Skip to content

Migrate to ESM and upgrade dependencies#1574

Merged
HarithaVattikuti merged 6 commits into
actions:mainfrom
gowridurgad:esm-migration-node
Jul 14, 2026
Merged

Migrate to ESM and upgrade dependencies#1574
HarithaVattikuti merged 6 commits into
actions:mainfrom
gowridurgad:esm-migration-node

Conversation

@gowridurgad

Copy link
Copy Markdown
Contributor

Description:
Migrates setup-node from CommonJS to ECMAScript Modules (ESM)

Related issue:
Add link to the related issue.

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@gowridurgad gowridurgad requested a review from a team as a code owner June 26, 2026 08:33
Copilot AI review requested due to automatic review settings June 26, 2026 08:33

Copilot AI left a comment

Copy link
Copy Markdown

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 migrates the setup-node codebase and tooling from CommonJS to ESM, aligning runtime behavior (NodeNext resolution + import.meta.url) with updated dependencies and ESM-compatible lint/test configuration.

Changes:

  • Switch TypeScript compilation to module: NodeNext and update internal relative imports to include .js extensions.
  • Migrate Jest and ESLint configuration to ESM-friendly setups (flat ESLint config + TS Jest config + ESM mocking patterns).
  • Upgrade Actions/toolkit and related dependencies, and refresh licensed metadata accordingly.

Reviewed changes

Copilot reviewed 73 out of 85 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.json Switch TS module output to NodeNext and exclude jest config from compilation.
src/util.ts Update catch clause style while keeping behavior unchanged.
src/setup-node.ts Update entrypoint import to ESM-friendly .js specifier.
src/main.ts Convert internal imports to .js and replace __dirname usage with import.meta.url resolution.
src/distributions/v8-canary/canary_builds.ts Update internal imports to .js specifiers.
src/distributions/rc/rc_builds.ts Update internal imports to .js specifiers.
src/distributions/official_builds/official_builds.ts Update internal imports to .js specifiers.
src/distributions/nightly/nightly_builds.ts Update internal imports to .js specifiers.
src/distributions/installer-factory.ts Update internal imports to .js specifiers.
src/distributions/base-distribution.ts Update imports for ESM and replace __dirname usage with import.meta.url resolution.
src/distributions/base-distribution-prerelease.ts Update internal imports to .js specifiers.
src/cache-utils.ts Update internal import to .js and fix async command output usage (await).
src/cache-save.ts Update internal imports to .js specifiers.
src/cache-restore.ts Update internal imports to .js specifiers.
package.json Mark package as ESM, update scripts, and upgrade dependencies/tooling.
jest.config.ts Add ESM-compatible Jest configuration using ts-jest with useESM.
jest.config.js Remove legacy CommonJS Jest configuration.
eslint.config.mjs Add flat ESLint config in ESM format.
dist/setup/package.json Add package boundary metadata for the bundled setup entrypoint.
dist/cache-save/package.json Add package boundary metadata for the bundled post-action entrypoint.
.prettierrc.json Add Prettier configuration in JSON format.
.prettierrc.js Remove legacy CommonJS Prettier configuration.
.licensed.yml Update allowed/reviewed licenses and normalize indentation for reviewed packages.
.eslintrc.js Remove legacy ESLint config (replaced by flat config).
.eslintignore Remove legacy ignore file (handled via flat config ignores).
tests/rc-installer.test.ts Update tests for ESM execution + ESM-safe mocking/import patterns.
tests/problem-matcher.test.ts Update tests to use ESM JSON import attributes and Jest globals.
tests/official-installer.test.ts Update tests for ESM execution + ESM-safe mocking/import patterns.
tests/nightly-installer.test.ts Update tests for ESM execution + ESM-safe mocking/import patterns.
tests/mock/glob-mock.test.ts Update internal test import to .js specifier and Jest globals.
tests/main.test.ts Update tests for ESM execution + ESM-safe mocking/import patterns.
tests/canary-installer.test.ts Update tests for ESM execution + ESM-safe mocking/import patterns.
tests/cache-utils.test.ts Update tests to mock @actions/exec.getExecOutput and align with async command execution.
tests/cache-save.test.ts Update tests for ESM execution + ESM-safe mocking/import patterns.
tests/cache-restore.test.ts Update tests for ESM execution + ESM-safe mocking/import patterns.
tests/authutil.test.ts Update tests for ESM execution + ESM-safe mocking/import patterns.
.licenses/npm/xml-naming.dep.yml Normalize license metadata formatting (homepage field).
.licenses/npm/wrappy.dep.yml Remove license metadata entry (dependency resolution changed).
.licenses/npm/universal-user-agent.dep.yml Update license metadata to match upgraded dependency version/content.
.licenses/npm/strnum.dep.yml Update license metadata formatting/version alignment.
.licenses/npm/semver.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/semver-6.3.1.dep.yml Remove old semver v6 license metadata entry.
.licenses/npm/once.dep.yml Remove license metadata entry (dependency resolution changed).
.licenses/npm/minimatch-3.1.5.dep.yml Add license metadata for additional minimatch version present in resolution.
.licenses/npm/minimatch-10.2.5.dep.yml Add license metadata for upgraded minimatch version present in resolution.
.licenses/npm/json-with-bigint.dep.yml Update license metadata to match dependency name/version/copyright.
.licenses/npm/fast-xml-parser.dep.yml Update license metadata formatting/version alignment.
.licenses/npm/fast-content-type-parse.dep.yml Update license metadata to match new dependency and reviewed status.
.licenses/npm/deprecation.dep.yml Remove license metadata entry (dependency resolution changed).
.licenses/npm/brace-expansion-5.0.6.dep.yml Update license metadata to match resolved dependency content.
.licenses/npm/brace-expansion-1.1.13.dep.yml Add license metadata for additional brace-expansion version present in resolution.
.licenses/npm/before-after-hook.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/balanced-match-4.0.4.dep.yml Add license metadata for additional balanced-match version present in resolution.
.licenses/npm/balanced-match-1.0.2.dep.yml Add license metadata for additional balanced-match version present in resolution.
.licenses/npm/@typespec/ts-http-runtime.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@octokit/types.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@octokit/types-13.10.0.dep.yml Remove old @octokit/types license metadata entry.
.licenses/npm/@octokit/request.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@octokit/request-error.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@octokit/plugin-rest-endpoint-methods.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@octokit/plugin-paginate-rest.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@octokit/openapi-types.dep.yml Update license metadata to match upgraded dependency version/content.
.licenses/npm/@octokit/graphql.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@octokit/endpoint.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@octokit/core.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@octokit/auth-token.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@nodable/entities.dep.yml Update license metadata formatting/version alignment.
.licenses/npm/@azure/storage-common.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@azure/storage-blob.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@azure/core-xml.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@azure/core-rest-pipeline.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@azure/core-http-compat.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@azure/abort-controller.dep.yml Add license metadata for newly present dependency in resolution.
.licenses/npm/@actions/tool-cache.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@actions/io.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@actions/http-client-4.0.1.dep.yml Update license metadata to match upgraded dependency version/content.
.licenses/npm/@actions/glob-0.7.0.dep.yml Update license metadata to match upgraded dependency version/content.
.licenses/npm/@actions/glob-0.6.1.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@actions/github.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@actions/exec.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@actions/core.dep.yml Update license metadata to match upgraded dependency version.
.licenses/npm/@actions/cache.dep.yml Update license metadata to match upgraded dependency version.

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

Comment thread package.json Outdated
@gowridurgad gowridurgad self-assigned this Jul 6, 2026
@gowridurgad gowridurgad force-pushed the esm-migration-node branch from 01bf383 to 0b42139 Compare July 8, 2026 15:32
priyagupta108
priyagupta108 previously approved these changes Jul 9, 2026
@HarithaVattikuti HarithaVattikuti merged commit 8207627 into actions:main Jul 14, 2026
231 checks passed
ajgon pushed a commit to deedee-ops/schemas that referenced this pull request Jul 14, 2026
#11)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/setup-node](https://github.com/actions/setup-node) | action | major | `v6.4.0` → `v7.0.0` |

---

### Release Notes

<details>
<summary>actions/setup-node (actions/setup-node)</summary>

### [`v7.0.0`](https://github.com/actions/setup-node/releases/tag/v7.0.0)

[Compare Source](actions/setup-node@v6.5.0...v7.0.0)

#### What's Changed

##### Enhancements:

- Add cache-primary-key and cache-matched-key as outputs by [@&#8203;gowridurgad](https://github.com/gowridurgad) in [#&#8203;1577](actions/setup-node#1577)
- Migrate to ESM and upgrade dependencies by [@&#8203;gowridurgad](https://github.com/gowridurgad) in [#&#8203;1574](actions/setup-node#1574)

##### Bug fixes:

- Remove dummy NODE\_AUTH\_TOKEN export by [@&#8203;gowridurgad](https://github.com/gowridurgad) in [#&#8203;1558](actions/setup-node#1558)
- Only use `mirrorToken` in `getManifest` if it's provided by [@&#8203;deiga](https://github.com/deiga) in [#&#8203;1548](actions/setup-node#1548)

##### Documentation updates:

- Add documentation for publishing to npm with Trusted Publisher (OIDC) by [@&#8203;chiranjib-swain](https://github.com/chiranjib-swain) in [#&#8203;1536](actions/setup-node#1536)
- docs: Update restore-only cache documentation by [@&#8203;priya-kinthali](https://github.com/priya-kinthali) in [#&#8203;1550](actions/setup-node#1550)
- docs: Update caching recommendations to mitigate cache poisoning risks by [@&#8203;chiranjib-swain](https://github.com/chiranjib-swain) in [#&#8203;1567](actions/setup-node#1567)

##### Dependency update:

- Upgrade [@&#8203;actions/cache](https://github.com/actions/cache) to 5.1.0, log cache write denied by [@&#8203;jasongin](https://github.com/jasongin) in [#&#8203;1569](actions/setup-node#1569)

#### New Contributors

- [@&#8203;chiranjib-swain](https://github.com/chiranjib-swain) made their first contribution in [#&#8203;1536](actions/setup-node#1536)
- [@&#8203;deiga](https://github.com/deiga) made their first contribution in [#&#8203;1548](actions/setup-node#1548)
- [@&#8203;jasongin](https://github.com/jasongin) made their first contribution in [#&#8203;1569](actions/setup-node#1569)

**Full Changelog**: <actions/setup-node@v6...v7.0.0>

### [`v6.5.0`](https://github.com/actions/setup-node/releases/tag/v6.5.0)

[Compare Source](actions/setup-node@v6.4.0...v6.5.0)

#### What's Changed

- Update [@&#8203;actions/cache](https://github.com/actions/cache) to 5.1.0 and add security overrides for undici and fast-xml-parser by [@&#8203;HarithaVattikuti](https://github.com/HarithaVattikuti) in [#&#8203;1579](actions/setup-node#1579)

**Full Changelog**: <actions/setup-node@v6.4.0...v6.5.0>

</details>

---

### Configuration

📅 **Schedule**: (in timezone Europe/Warsaw)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjEuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI2MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Reviewed-on: https://git.ajgon.casa/deedee/schemas/pulls/11
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.

5 participants