create-cloudflare 0.0.0-33762441 → 0.0.0-528cc0fc
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 +16 -11
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -53150,7 +53150,7 @@ var status = {
|
|
|
53150
53150
|
success: bgRed(` SUCCESS `)
|
|
53151
53151
|
};
|
|
53152
53152
|
var space = (n = 1) => {
|
|
53153
|
-
return
|
|
53153
|
+
return hidden("\u200A".repeat(n));
|
|
53154
53154
|
};
|
|
53155
53155
|
var logRaw = (msg) => {
|
|
53156
53156
|
if (process.env.VITEST)
|
|
@@ -54350,6 +54350,7 @@ var leftT = gray(shapes.leftT);
|
|
|
54350
54350
|
var textInput = async (opts) => {
|
|
54351
54351
|
const { renderSubmitted, question, defaultValue, validate, acceptDefault } = opts;
|
|
54352
54352
|
const helpText = opts.helpText || ``;
|
|
54353
|
+
const format3 = opts.format || ((val) => val);
|
|
54353
54354
|
const prompt = new oD({
|
|
54354
54355
|
defaultValue,
|
|
54355
54356
|
validate,
|
|
@@ -54359,19 +54360,21 @@ var textInput = async (opts) => {
|
|
|
54359
54360
|
case "initial":
|
|
54360
54361
|
body += `${blCorner} ${bold(question)} ${dim(helpText)}
|
|
54361
54362
|
`;
|
|
54362
|
-
body += `${space(2)}${gray(defaultValue)}
|
|
54363
|
+
body += `${space(2)}${gray(format3(defaultValue))}
|
|
54363
54364
|
`;
|
|
54364
54365
|
break;
|
|
54365
54366
|
case "active":
|
|
54366
54367
|
body += `${blCorner} ${bold(question)} ${dim(helpText)}
|
|
54367
54368
|
`;
|
|
54368
|
-
body += `${space(2)}${this.value}
|
|
54369
|
+
body += `${space(2)}${format3(this.value || dim(defaultValue))}
|
|
54369
54370
|
`;
|
|
54370
54371
|
break;
|
|
54371
54372
|
case "submit":
|
|
54372
54373
|
body += `${leftT} ${question}
|
|
54373
54374
|
`;
|
|
54374
|
-
body += `${grayBar} ${renderSubmitted(
|
|
54375
|
+
body += `${grayBar} ${renderSubmitted(
|
|
54376
|
+
format3(this.value)
|
|
54377
|
+
)}
|
|
54375
54378
|
${grayBar}`;
|
|
54376
54379
|
break;
|
|
54377
54380
|
case "error":
|
|
@@ -54381,7 +54384,7 @@ ${grayBar}`;
|
|
|
54381
54384
|
`;
|
|
54382
54385
|
body += `${blCorner} ${question} ${dim(helpText)}
|
|
54383
54386
|
`;
|
|
54384
|
-
body += `${space(2)}${this.value}
|
|
54387
|
+
body += `${space(2)}${format3(this.value)}
|
|
54385
54388
|
`;
|
|
54386
54389
|
break;
|
|
54387
54390
|
default:
|
|
@@ -59416,7 +59419,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
59416
59419
|
var yargs_default = Yargs;
|
|
59417
59420
|
|
|
59418
59421
|
// package.json
|
|
59419
|
-
var version = "0.0.0-
|
|
59422
|
+
var version = "0.0.0-528cc0fc";
|
|
59420
59423
|
|
|
59421
59424
|
// src/common.ts
|
|
59422
59425
|
var import_fs6 = require("fs");
|
|
@@ -59729,14 +59732,15 @@ var validateProjectDirectory = (relativePath) => {
|
|
|
59729
59732
|
const existsAlready = (0, import_fs6.existsSync)(path3);
|
|
59730
59733
|
const isEmpty = existsAlready && (0, import_fs6.readdirSync)(path3).length === 0;
|
|
59731
59734
|
if (existsAlready && !isEmpty) {
|
|
59732
|
-
|
|
59733
|
-
`Directory \`${relativePath}\` already exists and is not empty. Please choose a new name.`
|
|
59734
|
-
);
|
|
59735
|
+
return `Directory \`${relativePath}\` already exists and is not empty. Please choose a new name.`;
|
|
59735
59736
|
}
|
|
59736
59737
|
};
|
|
59737
59738
|
var setupProjectDirectory = (args) => {
|
|
59738
59739
|
const path3 = (0, import_path6.resolve)(args.projectName);
|
|
59739
|
-
validateProjectDirectory(path3);
|
|
59740
|
+
const err = validateProjectDirectory(path3);
|
|
59741
|
+
if (err) {
|
|
59742
|
+
crash(err);
|
|
59743
|
+
}
|
|
59740
59744
|
const directory = (0, import_path6.dirname)(path3);
|
|
59741
59745
|
const name = (0, import_path6.basename)(path3);
|
|
59742
59746
|
(0, import_fs6.mkdirSync)(directory, { recursive: true });
|
|
@@ -60903,7 +60907,8 @@ var validateName = async (name, { acceptDefault = false } = {}) => {
|
|
|
60903
60907
|
},
|
|
60904
60908
|
defaultValue,
|
|
60905
60909
|
acceptDefault,
|
|
60906
|
-
validate: (value
|
|
60910
|
+
validate: (value) => validateProjectDirectory(value || defaultValue),
|
|
60911
|
+
format: (val) => `./${val}`
|
|
60907
60912
|
});
|
|
60908
60913
|
};
|
|
60909
60914
|
var validateType = async (type, { acceptDefault = false } = {}) => {
|
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-528cc0fc",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"recast": "^0.22.0",
|
|
62
62
|
"semver": "^7.5.1",
|
|
63
63
|
"typescript": "^5.0.2",
|
|
64
|
-
"undici": "
|
|
64
|
+
"undici": "5.20.0",
|
|
65
65
|
"vite-tsconfig-paths": "^4.0.8",
|
|
66
66
|
"vitest": "^0.30.0",
|
|
67
67
|
"which-pm-runs": "^1.1.0",
|