From 287784cd030ab13607ad79ee3ca3429351c9e3a0 Mon Sep 17 00:00:00 2001 From: Arthur Breton Date: Sat, 18 Apr 2026 14:55:53 +0800 Subject: [PATCH 1/2] feat(perps-controller): add UI-safe subpath exports for formatters, calculations, constants Expose `./formatters`, `./calculations`, and `./constants` subpath exports so consumers can import pure utilities without transitively loading the HyperLiquid SDK, avoiding ESM-only `@noble/hashes` in CJS Jest environments. --- packages/perps-controller/CHANGELOG.md | 4 ++++ packages/perps-controller/package.json | 30 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/packages/perps-controller/CHANGELOG.md b/packages/perps-controller/CHANGELOG.md index a5831c4602c..20887fbba6f 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`, and `./constants` so consumers can import pure formatting/calc utilities (`perpsFormatters`, `orderCalculations`, `perpsConfig`) 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..e9863dd677f 100644 --- a/packages/perps-controller/package.json +++ b/packages/perps-controller/package.json @@ -35,6 +35,36 @@ "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" + } + }, "./package.json": "./package.json" }, "publishConfig": { From 07b4c4c9a3138a4f8262eccc6b3559036be2a9fe Mon Sep 17 00:00:00 2001 From: Arthur Breton Date: Sat, 18 Apr 2026 14:58:47 +0800 Subject: [PATCH 2/2] feat(perps-controller): add ./constants/hyperliquid subpath export --- packages/perps-controller/CHANGELOG.md | 2 +- packages/perps-controller/package.json | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/perps-controller/CHANGELOG.md b/packages/perps-controller/CHANGELOG.md index 20887fbba6f..630298d5df7 100644 --- a/packages/perps-controller/CHANGELOG.md +++ b/packages/perps-controller/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Add UI-safe subpath exports `./formatters`, `./calculations`, and `./constants` so consumers can import pure formatting/calc utilities (`perpsFormatters`, `orderCalculations`, `perpsConfig`) without transitively loading the HyperLiquid SDK. This avoids pulling ESM-only `@noble/hashes` into CJS Jest environments where `transformIgnorePatterns` is not customized. +- 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] diff --git a/packages/perps-controller/package.json b/packages/perps-controller/package.json index e9863dd677f..63573b0be42 100644 --- a/packages/perps-controller/package.json +++ b/packages/perps-controller/package.json @@ -65,6 +65,16 @@ "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": {