Skip to content

fix(base-controller): add TypeScript declaration file for legacy module resolution - #6915

Merged
cryptodev-2s merged 3 commits into
mainfrom
fix/base-controller-legacy-ts-resolution
Oct 22, 2025
Merged

fix(base-controller): add TypeScript declaration file for legacy module resolution#6915
cryptodev-2s merged 3 commits into
mainfrom
fix/base-controller-legacy-ts-resolution

Conversation

@cryptodev-2s

@cryptodev-2scryptodev-2s commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

Explanation

Added next.d.ts file to support importing from '@metamask/base-controller/next' with legacy TypeScript module resolution. Previously, this import pattern only worked with Node16/NodeNext resolution which uses the exports field in package.json.

This ensures compatibility with projects using older TypeScript module resolution settings while maintaining support for modern resolution modes.

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, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Add next.d.ts to enable @metamask/base-controller/next imports under legacy TypeScript module resolution; include it in package files and update changelog.

  • Base Controller
    • TypeScript declarations: Add packages/base-controller/next.d.ts re-exporting ./dist/next/index.cjs to support legacy module resolution for @metamask/base-controller/next.
    • Packaging: Include next.d.ts in packages/base-controller/package.jsonfiles array.
    • Changelog: Add Unreleased “Fixed” entry documenting the legacy module resolution fix for the /next subpath.

Written by Cursor Bugbot for commit d232e39. This will update automatically on new commits. Configure here.

…le resolution
Added next.d.ts file to support importing from '@metamask/base-controller/next'
with legacy TypeScript module resolution. Previously, this import pattern only
worked with Node16/NodeNext resolution which uses the exports field in package.json.
This ensures compatibility with projects using older TypeScript module resolution
settings while maintaining support for modern resolution modes.
@cryptodev-2s
cryptodev-2sforce-pushed the fix/base-controller-legacy-ts-resolution branch from f260a25 to bf9c17cCompareOctober 22, 2025 11:23
@cryptodev-2s
cryptodev-2s marked this pull request as ready for review October 22, 2025 11:23
@cryptodev-2s
cryptodev-2s requested a review from a team as a code ownerOctober 22, 2025 11:23
@cryptodev-2s
cryptodev-2s enabled auto-merge (squash) October 22, 2025 11:25
Mrtenz
Mrtenz previously approved these changes Oct 22, 2025
Comment threadpackages/base-controller/package.json

// Re-export all types and values from the CommonJS build
// eslint-disable-next-line import-x/no-useless-path-segments, import-x/extensions
export * from './dist/next/index.cjs';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: TypeScript Re-export Issue

The next.d.ts file re-exports from ./dist/next/index.cjs, a JavaScript file, instead of its corresponding TypeScript declaration file (./dist/next/index.d.cts). This prevents proper type resolution for consumers using legacy module resolution.

Fix in CursorFix in Web

@cryptodev-2s
cryptodev-2s merged commit e44c51b into mainOct 22, 2025
256 checks passed
@cryptodev-2s
cryptodev-2s deleted the fix/base-controller-legacy-ts-resolution branch October 22, 2025 11:50
Gudahtt added a commit that referenced this pull request Oct 24, 2025
…r/multichain-transactions-controller
* origin/main: (35 commits)
feat: `JsonRpcEngineV2` (#6176)
Release 641.0.0 (#6940)
feat: Add transaction emulation actions (#6935)
Release/640.0.0 (#6934)
fix(core-backend): control randomness to fix flaky test (#6936)
chore: Add `@metamask-previews/*` to NPM age gate exceptions (#6937)
Release/639.0.0 (#6931)
feat: make getCryptoApproveTransactionParams synchronous (#6930)
feat: add new actions to `KeyringController` (#6928)
feat: add `getAccounts` to `AccountsController` (#6927)
chore: remove `Monad Mainnet` single call balance contract and add into account v4 (#6929)
Release/638.0.0 (#6923)
fix: Downgrade `multiformats` to `^9.9.0` to avoid ESM-only dependency (#6920)
Release/637.0.0 (#6919)
feat(account-tree-controller): add callbacks for hidden and pinned data (#6910)
Release 636.0.0 (#6918)
fix(core-backend): reconnection logic (#6861)
fix: Tx state listener and signature coverage (#6906)
Release/635.0.0 (#6917)
fix(base-controller): add TypeScript declaration file for legacy module resolution (#6915)
...
Sign up for freeto 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

@cryptodev-2s@Mrtenz