Skip to content

Commit e3167ed

Browse files
authoredAug 5, 2022
fix: typescript commonjs module resolution with node16,nodenext (#4624)
* fix: typescript commonjs resolution * fix: bob paths * upgrade bob * use stable bob version * Update .changeset/fluffy-pianos-know.md
1 parent a56082b commit e3167ed

File tree

35 files changed

+109
-74
lines changed

35 files changed

+109
-74
lines changed
 

‎.changeset/fluffy-pianos-know.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
'@graphql-tools/batch-delegate': patch
3+
'@graphql-tools/batch-execute': patch
4+
'@graphql-tools/delegate': patch
5+
'@graphql-tools/graphql-tag-pluck': patch
6+
'graphql-tools': patch
7+
'@graphql-tools/import': patch
8+
'@graphql-tools/jest-transform': patch
9+
'@graphql-tools/links': patch
10+
'@graphql-tools/load': patch
11+
'@graphql-tools/load-files': patch
12+
'@graphql-tools/apollo-engine-loader': patch
13+
'@graphql-tools/code-file-loader': patch
14+
'@graphql-tools/git-loader': patch
15+
'@graphql-tools/github-loader': patch
16+
'@graphql-tools/graphql-file-loader': patch
17+
'@graphql-tools/json-file-loader': patch
18+
'@graphql-tools/module-loader': patch
19+
'@graphql-tools/prisma-loader': patch
20+
'@graphql-tools/url-loader': patch
21+
'@graphql-tools/merge': patch
22+
'@graphql-tools/mock': patch
23+
'@graphql-tools/node-require': patch
24+
'@graphql-tools/optimize': patch
25+
'@graphql-tools/relay-operation-optimizer': patch
26+
'@graphql-tools/resolvers-composition': patch
27+
'@graphql-tools/schema': patch
28+
'@graphql-tools/stitch': patch
29+
'@graphql-tools/stitching-directives': patch
30+
'@graphql-tools/utils': patch
31+
'@graphql-tools/webpack-loader': patch
32+
'@graphql-tools/webpack-loader-runtime': patch
33+
'@graphql-tools/wrap': patch
34+
---
35+
36+
Fix CommonJS TypeScript resolution with `moduleResolution` `node16` or `nodenext`

‎package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@typescript-eslint/eslint-plugin": "5.32.0",
5050
"@typescript-eslint/parser": "5.32.0",
5151
"babel-jest": "28.1.3",
52-
"bob-the-bundler": "2.0.0",
52+
"bob-the-bundler": "4.0.0",
5353
"chalk": "4.1.2",
5454
"concurrently": "7.3.0",
5555
"eslint": "8.21.0",
@@ -83,10 +83,10 @@
8383
]
8484
},
8585
"workspaces": [
86-
"./packages/*",
87-
"./packages/loaders/*",
88-
"./website",
89-
"./benchmark/*"
86+
"packages/*",
87+
"packages/loaders/*",
88+
"website",
89+
"benchmark/*"
9090
],
9191
"resolutions": {
9292
"graphql": "16.5.0",

‎packages/batch-delegate/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"exports": {
1515
".": {
1616
"require": {
17-
"types": "./dist/typings/index.d.ts",
17+
"types": "./dist/typings/index.d.cts",
1818
"default": "./dist/cjs/index.js"
1919
},
2020
"import": {
@@ -28,7 +28,7 @@
2828
},
2929
"./*": {
3030
"require": {
31-
"types": "./dist/typings/*.d.ts",
31+
"types": "./dist/typings/*.d.cts",
3232
"default": "./dist/cjs/*.js"
3333
},
3434
"import": {

‎packages/batch-execute/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"exports": {
1515
".": {
1616
"require": {
17-
"types": "./dist/typings/index.d.ts",
17+
"types": "./dist/typings/index.d.cts",
1818
"default": "./dist/cjs/index.js"
1919
},
2020
"import": {
@@ -28,7 +28,7 @@
2828
},
2929
"./*": {
3030
"require": {
31-
"types": "./dist/typings/*.d.ts",
31+
"types": "./dist/typings/*.d.cts",
3232
"default": "./dist/cjs/*.js"
3333
},
3434
"import": {

‎packages/delegate/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"exports": {
1515
".": {
1616
"require": {
17-
"types": "./dist/typings/index.d.ts",
17+
"types": "./dist/typings/index.d.cts",
1818
"default": "./dist/cjs/index.js"
1919
},
2020
"import": {
@@ -28,7 +28,7 @@
2828
},
2929
"./*": {
3030
"require": {
31-
"types": "./dist/typings/*.d.ts",
31+
"types": "./dist/typings/*.d.cts",
3232
"default": "./dist/cjs/*.js"
3333
},
3434
"import": {

‎packages/graphql-tag-pluck/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"exports": {
1515
".": {
1616
"require": {
17-
"types": "./dist/typings/index.d.ts",
17+
"types": "./dist/typings/index.d.cts",
1818
"default": "./dist/cjs/index.js"
1919
},
2020
"import": {
@@ -28,7 +28,7 @@
2828
},
2929
"./*": {
3030
"require": {
31-
"types": "./dist/typings/*.d.ts",
31+
"types": "./dist/typings/*.d.cts",
3232
"default": "./dist/cjs/*.js"
3333
},
3434
"import": {

‎packages/graphql-tools/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"exports": {
1515
".": {
1616
"require": {
17-
"types": "./dist/typings/index.d.ts",
17+
"types": "./dist/typings/index.d.cts",
1818
"default": "./dist/cjs/index.js"
1919
},
2020
"import": {
@@ -28,7 +28,7 @@
2828
},
2929
"./*": {
3030
"require": {
31-
"types": "./dist/typings/*.d.ts",
31+
"types": "./dist/typings/*.d.cts",
3232
"default": "./dist/cjs/*.js"
3333
},
3434
"import": {

‎packages/import/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"exports": {
1616
".": {
1717
"require": {
18-
"types": "./dist/typings/index.d.ts",
18+
"types": "./dist/typings/index.d.cts",
1919
"default": "./dist/cjs/index.js"
2020
},
2121
"import": {
@@ -29,7 +29,7 @@
2929
},
3030
"./*": {
3131
"require": {
32-
"types": "./dist/typings/*.d.ts",
32+
"types": "./dist/typings/*.d.cts",
3333
"default": "./dist/cjs/*.js"
3434
},
3535
"import": {

‎packages/jest-transform/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"exports": {
1515
".": {
1616
"require": {
17-
"types": "./dist/typings/index.d.ts",
17+
"types": "./dist/typings/index.d.cts",
1818
"default": "./dist/cjs/index.js"
1919
},
2020
"import": {
@@ -28,7 +28,7 @@
2828
},
2929
"./*": {
3030
"require": {
31-
"types": "./dist/typings/*.d.ts",
31+
"types": "./dist/typings/*.d.cts",
3232
"default": "./dist/cjs/*.js"
3333
},
3434
"import": {

‎packages/links/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"exports": {
1515
".": {
1616
"require": {
17-
"types": "./dist/typings/index.d.ts",
17+
"types": "./dist/typings/index.d.cts",
1818
"default": "./dist/cjs/index.js"
1919
},
2020
"import": {
@@ -28,7 +28,7 @@
2828
},
2929
"./*": {
3030
"require": {
31-
"types": "./dist/typings/*.d.ts",
31+
"types": "./dist/typings/*.d.cts",
3232
"default": "./dist/cjs/*.js"
3333
},
3434
"import": {

‎packages/load-files/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"exports": {
1616
".": {
1717
"require": {
18-
"types": "./dist/typings/index.d.ts",
18+
"types": "./dist/typings/index.d.cts",
1919
"default": "./dist/cjs/index.js"
2020
},
2121
"import": {
@@ -29,7 +29,7 @@
2929
},
3030
"./*": {
3131
"require": {
32-
"types": "./dist/typings/*.d.ts",
32+
"types": "./dist/typings/*.d.cts",
3333
"default": "./dist/cjs/*.js"
3434
},
3535
"import": {

‎packages/load/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"exports": {
1616
".": {
1717
"require": {
18-
"types": "./dist/typings/index.d.ts",
18+
"types": "./dist/typings/index.d.cts",
1919
"default": "./dist/cjs/index.js"
2020
},
2121
"import": {
@@ -29,7 +29,7 @@
2929
},
3030
"./*": {
3131
"require": {
32-
"types": "./dist/typings/*.d.ts",
32+
"types": "./dist/typings/*.d.cts",
3333
"default": "./dist/cjs/*.js"
3434
},
3535
"import": {

‎packages/loaders/apollo-engine/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"exports": {
1616
".": {
1717
"require": {
18-
"types": "./dist/typings/index.d.ts",
18+
"types": "./dist/typings/index.d.cts",
1919
"default": "./dist/cjs/index.js"
2020
},
2121
"import": {
@@ -29,7 +29,7 @@
2929
},
3030
"./*": {
3131
"require": {
32-
"types": "./dist/typings/*.d.ts",
32+
"types": "./dist/typings/*.d.cts",
3333
"default": "./dist/cjs/*.js"
3434
},
3535
"import": {

‎packages/loaders/code-file/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"exports": {
1616
".": {
1717
"require": {
18-
"types": "./dist/typings/index.d.ts",
18+
"types": "./dist/typings/index.d.cts",
1919
"default": "./dist/cjs/index.js"
2020
},
2121
"import": {
@@ -29,7 +29,7 @@
2929
},
3030
"./*": {
3131
"require": {
32-
"types": "./dist/typings/*.d.ts",
32+
"types": "./dist/typings/*.d.cts",
3333
"default": "./dist/cjs/*.js"
3434
},
3535
"import": {

‎packages/loaders/git/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"exports": {
1616
".": {
1717
"require": {
18-
"types": "./dist/typings/index.d.ts",
18+
"types": "./dist/typings/index.d.cts",
1919
"default": "./dist/cjs/index.js"
2020
},
2121
"import": {
@@ -29,7 +29,7 @@
2929
},
3030
"./*": {
3131
"require": {
32-
"types": "./dist/typings/*.d.ts",
32+
"types": "./dist/typings/*.d.cts",
3333
"default": "./dist/cjs/*.js"
3434
},
3535
"import": {

‎packages/loaders/github/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"exports": {
1616
".": {
1717
"require": {
18-
"types": "./dist/typings/index.d.ts",
18+
"types": "./dist/typings/index.d.cts",
1919
"default": "./dist/cjs/index.js"
2020
},
2121
"import": {
@@ -29,7 +29,7 @@
2929
},
3030
"./*": {
3131
"require": {
32-
"types": "./dist/typings/*.d.ts",
32+
"types": "./dist/typings/*.d.cts",
3333
"default": "./dist/cjs/*.js"
3434
},
3535
"import": {

‎packages/loaders/graphql-file/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"exports": {
1616
".": {
1717
"require": {
18-
"types": "./dist/typings/index.d.ts",
18+
"types": "./dist/typings/index.d.cts",
1919
"default": "./dist/cjs/index.js"
2020
},
2121
"import": {
@@ -29,7 +29,7 @@
2929
},
3030
"./*": {
3131
"require": {
32-
"types": "./dist/typings/*.d.ts",
32+
"types": "./dist/typings/*.d.cts",
3333
"default": "./dist/cjs/*.js"
3434
},
3535
"import": {

‎packages/loaders/json-file/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"exports": {
1616
".": {
1717
"require": {
18-
"types": "./dist/typings/index.d.ts",
18+
"types": "./dist/typings/index.d.cts",
1919
"default": "./dist/cjs/index.js"
2020
},
2121
"import": {
@@ -29,7 +29,7 @@
2929
},
3030
"./*": {
3131
"require": {
32-
"types": "./dist/typings/*.d.ts",
32+
"types": "./dist/typings/*.d.cts",
3333
"default": "./dist/cjs/*.js"
3434
},
3535
"import": {

‎packages/loaders/module/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"exports": {
1616
".": {
1717
"require": {
18-
"types": "./dist/typings/index.d.ts",
18+
"types": "./dist/typings/index.d.cts",
1919
"default": "./dist/cjs/index.js"
2020
},
2121
"import": {
@@ -29,7 +29,7 @@
2929
},
3030
"./*": {
3131
"require": {
32-
"types": "./dist/typings/*.d.ts",
32+
"types": "./dist/typings/*.d.cts",
3333
"default": "./dist/cjs/*.js"
3434
},
3535
"import": {

‎packages/loaders/prisma/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"exports": {
1616
".": {
1717
"require": {
18-
"types": "./dist/typings/index.d.ts",
18+
"types": "./dist/typings/index.d.cts",
1919
"default": "./dist/cjs/index.js"
2020
},
2121
"import": {
@@ -29,7 +29,7 @@
2929
},
3030
"./*": {
3131
"require": {
32-
"types": "./dist/typings/*.d.ts",
32+
"types": "./dist/typings/*.d.cts",
3333
"default": "./dist/cjs/*.js"
3434
},
3535
"import": {

0 commit comments

Comments
 (0)
Please sign in to comment.