create-cloudflare 0.0.0-64c3ec15 → 0.0.0-67c4c2c0
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 +140 -86
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -8473,7 +8473,7 @@ var require_util = __commonJS({
|
|
|
8473
8473
|
exports.isAbsolute = function(aPath) {
|
|
8474
8474
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
8475
8475
|
};
|
|
8476
|
-
function
|
|
8476
|
+
function relative3(aRoot, aPath) {
|
|
8477
8477
|
if (aRoot === "") {
|
|
8478
8478
|
aRoot = ".";
|
|
8479
8479
|
}
|
|
@@ -8492,7 +8492,7 @@ var require_util = __commonJS({
|
|
|
8492
8492
|
}
|
|
8493
8493
|
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
|
8494
8494
|
}
|
|
8495
|
-
exports.relative =
|
|
8495
|
+
exports.relative = relative3;
|
|
8496
8496
|
var supportsNullProto = function() {
|
|
8497
8497
|
var obj = /* @__PURE__ */ Object.create(null);
|
|
8498
8498
|
return !("__proto__" in obj);
|
|
@@ -58091,7 +58091,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
58091
58091
|
var yargs_default = Yargs;
|
|
58092
58092
|
|
|
58093
58093
|
// package.json
|
|
58094
|
-
var version = "0.0.0-
|
|
58094
|
+
var version = "0.0.0-67c4c2c0";
|
|
58095
58095
|
var devDependencies = {
|
|
58096
58096
|
"@babel/parser": "^7.21.3",
|
|
58097
58097
|
"@babel/types": "^7.21.4",
|
|
@@ -60149,29 +60149,39 @@ var spinner = (frames = spinnerFrames.clockwise, color = brandColor) => {
|
|
|
60149
60149
|
helpText ||= ``;
|
|
60150
60150
|
currentMsg = msg;
|
|
60151
60151
|
startMsg = `${currentMsg} ${dim(helpText)}`;
|
|
60152
|
-
|
|
60153
|
-
|
|
60154
|
-
|
|
60155
|
-
|
|
60156
|
-
|
|
60157
|
-
|
|
60158
|
-
|
|
60159
|
-
|
|
60160
|
-
|
|
60161
|
-
|
|
60152
|
+
if (isInteractive()) {
|
|
60153
|
+
let index = 0;
|
|
60154
|
+
clearLoop();
|
|
60155
|
+
loop = setInterval(() => {
|
|
60156
|
+
index++;
|
|
60157
|
+
const spinnerFrame = frames[index % frames.length];
|
|
60158
|
+
const ellipsisFrame = ellipsisFrames[index % ellipsisFrames.length];
|
|
60159
|
+
if (msg) {
|
|
60160
|
+
log_update_default(`${color(spinnerFrame)} ${currentMsg} ${ellipsisFrame}`);
|
|
60161
|
+
}
|
|
60162
|
+
}, frameRate);
|
|
60163
|
+
} else {
|
|
60164
|
+
log_update_default(`${leftT} ${startMsg}`);
|
|
60165
|
+
}
|
|
60162
60166
|
},
|
|
60163
60167
|
update(msg) {
|
|
60164
60168
|
currentMsg = msg;
|
|
60165
60169
|
},
|
|
60166
60170
|
stop(msg) {
|
|
60167
|
-
|
|
60168
|
-
|
|
60169
|
-
|
|
60171
|
+
if (isInteractive()) {
|
|
60172
|
+
log_update_default.clear();
|
|
60173
|
+
if (msg) {
|
|
60174
|
+
log_update_default(`${leftT} ${startMsg}
|
|
60175
|
+
${grayBar} ${msg}`);
|
|
60176
|
+
log_update_default.done();
|
|
60177
|
+
newline();
|
|
60178
|
+
}
|
|
60179
|
+
clearLoop();
|
|
60180
|
+
} else {
|
|
60181
|
+
log_update_default(`
|
|
60170
60182
|
${grayBar} ${msg}`);
|
|
60171
|
-
log_update_default.done();
|
|
60172
60183
|
newline();
|
|
60173
60184
|
}
|
|
60174
|
-
clearLoop();
|
|
60175
60185
|
}
|
|
60176
60186
|
};
|
|
60177
60187
|
};
|
|
@@ -60364,7 +60374,7 @@ var printAsyncStatus = async ({
|
|
|
60364
60374
|
...opts
|
|
60365
60375
|
}) => {
|
|
60366
60376
|
let s;
|
|
60367
|
-
if (opts.useSpinner) {
|
|
60377
|
+
if (opts.useSpinner && isInteractive()) {
|
|
60368
60378
|
s = spinner();
|
|
60369
60379
|
}
|
|
60370
60380
|
s?.start(opts?.startText);
|
|
@@ -60382,7 +60392,10 @@ var printAsyncStatus = async ({
|
|
|
60382
60392
|
}
|
|
60383
60393
|
return promise;
|
|
60384
60394
|
};
|
|
60385
|
-
var retry = async (
|
|
60395
|
+
var retry = async ({
|
|
60396
|
+
times,
|
|
60397
|
+
exitCondition
|
|
60398
|
+
}, fn) => {
|
|
60386
60399
|
let error = null;
|
|
60387
60400
|
while (times > 0) {
|
|
60388
60401
|
try {
|
|
@@ -60390,6 +60403,9 @@ var retry = async (times, fn) => {
|
|
|
60390
60403
|
} catch (e) {
|
|
60391
60404
|
error = e;
|
|
60392
60405
|
times--;
|
|
60406
|
+
if (exitCondition?.(e)) {
|
|
60407
|
+
break;
|
|
60408
|
+
}
|
|
60393
60409
|
}
|
|
60394
60410
|
}
|
|
60395
60411
|
throw error;
|
|
@@ -60596,9 +60612,9 @@ var usesEslint = (ctx) => {
|
|
|
60596
60612
|
}
|
|
60597
60613
|
return { used: false };
|
|
60598
60614
|
};
|
|
60599
|
-
var compatDateFlag = () => {
|
|
60600
|
-
const
|
|
60601
|
-
return `--compatibility-date=${
|
|
60615
|
+
var compatDateFlag = async () => {
|
|
60616
|
+
const workerdCompatDate = await getWorkerdCompatibilityDate();
|
|
60617
|
+
return `--compatibility-date=${workerdCompatDate}`;
|
|
60602
60618
|
};
|
|
60603
60619
|
|
|
60604
60620
|
// src/frameworks/angular/index.ts
|
|
@@ -60612,9 +60628,8 @@ var generate = async (ctx) => {
|
|
|
60612
60628
|
logRaw("");
|
|
60613
60629
|
};
|
|
60614
60630
|
var configure = async (ctx) => {
|
|
60615
|
-
const cli = getFrameworkCli(ctx, false);
|
|
60616
60631
|
process.chdir(ctx.project.path);
|
|
60617
|
-
await runCommand(`${npx}
|
|
60632
|
+
await runCommand(`${npx} ng analytics disable`, {
|
|
60618
60633
|
silent: true
|
|
60619
60634
|
});
|
|
60620
60635
|
await addSSRAdapter();
|
|
@@ -60626,15 +60641,15 @@ var config = {
|
|
|
60626
60641
|
generate,
|
|
60627
60642
|
configure,
|
|
60628
60643
|
displayName: "Angular",
|
|
60629
|
-
|
|
60644
|
+
getPackageScripts: async () => ({
|
|
60630
60645
|
process: "node ./tools/copy-worker-files.mjs && node ./tools/copy-client-files.mjs && node ./tools/bundle.mjs",
|
|
60631
|
-
|
|
60632
|
-
start:
|
|
60633
|
-
|
|
60634
|
-
|
|
60635
|
-
},
|
|
60646
|
+
"pages:build": `${npm} run build:ssr && ${npm} run process`,
|
|
60647
|
+
start: `${npm} run pages:build && wrangler pages dev dist/cloudflare ${await compatDateFlag()} --experimental-local`,
|
|
60648
|
+
deploy: `${npm} run pages:build && wrangler pages deploy dist/cloudflare`
|
|
60649
|
+
}),
|
|
60636
60650
|
deployCommand: "deploy",
|
|
60637
|
-
devCommand: "start"
|
|
60651
|
+
devCommand: "start",
|
|
60652
|
+
testFlags: ["--routing", "--style", "sass"]
|
|
60638
60653
|
};
|
|
60639
60654
|
var angular_default = config;
|
|
60640
60655
|
async function installCFWorker(ctx) {
|
|
@@ -60724,10 +60739,10 @@ var config2 = {
|
|
|
60724
60739
|
generate: generate2,
|
|
60725
60740
|
configure: configure2,
|
|
60726
60741
|
displayName: "Astro",
|
|
60727
|
-
|
|
60728
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} -- astro dev`,
|
|
60742
|
+
getPackageScripts: async () => ({
|
|
60743
|
+
"pages:dev": `wrangler pages dev ${await compatDateFlag()} -- astro dev`,
|
|
60729
60744
|
"pages:deploy": `astro build && wrangler pages deploy ./dist`
|
|
60730
|
-
},
|
|
60745
|
+
}),
|
|
60731
60746
|
testFlags: [
|
|
60732
60747
|
"--skip-houston",
|
|
60733
60748
|
"--no-install",
|
|
@@ -60749,10 +60764,10 @@ var generate3 = async (ctx) => {
|
|
|
60749
60764
|
var config3 = {
|
|
60750
60765
|
generate: generate3,
|
|
60751
60766
|
displayName: "Docusaurus",
|
|
60752
|
-
|
|
60753
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- ${npm2} run start`,
|
|
60767
|
+
getPackageScripts: async () => ({
|
|
60768
|
+
"pages:dev": `wrangler pages dev ${await compatDateFlag()} --proxy 3000 -- ${npm2} run start`,
|
|
60754
60769
|
"pages:deploy": `NODE_VERSION=16 ${npm2} run build && wrangler pages deploy ./build`
|
|
60755
|
-
},
|
|
60770
|
+
}),
|
|
60756
60771
|
testFlags: [`--package-manager`, npm2]
|
|
60757
60772
|
};
|
|
60758
60773
|
var docusaurus_default = config3;
|
|
@@ -60785,10 +60800,10 @@ var generate4 = async (ctx) => {
|
|
|
60785
60800
|
var config4 = {
|
|
60786
60801
|
generate: generate4,
|
|
60787
60802
|
displayName: "Gatsby",
|
|
60788
|
-
|
|
60789
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 8000 -- ${npm3} run develop`,
|
|
60803
|
+
getPackageScripts: async () => ({
|
|
60804
|
+
"pages:dev": `wrangler pages dev ${await compatDateFlag()} --proxy 8000 -- ${npm3} run develop`,
|
|
60790
60805
|
"pages:deploy": `${npm3} run build && wrangler pages deploy ./public`
|
|
60791
|
-
}
|
|
60806
|
+
})
|
|
60792
60807
|
};
|
|
60793
60808
|
var gatsby_default = config4;
|
|
60794
60809
|
|
|
@@ -60805,7 +60820,7 @@ var generate5 = async (ctx) => {
|
|
|
60805
60820
|
var config5 = {
|
|
60806
60821
|
generate: generate5,
|
|
60807
60822
|
displayName: "Hono",
|
|
60808
|
-
|
|
60823
|
+
getPackageScripts: async () => ({}),
|
|
60809
60824
|
deployCommand: "deploy",
|
|
60810
60825
|
devCommand: "dev",
|
|
60811
60826
|
type: "workers"
|
|
@@ -60945,12 +60960,12 @@ var config6 = {
|
|
|
60945
60960
|
generate: generate6,
|
|
60946
60961
|
configure: configure3,
|
|
60947
60962
|
displayName: "Next",
|
|
60948
|
-
|
|
60963
|
+
getPackageScripts: async () => ({
|
|
60949
60964
|
"pages:build": `${dlx6} @cloudflare/next-on-pages@1`,
|
|
60950
60965
|
"pages:deploy": `${npm4} run pages:build && wrangler pages deploy .vercel/output/static`,
|
|
60951
60966
|
"pages:watch": `${npx3} @cloudflare/next-on-pages@1 --watch`,
|
|
60952
|
-
"pages:dev": `${npx3} wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compat`
|
|
60953
|
-
},
|
|
60967
|
+
"pages:dev": `${npx3} wrangler pages dev .vercel/output/static ${await compatDateFlag()} --compatibility-flag=nodejs_compat`
|
|
60968
|
+
}),
|
|
60954
60969
|
testFlags: [
|
|
60955
60970
|
"--typescript",
|
|
60956
60971
|
"--no-install",
|
|
@@ -60985,11 +61000,11 @@ var config7 = {
|
|
|
60985
61000
|
generate: generate7,
|
|
60986
61001
|
configure: configure4,
|
|
60987
61002
|
displayName: "Nuxt",
|
|
60988
|
-
|
|
61003
|
+
getPackageScripts: async () => ({
|
|
60989
61004
|
build: (cmd) => `NITRO_PRESET=cloudflare-pages ${cmd}`,
|
|
60990
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- ${npm5} run dev`,
|
|
61005
|
+
"pages:dev": `wrangler pages dev ${await compatDateFlag()} --proxy 3000 -- ${npm5} run dev`,
|
|
60991
61006
|
"pages:deploy": `${npm5} run build && wrangler pages deploy ./dist`
|
|
60992
|
-
}
|
|
61007
|
+
})
|
|
60993
61008
|
};
|
|
60994
61009
|
var nuxt_default = config7;
|
|
60995
61010
|
|
|
@@ -61003,17 +61018,17 @@ var package_default = {
|
|
|
61003
61018
|
],
|
|
61004
61019
|
dependencies: {
|
|
61005
61020
|
"@angular/cli": "16.2.2",
|
|
61006
|
-
"create-astro": "4.
|
|
61021
|
+
"create-astro": "4.3.0",
|
|
61007
61022
|
"create-docusaurus": "2.4.3",
|
|
61008
|
-
"create-hono": "0.
|
|
61023
|
+
"create-hono": "0.3.1",
|
|
61009
61024
|
"create-next-app": "13.4.19",
|
|
61010
|
-
"create-qwik": "1.2.
|
|
61025
|
+
"create-qwik": "1.2.14",
|
|
61011
61026
|
"create-react-app": "5.0.1",
|
|
61012
|
-
"create-remix": "2.0
|
|
61013
|
-
"create-solid": "0.3.
|
|
61014
|
-
"create-svelte": "5.1.
|
|
61015
|
-
"create-vue": "3.
|
|
61016
|
-
gatsby: "5.12.
|
|
61027
|
+
"create-remix": "2.1.0",
|
|
61028
|
+
"create-solid": "0.3.7",
|
|
61029
|
+
"create-svelte": "5.1.1",
|
|
61030
|
+
"create-vue": "3.8.0",
|
|
61031
|
+
gatsby: "5.12.8",
|
|
61017
61032
|
nuxi: "3.9.0"
|
|
61018
61033
|
},
|
|
61019
61034
|
frameworkCliMap: {
|
|
@@ -61050,10 +61065,10 @@ var config8 = {
|
|
|
61050
61065
|
generate: generate8,
|
|
61051
61066
|
configure: configure5,
|
|
61052
61067
|
displayName: "Qwik",
|
|
61053
|
-
|
|
61054
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} -- ${npm6} run dev`,
|
|
61068
|
+
getPackageScripts: async () => ({
|
|
61069
|
+
"pages:dev": `wrangler pages dev ${await compatDateFlag()} -- ${npm6} run dev`,
|
|
61055
61070
|
"pages:deploy": `${npm6} run build && wrangler pages deploy ./dist`
|
|
61056
|
-
}
|
|
61071
|
+
})
|
|
61057
61072
|
};
|
|
61058
61073
|
var qwik_default = config8;
|
|
61059
61074
|
|
|
@@ -61071,10 +61086,10 @@ var config9 = {
|
|
|
61071
61086
|
generate: generate9,
|
|
61072
61087
|
configure: configure6,
|
|
61073
61088
|
displayName: "React",
|
|
61074
|
-
|
|
61075
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --port 3000 -- ${npm7} start`,
|
|
61089
|
+
getPackageScripts: async () => ({
|
|
61090
|
+
"pages:dev": `wrangler pages dev ${await compatDateFlag()} --port 3000 -- ${npm7} start`,
|
|
61076
61091
|
"pages:deploy": `${npm7} run build && wrangler pages deploy ./build`
|
|
61077
|
-
}
|
|
61092
|
+
})
|
|
61078
61093
|
};
|
|
61079
61094
|
var react_default = config9;
|
|
61080
61095
|
|
|
@@ -61091,9 +61106,9 @@ var generate10 = async (ctx) => {
|
|
|
61091
61106
|
var config10 = {
|
|
61092
61107
|
generate: generate10,
|
|
61093
61108
|
displayName: "Remix",
|
|
61094
|
-
|
|
61109
|
+
getPackageScripts: async () => ({
|
|
61095
61110
|
"pages:deploy": `${npm8} run build && wrangler pages deploy ./public`
|
|
61096
|
-
},
|
|
61111
|
+
}),
|
|
61097
61112
|
devCommand: "dev",
|
|
61098
61113
|
testFlags: ["--typescript", "--no-install", "--no-git-init"]
|
|
61099
61114
|
};
|
|
@@ -61135,10 +61150,10 @@ var config11 = {
|
|
|
61135
61150
|
generate: generate11,
|
|
61136
61151
|
configure: configure7,
|
|
61137
61152
|
displayName: "Solid",
|
|
61138
|
-
|
|
61139
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- ${npm9} run dev`,
|
|
61153
|
+
getPackageScripts: async () => ({
|
|
61154
|
+
"pages:dev": `wrangler pages dev ${await compatDateFlag()} --proxy 3000 -- ${npm9} run dev`,
|
|
61140
61155
|
"pages:deploy": `${npm9} run build && wrangler pages deploy ./dist/public`
|
|
61141
|
-
}
|
|
61156
|
+
})
|
|
61142
61157
|
};
|
|
61143
61158
|
var solid_default = config11;
|
|
61144
61159
|
|
|
@@ -61232,10 +61247,10 @@ var config12 = {
|
|
|
61232
61247
|
generate: generate12,
|
|
61233
61248
|
configure: configure8,
|
|
61234
61249
|
displayName: "Svelte",
|
|
61235
|
-
|
|
61236
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 5173 -- ${npm10} run dev`,
|
|
61250
|
+
getPackageScripts: async () => ({
|
|
61251
|
+
"pages:dev": `wrangler pages dev ${await compatDateFlag()} --proxy 5173 -- ${npm10} run dev`,
|
|
61237
61252
|
"pages:deploy": `${npm10} run build && wrangler pages deploy .svelte-kit/cloudflare`
|
|
61238
|
-
}
|
|
61253
|
+
})
|
|
61239
61254
|
};
|
|
61240
61255
|
var svelte_default = config12;
|
|
61241
61256
|
|
|
@@ -61248,10 +61263,10 @@ var generate13 = async (ctx) => {
|
|
|
61248
61263
|
var config13 = {
|
|
61249
61264
|
generate: generate13,
|
|
61250
61265
|
displayName: "Vue",
|
|
61251
|
-
|
|
61252
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 5173 -- ${npm11} run dev`,
|
|
61266
|
+
getPackageScripts: async () => ({
|
|
61267
|
+
"pages:dev": `wrangler pages dev ${await compatDateFlag()} --proxy 5173 -- ${npm11} run dev`,
|
|
61253
61268
|
"pages:deploy": `${npm11} run build && wrangler pages deploy ./dist`
|
|
61254
|
-
},
|
|
61269
|
+
}),
|
|
61255
61270
|
testFlags: ["--ts"]
|
|
61256
61271
|
};
|
|
61257
61272
|
var vue_default = config13;
|
|
@@ -61389,21 +61404,35 @@ function secondsSince(start) {
|
|
|
61389
61404
|
}
|
|
61390
61405
|
|
|
61391
61406
|
// ../wrangler/package.json
|
|
61392
|
-
var version2 = "3.
|
|
61407
|
+
var version2 = "3.14.0";
|
|
61393
61408
|
|
|
61394
61409
|
// src/common.ts
|
|
61395
61410
|
var { name, npm: npm12 } = detectPackageManager();
|
|
61396
|
-
var validateProjectDirectory = (relativePath) => {
|
|
61411
|
+
var validateProjectDirectory = (relativePath, args) => {
|
|
61397
61412
|
const path3 = (0, import_path7.resolve)(relativePath);
|
|
61398
61413
|
const existsAlready = (0, import_fs8.existsSync)(path3);
|
|
61399
61414
|
const isEmpty = existsAlready && (0, import_fs8.readdirSync)(path3).length === 0;
|
|
61400
61415
|
if (existsAlready && !isEmpty) {
|
|
61401
61416
|
return `Directory \`${relativePath}\` already exists and is not empty. Please choose a new name.`;
|
|
61402
61417
|
}
|
|
61418
|
+
if (!args.existingScript) {
|
|
61419
|
+
const projectName = (0, import_path7.basename)(path3);
|
|
61420
|
+
const invalidChars = /[^a-z0-9-]/;
|
|
61421
|
+
const invalidStartEnd = /^-|-$/;
|
|
61422
|
+
if (projectName.match(invalidStartEnd)) {
|
|
61423
|
+
return `Project names cannot start or end with a dash.`;
|
|
61424
|
+
}
|
|
61425
|
+
if (projectName.match(invalidChars)) {
|
|
61426
|
+
return `Project names must only contain lowercase characters, numbers, and dashes.`;
|
|
61427
|
+
}
|
|
61428
|
+
if (projectName.length > 58) {
|
|
61429
|
+
return `Project names must be less than 58 characters.`;
|
|
61430
|
+
}
|
|
61431
|
+
}
|
|
61403
61432
|
};
|
|
61404
61433
|
var setupProjectDirectory = (args) => {
|
|
61405
61434
|
const path3 = (0, import_path7.resolve)(args.projectName);
|
|
61406
|
-
const err = validateProjectDirectory(path3);
|
|
61435
|
+
const err = validateProjectDirectory(path3, args);
|
|
61407
61436
|
if (err) {
|
|
61408
61437
|
crash(err);
|
|
61409
61438
|
}
|
|
@@ -61509,7 +61538,10 @@ var chooseAccount = async (ctx) => {
|
|
|
61509
61538
|
};
|
|
61510
61539
|
var printSummary = async (ctx) => {
|
|
61511
61540
|
const nextSteps = [
|
|
61512
|
-
[
|
|
61541
|
+
[
|
|
61542
|
+
`Navigate to the new directory`,
|
|
61543
|
+
`cd ${quote([(0, import_path7.relative)(ctx.originalCWD, ctx.project.path)])}`
|
|
61544
|
+
],
|
|
61513
61545
|
[
|
|
61514
61546
|
`Run the development server`,
|
|
61515
61547
|
`${npm12} run ${ctx.framework?.config.devCommand ?? "start"}`
|
|
@@ -61736,6 +61768,7 @@ var defaultFrameworkConfig = {
|
|
|
61736
61768
|
devCommand: "pages:dev"
|
|
61737
61769
|
};
|
|
61738
61770
|
var runPagesGenerator = async (args) => {
|
|
61771
|
+
const originalCWD = process.cwd();
|
|
61739
61772
|
const { name: name2, path: path3 } = setupProjectDirectory(args);
|
|
61740
61773
|
const framework = await getFrameworkSelection(args);
|
|
61741
61774
|
const frameworkConfig = FrameworkMap[framework];
|
|
@@ -61753,7 +61786,8 @@ var runPagesGenerator = async (args) => {
|
|
|
61753
61786
|
args: args.additionalArgs ?? []
|
|
61754
61787
|
},
|
|
61755
61788
|
args,
|
|
61756
|
-
type: frameworkConfig.type
|
|
61789
|
+
type: frameworkConfig.type,
|
|
61790
|
+
originalCWD
|
|
61757
61791
|
};
|
|
61758
61792
|
const { generate: generate14, configure: configure9 } = FrameworkMap[framework];
|
|
61759
61793
|
await generate14({ ...ctx });
|
|
@@ -61793,7 +61827,8 @@ var getFrameworkSelection = async (args) => {
|
|
|
61793
61827
|
var updatePackageScripts = async (ctx) => {
|
|
61794
61828
|
(0, import_process3.chdir)(ctx.project.path);
|
|
61795
61829
|
await installWrangler();
|
|
61796
|
-
const {
|
|
61830
|
+
const { getPackageScripts } = ctx.framework?.config ?? {};
|
|
61831
|
+
const packageScripts = getPackageScripts ? await getPackageScripts() : {};
|
|
61797
61832
|
if (packageScripts) {
|
|
61798
61833
|
const s = spinner();
|
|
61799
61834
|
const updatingScripts = Object.entries(packageScripts).filter(
|
|
@@ -61840,7 +61875,15 @@ var createProject = async (ctx) => {
|
|
|
61840
61875
|
const productionBranch = await getProductionBranch(ctx.project.path);
|
|
61841
61876
|
const cmd = `${npx5} wrangler pages project create ${ctx.project.name} --production-branch ${productionBranch} ${compatFlagsArg}`;
|
|
61842
61877
|
await retry(
|
|
61843
|
-
|
|
61878
|
+
{
|
|
61879
|
+
times: CREATE_PROJECT_RETRIES,
|
|
61880
|
+
exitCondition: (e) => {
|
|
61881
|
+
return e instanceof Error && // if the error is regarding name duplication we can exist as retrying is not going to help
|
|
61882
|
+
e.message.includes(
|
|
61883
|
+
"A project with this name already exists. Choose a different project name."
|
|
61884
|
+
);
|
|
61885
|
+
}
|
|
61886
|
+
},
|
|
61844
61887
|
async () => runCommand(cmd, {
|
|
61845
61888
|
// Make this command more verbose in test mode to aid
|
|
61846
61889
|
// troubleshooting API errors
|
|
@@ -61857,7 +61900,7 @@ var createProject = async (ctx) => {
|
|
|
61857
61900
|
try {
|
|
61858
61901
|
const verifyProject = `${npx5} wrangler pages deployment list --project-name ${ctx.project.name}`;
|
|
61859
61902
|
await retry(
|
|
61860
|
-
VERIFY_PROJECT_RETRIES,
|
|
61903
|
+
{ times: VERIFY_PROJECT_RETRIES },
|
|
61861
61904
|
async () => runCommand(verifyProject, {
|
|
61862
61905
|
silent: process.env.VITEST == void 0,
|
|
61863
61906
|
cwd: ctx.project.path,
|
|
@@ -61879,11 +61922,14 @@ var import_promises2 = require("fs/promises");
|
|
|
61879
61922
|
var import_os = require("os");
|
|
61880
61923
|
var import_path9 = require("path");
|
|
61881
61924
|
var import_process4 = require("process");
|
|
61925
|
+
var { dlx: dlx14 } = detectPackageManager();
|
|
61882
61926
|
var runWorkersGenerator = async (args) => {
|
|
61927
|
+
const originalCWD = process.cwd();
|
|
61883
61928
|
const { name: name2, path: path3 } = setupProjectDirectory(args);
|
|
61884
61929
|
const ctx = {
|
|
61885
61930
|
project: { name: name2, path: path3 },
|
|
61886
|
-
args
|
|
61931
|
+
args,
|
|
61932
|
+
originalCWD
|
|
61887
61933
|
};
|
|
61888
61934
|
ctx.args.ts = await processArgument(ctx.args, "ts", {
|
|
61889
61935
|
type: "confirm",
|
|
@@ -61945,7 +61991,7 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
61945
61991
|
(0, import_path9.join)((0, import_os.tmpdir)(), "c3-wrangler-init--from-dash-")
|
|
61946
61992
|
);
|
|
61947
61993
|
await runCommand(
|
|
61948
|
-
|
|
61994
|
+
`${dlx14} wrangler@3 init --from-dash ${ctx.args.existingScript} -y --no-delegate-c3`,
|
|
61949
61995
|
{
|
|
61950
61996
|
silent: true,
|
|
61951
61997
|
cwd: tempdir,
|
|
@@ -62055,6 +62101,10 @@ var parseArgs = async (argv) => {
|
|
|
62055
62101
|
}).option("accept-defaults", {
|
|
62056
62102
|
alias: "y",
|
|
62057
62103
|
type: "boolean"
|
|
62104
|
+
}).option("auto-update", {
|
|
62105
|
+
type: "boolean",
|
|
62106
|
+
default: C3_DEFAULTS.autoUpdate,
|
|
62107
|
+
description: "Automatically uses the latest version of `create-cloudflare`. Set --no-auto-update to disable"
|
|
62058
62108
|
}).option("wrangler-defaults", { type: "boolean", hidden: true }).version(version).strictOptions().alias("h", "help").help();
|
|
62059
62109
|
const args = await yargsObj.argv;
|
|
62060
62110
|
const positionalArgs = args._;
|
|
@@ -62075,7 +62125,10 @@ var processArgument = async (args, name2, promptConfig) => {
|
|
|
62075
62125
|
let value = args[name2];
|
|
62076
62126
|
const renderSubmitted = getRenderers(promptConfig).submit;
|
|
62077
62127
|
if (value !== void 0) {
|
|
62078
|
-
promptConfig.validate?.(value);
|
|
62128
|
+
const error = promptConfig.validate?.(value);
|
|
62129
|
+
if (error) {
|
|
62130
|
+
crash(error);
|
|
62131
|
+
}
|
|
62079
62132
|
const lines = renderSubmitted({ value });
|
|
62080
62133
|
logRaw(lines.join("\n"));
|
|
62081
62134
|
return value;
|
|
@@ -62113,7 +62166,8 @@ var isUpdateAvailable = async () => {
|
|
|
62113
62166
|
};
|
|
62114
62167
|
var runLatest = async () => {
|
|
62115
62168
|
const args = process.argv.slice(2);
|
|
62116
|
-
|
|
62169
|
+
const argString = npm13 === "npm" ? `-- ${args.join(" ")}` : `${args.join(" ")}`;
|
|
62170
|
+
await runCommand(`${npm13} create cloudflare@latest ${argString}`);
|
|
62117
62171
|
};
|
|
62118
62172
|
var runCli = async (args) => {
|
|
62119
62173
|
printBanner();
|
|
@@ -62123,7 +62177,7 @@ var runCli = async (args) => {
|
|
|
62123
62177
|
helpText: "also used as application name",
|
|
62124
62178
|
defaultValue: C3_DEFAULTS.projectName,
|
|
62125
62179
|
label: "dir",
|
|
62126
|
-
validate: (value) => validateProjectDirectory(String(value) || C3_DEFAULTS.projectName),
|
|
62180
|
+
validate: (value) => validateProjectDirectory(String(value) || C3_DEFAULTS.projectName, args),
|
|
62127
62181
|
format: (val) => `./${val}`
|
|
62128
62182
|
});
|
|
62129
62183
|
if (!args.type) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-67c4c2c0",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"yargs": "^17.7.1",
|
|
67
67
|
"yarn": "^1.22.19",
|
|
68
68
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
69
|
-
"wrangler": "3.
|
|
69
|
+
"wrangler": "3.14.0"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=18.14.1"
|