Migrate to ESM with esbuild/vitest and upgrade to node24 (v5.0.0)#260
Open
davidgamero wants to merge 1 commit intoAzure:mainfrom
Open
Migrate to ESM with esbuild/vitest and upgrade to node24 (v5.0.0)#260davidgamero wants to merge 1 commit intoAzure:mainfrom
davidgamero wants to merge 1 commit intoAzure:mainfrom
Conversation
- Add "type": "module" to package.json for ESM support - Replace ncc with esbuild for bundling (with createRequire banner for CJS compat) - Replace jest/ts-jest with vitest for testing - Upgrade @actions/core to ^3.0.0, @actions/exec to ^3.0.0, @actions/io to ^3.0.2, @actions/tool-cache to 4.0.0 (ESM-only versions) - Update tsconfig.json to use NodeNext module resolution - Convert all tests to use vi.mock() factory pattern for ESM-only module compatibility - Update action.yml runtime from node20 to node24 - Bump version from 4.3.1 to 5.0.0 (major version bump for breaking node runtime change)
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.
Summary
"type": "module"to package.json, enabling native ES module support@vercel/nccwithesbuild(withcreateRequirebanner for CJS compatibility)jest/ts-jestwithvitest, usingvi.mock()factory pattern for ESM-only module compatibilitynode20tonode244.3.1→5.0.0(breaking change due to node runtime upgrade)Dependency Upgrades
@actions/core^2.0.2^3.0.0@actions/exec^2.0.0^3.0.0@actions/io^2.0.0^3.0.2@actions/tool-cache3.0.04.0.0Why
The
@actions/toolkitv3+ packages are ESM-only. Without this migration, Dependabot PRs that bump these packages fail withCannot find module '@actions/core'because jest/ncc cannot resolve ESM-only packages. This migration follows the same pattern used successfully in k8s-deploy and aks-set-context.Testing
tsc --noEmitnpm testandnpm run buildnow invoke vitest/esbuild)