From a7ac0b0bf5a2c0dbfcaa099b6350eab67f071808 Mon Sep 17 00:00:00 2001 From: Arthur Breton Date: Thu, 21 May 2026 21:52:20 +0800 Subject: [PATCH 1/2] feat(perps-controller): expose subpath exports for constants, types, utils Mobile (`@metamask/metamask-mobile`) and other consumers still on TypeScript's legacy `moduleResolution: "node"` cannot resolve deep package imports through the package.json `exports` field. Declare explicit subpath entries so imports such as `@metamask/perps-controller/constants/perpsConfig` or `@metamask/perps-controller/utils/coalescePerpsRestRequest` map back to the compiled artifacts in `dist/` while keeping tree-shaking working (each subpath points at its own dist file rather than re-exporting from the barrel). --- packages/perps-controller/CHANGELOG.md | 1 + packages/perps-controller/package.json | 40 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/packages/perps-controller/CHANGELOG.md b/packages/perps-controller/CHANGELOG.md index 587f5eb5c5..3f24251eb9 100644 --- a/packages/perps-controller/CHANGELOG.md +++ b/packages/perps-controller/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add slippage controls so users can configure per-order slippage tolerance for market trades ([#8871](https://github.com/MetaMask/core/pull/8871)) - Track `vip_tier` and `vip_discount` properties on perps trading events for fee analytics ([#8871](https://github.com/MetaMask/core/pull/8871)) - Surface an in-app banner during an ongoing HyperLiquid outage so users see degraded trading status ([#8871](https://github.com/MetaMask/core/pull/8871)) +- Expose subpath `exports` for `./constants`, `./constants/*`, `./types`, and `./utils/*` so consumers using legacy `node` module resolution can deep-import compiled entry points without losing tree-shaking ([#NNNN](https://github.com/MetaMask/core/pull/NNNN)) ### Fixed diff --git a/packages/perps-controller/package.json b/packages/perps-controller/package.json index 87832436f6..108ce7dc14 100644 --- a/packages/perps-controller/package.json +++ b/packages/perps-controller/package.json @@ -35,6 +35,46 @@ "default": "./dist/index.cjs" } }, + "./constants": { + "import": { + "types": "./dist/constants/index.d.mts", + "default": "./dist/constants/index.mjs" + }, + "require": { + "types": "./dist/constants/index.d.cts", + "default": "./dist/constants/index.cjs" + } + }, + "./constants/*": { + "import": { + "types": "./dist/constants/*.d.mts", + "default": "./dist/constants/*.mjs" + }, + "require": { + "types": "./dist/constants/*.d.cts", + "default": "./dist/constants/*.cjs" + } + }, + "./types": { + "import": { + "types": "./dist/types/index.d.mts", + "default": "./dist/types/index.mjs" + }, + "require": { + "types": "./dist/types/index.d.cts", + "default": "./dist/types/index.cjs" + } + }, + "./utils/*": { + "import": { + "types": "./dist/utils/*.d.mts", + "default": "./dist/utils/*.mjs" + }, + "require": { + "types": "./dist/utils/*.d.cts", + "default": "./dist/utils/*.cjs" + } + }, "./package.json": "./package.json" }, "publishConfig": { From dd98053e95c53c44226e50421ba97cce22b7b915 Mon Sep 17 00:00:00 2001 From: Arthur Breton Date: Thu, 21 May 2026 22:09:53 +0800 Subject: [PATCH 2/2] chore: fill core PR number in changelog entry --- packages/perps-controller/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/perps-controller/CHANGELOG.md b/packages/perps-controller/CHANGELOG.md index 3f24251eb9..24e6ce7017 100644 --- a/packages/perps-controller/CHANGELOG.md +++ b/packages/perps-controller/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add slippage controls so users can configure per-order slippage tolerance for market trades ([#8871](https://github.com/MetaMask/core/pull/8871)) - Track `vip_tier` and `vip_discount` properties on perps trading events for fee analytics ([#8871](https://github.com/MetaMask/core/pull/8871)) - Surface an in-app banner during an ongoing HyperLiquid outage so users see degraded trading status ([#8871](https://github.com/MetaMask/core/pull/8871)) -- Expose subpath `exports` for `./constants`, `./constants/*`, `./types`, and `./utils/*` so consumers using legacy `node` module resolution can deep-import compiled entry points without losing tree-shaking ([#NNNN](https://github.com/MetaMask/core/pull/NNNN)) +- Expose subpath `exports` for `./constants`, `./constants/*`, `./types`, and `./utils/*` so consumers using legacy `node` module resolution can deep-import compiled entry points without losing tree-shaking ([#8883](https://github.com/MetaMask/core/pull/8883)) ### Fixed