2 years ago
Hey I'm working in a new pattern than usual which is a monorepo using npm workspaces
My build failed after i introduced a shared package and it says error TS2307: Cannot find module '@local/keylib' or its corresponding type declarations.
I am using the root directory config in railway. Does that throw out the code outside from workspace? This could be why it can't reference code from other workspaces. Any help?
9 Replies
2 years ago
you are absolutely correct, only the set directory is copied, for packages that share code or types you wouldn't want to set a root directory
Would watch path be affected in any way? I don't want useless unchanged deploys
2 years ago
they shouldn't
Aight I didn't think this through. Is this still possible
ROOT
- core-service
- Dockerfile
- keymanager-service
- Dockerfile
- shared-API-clients
- keyclient
- keyclient.tsI want to use the keyclient as my shared library
core-service and keymanager-service are seperate railway services
Will railway be able to support a monorepo structure like this or should i break it up
2 years ago
yeah seems fine to me, keep the root directory as the root and set the location to the dockerfiles via the service variable