Skip to content

Commit 21a09e0

Browse files
authored
avoid potential double-install of create-cloudflare (#6615)
* chore: avoid potential double-install of c3 * add changeset
1 parent a197460 commit 21a09e0

File tree

4 files changed

+457
-450
lines changed

4 files changed

+457
-450
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
chore: avoid potential double-install of create-cloudflare
6+
7+
When `wrangler init` delegates to C3, it did so via `npm create [email protected]`. C3's v2.5.0 was the first to include auto-update support to avoid `npx`'s potentially stale cache. But this also guaranteed a double install for users who do not have 2.5.0 cached. Now, wrangler delegates via `npm create cloudflare@^2.5.0` which should use the latest version cached on the user's system or install and use the latest v2.x.x.

packages/wrangler/src/__tests__/generate.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ describe("generate", () => {
4646
`"✨ Created no-template/wrangler.toml"`
4747
);
4848
expect(std.warn).toMatchInlineSnapshot(`
49-
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe \`init\` command is no longer supported. Please use \`mockpm create cloudflare/@2.5.0 no-template\` instead.[0m
49+
"[33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe \`init\` command is no longer supported. Please use \`mockpm create cloudflare/@/^2.5.0 no-template\` instead.[0m
5050
51-
The \`init\` command will be removed in a future version.
51+
The \`init\` command will be removed in a future version.
5252
53-
"
54-
`);
53+
"
54+
`);
5555
});
5656

5757
it("complains when given the --type argument", async () => {

0 commit comments

Comments
 (0)