fix(vscode): include all runtime deps in extension package#2910
fix(vscode): include all runtime deps in extension package#2910ckeller42 wants to merge 1 commit into
Conversation
|
@coderabbitai review |
🦋 Changeset detectedLatest commit: 71c4b55 The changes in this PR will be included in the next version bump. This PR includes changesets to release 21 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
cc3949d to
5dbe27d
Compare
✅ Actions performedReview triggered.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a changeset for Changes
Sequence Diagram(s)sequenceDiagram
participant Script as rect rgba(70,130,180,0.5) Script
participant Lockfile as rect rgba(34,139,34,0.5) pnpm-lock.yaml
participant FS as rect rgba(220,20,60,0.5) File System
Script->>FS: read package.json (declared production deps)
Script->>FS: read ../../pnpm-lock.yaml
Script->>Lockfile: extract packages/vscode -> dependencies block
loop for each declared dependency
Script->>Lockfile: lookup `<name>@*` entry (regex match)
alt found
Lockfile-->>Script: version string
Script->>Script: map to exact resolved value (apply esbuild rewrite if needed)
Script->>FS: log resolved dependency entry
else not found
Script->>Script: throw error and abort
end
end
Script->>FS: write updated package.json.dependencies (resolvedDeps)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e767bd73-b00c-4d9c-b001-4d487531167a
📒 Files selected for processing (2)
.changeset/fix-vscode-packaging-deps.mdpackages/vscode/scripts/package-vsix.mts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/vscode/scripts/package-vsix.mts (1)
11-14: Stale comment references old approach.The comment mentions
pnpm ls --jsonbut the actual implementation usespnpm why. Consider updating for accuracy.* - * Resolve actual versions via `pnpm ls --json` (includes all deps, - * not just those linked into node_modules) and build a clean + * Resolve actual versions via `pnpm why <pkg> --json` (finds deps + * anywhere in the dependency graph, even if hoisted) and build a clean * dependencies object for npm install.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/vscode/scripts/package-vsix.mts` around lines 11 - 14, Update the stale comment in the package-vsix.mts script that currently says "Resolve actual versions via `pnpm ls --json`" to reflect the actual implementation which uses `pnpm why`; locate the comment block near the top of the file (the description about resolving versions and building a dependencies object) and change the wording to mention `pnpm why` (or otherwise accurately describe the approach used) so the comment matches the code behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/vscode/scripts/package-vsix.mts`:
- Around line 11-14: Update the stale comment in the package-vsix.mts script
that currently says "Resolve actual versions via `pnpm ls --json`" to reflect
the actual implementation which uses `pnpm why`; locate the comment block near
the top of the file (the description about resolving versions and building a
dependencies object) and change the wording to mention `pnpm why` (or otherwise
accurately describe the approach used) so the comment matches the code behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b448899d-17aa-4a81-bb5b-44b69f3a2da6
📒 Files selected for processing (2)
.changeset/fix-vscode-packaging-deps.mdpackages/vscode/scripts/package-vsix.mts
✅ Files skipped from review due to trivial changes (1)
- .changeset/fix-vscode-packaging-deps.md
5dbe27d to
444513e
Compare
|
@coderabbitai review |
444513e to
bf8890b
Compare
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/vscode/scripts/package-vsix.mts (1)
53-53: Version-suffix stripping is greedy and may over-strip.
version.replace(/\(.*\)$/, '')uses a greedy.*, which is fine for a single trailing(...)group but would collapse nested/multiple groups incorrectly. pnpm versions can look like5.1.0(esbuild@0.27.4)(foo@1.2.3)— the greedy match correctly strips both here, but if a version ever contained a literal)followed by more text it would misbehave. Prefer a first-paren split for clarity and safety:- const version = versionMatch[1].replace(/\(.*\)$/, '') + const version = versionMatch[1].split('(')[0].trim()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/vscode/scripts/package-vsix.mts` at line 53, The current extraction for version using versionMatch[1].replace(/\(.*\)$/, '') uses a greedy regex that can over-strip; update the logic that sets the version (where version is derived from versionMatch[1]) to trim any suffix beginning with the first '(' instead (e.g., split on '(' and take the first segment, trim whitespace) so nested or unexpected parentheses won't remove unintended parts of the version string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/vscode/scripts/package-vsix.mts`:
- Line 53: The current extraction for version using
versionMatch[1].replace(/\(.*\)$/, '') uses a greedy regex that can over-strip;
update the logic that sets the version (where version is derived from
versionMatch[1]) to trim any suffix beginning with the first '(' instead (e.g.,
split on '(' and take the first segment, trim whitespace) so nested or
unexpected parentheses won't remove unintended parts of the version string.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e7c5bd71-c42b-401f-b4c3-87bfb9e3463d
📒 Files selected for processing (2)
.changeset/fix-vscode-packaging-deps.mdpackages/vscode/scripts/package-vsix.mts
✅ Files skipped from review due to trivial changes (1)
- .changeset/fix-vscode-packaging-deps.md
The package-vsix.mts script used `pnpm ls -P --json` to resolve production dependency versions, but pnpm doesn't list deps that are hoisted through devDependencies (bundle-require, esbuild). This caused the language server to fail with "Cannot find package 'bundle-require'" on v1.55.1. Switch to `pnpm why <pkg> --json` which finds packages anywhere in the dependency graph regardless of hoisting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bf8890b to
71c4b55
Compare
|
I've updated |
Summary
Fix VSCode extension language server crash on v1.55.1 — "Cannot find package 'bundle-require'".
Root Cause
The
package-vsix.mtsscript usedpnpm ls -P --jsonto discover production dependency versions. But pnpm doesn't list dependencies that are hoisted through devDependencies —bundle-requireandesbuildare declared inpackage.jsonbut resolved through@likec4/lsp(a devDep), sopnpm ls -Preturned only 2 of 4 declared deps.Before: VSIX included only
fdir,std-envAfter: VSIX includes
bundle-require,esbuild(as esbuild-wasm),fdir,load-tsconfig,std-envFix
Replace
pnpm ls -P --jsonwithpnpm why <pkg> --jsonfor each declared dependency.pnpm whyfinds packages anywhere in the dependency graph regardless of hoisting.Files changed
packages/vscode/scripts/package-vsix.mtspnpm whyinstead ofpnpm ls -Pfor version resolutionTest plan
pnpm package-vsixproduces VSIX with all 5 runtime deps in node_modules🤖 Generated with Claude Code