create-cloudflare 2.73.4 → 2.74.0

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
@@ -3643,9 +3643,9 @@ var require_dispatcher_base = __commonJS({
3643
3643
  }
3644
3644
  close(callback) {
3645
3645
  if (callback === void 0) {
3646
- return new Promise((resolve15, reject) => {
3646
+ return new Promise((resolve16, reject) => {
3647
3647
  this.close((err, data) => {
3648
- return err ? reject(err) : resolve15(data);
3648
+ return err ? reject(err) : resolve16(data);
3649
3649
  });
3650
3650
  });
3651
3651
  }
@@ -3683,9 +3683,9 @@ var require_dispatcher_base = __commonJS({
3683
3683
  err = null;
3684
3684
  }
3685
3685
  if (callback === void 0) {
3686
- return new Promise((resolve15, reject) => {
3686
+ return new Promise((resolve16, reject) => {
3687
3687
  this.destroy(err, (err2, data) => {
3688
- return err2 ? reject(err2) : resolve15(data);
3688
+ return err2 ? reject(err2) : resolve16(data);
3689
3689
  });
3690
3690
  });
3691
3691
  }
@@ -7182,8 +7182,8 @@ var require_promise = __commonJS({
7182
7182
  function createDeferredPromise() {
7183
7183
  let res;
7184
7184
  let rej;
7185
- const promise2 = new Promise((resolve15, reject) => {
7186
- res = resolve15;
7185
+ const promise2 = new Promise((resolve16, reject) => {
7186
+ res = resolve16;
7187
7187
  rej = reject;
7188
7188
  });
7189
7189
  return { promise: promise2, resolve: res, reject: rej };
@@ -8586,12 +8586,12 @@ upgrade: ${upgrade}\r
8586
8586
  cb();
8587
8587
  }
8588
8588
  }
8589
- const waitForDrain = () => new Promise((resolve15, reject) => {
8589
+ const waitForDrain = () => new Promise((resolve16, reject) => {
8590
8590
  assert9(callback === null);
8591
8591
  if (socket[kError]) {
8592
8592
  reject(socket[kError]);
8593
8593
  } else {
8594
- callback = resolve15;
8594
+ callback = resolve16;
8595
8595
  }
8596
8596
  });
8597
8597
  socket.on("close", onDrain).on("drain", onDrain);
@@ -9467,12 +9467,12 @@ var require_client_h2 = __commonJS({
9467
9467
  cb();
9468
9468
  }
9469
9469
  }
9470
- const waitForDrain = () => new Promise((resolve15, reject) => {
9470
+ const waitForDrain = () => new Promise((resolve16, reject) => {
9471
9471
  assert9(callback === null);
9472
9472
  if (socket[kError]) {
9473
9473
  reject(socket[kError]);
9474
9474
  } else {
9475
- callback = resolve15;
9475
+ callback = resolve16;
9476
9476
  }
9477
9477
  });
9478
9478
  h2stream.on("close", onDrain).on("drain", onDrain);
@@ -9788,16 +9788,16 @@ var require_client = __commonJS({
9788
9788
  return this[kNeedDrain] < 2;
9789
9789
  }
9790
9790
  [kClose]() {
9791
- return new Promise((resolve15) => {
9791
+ return new Promise((resolve16) => {
9792
9792
  if (this[kSize]) {
9793
- this[kClosedResolve] = resolve15;
9793
+ this[kClosedResolve] = resolve16;
9794
9794
  } else {
9795
- resolve15(null);
9795
+ resolve16(null);
9796
9796
  }
9797
9797
  });
9798
9798
  }
9799
9799
  [kDestroy](err) {
9800
- return new Promise((resolve15) => {
9800
+ return new Promise((resolve16) => {
9801
9801
  const requests = this[kQueue].splice(this[kPendingIdx]);
9802
9802
  for (let i = 0; i < requests.length; i++) {
9803
9803
  const request2 = requests[i];
@@ -9810,7 +9810,7 @@ var require_client = __commonJS({
9810
9810
  this[kClosedResolve]();
9811
9811
  this[kClosedResolve] = null;
9812
9812
  }
9813
- resolve15(null);
9813
+ resolve16(null);
9814
9814
  };
9815
9815
  if (this[kHTTPContext]) {
9816
9816
  this[kHTTPContext].destroy(err, callback);
@@ -10217,8 +10217,8 @@ var require_pool_base = __commonJS({
10217
10217
  }
10218
10218
  return Promise.all(closeAll);
10219
10219
  } else {
10220
- return new Promise((resolve15) => {
10221
- this[kClosedResolve] = resolve15;
10220
+ return new Promise((resolve16) => {
10221
+ this[kClosedResolve] = resolve16;
10222
10222
  });
10223
10223
  }
10224
10224
  }
@@ -11337,7 +11337,7 @@ var require_socks5_proxy_agent = __commonJS({
11337
11337
  const proxyHost = this[kProxyUrl].hostname;
11338
11338
  const proxyPort = parseInt(this[kProxyUrl].port) || 1080;
11339
11339
  debug("creating SOCKS5 connection to", proxyHost, proxyPort);
11340
- const socket = await new Promise((resolve15, reject) => {
11340
+ const socket = await new Promise((resolve16, reject) => {
11341
11341
  this[kConnector]({
11342
11342
  hostname: proxyHost,
11343
11343
  host: proxyHost,
@@ -11347,7 +11347,7 @@ var require_socks5_proxy_agent = __commonJS({
11347
11347
  if (err) {
11348
11348
  reject(err);
11349
11349
  } else {
11350
- resolve15(socket2);
11350
+ resolve16(socket2);
11351
11351
  }
11352
11352
  });
11353
11353
  });
@@ -11357,14 +11357,14 @@ var require_socks5_proxy_agent = __commonJS({
11357
11357
  socket.destroy();
11358
11358
  });
11359
11359
  await socks5Client.handshake();
11360
- await new Promise((resolve15, reject) => {
11360
+ await new Promise((resolve16, reject) => {
11361
11361
  const timeout = setTimeout(() => {
11362
11362
  reject(new Error("SOCKS5 authentication timeout"));
11363
11363
  }, 5e3);
11364
11364
  const onAuthenticated = () => {
11365
11365
  clearTimeout(timeout);
11366
11366
  socks5Client.removeListener("error", onError);
11367
- resolve15();
11367
+ resolve16();
11368
11368
  };
11369
11369
  const onError = (err) => {
11370
11370
  clearTimeout(timeout);
@@ -11373,14 +11373,14 @@ var require_socks5_proxy_agent = __commonJS({
11373
11373
  };
11374
11374
  if (socks5Client.state === STATES.AUTHENTICATED) {
11375
11375
  clearTimeout(timeout);
11376
- resolve15();
11376
+ resolve16();
11377
11377
  } else {
11378
11378
  socks5Client.once("authenticated", onAuthenticated);
11379
11379
  socks5Client.once("error", onError);
11380
11380
  }
11381
11381
  });
11382
11382
  await socks5Client.connect(targetHost, targetPort);
11383
- await new Promise((resolve15, reject) => {
11383
+ await new Promise((resolve16, reject) => {
11384
11384
  const timeout = setTimeout(() => {
11385
11385
  reject(new Error("SOCKS5 connection timeout"));
11386
11386
  }, 5e3);
@@ -11388,7 +11388,7 @@ var require_socks5_proxy_agent = __commonJS({
11388
11388
  debug("SOCKS5 tunnel established to", targetHost, targetPort, "via", info);
11389
11389
  clearTimeout(timeout);
11390
11390
  socks5Client.removeListener("error", onError);
11391
- resolve15();
11391
+ resolve16();
11392
11392
  };
11393
11393
  const onError = (err) => {
11394
11394
  clearTimeout(timeout);
@@ -11431,8 +11431,8 @@ var require_socks5_proxy_agent = __commonJS({
11431
11431
  socket,
11432
11432
  servername: this[kRequestTls]?.servername || targetHost
11433
11433
  });
11434
- await new Promise((resolve15, reject) => {
11435
- finalSocket.once("secureConnect", resolve15);
11434
+ await new Promise((resolve16, reject) => {
11435
+ finalSocket.once("secureConnect", resolve16);
11436
11436
  finalSocket.once("error", reject);
11437
11437
  });
11438
11438
  }
@@ -12514,7 +12514,7 @@ var require_readable = __commonJS({
12514
12514
  if (this._readableState.closeEmitted) {
12515
12515
  return Promise.resolve(null);
12516
12516
  }
12517
- return new Promise((resolve15, reject) => {
12517
+ return new Promise((resolve16, reject) => {
12518
12518
  if (this[kContentLength] && this[kContentLength] > limit || this[kBytesRead] > limit) {
12519
12519
  this.destroy(new AbortError());
12520
12520
  }
@@ -12528,11 +12528,11 @@ var require_readable = __commonJS({
12528
12528
  if (signal.aborted) {
12529
12529
  reject(signal.reason ?? new AbortError());
12530
12530
  } else {
12531
- resolve15(null);
12531
+ resolve16(null);
12532
12532
  }
12533
12533
  });
12534
12534
  } else {
12535
- this.on("close", resolve15);
12535
+ this.on("close", resolve16);
12536
12536
  }
12537
12537
  this.on("error", noop).on("data", () => {
12538
12538
  if (this[kBytesRead] > limit) {
@@ -12560,7 +12560,7 @@ var require_readable = __commonJS({
12560
12560
  }
12561
12561
  function consume(stream, type) {
12562
12562
  assert9(!stream[kConsume]);
12563
- return new Promise((resolve15, reject) => {
12563
+ return new Promise((resolve16, reject) => {
12564
12564
  if (isUnusable(stream)) {
12565
12565
  const rState = stream._readableState;
12566
12566
  if (rState.destroyed && rState.closeEmitted === false) {
@@ -12575,7 +12575,7 @@ var require_readable = __commonJS({
12575
12575
  stream[kConsume] = {
12576
12576
  type,
12577
12577
  stream,
12578
- resolve: resolve15,
12578
+ resolve: resolve16,
12579
12579
  reject,
12580
12580
  length: 0,
12581
12581
  body: []
@@ -12649,18 +12649,18 @@ var require_readable = __commonJS({
12649
12649
  return buffer;
12650
12650
  }
12651
12651
  function consumeEnd(consume2, encoding) {
12652
- const { type, body, resolve: resolve15, stream, length } = consume2;
12652
+ const { type, body, resolve: resolve16, stream, length } = consume2;
12653
12653
  try {
12654
12654
  if (type === "text") {
12655
- resolve15(chunksDecode(body, length, encoding));
12655
+ resolve16(chunksDecode(body, length, encoding));
12656
12656
  } else if (type === "json") {
12657
- resolve15(JSON.parse(chunksDecode(body, length, encoding)));
12657
+ resolve16(JSON.parse(chunksDecode(body, length, encoding)));
12658
12658
  } else if (type === "arrayBuffer") {
12659
- resolve15(chunksConcat(body, length).buffer);
12659
+ resolve16(chunksConcat(body, length).buffer);
12660
12660
  } else if (type === "blob") {
12661
- resolve15(new Blob(body, { type: stream[kContentType] }));
12661
+ resolve16(new Blob(body, { type: stream[kContentType] }));
12662
12662
  } else if (type === "bytes") {
12663
- resolve15(chunksConcat(body, length));
12663
+ resolve16(chunksConcat(body, length));
12664
12664
  }
12665
12665
  consumeFinish(consume2);
12666
12666
  } catch (err) {
@@ -12850,9 +12850,9 @@ var require_api_request = __commonJS({
12850
12850
  };
12851
12851
  function request2(opts, callback) {
12852
12852
  if (callback === void 0) {
12853
- return new Promise((resolve15, reject) => {
12853
+ return new Promise((resolve16, reject) => {
12854
12854
  request2.call(this, opts, (err, data) => {
12855
- return err ? reject(err) : resolve15(data);
12855
+ return err ? reject(err) : resolve16(data);
12856
12856
  });
12857
12857
  });
12858
12858
  }
@@ -13064,9 +13064,9 @@ var require_api_stream = __commonJS({
13064
13064
  };
13065
13065
  function stream(opts, factory, callback) {
13066
13066
  if (callback === void 0) {
13067
- return new Promise((resolve15, reject) => {
13067
+ return new Promise((resolve16, reject) => {
13068
13068
  stream.call(this, opts, factory, (err, data) => {
13069
- return err ? reject(err) : resolve15(data);
13069
+ return err ? reject(err) : resolve16(data);
13070
13070
  });
13071
13071
  });
13072
13072
  }
@@ -13354,9 +13354,9 @@ var require_api_upgrade = __commonJS({
13354
13354
  };
13355
13355
  function upgrade(opts, callback) {
13356
13356
  if (callback === void 0) {
13357
- return new Promise((resolve15, reject) => {
13357
+ return new Promise((resolve16, reject) => {
13358
13358
  upgrade.call(this, opts, (err, data) => {
13359
- return err ? reject(err) : resolve15(data);
13359
+ return err ? reject(err) : resolve16(data);
13360
13360
  });
13361
13361
  });
13362
13362
  }
@@ -13449,9 +13449,9 @@ var require_api_connect = __commonJS({
13449
13449
  };
13450
13450
  function connect(opts, callback) {
13451
13451
  if (callback === void 0) {
13452
- return new Promise((resolve15, reject) => {
13452
+ return new Promise((resolve16, reject) => {
13453
13453
  connect.call(this, opts, (err, data) => {
13454
- return err ? reject(err) : resolve15(data);
13454
+ return err ? reject(err) : resolve16(data);
13455
13455
  });
13456
13456
  });
13457
13457
  }
@@ -14725,7 +14725,7 @@ var require_snapshot_recorder = __commonJS({
14725
14725
  "../../node_modules/.pnpm/undici@7.29.1/node_modules/undici/lib/mock/snapshot-recorder.js"(exports2, module2) {
14726
14726
  "use strict";
14727
14727
  var { writeFile: writeFile5, readFile: readFile3, mkdir: mkdir2 } = require("node:fs/promises");
14728
- var { dirname: dirname8, resolve: resolve15 } = require("node:path");
14728
+ var { dirname: dirname8, resolve: resolve16 } = require("node:path");
14729
14729
  var { setTimeout: setTimeout6, clearTimeout: clearTimeout2 } = require("node:timers");
14730
14730
  var { InvalidArgumentError, UndiciError } = require_errors();
14731
14731
  var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
@@ -14926,7 +14926,7 @@ var require_snapshot_recorder = __commonJS({
14926
14926
  throw new InvalidArgumentError("Snapshot path is required");
14927
14927
  }
14928
14928
  try {
14929
- const data = await readFile3(resolve15(path9), "utf8");
14929
+ const data = await readFile3(resolve16(path9), "utf8");
14930
14930
  const parsed = JSON.parse(data);
14931
14931
  if (Array.isArray(parsed)) {
14932
14932
  this.#snapshots.clear();
@@ -14955,7 +14955,7 @@ var require_snapshot_recorder = __commonJS({
14955
14955
  if (!path9) {
14956
14956
  throw new InvalidArgumentError("Snapshot path is required");
14957
14957
  }
14958
- const resolvedPath = resolve15(path9);
14958
+ const resolvedPath = resolve16(path9);
14959
14959
  await mkdir2(dirname8(resolvedPath), { recursive: true });
14960
14960
  const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
14961
14961
  hash: hash2,
@@ -22381,7 +22381,7 @@ var require_fetch = __commonJS({
22381
22381
  const agent = fetchParams.controller.dispatcher;
22382
22382
  const path9 = url2.pathname + url2.search;
22383
22383
  const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
22384
- return new Promise((resolve15, reject) => agent.dispatch(
22384
+ return new Promise((resolve16, reject) => agent.dispatch(
22385
22385
  {
22386
22386
  path: hasTrailingQuestionMark ? `${path9}?` : path9,
22387
22387
  origin: url2.origin,
@@ -22469,7 +22469,7 @@ var require_fetch = __commonJS({
22469
22469
  }
22470
22470
  }
22471
22471
  const onError = this.onError.bind(this);
22472
- resolve15({
22472
+ resolve16({
22473
22473
  status: status2,
22474
22474
  statusText,
22475
22475
  headersList,
@@ -22522,7 +22522,7 @@ var require_fetch = __commonJS({
22522
22522
  headersList.append(headerName, String(value), true);
22523
22523
  }
22524
22524
  }
22525
- resolve15({
22525
+ resolve16({
22526
22526
  status: status2,
22527
22527
  statusText: STATUS_CODES[status2],
22528
22528
  headersList,
@@ -22546,7 +22546,7 @@ var require_fetch = __commonJS({
22546
22546
  headersList.append(nameStr, value.toString("latin1"), true);
22547
22547
  }
22548
22548
  }
22549
- resolve15({
22549
+ resolve16({
22550
22550
  status: status2,
22551
22551
  statusText: STATUS_CODES[status2],
22552
22552
  headersList,
@@ -27286,19 +27286,19 @@ var init_open_PCXX3ZDZ = __esm({
27286
27286
  }
27287
27287
  const subprocess = import_node_child_process.default.spawn(command2, cliArguments, childProcessOptions);
27288
27288
  if (options.wait) {
27289
- return new Promise((resolve15, reject) => {
27289
+ return new Promise((resolve16, reject) => {
27290
27290
  subprocess.once("error", reject);
27291
27291
  subprocess.once("close", (exitCode) => {
27292
27292
  if (!options.allowNonzeroExitCode && exitCode !== 0) {
27293
27293
  reject(new Error(`Exited with code ${exitCode}`));
27294
27294
  return;
27295
27295
  }
27296
- resolve15(subprocess);
27296
+ resolve16(subprocess);
27297
27297
  });
27298
27298
  });
27299
27299
  }
27300
27300
  if (isFallbackAttempt) {
27301
- return new Promise((resolve15, reject) => {
27301
+ return new Promise((resolve16, reject) => {
27302
27302
  subprocess.once("error", reject);
27303
27303
  subprocess.once("spawn", () => {
27304
27304
  subprocess.once("close", (exitCode) => {
@@ -27308,17 +27308,17 @@ var init_open_PCXX3ZDZ = __esm({
27308
27308
  return;
27309
27309
  }
27310
27310
  subprocess.unref();
27311
- resolve15(subprocess);
27311
+ resolve16(subprocess);
27312
27312
  });
27313
27313
  });
27314
27314
  });
27315
27315
  }
27316
27316
  subprocess.unref();
27317
- return new Promise((resolve15, reject) => {
27317
+ return new Promise((resolve16, reject) => {
27318
27318
  subprocess.once("error", reject);
27319
27319
  subprocess.once("spawn", () => {
27320
27320
  subprocess.off("error", reject);
27321
- resolve15(subprocess);
27321
+ resolve16(subprocess);
27322
27322
  });
27323
27323
  });
27324
27324
  }, "baseOpen");
@@ -27489,12 +27489,12 @@ var require_isexe = __commonJS({
27489
27489
  if (typeof Promise !== "function") {
27490
27490
  throw new TypeError("callback not provided");
27491
27491
  }
27492
- return new Promise(function(resolve15, reject) {
27492
+ return new Promise(function(resolve16, reject) {
27493
27493
  isexe(path9, options || {}, function(er, is) {
27494
27494
  if (er) {
27495
27495
  reject(er);
27496
27496
  } else {
27497
- resolve15(is);
27497
+ resolve16(is);
27498
27498
  }
27499
27499
  });
27500
27500
  });
@@ -27560,27 +27560,27 @@ var require_which = __commonJS({
27560
27560
  opt = {};
27561
27561
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
27562
27562
  const found = [];
27563
- const step = (i) => new Promise((resolve15, reject) => {
27563
+ const step = (i) => new Promise((resolve16, reject) => {
27564
27564
  if (i === pathEnv.length)
27565
- return opt.all && found.length ? resolve15(found) : reject(getNotFoundError(cmd));
27565
+ return opt.all && found.length ? resolve16(found) : reject(getNotFoundError(cmd));
27566
27566
  const ppRaw = pathEnv[i];
27567
27567
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
27568
27568
  const pCmd = path9.join(pathPart, cmd);
27569
27569
  const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
27570
- resolve15(subStep(p2, i, 0));
27570
+ resolve16(subStep(p2, i, 0));
27571
27571
  });
27572
- const subStep = (p2, i, ii) => new Promise((resolve15, reject) => {
27572
+ const subStep = (p2, i, ii) => new Promise((resolve16, reject) => {
27573
27573
  if (ii === pathExt.length)
27574
- return resolve15(step(i + 1));
27574
+ return resolve16(step(i + 1));
27575
27575
  const ext = pathExt[ii];
27576
27576
  isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
27577
27577
  if (!er && is) {
27578
27578
  if (opt.all)
27579
27579
  found.push(p2 + ext);
27580
27580
  else
27581
- return resolve15(p2 + ext);
27581
+ return resolve16(p2 + ext);
27582
27582
  }
27583
- return resolve15(subStep(p2, i, ii + 1));
27583
+ return resolve16(subStep(p2, i, ii + 1));
27584
27584
  });
27585
27585
  });
27586
27586
  return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
@@ -30664,9 +30664,9 @@ var require_index_688c5d50 = __commonJS({
30664
30664
  }
30665
30665
  // stream.promise().then(() => done, er => emitted error)
30666
30666
  promise() {
30667
- return new Promise((resolve16, reject) => {
30667
+ return new Promise((resolve17, reject) => {
30668
30668
  this.on(DESTROYED, () => reject(new Error("stream destroyed")));
30669
- this.on("end", () => resolve16());
30669
+ this.on("end", () => resolve17());
30670
30670
  this.on("error", (er) => reject(er));
30671
30671
  });
30672
30672
  }
@@ -30678,7 +30678,7 @@ var require_index_688c5d50 = __commonJS({
30678
30678
  return Promise.resolve({ done: false, value: res });
30679
30679
  if (this[EOF$1])
30680
30680
  return Promise.resolve({ done: true });
30681
- let resolve16 = null;
30681
+ let resolve17 = null;
30682
30682
  let reject = null;
30683
30683
  const onerr = (er) => {
30684
30684
  this.removeListener("data", ondata);
@@ -30689,17 +30689,17 @@ var require_index_688c5d50 = __commonJS({
30689
30689
  this.removeListener("error", onerr);
30690
30690
  this.removeListener("end", onend);
30691
30691
  this.pause();
30692
- resolve16({ value, done: !!this[EOF$1] });
30692
+ resolve17({ value, done: !!this[EOF$1] });
30693
30693
  };
30694
30694
  const onend = () => {
30695
30695
  this.removeListener("error", onerr);
30696
30696
  this.removeListener("data", ondata);
30697
- resolve16({ done: true });
30697
+ resolve17({ done: true });
30698
30698
  };
30699
30699
  const ondestroy = () => onerr(new Error("stream destroyed"));
30700
30700
  return new Promise((res2, rej) => {
30701
30701
  reject = rej;
30702
- resolve16 = res2;
30702
+ resolve17 = res2;
30703
30703
  this.once(DESTROYED, ondestroy);
30704
30704
  this.once("error", onerr);
30705
30705
  this.once("end", onend);
@@ -33126,9 +33126,9 @@ var require_index_688c5d50 = __commonJS({
33126
33126
  const parse11 = new parse$4(opt);
33127
33127
  const readSize = opt.maxReadSize || 16 * 1024 * 1024;
33128
33128
  const file3 = opt.file;
33129
- const p2 = new Promise((resolve16, reject) => {
33129
+ const p2 = new Promise((resolve17, reject) => {
33130
33130
  parse11.on("error", reject);
33131
- parse11.on("end", resolve16);
33131
+ parse11.on("end", resolve17);
33132
33132
  fs__default["default"].stat(file3, (er, stat) => {
33133
33133
  if (er)
33134
33134
  reject(er);
@@ -33339,7 +33339,7 @@ var require_index_688c5d50 = __commonJS({
33339
33339
  };
33340
33340
  fs__default["default"].read(fd, headBuf, 0, 512, position, onread);
33341
33341
  };
33342
- const promise2 = new Promise((resolve16, reject) => {
33342
+ const promise2 = new Promise((resolve17, reject) => {
33343
33343
  p2.on("error", reject);
33344
33344
  let flag = "r+";
33345
33345
  const onopen = (er, fd) => {
@@ -33361,7 +33361,7 @@ var require_index_688c5d50 = __commonJS({
33361
33361
  });
33362
33362
  p2.pipe(stream);
33363
33363
  stream.on("error", reject);
33364
- stream.on("close", resolve16);
33364
+ stream.on("close", resolve17);
33365
33365
  addFilesAsync(p2, files);
33366
33366
  });
33367
33367
  });
@@ -33438,7 +33438,7 @@ var require_index_688c5d50 = __commonJS({
33438
33438
  };
33439
33439
  var optsArg_1 = optsArg;
33440
33440
  var platform$2 = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform;
33441
- var { resolve: resolve15, parse: parse$3 } = path__default2["default"];
33441
+ var { resolve: resolve16, parse: parse$3 } = path__default2["default"];
33442
33442
  var pathArg = (path10) => {
33443
33443
  if (/\0/.test(path10)) {
33444
33444
  throw Object.assign(
@@ -33449,7 +33449,7 @@ var require_index_688c5d50 = __commonJS({
33449
33449
  }
33450
33450
  );
33451
33451
  }
33452
- path10 = resolve15(path10);
33452
+ path10 = resolve16(path10);
33453
33453
  if (platform$2 === "win32") {
33454
33454
  const badWinChars = /[*|"<>?:]/;
33455
33455
  const { root } = parse$3(path10);
@@ -33879,8 +33879,8 @@ var require_index_688c5d50 = __commonJS({
33879
33879
  var pathReservations = () => {
33880
33880
  const queues = /* @__PURE__ */ new Map();
33881
33881
  const reservations = /* @__PURE__ */ new Map();
33882
- const { join: join11 } = path__default2["default"];
33883
- const getDirs = (path10) => join11(path10).split(/[\\/]/).slice(0, -1).reduce((set2, path11) => set2.length ? set2.concat(join11(set2[set2.length - 1], path11)) : [path11], []);
33882
+ const { join: join14 } = path__default2["default"];
33883
+ const getDirs = (path10) => join14(path10).split(/[\\/]/).slice(0, -1).reduce((set2, path11) => set2.length ? set2.concat(join14(set2[set2.length - 1], path11)) : [path11], []);
33884
33884
  const running = /* @__PURE__ */ new Set();
33885
33885
  const getQueues = (fn) => {
33886
33886
  const res = reservations.get(fn);
@@ -34528,9 +34528,9 @@ var require_index_688c5d50 = __commonJS({
34528
34528
  const u2 = new unpack(opt);
34529
34529
  const readSize = opt.maxReadSize || 16 * 1024 * 1024;
34530
34530
  const file3 = opt.file;
34531
- const p2 = new Promise((resolve16, reject) => {
34531
+ const p2 = new Promise((resolve17, reject) => {
34532
34532
  u2.on("error", reject);
34533
- u2.on("close", resolve16);
34533
+ u2.on("close", resolve17);
34534
34534
  fs__default["default"].stat(file3, (er, stat) => {
34535
34535
  if (er)
34536
34536
  reject(er);
@@ -36062,10 +36062,10 @@ var require_index_688c5d50 = __commonJS({
36062
36062
  process.cwd();
36063
36063
  } catch (er) {
36064
36064
  }
36065
- var chdir2 = process.chdir;
36065
+ var chdir3 = process.chdir;
36066
36066
  process.chdir = function(d3) {
36067
36067
  cwd = null;
36068
- chdir2.call(process, d3);
36068
+ chdir3.call(process, d3);
36069
36069
  };
36070
36070
  var polyfills = patch;
36071
36071
  function patch(fs11) {
@@ -39845,12 +39845,12 @@ var require_index_688c5d50 = __commonJS({
39845
39845
  });
39846
39846
  function promisify8(fn) {
39847
39847
  return function(req, opts) {
39848
- return new Promise((resolve16, reject) => {
39848
+ return new Promise((resolve17, reject) => {
39849
39849
  fn.call(this, req, opts, (err, rtn) => {
39850
39850
  if (err) {
39851
39851
  reject(err);
39852
39852
  } else {
39853
- resolve16(rtn);
39853
+ resolve17(rtn);
39854
39854
  }
39855
39855
  });
39856
39856
  });
@@ -40041,7 +40041,7 @@ var require_index_688c5d50 = __commonJS({
40041
40041
  var debug_1$1 = __importDefault$2(src$1);
40042
40042
  var debug$1 = debug_1$1.default("https-proxy-agent:parse-proxy-response");
40043
40043
  function parseProxyResponse(socket) {
40044
- return new Promise((resolve16, reject) => {
40044
+ return new Promise((resolve17, reject) => {
40045
40045
  let buffersLength = 0;
40046
40046
  const buffers = [];
40047
40047
  function read() {
@@ -40081,7 +40081,7 @@ var require_index_688c5d50 = __commonJS({
40081
40081
  const firstLine = buffered.toString("ascii", 0, buffered.indexOf("\r\n"));
40082
40082
  const statusCode = +firstLine.split(" ")[1];
40083
40083
  debug$1("got proxy server response: %o", firstLine);
40084
- resolve16({
40084
+ resolve17({
40085
40085
  statusCode,
40086
40086
  buffered
40087
40087
  });
@@ -40098,11 +40098,11 @@ var require_index_688c5d50 = __commonJS({
40098
40098
  }, "__esModule", { value: true });
40099
40099
  var __awaiter2 = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P2, generator) {
40100
40100
  function adopt(value) {
40101
- return value instanceof P2 ? value : new P2(function(resolve16) {
40102
- resolve16(value);
40101
+ return value instanceof P2 ? value : new P2(function(resolve17) {
40102
+ resolve17(value);
40103
40103
  });
40104
40104
  }
40105
- return new (P2 || (P2 = Promise))(function(resolve16, reject) {
40105
+ return new (P2 || (P2 = Promise))(function(resolve17, reject) {
40106
40106
  function fulfilled(value) {
40107
40107
  try {
40108
40108
  step(generator.next(value));
@@ -40118,7 +40118,7 @@ var require_index_688c5d50 = __commonJS({
40118
40118
  }
40119
40119
  }
40120
40120
  function step(result) {
40121
- result.done ? resolve16(result.value) : adopt(result.value).then(fulfilled, rejected);
40121
+ result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
40122
40122
  }
40123
40123
  step((generator = generator.apply(thisArg, _arguments || [])).next());
40124
40124
  });
@@ -49089,10 +49089,10 @@ var require_stringify2 = __commonJS({
49089
49089
  replacer = null;
49090
49090
  indent2 = EMPTY;
49091
49091
  };
49092
- var join11 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + LF + gap : two ? two.trimRight() + LF + gap : EMPTY;
49092
+ var join14 = (one, two, gap) => one ? two ? one + two.trim() + LF + gap : one.trimRight() + LF + gap : two ? two.trimRight() + LF + gap : EMPTY;
49093
49093
  var join_content = (inside, value, gap) => {
49094
49094
  const comment = process_comments(value, PREFIX_BEFORE, gap + indent2, true);
49095
- return join11(comment, inside, gap);
49095
+ return join14(comment, inside, gap);
49096
49096
  };
49097
49097
  var array_stringify = (value, gap) => {
49098
49098
  const deeper_gap = gap + indent2;
@@ -49103,7 +49103,7 @@ var require_stringify2 = __commonJS({
49103
49103
  if (i !== 0) {
49104
49104
  inside += COMMA;
49105
49105
  }
49106
- const before = join11(
49106
+ const before = join14(
49107
49107
  after_comma,
49108
49108
  process_comments(value, BEFORE(i), deeper_gap),
49109
49109
  deeper_gap
@@ -49113,7 +49113,7 @@ var require_stringify2 = __commonJS({
49113
49113
  inside += process_comments(value, AFTER_VALUE(i), deeper_gap);
49114
49114
  after_comma = process_comments(value, AFTER(i), deeper_gap);
49115
49115
  }
49116
- inside += join11(
49116
+ inside += join14(
49117
49117
  after_comma,
49118
49118
  process_comments(value, PREFIX_AFTER, deeper_gap),
49119
49119
  deeper_gap
@@ -49138,7 +49138,7 @@ var require_stringify2 = __commonJS({
49138
49138
  inside += COMMA;
49139
49139
  }
49140
49140
  first = false;
49141
- const before = join11(
49141
+ const before = join14(
49142
49142
  after_comma,
49143
49143
  process_comments(value, BEFORE(key), deeper_gap),
49144
49144
  deeper_gap
@@ -49148,7 +49148,7 @@ var require_stringify2 = __commonJS({
49148
49148
  after_comma = process_comments(value, AFTER(key), deeper_gap);
49149
49149
  };
49150
49150
  keys.forEach(iteratee);
49151
- inside += join11(
49151
+ inside += join14(
49152
49152
  after_comma,
49153
49153
  process_comments(value, PREFIX_AFTER, deeper_gap),
49154
49154
  deeper_gap
@@ -49369,11 +49369,11 @@ function __metadata(metadataKey, metadataValue) {
49369
49369
  }
49370
49370
  function __awaiter(thisArg, _arguments, P2, generator) {
49371
49371
  function adopt(value) {
49372
- return value instanceof P2 ? value : new P2(function(resolve15) {
49373
- resolve15(value);
49372
+ return value instanceof P2 ? value : new P2(function(resolve16) {
49373
+ resolve16(value);
49374
49374
  });
49375
49375
  }
49376
- return new (P2 || (P2 = Promise))(function(resolve15, reject) {
49376
+ return new (P2 || (P2 = Promise))(function(resolve16, reject) {
49377
49377
  function fulfilled(value) {
49378
49378
  try {
49379
49379
  step(generator.next(value));
@@ -49389,7 +49389,7 @@ function __awaiter(thisArg, _arguments, P2, generator) {
49389
49389
  }
49390
49390
  }
49391
49391
  function step(result) {
49392
- result.done ? resolve15(result.value) : adopt(result.value).then(fulfilled, rejected);
49392
+ result.done ? resolve16(result.value) : adopt(result.value).then(fulfilled, rejected);
49393
49393
  }
49394
49394
  step((generator = generator.apply(thisArg, _arguments || [])).next());
49395
49395
  });
@@ -49580,14 +49580,14 @@ function __asyncValues(o) {
49580
49580
  }, i);
49581
49581
  function verb(n) {
49582
49582
  i[n] = o[n] && function(v) {
49583
- return new Promise(function(resolve15, reject) {
49584
- v = o[n](v), settle2(resolve15, reject, v.done, v.value);
49583
+ return new Promise(function(resolve16, reject) {
49584
+ v = o[n](v), settle2(resolve16, reject, v.done, v.value);
49585
49585
  });
49586
49586
  };
49587
49587
  }
49588
- function settle2(resolve15, reject, d2, v) {
49588
+ function settle2(resolve16, reject, d2, v) {
49589
49589
  Promise.resolve(v).then(function(v2) {
49590
- resolve15({ value: v2, done: d2 });
49590
+ resolve16({ value: v2, done: d2 });
49591
49591
  }, reject);
49592
49592
  }
49593
49593
  }
@@ -53443,7 +53443,7 @@ var require_util8 = __commonJS({
53443
53443
  return path9;
53444
53444
  }
53445
53445
  exports2.normalize = normalize2;
53446
- function join11(aRoot, aPath) {
53446
+ function join14(aRoot, aPath) {
53447
53447
  if (aRoot === "") {
53448
53448
  aRoot = ".";
53449
53449
  }
@@ -53475,7 +53475,7 @@ var require_util8 = __commonJS({
53475
53475
  }
53476
53476
  return joined;
53477
53477
  }
53478
- exports2.join = join11;
53478
+ exports2.join = join14;
53479
53479
  exports2.isAbsolute = function(aPath) {
53480
53480
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
53481
53481
  };
@@ -53648,7 +53648,7 @@ var require_util8 = __commonJS({
53648
53648
  parsed.path = parsed.path.substring(0, index + 1);
53649
53649
  }
53650
53650
  }
53651
- sourceURL = join11(urlGenerate(parsed), sourceURL);
53651
+ sourceURL = join14(urlGenerate(parsed), sourceURL);
53652
53652
  }
53653
53653
  return normalize2(sourceURL);
53654
53654
  }
@@ -74512,12 +74512,12 @@ var require_packet = __commonJS({
74512
74512
  let chunklen = 0;
74513
74513
  let received = false;
74514
74514
  let expected = false;
74515
- return new Promise((resolve15, reject) => {
74515
+ return new Promise((resolve16, reject) => {
74516
74516
  const processMessage = () => {
74517
74517
  if (received) return;
74518
74518
  received = true;
74519
74519
  const buffer = Buffer.concat(chunks, chunklen);
74520
- resolve15(buffer.slice(2));
74520
+ resolve16(buffer.slice(2));
74521
74521
  };
74522
74522
  socket.on("end", processMessage);
74523
74523
  socket.on("error", reject);
@@ -74579,15 +74579,15 @@ var require_udp = __commonJS({
74579
74579
  if (message instanceof Packet) {
74580
74580
  message = message.toBuffer();
74581
74581
  }
74582
- return new Promise((resolve15, reject) => {
74582
+ return new Promise((resolve16, reject) => {
74583
74583
  this.send(message, rinfo.port, rinfo.address, (err) => {
74584
74584
  if (err) return reject(err);
74585
- resolve15(message);
74585
+ resolve16(message);
74586
74586
  });
74587
74587
  });
74588
74588
  }
74589
74589
  listen(port, address) {
74590
- return new Promise((resolve15) => this.bind(port, address, resolve15));
74590
+ return new Promise((resolve16) => this.bind(port, address, resolve16));
74591
74591
  }
74592
74592
  };
74593
74593
  module2.exports = Server;
@@ -74649,11 +74649,11 @@ var require_doh = __commonJS({
74649
74649
  }
74650
74650
  return queryData;
74651
74651
  };
74652
- var readStream = (stream) => new Promise((resolve15, reject) => {
74652
+ var readStream = (stream) => new Promise((resolve16, reject) => {
74653
74653
  let buffer = "";
74654
74654
  stream.on("error", reject).on("data", (chunk) => {
74655
74655
  buffer += chunk;
74656
- }).on("end", () => resolve15(buffer));
74656
+ }).on("end", () => resolve16(buffer));
74657
74657
  });
74658
74658
  var Server = class extends EventEmitter {
74659
74659
  constructor(options) {
@@ -74779,12 +74779,12 @@ var require_dns2 = __commonJS({
74779
74779
  }
74780
74780
  const servers = Object.values(this.servers);
74781
74781
  this.closed = Promise.all(
74782
- servers.map((server) => new Promise((resolve15) => server.once("close", resolve15)))
74782
+ servers.map((server) => new Promise((resolve16) => server.once("close", resolve16)))
74783
74783
  ).then(() => {
74784
74784
  this.emit("close");
74785
74785
  });
74786
74786
  this.listening = Promise.all(
74787
- servers.map((server) => new Promise((resolve15) => server.once("listening", resolve15)))
74787
+ servers.map((server) => new Promise((resolve16) => server.once("listening", resolve16)))
74788
74788
  ).then(() => {
74789
74789
  const addresses = this.addresses();
74790
74790
  this.emit("listening", addresses);
@@ -74916,18 +74916,18 @@ var require_tcp2 = __commonJS({
74916
74916
  var require_doh2 = __commonJS({
74917
74917
  "../../node_modules/.pnpm/dns2@2.1.0/node_modules/dns2/client/doh.js"(exports2, module2) {
74918
74918
  var Packet = require_packet();
74919
- var defaultGet = (url2) => new Promise((resolve15, reject) => {
74919
+ var defaultGet = (url2) => new Promise((resolve16, reject) => {
74920
74920
  const headers = {
74921
74921
  accept: "application/dns-message"
74922
74922
  };
74923
74923
  const base = url2.startsWith("https") ? require("https") : require("http");
74924
- const req = base.get(url2, { headers }, resolve15);
74924
+ const req = base.get(url2, { headers }, resolve16);
74925
74925
  req.on("error", reject);
74926
74926
  });
74927
74927
  var readStream = (stream) => {
74928
74928
  const buffer = [];
74929
- return new Promise((resolve15, reject) => {
74930
- stream.on("error", reject).on("data", (chunk) => buffer.push(chunk)).on("end", () => resolve15(Buffer.concat(buffer)));
74929
+ return new Promise((resolve16, reject) => {
74930
+ stream.on("error", reject).on("data", (chunk) => buffer.push(chunk)).on("end", () => resolve16(Buffer.concat(buffer)));
74931
74931
  });
74932
74932
  };
74933
74933
  var DOHClient = ({ dns, http, get = defaultGet } = {}) => {
@@ -74980,12 +74980,12 @@ var require_udp2 = __commonJS({
74980
74980
  type: Packet.TYPE[type]
74981
74981
  });
74982
74982
  const client = new udp.Socket(socketType);
74983
- return new Promise((resolve15, reject) => {
74983
+ return new Promise((resolve16, reject) => {
74984
74984
  client.once("message", function onMessage(message) {
74985
74985
  client.close();
74986
74986
  const response = Packet.parse(message);
74987
74987
  equal(response.header.id, query.header.id);
74988
- resolve15(response);
74988
+ resolve16(response);
74989
74989
  });
74990
74990
  debug("send", dns, query.toBuffer());
74991
74991
  client.send(query.toBuffer(), port, dns, (err) => err && reject(err));
@@ -74999,13 +74999,13 @@ var require_udp2 = __commonJS({
74999
74999
  var require_google = __commonJS({
75000
75000
  "../../node_modules/.pnpm/dns2@2.1.0/node_modules/dns2/client/google.js"(exports2, module2) {
75001
75001
  var https = require("https");
75002
- var get = (url2) => new Promise((resolve15) => https.get(url2, resolve15));
75002
+ var get = (url2) => new Promise((resolve16) => https.get(url2, resolve16));
75003
75003
  var readStream = (stream) => {
75004
75004
  const buffer = [];
75005
- return new Promise((resolve15, reject) => {
75005
+ return new Promise((resolve16, reject) => {
75006
75006
  stream.on("error", reject).on("data", (chunk) => {
75007
75007
  buffer.push(chunk);
75008
- }).on("end", () => resolve15(Buffer.concat(buffer)));
75008
+ }).on("end", () => resolve16(Buffer.concat(buffer)));
75009
75009
  });
75010
75010
  };
75011
75011
  var GoogleClient = () => (name3, type = "ANY") => {
@@ -75066,8 +75066,8 @@ var require_dns22 = __commonJS({
75066
75066
  const { port, nameServers, recursive: recursive2, resolverProtocol = "UDP" } = this;
75067
75067
  const createResolver = _DNS[resolverProtocol + "Client"];
75068
75068
  return Promise.race(nameServers.map((address) => {
75069
- const resolve15 = createResolver({ dns: address, port, recursive: recursive2 });
75070
- return resolve15(name3, type, cls, clientIp);
75069
+ const resolve16 = createResolver({ dns: address, port, recursive: recursive2 });
75070
+ return resolve16(name3, type, cls, clientIp);
75071
75071
  }));
75072
75072
  }
75073
75073
  /**
@@ -75115,13 +75115,10 @@ var require_dns22 = __commonJS({
75115
75115
  var cli_exports = {};
75116
75116
  __export(cli_exports, {
75117
75117
  main: () => main,
75118
- runCli: () => runCli,
75119
- setupProjectDirectory: () => setupProjectDirectory
75118
+ runCli: () => runCli
75120
75119
  });
75121
75120
  module.exports = __toCommonJS(cli_exports);
75122
- var import_node_fs24 = require("node:fs");
75123
- var import_node_path28 = require("node:path");
75124
- var import_node_process15 = require("node:process");
75121
+ var import_node_process16 = require("node:process");
75125
75122
 
75126
75123
  // ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js
75127
75124
  var ANSI_BACKGROUND_OFFSET = 10;
@@ -82897,7 +82894,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
82897
82894
  var NONE = 0;
82898
82895
  var ASSUMED = 1;
82899
82896
  var PROVEN = 2;
82900
- function isRecursive(inst, stack, resolve15) {
82897
+ function isRecursive(inst, stack, resolve16) {
82901
82898
  const cached2 = recursive.get(inst);
82902
82899
  if (cached2 !== void 0)
82903
82900
  return cached2 ? PROVEN : NONE;
@@ -82907,7 +82904,7 @@ function isRecursive(inst, stack, resolve15) {
82907
82904
  let result = NONE;
82908
82905
  const check2 = /* @__PURE__ */ __name((child) => {
82909
82906
  if (result !== PROVEN && child?._zod) {
82910
- const answer = isRecursive(child, stack, resolve15);
82907
+ const answer = isRecursive(child, stack, resolve16);
82911
82908
  if (answer > result)
82912
82909
  result = answer;
82913
82910
  }
@@ -82918,7 +82915,7 @@ function isRecursive(inst, stack, resolve15) {
82918
82915
  const desc = Object.getOwnPropertyDescriptor(sh, key);
82919
82916
  if (spread && !desc.enumerable)
82920
82917
  continue;
82921
- const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve15) : NONE;
82918
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve16) : NONE;
82922
82919
  if (child > answer)
82923
82920
  answer = child;
82924
82921
  }
@@ -82982,7 +82979,7 @@ function isRecursive(inst, stack, resolve15) {
82982
82979
  break;
82983
82980
  // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
82984
82981
  case "lazy": {
82985
- const inner = def._cachedInner ?? (resolve15 ? inst._zod.innerType : void 0);
82982
+ const inner = def._cachedInner ?? (resolve16 ? inst._zod.innerType : void 0);
82986
82983
  merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
82987
82984
  break;
82988
82985
  }
@@ -97860,7 +97857,7 @@ function formatZodError(error62) {
97860
97857
  }
97861
97858
  __name(formatZodError, "formatZodError");
97862
97859
 
97863
- // ../workers-utils/dist/chunk-TAK63GWY.mjs
97860
+ // ../workers-utils/dist/chunk-2HLTAS5V.mjs
97864
97861
  var import_node_module6 = require("node:module");
97865
97862
 
97866
97863
  // ../workers-utils/dist/chunk-M3RITKR3.mjs
@@ -97909,7 +97906,7 @@ function dedent(templ) {
97909
97906
  __name(dedent, "dedent");
97910
97907
  var esm_default = dedent;
97911
97908
 
97912
- // ../workers-utils/dist/chunk-TAK63GWY.mjs
97909
+ // ../workers-utils/dist/chunk-2HLTAS5V.mjs
97913
97910
  init_chunk_U6NEESU5();
97914
97911
  var import_node_fs = require("node:fs");
97915
97912
  var import_node_path = __toESM(require("node:path"), 1);
@@ -98074,7 +98071,7 @@ function getDurableObjectClassNameToUseSQLiteMap(migrations, exports$1) {
98074
98071
  __name(getDurableObjectClassNameToUseSQLiteMap, "getDurableObjectClassNameToUseSQLiteMap");
98075
98072
  function validateDurableObjectContainerApplications(config50, containers = getDurableObjectContainerApps(
98076
98073
  config50.containers
98077
- )) {
98074
+ ), configFileName2 = "Wrangler config file") {
98078
98075
  const allDOs = getDurableObjectClassNameToUseSQLiteMap(
98079
98076
  config50.migrations,
98080
98077
  config50.exports
@@ -98089,7 +98086,7 @@ function validateDurableObjectContainerApplications(config50, containers = getDu
98089
98086
  const useSQLite = allDOs.get(container.class_name);
98090
98087
  if (useSQLite === void 0 && maybeBoundDO === void 0) {
98091
98088
  throw new UserError(
98092
- `The container class_name ${container.class_name} does not match any durable object class_name defined in your Wrangler config file. Note that the durable object must be defined in the same script as the container.`,
98089
+ `The container class_name ${container.class_name} does not match any durable object class_name defined in your ${configFileName2}. Note that the durable object must be defined in the same script as the container.`,
98093
98090
  { telemetryMessage: "no DO defined that matches container class_name" }
98094
98091
  );
98095
98092
  }
@@ -98886,12 +98883,12 @@ function parseTree(text, errors = [], options = ParseOptions.DEFAULT) {
98886
98883
  return result;
98887
98884
  }
98888
98885
  __name(parseTree, "parseTree");
98889
- function findNodeAtLocation(root, path22) {
98886
+ function findNodeAtLocation(root, path32) {
98890
98887
  if (!root) {
98891
98888
  return void 0;
98892
98889
  }
98893
98890
  let node2 = root;
98894
- for (let segment of path22) {
98891
+ for (let segment of path32) {
98895
98892
  if (typeof segment === "string") {
98896
98893
  if (node2.type !== "object" || !Array.isArray(node2.children)) {
98897
98894
  return void 0;
@@ -99238,14 +99235,14 @@ function getNodeType(value) {
99238
99235
  }
99239
99236
  __name(getNodeType, "getNodeType");
99240
99237
  function setProperty(text, originalPath, value, options) {
99241
- const path22 = originalPath.slice();
99238
+ const path32 = originalPath.slice();
99242
99239
  const errors = [];
99243
99240
  const root = parseTree(text, errors);
99244
99241
  let parent = void 0;
99245
99242
  let lastSegment = void 0;
99246
- while (path22.length > 0) {
99247
- lastSegment = path22.pop();
99248
- parent = findNodeAtLocation(root, path22);
99243
+ while (path32.length > 0) {
99244
+ lastSegment = path32.pop();
99245
+ parent = findNodeAtLocation(root, path32);
99249
99246
  if (parent === void 0 && value !== void 0) {
99250
99247
  if (typeof lastSegment === "string") {
99251
99248
  value = { [lastSegment]: value };
@@ -99474,8 +99471,8 @@ function format22(documentText, range, options) {
99474
99471
  return format2(documentText, range, options);
99475
99472
  }
99476
99473
  __name(format22, "format");
99477
- function modify(text, path22, value, options) {
99478
- return setProperty(text, path22, value, options);
99474
+ function modify(text, path32, value, options) {
99475
+ return setProperty(text, path32, value, options);
99479
99476
  }
99480
99477
  __name(modify, "modify");
99481
99478
  function applyEdits(text, edits) {
@@ -100957,7 +100954,10 @@ function configFormat(configPath) {
100957
100954
  return "none";
100958
100955
  }
100959
100956
  __name(configFormat, "configFormat");
100960
- function configFileName(configPath) {
100957
+ function configFileName(configPath, userConfigPath) {
100958
+ if (userConfigPath !== void 0) {
100959
+ return import_node_path.default.basename(userConfigPath);
100960
+ }
100961
100961
  const format32 = configFormat(configPath);
100962
100962
  switch (format32) {
100963
100963
  case "toml":
@@ -113483,6 +113483,50 @@ The local dev server started at ${origin.href}
113483
113483
  return new Error(errorMessage);
113484
113484
  }
113485
113485
  __name(createTunnelStartupError, "createTunnelStartupError");
113486
+ var WRANGLER_COMMANDS = {
113487
+ deploy: "wrangler deploy",
113488
+ preview: "wrangler preview",
113489
+ versionsUpload: "wrangler versions upload",
113490
+ versionsDeploy: "wrangler versions deploy",
113491
+ versionsDeployAt: /* @__PURE__ */ __name((n2) => `wrangler versions deploy <new-version-id>@${n2}%`, "versionsDeployAt"),
113492
+ triggersDeploy: "wrangler triggers deploy",
113493
+ d1List: "wrangler d1 list",
113494
+ d1Delete: "wrangler d1 delete",
113495
+ queuesCreate: "wrangler queues create",
113496
+ secretPut: "wrangler secret put",
113497
+ versionsSecretPut: "wrangler versions secret put",
113498
+ containerRegistryConfigure: "wrangler containers registries configure"
113499
+ };
113500
+ var WRANGLER_CONFIG_FIELDS = {
113501
+ workersDev: "workers_dev",
113502
+ containerObservabilityTargetPercentage: "target_instance_percentage",
113503
+ containerObservabilityTargetCount: "target_instance_count"
113504
+ };
113505
+ var WRANGLER_CLI_PRESENTATION = {
113506
+ cliName: "wrangler",
113507
+ displayName: "Wrangler",
113508
+ displayConfigFileName: "Wrangler config file",
113509
+ configFieldAssignmentSeparator: " = ",
113510
+ commands: WRANGLER_COMMANDS,
113511
+ configFields: WRANGLER_CONFIG_FIELDS
113512
+ };
113513
+ function resolveCliPresentation(overrides) {
113514
+ return {
113515
+ cliName: overrides?.cliName ?? WRANGLER_CLI_PRESENTATION.cliName,
113516
+ displayName: overrides?.displayName ?? WRANGLER_CLI_PRESENTATION.displayName,
113517
+ displayConfigFileName: overrides?.displayConfigFileName ?? WRANGLER_CLI_PRESENTATION.displayConfigFileName,
113518
+ configFieldAssignmentSeparator: overrides?.configFieldAssignmentSeparator ?? WRANGLER_CLI_PRESENTATION.configFieldAssignmentSeparator,
113519
+ commands: {
113520
+ ...WRANGLER_COMMANDS,
113521
+ ...overrides?.commands
113522
+ },
113523
+ configFields: {
113524
+ ...WRANGLER_CONFIG_FIELDS,
113525
+ ...overrides?.configFields
113526
+ }
113527
+ };
113528
+ }
113529
+ __name(resolveCliPresentation, "resolveCliPresentation");
113486
113530
  var UPDATE_CHECK_TIMEOUT_MS = 3e3;
113487
113531
  var CACHE_TTL_MS = 60 * 60 * 1e3;
113488
113532
  var NPM_REGISTRY_URL = "https://registry.npmjs.org/";
@@ -117766,12 +117810,12 @@ var YargsInstance = class {
117766
117810
  async getCompletion(args, done) {
117767
117811
  argsert("<array> [function]", [args, done], arguments.length);
117768
117812
  if (!done) {
117769
- return new Promise((resolve15, reject) => {
117813
+ return new Promise((resolve16, reject) => {
117770
117814
  __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
117771
117815
  if (err)
117772
117816
  reject(err);
117773
117817
  else
117774
- resolve15(completions);
117818
+ resolve16(completions);
117775
117819
  });
117776
117820
  });
117777
117821
  } else {
@@ -118811,7 +118855,7 @@ var Yargs = YargsFactory(esm_default2);
118811
118855
  var yargs_default = Yargs;
118812
118856
 
118813
118857
  // package.json
118814
- var version2 = "2.73.4";
118858
+ var version2 = "2.74.0";
118815
118859
 
118816
118860
  // src/metrics.ts
118817
118861
  var import_node_async_hooks = require("node:async_hooks");
@@ -118966,6 +119010,7 @@ var CLOUDFLARE_API_TOKEN = process.env.CLOUDFLARE_API_TOKEN;
118966
119010
  var isExperimental = process.env.E2E_EXPERIMENTAL === "true";
118967
119011
  var workerTemplateToTest = process.env.E2E_WORKER_TEMPLATE_TO_TEST;
118968
119012
  var frameworkToTestFilter = process.env.E2E_FRAMEWORK_TEMPLATE_TO_TEST;
119013
+ var frameworkTestShard = process.env.E2E_FRAMEWORK_SHARD;
118969
119014
  var testPackageManager = isOneOf2(
118970
119015
  "E2E_TEST_PM",
118971
119016
  ["pnpm", "npm", "yarn", "bun"],
@@ -118974,7 +119019,7 @@ var testPackageManager = isOneOf2(
118974
119019
  var testPackageManagerVersion = process.env.E2E_TEST_PM_VERSION ?? "";
118975
119020
  var runDeployTests = process.env.E2E_RUN_DEPLOY_TESTS === "true";
118976
119021
  var customTempProjectPath = process.env.E2E_PROJECT_PATH;
118977
- var testRetries = process.env.E2E_TEST_RETRIES ? parseInt(process.env.E2E_TEST_RETRIES) : 1;
119022
+ var testRetries = process.env.E2E_TEST_RETRIES;
118978
119023
  function isOneOf2(key, possibleValues, defaultValue) {
118979
119024
  const value = process.env[key] ?? defaultValue;
118980
119025
  (0, import_node_assert3.default)(
@@ -119121,16 +119166,16 @@ async function sendEvent(payload, enableLog) {
119121
119166
 
119122
119167
  // src/metrics.ts
119123
119168
  function promiseWithResolvers() {
119124
- let resolve15;
119169
+ let resolve16;
119125
119170
  let reject;
119126
119171
  const promise2 = new Promise((res, rej) => {
119127
- resolve15 = res;
119172
+ resolve16 = res;
119128
119173
  reject = rej;
119129
119174
  });
119130
- if (!resolve15 || !reject) {
119175
+ if (!resolve16 || !reject) {
119131
119176
  throw new Error("Promise resolvers not set");
119132
119177
  }
119133
- return { resolve: resolve15, reject, promise: promise2 };
119178
+ return { resolve: resolve16, reject, promise: promise2 };
119134
119179
  }
119135
119180
  function getPlatform() {
119136
119181
  const platform3 = process.platform;
@@ -119347,10 +119392,10 @@ var runTelemetryCommand = (action) => {
119347
119392
  };
119348
119393
 
119349
119394
  // src/templates.ts
119350
- var import_node_fs21 = require("node:fs");
119395
+ var import_node_fs22 = require("node:fs");
119351
119396
  var import_promises9 = require("node:fs/promises");
119352
119397
  var import_node_os8 = require("node:os");
119353
- var import_node_path23 = require("node:path");
119398
+ var import_node_path26 = require("node:path");
119354
119399
  var import_deepmerge = __toESM(require_cjs());
119355
119400
  var import_degit = __toESM(require_dist());
119356
119401
 
@@ -120624,6 +120669,16 @@ async function installWrangler2() {
120624
120669
  const { npm: npm25 } = detectPackageManager();
120625
120670
  return installWrangler(npm25, false);
120626
120671
  }
120672
+ async function installCf() {
120673
+ const { npm: npm25 } = detectPackageManager();
120674
+ await installPackages2(["cf@latest"], {
120675
+ dev: true,
120676
+ startText: `Installing cf ${dim("The Cloudflare CLI")}`,
120677
+ doneText: `${brandColor("installed")} ${dim(
120678
+ `via \`${npm25} install cf --save-dev\``
120679
+ )}`
120680
+ });
120681
+ }
120627
120682
  var npmInstall = async (ctx) => {
120628
120683
  const nodeModulesPath = import_node_path12.default.join(ctx.project.path, "node_modules");
120629
120684
  if ((0, import_node_fs11.existsSync)(nodeModulesPath)) {
@@ -121240,19 +121295,19 @@ var baseOpen2 = async (options) => {
121240
121295
  }
121241
121296
  const subprocess = import_node_child_process9.default.spawn(command2, cliArguments, childProcessOptions);
121242
121297
  if (options.wait) {
121243
- return new Promise((resolve15, reject) => {
121298
+ return new Promise((resolve16, reject) => {
121244
121299
  subprocess.once("error", reject);
121245
121300
  subprocess.once("close", (exitCode) => {
121246
121301
  if (!options.allowNonzeroExitCode && exitCode !== 0) {
121247
121302
  reject(new Error(`Exited with code ${exitCode}`));
121248
121303
  return;
121249
121304
  }
121250
- resolve15(subprocess);
121305
+ resolve16(subprocess);
121251
121306
  });
121252
121307
  });
121253
121308
  }
121254
121309
  if (isFallbackAttempt) {
121255
- return new Promise((resolve15, reject) => {
121310
+ return new Promise((resolve16, reject) => {
121256
121311
  subprocess.once("error", reject);
121257
121312
  subprocess.once("spawn", () => {
121258
121313
  subprocess.once("close", (exitCode) => {
@@ -121262,17 +121317,17 @@ var baseOpen2 = async (options) => {
121262
121317
  return;
121263
121318
  }
121264
121319
  subprocess.unref();
121265
- resolve15(subprocess);
121320
+ resolve16(subprocess);
121266
121321
  });
121267
121322
  });
121268
121323
  });
121269
121324
  }
121270
121325
  subprocess.unref();
121271
- return new Promise((resolve15, reject) => {
121326
+ return new Promise((resolve16, reject) => {
121272
121327
  subprocess.once("error", reject);
121273
121328
  subprocess.once("spawn", () => {
121274
121329
  subprocess.off("error", reject);
121275
- resolve15(subprocess);
121330
+ resolve16(subprocess);
121276
121331
  });
121277
121332
  });
121278
121333
  };
@@ -121505,29 +121560,32 @@ function getPropertyName(newProp) {
121505
121560
  }
121506
121561
  __name2(getPropertyName, "getPropertyName");
121507
121562
 
121563
+ // src/frameworks/index.ts
121564
+ var import_semver3 = __toESM(require_semver2());
121565
+
121508
121566
  // src/frameworks/package.json
121509
121567
  var package_default = {
121510
121568
  name: "frameworks_clis_info",
121511
121569
  dependencies: {
121512
- "@angular/create": "22.2.1",
121570
+ "@angular/create": "22.2.2",
121513
121571
  "@tanstack/cli": "0.71.1",
121514
121572
  "create-analog": "2.8.0",
121515
- "create-astro": "5.2.4",
121573
+ "create-astro": "5.2.6",
121516
121574
  "create-docusaurus": "3.10.2",
121517
121575
  "create-hono": "0.19.5",
121518
- "create-next-app": "16.3.8",
121519
- "create-qwik": "1.20.1",
121576
+ "create-next-app": "16.4.0",
121577
+ "create-qwik": "1.20.2",
121520
121578
  "create-react-router": "8.4.0",
121521
121579
  "create-rwsdk": "3.1.3",
121522
121580
  "create-solid": "0.12.0",
121523
- "create-vike": "0.0.681",
121524
- "create-vinext-app": "1.0.0-beta.3",
121581
+ "create-vike": "0.0.682",
121582
+ "create-vinext-app": "1.0.0",
121525
121583
  "create-vite": "9.2.1",
121526
121584
  "create-vue": "3.24.0",
121527
121585
  "create-waku": "0.12.5-1.0.0-alpha.10-0",
121528
121586
  gatsby: "5.16.1",
121529
- nuxi: "3.37.0",
121530
- sv: "1.0.1"
121587
+ nuxi: "4.0.1",
121588
+ sv: "1.1.1"
121531
121589
  },
121532
121590
  info: [
121533
121591
  "This package.json is only used to keep track of the frameworks cli dependencies",
@@ -121546,6 +121604,13 @@ var getFrameworkCli = (ctx, withVersion = true) => {
121546
121604
  };
121547
121605
  var runFrameworkGenerator = async (ctx, args) => {
121548
121606
  const cli = getFrameworkCli(ctx, true);
121607
+ const nodeVersion2 = process.versions.node;
121608
+ const requiredNodeVersion = ctx.template.frameworkCliNodeVersion;
121609
+ if (requiredNodeVersion && !import_semver3.default.satisfies(nodeVersion2, requiredNodeVersion)) {
121610
+ throw new Error(
121611
+ `${ctx.template.displayName} requires Node.js ${requiredNodeVersion}. You are using Node.js ${nodeVersion2}. Please upgrade Node.js and try again.`
121612
+ );
121613
+ }
121549
121614
  const { npm: npm25, dlx } = detectPackageManager();
121550
121615
  const cmd = [...npm25 === "yarn" ? ["npx"] : dlx, cli, ...args];
121551
121616
  const env3 = npm25 === "yarn" && !process.env.npm_config_user_agent?.startsWith("yarn") ? { npm_config_user_agent: "yarn/1.22.22" } : {};
@@ -122450,6 +122515,16 @@ var c3_default26 = config22;
122450
122515
 
122451
122516
  // templates/next/c3.ts
122452
122517
  var import_node_assert5 = __toESM(require("node:assert"));
122518
+
122519
+ // src/cf/config.ts
122520
+ var import_node_fs17 = require("node:fs");
122521
+ var import_node_path18 = require("node:path");
122522
+ var CF_TYPES_PATH = "./.cloudflare/types/index.d.ts";
122523
+ function usesCfCli(projectPath) {
122524
+ return (0, import_node_fs17.existsSync)((0, import_node_path18.resolve)(projectPath, "cloudflare.config.ts"));
122525
+ }
122526
+
122527
+ // templates/next/c3.ts
122453
122528
  var { npm: npm8 } = detectPackageManager();
122454
122529
  var VINEXT_TYPES_PATH = "./worker-configuration.d.ts";
122455
122530
  var OPENNEXT_TYPES_PATH = "./cloudflare-env.d.ts";
@@ -122545,7 +122620,9 @@ var c3_default27 = {
122545
122620
  // Align with OpenNext so the shared previewScript: "preview" works
122546
122621
  // for both variants (vinext only ships dev/build/start/deploy).
122547
122622
  preview: `${npm8} run build && ${npm8} run start${npm8 === "npm" ? " --" : ""}`,
122548
- "cf-typegen": `wrangler types --env-interface ${envInterfaceName3} ${VINEXT_TYPES_PATH}`
122623
+ // vinext configures projects for the `cf` CLI unless it is passed
122624
+ // `--legacy-wrangler-cloudflare-init`
122625
+ "cf-typegen": usesCfCli(ctx.project.path) ? "cf workers types" : `wrangler types --env-interface ${envInterfaceName3} ${VINEXT_TYPES_PATH}`
122549
122626
  }
122550
122627
  };
122551
122628
  },
@@ -122583,6 +122660,7 @@ var experimental_c3_default = {
122583
122660
  };
122584
122661
 
122585
122662
  // templates/nuxt/pages/c3.ts
122663
+ var import_node_path19 = require("node:path");
122586
122664
  var recast4 = __toESM(require_main2());
122587
122665
  var { npm: npm9, name: pm } = detectPackageManager();
122588
122666
  var generate14 = async (ctx) => {
@@ -122595,7 +122673,7 @@ var generate14 = async (ctx) => {
122595
122673
  "--no-install",
122596
122674
  gitFlag
122597
122675
  ]);
122598
- writeFile4("./.node-version", "18");
122676
+ writeFile4((0, import_node_path19.join)(ctx.project.path, ".node-version"), "22.23.1");
122599
122677
  logRaw("");
122600
122678
  };
122601
122679
  var configure6 = async () => {
@@ -122656,6 +122734,7 @@ var config23 = {
122656
122734
  configVersion: 1,
122657
122735
  id: "nuxt",
122658
122736
  frameworkCli: "nuxi",
122737
+ frameworkCliNodeVersion: "^22.21.0 || ^24.11.0 || >=26.0.0",
122659
122738
  platform: "pages",
122660
122739
  languages: ["ts"],
122661
122740
  hidden: true,
@@ -122680,6 +122759,7 @@ var config23 = {
122680
122759
  var c3_default28 = config23;
122681
122760
 
122682
122761
  // templates/nuxt/workers/c3.ts
122762
+ var import_node_path20 = require("node:path");
122683
122763
  var recast5 = __toESM(require_main2());
122684
122764
  var { npm: npm10, name: pm2 } = detectPackageManager();
122685
122765
  var generate15 = async (ctx) => {
@@ -122692,7 +122772,7 @@ var generate15 = async (ctx) => {
122692
122772
  "--no-install",
122693
122773
  gitFlag
122694
122774
  ]);
122695
- writeFile4("./.node-version", "18");
122775
+ writeFile4((0, import_node_path20.join)(ctx.project.path, ".node-version"), "22.23.1");
122696
122776
  logRaw("");
122697
122777
  };
122698
122778
  var configure7 = async () => {
@@ -122753,6 +122833,7 @@ var config24 = {
122753
122833
  configVersion: 1,
122754
122834
  id: "nuxt",
122755
122835
  frameworkCli: "nuxi",
122836
+ frameworkCliNodeVersion: "^22.21.0 || ^24.11.0 || >=26.0.0",
122756
122837
  platform: "workers",
122757
122838
  languages: ["ts"],
122758
122839
  displayName: "Nuxt",
@@ -122797,10 +122878,10 @@ var config26 = {
122797
122878
  var c3_default31 = config26;
122798
122879
 
122799
122880
  // templates/pre-existing/c3.ts
122800
- var import_node_fs17 = require("node:fs");
122881
+ var import_node_fs18 = require("node:fs");
122801
122882
  var import_promises8 = require("node:fs/promises");
122802
122883
  var import_node_os7 = require("node:os");
122803
- var import_node_path18 = require("node:path");
122884
+ var import_node_path21 = require("node:path");
122804
122885
 
122805
122886
  // src/helpers/command.ts
122806
122887
  var runWranglerCommand = async (command2, opts = {}) => {
@@ -122813,6 +122894,44 @@ var runWranglerCommand = async (command2, opts = {}) => {
122813
122894
  return runCommand(command2, { ...opts, env: env3 });
122814
122895
  };
122815
122896
 
122897
+ // src/cf/accounts.ts
122898
+ async function cfWhoami() {
122899
+ const { npx: npx6 } = detectPackageManager();
122900
+ try {
122901
+ const output2 = await runWranglerCommand([npx6, "cf", "auth", "whoami"], {
122902
+ silent: true
122903
+ });
122904
+ return JSON.parse(
122905
+ output2.slice(output2.indexOf("{"), output2.lastIndexOf("}") + 1)
122906
+ );
122907
+ } catch (e) {
122908
+ if (e instanceof CancelError) {
122909
+ throw e;
122910
+ }
122911
+ return {};
122912
+ }
122913
+ }
122914
+ async function isLoggedIn() {
122915
+ const { authenticated, tokenValid } = await cfWhoami();
122916
+ return authenticated === true && tokenValid !== false;
122917
+ }
122918
+ async function listAccounts() {
122919
+ const { accounts = [] } = await cfWhoami();
122920
+ return Object.fromEntries(accounts.map(({ name: name3, id }) => [name3, id]));
122921
+ }
122922
+ async function login() {
122923
+ const { npx: npx6 } = detectPackageManager();
122924
+ try {
122925
+ await runWranglerCommand([npx6, "cf", "auth", "login", "--force"]);
122926
+ } catch (e) {
122927
+ if (e instanceof CancelError) {
122928
+ throw e;
122929
+ }
122930
+ return false;
122931
+ }
122932
+ return isLoggedIn();
122933
+ }
122934
+
122816
122935
  // src/wrangler/accounts.ts
122817
122936
  var chooseAccount = async (ctx) => {
122818
122937
  const accountIdFromEnv = process.env.CLOUDFLARE_ACCOUNT_ID;
@@ -122823,7 +122942,7 @@ var chooseAccount = async (ctx) => {
122823
122942
  }
122824
122943
  const s = spinner();
122825
122944
  s.start(`Selecting Cloudflare account ${dim("retrieving accounts")}`);
122826
- const accounts = await listAccounts();
122945
+ const accounts = usesCfCli(ctx.project.path) ? await listAccounts() : await listAccounts2();
122827
122946
  let accountId;
122828
122947
  const numAccounts = Object.keys(accounts).length;
122829
122948
  if (numAccounts === 0) {
@@ -122857,7 +122976,7 @@ var chooseAccount = async (ctx) => {
122857
122976
  );
122858
122977
  ctx.account = { id: accountId, name: accountName };
122859
122978
  };
122860
- var wranglerLogin = async (ctx) => {
122979
+ var login2 = async (ctx) => {
122861
122980
  return reporter.collectAsyncMetrics({
122862
122981
  eventPrefix: "c3 login",
122863
122982
  props: {
@@ -122865,16 +122984,25 @@ var wranglerLogin = async (ctx) => {
122865
122984
  },
122866
122985
  async promise() {
122867
122986
  const { npx: npx6 } = detectPackageManager();
122987
+ const useCf = usesCfCli(ctx.project.path);
122868
122988
  const s = spinner();
122869
122989
  s.start(
122870
122990
  `Logging into Cloudflare ${dim("checking authentication status")}`
122871
122991
  );
122872
- const isAlreadyLoggedIn = await isLoggedIn();
122992
+ const isAlreadyLoggedIn = useCf ? await isLoggedIn() : await isLoggedIn2();
122873
122993
  s.stop(brandColor(isAlreadyLoggedIn ? "logged in" : "not logged in"));
122874
122994
  reporter.setEventProperty("isAlreadyLoggedIn", isAlreadyLoggedIn);
122875
122995
  if (isAlreadyLoggedIn) {
122876
122996
  return true;
122877
122997
  }
122998
+ if (useCf) {
122999
+ const success3 = await login();
123000
+ updateStatus(
123001
+ `${brandColor(success3 ? "allowed" : "denied")} ${dim("via `cf auth login`")}`
123002
+ );
123003
+ reporter.setEventProperty("isLoginSuccessful", success3);
123004
+ return success3;
123005
+ }
122878
123006
  s.start(
122879
123007
  `Logging into Cloudflare ${dim("This will open a browser window")}`
122880
123008
  );
@@ -122889,7 +123017,7 @@ var wranglerLogin = async (ctx) => {
122889
123017
  }
122890
123018
  });
122891
123019
  };
122892
- var listAccounts = async () => {
123020
+ var listAccounts2 = async () => {
122893
123021
  const { npx: npx6 } = detectPackageManager();
122894
123022
  const output2 = await runWranglerCommand([npx6, "wrangler", "whoami"], {
122895
123023
  silent: true
@@ -122903,7 +123031,7 @@ var listAccounts = async () => {
122903
123031
  });
122904
123032
  return accounts;
122905
123033
  };
122906
- var isLoggedIn = async () => {
123034
+ var isLoggedIn2 = async () => {
122907
123035
  const { npx: npx6 } = detectPackageManager();
122908
123036
  try {
122909
123037
  const output2 = await runWranglerCommand([npx6, "wrangler", "whoami"], {
@@ -122930,7 +123058,7 @@ async function copyExistingWorkerFiles(ctx) {
122930
123058
  }
122931
123059
  );
122932
123060
  }
122933
- const tempdir = await (0, import_promises8.mkdtemp)((0, import_node_path18.join)((0, import_node_os7.tmpdir)(), "c3-wrangler-init--from-dash-"));
123061
+ const tempdir = await (0, import_promises8.mkdtemp)((0, import_node_path21.join)((0, import_node_os7.tmpdir)(), "c3-wrangler-init--from-dash-"));
122934
123062
  await runCommand(
122935
123063
  [
122936
123064
  ...dlx,
@@ -122953,16 +123081,16 @@ async function copyExistingWorkerFiles(ctx) {
122953
123081
  }
122954
123082
  );
122955
123083
  await (0, import_promises8.cp)(
122956
- (0, import_node_path18.join)(tempdir, ctx.args.existingScript, "src"),
122957
- (0, import_node_path18.join)(ctx.project.path, "src"),
123084
+ (0, import_node_path21.join)(tempdir, ctx.args.existingScript, "src"),
123085
+ (0, import_node_path21.join)(ctx.project.path, "src"),
122958
123086
  { recursive: true }
122959
123087
  );
122960
123088
  const configFiles = ["wrangler.jsonc", "wrangler.json", "wrangler.toml"];
122961
123089
  let configFileCopied = false;
122962
123090
  for (const configFile of configFiles) {
122963
- const sourcePath = (0, import_node_path18.join)(tempdir, ctx.args.existingScript, configFile);
122964
- if ((0, import_node_fs17.existsSync)(sourcePath)) {
122965
- await (0, import_promises8.cp)(sourcePath, (0, import_node_path18.join)(ctx.project.path, configFile));
123091
+ const sourcePath = (0, import_node_path21.join)(tempdir, ctx.args.existingScript, configFile);
123092
+ if ((0, import_node_fs18.existsSync)(sourcePath)) {
123093
+ await (0, import_promises8.cp)(sourcePath, (0, import_node_path21.join)(ctx.project.path, configFile));
122966
123094
  configFileCopied = true;
122967
123095
  break;
122968
123096
  }
@@ -122985,7 +123113,7 @@ var config27 = {
122985
123113
  },
122986
123114
  languages: ["js"],
122987
123115
  configure: buildConfigure({
122988
- login: wranglerLogin,
123116
+ login: login2,
122989
123117
  chooseAccount,
122990
123118
  copyFiles: copyExistingWorkerFiles
122991
123119
  })
@@ -123034,20 +123162,20 @@ var config28 = {
123034
123162
  var c3_default33 = config28;
123035
123163
 
123036
123164
  // src/helpers/codemod.ts
123037
- var import_node_fs18 = require("node:fs");
123038
- var import_node_path19 = require("node:path");
123165
+ var import_node_fs19 = require("node:fs");
123166
+ var import_node_path22 = require("node:path");
123039
123167
  var loadSnippets = (parentFolder) => {
123040
- const snippetsPath = (0, import_node_path19.join)(parentFolder, "snippets");
123041
- if (!(0, import_node_fs18.lstatSync)(snippetsPath, { throwIfNoEntry: false })?.isDirectory()) {
123168
+ const snippetsPath = (0, import_node_path22.join)(parentFolder, "snippets");
123169
+ if (!(0, import_node_fs19.lstatSync)(snippetsPath, { throwIfNoEntry: false })?.isDirectory()) {
123042
123170
  return {};
123043
123171
  }
123044
- const files = (0, import_node_fs18.readdirSync)(snippetsPath);
123045
- return files.filter((fileName) => (0, import_node_fs18.lstatSync)((0, import_node_path19.join)(snippetsPath, fileName)).isFile()).filter((fileName) => [".js", ".ts"].includes((0, import_node_path19.extname)(fileName))).reduce((acc, snippetPath) => {
123172
+ const files = (0, import_node_fs19.readdirSync)(snippetsPath);
123173
+ return files.filter((fileName) => (0, import_node_fs19.lstatSync)((0, import_node_path22.join)(snippetsPath, fileName)).isFile()).filter((fileName) => [".js", ".ts"].includes((0, import_node_path22.extname)(fileName))).reduce((acc, snippetPath) => {
123046
123174
  const [file3, ext] = snippetPath.split(".");
123047
123175
  const key = `${file3}${ext === "js" ? "Js" : "Ts"}`;
123048
123176
  return {
123049
123177
  ...acc,
123050
- [key]: parseFile((0, import_node_path19.join)(snippetsPath, snippetPath))?.body
123178
+ [key]: parseFile((0, import_node_path22.join)(snippetsPath, snippetPath))?.body
123051
123179
  };
123052
123180
  }, {});
123053
123181
  };
@@ -123240,7 +123368,7 @@ var config31 = {
123240
123368
  var c3_default36 = config31;
123241
123369
 
123242
123370
  // templates/react-router/c3.ts
123243
- var import_node_path20 = require("node:path");
123371
+ var import_node_path23 = require("node:path");
123244
123372
  var { npm: npm13 } = detectPackageManager();
123245
123373
  var generate18 = async (ctx) => {
123246
123374
  await runFrameworkGenerator(ctx, [
@@ -123259,9 +123387,9 @@ var configure10 = async (ctx) => {
123259
123387
  });
123260
123388
  const s = spinner();
123261
123389
  s.start("Removing non-Cloudflare artifacts from template");
123262
- removeFile((0, import_node_path20.resolve)(ctx.project.path, "Dockerfile"));
123263
- removeFile((0, import_node_path20.resolve)(ctx.project.path, ".dockerignore"));
123264
- const pkgJsonPath = (0, import_node_path20.resolve)(ctx.project.path, "package.json");
123390
+ removeFile((0, import_node_path23.resolve)(ctx.project.path, "Dockerfile"));
123391
+ removeFile((0, import_node_path23.resolve)(ctx.project.path, ".dockerignore"));
123392
+ const pkgJsonPath = (0, import_node_path23.resolve)(ctx.project.path, "package.json");
123265
123393
  const pkgJson = readJSON(pkgJsonPath);
123266
123394
  delete pkgJson.dependencies?.["@react-router/node"];
123267
123395
  delete pkgJson.dependencies?.["@react-router/serve"];
@@ -123634,7 +123762,7 @@ var config38 = {
123634
123762
  var c3_default43 = config38;
123635
123763
 
123636
123764
  // templates/svelte/pages/c3.ts
123637
- var import_node_fs19 = require("node:fs");
123765
+ var import_node_fs20 = require("node:fs");
123638
123766
  var recast10 = __toESM(require_main2());
123639
123767
  var { npm: npm18 } = detectPackageManager();
123640
123768
  var generate23 = async (ctx) => {
@@ -123667,7 +123795,7 @@ var updateViteConfig = (ctx) => {
123667
123795
  };
123668
123796
  var updatePlaywrightConfig = (shouldUseTypescript) => {
123669
123797
  const filePath = `playwright.config.${shouldUseTypescript ? "ts" : "js"}`;
123670
- if (!(0, import_node_fs19.existsSync)(filePath)) {
123798
+ if (!(0, import_node_fs20.existsSync)(filePath)) {
123671
123799
  return;
123672
123800
  }
123673
123801
  updateStatus(`Changing webServer port in ${blue(filePath)}`);
@@ -124073,7 +124201,7 @@ var config47 = {
124073
124201
  var c3_default51 = config47;
124074
124202
 
124075
124203
  // templates/waku/c3.ts
124076
- var import_node_path21 = require("node:path");
124204
+ var import_node_path24 = require("node:path");
124077
124205
  var { npm: npm23 } = detectPackageManager();
124078
124206
  var generate30 = async (ctx) => {
124079
124207
  await runFrameworkGenerator(ctx, [
@@ -124097,7 +124225,7 @@ var configure16 = async (ctx) => {
124097
124225
  );
124098
124226
  const s = spinner();
124099
124227
  s.start("Removing non-Cloudflare artifacts from template");
124100
- removeFile((0, import_node_path21.resolve)(ctx.project.path, "src/middleware/no-trailing-slash.ts"));
124228
+ removeFile((0, import_node_path24.resolve)(ctx.project.path, "src/middleware/no-trailing-slash.ts"));
124101
124229
  s.stop(`${brandColor("removed")} ${dim("trailing-slash dev middleware")}`);
124102
124230
  };
124103
124231
  var config48 = {
@@ -124222,7 +124350,7 @@ If the application uses Durable Objects or Workflows, refer to the relevant best
124222
124350
  var import_node_assert7 = __toESM(require("node:assert"));
124223
124351
 
124224
124352
  // ../wrangler/package.json
124225
- var version3 = "4.149.0";
124353
+ var version3 = "4.150.0";
124226
124354
 
124227
124355
  // src/git.ts
124228
124356
  var offerGit = async (ctx) => {
@@ -124418,8 +124546,8 @@ async function getProductionBranch(cwd) {
124418
124546
  }
124419
124547
 
124420
124548
  // src/validators.ts
124421
- var import_node_fs20 = require("node:fs");
124422
- var import_node_path22 = require("node:path");
124549
+ var import_node_fs21 = require("node:fs");
124550
+ var import_node_path25 = require("node:path");
124423
124551
  var TEMPLATE_REGEX = /^(?:(?:https:\/\/)?(?<httpsUrl>[^:/]+\.[^:/]+)\/|git@(?<gitUrl>[^:/]+)[:/]|(?<shorthandUrl>[^/]+):)?(?<user>[^/\s]+)\/(?<repository>[^/\s#]+)(?:(?<subdirectoryPath>(?:\/[^/\s#]+)+))?(?:\/)?(?:#(?<tag>.+))?/;
124424
124552
  var validateTemplateUrl = (value) => {
124425
124553
  if (!String(value).match(TEMPLATE_REGEX)) {
@@ -124427,9 +124555,9 @@ var validateTemplateUrl = (value) => {
124427
124555
  }
124428
124556
  };
124429
124557
  var validateProjectDirectory = (relativePath, args) => {
124430
- const path9 = (0, import_node_path22.resolve)(relativePath);
124558
+ const path9 = (0, import_node_path25.resolve)(relativePath);
124431
124559
  if (!args.existingScript) {
124432
- const projectName = (0, import_node_path22.basename)(path9);
124560
+ const projectName = (0, import_node_path25.basename)(path9);
124433
124561
  const invalidChars = /[^a-z0-9-]/;
124434
124562
  const invalidStartEnd = /^-|-$/;
124435
124563
  if (projectName.match(invalidStartEnd)) {
@@ -124442,9 +124570,9 @@ var validateProjectDirectory = (relativePath, args) => {
124442
124570
  return `Project names must be less than 58 characters.`;
124443
124571
  }
124444
124572
  }
124445
- const existsAlready = (0, import_node_fs20.existsSync)(path9);
124573
+ const existsAlready = (0, import_node_fs21.existsSync)(path9);
124446
124574
  if (existsAlready) {
124447
- for (const file3 of (0, import_node_fs20.readdirSync)(path9)) {
124575
+ for (const file3 of (0, import_node_fs21.readdirSync)(path9)) {
124448
124576
  if (!isAllowedExistingFile(file3)) {
124449
124577
  return `Directory \`${relativePath}\` already exists and contains files that might conflict. Please choose a new name.`;
124450
124578
  }
@@ -124917,7 +125045,7 @@ var createContext = async (args, prevArgs) => {
124917
125045
  envInterfaceName: "Env",
124918
125046
  ...template
124919
125047
  };
124920
- const path9 = (0, import_node_path23.resolve)(projectName);
125048
+ const path9 = (0, import_node_path26.resolve)(projectName);
124921
125049
  const languageVariants = template.copyFiles && !isVariantInfo(template.copyFiles) && !template.copyFiles.selectVariant ? Object.keys(template.copyFiles.variants) : [];
124922
125050
  if (languageVariants.length > 0) {
124923
125051
  if (hasTsConfig(path9)) {
@@ -124943,8 +125071,8 @@ var createContext = async (args, prevArgs) => {
124943
125071
  }
124944
125072
  }
124945
125073
  }
124946
- const name3 = (0, import_node_path23.basename)(path9);
124947
- const directory = (0, import_node_path23.dirname)(path9);
125074
+ const name3 = (0, import_node_path26.basename)(path9);
125075
+ const directory = (0, import_node_path26.dirname)(path9);
124948
125076
  const originalCWD = process.cwd();
124949
125077
  return {
124950
125078
  project: { name: name3, path: path9 },
@@ -124964,7 +125092,7 @@ async function copyTemplateFiles(ctx) {
124964
125092
  const { copyFiles } = ctx.template;
124965
125093
  let srcdir;
124966
125094
  if (isVariantInfo(copyFiles)) {
124967
- srcdir = (0, import_node_path23.join)(getTemplatePath(ctx), copyFiles.path);
125095
+ srcdir = (0, import_node_path26.join)(getTemplatePath(ctx), copyFiles.path);
124968
125096
  } else {
124969
125097
  const selectVariant = copyFiles.selectVariant ?? defaultSelectVariant;
124970
125098
  const variant = await selectVariant(ctx);
@@ -124974,22 +125102,22 @@ async function copyTemplateFiles(ctx) {
124974
125102
  `Unknown variant provided: ${JSON.stringify(variant ?? "")}`
124975
125103
  );
124976
125104
  }
124977
- srcdir = (0, import_node_path23.join)(getTemplatePath(ctx), variantInfo.path);
125105
+ srcdir = (0, import_node_path26.join)(getTemplatePath(ctx), variantInfo.path);
124978
125106
  }
124979
125107
  const copyDestDir = getCopyFilesDestinationDir(ctx);
124980
- const destdir = (0, import_node_path23.join)(ctx.project.path, ...copyDestDir ? [copyDestDir] : []);
125108
+ const destdir = (0, import_node_path26.join)(ctx.project.path, ...copyDestDir ? [copyDestDir] : []);
124981
125109
  const s = spinner();
124982
125110
  s.start(`Copying template files`);
124983
125111
  await (0, import_promises9.cp)(srcdir, destdir, { recursive: true, force: true });
124984
- const dummyGitIgnorePath = (0, import_node_path23.join)(destdir, "__dot__gitignore");
124985
- if ((0, import_node_fs21.existsSync)(dummyGitIgnorePath)) {
124986
- await (0, import_promises9.rename)(dummyGitIgnorePath, (0, import_node_path23.join)(destdir, ".gitignore"));
125112
+ const dummyGitIgnorePath = (0, import_node_path26.join)(destdir, "__dot__gitignore");
125113
+ if ((0, import_node_fs22.existsSync)(dummyGitIgnorePath)) {
125114
+ await (0, import_promises9.rename)(dummyGitIgnorePath, (0, import_node_path26.join)(destdir, ".gitignore"));
124987
125115
  }
124988
125116
  s.stop(`${brandColor("files")} ${dim("copied to project directory")}`);
124989
125117
  }
124990
125118
  function writeAgentsMd(projectPath) {
124991
- const agentsMdPath = (0, import_node_path23.join)(projectPath, "AGENTS.md");
124992
- if ((0, import_node_fs21.existsSync)(agentsMdPath)) {
125119
+ const agentsMdPath = (0, import_node_path26.join)(projectPath, "AGENTS.md");
125120
+ if ((0, import_node_fs22.existsSync)(agentsMdPath)) {
124993
125121
  return;
124994
125122
  }
124995
125123
  writeFile4(agentsMdPath, getAgentsMd());
@@ -125018,26 +125146,26 @@ var validateTemplate = (path9, config50) => {
125018
125146
  return;
125019
125147
  }
125020
125148
  if (isVariantInfo(config50.copyFiles)) {
125021
- validateTemplateSrcDirectory((0, import_node_path23.resolve)(path9, config50.copyFiles.path), config50);
125149
+ validateTemplateSrcDirectory((0, import_node_path26.resolve)(path9, config50.copyFiles.path), config50);
125022
125150
  } else {
125023
125151
  for (const variant of Object.values(config50.copyFiles.variants)) {
125024
- validateTemplateSrcDirectory((0, import_node_path23.resolve)(path9, variant.path), config50);
125152
+ validateTemplateSrcDirectory((0, import_node_path26.resolve)(path9, variant.path), config50);
125025
125153
  }
125026
125154
  }
125027
125155
  };
125028
125156
  var validateTemplateSrcDirectory = (path9, config50) => {
125029
125157
  if (config50.platform === "workers") {
125030
- const wranglerTomlPath = (0, import_node_path23.resolve)(path9, "wrangler.toml");
125031
- const wranglerJsonPath = (0, import_node_path23.resolve)(path9, "wrangler.json");
125032
- const wranglerJsoncPath = (0, import_node_path23.resolve)(path9, "wrangler.jsonc");
125033
- if (!(0, import_node_fs21.existsSync)(wranglerTomlPath) && !(0, import_node_fs21.existsSync)(wranglerJsonPath) && !(0, import_node_fs21.existsSync)(wranglerJsoncPath)) {
125158
+ const wranglerTomlPath = (0, import_node_path26.resolve)(path9, "wrangler.toml");
125159
+ const wranglerJsonPath = (0, import_node_path26.resolve)(path9, "wrangler.json");
125160
+ const wranglerJsoncPath = (0, import_node_path26.resolve)(path9, "wrangler.jsonc");
125161
+ if (!(0, import_node_fs22.existsSync)(wranglerTomlPath) && !(0, import_node_fs22.existsSync)(wranglerJsonPath) && !(0, import_node_fs22.existsSync)(wranglerJsoncPath)) {
125034
125162
  throw new Error(
125035
125163
  `create-cloudflare templates must contain a "wrangler.toml" or "wrangler.json(c)" file.`
125036
125164
  );
125037
125165
  }
125038
125166
  }
125039
- const pkgJsonPath = (0, import_node_path23.resolve)(path9, "package.json");
125040
- if (!(0, import_node_fs21.existsSync)(pkgJsonPath)) {
125167
+ const pkgJsonPath = (0, import_node_path26.resolve)(path9, "package.json");
125168
+ if (!(0, import_node_fs22.existsSync)(pkgJsonPath)) {
125041
125169
  throw new Error(
125042
125170
  `create-cloudflare templates must contain a "package.json" file.`
125043
125171
  );
@@ -125054,10 +125182,10 @@ var inferTemplateConfig = (path9) => {
125054
125182
  };
125055
125183
  var inferCopyFilesDefinition = (path9) => {
125056
125184
  const variants = {};
125057
- if ((0, import_node_fs21.existsSync)((0, import_node_path23.join)(path9, "js"))) {
125185
+ if ((0, import_node_fs22.existsSync)((0, import_node_path26.join)(path9, "js"))) {
125058
125186
  variants["js"] = { path: "./js" };
125059
125187
  }
125060
- if ((0, import_node_fs21.existsSync)((0, import_node_path23.join)(path9, "ts"))) {
125188
+ if ((0, import_node_fs22.existsSync)((0, import_node_path26.join)(path9, "ts"))) {
125061
125189
  variants["ts"] = { path: "./ts" };
125062
125190
  }
125063
125191
  const copyFiles = Object.keys(variants).length !== 0 ? { variants } : { path: "." };
@@ -125092,7 +125220,7 @@ Use the format "github:<owner>/<repo>/sub/directory[#<branch>]" to clone a speci
125092
125220
  force: true,
125093
125221
  mode: options.mode
125094
125222
  });
125095
- const tmpDir = options.intoFolder ?? await (0, import_promises9.mkdtemp)((0, import_node_path23.join)((0, import_node_os8.tmpdir)(), "c3-template"));
125223
+ const tmpDir = options.intoFolder ?? await (0, import_promises9.mkdtemp)((0, import_node_path26.join)((0, import_node_os8.tmpdir)(), "c3-template"));
125096
125224
  await emitter.clone(tmpDir);
125097
125225
  return tmpDir;
125098
125226
  } catch {
@@ -125101,8 +125229,8 @@ Use the format "github:<owner>/<repo>/sub/directory[#<branch>]" to clone a speci
125101
125229
  }
125102
125230
  }
125103
125231
  function updatePythonPackageName(path9, projectName) {
125104
- const pyProjectFile = (0, import_node_path23.resolve)(path9, "pyproject.toml");
125105
- if (!(0, import_node_fs21.existsSync)(pyProjectFile)) {
125232
+ const pyProjectFile = (0, import_node_path26.resolve)(path9, "pyproject.toml");
125233
+ if (!(0, import_node_fs22.existsSync)(pyProjectFile)) {
125106
125234
  return;
125107
125235
  }
125108
125236
  const s = spinner();
@@ -125114,7 +125242,7 @@ function updatePythonPackageName(path9, projectName) {
125114
125242
  }
125115
125243
  var updatePackageName = (ctx) => {
125116
125244
  const placeholderNames = ["<PACKAGE_NAME>", "<TBD>", "TBD", ""];
125117
- const pkgJsonPath = (0, import_node_path23.resolve)(ctx.project.path, "package.json");
125245
+ const pkgJsonPath = (0, import_node_path26.resolve)(ctx.project.path, "package.json");
125118
125246
  const pkgJson = readJSON(pkgJsonPath);
125119
125247
  if (!placeholderNames.includes(pkgJson.name)) {
125120
125248
  return;
@@ -125132,7 +125260,7 @@ var updatePackageScripts = async (ctx) => {
125132
125260
  }
125133
125261
  const s = spinner();
125134
125262
  s.start("Updating `package.json` scripts");
125135
- const pkgJsonPath = (0, import_node_path23.resolve)(ctx.project.path, "package.json");
125263
+ const pkgJsonPath = (0, import_node_path26.resolve)(ctx.project.path, "package.json");
125136
125264
  let pkgJson = readJSON(pkgJsonPath);
125137
125265
  const transformed = await ctx.template.transformPackageJson(pkgJson, ctx);
125138
125266
  pkgJson = (0, import_deepmerge.default)(pkgJson, transformed);
@@ -125141,9 +125269,9 @@ var updatePackageScripts = async (ctx) => {
125141
125269
  };
125142
125270
  var getTemplatePath = (ctx) => {
125143
125271
  if (ctx.template.path) {
125144
- return (0, import_node_path23.resolve)(__dirname, "..", ctx.template.path);
125272
+ return (0, import_node_path26.resolve)(__dirname, "..", ctx.template.path);
125145
125273
  }
125146
- return (0, import_node_path23.resolve)(__dirname, "..", "templates", ctx.template.id);
125274
+ return (0, import_node_path26.resolve)(__dirname, "..", "templates", ctx.template.id);
125147
125275
  };
125148
125276
  var isVariantInfo = (copyFiles) => {
125149
125277
  return "path" in copyFiles;
@@ -125526,7 +125654,7 @@ var processArgument = async (args, key, promptConfig) => {
125526
125654
  // src/deploy.ts
125527
125655
  var import_promises11 = require("node:fs/promises");
125528
125656
  var import_node_os9 = require("node:os");
125529
- var import_node_path25 = require("node:path");
125657
+ var import_node_path29 = require("node:path");
125530
125658
 
125531
125659
  // src/helpers/poll.ts
125532
125660
  var import_promises10 = require("node:timers/promises");
@@ -125617,9 +125745,51 @@ function secondsSince(start) {
125617
125745
  return Math.round((Date.now() - start) / 1e3);
125618
125746
  }
125619
125747
 
125748
+ // src/cf/deploy.ts
125749
+ var import_node_path27 = require("node:path");
125750
+ var DEFAULT_WORKER_CONFIG_PATH = ".cloudflare/output/v0/workers/default/worker.config.json";
125751
+ async function getDeploymentUrl(projectPath, accountId) {
125752
+ let name3;
125753
+ try {
125754
+ ({ name: name3 } = readJSON((0, import_node_path27.join)(projectPath, DEFAULT_WORKER_CONFIG_PATH)));
125755
+ } catch {
125756
+ throw new Error(
125757
+ `Failed to find deployment url: could not read the Worker's name from \`${DEFAULT_WORKER_CONFIG_PATH}\`.`
125758
+ );
125759
+ }
125760
+ const { npx: npx6 } = detectPackageManager();
125761
+ let worker;
125762
+ try {
125763
+ const output2 = await runWranglerCommand(
125764
+ [npx6, "cf", "workers", "get", name3],
125765
+ {
125766
+ silent: true,
125767
+ env: { CLOUDFLARE_ACCOUNT_ID: accountId }
125768
+ }
125769
+ );
125770
+ worker = JSON.parse(
125771
+ output2.slice(output2.indexOf("{"), output2.lastIndexOf("}") + 1)
125772
+ );
125773
+ } catch (e) {
125774
+ if (e instanceof CancelError) {
125775
+ throw e;
125776
+ }
125777
+ throw new Error(
125778
+ `Failed to find deployment url: \`cf workers get ${name3}\` failed.
125779
+ ${e instanceof Error ? e.message : String(e)}`
125780
+ );
125781
+ }
125782
+ if (!worker.subdomain?.enabled || !worker.subdomain.url) {
125783
+ throw new Error(
125784
+ `Failed to find deployment url: the \`${name3}\` Worker is not available on workers.dev.`
125785
+ );
125786
+ }
125787
+ return worker.subdomain.url;
125788
+ }
125789
+
125620
125790
  // src/wrangler/config.ts
125621
- var import_node_fs22 = require("node:fs");
125622
- var import_node_path24 = require("node:path");
125791
+ var import_node_fs23 = require("node:fs");
125792
+ var import_node_path28 = require("node:path");
125623
125793
 
125624
125794
  // src/helpers/json.ts
125625
125795
  var import_comment_json2 = __toESM(require_src3());
@@ -125731,22 +125901,22 @@ ${generateHintsAsTomlComments(wranglerToml)}
125731
125901
  }
125732
125902
  };
125733
125903
  var getWranglerTomlPath = (ctx) => {
125734
- return (0, import_node_path24.resolve)(ctx.project.path, "wrangler.toml");
125904
+ return (0, import_node_path28.resolve)(ctx.project.path, "wrangler.toml");
125735
125905
  };
125736
125906
  var getWranglerJsonPath = (ctx) => {
125737
- return (0, import_node_path24.resolve)(ctx.project.path, "wrangler.json");
125907
+ return (0, import_node_path28.resolve)(ctx.project.path, "wrangler.json");
125738
125908
  };
125739
125909
  var getWranglerJsoncPath = (ctx) => {
125740
- return (0, import_node_path24.resolve)(ctx.project.path, "wrangler.jsonc");
125910
+ return (0, import_node_path28.resolve)(ctx.project.path, "wrangler.jsonc");
125741
125911
  };
125742
125912
  var wranglerTomlExists = (ctx) => {
125743
125913
  const wranglerTomlPath = getWranglerTomlPath(ctx);
125744
- return (0, import_node_fs22.existsSync)(wranglerTomlPath);
125914
+ return (0, import_node_fs23.existsSync)(wranglerTomlPath);
125745
125915
  };
125746
125916
  var wranglerJsonOrJsoncExists = (ctx) => {
125747
125917
  const wranglerJsonPath = getWranglerJsonPath(ctx);
125748
125918
  const wranglerJsoncPath = getWranglerJsoncPath(ctx);
125749
- return (0, import_node_fs22.existsSync)(wranglerJsonPath) || (0, import_node_fs22.existsSync)(wranglerJsoncPath);
125919
+ return (0, import_node_fs23.existsSync)(wranglerJsonPath) || (0, import_node_fs23.existsSync)(wranglerJsoncPath);
125750
125920
  };
125751
125921
  var readWranglerToml = (ctx) => {
125752
125922
  const wranglerTomlPath = getWranglerTomlPath(ctx);
@@ -125754,7 +125924,7 @@ var readWranglerToml = (ctx) => {
125754
125924
  };
125755
125925
  var readWranglerJsonOrJsonc = (ctx, reviver) => {
125756
125926
  const wranglerJsonPath = getWranglerJsonPath(ctx);
125757
- if ((0, import_node_fs22.existsSync)(wranglerJsonPath)) {
125927
+ if ((0, import_node_fs23.existsSync)(wranglerJsonPath)) {
125758
125928
  return readJSONWithComments(wranglerJsonPath, reviver);
125759
125929
  }
125760
125930
  const wranglerJsoncPath = getWranglerJsoncPath(ctx);
@@ -125766,7 +125936,7 @@ var writeWranglerToml = (ctx, contents) => {
125766
125936
  };
125767
125937
  var writeWranglerJsonOrJsonc = (ctx, config50) => {
125768
125938
  const wranglerJsonPath = getWranglerJsonPath(ctx);
125769
- if ((0, import_node_fs22.existsSync)(wranglerJsonPath)) {
125939
+ if ((0, import_node_fs23.existsSync)(wranglerJsonPath)) {
125770
125940
  return writeJSONWithComments(wranglerJsonPath, config50);
125771
125941
  }
125772
125942
  const wranglerJsoncPath = getWranglerJsoncPath(ctx);
@@ -125774,10 +125944,10 @@ var writeWranglerJsonOrJsonc = (ctx, config50) => {
125774
125944
  };
125775
125945
  var addVscodeConfig = (ctx) => {
125776
125946
  const settingsPath = `${ctx.project.path}/.vscode/settings.json`;
125777
- if ((0, import_node_fs22.existsSync)(settingsPath)) {
125947
+ if ((0, import_node_fs23.existsSync)(settingsPath)) {
125778
125948
  return;
125779
125949
  }
125780
- (0, import_node_fs22.mkdirSync)(`${ctx.project.path}/.vscode`, { recursive: true });
125950
+ (0, import_node_fs23.mkdirSync)(`${ctx.project.path}/.vscode`, { recursive: true });
125781
125951
  writeJSON(settingsPath, {
125782
125952
  "files.associations": {
125783
125953
  "wrangler.json": "jsonc"
@@ -125926,7 +126096,7 @@ var offerToDeploy = async (ctx) => {
125926
126096
  return false;
125927
126097
  }
125928
126098
  ctx.deployment = {};
125929
- const loginSuccess = await wranglerLogin(ctx);
126099
+ const loginSuccess = await login2(ctx);
125930
126100
  if (!loginSuccess) {
125931
126101
  return false;
125932
126102
  }
@@ -125934,7 +126104,7 @@ var offerToDeploy = async (ctx) => {
125934
126104
  return true;
125935
126105
  };
125936
126106
  var isDeployable = async (ctx) => {
125937
- if (ctx.template.platform === "pages") {
126107
+ if (ctx.template.platform === "pages" || usesCfCli(ctx.project.path)) {
125938
126108
  return true;
125939
126109
  }
125940
126110
  const wranglerConfig = readWranglerConfig(ctx);
@@ -125963,10 +126133,8 @@ var runDeploy = async (ctx) => {
125963
126133
  JSON.stringify(ctx.commitMessage)
125964
126134
  ] : []
125965
126135
  ];
125966
- const outputFile = (0, import_node_path25.join)(
125967
- await (0, import_promises11.mkdtemp)((0, import_node_path25.join)((0, import_node_os9.tmpdir)(), "c3-wrangler-deploy-")),
125968
- "output.json"
125969
- );
126136
+ const useCf = usesCfCli(ctx.project.path);
126137
+ const outputFile = useCf ? void 0 : (0, import_node_path29.join)(await (0, import_promises11.mkdtemp)((0, import_node_path29.join)((0, import_node_os9.tmpdir)(), "c3-wrangler-deploy-")), "output.json");
125970
126138
  await runCommand(deployCmd, {
125971
126139
  cwd: ctx.project.path,
125972
126140
  env: {
@@ -125979,26 +126147,27 @@ var runDeploy = async (ctx) => {
125979
126147
  `via \`${quoteShellArgs(baseDeployCmd)}\``
125980
126148
  )}`
125981
126149
  });
125982
- try {
125983
- const contents = readFile2(outputFile);
125984
- const entries = contents.split("\n").filter(Boolean).map((entry) => JSON.parse(entry));
125985
- const url2 = entries.find((entry) => entry.type === "deploy")?.targets?.[0] ?? entries.find((entry) => entry.type === "pages-deploy")?.url;
125986
- const deployedUrlRegex = /https:\/\/.+\.(pages|workers)\.dev/;
125987
- const deployedUrlMatch = url2?.match(deployedUrlRegex);
125988
- if (deployedUrlMatch) {
125989
- ctx.deployment.url = deployedUrlMatch[0];
125990
- } else {
125991
- throw new Error("Failed to find deployment url.");
125992
- }
125993
- } catch {
126150
+ const url2 = outputFile ? readDeploymentUrl(outputFile) : await getDeploymentUrl(ctx.project.path, ctx.account.id);
126151
+ const deployedUrlRegex = /https:\/\/.+\.(pages|workers)\.dev/;
126152
+ const deployedUrlMatch = url2?.match(deployedUrlRegex);
126153
+ if (!deployedUrlMatch) {
125994
126154
  throw new Error("Failed to find deployment url.");
125995
126155
  }
126156
+ ctx.deployment.url = deployedUrlMatch[0];
125996
126157
  if (ctx.deployment.url?.endsWith(".pages.dev")) {
125997
126158
  const [proto2, hostname3] = ctx.deployment.url.split("://");
125998
126159
  const hostnameWithoutSHA1 = hostname3.split(".").slice(-3).join(".");
125999
126160
  ctx.deployment.url = `${proto2}://${hostnameWithoutSHA1}`;
126000
126161
  }
126001
126162
  };
126163
+ function readDeploymentUrl(outputFile) {
126164
+ try {
126165
+ const entries = readFile2(outputFile).split("\n").filter(Boolean).map((entry) => JSON.parse(entry));
126166
+ return entries.find((entry) => entry.type === "deploy")?.targets?.[0] ?? entries.find((entry) => entry.type === "pages-deploy")?.url;
126167
+ } catch {
126168
+ return void 0;
126169
+ }
126170
+ }
126002
126171
  var maybeOpenBrowser = async (ctx) => {
126003
126172
  if (ctx.deployment.url) {
126004
126173
  const success2 = await poll(ctx.deployment.url);
@@ -126026,7 +126195,7 @@ var hasBinding = (node2) => {
126026
126195
  };
126027
126196
 
126028
126197
  // src/dialog.ts
126029
- var import_node_path26 = require("node:path");
126198
+ var import_node_path30 = require("node:path");
126030
126199
  function createDialog(lines) {
126031
126200
  const screenWidth = process.stdout.columns;
126032
126201
  const maxLineWidth = Math.max(
@@ -126066,7 +126235,7 @@ function printWelcomeMessage(version4, telemetryEnabled, args) {
126066
126235
  }
126067
126236
  var printSummary = (ctx) => {
126068
126237
  const dashboardUrl = ctx.account ? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}/production` : null;
126069
- const relativePath = (0, import_node_path26.relative)(ctx.originalCWD, ctx.project.path);
126238
+ const relativePath = (0, import_node_path30.relative)(ctx.originalCWD, ctx.project.path);
126070
126239
  const cdCommand = relativePath ? `cd ${relativePath}` : null;
126071
126240
  const { npm: npm25 } = detectPackageManager();
126072
126241
  const deployCommand = quoteShellArgs([
@@ -126536,9 +126705,26 @@ var createProject = async (ctx) => {
126536
126705
  }
126537
126706
  };
126538
126707
 
126708
+ // src/project-directory.ts
126709
+ var import_node_fs24 = require("node:fs");
126710
+ var import_node_path31 = require("node:path");
126711
+ var import_node_process15 = require("node:process");
126712
+ var setupProjectDirectory = (ctx) => {
126713
+ const path9 = ctx.project.path;
126714
+ const err = validateProjectDirectory(path9, ctx.args);
126715
+ if (err) {
126716
+ throw new Error(err);
126717
+ }
126718
+ const directory = (0, import_node_path31.dirname)(path9);
126719
+ if (!(0, import_node_fs24.existsSync)(directory)) {
126720
+ (0, import_node_fs24.mkdirSync)(directory, { recursive: true });
126721
+ }
126722
+ (0, import_node_process15.chdir)(directory);
126723
+ };
126724
+
126539
126725
  // src/workers.ts
126540
- var import_node_fs23 = require("node:fs");
126541
- var import_node_path27 = require("node:path");
126726
+ var import_node_fs25 = require("node:fs");
126727
+ var import_node_path32 = require("node:path");
126542
126728
 
126543
126729
  // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
126544
126730
  function createScanner2(text, ignoreTrivia = false) {
@@ -127867,9 +128053,12 @@ async function addTypes(ctx) {
127867
128053
  const usesNodeCompat = await maybeInstallNodeTypes(ctx, npm25);
127868
128054
  await updateTsConfig(ctx, { usesNodeCompat });
127869
128055
  }
128056
+ function getTypesPath(ctx) {
128057
+ return usesCfCli(ctx.project.path) ? CF_TYPES_PATH : ctx.template.typesPath ?? "./worker-configuration.d.ts";
128058
+ }
127870
128059
  async function generateWorkersTypes(ctx, npm25) {
127871
- const packageJsonPath = (0, import_node_path27.join)(ctx.project.path, "package.json");
127872
- if (!(0, import_node_fs23.existsSync)(packageJsonPath)) {
128060
+ const packageJsonPath = (0, import_node_path32.join)(ctx.project.path, "package.json");
128061
+ if (!(0, import_node_fs25.existsSync)(packageJsonPath)) {
127873
128062
  return;
127874
128063
  }
127875
128064
  const packageManifest = readJSON(packageJsonPath);
@@ -127881,7 +128070,7 @@ async function generateWorkersTypes(ctx, npm25) {
127881
128070
  cwd: ctx.project.path,
127882
128071
  silent: true,
127883
128072
  startText: "Generating types for your application",
127884
- doneText: `${brandColor("generated")} ${dim(`to \`${ctx.template.typesPath}\` via \`${typesCmd.join(" ")}\``)}`
128073
+ doneText: `${brandColor("generated")} ${dim(`to \`${getTypesPath(ctx)}\` via \`${typesCmd.join(" ")}\``)}`
127885
128074
  });
127886
128075
  if (packageManifest["devDependencies"]?.["@cloudflare/workers-types"]) {
127887
128076
  delete packageManifest["devDependencies"]?.["@cloudflare/workers-types"];
@@ -127912,8 +128101,8 @@ var maybeInstallNodeTypes = async (ctx, npm25) => {
127912
128101
  return false;
127913
128102
  };
127914
128103
  async function updateTsConfig(ctx, { usesNodeCompat }) {
127915
- const tsconfigPath = (0, import_node_path27.join)(ctx.project.path, "tsconfig.json");
127916
- if (!(0, import_node_fs23.existsSync)(tsconfigPath)) {
128104
+ const tsconfigPath = (0, import_node_path32.join)(ctx.project.path, "tsconfig.json");
128105
+ if (!(0, import_node_fs25.existsSync)(tsconfigPath)) {
127917
128106
  return;
127918
128107
  }
127919
128108
  const tsconfig = readFile2(tsconfigPath);
@@ -127936,8 +128125,8 @@ async function updateTsConfig(ctx, { usesNodeCompat }) {
127936
128125
  newTypes.delete("@cloudflare/workers-types");
127937
128126
  if (entrypointVersion !== null) {
127938
128127
  newTypes.add(`@cloudflare/workers-types/${entrypointVersion}`);
127939
- } else if ((0, import_node_fs23.existsSync)(
127940
- (0, import_node_path27.join)(
128128
+ } else if ((0, import_node_fs25.existsSync)(
128129
+ (0, import_node_path32.join)(
127941
128130
  ctx.project.path,
127942
128131
  "node_modules",
127943
128132
  "@cloudflare",
@@ -127948,10 +128137,10 @@ async function updateTsConfig(ctx, { usesNodeCompat }) {
127948
128137
  }
127949
128138
  }
127950
128139
  } else if (ctx.template.workersTypes === "generated") {
127951
- newTypes.add(ctx.template.typesPath ?? "./worker-configuration.d.ts");
127952
- const typegen = readFile2(
127953
- ctx.template.typesPath ?? "./worker-configuration.d.ts"
127954
- ).split("\n");
128140
+ if (!usesCfCli(ctx.project.path)) {
128141
+ newTypes.add(getTypesPath(ctx));
128142
+ }
128143
+ const typegen = readFile2(getTypesPath(ctx)).split("\n");
127955
128144
  if (typegen.some(
127956
128145
  (line) => line.includes("// Runtime types generated with workerd")
127957
128146
  )) {
@@ -127965,6 +128154,9 @@ async function updateTsConfig(ctx, { usesNodeCompat }) {
127965
128154
  if (usesNodeCompat) {
127966
128155
  newTypes.add("node");
127967
128156
  }
128157
+ if (newTypes.size === 0 && config50.compilerOptions?.types === void 0) {
128158
+ return;
128159
+ }
127968
128160
  const useSpaces = !tsconfig.match(/\t/g);
127969
128161
  const edits = modify2(
127970
128162
  tsconfig,
@@ -128044,16 +128236,6 @@ var runCli = async (args) => {
128044
128236
  printSummary(ctx);
128045
128237
  logRaw("");
128046
128238
  };
128047
- var setupProjectDirectory = (ctx) => {
128048
- const path9 = ctx.project.path;
128049
- const err = validateProjectDirectory(path9, ctx.args);
128050
- if (err) {
128051
- throw new Error(err);
128052
- }
128053
- const directory = (0, import_node_path28.dirname)(path9);
128054
- (0, import_node_fs24.mkdirSync)(directory, { recursive: true });
128055
- (0, import_node_process15.chdir)(directory);
128056
- };
128057
128239
  var create = async (ctx) => {
128058
128240
  const { template } = ctx;
128059
128241
  setupProjectDirectory(ctx);
@@ -128065,7 +128247,7 @@ var create = async (ctx) => {
128065
128247
  }
128066
128248
  updatePackageName(ctx);
128067
128249
  writePnpmBuildApprovals(ctx.project.path);
128068
- (0, import_node_process15.chdir)(ctx.project.path);
128250
+ (0, import_node_process16.chdir)(ctx.project.path);
128069
128251
  await npmInstall(ctx);
128070
128252
  await rectifyPmMismatch(ctx);
128071
128253
  if (ctx.template.platform === "workers" && !ctx.template.frameworkCli) {
@@ -128078,7 +128260,11 @@ var configure17 = async (ctx) => {
128078
128260
  `Configuring your application for Cloudflare${ctx.args.experimental ? ` via \`wrangler setup\`` : ""}`,
128079
128261
  "Step 2 of 3"
128080
128262
  );
128081
- await installWrangler2();
128263
+ if (usesCfCli(ctx.project.path)) {
128264
+ await installCf();
128265
+ } else {
128266
+ await installWrangler2();
128267
+ }
128082
128268
  if (ctx.args.experimental) {
128083
128269
  const { npx: npx6 } = detectPackageManager();
128084
128270
  await runWranglerCommand([
@@ -128147,8 +128333,7 @@ ${getPnpmIgnoredBuildsGuidance(e.packages)}`);
128147
128333
  // Annotate the CommonJS export names for ESM import in node:
128148
128334
  0 && (module.exports = {
128149
128335
  main,
128150
- runCli,
128151
- setupProjectDirectory
128336
+ runCli
128152
128337
  });
128153
128338
  /*! Bundled license information:
128154
128339