New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support turborepo when using dependenciesMeta.*. injected (make injected deps re-sync) #6088
Comments
@simonihmig came up with a way to make this work over at: CrowdStrike/ember-headless-form#52 It requires this util: https://github.com/CrowdStrike/ember-headless-form/pull/52/files#diff-cba6a6cd1877ea907fa4d3c06bdd8548011bc52b603638c9e8334870e53aca39 which manually re-hard-links the dependencies. does it make sense for to add this util to pnpm? It would at least give us a quicker command than |
Doesn't it re-sync on |
@zkochan no, this doesn't work, just double checked. When I run a build that modifies some compiled output a package's
The hard-linked package resolvable for the other workspace that has this |
@zkochan it turns out that we can't use So, I would propose we add a I'll start a PR |
Confirm! I was running into exactly this when playing around, calling |
i really hope this feature release soon...:( |
yeah this would be very nice :) |
That would be a very nice feature, however I think it's more CI-related as it does not solve the problem in dev mode.
Dev server will just ignore built code of internal packages as it was not hardlinked during pnpm install. So we will need to run pnpm sync every time they changed. |
@nxmad it actually is exactly for solving the issue in dev mode! It would allow the file watcher of something like Vite or Turborepo or Turbopack to trigger a change notification for the hardlink when the dep changes. |
@NullVoxPopuli does "everything" also include re-syncing after a dependency was re-built in watch-mode? If so, please share what you have in mind! 😀 For me indeed dev mode is still an unsolved problem: I have to explicitly run the sync script mentioned above from inside of the app whenever That watch mode might actually be best implemented as part of the task runner, as it knows already the dependency graph:
|
Hello, I'm very much in favor of this issue. I suffered a lot from these problems, and I made a library as a temporary measure. https://github.com/gron1gh1/lopm Please refer to it if you need it, and I think it will be unnecessary if this issue is solved. |
Added a README to this project: https://github.com/NullVoxPopuli/pnpm-sync-dependencies-meta-injected |
你好,我已经收到你的邮件了。
|
This problem is not unique to turborebo. Even normal git operations will break the hard linking. For example, There's just a lot of possible things that can cause desynchronization. A watcher is necessary to really use per-file hard linking. |
你好,我已经收到你的邮件了。
|
idk how you feel about temporary tools to get around problems, or to assess DX, but https://github.com/NullVoxPopuli/pnpm-sync-dependencies-meta-injected has a watch mode, "start": "concurrently 'your dev command' 'pnpm _syncPnpm --watch'",
"_syncPnpm": "pnpm sync-dependencies-meta-injected" |
this looks to be a duplicate of #4407 |
你好,我已经收到你的邮件了。
|
I might be willing to implement if i know what the plan is.
Very similar to:
Related to:
dependenciesMeta.*.injected
, fix peer deps CrowdStrike/ember-headless-form#49Describe the user story
When using dependenciesMeta.*.injected, and turborepo, the built packages are not sync'd.
Describe the solution you'd like
I would like the dependencies to be sync'd when using dependenciesMeta.*. injected.
Describe the drawbacks of your solution
I can't think of any. Afaik, this is the most correct way to have dependencies?
Describe alternatives you've considered
I haven't thought of any
The text was updated successfully, but these errors were encountered: