Skip to content

Migrate to ESM and upgrade dependencies#1330

Open
priyagupta108 wants to merge 1 commit into
actions:mainfrom
priyagupta108:esm-migration-and-deps-upgrade
Open

Migrate to ESM and upgrade dependencies#1330
priyagupta108 wants to merge 1 commit into
actions:mainfrom
priyagupta108:esm-migration-and-deps-upgrade

Conversation

@priyagupta108

Copy link
Copy Markdown
Contributor

Description:
Describe your changes.

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.

@priyagupta108 priyagupta108 requested a review from a team as a code owner June 26, 2026 05:50
Copilot AI review requested due to automatic review settings June 26, 2026 05:50
@priyagupta108 priyagupta108 self-assigned this Jun 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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-python GitHub Action codebase to ESM (TypeScript NodeNext + package "type": "module") while upgrading core runtime/tooling dependencies, and updating Jest/ESLint/Prettier configuration to align with the new module system.

Changes:

  • Switch TypeScript compilation to module: NodeNext and update internal imports to explicit .js specifiers for ESM compatibility.
  • Upgrade @actions/*, Jest, ESLint, TypeScript, and related tooling; migrate ESLint to flat config and Jest to an ESM-compatible TS config.
  • Update tests to ESM patterns (top-level await, jest.unstable_mockModule) and refresh dependency license metadata.

Reviewed changes

Copilot reviewed 55 out of 66 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tsconfig.json Switch TS output module kind to NodeNext and exclude ESM Jest config from build compilation.
tsconfig.eslint.json Add a dedicated TS config for ESLint/IDE usage with broader includes.
src/utils.ts Add explicit string[] typings to avoid implicit any[] under strict mode.
src/setup-python.ts Update relative imports to .js, add ESM-compatible __dirname replacement, and adjust a catch clause.
src/install-python.ts Update utils import to .js and modernize ExecOptions type import.
src/install-pypy.ts Update utils import to .js for ESM.
src/install-graalpy.ts Update utils import to .js for ESM.
src/find-python.ts Update local imports to .js for ESM.
src/find-pypy.ts Update local imports to .js for ESM.
src/find-graalpy.ts Update local imports to .js for ESM.
src/cache-save.ts Update cache-distributor import to .js for ESM.
src/cache-distributions/poetry-cache.ts Update relative imports to .js for ESM.
src/cache-distributions/pipenv-cache.ts Update relative imports to .js for ESM.
src/cache-distributions/pip-cache.ts Update relative imports to .js for ESM.
src/cache-distributions/cache-factory.ts Update relative imports to .js for ESM.
src/cache-distributions/cache-distributor.ts Update relative imports to .js for ESM.
package.json Declare ESM package type, update scripts for flat ESLint/Jest ESM, and upgrade dependencies/devDependencies.
jest.config.ts Add Jest TS config for ESM + ts-jest (useESM) and .js-specifier mapping.
jest.config.js Remove legacy CommonJS Jest config.
eslint.config.mjs Add ESLint flat config (TS + Jest + Node rules + Prettier).
dist/setup/package.json Mark the bundled action entrypoint directory as ESM.
dist/cache-save/package.json Mark the bundled post-action entrypoint directory as ESM.
.prettierrc.json Add JSON-based Prettier config (replacing JS config).
.prettierrc.js Remove legacy JS-based Prettier config.
.licensed.yml Add newly-introduced transitive deps to the reviewed allowlist.
.eslintrc.js Remove legacy ESLint config (replaced by flat config).
.eslintignore Remove legacy ignore file (handled by flat config ignores).
tests/utils.test.ts Convert tests to ESM-style module mocking and dynamic imports.
tests/install-python.test.ts Convert tests to ESM-style module mocking and dynamic imports.
tests/install-pypy.test.ts Convert tests to ESM-style module mocking/dynamic imports and JSON import assertions.
tests/install-graalpy.test.ts Convert tests to ESM-style module mocking/dynamic imports and JSON import assertions.
tests/finder.test.ts Convert tests to ESM-style module mocking/dynamic imports and adjust mocking strategy.
tests/find-python.test.ts Update imports to .js for ESM.
tests/find-pypy.test.ts Convert tests to ESM-style module mocking/dynamic imports and JSON import assertions.
tests/find-graalpy.test.ts Convert tests to ESM-style module mocking/dynamic imports and JSON import assertions.
tests/cache-save.test.ts Convert tests to ESM-style module mocking/dynamic imports.
tests/cache-restore.test.ts Convert tests to ESM-style module mocking/dynamic imports and async restore result handling.
.licenses/npm/semver.dep.yml Update semver license metadata to v7.8.5.
.licenses/npm/semver-6.3.1.dep.yml Remove old semver v6.3.1 license metadata.
.licenses/npm/path-expression-matcher.dep.yml Update path-expression-matcher license metadata version.
.licenses/npm/minimatch-3.1.5.dep.yml Add minimatch v3.1.5 license metadata.
.licenses/npm/minimatch-10.2.5.dep.yml Add minimatch v10.2.5 license metadata.
.licenses/npm/fast-xml-parser.dep.yml Update fast-xml-parser license metadata version/homepage formatting.
.licenses/npm/brace-expansion-5.0.6.dep.yml Update/add brace-expansion v5.0.6 license metadata content.
.licenses/npm/brace-expansion-1.1.15.dep.yml Update brace-expansion v1.1.x license metadata version.
.licenses/npm/balanced-match-4.0.4.dep.yml Add balanced-match v4.0.4 license metadata.
.licenses/npm/balanced-match-1.0.2.dep.yml Add balanced-match v1.0.2 license metadata.
.licenses/npm/@typespec/ts-http-runtime.dep.yml Update @typespec/ts-http-runtime license metadata version/homepage.
.licenses/npm/@azure/storage-common.dep.yml Update @azure/storage-common license metadata version/homepage.
.licenses/npm/@azure/storage-blob.dep.yml Update @azure/storage-blob license metadata version/homepage.
.licenses/npm/@azure/core-xml.dep.yml Update @azure/core-xml license metadata version.
.licenses/npm/@azure/core-rest-pipeline.dep.yml Update @azure/core-rest-pipeline license metadata version/homepage.
.licenses/npm/@azure/core-http-compat.dep.yml Update @azure/core-http-compat license metadata version.
.licenses/npm/@azure/core-client.dep.yml Update @azure/core-client license metadata version.
.licenses/npm/@azure/abort-controller.dep.yml Add @azure/abort-controller v2.x license metadata.
.licenses/npm/@actions/tool-cache.dep.yml Update @actions/tool-cache license metadata version.
.licenses/npm/@actions/io.dep.yml Update @actions/io license metadata version.
.licenses/npm/@actions/http-client.dep.yml Update @actions/http-client license metadata version.
.licenses/npm/@actions/glob-0.7.0.dep.yml Add @actions/glob v0.7.0 license metadata.
.licenses/npm/@actions/glob-0.6.1.dep.yml Update @actions/glob v0.6.x license metadata version reference.
.licenses/npm/@actions/exec.dep.yml Update @actions/exec license metadata version.
.licenses/npm/@actions/core.dep.yml Update @actions/core license metadata version.
.licenses/npm/@actions/cache.dep.yml Update @actions/cache license metadata version.

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

@priyagupta108 priyagupta108 force-pushed the esm-migration-and-deps-upgrade branch from dfabef6 to d266e93 Compare June 26, 2026 07:45
@priyagupta108 priyagupta108 force-pushed the esm-migration-and-deps-upgrade branch from d266e93 to ee43a06 Compare June 26, 2026 10:31
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