diff --git a/packages/perps-controller/CHANGELOG.md b/packages/perps-controller/CHANGELOG.md index a5831c4602c..630298d5df7 100644 --- a/packages/perps-controller/CHANGELOG.md +++ b/packages/perps-controller/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Add UI-safe subpath exports `./formatters`, `./calculations`, `./constants`, and `./constants/hyperliquid` so consumers can import pure formatting/calc utilities (`perpsFormatters`, `orderCalculations`, `perpsConfig`, `hyperLiquidConfig`) without transitively loading the HyperLiquid SDK. This avoids pulling ESM-only `@noble/hashes` into CJS Jest environments where `transformIgnorePatterns` is not customized. + ## [3.2.0] ### Added diff --git a/packages/perps-controller/package.json b/packages/perps-controller/package.json index 501342b0a9b..63573b0be42 100644 --- a/packages/perps-controller/package.json +++ b/packages/perps-controller/package.json @@ -35,6 +35,46 @@ "default": "./dist/index.cjs" } }, + "./formatters": { + "import": { + "types": "./dist/utils/perpsFormatters.d.mts", + "default": "./dist/utils/perpsFormatters.mjs" + }, + "require": { + "types": "./dist/utils/perpsFormatters.d.cts", + "default": "./dist/utils/perpsFormatters.cjs" + } + }, + "./calculations": { + "import": { + "types": "./dist/utils/orderCalculations.d.mts", + "default": "./dist/utils/orderCalculations.mjs" + }, + "require": { + "types": "./dist/utils/orderCalculations.d.cts", + "default": "./dist/utils/orderCalculations.cjs" + } + }, + "./constants": { + "import": { + "types": "./dist/constants/perpsConfig.d.mts", + "default": "./dist/constants/perpsConfig.mjs" + }, + "require": { + "types": "./dist/constants/perpsConfig.d.cts", + "default": "./dist/constants/perpsConfig.cjs" + } + }, + "./constants/hyperliquid": { + "import": { + "types": "./dist/constants/hyperLiquidConfig.d.mts", + "default": "./dist/constants/hyperLiquidConfig.mjs" + }, + "require": { + "types": "./dist/constants/hyperLiquidConfig.d.cts", + "default": "./dist/constants/hyperLiquidConfig.cjs" + } + }, "./package.json": "./package.json" }, "publishConfig": {