Expose syncInjectedDeps from @pnpm/workspace.injected-deps-syncer in pnpm CLI #10353
BartoszUrban
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to get
pnpm deployto work and for that I have setinjectWorkspacePackagesto true. Even though pnpm now hassyncInjectedDepsAfterScripts, some tooling like Nx (or turborepo #9837 ) does not work with this. For me Nx on an outdated version does not seem to callpnpm rununder the hood, therefore not usingsyncInjectedDepsAfterScripts, but even if it did, because Nx caches the output of build, it'd not rerun syncInjectedDeps on a cache hit.This is expected of course, and direct integration with Nx can solve this but to make this third-party integration easier, I'd like to propose for
syncInjectedDepsto be exposed as a pnpm CLI command, or a pnpm install flag to run only the sync, since running just syncInjectedDeps is much faster than rerunning install, even if all caches are in place.e.g.
pnpm install --filter @pkg/name --sync-injected-deps-only(following naming pattern of --resolution-only)I have solved this for myself right now, by importing
syncInjectedDepsfrom@pnpm/workspace.injected-deps-syncerand while it was simple, not needing to depend on a pnpm internal would be greatWhile I see solutions like https://www.npmjs.com/package/pnpm-sync-lib and https://www.npmjs.com/package/pnpm-sync-dependencies-meta-injected, I'd prefer to depend on pnpm itself, since it already handles it during install and after running scripts with pnpm run.
And here's the use case, in Nx (below is for Nx 17.3.1) by creating a custom graph plugin I could replace the node script with a pnpm command instead:
Beta Was this translation helpful? Give feedback.
All reactions