From daefd5769506dfa3abc77d5b1f07a23cacacdda0 Mon Sep 17 00:00:00 2001 From: bluwy Date: Thu, 18 Jul 2024 20:21:22 +0800 Subject: [PATCH] Fix Svelte 5 slots --- .changeset/nine-carpets-doubt.md | 5 + examples/framework-svelte/astro.config.mjs | 6 - package.json | 3 +- packages/integrations/svelte/package.json | 2 +- pnpm-lock.yaml | 208 ++++++++++++--------- 5 files changed, 129 insertions(+), 95 deletions(-) create mode 100644 .changeset/nine-carpets-doubt.md diff --git a/.changeset/nine-carpets-doubt.md b/.changeset/nine-carpets-doubt.md new file mode 100644 index 000000000000..5abe918afe65 --- /dev/null +++ b/.changeset/nine-carpets-doubt.md @@ -0,0 +1,5 @@ +--- +'@astrojs/svelte': minor +--- + +Bumps Svelte 5 peer dependency to `^5.0.0-next.190` and support the latest slots/snippets API diff --git a/examples/framework-svelte/astro.config.mjs b/examples/framework-svelte/astro.config.mjs index 2b13cb03f64c..194e4591765f 100644 --- a/examples/framework-svelte/astro.config.mjs +++ b/examples/framework-svelte/astro.config.mjs @@ -5,10 +5,4 @@ import svelte from '@astrojs/svelte'; export default defineConfig({ // Enable Svelte to support Svelte components. integrations: [svelte()], - devToolbar: { enabled: false }, - vite: { - optimizeDeps: { - force: true, - }, - }, }); diff --git a/package.json b/package.json index baeb1f7e871f..d1948fb2bb06 100644 --- a/package.json +++ b/package.json @@ -91,8 +91,7 @@ }, "overrides": { "organize-imports-cli>ts-morph": "^19.0.0", - "tsconfig-resolver>type-fest": "3.0.0", - "svelte": "link:../svelte/packages/svelte" + "tsconfig-resolver>type-fest": "3.0.0" }, "peerDependencyRules": { "ignoreMissing": [ diff --git a/packages/integrations/svelte/package.json b/packages/integrations/svelte/package.json index 7d544328aca7..521daae536e3 100644 --- a/packages/integrations/svelte/package.json +++ b/packages/integrations/svelte/package.json @@ -61,7 +61,7 @@ }, "peerDependencies": { "astro": "^4.0.0", - "svelte": "^4.0.0 || ^5.0.0-next.90", + "svelte": "^4.0.0 || ^5.0.0-next.190", "typescript": "^5.3.3" }, "engines": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 897ab681df38..b73390f55349 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,7 +7,6 @@ settings: overrides: organize-imports-cli>ts-morph: ^19.0.0 tsconfig-resolver>type-fest: 3.0.0 - svelte: link:../svelte/packages/svelte packageExtensionsChecksum: 43e9b7451c9943c617aef017ec172155 @@ -247,8 +246,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../svelte/packages/svelte - version: link:../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -310,8 +309,8 @@ importers: specifier: ^4.11.6 version: link:../../packages/astro svelte: - specifier: link:../../../svelte/packages/svelte - version: link:../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 examples/framework-vue: dependencies: @@ -425,8 +424,8 @@ importers: specifier: ^4.11.6 version: link:../../packages/astro svelte: - specifier: link:../../../svelte/packages/svelte - version: link:../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 examples/starlog: dependencies: @@ -1029,8 +1028,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1153,8 +1152,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1222,8 +1221,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1281,8 +1280,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1321,8 +1320,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1361,8 +1360,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1401,8 +1400,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1441,8 +1440,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1481,8 +1480,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1668,8 +1667,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/e2e/fixtures/tailwindcss: dependencies: @@ -1728,8 +1727,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1872,8 +1871,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -1893,8 +1892,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/alias-tsconfig: dependencies: @@ -1908,8 +1907,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/alias-tsconfig-baseurl-only: dependencies: @@ -1920,8 +1919,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/alias-tsconfig/deps/namespace-package: {} @@ -2045,8 +2044,8 @@ importers: specifier: ^10.22.1 version: 10.22.1 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -2078,8 +2077,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/astro-client-only/pkg: {} @@ -2170,8 +2169,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/astro-env: dependencies: @@ -2494,8 +2493,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -2578,8 +2577,8 @@ importers: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/component-library-shared: dependencies: @@ -2830,8 +2829,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/css-import-as-inline: dependencies: @@ -3082,8 +3081,8 @@ importers: specifier: ^10.22.1 version: 10.22.1 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -3280,8 +3279,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -3468,8 +3467,8 @@ importers: specifier: ^1.8.18 version: 1.8.18 svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -3662,8 +3661,8 @@ importers: specifier: workspace:* version: link:../../../.. svelte: - specifier: link:../../../../../../../svelte/packages/svelte - version: link:../../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/server-islands/ssr: dependencies: @@ -3674,8 +3673,8 @@ importers: specifier: workspace:* version: link:../../../.. svelte: - specifier: link:../../../../../../../svelte/packages/svelte - version: link:../../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/set-html: dependencies: @@ -3743,8 +3742,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/slots-vue: dependencies: @@ -4068,8 +4067,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 packages/astro/test/fixtures/tailwindcss: dependencies: @@ -4191,8 +4190,8 @@ importers: specifier: workspace:* version: link:../../.. svelte: - specifier: link:../../../../../../svelte/packages/svelte - version: link:../../../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vue: specifier: ^3.4.31 version: 3.4.31(typescript@5.5.3) @@ -5352,10 +5351,10 @@ importers: dependencies: '@sveltejs/vite-plugin-svelte': specifier: ^3.1.1 - version: 3.1.1(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) + version: 3.1.1(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) svelte2tsx: specifier: ^0.7.13 - version: 0.7.13(svelte@svelte+packages+svelte)(typescript@5.5.3) + version: 0.7.13(svelte@4.2.18)(typescript@5.5.3) devDependencies: astro: specifier: workspace:* @@ -5364,8 +5363,8 @@ importers: specifier: workspace:* version: link:../../../scripts svelte: - specifier: link:../../../../svelte/packages/svelte - version: link:../../../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 vite: specifier: ^5.3.4 version: 5.3.4(@types/node@20.12.7)(sass@1.77.8) @@ -5969,8 +5968,8 @@ importers: specifier: ^6.1.0 version: 6.1.0 svelte: - specifier: link:../../svelte/packages/svelte - version: link:../../svelte/packages/svelte + specifier: ^4.2.18 + version: 4.2.18 tar: specifier: ^7.4.0 version: 7.4.0 @@ -7318,14 +7317,14 @@ packages: engines: {node: ^18.0.0 || >=20} peerDependencies: '@sveltejs/vite-plugin-svelte': ^3.0.0 - svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte + svelte: ^4.0.0 || ^5.0.0-next.0 vite: ^5.0.0 '@sveltejs/vite-plugin-svelte@3.1.1': resolution: {integrity: sha512-rimpFEAboBBHIlzISibg94iP09k/KYdHgVhJlcsTfn7KMBhc70jFX/GRWkRdFCc2fdnk+4+Bdfej23cMDnJS6A==} engines: {node: ^18.0.0 || >=20} peerDependencies: - svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte + svelte: ^4.0.0 || ^5.0.0-next.0 vite: ^5.0.0 '@tailwindcss/forms@0.5.7': @@ -8168,6 +8167,9 @@ packages: code-block-writer@12.0.0: resolution: {integrity: sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==} + code-red@1.0.4: + resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} + collapse-white-space@2.1.0: resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} @@ -9447,6 +9449,9 @@ packages: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} + locate-character@3.0.0: + resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} + locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -11012,14 +11017,18 @@ packages: resolution: {integrity: sha512-Gyc7cOS3VJzLlfj7wKS0ZnzDVdv3Pn2IuVeJPk9m2skfhcu5bq3wtIZyQGggr7/Iim5rH5cncyQft/kRLupcnA==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: - svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte + svelte: ^3.19.0 || ^4.0.0 svelte2tsx@0.7.13: resolution: {integrity: sha512-aObZ93/kGAiLXA/I/kP+x9FriZM+GboB/ReOIGmLNbVGEd2xC+aTCppm3mk1cc9I/z60VQf7b2QDxC3jOXu3yw==} peerDependencies: - svelte: link:/Users/bjorn/Work/oss/svelte/packages/svelte + svelte: ^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0 typescript: ^4.9.4 || ^5.0.0 + svelte@4.2.18: + resolution: {integrity: sha512-d0FdzYIiAePqRJEb90WlJDkjUEx42xhivxN8muUBmfZnP+tzUgz12DJ2hRJi8sIHCME7jeK1PTMgKPSfTd8JrA==} + engines: {node: '>=16'} + svg-tags@1.0.0: resolution: {integrity: sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==} @@ -13219,24 +13228,24 @@ snapshots: dependencies: solid-js: 1.8.18 - '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)))(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8))': + '@sveltejs/vite-plugin-svelte-inspector@2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)))(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8))': dependencies: - '@sveltejs/vite-plugin-svelte': 3.1.1(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) + '@sveltejs/vite-plugin-svelte': 3.1.1(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) debug: 4.3.5 - svelte: link:../svelte/packages/svelte + svelte: 4.2.18 vite: 5.3.4(@types/node@20.12.7)(sass@1.77.8) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@3.1.1(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8))': + '@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)))(svelte@svelte+packages+svelte)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) + '@sveltejs/vite-plugin-svelte-inspector': 2.1.0(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)))(svelte@4.2.18)(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) debug: 4.3.5 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.10 - svelte: link:../svelte/packages/svelte - svelte-hmr: 0.16.0(svelte@svelte+packages+svelte) + svelte: 4.2.18 + svelte-hmr: 0.16.0(svelte@4.2.18) vite: 5.3.4(@types/node@20.12.7)(sass@1.77.8) vitefu: 0.2.5(vite@5.3.4(@types/node@20.12.7)(sass@1.77.8)) transitivePeerDependencies: @@ -14275,6 +14284,14 @@ snapshots: code-block-writer@12.0.0: {} + code-red@1.0.4: + dependencies: + '@jridgewell/sourcemap-codec': 1.4.15 + '@types/estree': 1.0.5 + acorn: 8.12.1 + estree-walker: 3.0.3 + periscopic: 3.1.0 + collapse-white-space@2.1.0: {} color-convert@1.9.3: @@ -15622,6 +15639,8 @@ snapshots: pify: 4.0.1 strip-bom: 3.0.0 + locate-character@3.0.0: {} + locate-path@5.0.0: dependencies: p-locate: 4.1.0 @@ -17594,17 +17613,34 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-hmr@0.16.0(svelte@svelte+packages+svelte): + svelte-hmr@0.16.0(svelte@4.2.18): dependencies: - svelte: link:../svelte/packages/svelte + svelte: 4.2.18 - svelte2tsx@0.7.13(svelte@svelte+packages+svelte)(typescript@5.5.3): + svelte2tsx@0.7.13(svelte@4.2.18)(typescript@5.5.3): dependencies: dedent-js: 1.0.1 pascal-case: 3.1.2 - svelte: link:../svelte/packages/svelte + svelte: 4.2.18 typescript: 5.5.3 + svelte@4.2.18: + dependencies: + '@ampproject/remapping': 2.3.0 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.25 + '@types/estree': 1.0.5 + acorn: 8.12.1 + aria-query: 5.3.0 + axobject-query: 4.1.0 + code-red: 1.0.4 + css-tree: 2.3.1 + estree-walker: 3.0.3 + is-reference: 3.0.2 + locate-character: 3.0.0 + magic-string: 0.30.10 + periscopic: 3.1.0 + svg-tags@1.0.0: {} svgo@3.2.0: