Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: stabilize CLI bundle contract after publish (#6293)

Oleg Isonena8c1726418f7
diff --git a/packages/cli/src/cli-bundle-externals.test.ts b/packages/cli/src/cli-bundle-externals.test.ts
index 3c7718da08..bf22d4fcb8 100644
--- a/packages/cli/src/cli-bundle-externals.test.ts
+++ b/packages/cli/src/cli-bundle-externals.test.ts
@@ -9,6 +9,12 @@ describe("CLI bundle externals", () => {
expect(isExternal("node:fs")).toBe(true);
});
+ test("bundles project contract dependencies to prevent post-release version drift", () => {
+ expect(isExternal("zod")).toBe(false);
+ expect(isExternal("zod/v4")).toBe(false);
+ expect(isExternal("@emotion/hash")).toBe(false);
+ });
+
test("bundles the component registry without publishing its React dependency tree", () => {
expect(isExternal("@webstudio-is/sdk-components-registry/framework")).toBe(
false
diff --git a/packages/cli/vite.config.ts b/packages/cli/vite.config.ts
index 35aeb561d1..b7ee12598c 100644
--- a/packages/cli/vite.config.ts
+++ b/packages/cli/vite.config.ts
@@ -16,7 +16,10 @@ const externalDependencies = new Set(
})
);
-const bundledDependencies = new Set(["acorn"]);
+// The project bundle contract is derived from Zod's schema definitions and
+// hashed at runtime. Keep both implementations in the published artifact so a
+// transitive dependency update cannot change bundleVersion after publication.
+const bundledDependencies = new Set(["@emotion/hash", "acorn", "zod"]);
const getPackageName = (id: string) => {
if (id.startsWith("@")) {