Skip to content

refactor: rewrite .js imports in scripts folder to .ts - #10537

Merged
Mrtenz merged 3 commits into
mainfrom
mrtenz/ts-imports
Sep 29, 2026
Merged

Mrtenz merged 3 commits into
mainfrom
mrtenz/ts-imports

Conversation

@Mrtenz

@Mrtenz Mrtenz commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Explanation

In preparation for dropping the tsx dependency, I've updated all .js imports to .ts imports in the scripts folder. We may eventually want to do this in the packages too, but to keep this pull request small, I skipped that for now.

Also updated some scripts from .mts to .ts as .mts is not needed anymore now that the entire workspace is ESM.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Tooling-only refactor in CI scripts and dev configs; runtime product code and package import rules are unchanged.

Overview
Prepares the repo to eventually drop tsx by standardizing how scripts/ is written and invoked.

Script entrypoints that used .mts are renamed to .ts (e.g. get-changed-workspaces, lint-tsconfigs, close-stale-release-prs, shared scripts/lib/workspaces). GitHub Actions, root package.json, yarn.config.cjs, and every workspace lint:tsconfigs script are updated to call the new paths.

Relative imports under scripts/ switch from .js / .mjs specifiers to .ts. tsconfig.base.json enables allowImportingTsExtensions, while tsconfig.packages.json explicitly turns it off so published packages stay unchanged. oxlint.config.ts adds an import/extensions override for scripts/**/*.ts, and suppression keys are retargeted to the renamed files.

Reviewed by Cursor Bugbot for commit ddfd6ac. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread tsconfig.base.json
* This configuration is extended by all other TypeScript configurations.
*/
"compilerOptions": {
"allowImportingTsExtensions": true,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this here instead of tsconfig.scripts.json since this is what the IDE uses. If we only add it to tsconfig.scripts.json, you would see a bunch of TypeScript errors in your IDE.

Comment thread tsconfig.packages.json
*/
"extends": "./tsconfig.base.json",
"compilerOptions": {
"allowImportingTsExtensions": false,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overriding the new option in tsconfig.base.json.

@Mrtenz
Mrtenz marked this pull request as ready for review September 29, 2026 09:10
@Mrtenz
Mrtenz requested review from a team as code owners September 29, 2026 09:10
@Mrtenz
Mrtenz deployed to default-branch September 29, 2026 09:10 — with GitHub Actions Active
@Mrtenz
Mrtenz added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit 381c2b3 Sep 29, 2026
347 of 348 checks passed
@Mrtenz
Mrtenz deleted the mrtenz/ts-imports branch September 29, 2026 09:27
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537, where scripts import each other with a .ts extension.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537, where scripts import each other with a .ts extension.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537, where scripts import each other with a .ts extension.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537, where scripts import each other with a .ts extension.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537, where scripts import each other with a .ts extension.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537, where scripts import each other with a .ts extension.
cryptodev-2s added a commit that referenced this pull request Sep 29, 2026
Follows the convention main adopted in #10537.
cryptodev-2s added a commit that referenced this pull request Sep 30, 2026
Follows the convention main adopted in #10537, where scripts import each other with a .ts extension.
cryptodev-2s added a commit that referenced this pull request Sep 30, 2026
Follows the convention main adopted in #10537.
cryptodev-2s added a commit that referenced this pull request Sep 30, 2026
Follows the convention main adopted in #10537.
cryptodev-2s added a commit that referenced this pull request Sep 30, 2026
Follows the convention main adopted in #10537.

This branch was successfully deployed

1 active deployment
default-branch — ddfd6acf Deployed Sep 29, 2026 by Mrtenz via Determine whether this PR is a release PR #4848
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants