webstudio 0.304.0 → 0.306.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,12 @@
1
- import { defineConfig } from "vite";
1
+ import { existsSync, realpathSync } from "node:fs";
2
+ import { fileURLToPath } from "node:url";
3
+ import { defineConfig, searchForWorkspaceRoot } from "vite";
2
4
  import { reactRouter } from "@react-router/dev/vite";
3
5
 
4
6
  const sourceConditions =
5
7
  process.env.WEBSTUDIO_LOCAL_CLI_BOOTSTRAPPED === "1" ? ["webstudio"] : [];
8
+ const templateDirectory = fileURLToPath(new URL(".", import.meta.url));
9
+ const templateNodeModules = new URL("./node_modules", import.meta.url);
6
10
 
7
11
  export default defineConfig({
8
12
  // Local previews share node_modules, but must not share optimizer state.
@@ -10,6 +14,16 @@ export default defineConfig({
10
14
  plugins: [reactRouter()],
11
15
  server: {
12
16
  hmr: process.env.WEBSTUDIO_PREVIEW_HMR === "disabled" ? false : undefined,
17
+ // The local CLI links node_modules from its source workspace. Vite must
18
+ // serve React Router's client entry from that workspace to hydrate Preview.
19
+ fs: {
20
+ allow: [
21
+ templateDirectory,
22
+ ...(existsSync(templateNodeModules)
23
+ ? [searchForWorkspaceRoot(realpathSync(templateNodeModules))]
24
+ : []),
25
+ ],
26
+ },
13
27
  },
14
28
  resolve: {
15
29
  conditions: [
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "dependencies": {
9
9
  "@cloudflare/vite-plugin": "^1.1.0",
10
- "@webstudio-is/wsauth": "0.304.0",
10
+ "@webstudio-is/wsauth": "0.306.0",
11
11
  "wrangler": "^4.14.1"
12
12
  }
13
13
  }
@@ -0,0 +1 @@
1
+ export const onBeforePrerenderStart = () => __PRERENDER_PATHS__;
@@ -1,5 +1,5 @@
1
1
  import type { PageContextServer } from "vike/types";
2
- import { isLocalResource, loadResources } from "@webstudio-is/sdk/runtime";
2
+ import { isLocalResource, loadResources, getSystemSearch } from "@webstudio-is/sdk/runtime";
3
3
  import { getPageMeta, getResources } from "__SERVER__";
4
4
  import { assets } from "__ASSETS__";
5
5
  import {
@@ -57,7 +57,7 @@ export const data = async (pageContext: PageContextServer) => {
57
57
  const params = pageContext.routeParams;
58
58
  const system = {
59
59
  params,
60
- search: Object.fromEntries(url.searchParams),
60
+ ...getSystemSearch(url.searchParams),
61
61
  origin: url.origin,
62
62
  pathname: url.pathname,
63
63
  };
@@ -0,0 +1,5 @@
1
+ import type { Config } from "vike/types";
2
+
3
+ export default {
4
+ clientHooks: false,
5
+ } satisfies Config;
@@ -0,0 +1,5 @@
1
+ import type { OnRenderHtmlAsync } from "vike/types";
2
+
3
+ export const onRenderHtml: OnRenderHtmlAsync = async (pageContext) => {
4
+ pageContext.content = pageContext.data.pageMeta.content ?? "";
5
+ };
@@ -0,0 +1 @@
1
+ export default __PAGE_PATH__;
@@ -3,7 +3,7 @@
3
3
  "private": true,
4
4
  "sideEffects": false,
5
5
  "scripts": {
6
- "build": "vite build && vike prerender",
6
+ "build": "vike build && vike prerender",
7
7
  "dev": "vite dev",
8
8
  "start": "vite preview",
9
9
  "typecheck": "tsc --noEmit"
@@ -11,23 +11,23 @@
11
11
  "dependencies": {
12
12
  "@shikijs/langs": "4.4.1",
13
13
  "@shikijs/themes": "4.4.1",
14
- "@webstudio-is/image": "0.304.0",
15
- "@webstudio-is/react-sdk": "0.304.0",
16
- "@webstudio-is/sdk": "0.304.0",
17
- "@webstudio-is/sdk-components-react": "0.304.0",
18
- "@webstudio-is/sdk-components-animation": "0.304.0",
19
- "@webstudio-is/sdk-components-react-radix": "0.304.0",
14
+ "@webstudio-is/image": "0.306.0",
15
+ "@webstudio-is/react-sdk": "0.306.0",
16
+ "@webstudio-is/sdk": "0.306.0",
17
+ "@webstudio-is/sdk-components-react": "0.306.0",
18
+ "@webstudio-is/sdk-components-animation": "0.306.0",
19
+ "@webstudio-is/sdk-components-react-radix": "0.306.0",
20
20
  "react": "18.3.0-canary-14898b6a9-20240318",
21
21
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
22
22
  "shiki": "4.4.1",
23
- "vike": "^0.4.229"
23
+ "vike": "0.4.267-commit-feffb0f"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/react": "^18.2.70",
27
27
  "@types/react-dom": "^18.2.25",
28
- "@vitejs/plugin-react": "^4.4.1",
28
+ "@vitejs/plugin-react": "^4.7.0",
29
29
  "typescript": "7.0.2",
30
- "vite": "^6.3.4"
30
+ "vite": "7.1.12"
31
31
  },
32
32
  "engines": {
33
33
  "node": ">=22.12.0"