From 7b767e312f9c7a1288f67fd6e48acc59135cbc01 Mon Sep 17 00:00:00 2001 From: Daven Quinn Date: Sun, 21 Jan 2024 17:44:58 -0600 Subject: [PATCH 1/2] Update vite to v5 --- package.json | 2 +- yarn.lock | 220 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 217 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 10f7e986..86abd549 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "use-react-router-breadcrumbs": "^3.2.1", "use-resize-observer": "^9.1.0", "vike": "^0.4.159", - "vite": "^4.4.9", + "vite": "^5.0.12", "vite-plugin-cesium": "^1.2.22" }, "resolutions": { diff --git a/yarn.lock b/yarn.lock index 8d9bac27..e68afcfe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3811,7 +3811,7 @@ __metadata: use-react-router-breadcrumbs: ^3.2.1 use-resize-observer: ^9.1.0 vike: ^0.4.159 - vite: ^4.4.9 + vite: ^5.0.12 vite-plugin-cesium: ^1.2.22 vite-plugin-rewrite-all: ^1.0.1 dependenciesMeta: @@ -5606,6 +5606,97 @@ __metadata: languageName: node linkType: hard +"@rollup/rollup-android-arm-eabi@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.9.6" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@rollup/rollup-android-arm64@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-android-arm64@npm:4.9.6" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-arm64@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-darwin-arm64@npm:4.9.6" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-x64@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-darwin-x64@npm:4.9.6" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-gnueabihf@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.9.6" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-gnu@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.9.6" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-musl@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.9.6" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-riscv64-gnu@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.9.6" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-gnu@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.9.6" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-musl@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.9.6" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-win32-arm64-msvc@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.9.6" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-ia32-msvc@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.9.6" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-msvc@npm:4.9.6": + version: 4.9.6 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.9.6" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@samverschueren/stream-to-observable@npm:^0.3.0": version: 0.3.1 resolution: "@samverschueren/stream-to-observable@npm:0.3.1" @@ -6448,6 +6539,13 @@ __metadata: languageName: node linkType: hard +"@types/estree@npm:1.0.5": + version: 1.0.5 + resolution: "@types/estree@npm:1.0.5" + checksum: dd8b5bed28e6213b7acd0fb665a84e693554d850b0df423ac8076cc3ad5823a6bc26b0251d080bdc545af83179ede51dd3f6fa78cad2c46ed1f29624ddf3e41a + languageName: node + linkType: hard + "@types/express-serve-static-core@npm:*": version: 4.17.37 resolution: "@types/express-serve-static-core@npm:4.17.37" @@ -12955,7 +13053,7 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.19.0": +"esbuild@npm:^0.19.0, esbuild@npm:^0.19.3": version: 0.19.11 resolution: "esbuild@npm:0.19.11" dependencies: @@ -14253,7 +14351,7 @@ __metadata: languageName: node linkType: hard -"fsevents@npm:^2.3.2, fsevents@npm:~2.3.2": +"fsevents@npm:^2.3.2, fsevents@npm:~2.3.2, fsevents@npm:~2.3.3": version: 2.3.3 resolution: "fsevents@npm:2.3.3" dependencies: @@ -14273,7 +14371,7 @@ __metadata: languageName: node linkType: hard -"fsevents@patch:fsevents@^2.3.2#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin": +"fsevents@patch:fsevents@^2.3.2#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin, fsevents@patch:fsevents@~2.3.3#~builtin": version: 2.3.3 resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin::version=2.3.3&hash=df0bf1" dependencies: @@ -21109,6 +21207,15 @@ __metadata: languageName: node linkType: hard +"nanoid@npm:^3.3.7": + version: 3.3.7 + resolution: "nanoid@npm:3.3.7" + bin: + nanoid: bin/nanoid.cjs + checksum: d36c427e530713e4ac6567d488b489a36582ef89da1d6d4e3b87eded11eb10d7042a877958c6f104929809b2ab0bafa17652b076cdf84324aa75b30b722204f2 + languageName: node + linkType: hard + "nanomatch@npm:^1.2.9": version: 1.2.13 resolution: "nanomatch@npm:1.2.13" @@ -23734,6 +23841,17 @@ __metadata: languageName: node linkType: hard +"postcss@npm:^8.4.32": + version: 8.4.33 + resolution: "postcss@npm:8.4.33" + dependencies: + nanoid: ^3.3.7 + picocolors: ^1.0.0 + source-map-js: ^1.0.2 + checksum: 6f98b2af4b76632a3de20c4f47bf0e984a1ce1a531cf11adcb0b1d63a6cbda0aae4165e578b66c32ca4879038e3eaad386a6be725a8fb4429c78e3c1ab858fe9 + languageName: node + linkType: hard + "posthtml-parser@npm:^0.10.1": version: 0.10.2 resolution: "posthtml-parser@npm:0.10.2" @@ -26057,6 +26175,60 @@ __metadata: languageName: node linkType: hard +"rollup@npm:^4.2.0": + version: 4.9.6 + resolution: "rollup@npm:4.9.6" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.9.6 + "@rollup/rollup-android-arm64": 4.9.6 + "@rollup/rollup-darwin-arm64": 4.9.6 + "@rollup/rollup-darwin-x64": 4.9.6 + "@rollup/rollup-linux-arm-gnueabihf": 4.9.6 + "@rollup/rollup-linux-arm64-gnu": 4.9.6 + "@rollup/rollup-linux-arm64-musl": 4.9.6 + "@rollup/rollup-linux-riscv64-gnu": 4.9.6 + "@rollup/rollup-linux-x64-gnu": 4.9.6 + "@rollup/rollup-linux-x64-musl": 4.9.6 + "@rollup/rollup-win32-arm64-msvc": 4.9.6 + "@rollup/rollup-win32-ia32-msvc": 4.9.6 + "@rollup/rollup-win32-x64-msvc": 4.9.6 + "@types/estree": 1.0.5 + fsevents: ~2.3.2 + dependenciesMeta: + "@rollup/rollup-android-arm-eabi": + optional: true + "@rollup/rollup-android-arm64": + optional: true + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-linux-arm-gnueabihf": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-riscv64-gnu": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-ia32-msvc": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true + fsevents: + optional: true + bin: + rollup: dist/bin/rollup + checksum: cdc0bdd41ee2d3fe7f01df26f5a85921caf46ffe0ae118b2f3deebdf569e8b1c1800b8eee04960425e67aecbd9ccdd37bcdb92595866adb3968d223a07e9b7e6 + languageName: node + linkType: hard + "rsvp@npm:^3.3.3": version: 3.6.2 resolution: "rsvp@npm:3.6.2" @@ -29719,6 +29891,46 @@ __metadata: languageName: node linkType: hard +"vite@npm:^5.0.12": + version: 5.0.12 + resolution: "vite@npm:5.0.12" + dependencies: + esbuild: ^0.19.3 + fsevents: ~2.3.3 + postcss: ^8.4.32 + rollup: ^4.2.0 + peerDependencies: + "@types/node": ^18.0.0 || >=20.0.0 + less: "*" + lightningcss: ^1.21.0 + sass: "*" + stylus: "*" + sugarss: "*" + terser: ^5.4.0 + dependenciesMeta: + fsevents: + optional: true + peerDependenciesMeta: + "@types/node": + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + bin: + vite: bin/vite.js + checksum: b97b6f1c204d9091d0973626827a6e9d8e8b1959ebd0877b6f76e7068e1e7adf9ecd3b1cc382cbab9d421e3eeca5e1a95f27f9c1734439b229f5a58ef2052fa4 + languageName: node + linkType: hard + "vt-pbf@npm:^3.1.3": version: 3.1.3 resolution: "vt-pbf@npm:3.1.3" From 63e5b2c403c79eb419c33da71d397ef113e2a368 Mon Sep 17 00:00:00 2001 From: Daven Quinn Date: Sun, 21 Jan 2024 17:46:06 -0600 Subject: [PATCH 2/2] Fix error with maps page rendering, caused by #121 --- src/pages/maps/@id/+Page.ts | 28 --------------------------- src/pages/maps/@id/+onBeforeRender.ts | 28 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 src/pages/maps/@id/+onBeforeRender.ts diff --git a/src/pages/maps/@id/+Page.ts b/src/pages/maps/@id/+Page.ts index 67fab4aa..033c3545 100644 --- a/src/pages/maps/@id/+Page.ts +++ b/src/pages/maps/@id/+Page.ts @@ -1,35 +1,7 @@ import h from "@macrostrat/hyper"; -import { PageContextBuiltInServer } from "vike/types"; import { ClientOnly } from "~/renderer/client-only"; -import { apiV2Prefix } from "~/settings"; const MapInterface = () => import("./map-interface"); -const apiAddress = apiV2Prefix + "/defs/sources"; - -export async function onBeforeRender(pageContext: PageContextBuiltInServer) { - const { id } = pageContext.routeParams; - - const params = new URLSearchParams({ - format: "geojson", - source_id: id, - }); - const response = await fetch(apiAddress + "?" + params); - const data: any = await response.json(); - const map = data?.success?.data?.features[0]; - - return { - pageContext: { - pageProps: { - map, - }, - documentProps: { - // The page's - title: map.properties.name, - }, - }, - }; -} - export function Page({ map }) { return h("div.single-map", h(ClientOnly, { component: MapInterface, map })); } diff --git a/src/pages/maps/@id/+onBeforeRender.ts b/src/pages/maps/@id/+onBeforeRender.ts new file mode 100644 index 00000000..73db4571 --- /dev/null +++ b/src/pages/maps/@id/+onBeforeRender.ts @@ -0,0 +1,28 @@ +import { PageContextBuiltInServer } from "vike/types"; +import { apiV2Prefix } from "~/settings"; + +const apiAddress = apiV2Prefix + "/defs/sources"; + +export async function onBeforeRender(pageContext: PageContextBuiltInServer) { + const { id } = pageContext.routeParams; + + const params = new URLSearchParams({ + format: "geojson", + source_id: id, + }); + const response = await fetch(apiAddress + "?" + params); + const data: any = await response.json(); + const map = data?.success?.data?.features[0]; + + return { + pageContext: { + pageProps: { + map, + }, + documentProps: { + // The page's <title> + title: map.properties.name, + }, + }, + }; +}