Commit 5b9508c
committed
fix: migrate to NodeNext ESM for @actions/core v3 compatibility
@actions/core v3 is ESM-only (no CJS bundle, exports-field only).
TypeScript's moduleResolution:node predates exports-field support and
cannot locate the package, breaking both tsc compilation and Jest.
Changes:
- tsconfig.json: module/moduleResolution NodeNext, exclude test files
- package.json: add "type":"module", bump devDeps already from Renovate
- jest.config.js: keep CJS mode for tests via ts-jest inline tsconfig
override (jest.mock hoisting unreliable in ESM mode with ts-jest v29)
- All source + test files: add .js extensions to relative imports
(required by NodeNext module resolution)
- git.ts: switch to named import { simpleGit } (default import not
callable under NodeNext)
- __mocks__/@actions/core.ts: manual mock so Jest bypasses ESM-only
package; moduleNameMapper redirects all test imports here
All 34 tests pass; tsc+ncc build produces dist/index.js cleanly.1 parent c8a0f4d commit 5b9508c
20 files changed
Lines changed: 41067 additions & 42034 deletions
File tree
- .github/actions/core
- __mocks__/@actions
- dist
- src
- git
- utils
- version
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments