Commit 813ddb3
feat!: ESM only, Node 20+ (#311)
* feat!: ESM only, Node 20+\n\n- Migrate package to ESM-only (type: module, exports map)\n- Update engines to >=20.19.0 and .nvmrc to 20.19.0\n- TypeScript: NodeNext module with ES2022 target, verbatimModuleSyntax\n- Update internal imports to .js extensions for ESM\n- Switch tests from Ava to Vitest (TypeScript) with ava-compat shim\n- Add vitest.config.ts with .snapshots dir; port tests and skip flaky watch-mode\n- Remove Ava/NYC/Codecov and coverage tooling\n- Update CI workflows to Node 20.19.0 and use vitest run\n- Update README for new requirements and ESM usage\n- Rename config files to .cjs for ESM-compat (eslint/prettier/commitlint)\n
* chore(ci): add eslint devDependency so `pnpm lint:js` works in CI
* chore(eslint): configure NodeNext TS resolver; drop inline suppressions
test: remove unused 'compiler' assignments in skipped watch-mode tests
- Add eslint-import-resolver-typescript and resolver settings
- Remove per-line import/no-unresolved disables in src/{index,hooks}.ts
- Update watch-mode and import-update tests to not assign to undeclared 'compiler'
* ci(workflows): avoid duplicate runs on PR pushes; bump actions; move Windows to windows-2022\n\n- Limit push triggers to master; run PR workflows on pull_request only\n- Add concurrency with cancel-in-progress to dedupe per PR/branch\n- Checkout@v4 + fetch-depth: 0 for reliable origin/master refs\n- Setup-node@v4; Windows runner from 2019 -> 2022
* chore(eslint): configure NodeNext resolver; test(ts): allow TS extension imports via tsconfig.eslint
- ESLint: add typescript + node resolvers; remove per-line suppressions in src
- Style: use node: protocol for built-in modules in src
- Tests: declare watch-mode `compiler` handles and add teardown; keep tests skipped
- TS: move "allowImportingTsExtensions" to tsconfig.eslint.json (avoid build error)
- deps(dev): add eslint-import-resolver-typescript so import/no-unresolved resolves .js<->.ts under NodeNext
* Resolve rebase conflicts for ESLint resolver settings and lockfile (eslint-import-resolver-typescript ^4.4.4)
* chore(eslint): configure TypeScript resolver for NodeNext; remove inline import/no-unresolved disables\n\n- Add eslint-import-resolver-typescript and resolver settings to .eslintrc.cjs\n- Drop per-line import/no-unresolved suppressions in src/index.ts and src/hooks.ts\n\ntest: use .js import specifiers throughout and fix skipped watch tests\n\n- Switch tests to import emitted .js (NodeNext-friendly) instead of .ts\n- Remove assignments to undeclared 'compiler' in skipped watch tests\n\nBuild/lint/test all green locally
* chore(eslint): broaden node resolver extensions for ESM/CJS/TS variants\n\nstyle(node): use -prefixed core module specifiers in src/\n\nVerification: lint OK (0 errors, 1 warning); build OK; tests: 44 passed, 5 skipped
* fix: resolve rebase conflicts\n\n- Finalize ESLint resolver settings (NodeNext + TS, broad extensions)\n- Bump eslint-import-resolver-typescript to ^4.4.4; fix duplicate key\n- Normalize pnpm-lock.yaml to HEAD variants
* chore(eslint): include root JS configs in tsconfig.eslint.json (./*.{js,cjs,mjs})
* chore(lint): expand lint-staged to include TS; dedupe eslint --cache flag
- lint-staged: run eslint on *.{js,ts,tsx,cjs,mjs}
- scripts: remove duplicate --cache in lint:js
- lockfile: sync after install
* test(integration): save watcher handle to close in teardown; fix lints config
- import-update.ts/watch-mode.ts: assign result of watch(...) to compiler so test.after can close it
- package.json: de-dupe --cache; expand lint-staged to include TS/JS variants
- tsconfig.eslint.json: use explicit include globs for js/cjs/mjs (no brace expansion)
Verification: lint OK (0 errors, 1 warning); build OK; vitest: 44 passed, 5 skipped
# Conflicts:
# tsconfig.eslint.json
* docs(readme): remove CJS dynamic import note per Node 20.19.0 review
---------
Co-authored-by: CharlieHelps <charlie@charlielabs.ai>1 parent b87cabc commit 813ddb3
File tree
51 files changed
+2369
-2418
lines changed- .github/workflows
- src
- test
- helpers
- integration
- unit
- .snapshots
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
51 files changed
+2369
-2418
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | | - | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
19 | | - | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
27 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
28 | 38 | | |
29 | 39 | | |
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
33 | | - | |
| 43 | + | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | | - | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
17 | 25 | | |
18 | 26 | | |
19 | | - | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
26 | 36 | | |
27 | 37 | | |
28 | | - | |
| 38 | + | |
29 | 39 | | |
30 | 40 | | |
31 | 41 | | |
| |||
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
57 | | - | |
| 67 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | 1 | | |
6 | 2 | | |
7 | 3 | | |
8 | 4 | | |
9 | 5 | | |
10 | 6 | | |
11 | 7 | | |
12 | | - | |
13 | | - | |
14 | 8 | | |
15 | 9 | | |
16 | 10 | | |
| |||
24 | 18 | | |
25 | 19 | | |
26 | 20 | | |
27 | | - | |
| 21 | + | |
28 | 22 | | |
29 | 23 | | |
30 | 24 | | |
| |||
48 | 42 | | |
49 | 43 | | |
50 | 44 | | |
51 | | - | |
| 45 | + | |
52 | 46 | | |
53 | 47 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
64 | 55 | | |
65 | 56 | | |
66 | 57 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments