Skip to content

Commit 2346fa3

Browse files
committed
Add comments to package.json explaining types strategy
1 parent 0981ee0 commit 2346fa3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/solidstart/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
"module": "build/esm/index.server.js",
2121
"browser": "build/esm/index.client.js",
2222
"types": "build/types/index.types.d.ts",
23+
"//": [
24+
"For `@sentry/solidstart/solidrouter` types to resolve correctly for both `moduleResolution: bundler` and `moduleResolution: node`",
25+
"- type definitions have to be exported at root level (/build won't work)",
26+
"- type definitions have to match in name (i.e. `solidrouter.d.ts`)",
27+
"- the `types` entry needs to be set both at the root of the export and within `browser` and `node`"
28+
],
2329
"exports": {
2430
"./package.json": "./package.json",
2531
".": {
@@ -89,7 +95,7 @@
8995
"build:types:watch": "tsc -p tsconfig.types.json --watch",
9096
"build:tarball": "npm pack",
9197
"circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts && madge --circular src/solidrouter.client.ts && madge --circular src/solidrouter.server.ts && madge --circular src/solidrouter.types.ts",
92-
"clean": "rimraf build coverage sentry-solidstart-*.tgz ./*.d.ts ./*.d.ts.map ./client/*.d.ts ./client/*.d.ts.map ./server/*d.ts ./server/*d.ts.map",
98+
"clean": "rimraf build coverage sentry-solidstart-*.tgz ./*.d.ts ./*.d.ts.map ./client ./server",
9399
"fix": "eslint . --format stylish --fix",
94100
"lint": "eslint . --format stylish",
95101
"test": "yarn test:unit",

0 commit comments

Comments
 (0)