Skip to content

fix: convert to ESM to support @actions/core v3#204

Merged
felickz merged 2 commits intodependabot/npm_and_yarn/main/production-dependencies-bbd9ea46c9from
copilot/sub-pr-198
Mar 6, 2026
Merged

fix: convert to ESM to support @actions/core v3#204
felickz merged 2 commits intodependabot/npm_and_yarn/main/production-dependencies-bbd9ea46c9from
copilot/sub-pr-198

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

@actions/core v3 is ESM-only (no CJS export), causing ncc to fail when bundling. This converts the project to ES Modules.

Changes

  • package.json: Add "type": "module"; update test script to node --experimental-vm-modules node_modules/.bin/jest
  • tsconfig.json: Switch module/moduleResolution to NodeNext for ESM output
  • src/main.ts, __tests__/main.test.ts: Add .js extensions to relative imports (NodeNext requirement)
  • jest.config.js: Convert to export default; add useESM: true, extensionsToTreatAsEsm: ['.ts'], and moduleNameMapper for .js.ts resolution
  • eslint.config.js: Convert require()/module.exportsimport/export default
  • dist/package.json (new): Add {"type": "module"} so Node.js treats the ncc bundle as ESM

ncc now produces ESM output:

ncc: Compiling file index.js into ESM

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
Copilot AI changed the title [WIP] Bump production dependencies group with two updates fix: convert to ESM to support @actions/core v3 Mar 6, 2026
@felickz felickz marked this pull request as ready for review March 6, 2026 22:42
Copy link
Copy Markdown
Contributor

@felickz felickz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:octocat: 👍

@felickz felickz merged commit b1abf8e into dependabot/npm_and_yarn/main/production-dependencies-bbd9ea46c9 Mar 6, 2026
3 checks passed
@felickz felickz deleted the copilot/sub-pr-198 branch March 6, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants