Commit 40667d5
build: convert to ESM and take @actions/core 3 and @actions/github 9
The CJS bundle could not resolve @actions/core 3.x or @actions/github 9.x, both of
which are ESM-only. Converting the project to ESM unblocks both majors.
- package.json gains "type": "module". Relative imports now carry the explicit .js
extensions NodeNext requires; tsc rejects the build without them.
- Bundling moves from @vercel/ncc to esbuild. ncc has no ESM output mode, as its
--target flag sets the language target rather than the module format.
- The bundle banner injects createRequire. Bundled CommonJS dependencies lazily
require() Node built-ins, which esbuild rewrites to a shim that throws in ESM
scope unless a require binding exists in module scope.
- ncc type-checked as a side effect of bundling and esbuild does not, so an
explicit typecheck script (tsc --noEmit) replaces it and runs in CI.
- dist/licenses.txt and dist/sourcemap-register.js were ncc-specific artifacts and
are removed. A process.setSourceMapsEnabled(true) banner replaces the latter.
- eslint-plugin-import cannot follow NodeNext's .js to .ts mapping, so
import/no-unresolved is disabled in favour of the typecheck script.
- commitlint.config.js becomes .cjs, as its module.exports would throw once the
nearest package.json declares type: module.
The undici override is retained, as no @actions/* release reaches undici 7 alone.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 476e670 commit 40667d5
21 files changed
Lines changed: 27168 additions & 42825 deletions
File tree
- .github
- workflows
- dist
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
0 commit comments