create-cloudflare 0.0.0-9e466599 → 0.0.0-9f7e547e
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 +66 -46
- package/package.json +3 -2
- package/templates/chatgptPlugin/ts/package.json +1 -0
- package/templates/common/js/package.json +1 -0
- package/templates/common/ts/package.json +1 -0
- package/templates/hello-world/js/package.json +1 -0
- package/templates/hello-world/ts/package.json +1 -0
- package/templates/openapi/ts/package.json +1 -0
- package/templates/queues/js/package.json +1 -0
- package/templates/queues/ts/package.json +1 -0
- package/templates/scheduled/js/package.json +1 -0
- package/templates/scheduled/js/wrangler.toml +1 -1
- package/templates/scheduled/ts/package.json +1 -0
package/dist/cli.js
CHANGED
|
@@ -57864,7 +57864,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
57864
57864
|
var yargs_default = Yargs;
|
|
57865
57865
|
|
|
57866
57866
|
// package.json
|
|
57867
|
-
var version = "0.0.0-
|
|
57867
|
+
var version = "0.0.0-9f7e547e";
|
|
57868
57868
|
var devDependencies = {
|
|
57869
57869
|
"@babel/parser": "^7.21.3",
|
|
57870
57870
|
"@babel/types": "^7.21.4",
|
|
@@ -59876,6 +59876,10 @@ var detectPackageManager = () => {
|
|
|
59876
59876
|
name2 = "yarn";
|
|
59877
59877
|
version3 = devDependencies["yarn"].replace("^", "");
|
|
59878
59878
|
break;
|
|
59879
|
+
case "bun":
|
|
59880
|
+
name2 = "bun";
|
|
59881
|
+
version3 = "1.0.0";
|
|
59882
|
+
break;
|
|
59879
59883
|
case "npm":
|
|
59880
59884
|
name2 = "npm";
|
|
59881
59885
|
version3 = "0.0.0";
|
|
@@ -59917,6 +59921,14 @@ var detectPackageManager = () => {
|
|
|
59917
59921
|
npx: "yarn",
|
|
59918
59922
|
dlx: "yarn"
|
|
59919
59923
|
};
|
|
59924
|
+
case "bun":
|
|
59925
|
+
return {
|
|
59926
|
+
name: name2,
|
|
59927
|
+
version: version3,
|
|
59928
|
+
npm: "bun",
|
|
59929
|
+
npx: "bunx",
|
|
59930
|
+
dlx: "bunx"
|
|
59931
|
+
};
|
|
59920
59932
|
case "npm":
|
|
59921
59933
|
default:
|
|
59922
59934
|
return {
|
|
@@ -60047,14 +60059,18 @@ var runFrameworkGenerator = async (ctx, cmd) => {
|
|
|
60047
60059
|
await runCommand(cmd);
|
|
60048
60060
|
};
|
|
60049
60061
|
var installPackages = async (packages, config14) => {
|
|
60050
|
-
const { npm:
|
|
60062
|
+
const { npm: npm14 } = detectPackageManager();
|
|
60051
60063
|
let saveFlag;
|
|
60052
60064
|
let cmd;
|
|
60053
|
-
switch (
|
|
60065
|
+
switch (npm14) {
|
|
60054
60066
|
case "yarn":
|
|
60055
60067
|
cmd = "add";
|
|
60056
60068
|
saveFlag = config14.dev ? "-D" : "";
|
|
60057
60069
|
break;
|
|
60070
|
+
case "bun":
|
|
60071
|
+
cmd = "add";
|
|
60072
|
+
saveFlag = config14.dev ? "-d" : "";
|
|
60073
|
+
break;
|
|
60058
60074
|
case "npm":
|
|
60059
60075
|
case "pnpm":
|
|
60060
60076
|
default:
|
|
@@ -60062,36 +60078,36 @@ var installPackages = async (packages, config14) => {
|
|
|
60062
60078
|
saveFlag = config14.dev ? "--save-dev" : "--save";
|
|
60063
60079
|
break;
|
|
60064
60080
|
}
|
|
60065
|
-
await runCommand(`${
|
|
60081
|
+
await runCommand(`${npm14} ${cmd} ${saveFlag} ${packages.join(" ")}`, {
|
|
60066
60082
|
...config14,
|
|
60067
60083
|
silent: true
|
|
60068
60084
|
});
|
|
60069
60085
|
};
|
|
60070
60086
|
var npmInstall = async () => {
|
|
60071
|
-
const { npm:
|
|
60072
|
-
await runCommand(`${
|
|
60087
|
+
const { npm: npm14 } = detectPackageManager();
|
|
60088
|
+
await runCommand(`${npm14} install`, {
|
|
60073
60089
|
silent: true,
|
|
60074
60090
|
startText: "Installing dependencies",
|
|
60075
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
60091
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm14} install\``)}`
|
|
60076
60092
|
});
|
|
60077
60093
|
};
|
|
60078
60094
|
var resetPackageManager = async (ctx) => {
|
|
60079
|
-
const { npm:
|
|
60080
|
-
if (
|
|
60095
|
+
const { npm: npm14 } = detectPackageManager();
|
|
60096
|
+
if (npm14 === "npm")
|
|
60081
60097
|
return;
|
|
60082
60098
|
const nodeModulesPath = import_path5.default.join(ctx.project.path, "node_modules");
|
|
60083
60099
|
(0, import_fs5.rmSync)(nodeModulesPath, { recursive: true });
|
|
60084
60100
|
const lockfilePath = import_path5.default.join(ctx.project.path, "package-lock.json");
|
|
60085
60101
|
(0, import_fs5.rmSync)(lockfilePath);
|
|
60086
|
-
await runCommand(`${
|
|
60102
|
+
await runCommand(`${npm14} install`, {
|
|
60087
60103
|
silent: true,
|
|
60088
60104
|
cwd: ctx.project.path,
|
|
60089
60105
|
startText: "Installing dependencies",
|
|
60090
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
60106
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm14} install\``)}`
|
|
60091
60107
|
});
|
|
60092
60108
|
};
|
|
60093
60109
|
var installWrangler = async () => {
|
|
60094
|
-
const { npm:
|
|
60110
|
+
const { npm: npm14 } = detectPackageManager();
|
|
60095
60111
|
if ((0, import_fs5.existsSync)(import_path5.default.resolve("node_modules", "wrangler"))) {
|
|
60096
60112
|
return;
|
|
60097
60113
|
}
|
|
@@ -60101,7 +60117,7 @@ var installWrangler = async () => {
|
|
|
60101
60117
|
"A command line tool for building Cloudflare Workers"
|
|
60102
60118
|
)}`,
|
|
60103
60119
|
doneText: `${brandColor("installed")} ${dim(
|
|
60104
|
-
`via \`${
|
|
60120
|
+
`via \`${npm14} install wrangler --save-dev\``
|
|
60105
60121
|
)}`
|
|
60106
60122
|
});
|
|
60107
60123
|
};
|
|
@@ -60148,8 +60164,8 @@ var listAccounts = async () => {
|
|
|
60148
60164
|
return accounts;
|
|
60149
60165
|
};
|
|
60150
60166
|
async function getWorkerdCompatibilityDate() {
|
|
60151
|
-
const { npm:
|
|
60152
|
-
return runCommand(`${
|
|
60167
|
+
const { npm: npm14 } = detectPackageManager();
|
|
60168
|
+
return runCommand(`${npm14} info workerd dist-tags.latest`, {
|
|
60153
60169
|
silent: true,
|
|
60154
60170
|
captureOutput: true,
|
|
60155
60171
|
startText: "Retrieving current workerd compatibility date",
|
|
@@ -60368,7 +60384,7 @@ var config2 = {
|
|
|
60368
60384
|
"--no-install",
|
|
60369
60385
|
"--no-git",
|
|
60370
60386
|
"--template",
|
|
60371
|
-
"
|
|
60387
|
+
"basics",
|
|
60372
60388
|
"--typescript",
|
|
60373
60389
|
"strict"
|
|
60374
60390
|
]
|
|
@@ -60600,10 +60616,14 @@ var config6 = {
|
|
|
60600
60616
|
var next_default = config6;
|
|
60601
60617
|
|
|
60602
60618
|
// src/frameworks/nuxt/index.ts
|
|
60603
|
-
var { dlx: dlx7 } = detectPackageManager();
|
|
60619
|
+
var { npm: npm5, dlx: dlx7 } = detectPackageManager();
|
|
60604
60620
|
var generate7 = async (ctx) => {
|
|
60605
60621
|
const cli = getFrameworkCli(ctx);
|
|
60606
|
-
|
|
60622
|
+
const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
|
|
60623
|
+
await runFrameworkGenerator(
|
|
60624
|
+
ctx,
|
|
60625
|
+
`${dlx7} ${cli} init ${ctx.project.name} --packageManager ${npm5} ${gitFlag}`
|
|
60626
|
+
);
|
|
60607
60627
|
logRaw("");
|
|
60608
60628
|
};
|
|
60609
60629
|
var configure4 = async (ctx) => {
|
|
@@ -60617,8 +60637,8 @@ var config7 = {
|
|
|
60617
60637
|
displayName: "Nuxt",
|
|
60618
60638
|
packageScripts: {
|
|
60619
60639
|
build: (cmd) => `NITRO_PRESET=cloudflare-pages ${cmd}`,
|
|
60620
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 --
|
|
60621
|
-
"pages:deploy":
|
|
60640
|
+
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- ${npm5} run dev`,
|
|
60641
|
+
"pages:deploy": `${npm5} run build && wrangler pages deploy ./dist`
|
|
60622
60642
|
}
|
|
60623
60643
|
};
|
|
60624
60644
|
var nuxt_default = config7;
|
|
@@ -60664,7 +60684,7 @@ var package_default = {
|
|
|
60664
60684
|
};
|
|
60665
60685
|
|
|
60666
60686
|
// src/frameworks/qwik/index.ts
|
|
60667
|
-
var { npm:
|
|
60687
|
+
var { npm: npm6, npx: npx4, dlx: dlx8 } = detectPackageManager();
|
|
60668
60688
|
var generate8 = async (ctx) => {
|
|
60669
60689
|
const cli = getFrameworkCli(ctx);
|
|
60670
60690
|
await runFrameworkGenerator(ctx, `${dlx8} ${cli} basic ${ctx.project.name}`);
|
|
@@ -60681,14 +60701,14 @@ var config8 = {
|
|
|
60681
60701
|
configure: configure5,
|
|
60682
60702
|
displayName: "Qwik",
|
|
60683
60703
|
packageScripts: {
|
|
60684
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} -- ${
|
|
60685
|
-
"pages:deploy": `${
|
|
60704
|
+
"pages:dev": `wrangler pages dev ${compatDateFlag()} -- ${npm6} run dev`,
|
|
60705
|
+
"pages:deploy": `${npm6} run build && wrangler pages deploy ./dist`
|
|
60686
60706
|
}
|
|
60687
60707
|
};
|
|
60688
60708
|
var qwik_default = config8;
|
|
60689
60709
|
|
|
60690
60710
|
// src/frameworks/react/index.ts
|
|
60691
|
-
var { npm:
|
|
60711
|
+
var { npm: npm7, dlx: dlx9 } = detectPackageManager();
|
|
60692
60712
|
var generate9 = async (ctx) => {
|
|
60693
60713
|
const cli = getFrameworkCli(ctx);
|
|
60694
60714
|
await runFrameworkGenerator(ctx, `${dlx9} ${cli} ${ctx.project.name}`);
|
|
@@ -60702,14 +60722,14 @@ var config9 = {
|
|
|
60702
60722
|
configure: configure6,
|
|
60703
60723
|
displayName: "React",
|
|
60704
60724
|
packageScripts: {
|
|
60705
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --port 3000 -- ${
|
|
60706
|
-
"pages:deploy": `${
|
|
60725
|
+
"pages:dev": `wrangler pages dev ${compatDateFlag()} --port 3000 -- ${npm7} start`,
|
|
60726
|
+
"pages:deploy": `${npm7} run build && wrangler pages deploy ./build`
|
|
60707
60727
|
}
|
|
60708
60728
|
};
|
|
60709
60729
|
var react_default = config9;
|
|
60710
60730
|
|
|
60711
60731
|
// src/frameworks/remix/index.ts
|
|
60712
|
-
var { npm:
|
|
60732
|
+
var { npm: npm8, dlx: dlx10 } = detectPackageManager();
|
|
60713
60733
|
var generate10 = async (ctx) => {
|
|
60714
60734
|
const cli = getFrameworkCli(ctx);
|
|
60715
60735
|
await runFrameworkGenerator(
|
|
@@ -60722,7 +60742,7 @@ var config10 = {
|
|
|
60722
60742
|
generate: generate10,
|
|
60723
60743
|
displayName: "Remix",
|
|
60724
60744
|
packageScripts: {
|
|
60725
|
-
"pages:deploy": `${
|
|
60745
|
+
"pages:deploy": `${npm8} run build && wrangler pages deploy ./public`
|
|
60726
60746
|
},
|
|
60727
60747
|
devCommand: "dev",
|
|
60728
60748
|
testFlags: ["--typescript", "--no-install"]
|
|
@@ -60744,7 +60764,7 @@ export default defineConfig({
|
|
|
60744
60764
|
`;
|
|
60745
60765
|
|
|
60746
60766
|
// src/frameworks/solid/index.ts
|
|
60747
|
-
var { npm:
|
|
60767
|
+
var { npm: npm9, dlx: dlx11 } = detectPackageManager();
|
|
60748
60768
|
var generate11 = async (ctx) => {
|
|
60749
60769
|
(0, import_fs8.mkdirSync)(ctx.project.path);
|
|
60750
60770
|
process.chdir(ctx.project.path);
|
|
@@ -60770,8 +60790,8 @@ var config11 = {
|
|
|
60770
60790
|
configure: configure7,
|
|
60771
60791
|
displayName: "Solid",
|
|
60772
60792
|
packageScripts: {
|
|
60773
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- ${
|
|
60774
|
-
"pages:deploy": `${
|
|
60793
|
+
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- ${npm9} run dev`,
|
|
60794
|
+
"pages:deploy": `${npm9} run build && wrangler pages deploy ./dist/public`
|
|
60775
60795
|
}
|
|
60776
60796
|
};
|
|
60777
60797
|
var solid_default = config11;
|
|
@@ -60823,7 +60843,7 @@ interface Platform {
|
|
|
60823
60843
|
`;
|
|
60824
60844
|
|
|
60825
60845
|
// src/frameworks/svelte/index.ts
|
|
60826
|
-
var { npm:
|
|
60846
|
+
var { npm: npm10, dlx: dlx12 } = detectPackageManager();
|
|
60827
60847
|
var generate12 = async (ctx) => {
|
|
60828
60848
|
const cli = getFrameworkCli(ctx);
|
|
60829
60849
|
await runFrameworkGenerator(ctx, `${dlx12} ${cli} ${ctx.project.name}`);
|
|
@@ -60867,14 +60887,14 @@ var config12 = {
|
|
|
60867
60887
|
configure: configure8,
|
|
60868
60888
|
displayName: "Svelte",
|
|
60869
60889
|
packageScripts: {
|
|
60870
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 5173 -- ${
|
|
60871
|
-
"pages:deploy": `${
|
|
60890
|
+
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 5173 -- ${npm10} run dev`,
|
|
60891
|
+
"pages:deploy": `${npm10} run build && wrangler pages deploy .svelte-kit/cloudflare`
|
|
60872
60892
|
}
|
|
60873
60893
|
};
|
|
60874
60894
|
var svelte_default = config12;
|
|
60875
60895
|
|
|
60876
60896
|
// src/frameworks/vue/index.ts
|
|
60877
|
-
var { npm:
|
|
60897
|
+
var { npm: npm11, dlx: dlx13 } = detectPackageManager();
|
|
60878
60898
|
var generate13 = async (ctx) => {
|
|
60879
60899
|
const cli = getFrameworkCli(ctx);
|
|
60880
60900
|
await runFrameworkGenerator(ctx, `${dlx13} ${cli} ${ctx.project.name}`);
|
|
@@ -60883,8 +60903,8 @@ var config13 = {
|
|
|
60883
60903
|
generate: generate13,
|
|
60884
60904
|
displayName: "Vue",
|
|
60885
60905
|
packageScripts: {
|
|
60886
|
-
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 5173 -- ${
|
|
60887
|
-
"pages:deploy": `${
|
|
60906
|
+
"pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 5173 -- ${npm11} run dev`,
|
|
60907
|
+
"pages:deploy": `${npm11} run build && wrangler pages deploy ./dist`
|
|
60888
60908
|
},
|
|
60889
60909
|
testFlags: ["--ts"]
|
|
60890
60910
|
};
|
|
@@ -61023,10 +61043,10 @@ function secondsSince(start) {
|
|
|
61023
61043
|
}
|
|
61024
61044
|
|
|
61025
61045
|
// ../wrangler/package.json
|
|
61026
|
-
var version2 = "3.
|
|
61046
|
+
var version2 = "3.10.1";
|
|
61027
61047
|
|
|
61028
61048
|
// src/common.ts
|
|
61029
|
-
var { name, npm:
|
|
61049
|
+
var { name, npm: npm12 } = detectPackageManager();
|
|
61030
61050
|
var validateProjectDirectory = (relativePath) => {
|
|
61031
61051
|
const path3 = (0, import_path7.resolve)(relativePath);
|
|
61032
61052
|
const existsAlready = (0, import_fs9.existsSync)(path3);
|
|
@@ -61049,7 +61069,7 @@ var setupProjectDirectory = (args) => {
|
|
|
61049
61069
|
};
|
|
61050
61070
|
var offerToDeploy = async (ctx) => {
|
|
61051
61071
|
startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
|
|
61052
|
-
const label = `deploy via \`${
|
|
61072
|
+
const label = `deploy via \`${npm12} run ${ctx.framework?.config.deployCommand ?? "deploy"}\``;
|
|
61053
61073
|
ctx.args.deploy = await processArgument(ctx.args, "deploy", {
|
|
61054
61074
|
type: "confirm",
|
|
61055
61075
|
question: "Do you want to deploy your application?",
|
|
@@ -61071,7 +61091,7 @@ var runDeploy = async (ctx) => {
|
|
|
61071
61091
|
return;
|
|
61072
61092
|
}
|
|
61073
61093
|
const baseDeployCmd = [
|
|
61074
|
-
|
|
61094
|
+
npm12,
|
|
61075
61095
|
"run",
|
|
61076
61096
|
ctx.framework?.config.deployCommand ?? "deploy"
|
|
61077
61097
|
];
|
|
@@ -61146,11 +61166,11 @@ var printSummary = async (ctx) => {
|
|
|
61146
61166
|
[`Navigate to the new directory`, `cd ${ctx.project.name}`],
|
|
61147
61167
|
[
|
|
61148
61168
|
`Run the development server`,
|
|
61149
|
-
`${
|
|
61169
|
+
`${npm12} run ${ctx.framework?.config.devCommand ?? "start"}`
|
|
61150
61170
|
],
|
|
61151
61171
|
[
|
|
61152
61172
|
`Deploy your application`,
|
|
61153
|
-
`${
|
|
61173
|
+
`${npm12} run ${ctx.framework?.config.deployCommand ?? "deploy"}`
|
|
61154
61174
|
],
|
|
61155
61175
|
[
|
|
61156
61176
|
`Read the documentation`,
|
|
@@ -61172,7 +61192,7 @@ var printSummary = async (ctx) => {
|
|
|
61172
61192
|
`${bgGreen(" APPLICATION CREATED ")}`,
|
|
61173
61193
|
`${dim(`Deploy your application with`)}`,
|
|
61174
61194
|
`${blue(
|
|
61175
|
-
`${
|
|
61195
|
+
`${npm12} run ${ctx.framework?.config.deployCommand ?? "deploy"}`
|
|
61176
61196
|
)}`
|
|
61177
61197
|
].join(" ");
|
|
61178
61198
|
logRaw(msg);
|
|
@@ -61690,7 +61710,7 @@ var processArgument = async (args, name2, promptConfig) => {
|
|
|
61690
61710
|
|
|
61691
61711
|
// src/cli.ts
|
|
61692
61712
|
var import_semver2 = __toESM(require_semver2());
|
|
61693
|
-
var { npm:
|
|
61713
|
+
var { npm: npm13 } = detectPackageManager();
|
|
61694
61714
|
var main = async (argv) => {
|
|
61695
61715
|
const args = await parseArgs(argv);
|
|
61696
61716
|
logRaw("");
|
|
@@ -61717,7 +61737,7 @@ var isUpdateAvailable = async () => {
|
|
|
61717
61737
|
};
|
|
61718
61738
|
var runLatest = async () => {
|
|
61719
61739
|
const args = process.argv.slice(2);
|
|
61720
|
-
await runCommand(`${
|
|
61740
|
+
await runCommand(`${npm13} create cloudflare@latest ${args.join(" ")}`);
|
|
61721
61741
|
};
|
|
61722
61742
|
var runCli = async (args) => {
|
|
61723
61743
|
printBanner();
|
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-9f7e547e",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@clack/core": "^0.3.2",
|
|
63
63
|
"@types/semver": "^7.5.1",
|
|
64
64
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
65
|
-
"wrangler": "3.
|
|
65
|
+
"wrangler": "3.10.1"
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|
|
68
68
|
"node": ">=16.13.0"
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"test:e2e:cleanup": "node -r esbuild-register scripts/e2eCleanup.ts",
|
|
76
76
|
"test:e2e:npm": "pnpm run build && TEST_PM=npm vitest run --config ./vitest-e2e.config.ts",
|
|
77
77
|
"test:e2e:pnpm": "pnpm run build && TEST_PM=pnpm vitest run --config ./vitest-e2e.config.ts",
|
|
78
|
+
"test:e2e:bun": "pnpm run build && TEST_PM=bun vitest run --config ./vitest-e2e.config.ts",
|
|
78
79
|
"test:unit": "vitest run --config ./vitest.config.ts",
|
|
79
80
|
"test:unit:watch": "vitest --config ./vitest.config.ts",
|
|
80
81
|
"watch": "node -r esbuild-register scripts/build.ts --watch"
|