From eec2a707492d563df62f0b126c1e7ddf354d46b3 Mon Sep 17 00:00:00 2001 From: Rubi <14269809+codenoid@users.noreply.github.com> Date: Fri, 25 Oct 2024 19:13:13 +0700 Subject: [PATCH] create-cloudflare: replace create-svelte with sv (#7031) * create-cloudflare: replace create-svelte with sv * add changeset * update * update stable template * fix experimental template * update svelte e2e test * prettier --------- --- .changeset/hip-actors-thank.md | 5 +++++ .../create-cloudflare/e2e-tests/frameworks.test.ts | 11 ++++++++--- .../create-cloudflare/src/frameworks/package.json | 4 ++-- .../templates-experimental/svelte/c3.ts | 4 ++-- packages/create-cloudflare/templates/svelte/c3.ts | 4 ++-- 5 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 .changeset/hip-actors-thank.md diff --git a/.changeset/hip-actors-thank.md b/.changeset/hip-actors-thank.md new file mode 100644 index 000000000000..03dd08231cec --- /dev/null +++ b/.changeset/hip-actors-thank.md @@ -0,0 +1,5 @@ +--- +"create-cloudflare": minor +--- + +create-svelte is soon be deprecated, use the new official replacement npx sv instead. diff --git a/packages/create-cloudflare/e2e-tests/frameworks.test.ts b/packages/create-cloudflare/e2e-tests/frameworks.test.ts index 19649959c869..4b4e8f8997bc 100644 --- a/packages/create-cloudflare/e2e-tests/frameworks.test.ts +++ b/packages/create-cloudflare/e2e-tests/frameworks.test.ts @@ -357,15 +357,20 @@ function getFrameworkTests(opts: { svelte: { promptHandlers: [ { - matcher: /Which Svelte app template/, + matcher: /Which template would you like/, input: [keys.enter], }, { - matcher: /Add type checking with TypeScript/, + matcher: /Add type checking with Typescript/, input: [keys.down, keys.enter], }, { - matcher: /Select additional options/, + matcher: /What would you like to add to your project/, + input: [keys.enter], + }, + { + matcher: + /Which package manager do you want to install dependencies with/, input: [keys.enter], }, ], diff --git a/packages/create-cloudflare/src/frameworks/package.json b/packages/create-cloudflare/src/frameworks/package.json index a94fef8f9ddd..ebabd50a32eb 100644 --- a/packages/create-cloudflare/src/frameworks/package.json +++ b/packages/create-cloudflare/src/frameworks/package.json @@ -15,9 +15,9 @@ "create-vite": "5.5.4", "create-remix": "2.13.1", "create-solid": "0.5.13", - "create-svelte": "6.4.0", "create-vue": "3.11.1", "gatsby": "5.13.7", - "nuxi": "3.12.0" + "nuxi": "3.12.0", + "sv": "0.5.7" } } diff --git a/packages/create-cloudflare/templates-experimental/svelte/c3.ts b/packages/create-cloudflare/templates-experimental/svelte/c3.ts index 04c92109d07d..3833dc8fc310 100644 --- a/packages/create-cloudflare/templates-experimental/svelte/c3.ts +++ b/packages/create-cloudflare/templates-experimental/svelte/c3.ts @@ -13,7 +13,7 @@ import type { C3Context, PackageJson } from "types"; const { npm } = detectPackageManager(); const generate = async (ctx: C3Context) => { - await runFrameworkGenerator(ctx, [ctx.project.name]); + await runFrameworkGenerator(ctx, ["create", ctx.project.name]); logRaw(""); }; @@ -97,7 +97,7 @@ const updateTypeDefinitions = (ctx: C3Context) => { const config: TemplateConfig = { configVersion: 1, id: "svelte", - frameworkCli: "create-svelte", + frameworkCli: "sv", displayName: "Svelte", platform: "workers", copyFiles: { diff --git a/packages/create-cloudflare/templates/svelte/c3.ts b/packages/create-cloudflare/templates/svelte/c3.ts index 1d221f68026c..7d55d0ab3472 100644 --- a/packages/create-cloudflare/templates/svelte/c3.ts +++ b/packages/create-cloudflare/templates/svelte/c3.ts @@ -13,7 +13,7 @@ import type { C3Context, PackageJson } from "types"; const { npm } = detectPackageManager(); const generate = async (ctx: C3Context) => { - await runFrameworkGenerator(ctx, [ctx.project.name]); + await runFrameworkGenerator(ctx, ["create", ctx.project.name]); logRaw(""); }; @@ -97,7 +97,7 @@ const updateTypeDefinitions = (ctx: C3Context) => { const config: TemplateConfig = { configVersion: 1, id: "svelte", - frameworkCli: "create-svelte", + frameworkCli: "sv", displayName: "Svelte", platform: "pages", copyFiles: {