Skip to content

Commit 4171080

Browse files
FL4TLiN3claude
andauthored
fix: correct publishConfig.types format in package.json files (#400)
The types field was incorrectly specified as an object instead of being included in the exports field. This caused TypeScript to fail to resolve type definitions for published packages. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 822a391 commit 4171080

File tree

23 files changed

+117
-88
lines changed

23 files changed

+117
-88
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
"@perstack/core": patch
3+
"@perstack/react": patch
4+
"@perstack/api-client": patch
5+
---
6+
7+
Fixed `publishConfig.types` format in package.json files
8+
9+
The `types` field was incorrectly specified as an object (`{ ".": "./dist/src/index.d.ts" }`) instead of being included in the `exports` field. This caused TypeScript to fail to resolve type definitions for published packages.
10+
11+
Changed from:
12+
```json
13+
"publishConfig": {
14+
"exports": { ".": "./dist/src/index.js" },
15+
"types": { ".": "./dist/src/index.d.ts" }
16+
}
17+
```
18+
19+
To:
20+
```json
21+
"publishConfig": {
22+
"exports": {
23+
".": {
24+
"types": "./dist/src/index.d.ts",
25+
"import": "./dist/src/index.js"
26+
}
27+
}
28+
}
29+
```

packages/api-client/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"publishConfig": {
1212
"access": "public",
1313
"exports": {
14-
".": "./dist/index.js"
15-
},
16-
"types": {
17-
".": "./dist/index.d.ts"
14+
".": {
15+
"types": "./dist/index.d.ts",
16+
"import": "./dist/index.js"
17+
}
1818
}
1919
},
2020
"files": [

packages/core/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"publishConfig": {
1212
"access": "public",
1313
"exports": {
14-
".": "./dist/src/index.js"
15-
},
16-
"types": {
17-
".": "./dist/src/index.d.ts"
14+
".": {
15+
"types": "./dist/src/index.d.ts",
16+
"import": "./dist/src/index.js"
17+
}
1818
}
1919
},
2020
"files": [

packages/mock/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"publishConfig": {
1313
"access": "public",
1414
"exports": {
15-
".": "./dist/src/index.js"
16-
},
17-
"types": {
18-
".": "./dist/src/index.d.ts"
15+
".": {
16+
"types": "./dist/src/index.d.ts",
17+
"import": "./dist/src/index.js"
18+
}
1919
}
2020
},
2121
"files": [

packages/providers/anthropic/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
},
1212
"publishConfig": {
1313
"exports": {
14-
".": "./dist/src/index.js"
15-
},
16-
"types": {
17-
".": "./dist/src/index.d.ts"
14+
".": {
15+
"types": "./dist/src/index.d.ts",
16+
"import": "./dist/src/index.js"
17+
}
1818
}
1919
},
2020
"files": [

packages/providers/azure-openai/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
},
1212
"publishConfig": {
1313
"exports": {
14-
".": "./dist/src/index.js"
15-
},
16-
"types": {
17-
".": "./dist/src/index.d.ts"
14+
".": {
15+
"types": "./dist/src/index.d.ts",
16+
"import": "./dist/src/index.js"
17+
}
1818
}
1919
},
2020
"files": [

packages/providers/bedrock/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
},
1212
"publishConfig": {
1313
"exports": {
14-
".": "./dist/src/index.js"
15-
},
16-
"types": {
17-
".": "./dist/src/index.d.ts"
14+
".": {
15+
"types": "./dist/src/index.d.ts",
16+
"import": "./dist/src/index.js"
17+
}
1818
}
1919
},
2020
"files": [

packages/providers/deepseek/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
},
1212
"publishConfig": {
1313
"exports": {
14-
".": "./dist/src/index.js"
15-
},
16-
"types": {
17-
".": "./dist/src/index.d.ts"
14+
".": {
15+
"types": "./dist/src/index.d.ts",
16+
"import": "./dist/src/index.js"
17+
}
1818
}
1919
},
2020
"files": [

packages/providers/google/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
},
1212
"publishConfig": {
1313
"exports": {
14-
".": "./dist/src/index.js"
15-
},
16-
"types": {
17-
".": "./dist/src/index.d.ts"
14+
".": {
15+
"types": "./dist/src/index.d.ts",
16+
"import": "./dist/src/index.js"
17+
}
1818
}
1919
},
2020
"files": [

packages/providers/ollama/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
},
1212
"publishConfig": {
1313
"exports": {
14-
".": "./dist/src/index.js"
15-
},
16-
"types": {
17-
".": "./dist/src/index.d.ts"
14+
".": {
15+
"types": "./dist/src/index.d.ts",
16+
"import": "./dist/src/index.js"
17+
}
1818
}
1919
},
2020
"files": [

0 commit comments

Comments
 (0)