create-cloudflare 0.0.0-64c3ec15 → 0.0.0-696d7f29

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.
Files changed (2) hide show
  1. package/dist/cli.js +22 -4
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -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-64c3ec15";
58094
+ var version = "0.0.0-696d7f29";
58095
58095
  var devDependencies = {
58096
58096
  "@babel/parser": "^7.21.3",
58097
58097
  "@babel/types": "^7.21.4",
@@ -61389,7 +61389,7 @@ function secondsSince(start) {
61389
61389
  }
61390
61390
 
61391
61391
  // ../wrangler/package.json
61392
- var version2 = "3.11.0";
61392
+ var version2 = "3.13.0";
61393
61393
 
61394
61394
  // src/common.ts
61395
61395
  var { name, npm: npm12 } = detectPackageManager();
@@ -61400,6 +61400,18 @@ var validateProjectDirectory = (relativePath) => {
61400
61400
  if (existsAlready && !isEmpty) {
61401
61401
  return `Directory \`${relativePath}\` already exists and is not empty. Please choose a new name.`;
61402
61402
  }
61403
+ const projectName = (0, import_path7.basename)(path3);
61404
+ const invalidChars = /[^a-z0-9-]/;
61405
+ const invalidStartEnd = /^-|-$/;
61406
+ if (projectName.match(invalidStartEnd)) {
61407
+ return `Project name cannot start or end with a dash.`;
61408
+ }
61409
+ if (projectName.match(invalidChars)) {
61410
+ return `Project name must only contain lowercase characters, numbers, and dashes.`;
61411
+ }
61412
+ if (projectName.length > 58) {
61413
+ return `Project names must be less than 58 characters.`;
61414
+ }
61403
61415
  };
61404
61416
  var setupProjectDirectory = (args) => {
61405
61417
  const path3 = (0, import_path7.resolve)(args.projectName);
@@ -61879,6 +61891,7 @@ var import_promises2 = require("fs/promises");
61879
61891
  var import_os = require("os");
61880
61892
  var import_path9 = require("path");
61881
61893
  var import_process4 = require("process");
61894
+ var { dlx: dlx14 } = detectPackageManager();
61882
61895
  var runWorkersGenerator = async (args) => {
61883
61896
  const { name: name2, path: path3 } = setupProjectDirectory(args);
61884
61897
  const ctx = {
@@ -61945,7 +61958,7 @@ async function copyExistingWorkerFiles(ctx) {
61945
61958
  (0, import_path9.join)((0, import_os.tmpdir)(), "c3-wrangler-init--from-dash-")
61946
61959
  );
61947
61960
  await runCommand(
61948
- `npx wrangler@3 init --from-dash ${ctx.args.existingScript} -y --no-delegate-c3`,
61961
+ `${dlx14} wrangler@3 init --from-dash ${ctx.args.existingScript} -y --no-delegate-c3`,
61949
61962
  {
61950
61963
  silent: true,
61951
61964
  cwd: tempdir,
@@ -62055,6 +62068,10 @@ var parseArgs = async (argv) => {
62055
62068
  }).option("accept-defaults", {
62056
62069
  alias: "y",
62057
62070
  type: "boolean"
62071
+ }).option("auto-update", {
62072
+ type: "boolean",
62073
+ default: C3_DEFAULTS.autoUpdate,
62074
+ description: "Automatically uses the latest version of `create-cloudflare`. Set --no-auto-update to disable"
62058
62075
  }).option("wrangler-defaults", { type: "boolean", hidden: true }).version(version).strictOptions().alias("h", "help").help();
62059
62076
  const args = await yargsObj.argv;
62060
62077
  const positionalArgs = args._;
@@ -62113,7 +62130,8 @@ var isUpdateAvailable = async () => {
62113
62130
  };
62114
62131
  var runLatest = async () => {
62115
62132
  const args = process.argv.slice(2);
62116
- await runCommand(`${npm13} create cloudflare@latest ${args.join(" ")}`);
62133
+ const argString = npm13 === "npm" ? `-- ${args.join(" ")}` : `${args.join(" ")}`;
62134
+ await runCommand(`${npm13} create cloudflare@latest ${argString}`);
62117
62135
  };
62118
62136
  var runCli = async (args) => {
62119
62137
  printBanner();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "0.0.0-64c3ec15",
3
+ "version": "0.0.0-696d7f29",
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.11.0"
69
+ "wrangler": "3.13.0"
70
70
  },
71
71
  "engines": {
72
72
  "node": ">=18.14.1"