create-cloudflare 0.0.0-881ea7be → 0.0.0-9ae3d93e
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 +32 -27
- package/package.json +2 -2
- package/templates/chatgptPlugin/ts/README.md +1 -1
- package/templates/chatgptPlugin/ts/package.json +1 -1
- package/templates/common/js/package.json +1 -1
- package/templates/common/ts/package.json +1 -1
- package/templates/hello-world/js/package.json +1 -1
- package/templates/hello-world/ts/package.json +1 -1
- package/templates/queues/js/package.json +1 -1
- package/templates/queues/ts/package.json +1 -1
- package/templates/scheduled/js/package.json +1 -1
- package/templates/scheduled/ts/package.json +1 -1
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-9ae3d93e";
|
|
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 });
|
|
@@ -60021,10 +60025,10 @@ var config = {
|
|
|
60021
60025
|
displayName: "Angular",
|
|
60022
60026
|
packageScripts: {
|
|
60023
60027
|
process: "node ./tools/copy-worker-files.mjs && node ./tools/copy-client-files.mjs && node ./tools/bundle.mjs",
|
|
60024
|
-
prestart: `${npm2} run build:ssr &&
|
|
60028
|
+
prestart: `${npm2} run build:ssr && ${npm2} run process`,
|
|
60025
60029
|
start: "wrangler pages dev dist/cloudflare --compatibility-date=2021-09-20 --experimental-local",
|
|
60026
|
-
predeploy: `${npm2} run build:ssr &&
|
|
60027
|
-
deploy: "wrangler pages
|
|
60030
|
+
predeploy: `${npm2} run build:ssr && ${npm2} run process`,
|
|
60031
|
+
deploy: "wrangler pages deploy dist/cloudflare"
|
|
60028
60032
|
},
|
|
60029
60033
|
deployCommand: "deploy",
|
|
60030
60034
|
devCommand: "start"
|
|
@@ -60119,7 +60123,7 @@ var config2 = {
|
|
|
60119
60123
|
displayName: "Astro",
|
|
60120
60124
|
packageScripts: {
|
|
60121
60125
|
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- astro dev`,
|
|
60122
|
-
"pages:deploy": `astro build && wrangler pages
|
|
60126
|
+
"pages:deploy": `astro build && wrangler pages deploy ./dist`
|
|
60123
60127
|
},
|
|
60124
60128
|
testFlags: [
|
|
60125
60129
|
"--skip-houston",
|
|
@@ -60148,7 +60152,7 @@ var config3 = {
|
|
|
60148
60152
|
displayName: "Docusaurus",
|
|
60149
60153
|
packageScripts: {
|
|
60150
60154
|
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- ${npm3} run start`,
|
|
60151
|
-
"pages:deploy": `NODE_VERSION=16 ${npm3} run build && wrangler pages
|
|
60155
|
+
"pages:deploy": `NODE_VERSION=16 ${npm3} run build && wrangler pages deploy ./build`
|
|
60152
60156
|
}
|
|
60153
60157
|
};
|
|
60154
60158
|
var docusaurus_default = config3;
|
|
@@ -60189,7 +60193,7 @@ var config4 = {
|
|
|
60189
60193
|
displayName: "Gatsby",
|
|
60190
60194
|
packageScripts: {
|
|
60191
60195
|
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 8000 -- ${npm4} run develop`,
|
|
60192
|
-
"pages:deploy": `${npm4} run build && wrangler pages
|
|
60196
|
+
"pages:deploy": `${npm4} run build && wrangler pages deploy ./public`
|
|
60193
60197
|
}
|
|
60194
60198
|
};
|
|
60195
60199
|
var gatsby_default = config4;
|
|
@@ -60315,7 +60319,7 @@ var config6 = {
|
|
|
60315
60319
|
displayName: "Next",
|
|
60316
60320
|
packageScripts: {
|
|
60317
60321
|
"pages:build": `${npx3} @cloudflare/next-on-pages@1`,
|
|
60318
|
-
"pages:deploy": `${npm5} run pages:build && wrangler pages
|
|
60322
|
+
"pages:deploy": `${npm5} run pages:build && wrangler pages deploy .vercel/output/static`,
|
|
60319
60323
|
"pages:watch": `${npx3} @cloudflare/next-on-pages@1 --watch`,
|
|
60320
60324
|
"pages:dev": `${npx3} wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compat`
|
|
60321
60325
|
},
|
|
@@ -60353,7 +60357,7 @@ var config7 = {
|
|
|
60353
60357
|
displayName: "Nuxt",
|
|
60354
60358
|
packageScripts: {
|
|
60355
60359
|
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- npm run dev`,
|
|
60356
|
-
"pages:deploy": `NODE_VERSION=17 npm run generate && wrangler pages
|
|
60360
|
+
"pages:deploy": `NODE_VERSION=17 npm run generate && wrangler pages deploy ./dist`
|
|
60357
60361
|
}
|
|
60358
60362
|
};
|
|
60359
60363
|
var nuxt_default = config7;
|
|
@@ -60400,7 +60404,7 @@ var config9 = {
|
|
|
60400
60404
|
displayName: "React",
|
|
60401
60405
|
packageScripts: {
|
|
60402
60406
|
"pages:dev": `wrangler pages dev ${compatDateFlag()} --port 3000 -- ${npm7} start`,
|
|
60403
|
-
"pages:deploy": `${npm7} run build && wrangler pages
|
|
60407
|
+
"pages:deploy": `${npm7} run build && wrangler pages deploy ./build`
|
|
60404
60408
|
}
|
|
60405
60409
|
};
|
|
60406
60410
|
var react_default = config9;
|
|
@@ -60419,7 +60423,7 @@ var config10 = {
|
|
|
60419
60423
|
generate: generate10,
|
|
60420
60424
|
displayName: "Remix",
|
|
60421
60425
|
packageScripts: {
|
|
60422
|
-
"pages:deploy": `${npm8} run build && wrangler pages
|
|
60426
|
+
"pages:deploy": `${npm8} run build && wrangler pages deploy ./public`
|
|
60423
60427
|
},
|
|
60424
60428
|
devCommand: "dev",
|
|
60425
60429
|
testFlags: ["--typescript", "--no-install"]
|
|
@@ -60468,7 +60472,7 @@ var config11 = {
|
|
|
60468
60472
|
displayName: "Solid",
|
|
60469
60473
|
packageScripts: {
|
|
60470
60474
|
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- ${npm9} run dev`,
|
|
60471
|
-
"pages:deploy": `${npm9} run build build && wrangler pages
|
|
60475
|
+
"pages:deploy": `${npm9} run build build && wrangler pages deploy ./dist/public`
|
|
60472
60476
|
}
|
|
60473
60477
|
};
|
|
60474
60478
|
var solid_default = config11;
|
|
@@ -60568,7 +60572,7 @@ var config12 = {
|
|
|
60568
60572
|
displayName: "Svelte",
|
|
60569
60573
|
packageScripts: {
|
|
60570
60574
|
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 5173 -- ${npm10} run dev`,
|
|
60571
|
-
"pages:deploy": `NODE_VERSION=16 ${npm10} run build && wrangler pages
|
|
60575
|
+
"pages:deploy": `NODE_VERSION=16 ${npm10} run build && wrangler pages deploy .svelte-kit/cloudflare`
|
|
60572
60576
|
}
|
|
60573
60577
|
};
|
|
60574
60578
|
var svelte_default = config12;
|
|
@@ -60604,7 +60608,7 @@ var config13 = {
|
|
|
60604
60608
|
displayName: "Vue",
|
|
60605
60609
|
packageScripts: {
|
|
60606
60610
|
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 5173 -- ${npm11} run dev`,
|
|
60607
|
-
"pages:deploy": `${npm11} run build && wrangler pages
|
|
60611
|
+
"pages:deploy": `${npm11} run build && wrangler pages deploy ./dist`
|
|
60608
60612
|
},
|
|
60609
60613
|
testFlags: ["--ts"]
|
|
60610
60614
|
};
|
|
@@ -60859,8 +60863,8 @@ async function updateFiles(ctx) {
|
|
|
60859
60863
|
|
|
60860
60864
|
// src/cli.ts
|
|
60861
60865
|
var main = async (argv) => {
|
|
60862
|
-
printBanner();
|
|
60863
60866
|
const args = await parseArgs(argv);
|
|
60867
|
+
printBanner();
|
|
60864
60868
|
const validatedArgs = {
|
|
60865
60869
|
...args,
|
|
60866
60870
|
projectName: await validateName(args.projectName, {
|
|
@@ -60887,7 +60891,7 @@ var parseArgs = async (argv) => {
|
|
|
60887
60891
|
}).option("existing-script", {
|
|
60888
60892
|
type: "string",
|
|
60889
60893
|
hidden: templateMap["pre-existing"].hidden
|
|
60890
|
-
}).option("wrangler-defaults", { type: "boolean", hidden: true }).help().argv;
|
|
60894
|
+
}).option("wrangler-defaults", { type: "boolean", hidden: true }).version(version).help().argv;
|
|
60891
60895
|
return {
|
|
60892
60896
|
projectName: args._[0],
|
|
60893
60897
|
...args
|
|
@@ -60896,14 +60900,15 @@ var parseArgs = async (argv) => {
|
|
|
60896
60900
|
var validateName = async (name, { acceptDefault = false } = {}) => {
|
|
60897
60901
|
const defaultValue = name ?? new import_haikunator.default().haikunate({ tokenHex: true });
|
|
60898
60902
|
return textInput({
|
|
60899
|
-
question: `
|
|
60903
|
+
question: `In which directory do you want to create your application?`,
|
|
60900
60904
|
helpText: "also used as application name",
|
|
60901
60905
|
renderSubmitted: (value) => {
|
|
60902
60906
|
return `${brandColor("dir")} ${dim(value)}`;
|
|
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-9ae3d93e",
|
|
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",
|
|
@@ -12,7 +12,7 @@ The sample plugin allows ChatGPT users to search for repositories using GitHub's
|
|
|
12
12
|
1. Install [wrangler](https://developers.cloudflare.com/workers/cli-wrangler/install-update), the Cloudflare Workers CLI
|
|
13
13
|
2. Clone this project and install dependencies with `npm install`
|
|
14
14
|
3. Run `wrangler login` to login to your Cloudflare account in wrangler
|
|
15
|
-
4. Run `wrangler
|
|
15
|
+
4. Run `wrangler deploy` to publish the plugin to Cloudflare Workers
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|