webstudio 0.217.0 → 0.219.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webstudio",
3
- "version": "0.217.0",
3
+ "version": "0.219.0",
4
4
  "description": "Webstudio CLI",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -35,7 +35,7 @@
35
35
  "env-paths": "^3.0.0",
36
36
  "nanoid": "^5.1.5",
37
37
  "p-limit": "^6.2.0",
38
- "parse5": "7.2.1",
38
+ "parse5": "7.3.0",
39
39
  "picocolors": "^1.1.1",
40
40
  "reserved-identifiers": "^1.0.0",
41
41
  "tinyexec": "^0.3.2",
@@ -43,42 +43,44 @@
43
43
  "zod": "^3.24.2"
44
44
  },
45
45
  "devDependencies": {
46
+ "@cloudflare/vite-plugin": "^1.1.0",
46
47
  "@netlify/vite-plugin-react-router": "^1.0.1",
47
- "@react-router/dev": "^7.5.0",
48
- "@react-router/fs-routes": "^7.5.0",
49
- "@remix-run/cloudflare": "^2.16.4",
50
- "@remix-run/cloudflare-pages": "^2.16.4",
51
- "@remix-run/dev": "^2.16.4",
52
- "@remix-run/node": "^2.16.4",
53
- "@remix-run/react": "^2.16.4",
54
- "@remix-run/server-runtime": "^2.16.4",
48
+ "@react-router/dev": "^7.5.3",
49
+ "@react-router/fs-routes": "^7.5.3",
50
+ "@remix-run/cloudflare": "^2.16.5",
51
+ "@remix-run/cloudflare-pages": "^2.16.5",
52
+ "@remix-run/dev": "^2.16.5",
53
+ "@remix-run/node": "^2.16.5",
54
+ "@remix-run/react": "^2.16.5",
55
+ "@remix-run/server-runtime": "^2.16.5",
55
56
  "@types/react": "^18.2.70",
56
57
  "@types/react-dom": "^18.2.25",
57
58
  "@types/yargs": "^17.0.33",
58
59
  "@vercel/react-router": "^1.1.0",
59
- "@vitejs/plugin-react": "^4.3.4",
60
+ "@vitejs/plugin-react": "^4.4.1",
60
61
  "h3": "^1.15.1",
61
62
  "ipx": "^3.0.3",
63
+ "isbot": "^5.1.25",
62
64
  "prettier": "3.5.3",
63
65
  "react": "18.3.0-canary-14898b6a9-20240318",
64
66
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
65
- "react-router": "^7.5.0",
67
+ "react-router": "^7.5.3",
66
68
  "ts-expect": "^1.3.0",
67
- "vike": "^0.4.228",
68
- "vite": "^5.4.11",
69
- "vitest": "^3.0.8",
69
+ "vike": "^0.4.229",
70
+ "vite": "^6.3.4",
71
+ "vitest": "^3.1.2",
70
72
  "wrangler": "^3.63.2",
71
- "@webstudio-is/css-engine": "0.217.0",
72
- "@webstudio-is/http-client": "0.217.0",
73
- "@webstudio-is/image": "0.217.0",
74
- "@webstudio-is/sdk": "0.217.0",
75
- "@webstudio-is/sdk-components-animation": "0.217.0",
76
- "@webstudio-is/sdk-components-react-radix": "0.217.0",
77
- "@webstudio-is/sdk-components-react-remix": "0.217.0",
78
- "@webstudio-is/react-sdk": "0.217.0",
79
- "@webstudio-is/sdk-components-react-router": "0.217.0",
80
- "@webstudio-is/tsconfig": "1.0.7",
81
- "@webstudio-is/sdk-components-react": "0.217.0"
73
+ "@webstudio-is/css-engine": "0.219.0",
74
+ "@webstudio-is/http-client": "0.219.0",
75
+ "@webstudio-is/image": "0.219.0",
76
+ "@webstudio-is/react-sdk": "0.219.0",
77
+ "@webstudio-is/sdk": "0.219.0",
78
+ "@webstudio-is/sdk-components-animation": "0.219.0",
79
+ "@webstudio-is/sdk-components-react-radix": "0.219.0",
80
+ "@webstudio-is/sdk-components-react": "0.219.0",
81
+ "@webstudio-is/sdk-components-react-router": "0.219.0",
82
+ "@webstudio-is/sdk-components-react-remix": "0.219.0",
83
+ "@webstudio-is/tsconfig": "1.0.7"
82
84
  },
83
85
  "scripts": {
84
86
  "typecheck": "tsc",
@@ -12,8 +12,8 @@
12
12
  "build-cf-types": "wrangler types"
13
13
  },
14
14
  "dependencies": {
15
- "@remix-run/cloudflare": "2.16.4",
16
- "@remix-run/cloudflare-pages": "2.16.4"
15
+ "@remix-run/cloudflare": "2.16.5",
16
+ "@remix-run/cloudflare-pages": "2.16.5"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@cloudflare/workers-types": "^4.20240620.0",
@@ -18,4 +18,12 @@ export default defineConfig(({ mode }) => ({
18
18
  },
19
19
  }),
20
20
  ].filter(Boolean),
21
+ resolve: {
22
+ conditions: ["browser", "development|production"],
23
+ },
24
+ ssr: {
25
+ resolve: {
26
+ conditions: ["node", "development|production"],
27
+ },
28
+ },
21
29
  }));
@@ -286,6 +286,7 @@ const Outlet = () => {
286
286
  host={host}
287
287
  siteName={siteName}
288
288
  imageLoader={imageLoader}
289
+ assetBaseUrl={assetBaseUrl}
289
290
  />
290
291
  <PageSettingsTitle>{pageMeta.title}</PageSettingsTitle>
291
292
  <PageSettingsCanonicalLink href={url} />
@@ -8,26 +8,26 @@
8
8
  "typecheck": "tsc"
9
9
  },
10
10
  "dependencies": {
11
- "@remix-run/node": "2.16.4",
12
- "@remix-run/react": "2.16.4",
13
- "@remix-run/server-runtime": "2.16.4",
14
- "@webstudio-is/image": "0.217.0",
15
- "@webstudio-is/react-sdk": "0.217.0",
16
- "@webstudio-is/sdk": "0.217.0",
17
- "@webstudio-is/sdk-components-react": "0.217.0",
18
- "@webstudio-is/sdk-components-animation": "0.217.0",
19
- "@webstudio-is/sdk-components-react-radix": "0.217.0",
20
- "@webstudio-is/sdk-components-react-remix": "0.217.0",
11
+ "@remix-run/node": "2.16.5",
12
+ "@remix-run/react": "2.16.5",
13
+ "@remix-run/server-runtime": "2.16.5",
14
+ "@webstudio-is/image": "0.219.0",
15
+ "@webstudio-is/react-sdk": "0.219.0",
16
+ "@webstudio-is/sdk": "0.219.0",
17
+ "@webstudio-is/sdk-components-react": "0.219.0",
18
+ "@webstudio-is/sdk-components-animation": "0.219.0",
19
+ "@webstudio-is/sdk-components-react-radix": "0.219.0",
20
+ "@webstudio-is/sdk-components-react-remix": "0.219.0",
21
21
  "isbot": "^5.1.25",
22
22
  "react": "18.3.0-canary-14898b6a9-20240318",
23
23
  "react-dom": "18.3.0-canary-14898b6a9-20240318"
24
24
  },
25
25
  "devDependencies": {
26
- "@remix-run/dev": "2.16.4",
26
+ "@remix-run/dev": "2.16.5",
27
27
  "@types/react": "^18.2.70",
28
28
  "@types/react-dom": "^18.2.25",
29
29
  "typescript": "5.8.2",
30
- "vite": "^5.4.11"
30
+ "vite": "^6.3.4"
31
31
  },
32
32
  "engines": {
33
33
  "node": ">=20.0.0"
@@ -13,4 +13,12 @@ export default defineConfig({
13
13
  },
14
14
  }),
15
15
  ],
16
+ resolve: {
17
+ conditions: ["browser", "development|production"],
18
+ },
19
+ ssr: {
20
+ resolve: {
21
+ conditions: ["node", "development|production"],
22
+ },
23
+ },
16
24
  });
@@ -285,6 +285,7 @@ const Outlet = () => {
285
285
  host={host}
286
286
  siteName={siteName}
287
287
  imageLoader={imageLoader}
288
+ assetBaseUrl={assetBaseUrl}
288
289
  />
289
290
  <PageSettingsTitle>{pageMeta.title}</PageSettingsTitle>
290
291
  </ReactSdkContext.Provider>
@@ -8,20 +8,20 @@
8
8
  "typecheck": "tsc"
9
9
  },
10
10
  "dependencies": {
11
- "@react-router/dev": "^7.5.0",
12
- "@react-router/fs-routes": "^7.5.0",
13
- "@webstudio-is/image": "0.217.0",
14
- "@webstudio-is/react-sdk": "0.217.0",
15
- "@webstudio-is/sdk": "0.217.0",
16
- "@webstudio-is/sdk-components-animation": "0.217.0",
17
- "@webstudio-is/sdk-components-react-radix": "0.217.0",
18
- "@webstudio-is/sdk-components-react-router": "0.217.0",
19
- "@webstudio-is/sdk-components-react": "0.217.0",
11
+ "@react-router/dev": "^7.5.3",
12
+ "@react-router/fs-routes": "^7.5.3",
13
+ "@webstudio-is/image": "0.219.0",
14
+ "@webstudio-is/react-sdk": "0.219.0",
15
+ "@webstudio-is/sdk": "0.219.0",
16
+ "@webstudio-is/sdk-components-animation": "0.219.0",
17
+ "@webstudio-is/sdk-components-react-radix": "0.219.0",
18
+ "@webstudio-is/sdk-components-react-router": "0.219.0",
19
+ "@webstudio-is/sdk-components-react": "0.219.0",
20
20
  "isbot": "^5.1.25",
21
21
  "react": "18.3.0-canary-14898b6a9-20240318",
22
22
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
23
- "react-router": "^7.5.0",
24
- "vite": "^5.4.11"
23
+ "react-router": "^7.5.3",
24
+ "vite": "^6.3.4"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/react": "^18.2.70",
@@ -3,4 +3,12 @@ import { reactRouter } from "@react-router/dev/vite";
3
3
 
4
4
  export default defineConfig({
5
5
  plugins: [reactRouter()],
6
+ resolve: {
7
+ conditions: ["browser", "development|production"],
8
+ },
9
+ ssr: {
10
+ resolve: {
11
+ conditions: ["node", "development|production"],
12
+ },
13
+ },
6
14
  });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * We use mjs extension as constants in this file is shared with the build script
3
+ * and we use `node --eval` to extract the constants.
4
+ */
5
+ export const assetBaseUrl = "/assets/";
6
+
7
+ /**
8
+ * @type {import("@webstudio-is/image").ImageLoader}
9
+ */
10
+ export const imageLoader = (props) => {
11
+ if (import.meta.env.DEV) {
12
+ return props.src;
13
+ }
14
+
15
+ if (props.format === "raw") {
16
+ return props.src;
17
+ }
18
+
19
+ // @todo https://developers.cloudflare.com/images/transform-images/transform-via-url/
20
+ return props.src;
21
+ };
@@ -0,0 +1,43 @@
1
+ import type { AppLoadContext, EntryContext } from "react-router";
2
+ import { ServerRouter } from "react-router";
3
+ import { isbot } from "isbot";
4
+ import { renderToReadableStream } from "react-dom/server";
5
+
6
+ export default async function handleRequest(
7
+ request: Request,
8
+ responseStatusCode: number,
9
+ responseHeaders: Headers,
10
+ routerContext: EntryContext,
11
+ _loadContext: AppLoadContext
12
+ ) {
13
+ let shellRendered = false;
14
+ const userAgent = request.headers.get("user-agent");
15
+
16
+ const body = await renderToReadableStream(
17
+ <ServerRouter context={routerContext} url={request.url} />,
18
+ {
19
+ onError(error: unknown) {
20
+ responseStatusCode = 500;
21
+ // Log streaming rendering errors from inside the shell. Don't log
22
+ // errors encountered during initial shell rendering since they'll
23
+ // reject and get logged in handleDocumentRequest.
24
+ if (shellRendered) {
25
+ console.error(error);
26
+ }
27
+ },
28
+ }
29
+ );
30
+ shellRendered = true;
31
+
32
+ // Ensure requests from bots and SPA Mode renders wait for all content to load before responding
33
+ // https://react.dev/reference/react-dom/server/renderToPipeableStream#waiting-for-all-content-to-load-for-crawlers-and-static-generation
34
+ if ((userAgent && isbot(userAgent)) || routerContext.isSpaMode) {
35
+ await body.allReady;
36
+ }
37
+
38
+ responseHeaders.set("Content-Type", "text/html");
39
+ return new Response(body, {
40
+ headers: responseHeaders,
41
+ status: responseStatusCode,
42
+ });
43
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "scripts": {
3
+ "typecheck": "wrangler types && tsc",
4
+ "typegen": "wrangler types",
5
+ "preview": "react-router build && vite preview",
6
+ "deploy": "react-router build && wrangler deploy"
7
+ },
8
+ "dependencies": {
9
+ "@cloudflare/vite-plugin": "^1.1.0",
10
+ "wrangler": "^4.14.1"
11
+ }
12
+ }
@@ -0,0 +1,7 @@
1
+ import type { Config } from "@react-router/dev/config";
2
+
3
+ export default {
4
+ future: {
5
+ unstable_viteEnvironmentApi: true,
6
+ },
7
+ } satisfies Config;
@@ -0,0 +1,23 @@
1
+ {
2
+ "include": ["**/*.ts", "**/*.tsx", "**/*.mjs"],
3
+ "compilerOptions": {
4
+ "lib": ["DOM", "DOM.Iterable", "ESNext"],
5
+ "types": [
6
+ "./worker-configuration.d.ts",
7
+ "vite/client",
8
+ "@webstudio-is/react-sdk/placeholder"
9
+ ],
10
+ "isolatedModules": true,
11
+ "esModuleInterop": true,
12
+ "jsx": "react-jsx",
13
+ "module": "ESNext",
14
+ "moduleResolution": "bundler",
15
+ "target": "ES2022",
16
+ "strict": true,
17
+ "allowJs": true,
18
+ "forceConsistentCasingInFileNames": true,
19
+ "noEmit": true,
20
+ "skipLibCheck": true,
21
+ "customConditions": ["webstudio"]
22
+ }
23
+ }
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from "vite";
2
+ import { cloudflare } from "@cloudflare/vite-plugin";
3
+ import { reactRouter } from "@react-router/dev/vite";
4
+
5
+ export default defineConfig({
6
+ plugins: [cloudflare({ viteEnvironment: { name: "ssr" } }), reactRouter()],
7
+ resolve: {
8
+ conditions: ["browser", "development|production"],
9
+ },
10
+ ssr: {
11
+ resolve: {
12
+ conditions: ["node", "development|production"],
13
+ },
14
+ },
15
+ });
@@ -0,0 +1,26 @@
1
+ import { createRequestHandler } from "react-router";
2
+
3
+ declare module "react-router" {
4
+ export interface AppLoadContext {
5
+ cloudflare: {
6
+ env: Env;
7
+ ctx: ExecutionContext;
8
+ };
9
+ }
10
+ }
11
+
12
+ const requestHandler = createRequestHandler(
13
+ // @ts-ignore
14
+ () => import("virtual:react-router/server-build"),
15
+ import.meta.env.MODE
16
+ );
17
+
18
+ export default {
19
+ async fetch(request, env, ctx) {
20
+ return requestHandler(request, {
21
+ EXCLUDE_FROM_SEARCH: false,
22
+ getDefaultActionResource: undefined,
23
+ cloudflare: { env, ctx },
24
+ });
25
+ },
26
+ } satisfies ExportedHandler<Env>;
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "node_modules/wrangler/config-schema.json",
3
+ "name": "webstudio-app",
4
+ "compatibility_date": "2025-04-28",
5
+ "main": "./workers/app.ts"
6
+ }
@@ -3,8 +3,8 @@
3
3
  "start": "react-router-serve ./build/server/index.js"
4
4
  },
5
5
  "dependencies": {
6
- "@react-router/node": "^7.5.0",
7
- "@react-router/serve": "^7.5.0",
6
+ "@react-router/node": "^7.5.3",
7
+ "@react-router/serve": "^7.5.3",
8
8
  "h3": "^1.15.1",
9
9
  "ipx": "^3.0.3"
10
10
  }
@@ -5,6 +5,6 @@
5
5
  },
6
6
  "dependencies": {
7
7
  "@netlify/vite-plugin-react-router": "^1.0.1",
8
- "@react-router/node": "^7.5.0"
8
+ "@react-router/node": "^7.5.3"
9
9
  }
10
10
  }
@@ -4,4 +4,12 @@ import netlifyPlugin from "@netlify/vite-plugin-react-router";
4
4
 
5
5
  export default defineConfig({
6
6
  plugins: [reactRouter(), netlifyPlugin()],
7
+ resolve: {
8
+ conditions: ["browser", "development|production"],
9
+ },
10
+ ssr: {
11
+ resolve: {
12
+ conditions: ["node", "development|production"],
13
+ },
14
+ },
7
15
  });
@@ -3,7 +3,7 @@
3
3
  "deploy": "npx vercel deploy"
4
4
  },
5
5
  "dependencies": {
6
- "@react-router/node": "^7.5.0",
6
+ "@react-router/node": "^7.5.3",
7
7
  "@vercel/react-router": "^1.1.0"
8
8
  }
