webstudio 0.185.0 → 0.191.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 CHANGED
@@ -917,12 +917,22 @@ Please check webstudio --help for more details`
917
917
  break;
918
918
  case "xml":
919
919
  {
920
- componentImports = `import { XmlNode } from "@webstudio-is/sdk-components-react";
920
+ componentImports = `import { XmlNode, XmlTime } from "@webstudio-is/sdk-components-react";
921
921
  `;
922
922
  xmlPresentationComponents += Array.from(componentsSet).map(
923
923
  ([shortName, component]) => scope.getName(component, shortName)
924
- ).filter((scopedName) => scopedName !== "XmlNode").map(
925
- (scopedName) => scopedName === "Body" ? `const ${scopedName} = (props: any) => props.children;` : `const ${scopedName} = () => null;`
924
+ ).filter(
925
+ (scopedName) => scopedName !== "XmlNode" && scopedName !== "XmlTime"
926
+ ).map(
927
+ (scopedName) => scopedName === "Body" ? (
928
+ // Using <svg> prevents React from hoisting elements like <title>, <meta>, and <link>
929
+ // out of their intended scope during rendering.
930
+ // More details: https://github.com/facebook/react/blob/7c8e5e7ab8bb63de911637892392c5efd8ce1d0f/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js#L3083
931
+ `const ${scopedName} = (props: any) => <svg>{props.children}</svg>;`
932
+ ) : (
933
+ // Do not render all other components
934
+ `const ${scopedName} = (props: any) => null;`
935
+ )
926
936
  ).join("\n");
927
937
  }
928
938
  break;
@@ -1175,6 +1185,7 @@ var build = async (options) => {
1175
1185
  import { chdir, cwd as cwd4 } from "node:process";
1176
1186
  import { join as join7 } from "node:path";
1177
1187
  import pc2 from "picocolors";
1188
+ import { x } from "tinyexec";
1178
1189
  import {
1179
1190
  cancel as cancel2,
1180
1191
  confirm,
@@ -1184,7 +1195,6 @@ import {
1184
1195
  spinner as spinner3,
1185
1196
  text as text2
1186
1197
  } from "@clack/prompts";
1187
- import { $ } from "execa";
1188
1198
  var exitIfCancelled = (value) => {
1189
1199
  if (isCancel2(value)) {
1190
1200
  cancel2("Project initialization is cancelled");
@@ -1256,7 +1266,7 @@ var initFlow = async (options) => {
1256
1266
  if (shouldInstallDeps === true) {
1257
1267
  const install = spinner3();
1258
1268
  install.start("Installing dependencies");
1259
- await $`npm install`;
1269
+ await x("npm", ["install"]);
1260
1270
  install.stop("Installed dependencies");
1261
1271
  }
1262
1272
  log4.message();
@@ -1294,7 +1304,7 @@ import makeCLI from "yargs";
1294
1304
  // package.json
1295
1305
  var package_default = {
1296
1306
  name: "webstudio",
1297
- version: "0.185.0",
1307
+ version: "0.191.0",
1298
1308
  description: "Webstudio CLI",
1299
1309
  author: "Webstudio <github@webstudio.is>",
1300
1310
  homepage: "https://webstudio.is",
@@ -1318,7 +1328,7 @@ var package_default = {
1318
1328
  scripts: {
1319
1329
  typecheck: "tsc",
1320
1330
  build: "rm -rf lib && esbuild src/cli.ts --outdir=lib --bundle --format=esm --packages=external",
1321
- test: "NODE_OPTIONS=--experimental-vm-modules jest"
1331
+ test: "vitest run"
1322
1332
  },
1323
1333
  license: "AGPL-3.0-or-later",
1324
1334
  engines: {
@@ -1336,37 +1346,36 @@ var package_default = {
1336
1346
  "change-case": "^5.4.4",
1337
1347
  deepmerge: "^4.3.1",
1338
1348
  "env-paths": "^3.0.0",
1339
- execa: "^7.2.0",
1340
1349
  "p-limit": "^4.0.0",
1341
1350
  parse5: "7.1.2",
1342
1351
  picocolors: "^1.1.0",
1343
1352
  "strip-indent": "^4.0.0",
1353
+ tinyexec: "^0.3.1",
1344
1354
  yargs: "^17.7.2",
1345
1355
  zod: "^3.22.4"
1346
1356
  },
1347
1357
  devDependencies: {
1348
- "@jest/globals": "^29.7.0",
1349
1358
  "@netlify/remix-adapter": "^2.5.1",
1350
1359
  "@netlify/remix-edge-adapter": "3.4.2",
1351
- "@remix-run/cloudflare": "^2.12.1",
1352
- "@remix-run/cloudflare-pages": "^2.12.1",
1353
- "@remix-run/dev": "^2.12.1",
1354
- "@remix-run/node": "^2.12.1",
1355
- "@remix-run/react": "^2.12.1",
1356
- "@remix-run/server-runtime": "^2.12.1",
1357
- "@types/node": "^22.6.1",
1360
+ "@remix-run/cloudflare": "^2.15.0",
1361
+ "@remix-run/cloudflare-pages": "^2.15.0",
1362
+ "@remix-run/dev": "^2.15.0",
1363
+ "@remix-run/node": "^2.15.0",
1364
+ "@remix-run/react": "^2.15.0",
1365
+ "@remix-run/server-runtime": "^2.15.0",
1366
+ "@types/node": "^22.9.3",
1358
1367
  "@types/react": "^18.2.70",
1359
1368
  "@types/react-dom": "^18.2.25",
1360
- "@types/yargs": "^17.0.32",
1361
- "@vitejs/plugin-react": "^4.3.2",
1362
- "@webstudio-is/jest-config": "workspace:*",
1369
+ "@types/yargs": "^17.0.33",
1370
+ "@vitejs/plugin-react": "^4.3.4",
1363
1371
  "@webstudio-is/tsconfig": "workspace:*",
1372
+ prettier: "3.4.2",
1364
1373
  react: "18.3.0-canary-14898b6a9-20240318",
1365
1374
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
1366
1375
  "ts-expect": "^1.3.0",
1367
- typescript: "5.5.2",
1368
- vike: "^0.4.182",
1369
- vite: "^5.4.8",
1376
+ vike: "^0.4.206",
1377
+ vite: "^5.4.11",
1378
+ vitest: "^2.1.8",
1370
1379
  wrangler: "^3.63.2"
1371
1380
  }
1372
1381
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webstudio",
3
- "version": "0.185.0",
3
+ "version": "0.191.0",
4
4
  "description": "Webstudio CLI",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -30,49 +30,48 @@
30
30
  "change-case": "^5.4.4",
31
31
  "deepmerge": "^4.3.1",
32
32
  "env-paths": "^3.0.0",
33
- "execa": "^7.2.0",
34
33
  "p-limit": "^4.0.0",
35
34
  "parse5": "7.1.2",
36
35
  "picocolors": "^1.1.0",
37
36
  "strip-indent": "^4.0.0",
37
+ "tinyexec": "^0.3.1",
38
38
  "yargs": "^17.7.2",
39
39
  "zod": "^3.22.4",
40
- "@webstudio-is/http-client": "0.185.0",
41
- "@webstudio-is/image": "0.185.0",
42
- "@webstudio-is/react-sdk": "0.185.0",
43
- "@webstudio-is/sdk-components-react": "0.185.0",
44
- "@webstudio-is/sdk": "0.185.0",
45
- "@webstudio-is/sdk-components-react-radix": "0.185.0",
46
- "@webstudio-is/sdk-components-react-remix": "0.185.0"
40
+ "@webstudio-is/http-client": "0.191.0",
41
+ "@webstudio-is/image": "0.191.0",
42
+ "@webstudio-is/sdk": "0.191.0",
43
+ "@webstudio-is/sdk-components-react": "0.191.0",
44
+ "@webstudio-is/react-sdk": "0.191.0",
45
+ "@webstudio-is/sdk-components-react-remix": "0.191.0",
46
+ "@webstudio-is/sdk-components-react-radix": "0.191.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@jest/globals": "^29.7.0",
50
49
  "@netlify/remix-adapter": "^2.5.1",
51
50
  "@netlify/remix-edge-adapter": "3.4.2",
52
- "@remix-run/cloudflare": "^2.12.1",
53
- "@remix-run/cloudflare-pages": "^2.12.1",
54
- "@remix-run/dev": "^2.12.1",
55
- "@remix-run/node": "^2.12.1",
56
- "@remix-run/react": "^2.12.1",
57
- "@remix-run/server-runtime": "^2.12.1",
58
- "@types/node": "^22.6.1",
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",
59
58
  "@types/react": "^18.2.70",
60
59
  "@types/react-dom": "^18.2.25",
61
- "@types/yargs": "^17.0.32",
62
- "@vitejs/plugin-react": "^4.3.2",
60
+ "@types/yargs": "^17.0.33",
61
+ "@vitejs/plugin-react": "^4.3.4",
62
+ "prettier": "3.4.2",
63
63
  "react": "18.3.0-canary-14898b6a9-20240318",
64
64
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
65
65
  "ts-expect": "^1.3.0",
66
- "typescript": "5.5.2",
67
- "vike": "^0.4.182",
68
- "vite": "^5.4.8",
66
+ "vike": "^0.4.206",
67
+ "vite": "^5.4.11",
68
+ "vitest": "^2.1.8",
69
69
  "wrangler": "^3.63.2",
70
- "@webstudio-is/jest-config": "1.0.7",
71
70
  "@webstudio-is/tsconfig": "1.0.7"
72
71
  },
73
72
  "scripts": {
74
73
  "typecheck": "tsc",
75
74
  "build": "rm -rf lib && esbuild src/cli.ts --outdir=lib --bundle --format=esm --packages=external",
76
- "test": "NODE_OPTIONS=--experimental-vm-modules jest"
75
+ "test": "vitest run"
77
76
  }
78
77
  }
@@ -12,8 +12,8 @@
12
12
  "build-cf-types": "wrangler types"
13
13
  },
14
14
  "dependencies": {
15
- "@remix-run/cloudflare": "2.12.1",
16
- "@remix-run/cloudflare-pages": "2.12.1"
15
+ "@remix-run/cloudflare": "2.15.0",
16
+ "@remix-run/cloudflare-pages": "2.15.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@cloudflare/workers-types": "^4.20240620.0",
@@ -15,7 +15,7 @@ import {
15
15
  loadResources,
16
16
  formIdFieldName,
17
17
  formBotFieldName,
18
- } from "@webstudio-is/sdk";
18
+ } from "@webstudio-is/sdk/runtime";
19
19
  import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";
20
20
  import {
21
21
  Page,
@@ -1,6 +1,6 @@
1
1
  import { renderToString } from "react-dom/server";
2
2
  import { type LoaderFunctionArgs, redirect } from "@remix-run/server-runtime";
3
- import { isLocalResource, loadResources } from "@webstudio-is/sdk";
3
+ import { isLocalResource, loadResources } from "@webstudio-is/sdk/runtime";
4
4
  import { ReactSdkContext } from "@webstudio-is/react-sdk/runtime";
5
5
  import { Page } from "__CLIENT__";
6
6
  import { getPageMeta, getRemixParams, getResources } from "__SERVER__";
@@ -56,7 +56,7 @@ export const loader = async (arg: LoaderFunctionArgs) => {
56
56
  // typecheck
57
57
  arg.context.EXCLUDE_FROM_SEARCH satisfies boolean;
58
58
 
59
- const text = renderToString(
59
+ let text = renderToString(
60
60
  <ReactSdkContext.Provider
61
61
  value={{
62
62
  imageLoader,
@@ -69,6 +69,10 @@ export const loader = async (arg: LoaderFunctionArgs) => {
69
69
  </ReactSdkContext.Provider>
70
70
  );
71
71
 
72
+ // Xml is wrapped with <svg> to prevent React from hoisting elements like <title>, <meta>, and <link> out of their intended scope during rendering.
73
+ // More details: https://github.com/facebook/react/blob/7c8e5e7ab8bb63de911637892392c5efd8ce1d0f/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js#L3083
74
+ text = text.replace(/^<svg>/g, "").replace(/<\/svg>$/g, "");
75
+
72
76
  return new Response(`<?xml version="1.0" encoding="UTF-8"?>\n${text}`, {
73
77
  headers: { "Content-Type": "application/xml" },
74
78
  });
@@ -8,25 +8,25 @@
8
8
  "typecheck": "tsc"
9
9
  },
10
10
  "dependencies": {
11
- "@remix-run/node": "2.12.1",
12
- "@remix-run/react": "2.12.1",
13
- "@remix-run/server-runtime": "2.12.1",
14
- "@webstudio-is/react-sdk": "0.185.0",
15
- "@webstudio-is/sdk-components-react-radix": "0.185.0",
16
- "@webstudio-is/sdk-components-react-remix": "0.185.0",
17
- "@webstudio-is/sdk-components-react": "0.185.0",
18
- "@webstudio-is/image": "0.185.0",
19
- "@webstudio-is/sdk": "0.185.0",
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.191.0",
15
+ "@webstudio-is/sdk-components-react-radix": "0.191.0",
16
+ "@webstudio-is/sdk-components-react-remix": "0.191.0",
17
+ "@webstudio-is/sdk-components-react": "0.191.0",
18
+ "@webstudio-is/image": "0.191.0",
19
+ "@webstudio-is/sdk": "0.191.0",
20
20
  "isbot": "^5.1.17",
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.12.1",
25
+ "@remix-run/dev": "2.15.0",
26
26
  "@types/react": "^18.2.70",
27
27
  "@types/react-dom": "^18.2.25",
28
- "typescript": "5.5.2",
29
- "vite": "^5.4.8"
28
+ "typescript": "5.7.2",
29
+ "vite": "^5.4.11"
30
30
  },
31
31
  "engines": {
32
32
  "node": ">=20.0.0"
@@ -3,7 +3,7 @@
3
3
  "start": "netlify serve"
4
4
  },
5
5
  "dependencies": {
6
- "@netlify/edge-functions": "^2.11.0",
6
+ "@netlify/edge-functions": "^2.11.1",
7
7
  "@netlify/remix-edge-adapter": "^3.4.2"
8
8
  }
9
9
  }
@@ -3,7 +3,7 @@
3
3
  "start": "netlify serve"
4
4
  },
5
5
  "dependencies": {
6
- "@netlify/functions": "^2.8.1",
6
+ "@netlify/functions": "^2.8.2",
7
7
  "@netlify/remix-adapter": "^2.5.1"
8
8
  }
9
9
  }
@@ -1,6 +1,6 @@
1
1
  import type { PageContextServer } from "vike/types";
2
2
  import { redirect } from "vike/abort";
3
- import { loadResources } from "@webstudio-is/sdk";
3
+ import { loadResources } from "@webstudio-is/sdk/runtime";
4
4
  import { getPageMeta, getResources } from "__SERVER__";
5
5
 
6
6
  export const data = async (pageContext: PageContextServer) => {
@@ -8,21 +8,21 @@
8
8
  "typecheck": "tsc"
9
9
  },
10
10
  "dependencies": {
11
- "@webstudio-is/react-sdk": "0.185.0",
12
- "@webstudio-is/sdk-components-react-radix": "0.185.0",
13
- "@webstudio-is/sdk-components-react": "0.185.0",
14
- "@webstudio-is/image": "0.185.0",
15
- "@webstudio-is/sdk": "0.185.0",
11
+ "@webstudio-is/react-sdk": "0.191.0",
12
+ "@webstudio-is/sdk-components-react-radix": "0.191.0",
13
+ "@webstudio-is/sdk-components-react": "0.191.0",
14
+ "@webstudio-is/image": "0.191.0",
15
+ "@webstudio-is/sdk": "0.191.0",
16
16
  "react": "18.3.0-canary-14898b6a9-20240318",
17
17
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
18
- "vike": "^0.4.182"
18
+ "vike": "^0.4.206"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/react": "^18.2.70",
22
22
  "@types/react-dom": "^18.2.25",
23
- "@vitejs/plugin-react": "^4.3.2",
24
- "typescript": "5.5.2",
25
- "vite": "^5.4.8"
23
+ "@vitejs/plugin-react": "^4.3.4",
24
+ "typescript": "5.7.2",
25
+ "vite": "^5.4.11"
26
26
  },
27
27
  "engines": {
28
28
  "node": ">=20.0.0"