create-cloudflare 2.64.4 → 2.64.5

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
@@ -77165,6 +77165,7 @@ var defaultWranglerConfig = {
77165
77165
  upload_source_maps: void 0,
77166
77166
  assets: void 0,
77167
77167
  observability: { enabled: true },
77168
+ cache: void 0,
77168
77169
  /** The default here is undefined so that we can delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable. */
77169
77170
  compliance_region: void 0,
77170
77171
  python_modules: { exclude: ["**/*.pyc"] },
@@ -78730,6 +78731,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
78730
78731
  "error"
78731
78732
  );
78732
78733
  experimental(diagnostics, rawEnv, "unsafe");
78734
+ experimental(diagnostics, rawEnv, "secrets");
78733
78735
  const route = normalizeAndValidateRoute(diagnostics, topLevelEnv, rawEnv);
78734
78736
  const account_id = inheritableInWranglerEnvironments(
78735
78737
  diagnostics,
@@ -78888,6 +78890,16 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
78888
78890
  validateVars(envName),
78889
78891
  {}
78890
78892
  ),
78893
+ secrets: notInheritable(
78894
+ diagnostics,
78895
+ topLevelEnv,
78896
+ rawConfig,
78897
+ rawEnv,
78898
+ envName,
78899
+ "secrets",
78900
+ validateSecrets(envName),
78901
+ void 0
78902
+ ),
78891
78903
  define: notInheritable(
78892
78904
  diagnostics,
78893
78905
  topLevelEnv,
@@ -79267,6 +79279,14 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
79267
79279
  validateObservability,
79268
79280
  void 0
79269
79281
  ),
