create-cloudflare 0.0.0-9a9349a3 → 0.0.0-9b2578aa

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 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-9a9349a3";
58094
+ var version = "0.0.0-9b2578aa";
58095
58095
  var devDependencies = {
58096
58096
  "@babel/parser": "^7.21.3",
58097
58097
  "@babel/types": "^7.21.4",
@@ -60199,6 +60199,7 @@ var detectPackageManager = () => {
60199
60199
  case "bun":
60200
60200
  name2 = "bun";
60201
60201
  version3 = "1.0.0";
60202
+ process.env.npm_config_user_agent = "bun";
60202
60203
  break;
60203
60204
  case "npm":
60204
60205
  name2 = "npm";
@@ -60611,9 +60612,8 @@ var generate = async (ctx) => {
60611
60612
  logRaw("");
60612
60613
  };
60613
60614
  var configure = async (ctx) => {
60614
- const cli = getFrameworkCli(ctx, false);
60615
60615
  process.chdir(ctx.project.path);
60616
- await runCommand(`${npx} ${cli}@next analytics disable`, {
60616
+ await runCommand(`${npx} ng analytics disable`, {
60617
60617
  silent: true
60618
60618
  });
60619
60619
  await addSSRAdapter();
@@ -60627,13 +60627,13 @@ var config = {
60627
60627
  displayName: "Angular",
60628
60628
  packageScripts: {
60629
60629
  process: "node ./tools/copy-worker-files.mjs && node ./tools/copy-client-files.mjs && node ./tools/bundle.mjs",
60630
- prestart: `${npm} run build:ssr && ${npm} run process`,
60631
- start: "wrangler pages dev dist/cloudflare --compatibility-date=2021-09-20 --experimental-local",
60632
- predeploy: `${npm} run build:ssr && ${npm} run process`,
60633
- deploy: "wrangler pages deploy dist/cloudflare"
60630
+ "pages:build": `${npm} run build:ssr && ${npm} run process`,
60631
+ start: `${npm} run pages:build && wrangler pages dev dist/cloudflare --compatibility-date=2021-09-20 --experimental-local`,
60632
+ deploy: `${npm} run pages:build && wrangler pages deploy dist/cloudflare`
60634
60633
  },
60635
60634
  deployCommand: "deploy",
60636
- devCommand: "start"
60635
+ devCommand: "start",
60636
+ testFlags: ["--routing", "--style", "sass"]
60637
60637
  };
60638
60638
  var angular_default = config;
60639
60639
  async function installCFWorker(ctx) {
@@ -60751,7 +60751,8 @@ var config3 = {
60751
60751
  packageScripts: {
60752
60752
  "pages:dev": `wrangler pages dev ${compatDateFlag()} --proxy 3000 -- ${npm2} run start`,
60753
60753
  "pages:deploy": `NODE_VERSION=16 ${npm2} run build && wrangler pages deploy ./build`
60754
- }
60754
+ },
60755
+ testFlags: [`--package-manager`, npm2]
60755
60756
  };
60756
60757
  var docusaurus_default = config3;
60757
60758
 
@@ -61005,11 +61006,11 @@ var package_default = {
61005
61006
  "create-docusaurus": "2.4.3",
61006
61007
  "create-hono": "0.2.6",
61007
61008
  "create-next-app": "13.4.19",
61008
- "create-qwik": "1.2.12",
61009
+ "create-qwik": "1.2.13",
61009
61010
  "create-react-app": "5.0.1",
61010
61011
  "create-remix": "2.0.1",
61011
61012
  "create-solid": "0.3.6",
61012
- "create-svelte": "5.1.0",
61013
+ "create-svelte": "5.1.1",
61013
61014
  "create-vue": "3.7.5",
61014
61015
  gatsby: "5.12.4",
61015
61016
  nuxi: "3.9.0"
@@ -61387,7 +61388,7 @@ function secondsSince(start) {
61387
61388
  }
61388
61389
 
61389
61390
  // ../wrangler/package.json
61390
- var version2 = "3.10.1";
61391
+ var version2 = "3.13.1";
61391
61392
 
61392
61393
  // src/common.ts
61393
61394
  var { name, npm: npm12 } = detectPackageManager();
@@ -61398,6 +61399,18 @@ var validateProjectDirectory = (relativePath) => {
61398
61399
  if (existsAlready && !isEmpty) {
61399
61400
  return `Directory \`${relativePath}\` already exists and is not empty. Please choose a new name.`;
61400
61401
  }
61402
+ const projectName = (0, import_path7.basename)(path3);
61403
+ const invalidChars = /[^a-z0-9-]/;
61404
+ const invalidStartEnd = /^-|-$/;
61405
+ if (projectName.match(invalidStartEnd)) {
61406
+ return `Project name cannot start or end with a dash.`;
61407
+ }
61408
+ if (projectName.match(invalidChars)) {
61409
+ return `Project name must only contain lowercase characters, numbers, and dashes.`;
61410
+ }
61411
+ if (projectName.length > 58) {
61412
+ return `Project names must be less than 58 characters.`;
61413
+ }
61401
61414
  };
61402
61415
  var setupProjectDirectory = (args) => {
61403
61416
  const path3 = (0, import_path7.resolve)(args.projectName);
@@ -61568,6 +61581,16 @@ var offerGit = async (ctx) => {
61568
61581
  ctx.args.git = false;
61569
61582
  return;
61570
61583
  }
61584
+ const gitConfigured = await isGitConfigured();
61585
+ if (!gitConfigured) {
61586
+ if (ctx.args.git) {
61587
+ updateStatus(
61588
+ "Must configure `user.name` and user.email` to use git. Continuing without git."
61589
+ );
61590
+ }
61591
+ ctx.args.git = false;
61592
+ return;
61593
+ }
61571
61594
  const insideGitRepo = await isInsideGitRepo(ctx.project.path);
61572
61595
  if (insideGitRepo)
61573
61596
  return;
@@ -61649,6 +61672,25 @@ async function getGitVersion() {
61649
61672
  async function isGitInstalled() {
61650
61673
  return await getGitVersion() !== null;
61651
61674
  }
61675
+ async function isGitConfigured() {
61676
+ try {
61677
+ const userName = await runCommand("git config user.name", {
61678
+ useSpinner: false,
61679
+ silent: true
61680
+ });
61681
+ if (!userName)
61682
+ return false;
61683
+ const email = await runCommand("git config user.email", {
61684
+ useSpinner: false,
61685
+ silent: true
61686
+ });
61687
+ if (!email)
61688
+ return false;
61689
+ return true;
61690
+ } catch {
61691
+ return false;
61692
+ }
61693
+ }
61652
61694
  async function isInsideGitRepo(cwd) {
61653
61695
  try {
61654
61696
  const output = await runCommand("git status", {
@@ -61848,6 +61890,7 @@ var import_promises2 = require("fs/promises");
61848
61890
  var import_os = require("os");
61849
61891
  var import_path9 = require("path");
61850
61892
  var import_process4 = require("process");
61893
+ var { dlx: dlx14 } = detectPackageManager();
61851
61894
  var runWorkersGenerator = async (args) => {
61852
61895
  const { name: name2, path: path3 } = setupProjectDirectory(args);
61853
61896
  const ctx = {
@@ -61914,7 +61957,7 @@ async function copyExistingWorkerFiles(ctx) {
61914
61957
  (0, import_path9.join)((0, import_os.tmpdir)(), "c3-wrangler-init--from-dash-")
61915
61958
  );
61916
61959
  await runCommand(
61917
- `npx wrangler@3 init --from-dash ${ctx.args.existingScript} -y --no-delegate-c3`,
61960
+ `${dlx14} wrangler@3 init --from-dash ${ctx.args.existingScript} -y --no-delegate-c3`,
61918
61961
  {
61919
61962
  silent: true,
61920
61963
  cwd: tempdir,
@@ -62024,6 +62067,10 @@ var parseArgs = async (argv) => {
62024
62067
  }).option("accept-defaults", {
62025
62068
  alias: "y",
62026
62069
  type: "boolean"
62070
+ }).option("auto-update", {
62071
+ type: "boolean",
62072
+ default: C3_DEFAULTS.autoUpdate,
62073
+ description: "Automatically uses the latest version of `create-cloudflare`. Set --no-auto-update to disable"
62027
62074
  }).option("wrangler-defaults", { type: "boolean", hidden: true }).version(version).strictOptions().alias("h", "help").help();
62028
62075
  const args = await yargsObj.argv;
62029
62076
  const positionalArgs = args._;
@@ -62082,7 +62129,8 @@ var isUpdateAvailable = async () => {
62082
62129
  };
62083
62130
  var runLatest = async () => {
62084
62131
  const args = process.argv.slice(2);
62085
- await runCommand(`${npm13} create cloudflare@latest ${args.join(" ")}`);
62132
+ const argString = npm13 === "npm" ? `-- ${args.join(" ")}` : `${args.join(" ")}`;
62133
+ await runCommand(`${npm13} create cloudflare@latest ${argString}`);
62086
62134
  };
62087
62135
  var runCli = async (args) => {
62088
62136
  printBanner();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "0.0.0-9a9349a3",
3
+ "version": "0.0.0-9b2578aa",
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.10.1"
69
+ "wrangler": "3.13.1"
70
70
  },
71
71
  "engines": {
72
72
  "node": ">=18.14.1"
@@ -35,7 +35,7 @@ compatibility_date = "<TBD>"
35
35
  # Docs: https://developers.cloudflare.com/workers/platform/services
36
36
  # [[services]]
37
37
  # binding = "MY_SERVICE"
38
- # service = "/api/*"
38
+ # service = "my-service"
39
39
 
40
40
  # Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.
41
41
  # Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps.
@@ -35,7 +35,7 @@ compatibility_date = "<TBD>"
35
35
  # Docs: https://developers.cloudflare.com/workers/platform/services
36
36
  # [[services]]
37
37
  # binding = "MY_SERVICE"
38
- # service = "/api/*"
38
+ # service = "my-service"
39
39
 
40
40
  # Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.
41
41
  # Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps.
@@ -35,7 +35,7 @@ compatibility_date = "<TBD>"
35
35
  # Docs: https://developers.cloudflare.com/workers/platform/services
36
36
  # [[services]]
37
37
  # binding = "MY_SERVICE"
38
- # service = "/api/*"
38
+ # service = "my-service"
39
39
 
40
40
  # Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.
41
41
  # Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps.
@@ -35,7 +35,7 @@ compatibility_date = "<TBD>"
35
35
  # Docs: https://developers.cloudflare.com/workers/platform/services
36
36
  # [[services]]
37
37
  # binding = "MY_SERVICE"
38
- # service = "/api/*"
38
+ # service = "my-service"
39
39
 
40
40
  # Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model.
41
41
  # Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps.