webstudio 0.274.3 → 0.274.4

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.
@@ -7635,7 +7635,7 @@ class HandledCliError extends Error {
7635
7635
  }
7636
7636
  const isHandledCliError = (error) => error instanceof HandledCliError;
7637
7637
  const name$N = "webstudio";
7638
- const version = "0.274.3";
7638
+ const version = "0.274.4";
7639
7639
  const description = "Webstudio CLI";
7640
7640
  const author = "Webstudio <github@webstudio.is>";
7641
7641
  const homepage = "https://webstudio.is";
@@ -8988,9 +8988,9 @@ const htmlToJsx = (html2) => {
8988
8988
  }
8989
8989
  return result;
8990
8990
  };
8991
- const createRemixFramework = async () => (await import("./framework-remix-ByApfd6J.js")).createFramework();
8992
- const createReactRouterFramework = async () => (await import("./framework-react-router-D1HMM2Nm.js")).createFramework();
8993
- const createVikeSsgFramework = async () => (await import("./framework-vike-ssg-BGhpJT5M.js")).createFramework();
8991
+ const createRemixFramework = async () => (await import("./framework-remix-B0x9qavm.js")).createFramework();
8992
+ const createReactRouterFramework = async () => (await import("./framework-react-router-C6Ra_yxB.js")).createFramework();
8993
+ const createVikeSsgFramework = async () => (await import("./framework-vike-ssg-CPpMMlL7.js")).createFramework();
8994
8994
  const mergeJsonInto = async (sourcePath, destinationPath) => {
8995
8995
  const sourceJson = await readFile(sourcePath, "utf8");
8996
8996
  const destinationJson = await readFile(destinationPath, "utf8").catch(
@@ -9077,6 +9077,25 @@ const generateRedirectsModule = (pageRedirects) => {
9077
9077
  export const redirects = ${JSON.stringify(redirects, null, 2)};
9078
9078
  `;
9079
9079
  };
9080
+ const generateRedirectFallbackRoute = (runtime) => {
9081
+ const loaderFunctionArgs = runtime === "react-router" ? "react-router" : "@remix-run/server-runtime";
9082
+ return `
9083
+ import { type LoaderFunctionArgs } from ${JSON.stringify(loaderFunctionArgs)};
9084
+ import { redirectRequest } from "../redirect-url";
9085
+ // @todo think about how to make __generated__ typeable
9086
+ // @ts-ignore
9087
+ import { redirects } from "../__generated__/$resources.redirects";
9088
+
9089
+ export const loader = ({ request }: LoaderFunctionArgs) => {
9090
+ const redirectResponse = redirectRequest(request, redirects);
9091
+ if (redirectResponse !== undefined) {
9092
+ return redirectResponse;
9093
+ }
9094
+
9095
+ throw new Response("Not Found", { status: 404 });
9096
+ };
9097
+ `;
9098
+ };
9080
9099
  const prebuild = async (options) => {
9081
9100
  var _a3, _b2, _c, _d, _e, _f, _g, _h, _i, _j;
9082
9101
  if (options.template.length === 0) {
@@ -9492,6 +9511,14 @@ Please check webstudio --help for more details`
9492
9511
  join(generatedDir, "$resources.redirects.ts"),
9493
9512
  generateRedirectsModule(pages2.redirects)
9494
9513
  );
9514
+ if (pages2.redirects !== void 0 && pages2.redirects.length > 0) {
9515
+ await createFileIfNotExists(
9516
+ join(routesDir, "$.tsx"),
9517
+ generateRedirectFallbackRoute(
9518
+ options.template.includes("react-router") ? "react-router" : "remix"
9519
+ )
9520
+ );
9521
+ }
9495
9522
  if (options.assets === true && siteData.assets.length > 0) {
9496
9523
  const downloading = spinner();
9497
9524
  downloading.start("Downloading fonts and images");
@@ -39371,6 +39398,10 @@ const captureScreenshotWithBrowserInstall = async (options, dependencies2 = defa
39371
39398
  return captureScreenshot(options, dependencies2);
39372
39399
  }
39373
39400
  };
39401
+ const prepareMcpProjectSession = async (session) => {
39402
+ await session.initialize();
39403
+ await session.markStale(builderNamespaces);
39404
+ };
39374
39405
  const mcpOptions = (yargs) => yargs.example(
39375
39406
  "$0 mcp",
39376
39407
  "Run a local MCP server over stdio for the configured Webstudio project"
@@ -39383,6 +39414,7 @@ const mcpOptions = (yargs) => yargs.example(
39383
39414
  ).epilogue(
39384
39415
  [
39385
39416
  "Plain `webstudio mcp` starts the stdio MCP server.",
39417
+ "Startup marks cached ProjectSession data stale so MCP tools read the current Builder dev build.",
39386
39418
  "After startup, MCP clients discover capabilities with tools/list, resources/list, meta.index, meta.guide, and meta.get_more_tools.",
39387
39419
  "stdout is reserved for MCP JSON-RPC messages while the server is running."
39388
39420
  ].join("\n")
@@ -39404,6 +39436,7 @@ const mcp = async () => {
39404
39436
  }
39405
39437
  };
39406
39438
  const session = createCliProjectSession({ connection: apiConnection });
39439
+ await prepareMcpProjectSession(session);
39407
39440
  const preview2 = createPreviewController({ host: "127.0.0.1", port: 5173 });
39408
39441
  await connectProjectSessionMcpServer({
39409
39442
  operations: publicApiOperations,
package/lib/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "node:process";
2
2
  import "yargs/helpers";
3
- import { ay, ax } from "./cli-fEGl5mA1.js";
3
+ import { ay, ax } from "./cli-DFVUpwsS.js";
4
4
  import "yargs";
5
5
  export {
6
6
  ay as main,
@@ -1,7 +1,7 @@
1
1
  import { join } from "node:path";
2
2
  import { readFile, rm } from "node:fs/promises";
3
- import { b as baseComponentMetas, r as radixComponentMetas, a as animationComponentMetas } from "./metas-Bl_IZxfk.js";
4
- import { g as generateRemixRoute } from "./cli-fEGl5mA1.js";
3
+ import { b as baseComponentMetas, r as radixComponentMetas, a as animationComponentMetas } from "./metas-CS7NxloQ.js";
4
+ import { g as generateRemixRoute } from "./cli-DFVUpwsS.js";
5
5
  const createFramework = async () => {
6
6
  const routeTemplatesDir = join("app", "route-templates");
7
7
  const htmlTemplate = await readFile(
@@ -1,7 +1,7 @@
1
1
  import { join } from "node:path";
2
2
  import { readFile, rm } from "node:fs/promises";
3
- import { b as baseComponentMetas, r as radixComponentMetas, a as animationComponentMetas } from "./metas-Bl_IZxfk.js";
4
- import { g as generateRemixRoute } from "./cli-fEGl5mA1.js";
3
+ import { b as baseComponentMetas, r as radixComponentMetas, a as animationComponentMetas } from "./metas-CS7NxloQ.js";
4
+ import { g as generateRemixRoute } from "./cli-DFVUpwsS.js";
5
5
  const createFramework = async () => {
6
6
  const routeTemplatesDir = join("app", "route-templates");
7
7
  const htmlTemplate = await readFile(
@@ -1,7 +1,7 @@
1
1
  import { join } from "node:path";
2
2
  import { readFile, rm } from "node:fs/promises";
3
- import { b as baseComponentMetas, r as radixComponentMetas, a as animationComponentMetas } from "./metas-Bl_IZxfk.js";
4
- import { i as isPathnamePattern } from "./cli-fEGl5mA1.js";
3
+ import { b as baseComponentMetas, r as radixComponentMetas, a as animationComponentMetas } from "./metas-CS7NxloQ.js";
4
+ import { i as isPathnamePattern } from "./cli-DFVUpwsS.js";
5
5
  const generateVikeRoute = (pagePath) => {
6
6
  if (pagePath === "/") {
7
7
  return "index";
@@ -1,4 +1,4 @@
1
- import { S as SlotComponentIcon, d as descendantComponent, E as EmbedIcon, M as MarkdownEmbedIcon, b as body, s as section, n as nav, m as main, h as header, f as footer, a as figure, c as aside, e as article, j as address, k as div, T as TextIcon, l as h6, o as h5, p as h4, q as h3, r as h2, t as h1, u as p, v as a, w as span, P as PaintBrushIcon, x as b, y as i, z as sup, A as sub, B as button, C as input, D as form, W as WebhookFormIcon, F as img, G as ul, H as ol, I as li, J as hr, K as code, L as BracesIcon, N as label, O as textarea, Q as radio, R as RadioCheckedIcon, U as checkbox, V as CheckboxCheckedIcon, X as VimeoIcon, Y as YoutubeIcon, Z as ButtonElementIcon, _ as BoxIcon, $ as XmlIcon, a0 as CalendarIcon, a1 as time, a2 as select, a3 as HeaderIcon, a4 as ResourceIcon, a5 as WindowInfoIcon, a6 as WindowTitleIcon, a7 as VideoIcon, a8 as AnimationGroupIcon, a9 as TextAnimationIcon, aa as StaggerAnimationIcon, ab as PlayIcon, ac as CollapsibleIcon, ad as TriggerIcon, ae as ContentIcon, af as DialogIcon, ag as OverlayIcon, ah as HeadingIcon, ai as PopoverIcon, aj as TooltipIcon, ak as TabsIcon, al as LabelIcon, am as AccordionIcon, an as ItemIcon, ao as NavigationMenuIcon, ap as ListIcon, aq as ListItemIcon, ar as ViewportIcon, as as SelectIcon, at as FormTextFieldIcon, au as CheckMarkIcon, av as SwitchIcon, aw as RadioGroupIcon } from "./cli-fEGl5mA1.js";
1
+ import { S as SlotComponentIcon, d as descendantComponent, E as EmbedIcon, M as MarkdownEmbedIcon, b as body, s as section, n as nav, m as main, h as header, f as footer, a as figure, c as aside, e as article, j as address, k as div, T as TextIcon, l as h6, o as h5, p as h4, q as h3, r as h2, t as h1, u as p, v as a, w as span, P as PaintBrushIcon, x as b, y as i, z as sup, A as sub, B as button, C as input, D as form, W as WebhookFormIcon, F as img, G as ul, H as ol, I as li, J as hr, K as code, L as BracesIcon, N as label, O as textarea, Q as radio, R as RadioCheckedIcon, U as checkbox, V as CheckboxCheckedIcon, X as VimeoIcon, Y as YoutubeIcon, Z as ButtonElementIcon, _ as BoxIcon, $ as XmlIcon, a0 as CalendarIcon, a1 as time, a2 as select, a3 as HeaderIcon, a4 as ResourceIcon, a5 as WindowInfoIcon, a6 as WindowTitleIcon, a7 as VideoIcon, a8 as AnimationGroupIcon, a9 as TextAnimationIcon, aa as StaggerAnimationIcon, ab as PlayIcon, ac as CollapsibleIcon, ad as TriggerIcon, ae as ContentIcon, af as DialogIcon, ag as OverlayIcon, ah as HeadingIcon, ai as PopoverIcon, aj as TooltipIcon, ak as TabsIcon, al as LabelIcon, am as AccordionIcon, an as ItemIcon, ao as NavigationMenuIcon, ap as ListIcon, aq as ListItemIcon, ar as ViewportIcon, as as SelectIcon, at as FormTextFieldIcon, au as CheckMarkIcon, av as SwitchIcon, aw as RadioGroupIcon } from "./cli-DFVUpwsS.js";
2
2
  const meta$N = {
3
3
  category: "general",
4
4
  description: "Slot is a container for content that you want to reference across the project. Changes made to a Slot's children will be reflected in all other instances of that Slot.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webstudio",
3
- "version": "0.274.3",
3
+ "version": "0.274.4",
4
4
  "description": "Webstudio CLI",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -47,9 +47,9 @@
47
47
  "warn-once": "^0.1.1",
48
48
  "yargs": "^17.7.2",
49
49
  "zod": "^3.24.2",
50
- "@webstudio-is/http-client": "0.274.3",
51
- "@webstudio-is/protocol": "0.274.3",
52
- "@webstudio-is/project-migrations": "0.274.3"
50
+ "@webstudio-is/http-client": "0.274.4",
51
+ "@webstudio-is/project-migrations": "0.274.4",
52
+ "@webstudio-is/protocol": "0.274.4"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@cloudflare/vite-plugin": "^1.1.0",
@@ -79,18 +79,18 @@
79
79
  "vite": "^6.3.4",
80
80
  "vitest": "^3.1.2",
81
81
  "wrangler": "^3.63.2",
82
- "@webstudio-is/css-engine": "0.274.3",
82
+ "@webstudio-is/css-engine": "0.274.4",
83
83
  "@webstudio-is/project-build": "0.0.0",
84
- "@webstudio-is/image": "0.274.3",
85
- "@webstudio-is/react-sdk": "0.274.3",
86
- "@webstudio-is/sdk": "0.274.3",
87
- "@webstudio-is/sdk-components-animation": "0.274.3",
88
- "@webstudio-is/sdk-components-react": "0.274.3",
89
- "@webstudio-is/sdk-components-react-radix": "0.274.3",
90
- "@webstudio-is/sdk-components-react-remix": "0.274.3",
91
- "@webstudio-is/sdk-components-react-router": "0.274.3",
84
+ "@webstudio-is/image": "0.274.4",
85
+ "@webstudio-is/react-sdk": "0.274.4",
86
+ "@webstudio-is/sdk": "0.274.4",
87
+ "@webstudio-is/sdk-components-animation": "0.274.4",
88
+ "@webstudio-is/sdk-components-react-radix": "0.274.4",
89
+ "@webstudio-is/sdk-components-react": "0.274.4",
90
+ "@webstudio-is/sdk-components-react-remix": "0.274.4",
91
+ "@webstudio-is/sdk-components-react-router": "0.274.4",
92
92
  "@webstudio-is/tsconfig": "1.0.7",
93
- "@webstudio-is/wsauth": "0.274.3"
93
+ "@webstudio-is/wsauth": "0.274.4"
94
94
  },
95
95
  "scripts": {
96
96
  "typecheck": "tsgo --noEmit",
@@ -12,7 +12,7 @@
12
12
  "build-cf-types": "wrangler types"
13
13
  },
14
14
  "dependencies": {
15
- "@webstudio-is/wsauth": "0.274.3",
15
+ "@webstudio-is/wsauth": "0.274.4",
16
16
  "@remix-run/cloudflare": "2.16.5",
17
17
  "@remix-run/cloudflare-pages": "2.16.5"
18
18
  },
@@ -11,14 +11,14 @@
11
11
  "@remix-run/node": "2.16.5",
12
12
  "@remix-run/react": "2.16.5",
13
13
  "@remix-run/server-runtime": "2.16.5",
14
- "@webstudio-is/image": "0.274.3",
15
- "@webstudio-is/react-sdk": "0.274.3",
16
- "@webstudio-is/sdk": "0.274.3",
17
- "@webstudio-is/sdk-components-react": "0.274.3",
18
- "@webstudio-is/sdk-components-animation": "0.274.3",
19
- "@webstudio-is/sdk-components-react-radix": "0.274.3",
20
- "@webstudio-is/sdk-components-react-remix": "0.274.3",
21
- "@webstudio-is/wsauth": "0.274.3",
14
+ "@webstudio-is/image": "0.274.4",
15
+ "@webstudio-is/react-sdk": "0.274.4",
16
+ "@webstudio-is/sdk": "0.274.4",
17
+ "@webstudio-is/sdk-components-react": "0.274.4",
18
+ "@webstudio-is/sdk-components-animation": "0.274.4",
19
+ "@webstudio-is/sdk-components-react-radix": "0.274.4",
20
+ "@webstudio-is/sdk-components-react-remix": "0.274.4",
21
+ "@webstudio-is/wsauth": "0.274.4",
22
22
  "isbot": "^5.1.25",
23
23
  "react": "18.3.0-canary-14898b6a9-20240318",
24
24
  "react-dom": "18.3.0-canary-14898b6a9-20240318"
@@ -10,14 +10,14 @@
10
10
  "dependencies": {
11
11
  "@react-router/dev": "^7.5.3",
12
12
  "@react-router/fs-routes": "^7.5.3",
13
- "@webstudio-is/image": "0.274.3",
14
- "@webstudio-is/react-sdk": "0.274.3",
15
- "@webstudio-is/sdk": "0.274.3",
16
- "@webstudio-is/sdk-components-animation": "0.274.3",
17
- "@webstudio-is/sdk-components-react-radix": "0.274.3",
18
- "@webstudio-is/sdk-components-react-router": "0.274.3",
19
- "@webstudio-is/sdk-components-react": "0.274.3",
20
- "@webstudio-is/wsauth": "0.274.3",
13
+ "@webstudio-is/image": "0.274.4",
14
+ "@webstudio-is/react-sdk": "0.274.4",
15
+ "@webstudio-is/sdk": "0.274.4",
16
+ "@webstudio-is/sdk-components-animation": "0.274.4",
17
+ "@webstudio-is/sdk-components-react-radix": "0.274.4",
18
+ "@webstudio-is/sdk-components-react-router": "0.274.4",
19
+ "@webstudio-is/sdk-components-react": "0.274.4",
20
+ "@webstudio-is/wsauth": "0.274.4",
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",
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "dependencies": {
9
9
  "@cloudflare/vite-plugin": "^1.1.0",
10
- "@webstudio-is/wsauth": "0.274.3",
10
+ "@webstudio-is/wsauth": "0.274.4",
11
11
  "wrangler": "^4.14.1"
12
12
  }
13
13
  }
@@ -8,12 +8,12 @@
8
8
  "typecheck": "tsgo --noEmit"
9
9
  },
10
10
  "dependencies": {
11
- "@webstudio-is/image": "0.274.3",
12
- "@webstudio-is/react-sdk": "0.274.3",
13
- "@webstudio-is/sdk": "0.274.3",
14
- "@webstudio-is/sdk-components-react": "0.274.3",
15
- "@webstudio-is/sdk-components-animation": "0.274.3",
16
- "@webstudio-is/sdk-components-react-radix": "0.274.3",
11
+ "@webstudio-is/image": "0.274.4",
12
+ "@webstudio-is/react-sdk": "0.274.4",
13
+ "@webstudio-is/sdk": "0.274.4",
14
+ "@webstudio-is/sdk-components-react": "0.274.4",
15
+ "@webstudio-is/sdk-components-animation": "0.274.4",
16
+ "@webstudio-is/sdk-components-react-radix": "0.274.4",
17
17
  "react": "18.3.0-canary-14898b6a9-20240318",
18
18
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
19
19
  "vike": "^0.4.229"