chore: migrate to full ESM and upgrade dependencies#1350
Merged
HarithaVattikuti merged 1 commit intoJul 23, 2026
Conversation
…ucture - Changed import statements across multiple files to use the .js extension for ES module compatibility. - Refactored test files to utilize jest's unstable_mockModule for mocking core actions. - Removed unnecessary spy instances in tests, replacing them with direct mocked function calls. - Updated TypeScript configuration to target ES2022 and use NodeNext module resolution. - Removed the tsconfig.spec.json file and adjusted the main tsconfig.json to exclude test files.
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the action codebase to native Node.js ESM ("type": "module") and updates the toolchain (TypeScript, Jest, ESLint flat config) alongside major dependency upgrades to support newer @actions/* and @octokit/* versions.
Changes:
- Switch TypeScript compilation to
NodeNextESM semantics and update codebase-relative imports to use.jsextensions. - Replace Jest + ESLint legacy configs with ESM-compatible
jest.config.tsandeslint.config.mjs, updating tests for ESM execution. - Upgrade runtime/dev dependencies and refresh/adjust third-party license metadata.
Reviewed changes
Copilot reviewed 114 out of 122 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.spec.json | Removed legacy test TS config. |
| tsconfig.json | Switch to NodeNext ESM settings and adjust compiler options. |
| tsconfig.app.json | Keep app build compiling src while excluding *.spec.ts. |
| src/services/state.service.ts | Update relative imports for ESM .js extension rules. |
| src/main.ts | Update relative imports for ESM .js extension rules. |
| src/interfaces/state/state.ts | Update relative imports for ESM .js extension rules. |
| src/interfaces/issues-processor-options.ts | Update relative imports for ESM .js extension rules. |
| src/interfaces/issue.ts | Update relative imports for ESM .js extension rules. |
| src/interfaces/issue-event.ts | Update relative imports for ESM .js extension rules. |
| src/interfaces/comment.ts | Update relative imports for ESM .js extension rules. |
| src/functions/words-to-list.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/functions/should-mark-when-stale.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/functions/is-pull-request.ts | Update relative imports for ESM .js extension rules. |
| src/functions/is-pull-request.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/functions/is-labeled.ts | Update relative imports for ESM .js extension rules. |
| src/functions/is-labeled.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/functions/is-boolean.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/functions/get-sort-field.ts | Formatting adjustment in nested ternary. |
| src/functions/dates/is-valid-date.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/functions/dates/is-date-more-recent-than.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/functions/dates/get-humanized-date.ts | Update relative imports for ESM .js extension rules. |
| src/functions/dates/get-humanized-date.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/functions/clean-label.ts | Update relative imports for ESM .js extension rules. |
| src/classes/statistics.ts | Update relative imports for ESM .js extension rules. |
| src/classes/state/state.ts | Update relative imports for ESM .js extension rules. |
| src/classes/state/state.spec.ts | Rework mocking/imports for Jest ESM + update .js extensions. |
| src/classes/state/state-cache-storage.ts | Update relative import + simplify catch clause. |
| src/classes/stale-operations.ts | Update relative imports for ESM .js extension rules. |
| src/classes/stale-operations.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/classes/rate-limit.ts | Update relative imports for ESM .js extension rules. |
| src/classes/operations.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/classes/milestones.ts | Update relative imports for ESM .js extension rules. |
| src/classes/milestones.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/classes/loggers/logger.ts | Update relative imports for ESM .js extension rules. |
| src/classes/loggers/logger.spec.ts | Rework mocking/imports for Jest ESM + update .js extensions. |
| src/classes/loggers/issue-logger.ts | Update relative imports for ESM .js extension rules. |
| src/classes/loggers/issue-logger.spec.ts | Rework mocking/imports for Jest ESM + update .js extensions. |
| src/classes/issues-processor.ts | Update imports/types for ESM and adjust error construction. |
| src/classes/issue.ts | Update relative imports for ESM .js extension rules. |
| src/classes/issue.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/classes/ignore-updates.ts | Update relative imports for ESM .js extension rules. |
| src/classes/ignore-updates.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| src/classes/exempt-draft-pull-request.ts | Update relative imports for ESM .js extension rules. |
| src/classes/assignees.ts | Update relative imports for ESM .js extension rules. |
| src/classes/assignees.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| README.md | Add V11 note describing ESM migration. |
| package.json | Set "type":"module", bump to v11, update scripts and dependency versions. |
| jest.config.ts | Add Jest config for ts-jest in ESM mode. |
| jest.config.js | Remove legacy Jest CJS config. |
| eslint.config.mjs | Add flat ESLint config for ESM toolchain. |
| dist/package.json | Mark dist bundle as ESM via "type":"module". |
| .prettierrc.json | Add JSON Prettier config. |
| .prettierrc.js | Remove legacy Prettier CJS config. |
| .eslintrc.js | Remove legacy ESLint CJS config. |
| .eslintignore | Remove legacy ignore file (replaced by flat config ignores). |
| tests/updates-reset-stale.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| tests/state.spec.ts | Rework mocking/imports for Jest ESM + update .js extensions. |
| tests/remove-stale-when-updated.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| tests/remove-stale-when-updated-label-events.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| tests/operations-per-run.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| tests/only-labels.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| tests/only-issue-types.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| tests/milestones.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| tests/main.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| tests/functions/generate-issue.ts | Update relative imports for ESM .js extension rules. |
| tests/functions/generate-iissue.ts | Update relative imports for ESM .js extension rules. |
| tests/exempt-draft-pr.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| tests/constants/default-processor-options.ts | Update relative imports for ESM .js extension rules. |
| tests/classes/state-mock.ts | Update relative imports for ESM .js extension rules. |
| tests/classes/issues-processor-mock.ts | Update relative imports for ESM .js extension rules. |
| tests/assignees.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| tests/any-of-labels.spec.ts | Update test imports for ESM/Jest globals + .js extensions. |
| .licenses/npm/xml-naming.dep.yml | Add license metadata for a new transitive dependency. |
| .licenses/npm/wrappy.dep.yml | Remove license metadata for no-longer-used transitive dependency. |
| .licenses/npm/universal-user-agent.dep.yml | Update transitive dependency license metadata version/text. |
| .licenses/npm/strnum.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/semver.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/semver-6.3.1.dep.yml | Remove older transitive dependency license metadata. |
| .licenses/npm/path-expression-matcher.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/once.dep.yml | Remove license metadata for no-longer-used transitive dependency. |
| .licenses/npm/ms.dep.yml | Update transitive dependency license metadata version/text. |
| .licenses/npm/json-with-bigint.dep.yml | Replace incorrect entry content with correct dependency metadata. |
| .licenses/npm/is-unsafe.dep.yml | Add license metadata for a new transitive dependency. |
| .licenses/npm/fast-xml-parser.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/fast-xml-builder.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/deprecation.dep.yml | Remove license metadata for no-longer-used transitive dependency. |
| .licenses/npm/debug.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/content-type.dep.yml | Add license metadata for a new transitive dependency. |
| .licenses/npm/before-after-hook.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/anynum.dep.yml | Add license metadata for a new transitive dependency. |
| .licenses/npm/@typespec/ts-http-runtime.dep.yml | Update transitive dependency license metadata version/homepage. |
| .licenses/npm/@octokit/types.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@octokit/types-13.10.0.dep.yml | Remove older transitive dependency license metadata. |
| .licenses/npm/@octokit/request.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@octokit/request-error.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@octokit/plugin-retry.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@octokit/plugin-rest-endpoint-methods.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@octokit/plugin-paginate-rest.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@octokit/openapi-types.dep.yml | Update transitive dependency license metadata version/text. |
| .licenses/npm/@octokit/openapi-types-20.0.0.dep.yml | Remove older transitive dependency license metadata. |
| .licenses/npm/@octokit/graphql.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@octokit/endpoint.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@octokit/core.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@octokit/auth-token.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@nodable/entities.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@azure/storage-common.dep.yml | Update transitive dependency license metadata version/homepage. |
| .licenses/npm/@azure/storage-blob.dep.yml | Update transitive dependency license metadata version/homepage. |
| .licenses/npm/@azure/core-xml.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@azure/core-rest-pipeline.dep.yml | Update transitive dependency license metadata version/homepage. |
| .licenses/npm/@azure/core-http-compat.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@azure/core-client.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@azure/abort-controller.dep.yml | Add/update license metadata for updated abort-controller version. |
| .licenses/npm/@actions/io.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@actions/http-client-4.0.1.dep.yml | Add license metadata for new transitive dependency version. |
| .licenses/npm/@actions/http-client-3.0.2.dep.yml | Add license metadata for new transitive dependency version. |
| .licenses/npm/@actions/glob.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@actions/github.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@actions/exec.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@actions/core.dep.yml | Update transitive dependency license metadata version. |
| .licenses/npm/@actions/cache.dep.yml | Update transitive dependency license metadata version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
priya-kinthali
approved these changes
Jul 20, 2026
priyagupta108
approved these changes
Jul 20, 2026
HarithaVattikuti
approved these changes
Jul 23, 2026
This was referenced Jul 23, 2026
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.
Description:
Migrates the project to native ESM (
"type": "module") and upgrades all major dependencies.Changes
"type": "module"inpackage.jsonmodule: NodeNext+moduleResolution: NodeNext.jsextensions (required for ESM).eslintrc.js+.eslintignorewith flat configeslint.config.mjsjest.config.jswithjest.config.tsusingts-jestESM mode--experimental-vm-modulesnccbuild output to ESM (dist/package.json→"type": "module")Related issue:
Add link to the related issue.
Check list: