webstudio 0.195.0 → 0.197.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.195.0",
3
+ "version": "0.197.0",
4
4
  "description": "Webstudio CLI",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -26,52 +26,56 @@
26
26
  "node": ">=20.12"
27
27
  },
28
28
  "dependencies": {
29
- "@clack/prompts": "^0.7.0",
29
+ "@clack/prompts": "^0.9.0",
30
+ "@emotion/hash": "^0.9.2",
31
+ "acorn": "^8.14.0",
32
+ "acorn-walk": "^8.3.4",
30
33
  "change-case": "^5.4.4",
31
34
  "deepmerge": "^4.3.1",
32
35
  "env-paths": "^3.0.0",
33
- "p-limit": "^4.0.0",
34
- "parse5": "7.1.2",
35
- "picocolors": "^1.1.0",
36
- "strip-indent": "^4.0.0",
37
- "tinyexec": "^0.3.1",
36
+ "nanoid": "^5.0.9",
37
+ "p-limit": "^6.2.0",
38
+ "parse5": "7.2.1",
39
+ "picocolors": "^1.1.1",
40
+ "react": "18.3.0-canary-14898b6a9-20240318",
41
+ "reserved-identifiers": "^1.0.0",
42
+ "tinyexec": "^0.3.2",
43
+ "warn-once": "^0.1.1",
38
44
  "yargs": "^17.7.2",
39
- "zod": "^3.22.4",
40
- "@webstudio-is/http-client": "0.195.0",
41
- "@webstudio-is/react-sdk": "0.195.0",
42
- "@webstudio-is/image": "0.195.0",
43
- "@webstudio-is/sdk": "0.195.0",
44
- "@webstudio-is/sdk-components-react": "0.195.0",
45
- "@webstudio-is/sdk-components-react-radix": "0.195.0",
46
- "@webstudio-is/sdk-components-react-remix": "0.195.0"
45
+ "zod": "^3.22.4"
47
46
  },
48
47
  "devDependencies": {
49
48
  "@netlify/remix-adapter": "^2.5.1",
50
49
  "@netlify/remix-edge-adapter": "3.4.2",
51
- "@remix-run/cloudflare": "^2.15.0",
52
- "@remix-run/cloudflare-pages": "^2.15.0",
53
- "@remix-run/dev": "^2.15.0",
54
- "@remix-run/node": "^2.15.0",
55
- "@remix-run/react": "^2.15.0",
56
- "@remix-run/server-runtime": "^2.15.0",
57
- "@types/node": "^22.9.3",
50
+ "@remix-run/cloudflare": "^2.15.2",
51
+ "@remix-run/cloudflare-pages": "^2.15.2",
52
+ "@remix-run/dev": "^2.15.2",
53
+ "@remix-run/node": "^2.15.2",
54
+ "@remix-run/react": "^2.15.2",
55
+ "@remix-run/server-runtime": "^2.15.2",
58
56
  "@types/react": "^18.2.70",
59
57
  "@types/react-dom": "^18.2.25",
60
58
  "@types/yargs": "^17.0.33",
61
59
  "@vitejs/plugin-react": "^4.3.4",
62
60
  "prettier": "3.4.2",
63
- "react": "18.3.0-canary-14898b6a9-20240318",
64
61
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
65
62
  "ts-expect": "^1.3.0",
66
- "vike": "^0.4.206",
63
+ "vike": "^0.4.210",
67
64
  "vite": "^5.4.11",
68
65
  "vitest": "^2.1.8",
69
66
  "wrangler": "^3.63.2",
67
+ "@webstudio-is/http-client": "0.197.0",
68
+ "@webstudio-is/image": "0.197.0",
69
+ "@webstudio-is/react-sdk": "0.197.0",
70
+ "@webstudio-is/sdk": "0.197.0",
71
+ "@webstudio-is/sdk-components-react": "0.197.0",
72
+ "@webstudio-is/sdk-components-react-remix": "0.197.0",
73
+ "@webstudio-is/sdk-components-react-radix": "0.197.0",
70
74
  "@webstudio-is/tsconfig": "1.0.7"
71
75
  },
72
76
  "scripts": {
73
77
  "typecheck": "tsc",
74
- "build": "rm -rf lib && esbuild src/cli.ts --outdir=lib --bundle --format=esm --packages=external",
78
+ "build": "rm -rf lib && vite build",
75
79
  "test": "vitest run"
76
80
  }
77
81
  }
@@ -12,8 +12,8 @@
12
12
  "build-cf-types": "wrangler types"
13
13
  },
14
14
  "dependencies": {
15
- "@remix-run/cloudflare": "2.15.0",
16
- "@remix-run/cloudflare-pages": "2.15.0"
15
+ "@remix-run/cloudflare": "2.15.2",
16
+ "@remix-run/cloudflare-pages": "2.15.2"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@cloudflare/workers-types": "^4.20240620.0",
@@ -8,6 +8,14 @@ export default defineConfig(({ mode }) => ({
8
8
  plugins: [
9
9
  // without this, remixCloudflareDevProxy trying to load workerd even for production (it's not needed for production)
10
10
  mode === "production" ? undefined : remixCloudflareDevProxy(),
11
- remix(),
11
+ remix({
12
+ future: {
13
+ v3_lazyRouteDiscovery: false,
14
+ v3_relativeSplatPath: false,
15
+ v3_singleFetch: false,
16
+ v3_fetcherPersist: false,
17
+ v3_throwAbortReason: false,
18
+ },
19
+ }),
12
20
  ].filter(Boolean),
13
21
  }));
@@ -205,7 +205,7 @@ export const links: LinksFunction = () => {
205
205
  result.push({
206
206
  rel: "icon",
207
207
  href: imageLoader({
208
- src: favIconAsset.name,
208
+ src: `${assetBaseUrl}${favIconAsset.name}`,
209
209
  // width,height must be multiple of 48 https://developers.google.com/search/docs/appearance/favicon-in-search
210
210
  width: 144,
211
211
  height: 144,
@@ -1,7 +1,10 @@
1
1
  import { renderToString } from "react-dom/server";
2
2
  import { type LoaderFunctionArgs, redirect } from "@remix-run/server-runtime";
3
3
  import { isLocalResource, loadResources } from "@webstudio-is/sdk/runtime";
4
- import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";
4
+ import {
5
+ ReactSdkContext,
6
+ xmlNodeTagSuffix,
7
+ } from "@webstudio-is/react-sdk/runtime";
5
8
  import { Page } from "__CLIENT__";
6
9
  import { getPageMeta, getRemixParams, getResources } from "__SERVER__";
7
10
  import { assetBaseUrl, imageLoader } from "__CONSTANTS__";
@@ -72,6 +75,10 @@ export const loader = async (arg: LoaderFunctionArgs) => {
72
75
  // More details: https://github.com/facebook/react/blob/7c8e5e7ab8bb63de911637892392c5efd8ce1d0f/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js#L3083
73
76
  text = text.replace(/^<svg>/g, "").replace(/<\/svg>$/g, "");
74
77
 
78
+ // React has issues rendering certain elements, such as errors when a <link> element has children.
79
+ // To render XML, we wrap it with an <svg> tag and add a suffix to avoid React's default behavior on these elements.
80
+ text = text.replaceAll(xmlNodeTagSuffix, "");
81
+
75
82
  return new Response(`<?xml version="1.0" encoding="UTF-8"?>\n${text}`, {
76
83
  headers: { "Content-Type": "application/xml" },
77
84
  });
@@ -8,21 +8,21 @@
8
8
  "typecheck": "tsc"
9
9
  },
10
10
  "dependencies": {
11
- "@remix-run/node": "2.15.0",
12
- "@remix-run/react": "2.15.0",
13
- "@remix-run/server-runtime": "2.15.0",
14
- "@webstudio-is/react-sdk": "0.195.0",
15
- "@webstudio-is/sdk-components-react-radix": "0.195.0",
16
- "@webstudio-is/sdk-components-react-remix": "0.195.0",
17
- "@webstudio-is/sdk-components-react": "0.195.0",
18
- "@webstudio-is/image": "0.195.0",
19
- "@webstudio-is/sdk": "0.195.0",
20
- "isbot": "^5.1.17",
11
+ "@remix-run/node": "2.15.2",
12
+ "@remix-run/react": "2.15.2",
13
+ "@remix-run/server-runtime": "2.15.2",
14
+ "@webstudio-is/react-sdk": "0.197.0",
15
+ "@webstudio-is/sdk-components-react-radix": "0.197.0",
16
+ "@webstudio-is/sdk-components-react-remix": "0.197.0",
17
+ "@webstudio-is/sdk-components-react": "0.197.0",
18
+ "@webstudio-is/image": "0.197.0",
19
+ "@webstudio-is/sdk": "0.197.0",
20
+ "isbot": "^5.1.19",
21
21
  "react": "18.3.0-canary-14898b6a9-20240318",
22
22
  "react-dom": "18.3.0-canary-14898b6a9-20240318"
23
23
  },
24
24
  "devDependencies": {
25
- "@remix-run/dev": "2.15.0",
25
+ "@remix-run/dev": "2.15.2",
26
26
  "@types/react": "^18.2.70",
27
27
  "@types/react-dom": "^18.2.25",
28
28
  "typescript": "5.7.2",
@@ -2,5 +2,15 @@ import { defineConfig } from "vite";
2
2
  import { vitePlugin as remix } from "@remix-run/dev";
3
3
 
4
4
  export default defineConfig({
5
- plugins: [remix()],
5
+ plugins: [
6
+ remix({
7
+ future: {
8
+ v3_lazyRouteDiscovery: false,
9
+ v3_relativeSplatPath: false,
10
+ v3_singleFetch: false,
11
+ v3_fetcherPersist: false,
12
+ v3_throwAbortReason: false,
13
+ },
14
+ }),
15
+ ],
6
16
  });
@@ -18,12 +18,13 @@ export const imageLoader = (props) => {
18
18
  }
19
19
 
20
20
  // https://docs.netlify.com/image-cdn/overview/
21
- return (
22
- "/.netlify/images?url=" +
23
- encodeURIComponent(props.src) +
24
- "&w=" +
25
- props.width +
26
- "&q=" +
27
- props.quality
28
- );
21
+ const searchParams = new URLSearchParams();
22
+ searchParams.set("url", props.src);
23
+ searchParams.set("w", props.width.toString());
24
+ if (props.height) {
25
+ searchParams.set("h", props.height.toString());
26
+ }
27
+ searchParams.set("q", props.quality.toString());
28
+ // fit=contain by default
29
+ return `/.netlify/images?${searchParams}`;
29
30
  };
@@ -3,5 +3,16 @@ import { defineConfig } from "vite";
3
3
  import { netlifyPlugin } from "@netlify/remix-edge-adapter/plugin";
4
4
 
5
5
  export default defineConfig({
6
- plugins: [remix(), netlifyPlugin()],
6
+ plugins: [
7
+ remix({
8
+ future: {
9
+ v3_lazyRouteDiscovery: false,
10
+ v3_relativeSplatPath: false,
11
+ v3_singleFetch: false,
12
+ v3_fetcherPersist: false,
13
+ v3_throwAbortReason: false,
14
+ },
15
+ }),
16
+ netlifyPlugin(),
17
+ ],
7
18
  });
@@ -18,12 +18,13 @@ export const imageLoader = (props) => {
18
18
  }
19
19
 
20
20
  // https://docs.netlify.com/image-cdn/overview/
21
- return (
22
- "/.netlify/images?url=" +
23
- encodeURIComponent(props.src) +
24
- "&w=" +
25
- props.width +
26
- "&q=" +
27
- props.quality
28
- );
21
+ const searchParams = new URLSearchParams();
22
+ searchParams.set("url", props.src);
23
+ searchParams.set("w", props.width.toString());
24
+ if (props.height) {
25
+ searchParams.set("h", props.height.toString());
26
+ }
27
+ searchParams.set("q", props.quality.toString());
28
+ // fit=contain by default
29
+ return `/.netlify/images?${searchParams}`;
29
30
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "scripts": {
3
- "start": "netlify serve"
3
+ "start": "npx netlify-cli serve"
4
4
  },
5
5
  "dependencies": {
6
6
  "@netlify/functions": "^2.8.2",
@@ -3,5 +3,16 @@ import { defineConfig } from "vite";
3
3
  import { netlifyPlugin } from "@netlify/remix-adapter/plugin";
4
4
 
5
5
  export default defineConfig({
6
- plugins: [remix(), netlifyPlugin()],
6
+ plugins: [
7
+ remix({
8
+ future: {
9
+ v3_lazyRouteDiscovery: false,
10
+ v3_relativeSplatPath: false,
11
+ v3_singleFetch: false,
12
+ v3_fetcherPersist: false,
13
+ v3_throwAbortReason: false,
14
+ },
15
+ }),
16
+ netlifyPlugin(),
17
+ ],
7
18
  });
@@ -60,7 +60,7 @@ export const Head = ({ data }: { data: PageContext["data"] }) => {
60
60
  <link
61
61
  rel="icon"
62
62
  href={imageLoader({
63
- src: favIconAsset.name,
63
+ src: `${assetBaseUrl}${favIconAsset.name}`,
64
64
  // width,height must be multiple of 48 https://developers.google.com/search/docs/appearance/favicon-in-search
65
65
  width: 144,
66
66
  height: 144,
@@ -8,14 +8,14 @@
8
8
  "typecheck": "tsc"
9
9
  },
10
10
  "dependencies": {
11
- "@webstudio-is/react-sdk": "0.195.0",
12
- "@webstudio-is/sdk-components-react-radix": "0.195.0",
13
- "@webstudio-is/sdk-components-react": "0.195.0",
14
- "@webstudio-is/image": "0.195.0",
15
- "@webstudio-is/sdk": "0.195.0",
11
+ "@webstudio-is/react-sdk": "0.197.0",
12
+ "@webstudio-is/sdk-components-react-radix": "0.197.0",
13
+ "@webstudio-is/sdk-components-react": "0.197.0",
14
+ "@webstudio-is/image": "0.197.0",
15
+ "@webstudio-is/sdk": "0.197.0",
16
16
  "react": "18.3.0-canary-14898b6a9-20240318",
17
17
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
18
- "vike": "^0.4.206"
18
+ "vike": "^0.4.210"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/react": "^18.2.70",
@@ -24,12 +24,13 @@ export const imageLoader = (props) => {
24
24
  }
25
25
 
26
26
  // https://docs.netlify.com/image-cdn/overview/
27
- return (
28
- "/.netlify/images?url=" +
29
- encodeURIComponent(props.src) +
30
- "&w=" +
31
- props.width +
32
- "&q=" +
33
- props.quality
34
- );
27
+ const searchParams = new URLSearchParams();
28
+ searchParams.set("url", props.src);
29
+ searchParams.set("w", props.width.toString());
30
+ if (props.height) {
31
+ searchParams.set("h", props.height.toString());
32
+ }
33
+ searchParams.set("q", props.quality.toString());
34
+ // fit=contain by default
35
+ return `/.netlify/images?${searchParams}`;
35
36
  };
@@ -24,12 +24,9 @@ export const imageLoader = (props) => {
24
24
  }
25
25
 
26
26
  // https://vercel.com/blog/build-your-own-web-framework#automatic-image-optimization
27
- return (
28
- "/_vercel/image?url=" +
29
- encodeURIComponent(props.src) +
30
- "&w=" +
31
- props.width +
32
- "&q=" +
33
- props.quality
34
- );
27
+ const searchParams = new URLSearchParams();
28
+ searchParams.set("url", props.src);
29
+ searchParams.set("w", props.width.toString());
30
+ searchParams.set("q", props.quality.toString());
31
+ return `/_vercel/image?${searchParams}`;
35
32
  };
@@ -18,12 +18,9 @@ export const imageLoader = (props) => {
18
18
  }
19
19
 
20
20
  // https://vercel.com/blog/build-your-own-web-framework#automatic-image-optimization
21
- return (
22
- "/_vercel/image?url=" +
23
- encodeURIComponent(props.src) +
24
- "&w=" +
25
- props.width +
26
- "&q=" +
27
- props.quality
28
- );
21
+ const searchParams = new URLSearchParams();
22
+ searchParams.set("url", props.src);
23
+ searchParams.set("w", props.width.toString());
24
+ searchParams.set("q", props.quality.toString());
25
+ return `/_vercel/image?${searchParams}`;
29
26
  };