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.
- package/lib/cli.js +7259 -2343
- package/lib/content-runtime.js +2 -2
- package/package.json +24 -24
- package/templates/cloudflare/package.json +1 -1
- package/templates/defaults/app/route-templates/html.tsx +79 -13
- package/templates/defaults/app/route-templates/text.tsx +2 -2
- package/templates/defaults/app/route-templates/xml.tsx +2 -2
- package/templates/defaults/package.json +8 -8
- package/templates/react-router/app/route-templates/html.tsx +87 -35
- package/templates/react-router/app/route-templates/text.tsx +8 -22
- package/templates/react-router/app/route-templates/xml.tsx +8 -22
- package/templates/react-router/package.json +8 -8
- package/templates/react-router/vite.config.ts +15 -1
- package/templates/react-router-cloudflare/package.json +1 -1
- package/templates/ssg/app/route-templates/dynamic/+onBeforePrerenderStart.ts.template +1 -0
- package/templates/ssg/app/route-templates/{html → shared}/+data.ts +2 -2
- package/templates/ssg/app/route-templates/text/+config.ts +5 -0
- package/templates/ssg/app/route-templates/text/+onRenderHtml.ts +5 -0
- package/templates/ssg/app/route-templates/text/+route.ts.template +1 -0
- package/templates/ssg/package.json +10 -10
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
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: [
|
|
@@ -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
|
-
|
|
60
|
+
...getSystemSearch(url.searchParams),
|
|
61
61
|
origin: url.origin,
|
|
62
62
|
pathname: url.pathname,
|
|
63
63
|
};
|
|
@@ -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": "
|
|
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.
|
|
15
|
-
"@webstudio-is/react-sdk": "0.
|
|
16
|
-
"@webstudio-is/sdk": "0.
|
|
17
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
18
|
-
"@webstudio-is/sdk-components-animation": "0.
|
|
19
|
-
"@webstudio-is/sdk-components-react-radix": "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": "
|
|
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.
|
|
28
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
29
29
|
"typescript": "7.0.2",
|
|
30
|
-
"vite": "
|
|
30
|
+
"vite": "7.1.12"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=22.12.0"
|