From 4f1f64c64ca63074439f3b23b5338a7b18f694d1 Mon Sep 17 00:00:00 2001 From: Liam Bigelow <40188355+bglw@users.noreply.github.com> Date: Thu, 17 Oct 2024 11:25:58 +1300 Subject: [PATCH] Resolve svelte and astro Bookshop updates --- .../browser/lib/build/svelteFixPlugin.js | 16 ------ javascript-modules/browser/main.js | 4 +- .../engines/astro-engine/package.json | 6 +-- .../astro/astro-bookshop/package.json | 2 +- .../integration-tests/package.json | 1 + .../support/starters/astro/package.json | 4 +- javascript-modules/yarn.lock | 50 +++++++++++++------ 7 files changed, 43 insertions(+), 40 deletions(-) delete mode 100644 javascript-modules/browser/lib/build/svelteFixPlugin.js diff --git a/javascript-modules/browser/lib/build/svelteFixPlugin.js b/javascript-modules/browser/lib/build/svelteFixPlugin.js deleted file mode 100644 index 070fefe4..00000000 --- a/javascript-modules/browser/lib/build/svelteFixPlugin.js +++ /dev/null @@ -1,16 +0,0 @@ -import path from 'path'; -import { createRequire } from 'module'; - -export default { - name: 'fix_svelte_path', - setup(b) { - const require = createRequire(import.meta.url); - const svelteFileLocation = require.resolve('svelte'); - const svelteFolderLocation = path.dirname(svelteFileLocation); - const nodeFolderLocation = path.dirname(svelteFolderLocation); - - b.onResolve({ filter: /^svelte$|^svelte\// }, args => { - return { path: path.join(nodeFolderLocation,args.path,'index.mjs') } - }); - } -} \ No newline at end of file diff --git a/javascript-modules/browser/main.js b/javascript-modules/browser/main.js index 91e538b8..9562fb2b 100755 --- a/javascript-modules/browser/main.js +++ b/javascript-modules/browser/main.js @@ -5,7 +5,6 @@ import path from "path"; import Builder from "@bookshop/builder"; import { Command } from "commander"; import sveltePlugin from "esbuild-svelte"; -import svelteFixPlugin from "./lib/build/svelteFixPlugin.js"; import materialIconPlugin from "./lib/build/materialIconPlugin.js"; import { __dirname } from "./lib/build/util.js"; import BrowserServer from "./lib/build/browserServer.js"; @@ -40,8 +39,7 @@ export const runner = async (options) => { esbuild: { plugins: [ sveltePlugin({ compileOptions: { css: true } }), - materialIconPlugin(), - svelteFixPlugin + materialIconPlugin() ], loader: { ".svg": "text" diff --git a/javascript-modules/engines/astro-engine/package.json b/javascript-modules/engines/astro-engine/package.json index 30b4c11e..3c0db165 100644 --- a/javascript-modules/engines/astro-engine/package.json +++ b/javascript-modules/engines/astro-engine/package.json @@ -42,11 +42,11 @@ "vite": "^4.2.1" }, "peerDependencies": { + "astro": "^2.0.0 || ^3.0.0 || ^4.0.0", "react": "^17.0.2 || ^18.0.0", - "react-dom": "^17.0.2 || ^18.0.0", - "astro": "^2.0.0 || ^3.0.0 || ^4.0.0" + "react-dom": "^17.0.2 || ^18.0.0" }, "engines": { "node": ">=14.16" } -} \ No newline at end of file +} diff --git a/javascript-modules/generator-plugins/astro/astro-bookshop/package.json b/javascript-modules/generator-plugins/astro/astro-bookshop/package.json index e4d5eb87..57ddbc18 100644 --- a/javascript-modules/generator-plugins/astro/astro-bookshop/package.json +++ b/javascript-modules/generator-plugins/astro/astro-bookshop/package.json @@ -27,7 +27,7 @@ "nyc": "^15.1.0" }, "dependencies": { - "@astrojs/react": "^2.1.0", + "@astrojs/react": "^3.6.2", "@bookshop/helpers": "3.10.1", "@bookshop/vite-plugin-astro-bookshop": "3.10.1", "@cloudcannon/remark-auto-import": "^1.0.1" diff --git a/javascript-modules/integration-tests/package.json b/javascript-modules/integration-tests/package.json index 3a0f4f99..bc6878f6 100644 --- a/javascript-modules/integration-tests/package.json +++ b/javascript-modules/integration-tests/package.json @@ -51,6 +51,7 @@ "serve-handler": "^6.1.3", "svelte": "4.2.19", "tree-kill": "^1.2.2", + "typescript": "^4", "uuid": "^8.3.2", "vite": "^5" }, diff --git a/javascript-modules/integration-tests/support/starters/astro/package.json b/javascript-modules/integration-tests/support/starters/astro/package.json index 3f8a4f71..1d879a87 100644 --- a/javascript-modules/integration-tests/support/starters/astro/package.json +++ b/javascript-modules/integration-tests/support/starters/astro/package.json @@ -10,6 +10,6 @@ "@bookshop/vite-plugin-astro-bookshop": "file:../../../../../javascript-modules/generator-plugins/astro/vite-plugin-astro-bookshop" }, "dependencies": { - "@astrojs/react": "^3.0.0" + "@astrojs/react": "^3.6.2" } -} +} \ No newline at end of file diff --git a/javascript-modules/yarn.lock b/javascript-modules/yarn.lock index 05fddc39..a39dd643 100644 --- a/javascript-modules/yarn.lock +++ b/javascript-modules/yarn.lock @@ -308,19 +308,18 @@ __metadata: languageName: node linkType: hard -"@astrojs/react@npm:^2.1.0": - version: 2.3.2 - resolution: "@astrojs/react@npm:2.3.2" +"@astrojs/react@npm:^3.6.2": + version: 3.6.2 + resolution: "@astrojs/react@npm:3.6.2" dependencies: - "@babel/core": ^7.22.5 - "@babel/plugin-transform-react-jsx": ^7.22.5 - ultrahtml: ^1.2.0 + "@vitejs/plugin-react": ^4.3.1 + ultrahtml: ^1.5.3 peerDependencies: "@types/react": ^17.0.50 || ^18.0.21 "@types/react-dom": ^17.0.17 || ^18.0.6 - react: ^17.0.2 || ^18.0.0 - react-dom: ^17.0.2 || ^18.0.0 - checksum: 8ff6fdf4d4fd47e839131c579d71db52a29d8861d79663c83c689c37a90bf5d9be1746d1015c00f95ac3575687acd7f5ef0631dd2e00f4a171e432bdc7c8df7e + react: ^17.0.2 || ^18.0.0 || ^19.0.0-beta + react-dom: ^17.0.2 || ^18.0.0 || ^19.0.0-beta + checksum: 2552593ad451fe56c5c44d77c4df29716d28ff45c640dc4270b9974a38b4a106896229eb51df6f81d2014d080239182eff58fefb1ea0e30e32a61e51efb1dcb7 languageName: node linkType: hard @@ -356,7 +355,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.22.5, @babel/core@npm:^7.25.2, @babel/core@npm:^7.25.7, @babel/core@npm:^7.7.5": +"@babel/core@npm:^7.25.2, @babel/core@npm:^7.25.7, @babel/core@npm:^7.7.5": version: 7.25.7 resolution: "@babel/core@npm:7.25.7" dependencies: @@ -541,7 +540,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-react-jsx@npm:^7.22.5, @babel/plugin-transform-react-jsx@npm:^7.25.7": +"@babel/plugin-transform-react-jsx@npm:^7.25.7": version: 7.25.7 resolution: "@babel/plugin-transform-react-jsx@npm:7.25.7" dependencies: @@ -597,7 +596,7 @@ __metadata: version: 0.0.0-use.local resolution: "@bookshop/astro-bookshop@workspace:generator-plugins/astro/astro-bookshop" dependencies: - "@astrojs/react": ^2.1.0 + "@astrojs/react": ^3.6.2 "@bookshop/helpers": 3.10.1 "@bookshop/vite-plugin-astro-bookshop": 3.10.1 "@cloudcannon/remark-auto-import": ^1.0.1 @@ -617,7 +616,6 @@ __metadata: "@bookshop/builder": 3.10.1 "@bookshop/helpers": 3.10.1 "@bookshop/vite-plugin-astro-bookshop": 3.10.1 - astro: ^4.15.12 ava: ^6.1.3 esbuild: ^0.19.1 esbuild-sass-plugin: ^2.13.0 @@ -627,6 +625,7 @@ __metadata: svelte: 4.2.19 vite: ^4.2.1 peerDependencies: + astro: ^2.0.0 || ^3.0.0 || ^4.0.0 react: ^17.0.2 || ^18.0.0 react-dom: ^17.0.2 || ^18.0.0 languageName: unknown @@ -2749,7 +2748,7 @@ __metadata: languageName: node linkType: hard -"@vitejs/plugin-react@npm:^4.0.4": +"@vitejs/plugin-react@npm:^4.0.4, @vitejs/plugin-react@npm:^4.3.1": version: 4.3.2 resolution: "@vitejs/plugin-react@npm:4.3.2" dependencies: @@ -7443,6 +7442,7 @@ __metadata: serve-handler: ^6.1.3 svelte: 4.2.19 tree-kill: ^1.2.2 + typescript: ^4 uuid: ^8.3.2 vite: ^5 languageName: unknown @@ -13201,6 +13201,26 @@ __metadata: languageName: node linkType: hard +"typescript@npm:^4": + version: 4.9.5 + resolution: "typescript@npm:4.9.5" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: ee000bc26848147ad423b581bd250075662a354d84f0e06eb76d3b892328d8d4440b7487b5a83e851b12b255f55d71835b008a66cbf8f255a11e4400159237db + languageName: node + linkType: hard + +"typescript@patch:typescript@^4#~builtin": + version: 4.9.5 + resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin::version=4.9.5&hash=289587" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 1f8f3b6aaea19f0f67cba79057674ba580438a7db55057eb89cc06950483c5d632115c14077f6663ea76fd09fce3c190e6414bb98582ec80aa5a4eaf345d5b68 + languageName: node + linkType: hard + "ua-parser-js@npm:^1.0.33": version: 1.0.39 resolution: "ua-parser-js@npm:1.0.39" @@ -13233,7 +13253,7 @@ __metadata: languageName: node linkType: hard -"ultrahtml@npm:^1.2.0, ultrahtml@npm:^1.3.0": +"ultrahtml@npm:^1.3.0, ultrahtml@npm:^1.5.3": version: 1.5.3 resolution: "ultrahtml@npm:1.5.3" checksum: eff871bb116c28f972b4a229b4d177caa1102690bd7448b2e133a9ec0cbeb8bfdfb98ccf692bf9b5d7dff0a5819c1a36c59485592c93fac9253fe5e6814d7dbb