79282
+ cache: inheritable(
79283
+ diagnostics,
79284
+ topLevelEnv,
79285
+ rawEnv,
79286
+ "cache",
79287
+ validateCache,
79288
+ void 0
79289
+ ),
79270
79290
  compliance_region: inheritable(
79271
79291
  diagnostics,
79272
79292
  topLevelEnv,
@@ -79492,6 +79512,29 @@ Please add "vars.${varName}" to "env.${envName}".`
79492
79512
  }
79493
79513
  return isValid;
79494
79514
  }, "validateVars");
79515
+ var validateSecrets = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config49) => {
79516
+ const fieldPath = config49 === void 0 ? `${field}` : `env.${envName}.${field}`;
79517
+ if (value === void 0) {
79518
+ return true;
79519
+ }
79520
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
79521
+ diagnostics.errors.push(
79522
+ `The field "${fieldPath}" should be an object but got ${JSON.stringify(value)}.`
79523
+ );
79524
+ return false;
79525
+ }
79526
+ let isValid = true;
79527
+ validateAdditionalProperties(diagnostics, fieldPath, Object.keys(value), [
79528
+ "required"
79529
+ ]);
79530
+ isValid = validateOptionalTypedArray(
79531
+ diagnostics,
79532
+ `${fieldPath}.required`,
79533
+ value.required,
79534
+ "string"
79535
+ ) && isValid;
79536
+ return isValid;
79537
+ }, "validateSecrets");
79495
79538
  var validateBindingsProperty = /* @__PURE__ */ __name((envName, validateBinding) => (diagnostics, field, value, config49) => {
79496
79539
  let isValid = true;
79497
79540
  const fieldPath = config49 === void 0 ? `${field}` : `env.${envName}.${field}`;
@@ -79726,12 +79769,45 @@ var validateWorkflowBinding = /* @__PURE__ */ __name((diagnostics, field, value)
79726
79769
  );
79727
79770
  isValid = false;
79728
79771
  }
79772
+ if (hasProperty(value, "limits") && value.limits !== void 0) {
79773
+ if (typeof value.limits !== "object" || value.limits === null || Array.isArray(value.limits)) {
79774
+ diagnostics.errors.push(
79775
+ `"${field}" bindings should, optionally, have an object "limits" field but got ${JSON.stringify(
79776
+ value
79777
+ )}.`
79778
+ );
79779
+ isValid = false;
79780
+ } else {
79781
+ const limits = value.limits;
79782
+ if (limits.steps !== void 0) {
79783
+ if (typeof limits.steps !== "number" || !Number.isInteger(limits.steps) || limits.steps < 1) {
79784
+ diagnostics.errors.push(
79785
+ `"${field}" bindings "limits.steps" field must be a positive integer but got ${JSON.stringify(
79786
+ limits.steps
79787
+ )}.`
79788
+ );
79789
+ isValid = false;
79790
+ } else if (limits.steps > 25e3) {
79791
+ diagnostics.warnings.push(
79792
+ `"${field}" has a step limit of ${limits.steps}, which exceeds the production maximum of 25,000. This configuration may not work when deployed.`
79793
+ );
79794
+ }
79795
+ }
79796
+ validateAdditionalProperties(
79797
+ diagnostics,
79798
+ `${field}.limits`,
79799
+ Object.keys(limits),
79800
+ ["steps"]
79801
+ );
79802
+ }
79803
+ }
79729
79804
  validateAdditionalProperties(diagnostics, field, Object.keys(value), [
79730
79805
  "binding",
79731
79806
  "name",
79732
79807
  "class_name",
79733
79808
  "script_name",
79734
- "remote"
79809
+ "remote",
79810
+ "limits"
79735
79811
  ]);
79736
79812
  return isValid;
79737
79813
  }, "validateWorkflowBinding");
@@ -80816,6 +80892,7 @@ var validateBindingsHaveUniqueNames = /* @__PURE__ */ __name((diagnostics, confi
80816
80892
  )
80817
80893
  ])
80818
80894
  );
80895
+ bindingsGroupedByType["Secret"] = config49.secrets?.required ?? [];
80819
80896
  const bindingsGroupedByName = {};
80820
80897
  for (const bindingType in bindingsGroupedByType) {
80821
80898
  const bindingNames = bindingsGroupedByType[bindingType];
@@ -81606,6 +81683,30 @@ var validateObservability = /* @__PURE__ */ __name((diagnostics, field, value) =
81606
81683
  }
81607
81684
  return isValid;
81608
81685
  }, "validateObservability");
81686
+ var validateCache = /* @__PURE__ */ __name((diagnostics, field, value) => {
81687
+ if (value === void 0) {
81688
+ return true;
81689
+ }
81690
+ if (typeof value !== "object" || value === null) {
81691
+ diagnostics.errors.push(
81692
+ `"${field}" should be an object but got ${JSON.stringify(value)}.`
81693
+ );
81694
+ return false;
81695
+ }
81696
+ const val = value;
81697
+ let isValid = true;
81698
+ isValid = validateRequiredProperty(
81699
+ diagnostics,
81700
+ field,
81701
+ "enabled",
81702
+ val.enabled,
81703
+ "boolean"
81704
+ ) && isValid;
81705
+ isValid = validateAdditionalProperties(diagnostics, field, Object.keys(val), [
81706
+ "enabled"
81707
+ ]) && isValid;
81708
+ return isValid;
81709
+ }, "validateCache");
81609
81710
  function warnIfDurableObjectsHaveNoMigrations(diagnostics, durableObjects, migrations, configPath) {
81610
81711
  if (Array.isArray(durableObjects.bindings) && durableObjects.bindings.length > 0) {
81611
81712
  const exportedDurableObjects = (durableObjects.bindings || []).filter(
@@ -88531,7 +88632,7 @@ var Yargs = YargsFactory(esm_default2);
88531
88632
  var yargs_default = Yargs;
88532
88633
 
88533
88634
  // package.json
88534
- var version = "2.64.4";
88635
+ var version = "2.64.5";
88535
88636
 
88536
88637
  // src/metrics.ts
88537
88638
  var import_node_async_hooks = require("node:async_hooks");
@@ -90139,22 +90240,22 @@ var package_default = {
90139
90240
  ],
90140
90241
  dependencies: {
90141
90242
  "create-astro": "4.13.2",
90142
- "create-analog": "2.2.3",
90143
- "@angular/create": "21.1.4",
90243
+ "create-analog": "2.3.1",
90244
+ "@angular/create": "21.2.0",
90144
90245
  "create-docusaurus": "3.9.2",
90145
90246
  "create-hono": "0.19.4",
90146
90247
  "create-next-app": "15.5.6",
90147
90248
  "create-qwik": "1.19.0",
90148
90249
  "create-vite": "8.3.0",
90149
90250
  "create-rwsdk": "3.1.3",
90150
- "create-react-router": "7.13.0",
90251
+ "create-react-router": "7.13.1",
90151
90252
  "create-solid": "0.6.13",
90152
- "create-vike": "0.0.581",
90153
- "create-vue": "3.21.1",
90154
- "create-waku": "0.12.5-1.0.0-alpha.4-0",
90253
+ "create-vike": "0.0.591",
90254
+ "create-vue": "3.22.0",
90255
+ "create-waku": "0.12.5-1.0.0-alpha.5-0",
90155
90256
  "@tanstack/create-start": "0.59.8",
90156
90257
  gatsby: "5.16.1",
90157
- sv: "0.12.2",
90258
+ sv: "0.12.4",
90158
90259
  nuxi: "3.33.1"
90159
90260
  }
90160
90261
  };
@@ -92090,37 +92191,27 @@ var generate22 = async (ctx) => {
92090
92191
  };
92091
92192
  var configure11 = async (ctx) => {
92092
92193
  usesTypescript(ctx);
92093
- const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
92094
- const { date: compatDate } = getLocalWorkerdCompatibilityDate({
92095
- projectPath: ctx.project.path
92096
- });
92194
+ const filePath = `vite.config.${usesTypescript(ctx) ? "ts" : "js"}`;
92097
92195
  updateStatus(`Updating configuration in ${blue(filePath)}`);
92098
92196
  transformFile(filePath, {
92099
92197
  visitCallExpression: function(n) {
92100
92198
  const callee = n.node.callee;
92101
- if (callee.name !== "defineConfig") {
92199
+ if (callee.name !== "nitro") {
92102
92200
  return this.traverse(n);
92103
92201
  }
92104
92202
  const b3 = recast10.types.builders;
92105
- mergeObjectProperties(
92106
- n.node.arguments[0],
92107
- [
92108
- b3.objectProperty(
92109
- b3.identifier("server"),
92110
- b3.objectExpression([
92111
- // preset: "cloudflare_module"
92112
- b3.objectProperty(
92113
- b3.identifier("preset"),
92114
- b3.stringLiteral("cloudflare_module")
92115
- ),
92116
- b3.objectProperty(
92117
- b3.identifier("compatibilityDate"),
92118
- b3.stringLiteral(compatDate)
92119
- )
92120
- ])
92121
- )
92122
- ]
92203
+ const presetProp = b3.objectProperty(
92204
+ b3.identifier("preset"),
92205
+ b3.stringLiteral("cloudflare-module")
92123
92206
  );
92207
+ if (n.node.arguments.length === 0) {
92208
+ n.node.arguments.push(b3.objectExpression([presetProp]));
92209
+ } else {
92210
+ mergeObjectProperties(
92211
+ n.node.arguments[0],
92212
+ [presetProp]
92213
+ );
92214
+ }
92124
92215
  return false;
92125
92216
  }
92126
92217
  });
@@ -92510,7 +92601,7 @@ var generate29 = async (ctx) => {
92510
92601
  await runFrameworkGenerator(ctx, [
92511
92602
  ctx.project.name,
92512
92603
  "--router",
92513
- lang === "ts" ? "--ts" : ""
92604
+ lang === "ts" ? "--ts" : "--no-ts"
92514
92605
  ]);
92515
92606
  logRaw("");
92516
92607
  };
@@ -92673,7 +92764,7 @@ Retrieve API references and limits from:
92673
92764
  var import_node_assert6 = __toESM(require("node:assert"));
92674
92765
 
92675
92766
  // ../wrangler/package.json
92676
- var version2 = "4.68.1";
92767
+ var version2 = "4.70.0";
92677
92768
 
92678
92769
  // src/git.ts
92679
92770
  var offerGit = async (ctx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.64.4",
3
+ "version": "2.64.5",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -30,7 +30,7 @@
30
30
  "@babel/parser": "^7.21.3",
31
31
  "@babel/types": "^7.21.4",
32
32
  "@clack/prompts": "^0.6.3",
33
- "@cloudflare/workers-types": "^4.20260302.0",
33
+ "@cloudflare/workers-types": "^4.20260226.1",
34
34
  "@types/command-exists": "^1.2.0",
35
35
  "@types/cross-spawn": "^6.0.2",
36
36
  "@types/deepmerge": "^2.2.0",
@@ -41,7 +41,6 @@
41
41
  "@types/semver": "^7.5.1",
42
42
  "@types/which-pm-runs": "^1.0.0",
43
43
  "@types/yargs": "^17.0.22",
44
- "chalk": "^5.2.0",
45
44
  "command-exists": "^1.2.9",
46
45
  "comment-json": "^4.5.0",
47
46
  "cross-spawn": "^7.0.3",
@@ -73,13 +72,13 @@
73
72
  "wrap-ansi": "^9.0.0",
74
73
  "xdg-app-paths": "^8.3.0",
75
74
  "yargs": "^17.7.2",
76
- "@cloudflare/workers-utils": "0.11.2",
75
+ "@cloudflare/workers-utils": "0.12.0",
77
76
  "@cloudflare/cli": "1.2.1",
78
77
  "@cloudflare/eslint-config-shared": "1.2.1",
79
78
  "@cloudflare/mock-npm-registry": "0.0.0",
80
- "@cloudflare/vite-plugin": "1.25.5",
79
+ "@cloudflare/vite-plugin": "1.26.0",
81
80
  "@cloudflare/workers-tsconfig": "0.0.0",
82
- "wrangler": "4.68.1"
81
+ "wrangler": "4.70.0"
83
82
  },
84
83
  "engines": {
85
84
  "node": ">=18.14.1"
@@ -1,6 +1,5 @@
1
1
  import { logRaw, updateStatus } from "@cloudflare/cli";
2
2
  import { blue } from "@cloudflare/cli/colors";
3
- import { getLocalWorkerdCompatibilityDate } from "@cloudflare/workers-utils";
4
3
  import { runFrameworkGenerator } from "frameworks/index";
5
4
  import { mergeObjectProperties, transformFile } from "helpers/codemod";
6
5
  import { usesTypescript } from "helpers/files";
@@ -21,42 +20,32 @@ const generate = async (ctx: C3Context) => {
21
20
 
22
21
  const configure = async (ctx: C3Context) => {
23
22
  usesTypescript(ctx);
24
- const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
25
-
26
- const { date: compatDate } = getLocalWorkerdCompatibilityDate({
27
- projectPath: ctx.project.path,
28
- });
23
+ const filePath = `vite.config.${usesTypescript(ctx) ? "ts" : "js"}`;
29
24
 
30
25
  updateStatus(`Updating configuration in ${blue(filePath)}`);
31
26
 
32
27
  transformFile(filePath, {
33
28
  visitCallExpression: function (n) {
34
29
  const callee = n.node.callee as recast.types.namedTypes.Identifier;
35
- if (callee.name !== "defineConfig") {
30
+ if (callee.name !== "nitro") {
36
31
  return this.traverse(n);
37
32
  }
38
33
 
39
34
  const b = recast.types.builders;
40
- mergeObjectProperties(
41
- n.node.arguments[0] as recast.types.namedTypes.ObjectExpression,
42
- [
43
- b.objectProperty(
44
- b.identifier("server"),
45
- b.objectExpression([
46
- // preset: "cloudflare_module"
47
- b.objectProperty(
48
- b.identifier("preset"),
49
- b.stringLiteral("cloudflare_module"),
50
- ),
51
- b.objectProperty(
52
- b.identifier("compatibilityDate"),
53
- b.stringLiteral(compatDate),
54
- ),
55
- ]),
56
- ),
57
- ],
35
+ const presetProp = b.objectProperty(
36
+ b.identifier("preset"),
37
+ b.stringLiteral("cloudflare-module"),
58
38
  );
59
39
 
40
+ if (n.node.arguments.length === 0) {
41
+ n.node.arguments.push(b.objectExpression([presetProp]));
42
+ } else {
43
+ mergeObjectProperties(
44
+ n.node.arguments[0] as recast.types.namedTypes.ObjectExpression,
45
+ [presetProp],
46
+ );
47
+ }
48
+
60
49
  return false;
61
50
  },
62
51
  });
@@ -1,14 +1,9 @@
1
1
  {
2
2
  "name": "<WORKER_NAME>",
3
- "main": "./.output/server/index.mjs",
4
3
  "compatibility_date": "<COMPATIBILITY_DATE>",
5
4
  "compatibility_flags": [
6
5
  "nodejs_compat"
7
6
  ],
8
- "assets": {
9
- "binding": "ASSETS",
10
- "directory": "./.output/public"
11
- },
12
7
  "observability": {
13
8
  "enabled": true
14
9
  }
@@ -25,7 +25,7 @@ const generate = async (ctx: C3Context) => {
25
25
  await runFrameworkGenerator(ctx, [
26
26
  ctx.project.name,
27
27
  "--router",
28
- lang === "ts" ? "--ts" : "",
28
+ lang === "ts" ? "--ts" : "--no-ts",
29
29
  ]);
30
30
  logRaw("");
31
31
  };