Skip to content

Commit

Permalink
fix: typescript commonjs module resolution with node16,nodenext (#4624)
Browse files Browse the repository at this point in the history
* fix: typescript commonjs resolution

* fix: bob paths

* upgrade bob

* use stable bob version

* Update .changeset/fluffy-pianos-know.md
  • Loading branch information
n1ru4l authored Aug 5, 2022
1 parent a56082b commit e3167ed
Show file tree
Hide file tree
Showing 35 changed files with 109 additions and 74 deletions.
36 changes: 36 additions & 0 deletions .changeset/fluffy-pianos-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
'@graphql-tools/batch-delegate': patch
'@graphql-tools/batch-execute': patch
'@graphql-tools/delegate': patch
'@graphql-tools/graphql-tag-pluck': patch
'graphql-tools': patch
'@graphql-tools/import': patch
'@graphql-tools/jest-transform': patch
'@graphql-tools/links': patch
'@graphql-tools/load': patch
'@graphql-tools/load-files': patch
'@graphql-tools/apollo-engine-loader': patch
'@graphql-tools/code-file-loader': patch
'@graphql-tools/git-loader': patch
'@graphql-tools/github-loader': patch
'@graphql-tools/graphql-file-loader': patch
'@graphql-tools/json-file-loader': patch
'@graphql-tools/module-loader': patch
'@graphql-tools/prisma-loader': patch
'@graphql-tools/url-loader': patch
'@graphql-tools/merge': patch
'@graphql-tools/mock': patch
'@graphql-tools/node-require': patch
'@graphql-tools/optimize': patch
'@graphql-tools/relay-operation-optimizer': patch
'@graphql-tools/resolvers-composition': patch
'@graphql-tools/schema': patch
'@graphql-tools/stitch': patch
'@graphql-tools/stitching-directives': patch
'@graphql-tools/utils': patch
'@graphql-tools/webpack-loader': patch
'@graphql-tools/webpack-loader-runtime': patch
'@graphql-tools/wrap': patch
---

Fix CommonJS TypeScript resolution with `moduleResolution` `node16` or `nodenext`
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@typescript-eslint/eslint-plugin": "5.32.0",
"@typescript-eslint/parser": "5.32.0",
"babel-jest": "28.1.3",
"bob-the-bundler": "2.0.0",
"bob-the-bundler": "4.0.0",
"chalk": "4.1.2",
"concurrently": "7.3.0",
"eslint": "8.21.0",
Expand Down Expand Up @@ -83,10 +83,10 @@
]
},
"workspaces": [
"./packages/*",
"./packages/loaders/*",
"./website",
"./benchmark/*"
"packages/*",
"packages/loaders/*",
"website",
"benchmark/*"
],
"resolutions": {
"graphql": "16.5.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/batch-delegate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -28,7 +28,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/batch-execute/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -28,7 +28,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/delegate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -28,7 +28,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql-tag-pluck/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -28,7 +28,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -28,7 +28,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -29,7 +29,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-transform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -28,7 +28,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -28,7 +28,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/load-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -29,7 +29,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/load/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -29,7 +29,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/loaders/apollo-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -29,7 +29,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/loaders/code-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -29,7 +29,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/loaders/git/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -29,7 +29,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/loaders/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -29,7 +29,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/loaders/graphql-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -29,7 +29,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/loaders/json-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -29,7 +29,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/loaders/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -29,7 +29,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
4 changes: 2 additions & 2 deletions packages/loaders/prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand All @@ -29,7 +29,7 @@
},
"./*": {
"require": {
"types": "./dist/typings/*.d.ts",
"types": "./dist/typings/*.d.cts",
"default": "./dist/cjs/*.js"
},
"import": {
Expand Down
Loading

0 comments on commit e3167ed

Please sign in to comment.