From 9a94ac24300fb8e88643d016e819f8ee3bba7c29 Mon Sep 17 00:00:00 2001 From: kimyouknow Date: Tue, 10 Feb 2026 23:15:38 +0900 Subject: [PATCH] fix: move package exports from publishConfig to top-level fields npm does not support publishConfig overrides for manifest fields (main, types, module, exports). This caused 0.0.47 and @react-simplikit/mobile 0.0.1 to be published with incorrect entry points (pointing to source instead of built output). Move these fields to the top level of package.json so they are correctly included regardless of the publish tool used. --- .changeset/fix-publishconfig.md | 8 ++++++++ packages/core/package.json | 35 ++++++++++++++++----------------- packages/mobile/package.json | 35 ++++++++++++++++----------------- 3 files changed, 42 insertions(+), 36 deletions(-) create mode 100644 .changeset/fix-publishconfig.md diff --git a/.changeset/fix-publishconfig.md b/.changeset/fix-publishconfig.md new file mode 100644 index 00000000..6f4f1a98 --- /dev/null +++ b/.changeset/fix-publishconfig.md @@ -0,0 +1,8 @@ +--- +'react-simplikit': patch +'@react-simplikit/mobile': patch +--- + +Fix broken package exports by moving main/types/module/exports from publishConfig to top-level package.json fields + +npm does not support publishConfig field overrides for manifest fields like main, types, and exports. The previous versions (react-simplikit@0.0.47, @react-simplikit/mobile@0.0.1) were published with incorrect entry points because publishConfig overrides were not applied during `npm publish`. diff --git a/packages/core/package.json b/packages/core/package.json index 3137a794..3083d8d8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,22 @@ { "name": "react-simplikit", "version": "0.0.47", - "main": "./src/index.ts", + "main": "./dist/index.cjs", + "module": "./esm/index.js", + "types": "./dist/index.d.cts", + "exports": { + ".": { + "import": { + "types": "./esm/index.d.ts", + "default": "./esm/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" + }, "type": "module", "sideEffects": false, "keywords": [ @@ -29,23 +44,7 @@ "test:coverage": "vitest run --coverage" }, "publishConfig": { - "access": "public", - "main": "./dist/index.cjs", - "types": "./dist/index.d.cts", - "module": "./esm/index.js", - "exports": { - ".": { - "import": { - "types": "./esm/index.d.ts", - "default": "./esm/index.js" - }, - "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" - } - }, - "./package.json": "./package.json" - } + "access": "public" }, "devDependencies": { "@changesets/changelog-github": "^0.5.1", diff --git a/packages/mobile/package.json b/packages/mobile/package.json index 07c5d190..76917452 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -3,7 +3,22 @@ "version": "0.0.1", "description": "Mobile web utilities for React - fixing viewport, keyboard, and layout issues", "type": "module", - "main": "./src/index.ts", + "main": "./dist/index.cjs", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + }, + "./package.json": "./package.json" + }, "files": [ "dist/**/*" ], @@ -55,22 +70,6 @@ "vitest": "^2.1.8" }, "publishConfig": { - "access": "public", - "main": "./dist/index.cjs", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", - "exports": { - ".": { - "import": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - }, - "require": { - "types": "./dist/index.d.cts", - "default": "./dist/index.cjs" - } - }, - "./package.json": "./package.json" - } + "access": "public" } }