fix(vscode): remove @vscode/vsce from devDependencies to fix local build#2824
Conversation
The vsce package was causing ESM module resolution errors when building locally due to a dependency cycle between ansi-regex (ESM-only in v6) and strip-ansi (CommonJS) pulled in by @textlint/linter-formatter. CI already installs vsce globally before packaging, so this change aligns local builds with CI behavior. Developers should install vsce globally: npm install -g @vscode/vsce Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
📋 Review SummaryThis PR removes 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
The vsce package was causing ESM module resolution errors when building locally due to a dependency cycle between ansi-regex (ESM-only in v6) and strip-ansi (CommonJS) pulled in by @textlint/linter-formatter. CI already installs vsce globally before packaging, so this change aligns local builds with CI behavior. Developers should install vsce globally: npm install -g @vscode/vsce Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
TLDR
Removes
@vscode/vscefrom devDependencies to fix local build failures caused by ESM module resolution errors. This aligns local builds with CI behavior which installs vsce globally.Screenshots / Video Demo
N/A — no user-facing change (build system fix only)
Dive Deeper
Problem
When building the VSCode extension locally with
npm run packageinpackages/vscode-ide-companion, the build fails with:Root Cause
package.jsonhas an override forcingansi-regexto version 6.2.2 (ESM-only)@vscode/vscetransitively depends on@textlint/linter-formatter→strip-ansi@6.0.1(CommonJS)strip-ansi@6.0.1tries torequire()the ESM-onlyansi-regex@6.2.2, causing the errorWhy CI Works But Local Fails
CI installs
@vscode/vsceglobally (npm install -g @vscode/vsce), so its dependencies live in an isolated globalnode_moduleswithout the ansi-regex override. Locally, vsce was a devDependency, subjecting it to the override.Solution
Remove
@vscode/vscefrom devDependencies. Developers should install it globally:This matches the CI workflow and avoids the dependency conflict.
Reviewer Test Plan
npm install -g @vscode/vscecd packages/vscode-ide-companionnpm run package.vsixfile is created successfullyTesting Matrix
Linked issues / bugs
No linked issues
🤖 Generated with Qwen Code