-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Setup for monorepos with build steps (e.g. Typescript) no longer works with v10 and deploy #8975
Description
Last pnpm version that worked
9.15.4
pnpm version
10.0.0
Code to reproduce the issue
The steps for building a monorepo using deploy for versions <10 (as seen in the docs here) is:
pnpm installpnpm run --recursive buildpnpm deploy --filter=app1 --prod /prod/app1
Expected behavior
The install followed by build setup doesn't work with v10 anymore due to the requirement for inject-workspace-packages=true when using deploy. Because the build step happens after the install step, the built files don't show up in the previously installed dependencies.
For us this manifests in the build step failing because types from previously built packages are not available in later packages. This happens when using docker builds but also for general development (as updates to dependencies are no longer reflected). This means that, as far as I understand it, one of the following is required:
- Stop using deploy to avoid
inject-workspace-packages=true; - Add a postinstall step to all packages to build them and ensure they are reinstalled whenever the files change (which means having a watch step that reinstalls instead of for example just doing
tsc --watch); or - Change the
inject-workspace-packages=truesetting inside of the docker build but use linking instead of injecting by default.
Actual behavior
I'm not sure whether this is the intended behaviour or if I might be missing something. Currently we stopped trialing v10 until we find a solution. If this is the expected approach, then the only remediation here is to update the recipes section of the docs to ensure it works correctly with v10. If there are other solutions than why I noted above them it might be worth ensuring that's captured in the docs (and most likely in the changelog as well).
Additional information
No response
Node.js version
v23.6.0
Operating System
Linux