Skip to content

Commit 5b9508c

Browse files
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
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { jest } from '@jest/globals';
2+
3+
export const getInput = jest.fn();
4+
export const setOutput = jest.fn();
5+
export const setFailed = jest.fn();
6+
export const info = jest.fn();
7+
export const debug = jest.fn();
8+
export const error = jest.fn();
9+
export const warning = jest.fn();
10+
export const summary = {
11+
addRaw: jest.fn().mockReturnThis(),
12+
addDetails: jest.fn().mockReturnThis(),
13+
write: jest.fn().mockResolvedValue(undefined),
14+
};

0 commit comments

Comments
 (0)