Skip to content

fix(langs): declare all language packages as explicit dependencies#760

Merged
jaywcjlove merged 2 commits intouiwjs:masterfrom
EurFelux:fix/langs-explicit-dependencies
Mar 2, 2026
Merged

fix(langs): declare all language packages as explicit dependencies#760
jaywcjlove merged 2 commits intouiwjs:masterfrom
EurFelux:fix/langs-explicit-dependencies

Conversation

@EurFelux
Copy link
Contributor

@EurFelux EurFelux commented Mar 2, 2026

Summary

  • gen-langs-map.cjs now auto-syncs package.json dependencies after generating src/index.ts, ensuring every imported package is explicitly declared
  • Moved @codemirror/language-data from dependencies to devDependencies and pinned to 6.5.2 (only used as gen script input, not at runtime)
  • Removed @codemirror/language-data from peerDependencies

Problem

The generated src/index.ts imports from 20+ @codemirror/lang-* and @codemirror/legacy-modes packages that were never declared in package.json. They only worked as phantom dependencies hoisted from @codemirror/language-data, which breaks under pnpm strict mode.

Fixes #754
Fixes #759

Note on src/index.ts diff

The regenerated src/index.ts includes minor content changes (e.g. jinja upgraded from legacy mode to @codemirror/lang-jinja, new xq/xqm/xqy extensions added) because the repo has no lockfile — npm install resolved @codemirror/language-data@6.5.2 while the previously committed output was generated from 6.5.1. This version has now been pinned to 6.5.2 in devDependencies to prevent future drift.

Test plan

  • Run npm run gen in extensions/langs/ and verify package.json dependencies are auto-updated
  • Verify all imports in src/index.ts have corresponding entries in package.json
  • Test with pnpm install --strict-peer-dependencies to confirm no phantom dependency issues

🤖 Generated with Claude Code

EurFelux and others added 2 commits March 2, 2026 17:54
The generated src/index.ts imports from 20+ @codemirror/lang-* and
@codemirror/legacy-modes packages that were never declared in
package.json. They only worked as phantom dependencies hoisted from
@codemirror/language-data, which breaks under pnpm strict mode.

- Enhance gen-langs-map.cjs to auto-sync package.json dependencies
  after generating the TypeScript file
- Move @codemirror/language-data to devDependencies (only needed
  as input for the gen script, not at runtime)
- Remove @codemirror/language-data from peerDependencies

Fixes uiwjs#759

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jaywcjlove jaywcjlove merged commit dddf539 into uiwjs:master Mar 2, 2026
1 check passed
github-actions bot pushed a commit that referenced this pull request Mar 2, 2026
…ncies (#760)

* fix(langs): declare all language packages as explicit dependencies

The generated src/index.ts imports from 20+ @codemirror/lang-* and
@codemirror/legacy-modes packages that were never declared in
package.json. They only worked as phantom dependencies hoisted from
@codemirror/language-data, which breaks under pnpm strict mode.

- Enhance gen-langs-map.cjs to auto-sync package.json dependencies
  after generating the TypeScript file
- Move @codemirror/language-data to devDependencies (only needed
  as input for the gen script, not at runtime)
- Remove @codemirror/language-data from peerDependencies

Fixes #759

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore(langs): pin @codemirror/language-data to 6.5.2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> dddf539
jaywcjlove added a commit that referenced this pull request Mar 2, 2026
github-actions bot pushed a commit that referenced this pull request Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Too many phantom dependencies in @uiw/codemirror-extensions-langs lang extension missing peer deps

2 participants