fix: point exports to TypeScript source for Git dependency consumers

Git dependencies don't run prepublishOnly, so dist/ never exists.
Point all exports directly to src/*.ts files since Next.js/Turbopack
handles TypeScript natively.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Martin Porwoll 2026-02-15 00:31:04 +00:00
parent 715783dbf3
commit 64847594b2

View file

@ -3,40 +3,38 @@
"version": "1.0.0", "version": "1.0.0",
"description": "Shared TypeScript types, API client, and block registry for Payload CMS frontends", "description": "Shared TypeScript types, API client, and block registry for Payload CMS frontends",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./src/index.ts",
"types": "./dist/index.d.ts", "types": "./src/index.ts",
"exports": { "exports": {
".": { ".": {
"types": "./dist/index.d.ts", "types": "./src/index.ts",
"import": "./dist/index.js" "import": "./src/index.ts"
}, },
"./types": { "./types": {
"types": "./dist/types/index.d.ts", "types": "./src/types/index.ts",
"import": "./dist/types/index.js" "import": "./src/types/index.ts"
}, },
"./api-client": { "./api-client": {
"types": "./dist/api-client/index.d.ts", "types": "./src/api-client/index.ts",
"import": "./dist/api-client/index.js" "import": "./src/api-client/index.ts"
}, },
"./blocks": { "./blocks": {
"types": "./dist/blocks/registry.d.ts", "types": "./src/blocks/registry.tsx",
"import": "./dist/blocks/registry.js" "import": "./src/blocks/registry.tsx"
}, },
"./constants": { "./constants": {
"types": "./dist/constants/index.d.ts", "types": "./src/constants/index.ts",
"import": "./dist/constants/index.js" "import": "./src/constants/index.ts"
} }
}, },
"files": [ "files": [
"dist",
"src" "src"
], ],
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"dev": "tsc --watch", "dev": "tsc --watch",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"extract": "tsx scripts/extract-types.ts", "extract": "tsx scripts/extract-types.ts"
"prepublishOnly": "pnpm build"
}, },
"keywords": [ "keywords": [
"payload-cms", "payload-cms",