Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 0c29146

Browse files
committed
Removing lib-dom types from tsconfig
We don't need to include those, since we're relying on native fetch APIs / node-fetch
1 parent b147bd5 commit 0c29146

File tree

11 files changed

+69
-17
lines changed

11 files changed

+69
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@babel/plugin-transform-async-to-generator": "^7.20.7",
2121
"@babel/plugin-transform-runtime": "^7.21.0",
2222
"@babel/preset-env": "^7.23.8",
23-
"@babel/preset-typescript": "^7.21.0",
23+
"@babel/preset-typescript": "^7.23.3",
2424
"@changesets/changelog-github": "^0.5.0",
2525
"@changesets/cli": "^2.22.0",
2626
"@rollup/plugin-babel": "^6.0.3",

packages/admin-api-client/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"declaration": true,
66
"declarationMap": true,
77
"target": "ES2022",
8-
"lib": ["ESNext", "DOM"],
8+
"lib": ["ESNext"],
99
"rootDir": "src",
1010
"baseUrl": "src",
1111
"strict": true,

packages/graphql-client/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"declaration": true,
66
"declarationMap": true,
77
"target": "ES2022",
8-
"lib": ["ESNext", "DOM"],
8+
"lib": ["ESNext"],
99
"rootDir": "src",
1010
"baseUrl": "src",
1111
"strict": true,

packages/shopify-api/lib/auth/oauth/oauth.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
BeginParams,
2929
CallbackParams,
3030
AuthQuery,
31+
AccessTokenResponse,
3132
} from './types';
3233
import {nonce} from './nonce';
3334
import {safeCompare} from './safe-compare';
@@ -206,7 +207,7 @@ export function callback(config: ConfigInterface): OAuthCallback {
206207
}
207208

208209
const session: Session = createSession({
209-
accessTokenResponse: await postResponse.json(),
210+
accessTokenResponse: await postResponse.json<AccessTokenResponse>(),
210211
shop: cleanShop,
211212
state: stateFromCookie,
212213
config,

packages/shopify-api/lib/auth/oauth/token-exchange.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {abstractFetch} from '../../../runtime';
77
import {DataType} from '../../clients/types';
88

99
import {createSession} from './create-session';
10+
import {AccessTokenResponse} from './types';
1011

1112
export enum RequestedTokenType {
1213
OnlineAccessToken = 'urn:shopify:params:oauth:token-type:online-access-token',
@@ -64,7 +65,7 @@ export function tokenExchange(config: ConfigInterface): TokenExchange {
6465

6566
return {
6667
session: createSession({
67-
accessTokenResponse: await postResponse.json(),
68+
accessTokenResponse: await postResponse.json<AccessTokenResponse>(),
6869
shop: cleanShop,
6970
// We need to keep this as an empty string as our template DB schemas have this required
7071
state: '',

packages/shopify-api/lib/clients/common.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {LIBRARY_NAME} from '../types';
1010
import {ConfigInterface} from '../base-types';
1111
import {SHOPIFY_API_LIBRARY_VERSION} from '../version';
1212
import {
13-
AbstractFetchFunc,
1413
abstractRuntimeString,
1514
canonicalizeHeaders,
1615
getHeader,
@@ -59,7 +58,7 @@ export function clientLoggerFactory(config: ConfigInterface) {
5958

6059
export function throwFailedRequest(
6160
body: any,
62-
response: Awaited<ReturnType<AbstractFetchFunc>>,
61+
response: Response,
6362
atMaxRetries: boolean,
6463
): never {
6564
const responseHeaders = canonicalizeHeaders(

packages/shopify-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"@swc/core": "^1.3.100",
8686
"@types/express": "^4.17.13",
8787
"@types/node": "^20.11.6",
88-
"@types/node-fetch": "^2.5.7",
88+
"@types/node-fetch": "^2.6.11",
8989
"@types/supertest": "^2.0.10",
9090
"@types/uuid": "^9.0.0",
9191
"express": "^4.17.13",

packages/shopify-api/runtime/http/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export interface AdapterArgs {
2222
rawResponse?: AdapterResponse;
2323
}
2424

25-
export type AbstractFetchFunc = typeof fetch;
25+
export type AbstractFetchFunc = (
26+
...params: Parameters<typeof fetch>
27+
) => Promise<Response>;
2628

2729
export type AbstractConvertRequestFunc = (
2830
adapterArgs: AdapterArgs,

packages/shopify-api/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"baseUrl": ".",
66
"rootDir": ".",
77
"lib": [
8-
"dom",
98
"dom.iterable",
109
"es2015",
1110
"es2016",

packages/storefront-api-client/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"declaration": true,
66
"declarationMap": true,
77
"target": "ES2022",
8-
"lib": ["ESNext", "DOM"],
8+
"lib": ["ESNext"],
99
"rootDir": "src",
1010
"baseUrl": "src",
1111
"strict": true,

yarn.lock

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,21 @@
145145
"@babel/helper-split-export-declaration" "^7.22.6"
146146
semver "^6.3.1"
147147

148+
"@babel/helper-create-class-features-plugin@^7.23.6":
149+
version "7.23.7"
150+
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.7.tgz#b2e6826e0e20d337143655198b79d58fdc9bd43d"
151+
integrity sha512-xCoqR/8+BoNnXOY7RVSgv6X+o7pmT5q1d+gGcRlXYkI+9B31glE4jeejhKVpA04O1AtzOt7OSQ6VYKP5FcRl9g==
152+
dependencies:
153+
"@babel/helper-annotate-as-pure" "^7.22.5"
154+
"@babel/helper-environment-visitor" "^7.22.20"
155+
"@babel/helper-function-name" "^7.23.0"
156+
"@babel/helper-member-expression-to-functions" "^7.23.0"
157+
"@babel/helper-optimise-call-expression" "^7.22.5"
158+
"@babel/helper-replace-supers" "^7.22.20"
159+
"@babel/helper-skip-transparent-expression-wrappers" "^7.22.5"
160+
"@babel/helper-split-export-declaration" "^7.22.6"
161+
semver "^6.3.1"
162+
148163
"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.22.15", "@babel/helper-create-regexp-features-plugin@^7.22.5":
149164
version "7.22.15"
150165
resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz#5ee90093914ea09639b01c711db0d6775e558be1"
@@ -185,7 +200,7 @@
185200
dependencies:
186201
"@babel/types" "^7.22.5"
187202

188-
"@babel/helper-member-expression-to-functions@^7.22.15":
203+
"@babel/helper-member-expression-to-functions@^7.22.15", "@babel/helper-member-expression-to-functions@^7.23.0":
189204
version "7.23.0"
190205
resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366"
191206
integrity sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==
@@ -499,6 +514,13 @@
499514
dependencies:
500515
"@babel/helper-plugin-utils" "^7.22.5"
501516

517+
"@babel/plugin-syntax-jsx@^7.23.3":
518+
version "7.23.3"
519+
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473"
520+
integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==
521+
dependencies:
522+
"@babel/helper-plugin-utils" "^7.22.5"
523+
502524
"@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3":
503525
version "7.10.4"
504526
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699"
@@ -562,6 +584,13 @@
562584
dependencies:
563585
"@babel/helper-plugin-utils" "^7.22.5"
564586

587+
"@babel/plugin-syntax-typescript@^7.23.3":
588+
version "7.23.3"
589+
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz#24f460c85dbbc983cd2b9c4994178bcc01df958f"
590+
integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==
591+
dependencies:
592+
"@babel/helper-plugin-utils" "^7.22.5"
593+
565594
"@babel/plugin-syntax-unicode-sets-regex@^7.18.6":
566595
version "7.18.6"
567596
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz#d49a3b3e6b52e5be6740022317580234a6a47357"
@@ -997,6 +1026,16 @@
9971026
"@babel/helper-plugin-utils" "^7.22.5"
9981027
"@babel/plugin-syntax-typescript" "^7.22.5"
9991028

1029+
"@babel/plugin-transform-typescript@^7.23.3":
1030+
version "7.23.6"
1031+
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.6.tgz#aa36a94e5da8d94339ae3a4e22d40ed287feb34c"
1032+
integrity sha512-6cBG5mBvUu4VUD04OHKnYzbuHNP8huDsD3EDqqpIpsswTDoqHCjLoHb6+QgsV1WsT2nipRqCPgxD3LXnEO7XfA==
1033+
dependencies:
1034+
"@babel/helper-annotate-as-pure" "^7.22.5"
1035+
"@babel/helper-create-class-features-plugin" "^7.23.6"
1036+
"@babel/helper-plugin-utils" "^7.22.5"
1037+
"@babel/plugin-syntax-typescript" "^7.23.3"
1038+
10001039
"@babel/plugin-transform-unicode-escapes@^7.23.3":
10011040
version "7.23.3"
10021041
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.23.3.tgz#1f66d16cab01fab98d784867d24f70c1ca65b925"
@@ -1135,7 +1174,7 @@
11351174
"@babel/plugin-transform-react-jsx-development" "^7.22.5"
11361175
"@babel/plugin-transform-react-pure-annotations" "^7.22.5"
11371176

1138-
"@babel/preset-typescript@^7.16.0", "@babel/preset-typescript@^7.21.0":
1177+
"@babel/preset-typescript@^7.16.0":
11391178
version "7.23.2"
11401179
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.23.2.tgz#c8de488130b7081f7e1482936ad3de5b018beef4"
11411180
integrity sha512-u4UJc1XsS1GhIGteM8rnGiIvf9rJpiVgMEeCnwlLA7WJPC+jcXWJAGxYmeqs5hOZD8BbAfnV5ezBOxQbb4OUxA==
@@ -1146,6 +1185,17 @@
11461185
"@babel/plugin-transform-modules-commonjs" "^7.23.0"
11471186
"@babel/plugin-transform-typescript" "^7.22.15"
11481187

1188+
"@babel/preset-typescript@^7.23.3":
1189+
version "7.23.3"
1190+
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.23.3.tgz#14534b34ed5b6d435aa05f1ae1c5e7adcc01d913"
1191+
integrity sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ==
1192+
dependencies:
1193+
"@babel/helper-plugin-utils" "^7.22.5"
1194+
"@babel/helper-validator-option" "^7.22.15"
1195+
"@babel/plugin-syntax-jsx" "^7.23.3"
1196+
"@babel/plugin-transform-modules-commonjs" "^7.23.3"
1197+
"@babel/plugin-transform-typescript" "^7.23.3"
1198+
11491199
"@babel/regjsgen@^0.8.0":
11501200
version "0.8.0"
11511201
resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310"
@@ -3091,10 +3141,10 @@
30913141
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.5.tgz#ec10755e871497bcd83efe927e43ec46e8c0747e"
30923142
integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==
30933143

3094-
"@types/node-fetch@^2.5.7":
3095-
version "2.6.9"
3096-
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.9.tgz#15f529d247f1ede1824f7e7acdaa192d5f28071e"
3097-
integrity sha512-bQVlnMLFJ2d35DkPNjEPmd9ueO/rh5EiaZt2bhqiSarPjZIuIV6bPQVqcrEyvNo+AfTrRGVazle1tl597w3gfA==
3144+
"@types/node-fetch@^2.6.11":
3145+
version "2.6.11"
3146+
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.11.tgz#9b39b78665dae0e82a08f02f4967d62c66f95d24"
3147+
integrity sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==
30983148
dependencies:
30993149
"@types/node" "*"
31003150
form-data "^4.0.0"

0 commit comments

Comments
 (0)