-
Notifications
You must be signed in to change notification settings - Fork 63
Migrate to pnpm #818
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
Merged
Migrate to pnpm #818
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
a5d2595
Migrate to pnpm
NullVoxPopuli a7e4a79
Lockfile
NullVoxPopuli dfec2f1
Cleanup
NullVoxPopuli c3c1d00
Remove overrides
NullVoxPopuli 3d62eb2
Lockfile
NullVoxPopuli 49b80e5
Add missing dependencies
NullVoxPopuli 2dc7135
Dep changes, more upgrades
NullVoxPopuli d060934
Update deps
NullVoxPopuli cb47a12
A lot more successes
NullVoxPopuli 23b011a
Format
NullVoxPopuli 7b44bd3
Don't include node types in ember projects
NullVoxPopuli 5a237ff
Don't include node types in ember projects
NullVoxPopuli 43d96b4
Our test projects cannot use tsconfigs from the monorepo root, becaus…
NullVoxPopuli b1cb466
SNAPSHOT UPDATE -- review this carefully
NullVoxPopuli 673bc55
lint:fix
NullVoxPopuli 5fad6e7
Commit the generated-meta because it's easier
NullVoxPopuli fff0b36
Ensure everything is always comitted, and we don't get diffs in ci
NullVoxPopuli 6e343a0
Update CI
NullVoxPopuli 0247ba9
Specify types for the test-utils
NullVoxPopuli b4777ef
Resolve some peer dependency issues
NullVoxPopuli 9156858
Try to fix missing glint-monorepo-test-utils
NullVoxPopuli 1ffa77e
Lint:fix
NullVoxPopuli 4b290b1
Define __dirname since it doesn't exist in ESM
NullVoxPopuli c8dac80
Somehow esmoduleinterop got removed
NullVoxPopuli b4a0c8f
make a require
NullVoxPopuli c234ad7
Use require.resolve instead of hard-coded paths
NullVoxPopuli a84327f
No .js.js
NullVoxPopuli 3bf0f0a
Move types directly into their packages, do not share
NullVoxPopuli 913b360
Not sure if progress or not
NullVoxPopuli 64ae5bb
This is an improvement
NullVoxPopuli e9c236e
lint:fix
NullVoxPopuli e5a4915
Set injected on all consuming packages
NullVoxPopuli a0ce584
Done
NullVoxPopuli a6a3aa2
Simplify reset script
NullVoxPopuli 392f3bb
Update CONTRIBUTING
NullVoxPopuli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ | |
|
|
||
| dist/ | ||
| __fixtures__ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| node_modules | ||
| yarn-error.log | ||
| pnpm-debug.log | ||
| .eslintcache | ||
| *.tsbuildinfo | ||
| *.js.map | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| ignore-scripts=true | ||
|
|
||
|
|
||
| # Libraries should never have this enabled, | ||
| # else we can break consumers | ||
| auto-install-peers=false | ||
|
|
||
| ## Make sure we don't troll ourselves when updating deps | ||
| ## | ||
| verify-deps-before-run=true | ||
|
|
||
|
|
||
| ## If a dependency is not declared, we do not want to accidentally | ||
| ## resolve it from the workspace root. This is a common source of | ||
| ## bugs in monorepos. | ||
| ## | ||
| resolve-peers-from-workspace-root=false | ||
|
|
||
| ## We use so many similarly grouped peers, we want to make the | ||
| ## peer-groups easier to distinguish. | ||
| ## This forces a shorter sha for all groups (vs the default of 1000) | ||
| ## | ||
| peers-suffix-max-length=40 | ||
| virtual-store-dir-max-length=40 | ||
|
|
||
| # We don't want to inject *all* dependencies. | ||
| # only the ones that are peers. | ||
| inject-workspace-packages=false | ||
|
|
||
|
|
||
| ## This also means we do not want to hoist them to the root | ||
| ## As this would both expose them to all other packages AND | ||
| ## results in them using symlinks instead of hardlinks | ||
| ## | ||
| hoist-workspace-packages=false | ||
|
|
||
|
|
||
| ## We use the `workspace:*` protocol for all workspace | ||
| ## packages. | ||
| ## In theory it would be nice to use `deep` here just in case | ||
| ## we missed something so that we could tell pnpm to use the | ||
| ## workspace version of a package if it exists. At any depth. | ||
| ## | ||
| ## However, it seems that deep/true result in workspace packages | ||
| ## that are dependencies being symlinked instead of hardlinked | ||
| ## more often, even at the top-level of a package, which is not | ||
| ## what we want. | ||
| ## | ||
| link-workspace-packages=false # deep | ||
|
|
||
| ## Update injected dependencies when needed | ||
| ## This will rerun after various "build" scripts | ||
| ## In our published packages. | ||
| ## | ||
| ## Unfortunately, this does not run after scripts in | ||
| ## the monorepo root, so we have added a special "sync" | ||
| ## script to handle this. | ||
| ## | ||
| sync-injected-deps-after-scripts[]=build | ||
| sync-injected-deps-after-scripts[]=sync | ||
|
|
||
|
|
||
| ## In keeping with our "no hoisting" and "no auto-peers" and | ||
| ## "isolated dep trees", we also want to avoid other things | ||
| ## that lead to reliance on hoisting. | ||
| ## In general, deduping leads to hoisting. This particular | ||
| ## setting causes direct-dependencies to resolve from the | ||
| ## workspace root if already in root. We don't want this. | ||
| ## | ||
| dedupe-direct-deps=false | ||
|
|
||
| ## We do not want to dedupe peer dependencies as this | ||
| ## results in hoisting and violates optional peer isolation. | ||
| ## | ||
| dedupe-peer-dependents=false | ||
|
|
||
| ## We do not want to dedupe injected dependencies as this | ||
| ## results in hoisting and violates optional peer isolation. | ||
| ## | ||
| dedupe-injected-deps=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ | |
| /packages/*/lib | ||
| /test-packages/*/lib | ||
| dist/ | ||
| *.yaml | ||
| *.yml | ||
|
|
||
| # Hidden directories | ||
| .*/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a comment here in case some docs here might answer my question:
Don't have all the implications of peer deps and pnpm injected dependencies in my head, but I'm wondering what is the particular workflow when working on a workspace that uses injected deps? i.e. if I add or remove a file from one of the packages, what is the mechanism that add/removes that file from all of their referencing packages' node_moduies hard links? Is it a manual mechanism i need to periodically remember to run, or is it tied to some kind of watch script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a note to the CONTRIBUTING.md about sync, if needed.
the either
pnpm buildorpnpm syncwill update those hard links. This is configured in the.npmrc.Unfortunately, there is no ability to have syncing in a watch script built in. I made this https://github.com/NullVoxPopuli/pnpm-sync-dependencies-meta-injected, but I don't yet know if it works with pnpm 10, and probably needs some tweaks to read the .npmrc, etc.
For now, the hard-links are synced whenever:
pnpm buildpnpm sync(a no-op, just syncs)