Skip to content

Commit

Permalink
fix: typescript commonjs module resolution with node16,nodenext (#8189)
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ru4l authored Aug 5, 2022
1 parent 47d0a57 commit b408f82
Show file tree
Hide file tree
Showing 62 changed files with 126 additions and 64 deletions.
62 changes: 62 additions & 0 deletions .changeset/cyan-pens-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
'@graphql-cli/codegen': patch
'@graphql-codegen/cli': patch
'@graphql-codegen/core': patch
'@graphql-codegen/c-sharp': patch
'@graphql-codegen/c-sharp-common': patch
'@graphql-codegen/c-sharp-operations': patch
'@graphql-codegen/flow': patch
'@graphql-codegen/flow-operations': patch
'@graphql-codegen/flow-resolvers': patch
'@graphql-codegen/java-apollo-android': patch
'@graphql-codegen/java-common': patch
'@graphql-codegen/java': patch
'@graphql-codegen/kotlin': patch
'@graphql-codegen/java-resolvers': patch
'@graphql-codegen/add': patch
'@graphql-codegen/fragment-matcher': patch
'@graphql-codegen/hasura-allow-list': patch
'@graphql-codegen/introspection': patch
'@graphql-codegen/jsdoc': patch
'@graphql-codegen/schema-ast': patch
'@graphql-codegen/time': patch
'@graphql-codegen/urql-introspection': patch
'@graphql-codegen/visitor-plugin-common': patch
'@graphql-codegen/typescript-apollo-angular': patch
'@graphql-codegen/typescript-apollo-client-helpers': patch
'@graphql-codegen/typescript-document-nodes': patch
'@graphql-codegen/typescript-enum-array': patch
'@graphql-codegen/typescript-generic-sdk': patch
'@graphql-codegen/gql-tag-operations': patch
'@graphql-codegen/typescript-graphql-apollo': patch
'@graphql-codegen/typescript-graphql-files-modules': patch
'@graphql-codegen/typescript-graphql-request': patch
'@graphql-codegen/typescript-jit-sdk': patch
'@graphql-codegen/typescript-mongodb': patch
'@graphql-codegen/typescript-msw': patch
'@graphql-codegen/named-operations-object': patch
'@graphql-codegen/typescript-oclif': patch
'@graphql-codegen/typescript-operations': patch
'@graphql-codegen/typescript-react-apollo': patch
'@graphql-codegen/typescript-react-offix': patch
'@graphql-codegen/typescript-react-query': patch
'@graphql-codegen/typescript-resolvers': patch
'@graphql-codegen/typescript-rtk-query': patch
'@graphql-codegen/typescript-stencil-apollo': patch
'@graphql-codegen/typescript-type-graphql': patch
'@graphql-codegen/typed-document-node': patch
'@graphql-codegen/typescript': patch
'@graphql-codegen/typescript-urql': patch
'@graphql-codegen/typescript-urql-graphcache': patch
'@graphql-codegen/urql-svelte-operations-store': patch
'@graphql-codegen/typescript-vue-apollo': patch
'@graphql-codegen/typescript-vue-apollo-smart-ops': patch
'@graphql-codegen/typescript-vue-urql': patch
'@graphql-codegen/gql-tag-operations-preset': patch
'@graphql-codegen/graphql-modules-preset': patch
'@graphql-codegen/import-types-preset': patch
'@graphql-codegen/near-operation-file-preset': patch
'@graphql-codegen/plugin-helpers': patch
---

Fix CommonJS TypeScript resolution with `moduleResolution` `node16` or `nodenext`
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"apollo-server": "3.10.0",
"auto-bind": "4.0.0",
"babel-jest": "27.5.1",
"bob-the-bundler": "3.0.1",
"bob-the-bundler": "4.0.0",
"chalk": "4.1.2",
"dotenv": "16.0.1",
"eslint": "8.19.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-cli-codegen-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-codegen-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-codegen-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/c-sharp/c-sharp-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/c-sharp/c-sharp-operations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/c-sharp/c-sharp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/flow/flow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/flow/operations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/flow/resolvers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/java/apollo-android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/java/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/java/java/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/java/kotlin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/java/resolvers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/other/add/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/other/fragment-matcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/other/hasura-allow-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/other/introspection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/other/jsdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/other/schema-ast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/other/time/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/other/urql-introspection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/other/visitor-plugin-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/apollo-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/document-nodes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/enum-array/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/generic-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/graphql-apollo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/graphql-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/jit-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/mongodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/typescript/msw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"exports": {
".": {
"require": {
"types": "./dist/typings/index.d.ts",
"types": "./dist/typings/index.d.cts",
"default": "./dist/cjs/index.js"
},
"import": {
Expand Down
Loading

1 comment on commit b408f82

@vercel
Copy link

@vercel vercel bot commented on b408f82 Aug 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.