build(label-released-issues-v1): migrate to ESM + node:test#397
Open
Garbee wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the label-released-issues-v1 GitHub Action workspace to an ESM-based toolchain using node:test + tsx + esbuild, aligning it with the per-workspace migration pattern established in #360.
Changes:
- Convert the workspace to ESM (
"type": "module") and switch tests from mocha/chai/sinon tonode:testwith built-in coverage driven bynode.config.json. - Add an interim ESM-oriented
tsconfig.jsonoverride for this workspace (module/moduleResolution/noEmit/excludes). - Regenerate
dist/using esbuild (dropping priorncc-generated.d.tsartifacts) and refresh third-party license output.
Reviewed changes
Copilot reviewed 4 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/actions/label-released-issues-v1/package.json | Switches workspace to ESM and updates build/test/typecheck/lint scripts to the new toolchain. |
| .github/actions/label-released-issues-v1/node.config.json | Adds Node default config for tsx import, reporter, and coverage include/exclude + thresholds. |
| .github/actions/label-released-issues-v1/tsconfig.json | Adds workspace-local ESM/bundler TS settings (interim override) and excludes dist/. |
| .github/actions/label-released-issues-v1/src/run.test.ts | Rewrites tests to node:test + node:assert and replaces sinon-style stubbing with node:test mocks/module mocks. |
| .github/actions/label-released-issues-v1/dist/index.js | Regenerated bundled ESM artifact for GitHub Actions runtime. |
| .github/actions/label-released-issues-v1/dist/licenses.txt | Refreshed bundled third-party license summary output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The committed bundle was built with a stale/non-pinned esbuild and baked machine-absolute paths into module-annotation comments. Rebuilding with the repo's pinned esbuild emits repo-relative paths; the bundle is now byte-deterministic across builds.
- Use extensionless local type imports, matching the production code's specifiers (avoids duplicate module identities). - Drop the .ts extension from the mock.module specifiers so they match the extensionless paths run.ts imports. - The non-numeric project-number test now uses generateInputs to supply valid defaults and override only project-number, rather than returning '' for the other required inputs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Part of #361 — converting each buildable action workspace off the old toolchain (
ts-node+mocha+nyc+chai/sinon+ncc) ontonode:test+tsx+esbuild, so dependencies can be updated without the TS6/ts-node breakage. Follows the exemplar #360 (get-release-issue-v1).Approach
Migrate this one workspace, fully self-contained and green on its own. Coverage is no longer a separate step — the single
testscript always runs Node's built-in coverage and enforces the thresholds fromnode.config.json. The root toolchain stays CommonJS; this workspace gets an interimtsconfigoverride that is removed in the final flip PR.Changes (
label-released-issues-v1)package.json—"type": "module"; a singletestscript runningnode --experimental-default-config-file --experimental-test-module-mocks --experimental-test-coverage --test --test-force-exit 'src/**/*.test.ts';buildvia the sharednode ../../../scripts/build-action.mjs;typecheck: tsc --noEmit; removed thenycblock (thresholds moved tonode.config.json).node.config.json(new) —--experimental-default-config-filesource:import: ["tsx"],test-reporter: ["spec"], coverage includesrc/**/*.ts(excludingsrc/**/*.test.ts,src/index.ts), with the original 100 / 85 / 100 line / branch / function thresholds.tsconfig.json— interim ESM override (module: esnext,moduleResolution: bundler,allowImportingTsExtensions,noEmit) so this workspace is ESM while the repo root is still CommonJS. Removed in the final flip PR.run.test.ts) — rewritten tonode:test/node:assert/mock.module(replaces mocha/chai/sinon).dist/— regenerated as an ESM esbuild bundle; the ncc.d.tsartifacts are dropped anddist/licenses.txtis refreshed. (dist/**islinguist-generated, so it collapses in the diff.).github/workflows/tests.yml; that file is unchanged.Verification
Locally (node 24), this workspace only:
npm run typecheck -w label-released-issues-v1— greennpm run lint -w label-released-issues-v1— greennpm run test -w label-released-issues-v1— green (single command runsnode:testwith coverage; 100% lines / 85% branches / 100% functions enforced fromnode.config.json)npm run build -w label-released-issues-v1— green (esbuild ESMdist/index.js+ regenerateddist/licenses.txt)Closes: #380