webstudio 0.134.0 → 0.136.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
@@ -364,12 +364,20 @@ var prebuild = async (options) => {
364
364
  Please check webstudio --help for more details`
365
365
  );
366
366
  }
367
- if (options.template !== "vanilla" && await isCliTemplate(options.template) === false && options.template.startsWith(".") === false) {
368
- throw Error(
369
- `
367
+ for (const template of options.template) {
368
+ if (template === "vanilla") {
369
+ continue;
370
+ }
371
+ if (template.startsWith(".")) {
372
+ continue;
373
+ }
374
+ if (await isCliTemplate(template) === false) {
375
+ throw Error(
376
+ `
370
377
  Template ${options.template} is not available
371
378
  Please check webstudio --help for more details`
372
- );
379
+ );
380
+ }
373
381
  }
374
382
  const spinner = ora2("Scaffolding the project files");
375
383
  spinner.start();
@@ -380,8 +388,11 @@ var prebuild = async (options) => {
380
388
  const routesDir = join4(appRoot, "routes");
381
389
  await rm(routesDir, { recursive: true, force: true });
382
390
  await copyTemplates();
383
- if (options.template !== "vanilla") {
384
- await copyTemplates(options.template);
391
+ for (const template of options.template) {
392
+ if (template === "vanilla") {
393
+ continue;
394
+ }
395
+ await copyTemplates(template);
385
396
  }
386
397
  const constants2 = await import(pathToFileURL(join4(cwd3(), "app/constants.mjs")).href);
387
398
  const { assetBaseUrl } = constants2;
@@ -757,7 +768,8 @@ var buildOptions = (yargs) => yargs.option("assets", {
757
768
  default: false,
758
769
  describe: "[Experimental] Use preview version of the project"
759
770
  }).option("template", {
760
- type: "string",
771
+ type: "array",
772
+ string: true,
761
773
  describe: `Template to use for the build [choices: ${PROJECT_TEMPALTES.join(
762
774
  ", "
763
775
  )}]`
@@ -872,7 +884,7 @@ var initFlow = async (options) => {
872
884
  }
873
885
  await build({
874
886
  ...options,
875
- ...projectTemplate && { template: projectTemplate }
887
+ ...projectTemplate && { template: [projectTemplate] }
876
888
  });
877
889
  if (shouldInstallDeps === true) {
878
890
  const spinner = ora3().start();
@@ -915,7 +927,7 @@ import makeCLI from "yargs";
915
927
  // package.json
916
928
  var package_default = {
917
929
  name: "webstudio",
918
- version: "0.134.0",
930
+ version: "0.136.0",
919
931
  description: "Webstudio CLI",
920
932
  author: "Webstudio <github@webstudio.is>",
921
933
  homepage: "https://webstudio.is",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webstudio",
3
- "version": "0.134.0",
3
+ "version": "0.136.0",
4
4
  "description": "Webstudio CLI",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -28,13 +28,13 @@
28
28
  "title-case": "^4.1.0",
29
29
  "yargs": "^17.7.2",
30
30
  "zod": "^3.21.4",
31
- "@webstudio-is/image": "0.134.0",
32
- "@webstudio-is/http-client": "0.134.0",
33
- "@webstudio-is/sdk": "0.134.0",
34
- "@webstudio-is/react-sdk": "0.134.0",
35
- "@webstudio-is/sdk-components-react-radix": "0.134.0",
36
- "@webstudio-is/sdk-components-react-remix": "0.134.0",
37
- "@webstudio-is/sdk-components-react": "0.134.0"
31
+ "@webstudio-is/http-client": "0.136.0",
32
+ "@webstudio-is/react-sdk": "0.136.0",
33
+ "@webstudio-is/image": "0.136.0",
34
+ "@webstudio-is/sdk": "0.136.0",
35
+ "@webstudio-is/sdk-components-react": "0.136.0",
36
+ "@webstudio-is/sdk-components-react-radix": "0.136.0",
37
+ "@webstudio-is/sdk-components-react-remix": "0.136.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^18.17.1",
@@ -42,7 +42,7 @@
42
42
  "tsx": "^3.12.8",
43
43
  "typescript": "5.2.2",
44
44
  "@webstudio-is/tsconfig": "1.0.7",
45
- "@webstudio-is/form-handlers": "0.134.0"
45
+ "@webstudio-is/form-handlers": "0.136.0"
46
46
  },
47
47
  "scripts": {
48
48
  "typecheck": "tsc",
@@ -5,6 +5,7 @@ import {
5
5
  type LinkDescriptor,
6
6
  type ActionArgs,
7
7
  type LoaderArgs,
8
+ type HeadersArgs,
8
9
  json,
9
10
  redirect,
10
11
  } from "@remix-run/server-runtime";
@@ -71,14 +72,18 @@ export const loader = async (arg: LoaderArgs) => {
71
72
  // In case of CRM Data, this should be set to 0
72
73
  {
73
74
  status: pageMeta.status,
74
- headers: { "Cache-Control": "public, max-age=600" },
75
+ headers: {
76
+ "Cache-Control": "public, max-age=600",
77
+ "x-ws-language": pageMeta.language ?? "en",
78
+ },
75
79
  }
76
80
  );
77
81
  };
78
82
 
79
- export const headers = () => {
83
+ export const headers = ({ loaderHeaders }: HeadersArgs) => {
80
84
  return {
81
85
  "Cache-Control": "public, max-age=0, must-revalidate",
86
+ "x-ws-language": loaderHeaders.get("x-ws-language"),
82
87
  };
83
88
  };
84
89
 
@@ -214,18 +219,16 @@ export const links: LinksFunction = () => {
214
219
  for (const asset of pageFontAssets) {
215
220
  result.push({
216
221
  rel: "preload",
217
- href: assetBaseUrl + asset.name,
222
+ href: `${assetBaseUrl}${asset.name}`,
218
223
  as: "font",
224
+ crossOrigin: "anonymous",
219
225
  });
220
226
  }
221
227
 
222
228
  for (const backgroundImageAsset of pageBackgroundImageAssets) {
223
229
  result.push({
224
230
  rel: "preload",
225
- href: imageLoader({
226
- src: backgroundImageAsset.name,
227
- format: "raw",
228
- }),
231
+ href: `${assetBaseUrl}${backgroundImageAsset.name}`,
229
232
  as: "image",
230
233
  });
231
234
  }
@@ -10,13 +10,13 @@
10
10
  "@remix-run/react": "^1.19.2",
11
11
  "@remix-run/server-runtime": "^1.19.2",
12
12
  "@remix-run/node": "^1.19.2",
13
- "@webstudio-is/react-sdk": "0.134.0",
14
- "@webstudio-is/sdk-components-react-radix": "0.134.0",
15
- "@webstudio-is/sdk-components-react-remix": "0.134.0",
16
- "@webstudio-is/sdk-components-react": "0.134.0",
17
- "@webstudio-is/form-handlers": "0.134.0",
18
- "@webstudio-is/image": "0.134.0",
19
- "@webstudio-is/sdk": "0.134.0",
13
+ "@webstudio-is/react-sdk": "0.136.0",
14
+ "@webstudio-is/sdk-components-react-radix": "0.136.0",
15
+ "@webstudio-is/sdk-components-react-remix": "0.136.0",
16
+ "@webstudio-is/sdk-components-react": "0.136.0",
17
+ "@webstudio-is/form-handlers": "0.136.0",
18
+ "@webstudio-is/image": "0.136.0",
19
+ "@webstudio-is/sdk": "0.136.0",
20
20
  "isbot": "^3.6.8",
21
21
  "react": "^18.2.0",
22
22
  "react-dom": "^18.2.0"