You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(types): migrate test suite and config files to TypeScript (Phase 6) (#588)
* feat(types): migrate test suite and config files to TypeScript (Phase 6)
Rename all 114 test files and 2 helpers from .js to .ts, plus
vitest.config and commitlint.config. Add type annotations to fix
noImplicitAnyLet lint errors. Remove jsToTsResolver vite plugin
(no longer needed). Drop allowJs/checkJs from tsconfig.
* feat(types): migrate scripts and docs examples to TypeScript
Rename 16 scripts and 1 docs example from .js to .ts. Update all
invocations in package.json, CI workflows, and shell scripts to use
node --experimental-strip-types.
Remaining .js files (must stay JS):
- scripts/test.js, scripts/build-wasm.js (Node 20 bootstrap)
- 4 ESM loader hooks (bootstrap .ts support)
- scripts/gen-deps.cjs, src/index.cjs (CJS by design)
* feat(types): drop Node 20, require Node >= 22
- Bump engines.node from >=20 to >=22
- Remove Node 20 from CI test matrix
- Bump native build Node from 20 to 22
- Replace old JS ESM loader hooks with 2 TypeScript hooks
(ts-resolve-loader.ts + ts-resolve-hooks.ts) that resolve .js→.ts
import specifiers at runtime
- Remove canStripTypes helper and version guards from tests
- Update src/index.cjs to import('./index.ts') for dev; build step
produces dist/index.cjs with ./index.js for published package
- Simplify vitest.config.ts to use --experimental-strip-types only
- Update child-process test invocations to use --import loader flag
- Rewrite scripts/gen-deps.cjs as ESM TypeScript
- Rename scripts/build-wasm.js → .ts
Impact: 1 functions changed, 1 affected
* fix(ci): update embedding regression workflow to reference .ts test file (#588)
The test file was renamed from .js to .ts in the Phase 6 migration
but the CI workflow was not updated, causing test discovery to fail.
* fix: tighten Node engines to >=22.6, restore strip-types guard, use replaceAll (#588)
Impact: 1 functions changed, 0 affected
* fix(docs): use version-aware strip-types flag in pre-commit example (#588)
Detect Node version at runtime and select --strip-types (>=23) vs
--experimental-strip-types (22.x), matching the approach in vitest.config.ts.
* fix(types): add TypeScript parameter types to test helpers (#588)
Replace JSDoc-only annotations in fixtures.ts with proper TypeScript
interfaces and typed parameters. Add interfaces and typed parameters
to resolution-benchmark.test.ts helper functions. Eliminates all
noExplicitAny warnings in both files.
Impact: 22 functions changed, 0 affected
* fix(hooks): convert pre-commit-checks.ts from CJS require() to ESM imports (#588)
The file was renamed from .js to .ts but retained CommonJS require() calls.
Since the repo has "type": "module", Node loads .ts files as ESM under
--strip-types, where require is not defined. This caused a silent
ReferenceError swallowed by 2>/dev/null || true in pre-commit.sh,
making all pre-commit checks (cycles, dead exports, diff-impact)
non-functional.
Convert to ESM imports with createRequire for dynamic runtime requires.
Also update the file header comment to reference .ts instead of .js.
* fix(ci): add --import loader to benchmark workflow for Node 22 compatibility (#588)
Benchmark scripts import ./lib/bench-config.js and ./lib/fork-engine.js
but only .ts files exist on disk. Node 22's --experimental-strip-types
does not auto-resolve .js to .ts (that was added in Node 23+). Add
--import ./scripts/ts-resolve-loader.js to all four benchmark invocations
so the ESM loader resolves .js specifiers to their .ts counterparts.
* fix: version-aware strip-types flag in benchmark.yml, update docs (#588)
- Use dynamic STRIP_FLAG selection in all benchmark.yml node invocations
for forward compatibility with Node 23+ (--strip-types vs
--experimental-strip-types)
- Update token-benchmark.ts usage docs to include --import loader flag
- Update CLAUDE.md Node version from >= 20 to >= 22.6
* fix: remove unused .ts loader duplicates (#588)
ESM loader hooks must stay as .js files for bootstrap reasons. The .ts
duplicates were never referenced by any CI workflow or package script
and only created confusion about which version to use.
* Revert "fix: remove unused .ts loader duplicates (#588)"
This reverts commit 966ec3e.
* fix(ci): use version-aware strip-types flag in verify-imports step (#588)
* fix(ci): use dynamic strip-types flag in publish workflow (#588)
* fix: remove dead scripts/test.js (#588)
0 commit comments