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.

feat: drop legacy CLI templates (#4867)

Bogdan Chadkin5c1c55799be5
diff --git a/apps/builder/app/builder/features/topbar/publish.tsx b/apps/builder/app/builder/features/topbar/publish.tsx
index 40972bc181..6388839fe9 100644
--- a/apps/builder/app/builder/features/topbar/publish.tsx
+++ b/apps/builder/app/builder/features/topbar/publish.tsx
@@ -56,7 +56,6 @@ import {
import { AddDomain } from "./add-domain";
import { humanizeString } from "~/shared/string-utils";
import { trpcClient, nativeClient } from "~/shared/trpc/trpc-client";
-import { isFeatureEnabled } from "@webstudio-is/feature-flags";
import type { Templates } from "@webstudio-is/sdk";
import DomainCheckbox, { domainToPublishName } from "./domain-checkbox";
import { CopyToClipboard } from "~/builder/shared/copy-to-clipboard";
@@ -641,30 +640,38 @@ const Content = (props: {
);
};
-const deployTargets = {
- vanilla: {
+type DeployTarget = {
+ docs?: string;
+ command?: string;
+ ssgTemplates?: Templates[];
+};
+
+const deployTargets: Record<string, DeployTarget> = {
+ docker: {
+ docs: "https://docs.docker.com",
command: `
- npm install
- npm run dev
+ docker build -t my-image .
+ docker run my-image
`,
- docs: "https://remix.run/",
+ },
+ static: {
ssgTemplates: ["ssg"],
},
vercel: {
- command: "npx vercel@latest",
docs: "https://vercel.com/docs/cli",
+ command: "npx vercel@latest",
ssgTemplates: ["ssg-vercel"],
},
netlify: {
+ docs: "https://docs.netlify.com/cli/get-started/",
command: `
npx netlify-cli@latest login
npx netlify-cli sites:create
npx netlify-cli build
npx netlify-cli deploy`,
- docs: "https://docs.netlify.com/cli/get-started/",
ssgTemplates: ["ssg-netlify"],
},
-} as const;
+};
type DeployTargets = keyof typeof deployTargets;
@@ -673,7 +680,7 @@ const isDeployTargets = (value: string): value is DeployTargets =>
const ExportContent = (props: { projectId: Project["id"] }) => {
const npxCommand = "npx webstudio@latest";
- const [deployTarget, setDeployTarget] = useState<DeployTargets>("vanilla");
+ const [deployTarget, setDeployTarget] = useState<DeployTargets>("docker");
return (
<Grid columns={1} gap={3} css={{ padding: theme.panel.padding }}>
@@ -698,152 +705,151 @@ const ExportContent = (props: { projectId: Project["id"] }) => {
</Grid>
</Grid>
- <Grid columns={1} gap={1}>
- {isFeatureEnabled("staticExport") && (
- <>
- <PublishStatic
- projectId={props.projectId}
- templates={deployTargets[deployTarget].ssgTemplates}
- />
- <div />
- <Text color="subtle">
- Learn about deploying static sites{" "}
- <Link
- variant="inherit"
- color="inherit"
- href="https://wstd.us/ssg"
- target="_blank"
- rel="noreferrer"
- >
- here
- </Link>
- </Text>
-
- <div />
- <div />
- <Grid
- gap={2}
- align={"center"}
- css={{
- gridTemplateColumns: `1fr auto 1fr`,
- }}
- >
- <Separator css={{ alignSelf: "unset" }} />
- <Text color="main">CLI</Text>
- <Separator css={{ alignSelf: "unset" }} />
- </Grid>
- </>
- )}
-
- <Text color="main" variant="labelsTitleCase">
- Step 1
- </Text>
- <Text color="subtle">
- Download and install Node v20+ from{" "}
- <Link
- variant="inherit"
- color="inherit"
- href="https://nodejs.org/"
- target="_blank"
- rel="noreferrer"
- >
- nodejs.org
- </Link>{" "}
- or with{" "}
- <Link
- variant="inherit"
- color="inherit"
- href="https://nodejs.org/en/download/package-manager"
- target="_blank"
- rel="noreferrer"
- >
- a package manager
- </Link>
- .
- </Text>
- </Grid>
-
- <Grid columns={1} gap={2}>
+ {deployTargets[deployTarget].ssgTemplates && (
<Grid columns={1} gap={1}>
- <Text color="main" variant="labelsTitleCase">
- Step 2
- </Text>
- <Text color="subtle">
- Run this command in your Terminal to install Webstudio CLI and sync
- your project.
- </Text>
- </Grid>
-
- <Flex gap={2}>
- <InputField
- css={{ flex: 1 }}
- text="mono"
- readOnly
- value={npxCommand}
+ <PublishStatic
+ projectId={props.projectId}
+ templates={deployTargets[deployTarget].ssgTemplates}
/>
-
- <CopyToClipboard text={npxCommand}>
- <Button type="button" color="neutral" prefix={<CopyIcon />}>
- Copy
- </Button>
- </CopyToClipboard>
- </Flex>
- </Grid>
- <Grid columns={1} gap={2}>
- <Grid columns={1} gap={1}>
- <Text color="main" variant="labelsTitleCase">
- Step 3
- </Text>
+ <div />
<Text color="subtle">
- Run this command to publish to{" "}
+ Learn about deploying static sites{" "}
<Link
variant="inherit"
color="inherit"
- href={deployTargets[deployTarget].docs}
+ href="https://wstd.us/ssg"
target="_blank"
rel="noreferrer"
>
- {humanizeString(deployTarget)}
- </Link>{" "}
+ here
+ </Link>
</Text>
</Grid>
-
- <Flex gap={2} align="end">
- <TextArea
- css={{ flex: 1 }}
- variant="mono"
- readOnly
- value={stripIndent(deployTargets[deployTarget].command)
- .trimStart()
- .replace(/ +$/, "")}
- />
-
- <CopyToClipboard text={deployTargets[deployTarget].command}>
- <Button
- type="button"
- css={{ flexShrink: 0 }}
- color="neutral"
- prefix={<CopyIcon />}
- >
- Copy
- </Button>
- </CopyToClipboard>
- </Flex>
- </Grid>
- <Grid columns={1} gap={1}>
- <Text color="subtle">
- Read the detailed documentation{" "}
- <Link
- variant="inherit"
- color="inherit"
- href="https://wstd.us/cli"
- target="_blank"
- rel="noreferrer"
+ )}
+
+ {deployTargets[deployTarget].command && (
+ <Grid columns={1} gap={2}>
+ <Grid
+ gap={2}
+ align={"center"}
+ css={{
+ gridTemplateColumns: `1fr auto 1fr`,
+ }}
>
- here
- </Link>
- </Text>
- </Grid>
+ <Separator css={{ alignSelf: "unset" }} />
+ <Text color="main">CLI</Text>
+ <Separator css={{ alignSelf: "unset" }} />
+ </Grid>
+ <Grid columns={1} gap={1}>
+ <Text color="main" variant="labelsTitleCase">
+ Step 1
+ </Text>
+ <Text color="subtle">
+ Download and install Node v20+ from{" "}
+ <Link
+ variant="inherit"
+ color="inherit"
+ href="https://nodejs.org/"
+ target="_blank"
+ rel="noreferrer"
+ >
+ nodejs.org
+ </Link>{" "}
+ or with{" "}
+ <Link
+ variant="inherit"
+ color="inherit"
+ href="https://nodejs.org/en/download/package-manager"
+ target="_blank"
+ rel="noreferrer"
+ >
+ a package manager
+ </Link>
+ .
+ </Text>
+ </Grid>
+
+ <Grid columns={1} gap={2}>
+ <Grid columns={1} gap={1}>
+ <Text color="main" variant="labelsTitleCase">
+ Step 2
+ </Text>
+ <Text color="subtle">
+ Run this command in your Terminal to install Webstudio CLI and
+ sync your project.
+ </Text>
+ </Grid>
+ <Flex gap={2}>
+ <InputField
+ css={{ flex: 1 }}
+ text="mono"
+ readOnly
+ value={npxCommand}
+ />
+ <CopyToClipboard text={npxCommand}>
+ <Button type="button" color="neutral" prefix={<CopyIcon />}>
+ Copy
+ </Button>
+ </CopyToClipboard>
+ </Flex>
+ </Grid>
+
+ <Grid columns={1} gap={2}>
+ <Grid columns={1} gap={1}>
+ <Text color="main" variant="labelsTitleCase">
+ Step 3
+ </Text>
+ <Text color="subtle">
+ Run this command to publish to{" "}
+ <Link
+ variant="inherit"
+ color="inherit"
+ href={deployTargets[deployTarget].docs}
+ target="_blank"
+ rel="noreferrer"
+ >
+ {humanizeString(deployTarget)}
+ </Link>{" "}
+ </Text>
+ </Grid>
+ <Flex gap={2} align="end">
+ <TextArea
+ css={{ flex: 1 }}
+ variant="mono"
+ readOnly
+ value={stripIndent(deployTargets[deployTarget].command)
+ .trimStart()
+ .replace(/ +$/, "")}
+ />
+ <CopyToClipboard text={deployTargets[deployTarget].command}>
+ <Button
+ type="button"
+ css={{ flexShrink: 0 }}
+ color="neutral"
+ prefix={<CopyIcon />}
+ >
+ Copy
+ </Button>
+ </CopyToClipboard>
+ </Flex>
+ </Grid>
+
+ <Grid columns={1} gap={1}>
+ <Text color="subtle">
+ Read the detailed documentation{" "}
+ <Link
+ variant="inherit"
+ color="inherit"
+ href="https://wstd.us/cli"
+ target="_blank"
+ rel="noreferrer"
+ >
+ here
+ </Link>
+ </Text>
+ </Grid>
+ </Grid>
+ )}
</Grid>
);
};
diff --git a/packages/cli/src/config.ts b/packages/cli/src/config.ts
index 9570e2ac1f..d2eb6a03e5 100644
--- a/packages/cli/src/config.ts
+++ b/packages/cli/src/config.ts
@@ -53,11 +53,6 @@ export const jsonToGlobalConfig = (json: unknown) => {
export type GlobalConfig = z.infer<typeof zGlobalConfig>;
export const PROJECT_TEMPLATES = [
- {
- value: "vanilla" as const,
- label: "Vanilla",
- expand: ["defaults"],
- },
{
value: "docker" as const,
label: "Docker",
@@ -68,11 +63,6 @@ export const PROJECT_TEMPLATES = [
label: "Vercel",
expand: ["react-router", "react-router-vercel"],
},
- {
- value: "vercel-legacy" as const,
- label: "Vercel (legacy)",
- expand: ["defaults", "vercel"],
- },
{
value: "netlify" as const,
label: "Netlify",
diff --git a/packages/feature-flags/src/flags.ts b/packages/feature-flags/src/flags.ts
index 9c9a122a21..2e87ceab06 100644
--- a/packages/feature-flags/src/flags.ts
+++ b/packages/feature-flags/src/flags.ts
@@ -5,7 +5,6 @@ export const aiRadixComponents = false;
export const cms = false;
export const filters = false;
export const xmlElement = false;
-export const staticExport = false;
export const contentEditableMode = false;
export const command = false;
export const headSlotComponent = false;
diff --git a/packages/sdk/src/schema/deployment.ts b/packages/sdk/src/schema/deployment.ts
index fc99d78223..39907018f0 100644
--- a/packages/sdk/src/schema/deployment.ts
+++ b/packages/sdk/src/schema/deployment.ts
@@ -1,10 +1,8 @@
import { z } from "zod";
export const Templates = z.enum([
- "vanilla",
"docker",
"vercel",
- "vercel-legacy",
"netlify",
"ssg",
"ssg-netlify",