diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 3ff70c0..3f0962c 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -42,6 +42,7 @@ "vite": "^3.0.0 || ^4.0.0" }, "dependencies": { + "estree-walker": "^3.0.3", "magic-string": "^0.30.0", "svelte": "^3.58.0", "svelte-parse-markup": "^0.1.1" diff --git a/packages/svelte/src/shared.js b/packages/svelte/src/shared.js index 30a04d4..9fdee22 100644 --- a/packages/svelte/src/shared.js +++ b/packages/svelte/src/shared.js @@ -1,5 +1,5 @@ import path from 'node:path' -import { walk } from 'svelte/compiler' +import { walk } from 'estree-walker' import { parse } from 'svelte-parse-markup' import MagicString from 'magic-string' import { dedent, hash } from '@whyframe/core/pluginutils' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bf52dfb..2d0f7d5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -171,6 +171,9 @@ importers: packages/svelte: dependencies: + estree-walker: + specifier: ^3.0.3 + version: 3.0.3 magic-string: specifier: ^0.30.0 version: 0.30.0 @@ -949,7 +952,7 @@ packages: dependencies: '@vitejs/plugin-vue': 4.2.3(vue@3.3.4) '@vitejs/plugin-vue-jsx': 3.0.1(vue@3.3.4) - '@vue/babel-plugin-jsx': 1.1.5 + '@vue/babel-plugin-jsx': 1.1.5(@babel/core@7.22.10) '@vue/compiler-sfc': 3.3.4 astro: 2.10.4 vue: 3.3.4 @@ -1872,18 +1875,6 @@ packages: '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 - /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.21.4): - resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - peerDependenciesMeta: - '@babel/core': - optional: true - dependencies: - '@babel/core': 7.21.4 - '@babel/helper-plugin-utils': 7.22.5 - /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.22.10): resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} engines: {node: '>=6.9.0'} @@ -2367,18 +2358,6 @@ packages: '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 - /@babel/plugin-transform-react-jsx-development@7.18.6: - resolution: {integrity: sha512-SA6HEjwYFKF7WDjWcMcMGUimmw/nhNRDWxr+KaLSCrkD/LMDBvWRmHAYgE1HDeF8KUuI8OAu+RT6EOtKxSW2qA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - peerDependenciesMeta: - '@babel/core': - optional: true - dependencies: - '@babel/plugin-transform-react-jsx': 7.21.0(@babel/core@7.21.4) - dev: true - /@babel/plugin-transform-react-jsx-development@7.18.6(@babel/core@7.21.4): resolution: {integrity: sha512-SA6HEjwYFKF7WDjWcMcMGUimmw/nhNRDWxr+KaLSCrkD/LMDBvWRmHAYgE1HDeF8KUuI8OAu+RT6EOtKxSW2qA==} engines: {node: '>=6.9.0'} @@ -2389,7 +2368,7 @@ packages: optional: true dependencies: '@babel/core': 7.21.4 - '@babel/plugin-transform-react-jsx': 7.22.5(@babel/core@7.21.4) + '@babel/plugin-transform-react-jsx': 7.21.0(@babel/core@7.21.4) /@babel/plugin-transform-react-jsx-self@7.21.0(@babel/core@7.21.4): resolution: {integrity: sha512-f/Eq+79JEu+KUANFks9UZCcvydOOGMgF7jBrcwjHa5jTZD8JivnhCJYvmlhR/WTXBWonDExPoW0eO/CR4QJirA==} @@ -2433,22 +2412,6 @@ packages: '@babel/plugin-syntax-jsx': 7.21.4(@babel/core@7.21.4) '@babel/types': 7.21.4 - /@babel/plugin-transform-react-jsx@7.22.5(@babel/core@7.21.4): - resolution: {integrity: sha512-rog5gZaVbUip5iWDMTYbVM15XQq+RkUKhET/IHR6oizR+JEoN6CAfTTuHcK4vwUyzca30qqHqEpzBOnaRMWYMA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - peerDependenciesMeta: - '@babel/core': - optional: true - dependencies: - '@babel/core': 7.21.4 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-module-imports': 7.22.5 - '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.21.4) - '@babel/types': 7.22.10 - /@babel/plugin-transform-react-jsx@7.22.5(@babel/core@7.22.10): resolution: {integrity: sha512-rog5gZaVbUip5iWDMTYbVM15XQq+RkUKhET/IHR6oizR+JEoN6CAfTTuHcK4vwUyzca30qqHqEpzBOnaRMWYMA==} engines: {node: '>=6.9.0'} @@ -4660,7 +4623,7 @@ packages: optional: true dependencies: '@babel/plugin-transform-react-jsx': 7.21.0(@babel/core@7.21.4) - '@babel/plugin-transform-react-jsx-development': 7.18.6 + '@babel/plugin-transform-react-jsx-development': 7.18.6(@babel/core@7.21.4) '@prefresh/vite': 2.2.9(preact@10.13.2)(vite@4.4.9) '@rollup/pluginutils': 4.2.1 babel-plugin-transform-hook-names: 1.0.2 @@ -5305,12 +5268,12 @@ packages: resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==} dependencies: '@types/eslint': 8.37.0 - '@types/estree': 0.0.51 + '@types/estree': 1.0.1 /@types/eslint@8.37.0: resolution: {integrity: sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ==} dependencies: - '@types/estree': 0.0.51 + '@types/estree': 1.0.1 '@types/json-schema': 7.0.11 /@types/estree-jsx@1.0.0: @@ -5322,12 +5285,8 @@ packages: /@types/estree@0.0.51: resolution: {integrity: sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==} - /@types/estree@1.0.0: - resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} - /@types/estree@1.0.1: resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} - dev: true /@types/express-serve-static-core@4.17.33: resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==} @@ -5711,27 +5670,6 @@ packages: resolution: {integrity: sha512-SgUymFpMoAyWeYWLAY+MkCK3QEROsiUnfaw5zxOVD/M64KQs8D/4oK6Q5omVA2hnvEOE0SCkH2TZxs/jnnUj7w==} dev: true - /@vue/babel-plugin-jsx@1.1.5: - resolution: {integrity: sha512-nKs1/Bg9U1n3qSWnsHhCVQtAzI6aQXqua8j/bZrau8ywT1ilXQbK4FwEJGmU8fV7tcpuFvWmmN7TMmV1OBma1g==} - peerDependencies: - '@babel/core': ^7.0.0-0 - peerDependenciesMeta: - '@babel/core': - optional: true - dependencies: - '@babel/helper-module-imports': 7.22.5 - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.21.4) - '@babel/template': 7.22.5 - '@babel/traverse': 7.22.10 - '@babel/types': 7.22.10 - '@vue/babel-helper-vue-transform-on': 1.1.5 - camelcase: 6.3.0 - html-tags: 3.3.1 - svg-tags: 1.0.0 - transitivePeerDependencies: - - supports-color - dev: true - /@vue/babel-plugin-jsx@1.1.5(@babel/core@7.22.10): resolution: {integrity: sha512-nKs1/Bg9U1n3qSWnsHhCVQtAzI6aQXqua8j/bZrau8ywT1ilXQbK4FwEJGmU8fV7tcpuFvWmmN7TMmV1OBma1g==} peerDependencies: @@ -6533,7 +6471,7 @@ packages: optional: true dependencies: '@babel/helper-module-imports': 7.18.6 - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.21.4) + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.10) '@babel/types': 7.22.10 html-entities: 2.3.3 validate-html-nesting: 1.2.2 @@ -8199,7 +8137,7 @@ packages: /estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} dependencies: - '@types/estree': 1.0.0 + '@types/estree': 1.0.1 /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}