Skip to content

chore: modernize toolchain (pnpm, TypeScript 6, Vitest, ESLint 9) - #259

Merged
joe-re merged 4 commits into
releasefrom
chore/modernize-toolchain
Sep 25, 2026
Merged

joe-re merged 4 commits into
releasefrom
chore/modernize-toolchain

Conversation

@joe-re

@joe-re joe-re commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Summary

First step of modernizing the toolchain (phases 1–2 of the maintenance plan). No runtime behavior change is intended.

Package manager / release

  • yarn v1 + Lerna → pnpm workspaces (pnpm-workspace.yaml, packageManager: pnpm@11)
  • Internal deps use the workspace:^ protocol (rewritten to ^x.y.z on publish — verified with pnpm pack)
  • Declare dependencies that previously resolved only through yarn hoisting (log4js in sqlint, vscode-languageserver-types / vscode-jsonrpc in server, etc.)
  • prepublish → prepublishOnly so dist is actually built on publish
  • Lerna versioning → changesets, with @joe-re/sql-parser / sqlint / sql-language-server in one fixed group

Tooling

  • Node >= 22.13 (.nvmrc, engines)
  • jest 26 / ts-jest → Vitest 5; test files are type-checked separately via pnpm typecheck
  • TypeScript 4.x → 6.0, moduleResolution: node16, target ES2022
  • ESLint 8 → ESLint 9 flat config, typescript-eslint 8, eslint-plugin-n, Prettier 3 (trailingComma: es5 kept to avoid reformatting)
  • esbuild 0.13 → 0.28, @types/node 14 → 22
  • CI: actions v4, Node 22/24 matrix, runs on push to release and on pull requests
  • Docker dev image: node:17 → node:22

Fixes found along the way

  • 10 FOREIGN KEY ... ON DELETE/UPDATE cases in sql-parser tests were describe blocks without it, so they never counted as tests. They are now real tests (parser: 58 → 68 tests).

Temporary pins (to be removed when DB drivers are upgraded)

  • pg ~8.10.0, @types/pg ~8.6.6, and a pg-protocol ~1.6.0 override

Test plan

  • pnpm npm:prepublish, lint, typecheck, vsc-compile:client, vsc-compile:server, all tests on Node 22 and Node 24
  • server: 119 passed / 3 skipped, parser: 68 passed, sqlint: 36 passed (same as baseline, plus the 10 fixed parser tests)
  • LSP initialize over stdio responds with both the esbuild CLI bundle and npm_bin/cli.js
  • sqlint --stdin reports lint errors as before
  • VS Code extension packaging with vsce is not verified yet under pnpm; do not publish the extension until the sqlite3 → node:sqlite migration lands

- Replace yarn workspaces / lerna with pnpm workspaces (Node >= 22)
- Use workspace: protocol for internal dependencies
- Declare dependencies that were only resolvable through yarn hoisting
- Rename prepublish hooks to prepublishOnly so dist is built on publish
- Manage releases of sql-parser / sqlint / server with changesets (fixed group)
- Bump @types/node to 22 and esbuild to 0.28
- Pin pg / pg-protocol to previously locked versions until TypeScript is upgraded
- Update CI to actions v4 with Node 22/24 matrix, and Docker image to node:22
- Run tests with Vitest 5 (globals mode) instead of jest 26 / ts-jest
- Remove jest from sql-language-server runtime dependencies
- Fix FOREIGN KEY ON option cases in sql-parser tests that ran as describe
  bodies without it(), so they were never reported as tests
- Upgrade TypeScript to 6.0 and @types/node to 22.x
- Replace deprecated baseUrl / moduleResolution=node with node16 resolution
  and target ES2022
- Declare types: ["node"] explicitly since TypeScript 6 no longer loads all
  @types packages by default
- Type-check tests with tsc (pnpm typecheck), which ts-jest used to do
- Require Node >= 22.13 (needed by Vitest 5 and unflagged node:sqlite)
- Replace .eslintrc.js / .eslintignore with eslint.config.mjs
- typescript-eslint 5 -> 8, eslint-plugin-node -> eslint-plugin-n
- Prettier 2 -> 3, keeping trailingComma "es5" to avoid reformatting
- Disable n/no-missing-import for TypeScript files; tsc already reports
  unresolved imports and the plugin cannot resolve directory imports
- Rename no-var-requires disable comments to no-require-imports
@joe-re
joe-re merged commit 2a7fe46 into release Sep 25, 2026
2 checks passed
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.

1 participant