Skip to content

Update npm dependencies and fix breaking API changes - #40

Merged
AnHeuermann merged 8 commits into
OpenModelica:mainfrom
AnHeuermann:update
Jun 5, 2026
Merged

AnHeuermann merged 8 commits into
OpenModelica:mainfrom
AnHeuermann:update

Conversation

@AnHeuermann

@AnHeuermann AnHeuermann commented Jun 4, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Bump all npm packages to latest versions: TypeScript 5→6, ESLint 8→10, mocha 10→11, web-tree-sitter 0.20→0.26, vscode-languageclient 8→9, esbuild 0.20→0.28, @types/node 20→25, and others
  • Update CI to Node.js 24 LTS

Breaking changes fixed

web-tree-sitter v0.26 API changes:

  • Rename SyntaxNode→Node, add named imports for Tree, Language, Edit, Point throughout the codebase
  • Use new Edit class constructor for tree.edit() calls
  • Replace callback-based incremental parse with byte-index approach to correctly handle newlines
  • Update tree-sitter-modelica.wasm to v0.2.2 (dylink.0 format required by v0.26 runtime)

esbuild bundling fix:

  • Alias web-tree-sitter to its CJS build in esbuild.config.js; the ESM build uses import.meta.url which esbuild shims as undefined in CJS output, causing createRequire(undefined) to throw at startup

ESLint 9+ flat config migration:

  • Replace .eslintrc.js + .eslintignore with eslint.config.js using the new flat config format
  • Install @eslint/js and globals packages

Mocha v11 + Node.js 24 test runner fix:

  • Node.js 24 has native TypeScript strip support (process.features.typescript === 'strip'), which causes mocha to bypass ts-node/register for .ts files
  • Switch from ts-node/register to tsx/cjs as the mocha require hook

TypeScript 6 fixes:

  • Add ignoreDeprecations: "6.0" for moduleResolution: node deprecation
  • Add skipLibCheck: true and update lib/target to es2022
  • Fix lint issues surfaced by stricter rules (no-redeclare, unused expressions, comma-expressions)

Other fixes:

  • Remove unused native tree-sitter addon (only web-tree-sitter is used at runtime)
  • Replace @nodelib/fs.walk with fs.readdir({ recursive: true, withFileTypes: true })

Test plan

  • npm run lint — clean
  • npm run esbuild — builds successfully, no import_meta references in bundle
  • npm run test:server — 20/20 unit tests pass
  • npm run test:e2e — 3/3 integration tests pass (requires display / WSLg)
  • CI passes on ubuntu-latest with Xvfb

- Bump all npm packages to latest versions: TypeScript 5→6, ESLint
  8→10, mocha 10→11, web-tree-sitter 0.20→0.26, vscode-languageclient
  8→9, esbuild 0.20→0.28, @types/node 20→25, and others
- Update softprops/action-gh-release from v2 to v3

web-tree-sitter v0.26 API changes:
- Rename SyntaxNode→Node, add named imports for Tree, Language, Edit,
  Point throughout the codebase
- Use new Edit class constructor for tree.edit() calls
- Replace callback-based incremental parse with byte-index approach to
  correctly handle newlines
- Update tree-sitter-modelica.wasm to v0.2.2 (dylink.0 format required
  by v0.26 runtime)

esbuild bundling fix:
- Alias web-tree-sitter to its CJS build in esbuild config; the ESM
  build uses import.meta.url which esbuild shims as undefined, causing
  the server to fail at startup

Other fixes:
- Remove unused native tree-sitter dependency (only web-tree-sitter
  is used)
- Replace @nodelib/fs.walk with fs.readdir({recursive:true})
- Switch test runner from ts-node/register to tsx/cjs for mocha v11
  compatibility with Node.js 24 native TypeScript support
- Migrate ESLint config from .eslintrc.js to flat eslint.config.js
- Fix stale no-redeclare, unused expressions, and comma-expression
  lint issues surfaced by ESLint 10
- Add skipLibCheck and es2022 lib/target to tsconfig files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AnHeuermann and others added 3 commits June 5, 2026 13:05
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AnHeuermann AnHeuermann added the dependencies Pull requests that update a dependency file label Jun 5, 2026
AnHeuermann and others added 2 commits June 5, 2026 13:18
- Alias web-tree-sitter to its CJS build (same fix as root esbuild.config.js)
- Fix WASM filename: tree-sitter.wasm → web-tree-sitter.wasm (v0.26 name)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add overrides to force patched transitive deps pulled in by mocha:
- diff >=9.0.0 (was 7.0.0, GHSA-73rr-hh4g-fpgx DoS)
- serialize-javascript >=7.0.5 (was 6.0.2, GHSA-5c6j-r48x-rmvq RCE / GHSA-qj8w-gfj5-8c6v DoS)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AnHeuermann
AnHeuermann marked this pull request as ready for review June 5, 2026 11:23
AnHeuermann and others added 2 commits June 5, 2026 13:31
Replaces deprecated "moduleResolution": "node" (and removes
ignoreDeprecations: "6.0") with the modern Node16 mode. No import
paths required updating.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AnHeuermann
AnHeuermann merged commit d8d641b into OpenModelica:main Jun 5, 2026
3 checks passed
@AnHeuermann
AnHeuermann deleted the update branch June 5, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant