From c64008410b058bf9d3f178ff8409c8cea0bf529c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Jul 2023 17:02:41 +0000 Subject: [PATCH 1/3] chore(deps): update [dev] minor and patch dependencies for gatsby-plugin-image --- packages/gatsby-plugin-image/package.json | 14 ++++---- yarn.lock | 40 +++++++++++------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/gatsby-plugin-image/package.json b/packages/gatsby-plugin-image/package.json index 16b8d40b3cf40..84da9362f0a93 100644 --- a/packages/gatsby-plugin-image/package.json +++ b/packages/gatsby-plugin-image/package.json @@ -44,13 +44,13 @@ "@babel/cli": "^7.20.7", "@babel/core": "^7.20.12", "@testing-library/react": "^11.2.7", - "@types/babel__core": "^7.20.0", - "@types/babel__traverse": "^7.18.3", + "@types/babel__core": "^7.20.1", + "@types/babel__traverse": "^7.20.1", "@types/fs-extra": "^9.0.13", - "@types/node": "^14.18.42", + "@types/node": "^14.18.53", "@types/prop-types": "^15.7.5", - "@types/react": "^18.0.31", - "@types/react-dom": "^18.0.11", + "@types/react": "^18.2.14", + "@types/react-dom": "^18.2.6", "ast-pretty-print": "^2.0.1", "babel-plugin-macros": "^3.1.0", "cross-env": "^7.0.3", @@ -59,10 +59,10 @@ "do-sync": "^3.1.1", "microbundle": "^0.15.1", "npm-run-all": "^4.1.5", - "postcss": "^8.4.21", + "postcss": "^8.4.24", "prepend-directive": "^1.1.0", "semver": "^7.5.3", - "terser": "^5.16.8", + "terser": "^5.18.2", "typescript": "^5.1.6" }, "peerDependencies": { diff --git a/yarn.lock b/yarn.lock index 5b71672b82af9..944901f08c26b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1390,7 +1390,7 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.0.0-beta.49", "@babel/types@^7.12.1", "@babel/types@^7.12.7", "@babel/types@^7.16.8", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.2.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/types@^7.0.0", "@babel/types@^7.0.0-beta.49", "@babel/types@^7.12.1", "@babel/types@^7.12.7", "@babel/types@^7.16.8", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.2.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== @@ -2329,10 +2329,10 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/source-map@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" - integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== +"@jridgewell/source-map@^0.3.3": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.5.tgz#a3bb4d5c6825aab0d281268f47f6ad5853431e91" + integrity sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ== dependencies: "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" @@ -4390,7 +4390,7 @@ resolved "https://registry.yarnpkg.com/@types/babel__code-frame/-/babel__code-frame-7.0.3.tgz#eda94e1b7c9326700a4b69c485ebbc9498a0b63f" integrity sha512-2TN6oiwtNjOezilFVl77zwdNPwQWaDBBCCWWxyo1ctiO3vAtd7H/aB/CBJdw9+kqq3+latD0SXoedIuHySSZWw== -"@types/babel__core@^7.1.14", "@types/babel__core@^7.20.0", "@types/babel__core@^7.20.1": +"@types/babel__core@^7.1.14", "@types/babel__core@^7.20.1": version "7.20.1" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.1.tgz#916ecea274b0c776fec721e333e55762d3a9614b" integrity sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw== @@ -4416,12 +4416,12 @@ "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6", "@types/babel__traverse@^7.18.3": - version "7.18.3" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.18.3.tgz#dfc508a85781e5698d5b33443416b6268c4b3e8d" - integrity sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w== +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6", "@types/babel__traverse@^7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.20.1.tgz#dd6f1d2411ae677dcb2db008c962598be31d6acf" + integrity sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg== dependencies: - "@babel/types" "^7.3.0" + "@babel/types" "^7.20.7" "@types/babylon@*": version "6.16.6" @@ -4832,7 +4832,7 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== -"@types/node@^14.18.42", "@types/node@^14.18.52": +"@types/node@^14.18.52", "@types/node@^14.18.53": version "14.18.53" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.53.tgz#42855629b8773535ab868238718745bf56c56219" integrity sha512-soGmOpVBUq+gaBMwom1M+krC/NNbWlosh4AtGA03SyWNDiqSKtwp7OulO1M6+mg8YkHMvJ/y0AkCeO8d1hNb7A== @@ -4897,14 +4897,14 @@ dependencies: "@types/react" "*" -"@types/react-dom@^18.0.11", "@types/react-dom@^18.2.6": +"@types/react-dom@^18.2.6": version "18.2.6" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.6.tgz#ad621fa71a8db29af7c31b41b2ea3d8a6f4144d1" integrity sha512-2et4PDvg6PVCyS7fuTc4gPoksV58bW0RwSxWKcPRcHZf0PRUGq03TKcD/rUHe3azfV6/5/biUBJw+HhCQjaP0A== dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.31", "@types/react@^18.2.14": +"@types/react@*", "@types/react@^18.2.14": version "18.2.14" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.14.tgz#fa7a6fecf1ce35ca94e74874f70c56ce88f7a127" integrity sha512-A0zjq+QN/O0Kpe30hA1GidzyFjatVvrpIvWLxD+xv67Vt91TWWgco9IvrJBkeyHm1trGaFS/FSGqPlhyeZRm0g== @@ -23164,13 +23164,13 @@ terser@^4.0.0: source-map "~0.6.1" source-map-support "~0.5.12" -terser@^5.0.0, terser@^5.10.0, terser@^5.16.8, terser@^5.2.0, terser@^5.7.0: - version "5.17.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.17.1.tgz#948f10830454761e2eeedc6debe45c532c83fd69" - integrity sha512-hVl35zClmpisy6oaoKALOpS0rDYLxRFLHhRuDlEGTKey9qHjS1w9GMORjuwIMt70Wan4lwsLYyWDVnWgF+KUEw== +terser@^5.0.0, terser@^5.10.0, terser@^5.16.8, terser@^5.18.2, terser@^5.2.0, terser@^5.7.0: + version "5.18.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.18.2.tgz#ff3072a0faf21ffd38f99acc9a0ddf7b5f07b948" + integrity sha512-Ah19JS86ypbJzTzvUCX7KOsEIhDaRONungA4aYBjEP3JZRf4ocuDzTg4QWZnPn9DEMiMYGJPiSOy7aykoCc70w== dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" commander "^2.20.0" source-map-support "~0.5.20" From c4f472dc36943030806a1dfdd8292ab210111659 Mon Sep 17 00:00:00 2001 From: LekoArts Date: Wed, 5 Jul 2023 13:25:17 +0200 Subject: [PATCH 2/3] fix type error --- packages/babel-plugin-remove-graphql-queries/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/babel-plugin-remove-graphql-queries/src/index.ts b/packages/babel-plugin-remove-graphql-queries/src/index.ts index d0f7f6bc27a69..d008bc0faed00 100644 --- a/packages/babel-plugin-remove-graphql-queries/src/index.ts +++ b/packages/babel-plugin-remove-graphql-queries/src/index.ts @@ -51,7 +51,7 @@ interface INestedHookVisitor { CallExpression: (path: NodePath) => void queryHash: string query: string - templatePaath: NodePath + templatePath: NodePath } class StringInterpolationNotAllowedError extends Error { @@ -443,12 +443,14 @@ export default function ({ types: t }): PluginObj { // modify StaticQuery elements and import data only if query is inside StaticQuery if (parent) { + // @ts-ignore - Weird type parent.traverse(nestedJSXVistor, { queryHash, query, }) // modify useStaticQuery elements and import data only if query is inside useStaticQuery + // @ts-ignore - Weird type parent.traverse(nestedHookVisitor, { queryHash, query, From dbe0177c4c5cd84cf9d5711ecd72a584dd7687f1 Mon Sep 17 00:00:00 2001 From: LekoArts Date: Wed, 5 Jul 2023 13:45:39 +0200 Subject: [PATCH 3/3] other type fix --- .../src/optimize-hook-destructuring.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/babel-preset-gatsby/src/optimize-hook-destructuring.ts b/packages/babel-preset-gatsby/src/optimize-hook-destructuring.ts index 874710275970a..c6d9991d7beeb 100644 --- a/packages/babel-preset-gatsby/src/optimize-hook-destructuring.ts +++ b/packages/babel-preset-gatsby/src/optimize-hook-destructuring.ts @@ -1,4 +1,4 @@ -import { NodePath, PluginObj, Visitor } from "@babel/core" +import { NodePath, PluginObj } from "@babel/core" import * as BabelTypes from "@babel/types" import { Program } from "@babel/types" @@ -21,8 +21,11 @@ export default function ({ }: { types: typeof BabelTypes }): PluginObj { - const visitor: Visitor = { - CallExpression(path, state: IState): void { + const visitor = { + CallExpression( + path: NodePath, + state: IState + ): void { const onlyBuiltIns = state.opts?.onlyBuiltIns || false // if specified, options.lib is a list of libraries that provide hook functions