Skip to content

Modernize ESM build and test workflow#107

Merged
j178 merged 2 commits intomainfrom
deps
Mar 17, 2026
Merged

Modernize ESM build and test workflow#107
j178 merged 2 commits intomainfrom
deps

Conversation

@j178
Copy link
Copy Markdown
Owner

@j178 j178 commented Mar 17, 2026

Summary

  • upgrade the GitHub Actions toolkit dependencies and switch the action bundle to ESM-compatible outputs built with esbuild
  • replace the old node test runner flow with Jest plus ts-jest and simplify the module mocks
  • update docs and workflows to use the new bundle path and checked-in dist outputs

Verification

  • npm run build
  • npm run test
  • npm run bundle

Copilot AI review requested due to automatic review settings March 17, 2026 11:37
@j178 j178 added the internal label Mar 17, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the action’s TypeScript/module setup and CI developer workflow by moving to an ESM-oriented project configuration, bundling with esbuild, and migrating unit tests from node:test to Jest + ts-jest.

Changes:

  • Switch TypeScript config to ESM (module: esnext, moduleResolution: bundler) and mark the package as "type": "module".
  • Replace the previous test build + Node test runner with Jest + ts-jest, updating mocks to use jest.unstable_mockModule.
  • Replace ncc bundling with an esbuild-based bundler that emits dist/index.cjs and dist/post/index.cjs, and update the action entrypoints accordingly.

Reviewed changes

Copilot reviewed 10 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tsconfig.test.json Removed old test compilation config (no longer compiling tests to .test-build).
tsconfig.json Updated TS module settings for ESM-oriented typechecking.
test/prek.test.ts Migrated to Jest + ESM module mocking.
test/manifest.test.ts Migrated to Jest + ESM module mocking; refactored imports/reset behavior.
test/install.test.ts Migrated assertions from assert to Jest expect.
test/cache.test.ts Migrated to Jest + ESM module mocking; simplified mock setup.
scripts/build-dist.mjs Added esbuild-based bundling script producing .cjs outputs.
package.json Switched to ESM package, updated deps, and replaced build/test/bundle scripts.
jest.config.mjs Added ts-jest ESM preset configuration for running TS tests directly.
action.yaml Updated action entrypoints to dist/index.cjs and dist/post/index.cjs.
CONTRIBUTING.md Updated contributor docs to reflect new Jest-based test flow and dist bundling guidance (but filenames need follow-up).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CONTRIBUTING.md Outdated
Comment thread scripts/build-dist.mjs Outdated
Comment thread action.yaml
@j178 j178 merged commit d75b145 into main Mar 17, 2026
9 checks passed
@j178 j178 deleted the deps branch March 17, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants