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" } }