Skip to content

refactor: add .js import extensions to Assets packages#9580

Merged
Mrtenz merged 3 commits into
mainfrom
mrtenz/esm-import-extensions-assets
Jul 23, 2026
Merged

refactor: add .js import extensions to Assets packages#9580
Mrtenz merged 3 commits into
mainfrom
mrtenz/esm-import-extensions-assets

Conversation

@Mrtenz

@Mrtenz Mrtenz commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds .js import extensions to all relative imports in the Assets
packages, in preparation for the ESM refactor.

The ESLint rule that enforces this (n/file-extension-in-import +
import-x/extensions) has been added for these packages in
eslint.config.mjs.

Packages

  • @metamask/assets-controller
  • @metamask/assets-controllers
  • @metamask/network-enablement-controller

Note

Low Risk
Mechanical import-path and tooling updates only; no auth, data, or runtime behavior changes, though the large touch surface means build/test breakage if any path was missed.

Overview
Prepares @metamask/assets-controller, @metamask/assets-controllers, and @metamask/network-enablement-controller for ESM by appending .js to relative import/export paths across source and tests (including barrels like utils/index.js and data-sources/index.js). No controller or business logic changes.

ESLint now applies n/file-extension-in-import to those three asset-related package globs (plus the newly listed network-enablement-controller entry). Messenger action type scripts in both assets package.json files gain --esm so generated types use .js specifiers (e.g. AssetsController.js).

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

@Mrtenz
Mrtenz requested review from a team as code owners July 21, 2026 14:40
@Mrtenz
Mrtenz temporarily deployed to default-branch July 21, 2026 14:40 — with GitHub Actions Inactive
@Mrtenz
Mrtenz force-pushed the mrtenz/esm-import-extensions-assets branch 3 times, most recently from 5df20bb to 6807c8d Compare July 23, 2026 09:25
@Mrtenz
Mrtenz enabled auto-merge July 23, 2026 09:33
salimtb
salimtb previously approved these changes Jul 23, 2026
@Mrtenz
Mrtenz added this pull request to the merge queue Jul 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jul 23, 2026
@Mrtenz
Mrtenz force-pushed the mrtenz/esm-import-extensions-assets branch from 6807c8d to 864eb1c Compare July 23, 2026 09:40
@Mrtenz
Mrtenz enabled auto-merge July 23, 2026 09:41
@Mrtenz
Mrtenz added this pull request to the merge queue Jul 23, 2026
Merged via the queue into main with commit a652196 Jul 23, 2026
427 checks passed
@Mrtenz
Mrtenz deleted the mrtenz/esm-import-extensions-assets branch July 23, 2026 09:52
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