9
9
  }
@@ -25,11 +25,11 @@ const conditions = hasPrivateFolders
25
25
 
26
26
  export default defineConfig(({ mode }) => ({
27
27
  resolve: {
28
- conditions,
28
+ conditions: [...conditions, "browser", "development|production"],
29
29
  },
30
30
  ssr: {
31
31
  resolve: {
32
- conditions,
32
+ conditions: [...conditions, "node", "development|production"],
33
33
  },
34
34
  },
35
35
  plugins: [
@@ -20,11 +20,14 @@ export const Head = ({ data }: { data: PageContext["data"] }) => {
20
20
  let socialImageUrl = pageMeta.socialImageUrl;
21
21
  if (pageMeta.socialImageAssetName) {
22
22
  socialImageUrl = `${origin}${imageLoader({
23
- src: pageMeta.socialImageAssetName,
23
+ src: `${assetBaseUrl}/${pageMeta.socialImageAssetName}`,
24
24
  // Do not transform social image (not enough information do we need to do this)
25
25
  format: "raw",
26
26
  })}`;
27
27
  }
28
+ const isTwitterCardSizeDefined = pageMeta.custom.some(
29
+ (meta) => meta.property === "twitter:card"
30
+ );
28
31
  return (
29
32
  <>
30
33
  {data.url && <meta property="og:url" content={data.url} />}
@@ -55,6 +58,11 @@ export const Head = ({ data }: { data: PageContext["data"] }) => {
55
58
  {pageMeta.custom.map(({ property, content }) => (
56
59
  <meta key={property} property={property} content={content} />
57
60
  ))}
61
+ {(pageMeta.socialImageAssetName !== undefined ||
62
+ pageMeta.socialImageUrl !== undefined) &&
63
+ isTwitterCardSizeDefined === false && (
64
+ <meta property="twitter:card" content="summary_large_image" />
65
+ )}
58
66
 
59
67
  {favIconAsset && (
60
68
  <link
@@ -8,22 +8,22 @@
8
8
  "typecheck": "tsc"
9
9
  },
10
10
  "dependencies": {
11
- "@webstudio-is/image": "0.217.0",
12
- "@webstudio-is/react-sdk": "0.217.0",
13
- "@webstudio-is/sdk": "0.217.0",
14
- "@webstudio-is/sdk-components-react": "0.217.0",
15
- "@webstudio-is/sdk-components-animation": "0.217.0",
16
- "@webstudio-is/sdk-components-react-radix": "0.217.0",
11
+ "@webstudio-is/image": "0.219.0",
12
+ "@webstudio-is/react-sdk": "0.219.0",
13
+ "@webstudio-is/sdk": "0.219.0",
14
+ "@webstudio-is/sdk-components-react": "0.219.0",
15
+ "@webstudio-is/sdk-components-animation": "0.219.0",
16
+ "@webstudio-is/sdk-components-react-radix": "0.219.0",
17
17
  "react": "18.3.0-canary-14898b6a9-20240318",
18
18
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
19
- "vike": "^0.4.228"
19
+ "vike": "^0.4.229"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/react": "^18.2.70",
23
23
  "@types/react-dom": "^18.2.25",
24
- "@vitejs/plugin-react": "^4.3.4",
24
+ "@vitejs/plugin-react": "^4.4.1",
25
25
  "typescript": "5.8.2",
26
- "vite": "^5.4.11"
26
+ "vite": "^6.3.4"
27
27
  },
28
28
  "engines": {
29
29
  "node": ">=20.0.0"
@@ -4,4 +4,12 @@ import vike from "vike/plugin";
4
4
 
5
5
  export default defineConfig({
6
6
  plugins: [react(), vike({ prerender: true })],
7
+ resolve: {
8
+ conditions: ["browser", "development|production"],
9
+ },
10
+ ssr: {
11
+ resolve: {
12
+ conditions: ["node", "development|production"],
13
+ },
14
+ },
7
15
  });