Skip to content

Commit 59fb5d2

Browse files
committed
Try different type configuration
1 parent a2a5b7c commit 59fb5d2

File tree

8 files changed

+71
-32
lines changed

8 files changed

+71
-32
lines changed

packages/solid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
7979
"build:types:watch": "tsc -p tsconfig.types.json --watch",
8080
"build:tarball": "npm pack",
81-
"circularDepCheck": "madge --circular src/index.ts",
81+
"circularDepCheck": "madge --circular src/index.ts && madge --circular src/solidrouter.ts",
8282
"clean": "rimraf build coverage sentry-solid-*.tgz ./*.d.ts ./*.d.ts.map",
8383
"fix": "eslint . --format stylish --fix",
8484
"lint": "eslint . --format stylish",

packages/solidstart/.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
/server
2-
/client
1+
/client/*.d.ts
2+
/client/*.d.ts.map
3+
/server/*.d.ts
4+
/server/*.d.ts.map
35
/*.d.ts
46
/*.d.ts.map

packages/solidstart/package.json

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,46 @@
2424
"./package.json": "./package.json",
2525
".": {
2626
"browser": {
27-
"types": "./build/types/index.types.d.ts",
28-
"import": "./build/esm/index.client.js",
29-
"require": "./build/cjs/index.client.js"
27+
"import": {
28+
"types": "./build/types/index.types.d.ts",
29+
"default": "./build/esm/index.client.js"
30+
},
31+
"require": {
32+
"types": "./build/types/index.types.d.ts",
33+
"default": "./build/cjs/index.client.js"
34+
}
3035
},
3136
"node": {
32-
"types": "./build/types/index.types.d.ts",
33-
"import": "./build/esm/index.server.js",
34-
"require": "./build/cjs/index.server.js"
37+
"import": {
38+
"types": "./build/types/index.types.d.ts",
39+
"default": "./build/esm/index.server.js"
40+
},
41+
"require": {
42+
"types": "./build/types/index.types.d.ts",
43+
"default": "./build/cjs/index.server.js"
44+
}
3545
}
3646
},
3747
"./solidrouter": {
3848
"browser": {
39-
"types": "./solidrouter.types.d.ts",
40-
"import": "./build/esm/solidrouter.client.js",
41-
"require": "./build/cjs/solidrouter.client.js"
49+
"import": {
50+
"types": "./solidrouter.types.d.ts",
51+
"default": "./build/esm/solidrouter.client.js"
52+
},
53+
"require": {
54+
"types": "./solidrouter.types.d.ts",
55+
"default": "./build/cjs/solidrouter.client.js"
56+
}
4257
},
4358
"node": {
44-
"types": "./solidrouter.types.d.ts",
45-
"import": "./build/esm/solidrouter.server.js",
46-
"require": "./build/cjs/solidrouter.server.js"
59+
"import": {
60+
"types": "./solidrouter.types.d.ts",
61+
"default": "./build/esm/solidrouter.server.js"
62+
},
63+
"require": {
64+
"types": "./solidrouter.types.d.ts",
65+
"default": "./build/cjs/solidrouter.server.js"
66+
}
4767
}
4868
}
4969
},
@@ -88,16 +108,31 @@
88108
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
89109
"build:types:watch": "tsc -p tsconfig.types.json --watch",
90110
"build:tarball": "npm pack",
91-
"circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts",
92-
"clean": "rimraf build coverage sentry-solidstart-*.tgz ./*.d.ts ./*.d.ts.map ./client ./server",
111+
"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",
112+
"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",
93113
"fix": "eslint . --format stylish --fix",
94114
"lint": "eslint . --format stylish",
95115
"test": "yarn test:unit",
96116
"test:unit": "vitest run",
97117
"test:watch": "vitest --watch",
98-
"yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push --sig"
118+
"yalc:publish": "yalc publish --push --sig"
99119
},
100120
"volta": {
101121
"extends": "../../package.json"
122+
},
123+
"nx": {
124+
"targets": {
125+
"build:types": {
126+
"outputs": [
127+
"{projectRoot}/build/types",
128+
"{projectRoot}/client/*.d.ts",
129+
"{projectRoot}/client/*.d.ts.map",
130+
"{projectRoot}/server/*.d.ts",
131+
"{projectRoot}/server/*.d.ts.map",
132+
"{projectRoot}/*.d.ts",
133+
"{projectRoot}/*.d.ts.map"
134+
]
135+
}
136+
}
102137
}
103138
}

packages/solidstart/rollup.npm.config.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollu
33
export default makeNPMConfigVariants(
44
makeBaseNPMConfig({
55
entrypoints: [
6-
'src/index.server.ts',
7-
'src/solidrouter.server.ts',
86
'src/index.client.ts',
97
'src/solidrouter.client.ts',
8+
'src/index.server.ts',
9+
'src/solidrouter.server.ts',
1010
'src/client/index.ts',
1111
'src/client/solidrouter.ts',
1212
'src/server/index.ts',
@@ -16,6 +16,9 @@ export default makeNPMConfigVariants(
1616
// the name doesn't match an SDK dependency)
1717
packageSpecificConfig: {
1818
external: ['solid-js', '@sentry/solid', '@sentry/solid/solidrouter'],
19+
output: {
20+
dynamicImportInCjs: true,
21+
},
1922
},
2023
}),
2124
);

packages/solidstart/src/server/solidrouter.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@ function withSentryRouterRoot(Root: Component<RouteSectionProps>): Component<Rou
2424
/**
2525
* A browser tracing integration that uses Solid Router to instrument navigations.
2626
*/
27-
export function solidRouterBrowserTracingIntegration(
28-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
29-
options: any,
30-
): Integration {
27+
export function solidRouterBrowserTracingIntegration(_options: unknown): Integration {
3128
return {
32-
name: 'solidRouterBrowserTracingIntegration',
29+
name: '[no-op] solidRouterBrowserTracingIntegration',
3330
};
3431
}
3532

packages/solidstart/src/solidrouter.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// We export everything from both the client part of the SDK and from the server part.
2-
// Some of the exports collide, which is not allowed, unless we redifine the colliding
2+
// Some of the exports collide, which is not allowed, unless we redefine the colliding
33
// exports in this file - which we do below.
44

55
export * from './client/solidrouter';

packages/solidstart/tsconfig.solidrouter-types.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
"outDir": "./"
99
},
1010

11-
"//": "This type is built separately because it is for a subpath export, which has problems if it is not in the root",
11+
"//": "These types are built separately because they are for a subpath export, which has problems if they are not in the root",
1212
"include": [
13-
"src/client/solidrouter.ts",
1413
"src/solidrouter.client.ts",
14+
"src/client/solidrouter.ts",
15+
"src/solidrouter.server.ts",
1516
"src/server/solidrouter.ts",
16-
"src/solidrouter.server.ts"
17+
"src/solidrouter.types.ts"
1718
],
1819
"//": "Without this, we cannot output into the root dir",
1920
"exclude": []

packages/solidstart/tsconfig.types.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
"outDir": "build/types"
99
},
1010

11-
"//": "This is built separately in tsconfig.solidrouter-types.json",
11+
"//": "These are built separately in tsconfig.solidrouter-types.json",
1212
"exclude": [
13-
"src/client/solidrouter.ts",
1413
"src/solidrouter.client.ts",
14+
"src/client/solidrouter.ts",
15+
"src/solidrouter.server.ts",
1516
"src/server/solidrouter.ts",
16-
"src/solidrouter.server.ts"
17+
"src/solidrouter.types.ts"
1718
]
1819
}

0 commit comments

Comments
 (0)