-
Notifications
You must be signed in to change notification settings - Fork 963
chore: use global virtual store #10587
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
base: master
Are you sure you want to change the base?
Changes from all commits
ab6ec29
7ab8372
187da47
82d9421
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -662,10 +662,21 @@ jobs: | |
| # tracked changes) — without it, a duplicate user-agent line lands on master every | ||
| # release and, being last in the file, overrides bit-repo-local for local installs too. | ||
| # the flag lives in .git/index, so it survives persist_to_workspace into later jobs. | ||
| # | ||
| # storeDir moves the store — and with it the global virtual store at <storeDir>/<version>/links, | ||
| # which every node_modules entry symlinks into — under the persist_to_workspace root, so the | ||
| # later jobs that only attach the workspace get resolvable symlinks. pnpm's default store | ||
| # lives in ~/.local/share/pnpm, outside that root. it has to go in pnpm-workspace.yaml: | ||
| # .npmrc only carries npm-compatible settings, and store-dir there is silently ignored by | ||
| # the config reader bit installs through (see scopes/dependencies/pnpm/read-config.ts). | ||
| # the repo has no committed pnpm-workspace.yaml; info/exclude keeps this CI-only one from | ||
| # being picked up by anything that stages untracked files. | ||
| command: > | ||
| cd bit && | ||
| echo "user-agent=bit-repo-circleci" >> .npmrc && | ||
| git update-index --skip-worktree .npmrc && | ||
| echo "storeDir: /home/circleci/bit/.pnpm-store" > pnpm-workspace.yaml && | ||
| echo "pnpm-workspace.yaml" >> .git/info/exclude && | ||
| bbit install | ||
| # `bbit install` compiles as part of the install, but that pass can fall back to the | ||
| # default TypeScript compiler for components whose env is still being imported - notably | ||
|
|
@@ -679,11 +690,24 @@ jobs: | |
| # - run: cd bit && ls -l node_modules/@babel | ||
| # - run: cd bit && ls -l node_modules/@babel/cli/bin | ||
| # - run: cd bit && ls -l node_modules/.bin | ||
| - run: | ||
| # a persist path that matches nothing is not an error, so without this check a store that | ||
| # landed outside the workspace root only shows up much later, as a MODULE_NOT_FOUND on a | ||
| # dangling node_modules symlink in whichever job runs first. | ||
| name: verify the global virtual store sits inside the persisted workspace | ||
| command: | | ||
| set -e | ||
| ls -d /home/circleci/bit/.pnpm-store/*/links | ||
| ls -l bit/node_modules/oxlint | ||
| test -e bit/node_modules/oxlint/bin/oxlint | ||
| - persist_to_workspace: | ||
| root: . | ||
| paths: | ||
| - bit | ||
| - .pnpm-store | ||
| # only the global virtual store, not the content-addressable files/ it hardlinks from: | ||
| # the consumers of this workspace read node_modules, they never fetch packages, and | ||
| # carrying files/ too would duplicate every package in the archive. | ||
| - .pnpm-store/*/links | ||
|
Comment on lines
+707
to
+710
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Persisted links path mismatch The CircleCI workspace persists .pnpm-store/*/links, but Bit resolves the global virtual store at <storeDir>/links; if the resolved storeDir is /home/circleci/bit/.pnpm-store (as configured), downstream jobs that only attach the workspace may miss the actual links directory and end up with broken node_modules symlinks. Agent Prompt
|
||
| - store_artifacts: | ||
| path: ~/Library/Caches/Bit/logs | ||
| - store_artifacts: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| "resolveEnvsFromRoots": true | ||
| }, | ||
| "teambit.dependencies/dependency-resolver": { | ||
| "enableGlobalVirtualStore": true, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Prune deletes pnpm internals With enableGlobalVirtualStore enabled, pnpm keeps pnpm-owned dot entries under node_modules/.pnpm, but pnpmPruneModules() does not exclude dot entries and will remove them when they don’t appear in the lockfile’s package list. This can break or destabilize subsequent installs by deleting pnpm-managed virtual-store state (or forcing it to be recreated unpredictably). Agent Prompt
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Schema missing gvs key workspace.jsonc now sets enableGlobalVirtualStore, but the repo’s workspace-jsonc-schema.json does not define this property under teambit.dependencies/dependency-resolver, so schema-driven validation/autocomplete cannot surface/validate the new config key. Agent Prompt
|
||
| "allowScripts": { | ||
| "@apollo/protobufjs": true, | ||
| "@parcel/watcher": true, | ||
|
|
||
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.
1. Hard-coded storedir path
🐞 Bug⚙ MaintainabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools