Skip to content

Commit 25ae06a

Browse files
committed
Add node10 type resolution support for subpath exports (still does not actually import in Node 10 or Browserify/Parcel)
https://github.com/andrewbranch/example-subpath-exports-ts-compat
1 parent 280e4fe commit 25ae06a

File tree

8 files changed

+230
-37
lines changed

8 files changed

+230
-37
lines changed

.github/workflows/typecheck.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ jobs:
2929
run: pnpm run generate
3030

3131
- name: 🔎 Type check
32-
run: pnpm run typecheck --filter webapp
32+
run: pnpm run typecheck
33+
34+
- name: 🔎 Check exports
35+
run: pnpm run check-exports

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@ apps/**/public/build
5555
.cosine
5656
.trigger
5757
.tshy*
58-
.yarn
58+
.yarn
59+
*.tsbuildinfo

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"test": "turbo run test",
2929
"test:dev": "turbo run test:dev",
3030
"start": "turbo run start",
31+
"check-exports": "turbo run check-exports",
3132
"clean": "turbo run clean",
3233
"clean:node_modules": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
3334
"typecheck": "turbo run typecheck",

packages/build/package.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,32 @@
3333
"@triggerdotdev/source"
3434
]
3535
},
36+
"typesVersions": {
37+
"*": {
38+
"extensions": [
39+
"dist/commonjs/extensions/index.d.ts"
40+
],
41+
"extensions/core": [
42+
"dist/commonjs/extensions/core.d.ts"
43+
],
44+
"extensions/prisma": [
45+
"dist/commonjs/extensions/prisma.d.ts"
46+
],
47+
"extensions/audioWaveform": [
48+
"dist/commonjs/extensions/audioWaveform.d.ts"
49+
],
50+
"extensions/typescript": [
51+
"dist/commonjs/extensions/typescript.d.ts"
52+
]
53+
}
54+
},
3655
"scripts": {
3756
"clean": "rimraf dist",
3857
"build": "tshy && pnpm run update-version",
3958
"dev": "tshy --watch",
4059
"typecheck": "tsc --noEmit -p tsconfig.src.json",
41-
"update-version": "tsx ../../scripts/updateVersion.ts"
60+
"update-version": "tsx ../../scripts/updateVersion.ts",
61+
"check-exports": "attw --pack ."
4262
},
4363
"dependencies": {
4464
"@trigger.dev/core": "workspace:3.0.0-beta.56",
@@ -51,7 +71,8 @@
5171
"tshy": "^3.0.2",
5272
"typescript": "^5.5.4",
5373
"tsx": "4.17.0",
54-
"esbuild": "^0.23.0"
74+
"esbuild": "^0.23.0",
75+
"@arethetypeswrong/cli": "^0.15.4"
5576
},
5677
"engines": {
5778
"node": ">=18.20.0"
@@ -128,4 +149,4 @@
128149
"main": "./dist/commonjs/index.js",
129150
"types": "./dist/commonjs/index.d.ts",
130151
"module": "./dist/esm/index.js"
131-
}
152+
}

packages/cli-v3/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"vitest": "^2.0.5"
6767
},
6868
"scripts": {
69-
"typecheck": "tsc",
69+
"typecheck": "tsc -p tsconfig.src.json --noEmit",
7070
"build": "tshy && pnpm run update-version",
7171
"dev": "tshy --watch",
7272
"test:e2e": "vitest --run -c ./e2e/vitest.config.ts",

packages/trigger-sdk/package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,20 @@
2929
"@triggerdotdev/source"
3030
]
3131
},
32+
"typesVersions": {
33+
"*": {
34+
"v3": [
35+
"dist/commonjs/v3/index.d.ts"
36+
]
37+
}
38+
},
3239
"scripts": {
3340
"clean": "rimraf dist",
3441
"build": "tshy && pnpm run update-version",
3542
"dev": "tshy --watch",
3643
"typecheck": "tsc --noEmit",
37-
"update-version": "tsx ../../scripts/updateVersion.ts"
44+
"update-version": "tsx ../../scripts/updateVersion.ts",
45+
"check-exports": "attw --pack ."
3846
},
3947
"dependencies": {
4048
"@opentelemetry/api": "1.9.0",
@@ -54,6 +62,7 @@
5462
"zod": "3.22.3"
5563
},
5664
"devDependencies": {
65+
"@arethetypeswrong/cli": "^0.15.4",
5766
"@types/debug": "^4.1.7",
5867
"@types/node": "20.14.14",
5968
"@types/slug": "^5.0.3",
@@ -63,9 +72,9 @@
6372
"msw": "^2.2.1",
6473
"rimraf": "^3.0.2",
6574
"tshy": "^3.0.2",
75+
"tsx": "4.17.0",
6676
"typed-emitter": "^2.1.0",
67-
"typescript": "^5.5.4",
68-
"tsx": "4.17.0"
77+
"typescript": "^5.5.4"
6978
},
7079
"engines": {
7180
"node": ">=18.20.0"

0 commit comments

Comments
 (0)