From 088a0202e4b95054ad0c4e33df6d53072d2b4991 Mon Sep 17 00:00:00 2001 From: Seppe Dekeyser Date: Sat, 7 Dec 2024 16:14:24 +0100 Subject: [PATCH] Fix @babel/parser and @babel/types version mismatches, fix type mismatch --- packages/houdini-react/package.json | 4 +- packages/houdini/package.json | 4 +- packages/houdini/src/lib/router/manifest.ts | 8 +- pnpm-lock.yaml | 119 +++++++------------- 4 files changed, 49 insertions(+), 86 deletions(-) diff --git a/packages/houdini-react/package.json b/packages/houdini-react/package.json index 1998f327e3..0559718d78 100644 --- a/packages/houdini-react/package.json +++ b/packages/houdini-react/package.json @@ -31,8 +31,8 @@ "scripts": "workspace:^" }, "dependencies": { - "@babel/parser": "^7.19.3", - "@babel/types": "^7.21.4", + "@babel/parser": "^7.24.6", + "@babel/types": "^7.24.6", "@whatwg-node/server": "^0.9.14", "cookie-parser": "^1.4.6", "cookie-session": "^2.0.0", diff --git a/packages/houdini/package.json b/packages/houdini/package.json index aa0d711e30..7f67831a34 100644 --- a/packages/houdini/package.json +++ b/packages/houdini/package.json @@ -20,7 +20,7 @@ "typedefs": "scripts typedefs" }, "devDependencies": { - "@babel/types": "^7.21.5", + "@babel/types": "^7.24.6", "@trivago/prettier-plugin-sort-imports": "^4.0.0", "@types/glob": "^8.0.0", "@types/minimatch": "^5.1.2", @@ -34,7 +34,7 @@ "vitest": "^1.6.0" }, "dependencies": { - "@babel/parser": "^7.23.9", + "@babel/parser": "^7.24.6", "@clack/prompts": "^0.6.3", "@graphql-tools/merge": "^9.0.0", "@graphql-tools/schema": "^9.0.4", diff --git a/packages/houdini/src/lib/router/manifest.ts b/packages/houdini/src/lib/router/manifest.ts index 4c9bcd7a76..0c4587f81e 100644 --- a/packages/houdini/src/lib/router/manifest.ts +++ b/packages/houdini/src/lib/router/manifest.ts @@ -314,7 +314,9 @@ export async function extractQueries(source: string): Promise { let defaultExportIdentifier: string | null = null // walk through the function body and find the default export - for (const node of ast.body) { + for (const n of ast.body) { + const node = n as t.Node // typecast from ast-types to @babel/types + if (t.isExportDefaultDeclaration(node)) { if ( t.isFunctionDeclaration(node.declaration) || @@ -334,7 +336,9 @@ export async function extractQueries(source: string): Promise { // if the default export was an identifier then go back through and find the correct one if (defaultExportIdentifier) { - for (const node of ast.body) { + for (const n of ast.body) { + const node = n as t.Node // typecast from ast-types to @babel/types + if (t.isVariableDeclaration(node)) { for (const declaration of node.declarations) { if ( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 81f4f5078e..440020c783 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -467,8 +467,8 @@ importers: packages/houdini: dependencies: '@babel/parser': - specifier: ^7.23.9 - version: 7.23.9 + specifier: ^7.24.6 + version: 7.24.6 '@clack/prompts': specifier: ^0.6.3 version: 0.6.3 @@ -543,8 +543,8 @@ importers: version: 1.7.0 devDependencies: '@babel/types': - specifier: ^7.21.5 - version: 7.21.5 + specifier: ^7.24.6 + version: 7.24.6 '@trivago/prettier-plugin-sort-imports': specifier: ^4.0.0 version: 4.0.0(@vue/compiler-sfc@3.2.47)(prettier@2.8.3) @@ -582,11 +582,11 @@ importers: packages/houdini-react: dependencies: '@babel/parser': - specifier: ^7.19.3 - version: 7.20.7 + specifier: ^7.24.6 + version: 7.24.6 '@babel/types': - specifier: ^7.21.4 - version: 7.21.4 + specifier: ^7.24.6 + version: 7.24.6 '@whatwg-node/server': specifier: ^0.9.14 version: 0.9.14 @@ -937,14 +937,6 @@ packages: resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.19.4': - resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-string-parser@7.21.5': - resolution: {integrity: sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==} - engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.24.6': resolution: {integrity: sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==} engines: {node: '>=6.9.0'} @@ -979,11 +971,6 @@ packages: engines: {node: '>=6.0.0'} hasBin: true - '@babel/parser@7.23.9': - resolution: {integrity: sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==} - engines: {node: '>=6.0.0'} - hasBin: true - '@babel/parser@7.24.6': resolution: {integrity: sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==} engines: {node: '>=6.0.0'} @@ -1102,14 +1089,6 @@ packages: resolution: {integrity: sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==} engines: {node: '>=6.9.0'} - '@babel/types@7.21.4': - resolution: {integrity: sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.21.5': - resolution: {integrity: sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q==} - engines: {node: '>=6.9.0'} - '@babel/types@7.24.6': resolution: {integrity: sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==} engines: {node: '>=6.9.0'} @@ -7784,10 +7763,10 @@ snapshots: '@babel/helper-compilation-targets': 7.21.4(@babel/core@7.17.8) '@babel/helper-module-transforms': 7.21.2 '@babel/helpers': 7.21.0 - '@babel/parser': 7.23.9 + '@babel/parser': 7.24.6 '@babel/template': 7.20.7 '@babel/traverse': 7.21.4 - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 convert-source-map: 1.9.0 debug: 4.3.4(supports-color@9.3.1) gensync: 1.0.0-beta.2 @@ -7804,10 +7783,10 @@ snapshots: '@babel/helper-compilation-targets': 7.21.4(@babel/core@7.20.7) '@babel/helper-module-transforms': 7.21.2 '@babel/helpers': 7.21.0 - '@babel/parser': 7.23.9 + '@babel/parser': 7.24.6 '@babel/template': 7.20.7 '@babel/traverse': 7.21.4 - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 convert-source-map: 1.9.0 debug: 4.3.4(supports-color@9.3.1) gensync: 1.0.0-beta.2 @@ -7824,10 +7803,10 @@ snapshots: '@babel/helper-compilation-targets': 7.21.4(@babel/core@7.21.4) '@babel/helper-module-transforms': 7.21.2 '@babel/helpers': 7.21.0 - '@babel/parser': 7.23.9 + '@babel/parser': 7.24.6 '@babel/template': 7.20.7 '@babel/traverse': 7.21.4 - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 convert-source-map: 1.9.0 debug: 4.3.4(supports-color@9.3.1) gensync: 1.0.0-beta.2 @@ -7838,19 +7817,19 @@ snapshots: '@babel/generator@7.17.7': dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 jsesc: 2.5.2 source-map: 0.5.7 '@babel/generator@7.20.7': dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 '@jridgewell/gen-mapping': 0.3.2 jsesc: 2.5.2 '@babel/generator@7.21.4': dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 '@jridgewell/gen-mapping': 0.3.2 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 @@ -7887,15 +7866,15 @@ snapshots: '@babel/helper-function-name@7.21.0': dependencies: '@babel/template': 7.20.7 - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 '@babel/helper-hoist-variables@7.18.6': dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 '@babel/helper-module-imports@7.18.6': dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 '@babel/helper-module-transforms@7.21.2': dependencies: @@ -7903,10 +7882,10 @@ snapshots: '@babel/helper-module-imports': 7.18.6 '@babel/helper-simple-access': 7.20.2 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/helper-validator-identifier': 7.19.1 + '@babel/helper-validator-identifier': 7.24.6 '@babel/template': 7.20.7 '@babel/traverse': 7.21.4 - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 transitivePeerDependencies: - supports-color @@ -7914,15 +7893,11 @@ snapshots: '@babel/helper-simple-access@7.20.2': dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 '@babel/helper-split-export-declaration@7.18.6': dependencies: - '@babel/types': 7.21.5 - - '@babel/helper-string-parser@7.19.4': {} - - '@babel/helper-string-parser@7.21.5': {} + '@babel/types': 7.24.6 '@babel/helper-string-parser@7.24.6': {} @@ -7936,27 +7911,23 @@ snapshots: dependencies: '@babel/template': 7.20.7 '@babel/traverse': 7.21.4 - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 transitivePeerDependencies: - supports-color '@babel/highlight@7.18.6': dependencies: - '@babel/helper-validator-identifier': 7.19.1 + '@babel/helper-validator-identifier': 7.24.6 chalk: 2.4.2 js-tokens: 4.0.0 '@babel/parser@7.18.9': dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 '@babel/parser@7.20.7': dependencies: - '@babel/types': 7.21.5 - - '@babel/parser@7.23.9': - dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 '@babel/parser@7.24.6': dependencies: @@ -8053,8 +8024,8 @@ snapshots: '@babel/template@7.20.7': dependencies: '@babel/code-frame': 7.21.4 - '@babel/parser': 7.23.9 - '@babel/types': 7.21.5 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 '@babel/traverse@7.17.3': dependencies: @@ -8064,8 +8035,8 @@ snapshots: '@babel/helper-function-name': 7.21.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.23.9 - '@babel/types': 7.21.5 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 debug: 4.3.4(supports-color@9.3.1) globals: 11.12.0 transitivePeerDependencies: @@ -8079,8 +8050,8 @@ snapshots: '@babel/helper-function-name': 7.21.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.23.9 - '@babel/types': 7.21.5 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 debug: 4.3.4(supports-color@9.3.1) globals: 11.12.0 transitivePeerDependencies: @@ -8094,8 +8065,8 @@ snapshots: '@babel/helper-function-name': 7.21.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.23.9 - '@babel/types': 7.21.5 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 debug: 4.3.4(supports-color@9.3.1) globals: 11.12.0 transitivePeerDependencies: @@ -8106,18 +8077,6 @@ snapshots: '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 - '@babel/types@7.21.4': - dependencies: - '@babel/helper-string-parser': 7.19.4 - '@babel/helper-validator-identifier': 7.19.1 - to-fast-properties: 2.0.0 - - '@babel/types@7.21.5': - dependencies: - '@babel/helper-string-parser': 7.21.5 - '@babel/helper-validator-identifier': 7.19.1 - to-fast-properties: 2.0.0 - '@babel/types@7.24.6': dependencies: '@babel/helper-string-parser': 7.24.6 @@ -9346,7 +9305,7 @@ snapshots: '@types/babel__traverse@7.18.3': dependencies: - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 '@types/body-parser@1.19.2': dependencies: @@ -12620,7 +12579,7 @@ snapshots: istanbul-lib-instrument@5.2.1: dependencies: '@babel/core': 7.21.4 - '@babel/parser': 7.23.9 + '@babel/parser': 7.24.6 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 6.3.1 @@ -12717,7 +12676,7 @@ snapshots: '@babel/plugin-syntax-jsx': 7.18.6(@babel/core@7.20.7) '@babel/plugin-syntax-typescript': 7.20.0(@babel/core@7.20.7) '@babel/traverse': 7.20.10 - '@babel/types': 7.21.5 + '@babel/types': 7.24.6 '@jest/expect-utils': 29.4.1 '@jest/transform': 29.4.1 '@jest/types': 29.4.1