create-cloudflare 2.54.3 → 2.54.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +34 -47
- package/package.json +8 -7
- package/templates/next/c3.ts +11 -38
package/dist/cli.js
CHANGED
|
@@ -79316,7 +79316,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
79316
79316
|
var yargs_default = Yargs;
|
|
79317
79317
|
|
|
79318
79318
|
// package.json
|
|
79319
|
-
var version = "2.54.
|
|
79319
|
+
var version = "2.54.4";
|
|
79320
79320
|
|
|
79321
79321
|
// src/metrics.ts
|
|
79322
79322
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -80103,7 +80103,7 @@ var package_default = {
|
|
|
80103
80103
|
"@angular/create": "20.3.8",
|
|
80104
80104
|
"create-docusaurus": "3.9.1",
|
|
80105
80105
|
"create-hono": "0.19.3",
|
|
80106
|
-
"create-next-app": "15.
|
|
80106
|
+
"create-next-app": "15.5.6",
|
|
80107
80107
|
"create-qwik": "1.17.1",
|
|
80108
80108
|
"create-vite": "7.1.1",
|
|
80109
80109
|
"create-react-router": "7.9.5",
|
|
@@ -81060,28 +81060,16 @@ var c3_default23 = config21;
|
|
|
81060
81060
|
|
|
81061
81061
|
// templates/next/c3.ts
|
|
81062
81062
|
var generate12 = async (ctx) => {
|
|
81063
|
-
await runFrameworkGenerator(ctx, [
|
|
81064
|
-
|
|
81065
|
-
|
|
81066
|
-
|
|
81067
|
-
|
|
81068
|
-
|
|
81069
|
-
|
|
81070
|
-
|
|
81071
|
-
|
|
81072
|
-
|
|
81073
|
-
var updateNextConfig = (usesTs) => {
|
|
81074
|
-
const s = spinner();
|
|
81075
|
-
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
81076
|
-
s.start(`Updating \`${configFile}\``);
|
|
81077
|
-
const configContent = readFile(configFile);
|
|
81078
|
-
const updatedConfigFile = configContent + `
|
|
81079
|
-
// added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
|
|
81080
|
-
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
|
|
81081
|
-
initOpenNextCloudflareForDev();
|
|
81082
|
-
`.replace(/\n\t*/g, "\n");
|
|
81083
|
-
writeFile2(configFile, updatedConfigFile);
|
|
81084
|
-
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
81063
|
+
await runFrameworkGenerator(ctx, [
|
|
81064
|
+
ctx.project.name,
|
|
81065
|
+
"--no-turbopack",
|
|
81066
|
+
"--skip-install",
|
|
81067
|
+
// We are using the Cloudflare template for Next.js projects
|
|
81068
|
+
// This is a template maintained by Cloudflare that based on a standard Next.js starter project,
|
|
81069
|
+
// and has already been configured to work with Cloudflare Workers
|
|
81070
|
+
"--example",
|
|
81071
|
+
"https://github.com/opennextjs/opennextjs-cloudflare/tree/main/create-cloudflare/next"
|
|
81072
|
+
]);
|
|
81085
81073
|
};
|
|
81086
81074
|
var envInterfaceName3 = "CloudflareEnv";
|
|
81087
81075
|
var typesPath = "./cloudflare-env.d.ts";
|
|
@@ -81095,7 +81083,6 @@ var c3_default24 = {
|
|
|
81095
81083
|
path: "./templates"
|
|
81096
81084
|
},
|
|
81097
81085
|
generate: generate12,
|
|
81098
|
-
configure: configure6,
|
|
81099
81086
|
transformPackageJson: async () => ({
|
|
81100
81087
|
scripts: {
|
|
81101
81088
|
deploy: `opennextjs-cloudflare build && opennextjs-cloudflare deploy`,
|
|
@@ -81126,7 +81113,7 @@ var generate13 = async (ctx) => {
|
|
|
81126
81113
|
writeFile2("./.node-version", "18");
|
|
81127
81114
|
logRaw("");
|
|
81128
81115
|
};
|
|
81129
|
-
var
|
|
81116
|
+
var configure6 = async () => {
|
|
81130
81117
|
const packages = ["nitro-cloudflare-dev"];
|
|
81131
81118
|
if (pm2 === "pnpm") {
|
|
81132
81119
|
packages.push("h3");
|
|
@@ -81192,7 +81179,7 @@ var config22 = {
|
|
|
81192
81179
|
},
|
|
81193
81180
|
path: "templates/nuxt/pages",
|
|
81194
81181
|
generate: generate13,
|
|
81195
|
-
configure:
|
|
81182
|
+
configure: configure6,
|
|
81196
81183
|
transformPackageJson: async () => ({
|
|
81197
81184
|
scripts: {
|
|
81198
81185
|
deploy: `${npm8} run build && wrangler pages deploy`,
|
|
@@ -81222,7 +81209,7 @@ var generate14 = async (ctx) => {
|
|
|
81222
81209
|
writeFile2("./.node-version", "18");
|
|
81223
81210
|
logRaw("");
|
|
81224
81211
|
};
|
|
81225
|
-
var
|
|
81212
|
+
var configure7 = async () => {
|
|
81226
81213
|
const packages = ["nitro-cloudflare-dev", "nitropack"];
|
|
81227
81214
|
if (pm3 === "pnpm") {
|
|
81228
81215
|
packages.push("h3");
|
|
@@ -81287,7 +81274,7 @@ var config23 = {
|
|
|
81287
81274
|
},
|
|
81288
81275
|
path: "templates/nuxt/workers",
|
|
81289
81276
|
generate: generate14,
|
|
81290
|
-
configure:
|
|
81277
|
+
configure: configure7,
|
|
81291
81278
|
transformPackageJson: async () => ({
|
|
81292
81279
|
scripts: {
|
|
81293
81280
|
deploy: `${npm9} run build && wrangler deploy`,
|
|
@@ -81499,7 +81486,7 @@ var config26 = {
|
|
|
81499
81486
|
};
|
|
81500
81487
|
var c3_default29 = config26;
|
|
81501
81488
|
function buildConfigure(params) {
|
|
81502
|
-
return async function
|
|
81489
|
+
return async function configure16(ctx) {
|
|
81503
81490
|
const loginSuccess = await params.login(ctx);
|
|
81504
81491
|
if (!loginSuccess) {
|
|
81505
81492
|
throw new Error("Failed to login to Cloudflare");
|
|
@@ -81546,7 +81533,7 @@ var { npm: npm10, npx: npx3, name } = detectPackageManager();
|
|
|
81546
81533
|
var generate15 = async (ctx) => {
|
|
81547
81534
|
await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
|
|
81548
81535
|
};
|
|
81549
|
-
var
|
|
81536
|
+
var configure8 = async (ctx) => {
|
|
81550
81537
|
const cmd = [name === "pnpm" ? npm10 : npx3, "qwik", "add", "cloudflare-pages"];
|
|
81551
81538
|
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
81552
81539
|
await runCommand(cmd);
|
|
@@ -81635,7 +81622,7 @@ var config28 = {
|
|
|
81635
81622
|
},
|
|
81636
81623
|
path: "templates/qwik/pages",
|
|
81637
81624
|
generate: generate15,
|
|
81638
|
-
configure:
|
|
81625
|
+
configure: configure8,
|
|
81639
81626
|
transformPackageJson: async () => ({
|
|
81640
81627
|
scripts: {
|
|
81641
81628
|
deploy: `${npm10} run build && wrangler pages deploy`,
|
|
@@ -81656,7 +81643,7 @@ var { npm: npm11, npx: npx4, name: name2 } = detectPackageManager();
|
|
|
81656
81643
|
var generate16 = async (ctx) => {
|
|
81657
81644
|
await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
|
|
81658
81645
|
};
|
|
81659
|
-
var
|
|
81646
|
+
var configure9 = async (ctx) => {
|
|
81660
81647
|
const cmd = [name2 === "pnpm" ? npm11 : npx4, "qwik", "add", "cloudflare-pages"];
|
|
81661
81648
|
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
81662
81649
|
await runCommand(cmd);
|
|
@@ -81745,7 +81732,7 @@ var config29 = {
|
|
|
81745
81732
|
},
|
|
81746
81733
|
path: "templates/qwik/workers",
|
|
81747
81734
|
generate: generate16,
|
|
81748
|
-
configure:
|
|
81735
|
+
configure: configure9,
|
|
81749
81736
|
transformPackageJson: async () => ({
|
|
81750
81737
|
scripts: {
|
|
81751
81738
|
deploy: `${npm11} run build && wrangler deploy`,
|
|
@@ -81873,7 +81860,7 @@ var generate19 = async (ctx) => {
|
|
|
81873
81860
|
]);
|
|
81874
81861
|
logRaw("");
|
|
81875
81862
|
};
|
|
81876
|
-
var
|
|
81863
|
+
var configure10 = async (ctx) => {
|
|
81877
81864
|
await installPackages(["@cloudflare/vite-plugin"], {
|
|
81878
81865
|
dev: true,
|
|
81879
81866
|
startText: "Installing the Cloudflare Vite plugin",
|
|
@@ -81981,7 +81968,7 @@ var config33 = {
|
|
|
81981
81968
|
}
|
|
81982
81969
|
},
|
|
81983
81970
|
generate: generate19,
|
|
81984
|
-
configure:
|
|
81971
|
+
configure: configure10,
|
|
81985
81972
|
transformPackageJson: async (_3, ctx) => ({
|
|
81986
81973
|
scripts: {
|
|
81987
81974
|
deploy: `${npm14} run build && wrangler deploy`,
|
|
@@ -82077,7 +82064,7 @@ var generate20 = async (ctx) => {
|
|
|
82077
82064
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
82078
82065
|
logRaw("");
|
|
82079
82066
|
};
|
|
82080
|
-
var
|
|
82067
|
+
var configure11 = async (ctx) => {
|
|
82081
82068
|
const packages = ["nitropack"];
|
|
82082
82069
|
await installPackages(packages, {
|
|
82083
82070
|
dev: true,
|
|
@@ -82129,7 +82116,7 @@ var config36 = {
|
|
|
82129
82116
|
},
|
|
82130
82117
|
path: "templates/solid",
|
|
82131
82118
|
generate: generate20,
|
|
82132
|
-
configure:
|
|
82119
|
+
configure: configure11,
|
|
82133
82120
|
transformPackageJson: async () => ({
|
|
82134
82121
|
scripts: {
|
|
82135
82122
|
preview: `${npm15} run build && npx wrangler dev`,
|
|
@@ -82151,7 +82138,7 @@ var generate21 = async (ctx) => {
|
|
|
82151
82138
|
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
82152
82139
|
logRaw("");
|
|
82153
82140
|
};
|
|
82154
|
-
var
|
|
82141
|
+
var configure12 = async (ctx) => {
|
|
82155
82142
|
const pkg = `@sveltejs/adapter-cloudflare`;
|
|
82156
82143
|
await installPackages([pkg], {
|
|
82157
82144
|
dev: true,
|
|
@@ -82246,7 +82233,7 @@ var config37 = {
|
|
|
82246
82233
|
},
|
|
82247
82234
|
path: "templates/svelte/pages",
|
|
82248
82235
|
generate: generate21,
|
|
82249
|
-
configure:
|
|
82236
|
+
configure: configure12,
|
|
82250
82237
|
transformPackageJson: async (original, ctx) => {
|
|
82251
82238
|
let scripts = {
|
|
82252
82239
|
preview: `${npm16} run build && wrangler pages dev`,
|
|
@@ -82274,7 +82261,7 @@ var generate22 = async (ctx) => {
|
|
|
82274
82261
|
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
82275
82262
|
logRaw("");
|
|
82276
82263
|
};
|
|
82277
|
-
var
|
|
82264
|
+
var configure13 = async (ctx) => {
|
|
82278
82265
|
const pkg = `@sveltejs/adapter-cloudflare`;
|
|
82279
82266
|
await installPackages([pkg], {
|
|
82280
82267
|
dev: true,
|
|
@@ -82345,7 +82332,7 @@ var config38 = {
|
|
|
82345
82332
|
},
|
|
82346
82333
|
path: "templates/svelte/workers",
|
|
82347
82334
|
generate: generate22,
|
|
82348
|
-
configure:
|
|
82335
|
+
configure: configure13,
|
|
82349
82336
|
transformPackageJson: async (original, ctx) => {
|
|
82350
82337
|
let scripts = {
|
|
82351
82338
|
preview: `${npm17} run build && wrangler dev`,
|
|
@@ -82454,7 +82441,7 @@ var generate25 = async (ctx) => {
|
|
|
82454
82441
|
]);
|
|
82455
82442
|
logRaw("");
|
|
82456
82443
|
};
|
|
82457
|
-
var
|
|
82444
|
+
var configure14 = async (ctx) => {
|
|
82458
82445
|
await installPackages(["@cloudflare/vite-plugin"], {
|
|
82459
82446
|
dev: true,
|
|
82460
82447
|
startText: "Installing the Cloudflare Vite plugin",
|
|
@@ -82495,7 +82482,7 @@ var config42 = {
|
|
|
82495
82482
|
}
|
|
82496
82483
|
}
|
|
82497
82484
|
},
|
|
82498
|
-
configure:
|
|
82485
|
+
configure: configure14,
|
|
82499
82486
|
generate: generate25,
|
|
82500
82487
|
transformPackageJson: async (_3, ctx) => ({
|
|
82501
82488
|
scripts: {
|
|
@@ -82551,7 +82538,7 @@ var c3_default47 = config44;
|
|
|
82551
82538
|
var import_node_assert2 = __toESM(require("node:assert"));
|
|
82552
82539
|
|
|
82553
82540
|
// ../wrangler/package.json
|
|
82554
|
-
var version2 = "4.
|
|
82541
|
+
var version2 = "4.47.0";
|
|
82555
82542
|
|
|
82556
82543
|
// src/git.ts
|
|
82557
82544
|
var offerGit = async (ctx) => {
|
|
@@ -86184,7 +86171,7 @@ var runCli = async (args) => {
|
|
|
86184
86171
|
checkMacOSVersion({ shouldThrow: true });
|
|
86185
86172
|
const ctx = await createContext(args);
|
|
86186
86173
|
await create(ctx);
|
|
86187
|
-
await
|
|
86174
|
+
await configure15(ctx);
|
|
86188
86175
|
await deploy(ctx);
|
|
86189
86176
|
printSummary(ctx);
|
|
86190
86177
|
logRaw("");
|
|
@@ -86212,7 +86199,7 @@ var create = async (ctx) => {
|
|
|
86212
86199
|
await rectifyPmMismatch(ctx);
|
|
86213
86200
|
endSection(`Application created`);
|
|
86214
86201
|
};
|
|
86215
|
-
var
|
|
86202
|
+
var configure15 = async (ctx) => {
|
|
86216
86203
|
startSection("Configuring your application for Cloudflare", "Step 2 of 3");
|
|
86217
86204
|
await installWrangler();
|
|
86218
86205
|
await updateWranglerConfig(ctx);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.54.
|
|
3
|
+
"version": "2.54.4",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -30,9 +30,8 @@
|
|
|
30
30
|
"@babel/parser": "^7.21.3",
|
|
31
31
|
"@babel/types": "^7.21.4",
|
|
32
32
|
"@clack/prompts": "^0.6.3",
|
|
33
|
-
"@cloudflare/workers-types": "^4.
|
|
33
|
+
"@cloudflare/workers-types": "^4.20251109.0",
|
|
34
34
|
"@iarna/toml": "^3.0.0",
|
|
35
|
-
"jsonc-parser": "^3.2.0",
|
|
36
35
|
"@types/command-exists": "^1.2.0",
|
|
37
36
|
"@types/cross-spawn": "^6.0.2",
|
|
38
37
|
"@types/deepmerge": "^2.2.0",
|
|
@@ -60,6 +59,7 @@
|
|
|
60
59
|
"glob": "^10.3.3",
|
|
61
60
|
"haikunator": "^2.1.2",
|
|
62
61
|
"indent-string": "^5.0.0",
|
|
62
|
+
"jsonc-parser": "^3.2.0",
|
|
63
63
|
"magic-string": "^0.30.5",
|
|
64
64
|
"open": "^8.4.0",
|
|
65
65
|
"recast": "^0.22.0",
|
|
@@ -73,12 +73,13 @@
|
|
|
73
73
|
"wrap-ansi": "^9.0.0",
|
|
74
74
|
"xdg-app-paths": "^8.3.0",
|
|
75
75
|
"yargs": "^17.7.2",
|
|
76
|
-
"
|
|
77
|
-
"@cloudflare/eslint-config-shared": "1.1.0",
|
|
76
|
+
"eslint": "^9.39.1",
|
|
78
77
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
79
|
-
"@cloudflare/vite-plugin": "1.14.
|
|
78
|
+
"@cloudflare/vite-plugin": "1.14.1",
|
|
80
79
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
81
|
-
"wrangler": "4.
|
|
80
|
+
"wrangler": "4.47.0",
|
|
81
|
+
"@cloudflare/cli": "1.1.3",
|
|
82
|
+
"@cloudflare/eslint-config-shared": "1.1.0"
|
|
82
83
|
},
|
|
83
84
|
"engines": {
|
|
84
85
|
"node": ">=18.14.1"
|
package/templates/next/c3.ts
CHANGED
|
@@ -1,45 +1,19 @@
|
|
|
1
|
-
import { brandColor, dim } from "@cloudflare/cli/colors";
|
|
2
|
-
import { spinner } from "@cloudflare/cli/interactive";
|
|
3
1
|
import { runFrameworkGenerator } from "frameworks/index";
|
|
4
|
-
import { readFile, usesTypescript, writeFile } from "helpers/files";
|
|
5
|
-
import { installPackages } from "helpers/packages";
|
|
6
2
|
import type { TemplateConfig } from "../../src/templates";
|
|
7
3
|
import type { C3Context } from "types";
|
|
8
4
|
|
|
9
5
|
const generate = async (ctx: C3Context) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
updateNextConfig(usesTs);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const updateNextConfig = (usesTs: boolean) => {
|
|
25
|
-
const s = spinner();
|
|
26
|
-
|
|
27
|
-
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
28
|
-
s.start(`Updating \`${configFile}\``);
|
|
29
|
-
|
|
30
|
-
const configContent = readFile(configFile);
|
|
31
|
-
|
|
32
|
-
const updatedConfigFile =
|
|
33
|
-
configContent +
|
|
34
|
-
`
|
|
35
|
-
// added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
|
|
36
|
-
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
|
|
37
|
-
initOpenNextCloudflareForDev();
|
|
38
|
-
`.replace(/\n\t*/g, "\n");
|
|
39
|
-
|
|
40
|
-
writeFile(configFile, updatedConfigFile);
|
|
41
|
-
|
|
42
|
-
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
6
|
+
// Disable Turbopack as it is not currently compatible with the Cloudflare adapter
|
|
7
|
+
await runFrameworkGenerator(ctx, [
|
|
8
|
+
ctx.project.name,
|
|
9
|
+
"--no-turbopack",
|
|
10
|
+
"--skip-install",
|
|
11
|
+
// We are using the Cloudflare template for Next.js projects
|
|
12
|
+
// This is a template maintained by Cloudflare that based on a standard Next.js starter project,
|
|
13
|
+
// and has already been configured to work with Cloudflare Workers
|
|
14
|
+
"--example",
|
|
15
|
+
"https://github.com/opennextjs/opennextjs-cloudflare/tree/main/create-cloudflare/next",
|
|
16
|
+
]);
|
|
43
17
|
};
|
|
44
18
|
|
|
45
19
|
const envInterfaceName = "CloudflareEnv";
|
|
@@ -54,7 +28,6 @@ export default {
|
|
|
54
28
|
path: "./templates",
|
|
55
29
|
},
|
|
56
30
|
generate,
|
|
57
|
-
configure,
|
|
58
31
|
transformPackageJson: async () => ({
|
|
59
32
|
scripts: {
|
|
60
33
|
deploy: `opennextjs-cloudflare build && opennextjs-cloudflare deploy`,
|