Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/clever-squids-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-cloudflare": patch
---

remove BETA label from Workers+Assets templates and hide Pages templates
8 changes: 4 additions & 4 deletions packages/create-cloudflare/e2e-tests/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,10 @@ describe.skipIf(frameworkToTest || isQuarantineMode())("help text", () => {
--platform=<value>
Whether the application should be deployed to Pages or Workers. This is only applicable for Frameworks templates that support both Pages and Workers.
Allowed Values:
workers
Create a web application that can be deployed to Workers.
pages
Create a web application that can be deployed to Pages.
workers
Create a web application that can be deployed to Workers (BETA).
--lang=<value>
The programming language of the template
Allowed Values:
Expand Down Expand Up @@ -576,10 +576,10 @@ describe.skipIf(frameworkToTest || isQuarantineMode())("help text", () => {
--platform=<value>
Whether the application should be deployed to Pages or Workers. This is only applicable for Frameworks templates that support both Pages and Workers.
Allowed Values:
workers
Create a web application that can be deployed to Workers.
pages
Create a web application that can be deployed to Pages.
workers
Create a web application that can be deployed to Workers (BETA).
--lang=<value>
The programming language of the template
Allowed Values:
Expand Down
8 changes: 4 additions & 4 deletions packages/create-cloudflare/src/helpers/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ export const cliDefinition: ArgumentsDefinition = {
description: `Whether the application should be deployed to Pages or Workers. This is only applicable for Frameworks templates that support both Pages and Workers.`,
values: [
{
name: "pages",
name: "workers",
description:
"Create a web application that can be deployed to Pages.",
"Create a web application that can be deployed to Workers.",
},
{
name: "workers",
name: "pages",
description:
"Create a web application that can be deployed to Workers (BETA).",
"Create a web application that can be deployed to Pages.",
},
],
requiresArg: true,
Expand Down
43 changes: 32 additions & 11 deletions packages/create-cloudflare/src/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,22 +467,43 @@ export const createContext = async (
}

if ("platformVariants" in frameworkConfig) {
const availableVariants = Object.entries(
frameworkConfig.platformVariants,
).filter(([, config]) => !config.hidden) as [
keyof typeof frameworkConfig.platformVariants,
TemplateConfig,
][];

if (availableVariants.length === 1) {
args.platform ??= availableVariants[0][0];
}

const platform = await processArgument(args, "platform", {
type: "select",
label: "platform",
question: "Select your deployment platform",
options: [
{
label: "Workers with Assets (BETA)",
value: "workers",
description:
"Take advantage of the full Developer Platform, including R2, Queues, Durable Objects and more.",
},
{
label: "Pages",
value: "pages",
description: "Great for simple websites and applications.",
},
...(args.platform === "workers" ||
!frameworkConfig.platformVariants.workers.hidden
? [
{
label: "Workers with Assets",
value: "workers",
description:
"Take advantage of the full Developer Platform, including R2, Queues, Durable Objects and more.",
},
]
: []),
...(args.platform === "pages" ||
!frameworkConfig.platformVariants.pages.hidden
? [
{
label: "Pages",
value: "pages",
description: "Great for simple websites and applications.",
},
]
: []),
backOption,
],
defaultValue: "workers",
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/templates/angular/pages/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const config: TemplateConfig = {
frameworkCli: "@angular/create",
displayName: "Angular",
platform: "pages",
hidden: true,
copyFiles: {
path: "./templates",
},
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/templates/astro/pages/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const config: TemplateConfig = {
id: "astro",
frameworkCli: "create-astro",
platform: "pages",
hidden: true,
displayName: "Astro",
path: "templates/astro/pages",
copyFiles: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const config: TemplateConfig = {
id: "docusaurus",
frameworkCli: "create-docusaurus",
platform: "pages",
hidden: true,
displayName: "Docusaurus",
path: "templates/docusaurus/pages",
generate,
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/templates/gatsby/pages/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const config: TemplateConfig = {
id: "gatsby",
frameworkCli: "gatsby",
platform: "pages",
hidden: true,
displayName: "Gatsby",
path: "templates/gatsby/pages",
generate,
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/templates/hono/pages/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const config: TemplateConfig = {
},
path: "templates/hono/pages",
platform: "pages",
hidden: true,
generate,
transformPackageJson: async () => ({
scripts: {
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/templates/next/pages/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export default {
id: "next",
frameworkCli: "create-next-app",
platform: "pages",
hidden: true,
displayName: "Next.js",
path: "templates/next/pages",
generate,
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/templates/nuxt/pages/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const config: TemplateConfig = {
id: "nuxt",
frameworkCli: "nuxi",
platform: "pages",
hidden: true,
displayName: "Nuxt",
copyFiles: {
path: "./templates",
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/templates/qwik/pages/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ const config: TemplateConfig = {
frameworkCli: "create-qwik",
displayName: "Qwik",
platform: "pages",
hidden: true,
copyFiles: {
path: "./templates",
},
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/templates/react/pages/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const config: TemplateConfig = {
frameworkCli: "create-vite",
displayName: "React",
platform: "pages",
hidden: true,
path: "templates/react/pages",
generate,
transformPackageJson: async () => ({
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/templates/remix/pages/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const config: TemplateConfig = {
id: "remix",
frameworkCli: "create-remix",
platform: "pages",
hidden: true,
displayName: "Remix",
copyFiles: {
path: "./templates",
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/templates/svelte/pages/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ const config: TemplateConfig = {
frameworkCli: "sv",
displayName: "SvelteKit",
platform: "pages",
hidden: true,
copyFiles: {
path: "./templates",
},
Expand Down
1 change: 1 addition & 0 deletions packages/create-cloudflare/templates/vue/pages/c3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const config: TemplateConfig = {
frameworkCli: "create-vue",
displayName: "Vue",
platform: "pages",
hidden: true,
path: "templates/pages/vue",
generate,
transformPackageJson: async () => ({
Expand Down
Loading