Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Add export types to fix typescript moduleResolution:"node16" compatab…
Browse files Browse the repository at this point in the history
…ility (#2389)

* Update jest-extended

* Add types key to all exports fields

This adds typescript support when consumers are using
`moduleResolution:"node16"` in their tsconfig file.

The `types` and `typesVersions` field are still needed for consumers
that still use `moduleResolution:"node"`
  • Loading branch information
BPScott authored Aug 24, 2022
1 parent 395bf94 commit 03c1abc
Show file tree
Hide file tree
Showing 77 changed files with 296 additions and 188 deletions.
75 changes: 75 additions & 0 deletions .changeset/proud-suits-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
'@shopify/address': patch
'@shopify/address-consts': patch
'@shopify/address-mocks': patch
'@shopify/admin-graphql-api-utilities': patch
'@shopify/ast-utilities': patch
'@shopify/async': patch
'@shopify/browser': patch
'@shopify/csrf-token-fetcher': patch
'@shopify/css-utilities': patch
'@shopify/dates': patch
'@shopify/decorators': patch
'@shopify/function-enhancers': patch
'graphql-config-utilities': patch
'graphql-fixtures': patch
'graphql-mini-transforms': patch
'@shopify/graphql-testing': patch
'graphql-tool-utilities': patch
'graphql-typed': patch
'graphql-typescript-definitions': patch
'graphql-validate-fixtures': patch
'@shopify/i18n': patch
'@shopify/jest-dom-mocks': patch
'@shopify/jest-koa-mocks': patch
'@shopify/koa-liveness-ping': patch
'@shopify/koa-metrics': patch
'@shopify/koa-performance': patch
'@shopify/koa-shopify-graphql-proxy': patch
'@shopify/koa-shopify-webhooks': patch
'@shopify/logger': patch
'@shopify/mime-types': patch
'@shopify/network': patch
'@shopify/performance': patch
'@shopify/polyfills': patch
'@shopify/predicates': patch
'@shopify/react-app-bridge-universal-provider': patch
'@shopify/react-async': patch
'@shopify/react-bugsnag': patch
'@shopify/react-compose': patch
'@shopify/react-cookie': patch
'@shopify/react-csrf': patch
'@shopify/react-csrf-universal-provider': patch
'@shopify/react-effect': patch
'@shopify/react-form': patch
'@shopify/react-form-state': patch
'@shopify/react-google-analytics': patch
'@shopify/react-graphql': patch
'@shopify/react-graphql-universal-provider': patch
'@shopify/react-hooks': patch
'@shopify/react-html': patch
'@shopify/react-hydrate': patch
'@shopify/react-i18n': patch
'@shopify/react-i18n-universal-provider': patch
'@shopify/react-idle': patch
'@shopify/react-import-remote': patch
'@shopify/react-intersection-observer': patch
'@shopify/react-network': patch
'@shopify/react-performance': patch
'@shopify/react-router': patch
'@shopify/react-server': patch
'@shopify/react-shortcuts': patch
'@shopify/react-testing': patch
'@shopify/react-tracking-pixel': patch
'@shopify/react-universal-provider': patch
'@shopify/react-web-worker': patch
'@shopify/semaphore': patch
'@shopify/sewing-kit-koa': patch
'@shopify/statsd': patch
'@shopify/storybook-a11y-test': patch
'@shopify/useful-types': patch
'@shopify/web-worker': patch
'@shopify/with-env': patch
---

Add types field to package.json export maps to support typescript consumers that use `moduleResolution: "node16"`
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"graphql": "^15.4.0",
"graphql-tag": "^2.10.3",
"intl-pluralrules": "^0.2.1",
"jest-extended": "^0.11.5",
"jest-extended": "^3.0.2",
"jest-transform-graphql": "^2.1.0",
"plop": "^2.6.0",
"prettier": "~2.7.1",
Expand Down
1 change: 1 addition & 0 deletions packages/address-consts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/address-mocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/address/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/admin-graphql-api-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
3 changes: 3 additions & 0 deletions packages/ast-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,19 @@
"esnext": "index.esnext",
"exports": {
"./javascript": {
"types": "./build/ts/javascript/index.d.ts",
"esnext": "./javascript.esnext",
"import": "./javascript.mjs",
"require": "./javascript.js"
},
"./markdown": {
"types": "./build/ts/markdown/index.d.ts",
"esnext": "./markdown.esnext",
"import": "./markdown.mjs",
"require": "./markdown.js"
},
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
6 changes: 5 additions & 1 deletion packages/async/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@
"module": "index.mjs",
"esnext": "index.esnext",
"exports": {
"./babel": "./babel.js",
"./babel": {
"types": "./build/ts/babel-plugin.d.ts",
"default": "./babel.js"
},
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/csrf-token-fetcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/css-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/dates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/decorators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/function-enhancers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/graphql-config-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/graphql-fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
24 changes: 20 additions & 4 deletions packages/graphql-mini-transforms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"jest-simple": [
"./build/ts/jest-simple.d.ts"
],
"webpack": [
"./build/ts/webpack-loader.d.ts"
],
"webpack-loader": [
"./build/ts/webpack-loader.d.ts"
]
Expand Down Expand Up @@ -75,11 +78,24 @@
"module": "index.mjs",
"esnext": "index.esnext",
"exports": {
"./jest": "./jest.js",
"./jest-simple": "./jest-simple.js",
"./webpack-loader": "./webpack-loader.js",
"./webpack": "./webpack-loader.js",
"./jest": {
"types": "./build/ts/jest.d.ts",
"default": "./jest.js"
},
"./jest-simple": {
"types": "./build/ts/jest-simple.d.ts",
"default": "./build/ts/jest-simple.d.ts"
},
"./webpack-loader": {
"types": "./build/ts/webpack-loader.d.ts",
"default": "./webpack-loader.js"
},
"./webpack": {
"types": "./build/ts/webpack-loader.d.ts",
"default": "./webpack-loader.js"
},
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
2 changes: 2 additions & 0 deletions packages/graphql-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@
"esnext": "index.esnext",
"exports": {
"./matchers": {
"types": "./build/ts/matchers/index.d.ts",
"esnext": "./matchers.esnext",
"import": "./matchers.mjs",
"require": "./matchers.js"
},
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/graphql-tool-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/graphql-typed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/graphql-typescript-definitions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/graphql-validate-fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/jest-dom-mocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/jest-koa-mocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/koa-liveness-ping/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/koa-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/koa-performance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/koa-shopify-graphql-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/koa-shopify-webhooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/mime-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
1 change: 1 addition & 0 deletions packages/performance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"esnext": "index.esnext",
"exports": {
".": {
"types": "./build/ts/index.d.ts",
"esnext": "./index.esnext",
"import": "./index.mjs",
"require": "./index.js"
Expand Down
Loading

0 comments on commit 03c1abc

Please sign in to comment.