create-cloudflare 2.70.14 → 2.70.15

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
@@ -75471,7 +75471,7 @@ function getGlobalWranglerCachePath() {
75471
75471
  }
75472
75472
  __name(getGlobalWranglerCachePath, "getGlobalWranglerCachePath");
75473
75473
 
75474
- // ../workers-utils/dist/chunk-Y3JVLYM6.mjs
75474
+ // ../workers-utils/dist/chunk-3K53PSCY.mjs
75475
75475
  init_chunk_Q72B4Q5Z();
75476
75476
  var import_node_fs2 = require("node:fs");
75477
75477
  var import_node_path2 = __toESM(require("node:path"), 1);
@@ -77822,10 +77822,20 @@ var APIError = class extends ParseError {
77822
77822
  * endpoint-specific structured error payloads.
77823
77823
  */
77824
77824
  meta;
77825
- constructor({ status: status2, ...rest }) {
77825
+ /**
77826
+ * Optional number of milliseconds the API asked us to wait before retrying,
77827
+ * derived from the response's `Retry-After` header (if present).
77828
+ */
77829
+ retryAfterMs;
77830
+ constructor({
77831
+ status: status2,
77832
+ retryAfterMs,
77833
+ ...rest
77834
+ }) {
77826
77835
  super(rest);
77827
77836
  this.name = this.constructor.name;
77828
77837
  this.#status = status2;
77838
+ this.retryAfterMs = retryAfterMs;
77829
77839
  }
77830
77840
  get status() {
77831
77841
  return this.#status;
@@ -98668,12 +98678,47 @@ var validateR2Binding = /* @__PURE__ */ __name((diagnostics, field, value) => {
98668
98678
  if (!isRemoteValid(value, field, diagnostics)) {
98669
98679
  isValid = false;
98670
98680
  }
98681
+ if (hasProperty(value, "local_dev")) {
98682
+ const localDev = value.local_dev;
98683
+ if (typeof localDev !== "object" || localDev === null) {
98684
+ diagnostics.errors.push(
98685
+ `"${field}" bindings should, optionally, have an object "local_dev" field but got ${JSON.stringify(
98686
+ value
98687
+ )}.`
98688
+ );
98689
+ isValid = false;
98690
+ } else {
98691
+ experimental(
98692
+ diagnostics,
98693
+ { local_dev: localDev },
98694
+ "local_dev.experimental_s3_credentials"
98695
+ );
98696
+ if (hasProperty(localDev, "experimental_s3_credentials")) {
98697
+ const credentials = localDev.experimental_s3_credentials;
98698
+ if (typeof credentials !== "object" || credentials === null || !isRequiredProperty(credentials, "accessKeyId", "string") || !isRequiredProperty(credentials, "secretAccessKey", "string")) {
98699
+ diagnostics.errors.push(
98700
+ `"${field}" bindings should, optionally, have a "local_dev.experimental_s3_credentials" field with string "accessKeyId" and "secretAccessKey" fields, but got ${JSON.stringify(
98701
+ value
98702
+ )}.`
98703
+ );
98704
+ isValid = false;
98705
+ }
98706
+ }
98707
+ validateAdditionalProperties(
98708
+ diagnostics,
98709
+ `${field}.local_dev`,
98710
+ Object.keys(localDev),
98711
+ ["experimental_s3_credentials"]
98712
+ );
98713
+ }
98714
+ }
98671
98715
  validateAdditionalProperties(diagnostics, field, Object.keys(value), [
98672
98716
  "binding",
98673
98717
  "bucket_name",
98674
98718
  "preview_bucket_name",
98675
98719
  "jurisdiction",
98676
- "remote"
98720
+ "remote",
98721
+ "local_dev"
98677
98722
  ]);
98678
98723
  return isValid;
98679
98724
  }, "validateR2Binding");
@@ -102107,6 +102152,7 @@ async function fetchInternalBase(complianceConfig, resource, init = {}, userAgen
102107
102152
  logHeaders(response.headers, logger);
102108
102153
  logger.debugWithSanitization?.("RESPONSE:", jsonText);
102109
102154
  logger.debug("-- END CF API RESPONSE");
102155
+ const retryAfterMs = parseRetryAfterMs(response.headers);
102110
102156
  if (!jsonText && (response.status === 204 || response.status === 205)) {
102111
102157
  return {
102112
102158
  response: {
@@ -102115,7 +102161,8 @@ async function fetchInternalBase(complianceConfig, resource, init = {}, userAgen
102115
102161
  errors: [],
102116
102162
  messages: []
102117
102163
  },
102118
- status: response.status
102164
+ status: response.status,
102165
+ retryAfterMs
102119
102166
  };
102120
102167
  }
102121
102168
  if (isWAFBlockResponse(response.headers)) {
@@ -102124,12 +102171,13 @@ async function fetchInternalBase(complianceConfig, resource, init = {}, userAgen
102124
102171
  method,
102125
102172
  resource,
102126
102173
  response.status,
102127
- response.statusText
102174
+ response.statusText,
102175
+ retryAfterMs
102128
102176
  );
102129
102177
  }
102130
102178
  try {
102131
102179
  const json2 = parseJSON(jsonText);
102132
- return { response: json2, status: response.status };
102180
+ return { response: json2, status: response.status, retryAfterMs };
102133
102181
  } catch {
102134
102182
  const rayId = extractWAFBlockRayId(response.headers);
102135
102183
  throw new APIError({
@@ -102144,13 +102192,18 @@ async function fetchInternalBase(complianceConfig, resource, init = {}, userAgen
102144
102192
  ...rayId ? [{ text: `Cloudflare Ray ID: ${rayId}` }] : []
102145
102193
  ],
102146
102194
  status: response.status,
102195
+ retryAfterMs,
102147
102196
  telemetryMessage: false
102148
102197
  });
102149
102198
  }
102150
102199
  }
102151
102200
  __name(fetchInternalBase, "fetchInternalBase");
102152
102201
  async function fetchResultBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
102153
- const { response: json2, status: status2 } = await fetchInternalBase(
102202
+ const {
102203
+ response: json2,
102204
+ status: status2,
102205
+ retryAfterMs
102206
+ } = await fetchInternalBase(
102154
102207
  complianceConfig,
102155
102208
  resource,
102156
102209
  init,
@@ -102163,7 +102216,7 @@ async function fetchResultBase(complianceConfig, resource, init = {}, userAgent,
102163
102216
  if (json2.success) {
102164
102217
  return json2.result;
102165
102218
  } else {
102166
- throwFetchError(resource, json2, status2);
102219
+ throwFetchError(resource, json2, status2, retryAfterMs);
102167
102220
  }
102168
102221
  }
102169
102222
  __name(fetchResultBase, "fetchResultBase");
@@ -102176,7 +102229,11 @@ async function fetchListResultBase(complianceConfig, resource, init = {}, userAg
102176
102229
  queryParams = new import_node_url2.URLSearchParams(queryParams);
102177
102230
  queryParams.set("cursor", cursor);
102178
102231
  }
102179
- const { response: json2, status: status2 } = await fetchInternalBase(
102232
+ const {
102233
+ response: json2,
102234
+ status: status2,
102235
+ retryAfterMs
102236
+ } = await fetchInternalBase(
102180
102237
  complianceConfig,
102181
102238
  resource,
102182
102239
  init,
@@ -102194,7 +102251,7 @@ async function fetchListResultBase(complianceConfig, resource, init = {}, userAg
102194
102251
  getMoreResults = false;
102195
102252
  }
102196
102253
  } else {
102197
- throwFetchError(resource, json2, status2);
102254
+ throwFetchError(resource, json2, status2, retryAfterMs);
102198
102255
  }
102199
102256
  }
102200
102257
  return results;
@@ -102212,6 +102269,24 @@ function isWAFBlockResponse(headers) {
102212
102269
  return headers.get("cf-mitigated") === "challenge";
102213
102270
  }
102214
102271
  __name(isWAFBlockResponse, "isWAFBlockResponse");
102272
+ function parseRetryAfterValue(retryAfter) {
102273
+ if (!retryAfter) {
102274
+ return void 0;
102275
+ }
102276
+ if (/^\d+$/.test(retryAfter.trim())) {
102277
+ return Number(retryAfter) * 1e3;
102278
+ }
102279
+ const retryAfterDate = new Date(retryAfter);
102280
+ if (!Number.isNaN(retryAfterDate.getTime())) {
102281
+ return Math.max(0, retryAfterDate.getTime() - Date.now());
102282
+ }
102283
+ return void 0;
102284
+ }
102285
+ __name(parseRetryAfterValue, "parseRetryAfterValue");
102286
+ function parseRetryAfterMs(headers) {
102287
+ return parseRetryAfterValue(headers.get("Retry-After"));
102288
+ }
102289
+ __name(parseRetryAfterMs, "parseRetryAfterMs");
102215
102290
  function extractWAFBlockRayId(headers) {
102216
102291
  return headers.get("cf-ray") ?? void 0;
102217
102292
  }
@@ -102291,7 +102366,7 @@ function escapeCharacter(character) {
102291
102366
  }).join("");
102292
102367
  }
102293
102368
  __name(escapeCharacter, "escapeCharacter");
102294
- function throwFetchError(resource, response, status2) {
102369
+ function throwFetchError(resource, response, status2, retryAfterMs) {
102295
102370
  const errors = response.errors ?? [];
102296
102371
  for (const error52 of errors) {
102297
102372
  maybeThrowFriendlyError(error52);
@@ -102309,10 +102384,19 @@ function throwFetchError(resource, response, status2) {
102309
102384
  notes.push({ text: fallbackMessage });
102310
102385
  }
102311
102386
  }
102387
+ if (retryAfterMs !== void 0) {
102388
+ notes.push({
102389
+ text: `The API responded with a "Retry-After" header indicating you should wait ${Math.ceil(retryAfterMs / 1e3)} second(s) before retrying.`
102390
+ });
102391
+ }
102312
102392
  const error512 = new APIError({
102313
102393
  text: `A request to the Cloudflare API (${resource}) failed.`,
102314
102394
  notes,
102315
102395
  status: status2,
102396
+ // hoist the parsed `Retry-After` header (if any) so consumers such as
102397
+ // `retryOnAPIFailure()` can back off for the amount of time the API
102398
+ // asked us to wait, e.g. when rate limited (HTTP 429).
102399
+ retryAfterMs,
102316
102400
  telemetryMessage: false
102317
102401
  });
102318
102402
  const code = errors[0]?.code;
@@ -102327,7 +102411,7 @@ function throwFetchError(resource, response, status2) {
102327
102411
  throw error512;
102328
102412
  }
102329
102413
  __name(throwFetchError, "throwFetchError");
102330
- function throwWAFBlockError(headers, method, resource, status2, statusText) {
102414
+ function throwWAFBlockError(headers, method, resource, status2, statusText, retryAfterMs) {
102331
102415
  const rayId = extractWAFBlockRayId(headers);
102332
102416
  throw new APIError({
102333
102417
  text: "The Cloudflare API responded with a WAF block page instead of the expected JSON response",
@@ -102344,6 +102428,7 @@ function throwWAFBlockError(headers, method, resource, status2, statusText) {
102344
102428
  }
102345
102429
  ],
102346
102430
  status: status2,
102431
+ retryAfterMs,
102347
102432
  telemetryMessage: false
102348
102433
  });
102349
102434
  }
@@ -102442,24 +102527,42 @@ ${url2}`
102442
102527
  }
102443
102528
  __name(handleBrowserOpenError, "handleBrowserOpenError");
102444
102529
  var MAX_ATTEMPTS = 3;
102530
+ var MAX_RETRY_AFTER_MS = 6e4;
102445
102531
  async function retryOnAPIFailure(action, logger, backoff = 0, attempts = MAX_ATTEMPTS, abortSignal) {
102446
102532
  try {
102447
102533
  return await action();
102448
102534
  } catch (err) {
102449
102535
  if (err instanceof APIError) {
102450
- if (!err.isRetryable()) {
102536
+ if (!err.isRetryable() && err.status !== 429) {
102451
102537
  throw err;
102452
102538
  }
102453
102539
  } else if (err instanceof DOMException && err.name === "TimeoutError") ;
102454
102540
  else if (!(err instanceof TypeError)) {
102455
102541
  throw err;
102456
102542
  }
102457
- logger.debug(`Retrying API call after error...`);
102458
- logger.debug(err);
102543
+ const retryAfterMs = err instanceof APIError ? err.retryAfterMs : void 0;
102544
+ if (retryAfterMs !== void 0 && retryAfterMs > MAX_RETRY_AFTER_MS) {
102545
+ throw err;
102546
+ }
102459
102547
  if (attempts <= 1) {
102460
102548
  throw err;
102461
102549
  }
102462
- await (0, import_promises2.setTimeout)(backoff, void 0, { signal: abortSignal });
102550
+ const jitter = Math.random() * 1e3;
102551
+ let wait = backoff;
102552
+ if (retryAfterMs !== void 0) {
102553
+ wait = retryAfterMs + jitter;
102554
+ } else if (err instanceof APIError && err.status === 429) {
102555
+ wait = Math.max(backoff, 1e3) + jitter;
102556
+ }
102557
+ if (retryAfterMs !== void 0) {
102558
+ logger.info(
102559
+ `Received a "Retry-After" header from the Cloudflare API. Waiting ${Math.ceil(retryAfterMs / 1e3)} second(s) before retrying...`
102560
+ );
102561
+ } else {
102562
+ logger.debug(`Retrying API call after error...`);
102563
+ logger.debug(err);
102564
+ }
102565
+ await (0, import_promises2.setTimeout)(wait, void 0, { signal: abortSignal });
102463
102566
  return retryOnAPIFailure(
102464
102567
  action,
102465
102568
  logger,
@@ -109455,7 +109558,7 @@ var Yargs = YargsFactory(esm_default2);
109455
109558
  var yargs_default = Yargs;
109456
109559
 
109457
109560
  // package.json
109458
- var version2 = "2.70.14";
109561
+ var version2 = "2.70.15";
109459
109562
 
109460
109563
  // src/metrics.ts
109461
109564
  var import_node_async_hooks = require("node:async_hooks");
@@ -112024,24 +112127,24 @@ __name2(getPropertyName, "getPropertyName");
112024
112127
  var package_default = {
112025
112128
  name: "frameworks_clis_info",
112026
112129
  dependencies: {
112027
- "@angular/create": "22.0.7",
112028
- "@tanstack/cli": "0.69.5",
112029
- "create-analog": "2.6.3",
112130
+ "@angular/create": "22.0.8",
112131
+ "@tanstack/cli": "0.70.1",
112132
+ "create-analog": "2.6.4",
112030
112133
  "create-astro": "5.2.2",
112031
112134
  "create-docusaurus": "3.10.2",
112032
112135
  "create-hono": "0.19.4",
112033
112136
  "create-next-app": "16.2.11",
112034
112137
  "create-qwik": "1.20.0",
112035
- "create-react-router": "8.2.0",
112138
+ "create-react-router": "8.3.0",
112036
112139
  "create-rwsdk": "3.1.3",
112037
- "create-solid": "0.7.0",
112038
- "create-vike": "0.0.664",
112140
+ "create-solid": "0.8.0",
112141
+ "create-vike": "0.0.668",
112039
112142
  "create-vite": "9.1.1",
112040
- "create-vue": "3.22.4",
112143
+ "create-vue": "3.23.0",
112041
112144
  "create-waku": "0.12.5-1.0.0-alpha.10-0",
112042
112145
  gatsby: "5.16.1",
112043
112146
  nuxi: "3.37.0",
112044
- sv: "0.16.3"
112147
+ sv: "0.16.5"
112045
112148
  },
112046
112149
  info: [
112047
112150
  "This package.json is only used to keep track of the frameworks cli dependencies",
@@ -114545,7 +114648,7 @@ If the application uses Durable Objects or Workflows, refer to the relevant best
114545
114648
  var import_node_assert6 = __toESM(require("node:assert"));
114546
114649
 
114547
114650
  // ../wrangler/package.json
114548
- var version3 = "4.114.0";
114651
+ var version3 = "4.115.0";
114549
114652
 
114550
114653
  // src/git.ts
114551
114654
  var offerGit = async (ctx) => {
@@ -114600,16 +114703,24 @@ var gitCommit = async (ctx) => {
114600
114703
  silent: true,
114601
114704
  cwd: ctx.project.path
114602
114705
  });
114706
+ } catch {
114707
+ s.stop(`${brandColor("git")} ${dim(`commit failed`)}`);
114708
+ updateStatus(
114709
+ "Failed to create initial commit. You can commit manually later."
114710
+ );
114711
+ return;
114712
+ }
114713
+ s.stop();
114714
+ try {
114603
114715
  await runCommand(
114604
114716
  ["git", "commit", "-m", ctx.commitMessage, "--no-verify"],
114605
114717
  {
114606
- silent: true,
114607
114718
  cwd: ctx.project.path
114608
114719
  }
114609
114720
  );
114610
- s.stop(`${brandColor("git")} ${dim(`commit`)}`);
114721
+ updateStatus(`${brandColor("git")} ${dim(`commit`)}`);
114611
114722
  } catch {
114612
- s.stop(`${brandColor("git")} ${dim(`commit failed`)}`);
114723
+ updateStatus(`${brandColor("git")} ${dim(`commit failed`)}`);
114613
114724
  updateStatus(
114614
114725
  "Failed to create initial commit. You can commit manually later."
114615
114726
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.70.14",
3
+ "version": "2.70.15",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -65,19 +65,19 @@
65
65
  "tree-kill": "1.2.2",
66
66
  "typescript": "5.8.3",
67
67
  "undici": "7.28.0",
68
- "vite": "8.0.13",
68
+ "vite": "8.1.5",
69
69
  "vite-tsconfig-paths": "^4.0.8",
70
70
  "vitest": "4.1.0",
71
71
  "which-pm-runs": "^1.1.0",
72
72
  "wrap-ansi": "^9.0.0",
73
73
  "yargs": "^17.7.2",
74
- "@cloudflare/cli-shared-helpers": "0.1.16",
75
- "@cloudflare/vite-plugin": "1.47.0",
74
+ "@cloudflare/codemod": "1.1.0",
75
+ "@cloudflare/cli-shared-helpers": "0.1.17",
76
76
  "@cloudflare/mock-npm-registry": "0.0.0",
77
+ "@cloudflare/vite-plugin": "1.48.0",
77
78
  "@cloudflare/workers-tsconfig": "0.0.0",
78
- "@cloudflare/workers-utils": "0.28.0",
79
- "@cloudflare/codemod": "1.1.0",
80
- "wrangler": "4.114.0"
79
+ "@cloudflare/workers-utils": "0.29.0",
80
+ "wrangler": "4.115.0"
81
81
  },
82
82
  "engines": {
83
83
  "node": ">=22.0.0"
@@ -22,13 +22,6 @@ import { WorkflowEntrypoint } from "cloudflare:workers";
22
22
  */
23
23
 
24
24
  export class MyWorkflow extends WorkflowEntrypoint {
25
- /**
26
- * @param {Env} env
27
- */
28
- constructor(env) {
29
- this.env = env;
30
- }
31
-
32
25
  /**
33
26
  * @param {WorkflowEvent<Params>} event
34
27
  * @param {WorkflowStep} step