create-cloudflare 2.69.0 → 2.70.1

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
@@ -2696,9 +2696,9 @@ var require_dispatcher_base = __commonJS({
2696
2696
  }
2697
2697
  close(callback) {
2698
2698
  if (callback === void 0) {
2699
- return new Promise((resolve12, reject) => {
2699
+ return new Promise((resolve13, reject) => {
2700
2700
  this.close((err, data) => {
2701
- return err ? reject(err) : resolve12(data);
2701
+ return err ? reject(err) : resolve13(data);
2702
2702
  });
2703
2703
  });
2704
2704
  }
@@ -2736,9 +2736,9 @@ var require_dispatcher_base = __commonJS({
2736
2736
  err = null;
2737
2737
  }
2738
2738
  if (callback === void 0) {
2739
- return new Promise((resolve12, reject) => {
2739
+ return new Promise((resolve13, reject) => {
2740
2740
  this.destroy(err, (err2, data) => {
2741
- return err2 ? reject(err2) : resolve12(data);
2741
+ return err2 ? reject(err2) : resolve13(data);
2742
2742
  });
2743
2743
  });
2744
2744
  }
@@ -5730,7 +5730,7 @@ var require_formdata = __commonJS({
5730
5730
  var { kEnumerableProperty } = require_util();
5731
5731
  var { webidl } = require_webidl();
5732
5732
  var nodeUtil = require("node:util");
5733
- var FormData = class _FormData {
5733
+ var FormData2 = class _FormData {
5734
5734
  #state = [];
5735
5735
  constructor(form = void 0) {
5736
5736
  webidl.util.markAsUncloneable(this);
@@ -5847,11 +5847,11 @@ var require_formdata = __commonJS({
5847
5847
  formData.#state = newState;
5848
5848
  }
5849
5849
  };
5850
- var { getFormDataState, setFormDataState } = FormData;
5851
- Reflect.deleteProperty(FormData, "getFormDataState");
5852
- Reflect.deleteProperty(FormData, "setFormDataState");
5853
- iteratorMixin("FormData", FormData, getFormDataState, "name", "value");
5854
- Object.defineProperties(FormData.prototype, {
5850
+ var { getFormDataState, setFormDataState } = FormData2;
5851
+ Reflect.deleteProperty(FormData2, "getFormDataState");
5852
+ Reflect.deleteProperty(FormData2, "setFormDataState");
5853
+ iteratorMixin("FormData", FormData2, getFormDataState, "name", "value");
5854
+ Object.defineProperties(FormData2.prototype, {
5855
5855
  append: kEnumerableProperty,
5856
5856
  delete: kEnumerableProperty,
5857
5857
  get: kEnumerableProperty,
@@ -5879,8 +5879,8 @@ var require_formdata = __commonJS({
5879
5879
  }
5880
5880
  return { name: name3, value };
5881
5881
  }
5882
- webidl.is.FormData = webidl.util.MakeTypeAssertion(FormData);
5883
- module2.exports = { FormData, makeEntry, setFormDataState };
5882
+ webidl.is.FormData = webidl.util.MakeTypeAssertion(FormData2);
5883
+ module2.exports = { FormData: FormData2, makeEntry, setFormDataState };
5884
5884
  }
5885
5885
  });
5886
5886
 
@@ -6215,8 +6215,8 @@ var require_promise = __commonJS({
6215
6215
  function createDeferredPromise() {
6216
6216
  let res;
6217
6217
  let rej;
6218
- const promise = new Promise((resolve12, reject) => {
6219
- res = resolve12;
6218
+ const promise = new Promise((resolve13, reject) => {
6219
+ res = resolve13;
6220
6220
  rej = reject;
6221
6221
  });
6222
6222
  return { promise, resolve: res, reject: rej };
@@ -6238,7 +6238,7 @@ var require_body = __commonJS({
6238
6238
  fullyReadBody,
6239
6239
  extractMimeType
6240
6240
  } = require_util2();
6241
- var { FormData, setFormDataState } = require_formdata();
6241
+ var { FormData: FormData2, setFormDataState } = require_formdata();
6242
6242
  var { webidl } = require_webidl();
6243
6243
  var assert7 = require("node:assert");
6244
6244
  var { isErrored, isDisturbed } = require("node:stream");
@@ -6431,13 +6431,13 @@ Content-Type: ${value.type || "application/octet-stream"}\r
6431
6431
  switch (mimeType.essence) {
6432
6432
  case "multipart/form-data": {
6433
6433
  const parsed = multipartFormDataParser(value, mimeType);
6434
- const fd = new FormData();
6434
+ const fd = new FormData2();
6435
6435
  setFormDataState(fd, parsed);
6436
6436
  return fd;
6437
6437
  }
6438
6438
  case "application/x-www-form-urlencoded": {
6439
6439
  const entries = new URLSearchParams(value.toString());
6440
- const fd = new FormData();
6440
+ const fd = new FormData2();
6441
6441
  for (const [name3, value2] of entries) {
6442
6442
  fd.append(name3, value2);
6443
6443
  }
@@ -7517,12 +7517,12 @@ upgrade: ${upgrade}\r
7517
7517
  cb();
7518
7518
  }
7519
7519
  }
7520
- const waitForDrain = () => new Promise((resolve12, reject) => {
7520
+ const waitForDrain = () => new Promise((resolve13, reject) => {
7521
7521
  assert7(callback === null);
7522
7522
  if (socket[kError]) {
7523
7523
  reject(socket[kError]);
7524
7524
  } else {
7525
- callback = resolve12;
7525
+ callback = resolve13;
7526
7526
  }
7527
7527
  });
7528
7528
  socket.on("close", onDrain).on("drain", onDrain);
@@ -8367,12 +8367,12 @@ var require_client_h2 = __commonJS({
8367
8367
  cb();
8368
8368
  }
8369
8369
  }
8370
- const waitForDrain = () => new Promise((resolve12, reject) => {
8370
+ const waitForDrain = () => new Promise((resolve13, reject) => {
8371
8371
  assert7(callback === null);
8372
8372
  if (socket[kError]) {
8373
8373
  reject(socket[kError]);
8374
8374
  } else {
8375
- callback = resolve12;
8375
+ callback = resolve13;
8376
8376
  }
8377
8377
  });
8378
8378
  h2stream.on("close", onDrain).on("drain", onDrain);
@@ -8683,16 +8683,16 @@ var require_client = __commonJS({
8683
8683
  return this[kNeedDrain] < 2;
8684
8684
  }
8685
8685
  [kClose]() {
8686
- return new Promise((resolve12) => {
8686
+ return new Promise((resolve13) => {
8687
8687
  if (this[kSize]) {
8688
- this[kClosedResolve] = resolve12;
8688
+ this[kClosedResolve] = resolve13;
8689
8689
  } else {
8690
- resolve12(null);
8690
+ resolve13(null);
8691
8691
  }
8692
8692
  });
8693
8693
  }
8694
8694
  [kDestroy](err) {
8695
- return new Promise((resolve12) => {
8695
+ return new Promise((resolve13) => {
8696
8696
  const requests = this[kQueue].splice(this[kPendingIdx]);
8697
8697
  for (let i = 0; i < requests.length; i++) {
8698
8698
  const request2 = requests[i];
@@ -8703,7 +8703,7 @@ var require_client = __commonJS({
8703
8703
  this[kClosedResolve]();
8704
8704
  this[kClosedResolve] = null;
8705
8705
  }
8706
- resolve12(null);
8706
+ resolve13(null);
8707
8707
  };
8708
8708
  if (this[kHTTPContext]) {
8709
8709
  this[kHTTPContext].destroy(err, callback);
@@ -9108,8 +9108,8 @@ var require_pool_base = __commonJS({
9108
9108
  }
9109
9109
  return Promise.all(closeAll);
9110
9110
  } else {
9111
- return new Promise((resolve12) => {
9112
- this[kClosedResolve] = resolve12;
9111
+ return new Promise((resolve13) => {
9112
+ this[kClosedResolve] = resolve13;
9113
9113
  });
9114
9114
  }
9115
9115
  }
@@ -10201,10 +10201,10 @@ var require_socks5_proxy_agent = __commonJS({
10201
10201
  const proxyHost = this[kProxyUrl].hostname;
10202
10202
  const proxyPort = parseInt(this[kProxyUrl].port) || 1080;
10203
10203
  debug("creating SOCKS5 connection to", proxyHost, proxyPort);
10204
- const socket = await new Promise((resolve12, reject) => {
10204
+ const socket = await new Promise((resolve13, reject) => {
10205
10205
  const onConnect = () => {
10206
10206
  socket2.removeListener("error", onError);
10207
- resolve12(socket2);
10207
+ resolve13(socket2);
10208
10208
  };
10209
10209
  const onError = (err) => {
10210
10210
  socket2.removeListener("connect", onConnect);
@@ -10223,14 +10223,14 @@ var require_socks5_proxy_agent = __commonJS({
10223
10223
  socket.destroy();
10224
10224
  });
10225
10225
  await socks5Client.handshake();
10226
- await new Promise((resolve12, reject) => {
10226
+ await new Promise((resolve13, reject) => {
10227
10227
  const timeout = setTimeout(() => {
10228
10228
  reject(new Error("SOCKS5 authentication timeout"));
10229
10229
  }, 5e3);
10230
10230
  const onAuthenticated = () => {
10231
10231
  clearTimeout(timeout);
10232
10232
  socks5Client.removeListener("error", onError);
10233
- resolve12();
10233
+ resolve13();
10234
10234
  };
10235
10235
  const onError = (err) => {
10236
10236
  clearTimeout(timeout);
@@ -10239,14 +10239,14 @@ var require_socks5_proxy_agent = __commonJS({
10239
10239
  };
10240
10240
  if (socks5Client.state === "authenticated") {
10241
10241
  clearTimeout(timeout);
10242
- resolve12();
10242
+ resolve13();
10243
10243
  } else {
10244
10244
  socks5Client.once("authenticated", onAuthenticated);
10245
10245
  socks5Client.once("error", onError);
10246
10246
  }
10247
10247
  });
10248
10248
  await socks5Client.connect(targetHost, targetPort);
10249
- await new Promise((resolve12, reject) => {
10249
+ await new Promise((resolve13, reject) => {
10250
10250
  const timeout = setTimeout(() => {
10251
10251
  reject(new Error("SOCKS5 connection timeout"));
10252
10252
  }, 5e3);
@@ -10254,7 +10254,7 @@ var require_socks5_proxy_agent = __commonJS({
10254
10254
  debug("SOCKS5 tunnel established to", targetHost, targetPort, "via", info);
10255
10255
  clearTimeout(timeout);
10256
10256
  socks5Client.removeListener("error", onError);
10257
- resolve12();
10257
+ resolve13();
10258
10258
  };
10259
10259
  const onError = (err) => {
10260
10260
  clearTimeout(timeout);
@@ -10295,8 +10295,8 @@ var require_socks5_proxy_agent = __commonJS({
10295
10295
  servername: targetHost,
10296
10296
  ...connectOpts.tls || {}
10297
10297
  });
10298
- await new Promise((resolve12, reject) => {
10299
- finalSocket.once("secureConnect", resolve12);
10298
+ await new Promise((resolve13, reject) => {
10299
+ finalSocket.once("secureConnect", resolve13);
10300
10300
  finalSocket.once("error", reject);
10301
10301
  });
10302
10302
  }
@@ -11321,7 +11321,7 @@ var require_readable = __commonJS({
11321
11321
  if (this._readableState.closeEmitted) {
11322
11322
  return Promise.resolve(null);
11323
11323
  }
11324
- return new Promise((resolve12, reject) => {
11324
+ return new Promise((resolve13, reject) => {
11325
11325
  if (this[kContentLength] && this[kContentLength] > limit || this[kBytesRead] > limit) {
11326
11326
  this.destroy(new AbortError());
11327
11327
  }
@@ -11335,11 +11335,11 @@ var require_readable = __commonJS({
11335
11335
  if (signal.aborted) {
11336
11336
  reject(signal.reason ?? new AbortError());
11337
11337
  } else {
11338
- resolve12(null);
11338
+ resolve13(null);
11339
11339
  }
11340
11340
  });
11341
11341
  } else {
11342
- this.on("close", resolve12);
11342
+ this.on("close", resolve13);
11343
11343
  }
11344
11344
  this.on("error", noop).on("data", () => {
11345
11345
  if (this[kBytesRead] > limit) {
@@ -11367,7 +11367,7 @@ var require_readable = __commonJS({
11367
11367
  }
11368
11368
  function consume(stream, type) {
11369
11369
  assert7(!stream[kConsume]);
11370
- return new Promise((resolve12, reject) => {
11370
+ return new Promise((resolve13, reject) => {
11371
11371
  if (isUnusable(stream)) {
11372
11372
  const rState = stream._readableState;
11373
11373
  if (rState.destroyed && rState.closeEmitted === false) {
@@ -11382,7 +11382,7 @@ var require_readable = __commonJS({
11382
11382
  stream[kConsume] = {
11383
11383
  type,
11384
11384
  stream,
11385
- resolve: resolve12,
11385
+ resolve: resolve13,
11386
11386
  reject,
11387
11387
  length: 0,
11388
11388
  body: []
@@ -11456,18 +11456,18 @@ var require_readable = __commonJS({
11456
11456
  return buffer;
11457
11457
  }
11458
11458
  function consumeEnd(consume2, encoding) {
11459
- const { type, body, resolve: resolve12, stream, length } = consume2;
11459
+ const { type, body, resolve: resolve13, stream, length } = consume2;
11460
11460
  try {
11461
11461
  if (type === "text") {
11462
- resolve12(chunksDecode(body, length, encoding));
11462
+ resolve13(chunksDecode(body, length, encoding));
11463
11463
  } else if (type === "json") {
11464
- resolve12(JSON.parse(chunksDecode(body, length, encoding)));
11464
+ resolve13(JSON.parse(chunksDecode(body, length, encoding)));
11465
11465
  } else if (type === "arrayBuffer") {
11466
- resolve12(chunksConcat(body, length).buffer);
11466
+ resolve13(chunksConcat(body, length).buffer);
11467
11467
  } else if (type === "blob") {
11468
- resolve12(new Blob(body, { type: stream[kContentType] }));
11468
+ resolve13(new Blob(body, { type: stream[kContentType] }));
11469
11469
  } else if (type === "bytes") {
11470
- resolve12(chunksConcat(body, length));
11470
+ resolve13(chunksConcat(body, length));
11471
11471
  }
11472
11472
  consumeFinish(consume2);
11473
11473
  } catch (err) {
@@ -11657,9 +11657,9 @@ var require_api_request = __commonJS({
11657
11657
  };
11658
11658
  function request2(opts, callback) {
11659
11659
  if (callback === void 0) {
11660
- return new Promise((resolve12, reject) => {
11660
+ return new Promise((resolve13, reject) => {
11661
11661
  request2.call(this, opts, (err, data) => {
11662
- return err ? reject(err) : resolve12(data);
11662
+ return err ? reject(err) : resolve13(data);
11663
11663
  });
11664
11664
  });
11665
11665
  }
@@ -11871,9 +11871,9 @@ var require_api_stream = __commonJS({
11871
11871
  };
11872
11872
  function stream(opts, factory, callback) {
11873
11873
  if (callback === void 0) {
11874
- return new Promise((resolve12, reject) => {
11874
+ return new Promise((resolve13, reject) => {
11875
11875
  stream.call(this, opts, factory, (err, data) => {
11876
- return err ? reject(err) : resolve12(data);
11876
+ return err ? reject(err) : resolve13(data);
11877
11877
  });
11878
11878
  });
11879
11879
  }
@@ -12161,9 +12161,9 @@ var require_api_upgrade = __commonJS({
12161
12161
  };
12162
12162
  function upgrade(opts, callback) {
12163
12163
  if (callback === void 0) {
12164
- return new Promise((resolve12, reject) => {
12164
+ return new Promise((resolve13, reject) => {
12165
12165
  upgrade.call(this, opts, (err, data) => {
12166
- return err ? reject(err) : resolve12(data);
12166
+ return err ? reject(err) : resolve13(data);
12167
12167
  });
12168
12168
  });
12169
12169
  }
@@ -12256,9 +12256,9 @@ var require_api_connect = __commonJS({
12256
12256
  };
12257
12257
  function connect(opts, callback) {
12258
12258
  if (callback === void 0) {
12259
- return new Promise((resolve12, reject) => {
12259
+ return new Promise((resolve13, reject) => {
12260
12260
  connect.call(this, opts, (err, data) => {
12261
- return err ? reject(err) : resolve12(data);
12261
+ return err ? reject(err) : resolve13(data);
12262
12262
  });
12263
12263
  });
12264
12264
  }
@@ -13532,7 +13532,7 @@ var require_snapshot_recorder = __commonJS({
13532
13532
  "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/mock/snapshot-recorder.js"(exports2, module2) {
13533
13533
  "use strict";
13534
13534
  var { writeFile: writeFile4, readFile: readFile2, mkdir } = require("node:fs/promises");
13535
- var { dirname: dirname7, resolve: resolve12 } = require("node:path");
13535
+ var { dirname: dirname7, resolve: resolve13 } = require("node:path");
13536
13536
  var { setTimeout: setTimeout6, clearTimeout: clearTimeout2 } = require("node:timers");
13537
13537
  var { InvalidArgumentError, UndiciError } = require_errors();
13538
13538
  var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
@@ -13733,7 +13733,7 @@ var require_snapshot_recorder = __commonJS({
13733
13733
  throw new InvalidArgumentError("Snapshot path is required");
13734
13734
  }
13735
13735
  try {
13736
- const data = await readFile2(resolve12(path6), "utf8");
13736
+ const data = await readFile2(resolve13(path6), "utf8");
13737
13737
  const parsed = JSON.parse(data);
13738
13738
  if (Array.isArray(parsed)) {
13739
13739
  this.#snapshots.clear();
@@ -13762,7 +13762,7 @@ var require_snapshot_recorder = __commonJS({
13762
13762
  if (!path6) {
13763
13763
  throw new InvalidArgumentError("Snapshot path is required");
13764
13764
  }
13765
- const resolvedPath = resolve12(path6);
13765
+ const resolvedPath = resolve13(path6);
13766
13766
  await mkdir(dirname7(resolvedPath), { recursive: true });
13767
13767
  const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
13768
13768
  hash,
@@ -18133,7 +18133,7 @@ var require_headers = __commonJS({
18133
18133
  }
18134
18134
  }
18135
18135
  };
18136
- var Headers = class _Headers {
18136
+ var Headers2 = class _Headers {
18137
18137
  #guard;
18138
18138
  /**
18139
18139
  * @type {HeadersList}
@@ -18274,13 +18274,13 @@ var require_headers = __commonJS({
18274
18274
  target.#headersList = list;
18275
18275
  }
18276
18276
  };
18277
- var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers;
18278
- Reflect.deleteProperty(Headers, "getHeadersGuard");
18279
- Reflect.deleteProperty(Headers, "setHeadersGuard");
18280
- Reflect.deleteProperty(Headers, "getHeadersList");
18281
- Reflect.deleteProperty(Headers, "setHeadersList");
18282
- iteratorMixin("Headers", Headers, headersListSortAndCombine, 0, 1);
18283
- Object.defineProperties(Headers.prototype, {
18277
+ var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers2;
18278
+ Reflect.deleteProperty(Headers2, "getHeadersGuard");
18279
+ Reflect.deleteProperty(Headers2, "setHeadersGuard");
18280
+ Reflect.deleteProperty(Headers2, "getHeadersList");
18281
+ Reflect.deleteProperty(Headers2, "setHeadersList");
18282
+ iteratorMixin("Headers", Headers2, headersListSortAndCombine, 0, 1);
18283
+ Object.defineProperties(Headers2.prototype, {
18284
18284
  append: kEnumerableProperty,
18285
18285
  delete: kEnumerableProperty,
18286
18286
  get: kEnumerableProperty,
@@ -18298,7 +18298,7 @@ var require_headers = __commonJS({
18298
18298
  webidl.converters.HeadersInit = function(V2, prefix, argument) {
18299
18299
  if (webidl.util.Type(V2) === webidl.util.Types.OBJECT) {
18300
18300
  const iterator = Reflect.get(V2, Symbol.iterator);
18301
- if (!util2.types.isProxy(V2) && iterator === Headers.prototype.entries) {
18301
+ if (!util2.types.isProxy(V2) && iterator === Headers2.prototype.entries) {
18302
18302
  try {
18303
18303
  return getHeadersList(V2).entriesList;
18304
18304
  } catch {
@@ -18319,7 +18319,7 @@ var require_headers = __commonJS({
18319
18319
  fill,
18320
18320
  // for test.
18321
18321
  compareHeaderName,
18322
- Headers,
18322
+ Headers: Headers2,
18323
18323
  HeadersList,
18324
18324
  getHeadersGuard,
18325
18325
  setHeadersGuard,
@@ -18333,7 +18333,7 @@ var require_headers = __commonJS({
18333
18333
  var require_response = __commonJS({
18334
18334
  "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/response.js"(exports2, module2) {
18335
18335
  "use strict";
18336
- var { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers();
18336
+ var { Headers: Headers2, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers();
18337
18337
  var { extractBody, cloneBody, mixinBody, streamRegistry, bodyUnusable } = require_body();
18338
18338
  var util2 = require_util();
18339
18339
  var nodeUtil = require("node:util");
@@ -18355,7 +18355,7 @@ var require_response = __commonJS({
18355
18355
  var assert7 = require("node:assert");
18356
18356
  var { isomorphicEncode, serializeJavascriptValueToJSONString } = require_infra();
18357
18357
  var textEncoder = new TextEncoder("utf-8");
18358
- var Response = class _Response {
18358
+ var Response2 = class _Response {
18359
18359
  /** @type {Headers} */
18360
18360
  #headers;
18361
18361
  #state;
@@ -18409,7 +18409,7 @@ var require_response = __commonJS({
18409
18409
  }
18410
18410
  init = webidl.converters.ResponseInit(init);
18411
18411
  this.#state = makeResponse({});
18412
- this.#headers = new Headers(kConstruct);
18412
+ this.#headers = new Headers2(kConstruct);
18413
18413
  setHeadersGuard(this.#headers, "response");
18414
18414
  setHeadersList(this.#headers, this.#state.headersList);
18415
18415
  let bodyWithType = null;
@@ -18527,13 +18527,13 @@ var require_response = __commonJS({
18527
18527
  response.#state = newState;
18528
18528
  }
18529
18529
  };
18530
- var { getResponseHeaders, setResponseHeaders, getResponseState, setResponseState } = Response;
18531
- Reflect.deleteProperty(Response, "getResponseHeaders");
18532
- Reflect.deleteProperty(Response, "setResponseHeaders");
18533
- Reflect.deleteProperty(Response, "getResponseState");
18534
- Reflect.deleteProperty(Response, "setResponseState");
18535
- mixinBody(Response, getResponseState);
18536
- Object.defineProperties(Response.prototype, {
18530
+ var { getResponseHeaders, setResponseHeaders, getResponseState, setResponseState } = Response2;
18531
+ Reflect.deleteProperty(Response2, "getResponseHeaders");
18532
+ Reflect.deleteProperty(Response2, "setResponseHeaders");
18533
+ Reflect.deleteProperty(Response2, "getResponseState");
18534
+ Reflect.deleteProperty(Response2, "setResponseState");
18535
+ mixinBody(Response2, getResponseState);
18536
+ Object.defineProperties(Response2.prototype, {
18537
18537
  type: kEnumerableProperty,
18538
18538
  url: kEnumerableProperty,
18539
18539
  status: kEnumerableProperty,
@@ -18549,7 +18549,7 @@ var require_response = __commonJS({
18549
18549
  configurable: true
18550
18550
  }
18551
18551
  });
18552
- Object.defineProperties(Response, {
18552
+ Object.defineProperties(Response2, {
18553
18553
  json: kEnumerableProperty,
18554
18554
  redirect: kEnumerableProperty,
18555
18555
  error: kEnumerableProperty
@@ -18682,9 +18682,9 @@ var require_response = __commonJS({
18682
18682
  }
18683
18683
  }
18684
18684
  function fromInnerResponse(innerResponse, guard) {
18685
- const response = new Response(kConstruct);
18685
+ const response = new Response2(kConstruct);
18686
18686
  setResponseState(response, innerResponse);
18687
- const headers = new Headers(kConstruct);
18687
+ const headers = new Headers2(kConstruct);
18688
18688
  setResponseHeaders(response, headers);
18689
18689
  setHeadersList(headers, innerResponse.headersList);
18690
18690
  setHeadersGuard(headers, guard);
@@ -18736,14 +18736,14 @@ var require_response = __commonJS({
18736
18736
  converter: webidl.converters.HeadersInit
18737
18737
  }
18738
18738
  ]);
18739
- webidl.is.Response = webidl.util.MakeTypeAssertion(Response);
18739
+ webidl.is.Response = webidl.util.MakeTypeAssertion(Response2);
18740
18740
  module2.exports = {
18741
18741
  isNetworkError,
18742
18742
  makeNetworkError,
18743
18743
  makeResponse,
18744
18744
  makeAppropriateNetworkError,
18745
18745
  filterResponse,
18746
- Response,
18746
+ Response: Response2,
18747
18747
  cloneResponse,
18748
18748
  fromInnerResponse,
18749
18749
  getResponseState
@@ -18756,7 +18756,7 @@ var require_request2 = __commonJS({
18756
18756
  "../../node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/request.js"(exports2, module2) {
18757
18757
  "use strict";
18758
18758
  var { extractBody, mixinBody, cloneBody, bodyUnusable } = require_body();
18759
- var { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers();
18759
+ var { Headers: Headers2, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers();
18760
18760
  var util2 = require_util();
18761
18761
  var nodeUtil = require("node:util");
18762
18762
  var {
@@ -19025,7 +19025,7 @@ var require_request2 = __commonJS({
19025
19025
  requestFinalizer.register(ac, { signal, abort }, abort);
19026
19026
  }
19027
19027
  }
19028
- this.#headers = new Headers(kConstruct);
19028
+ this.#headers = new Headers2(kConstruct);
19029
19029
  setHeadersList(this.#headers, request2.headersList);
19030
19030
  setHeadersGuard(this.#headers, "request");
19031
19031
  if (mode === "no-cors") {
@@ -19366,7 +19366,7 @@ var require_request2 = __commonJS({
19366
19366
  setRequestState(request2, innerRequest);
19367
19367
  setRequestDispatcher(request2, dispatcher);
19368
19368
  setRequestSignal(request2, signal);
19369
- const headers = new Headers(kConstruct);
19369
+ const headers = new Headers2(kConstruct);
19370
19370
  setRequestHeaders(request2, headers);
19371
19371
  setHeadersList(headers, innerRequest.headersList);
19372
19372
  setHeadersGuard(headers, guard);
@@ -20604,7 +20604,7 @@ var require_fetch = __commonJS({
20604
20604
  const agent = fetchParams.controller.dispatcher;
20605
20605
  const path6 = url.pathname + url.search;
20606
20606
  const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === "?";
20607
- return new Promise((resolve12, reject) => agent.dispatch(
20607
+ return new Promise((resolve13, reject) => agent.dispatch(
20608
20608
  {
20609
20609
  path: hasTrailingQuestionMark ? `${path6}?` : path6,
20610
20610
  origin: url.origin,
@@ -20692,7 +20692,7 @@ var require_fetch = __commonJS({
20692
20692
  }
20693
20693
  }
20694
20694
  const onError = this.onError.bind(this);
20695
- resolve12({
20695
+ resolve13({
20696
20696
  status: status2,
20697
20697
  statusText,
20698
20698
  headersList,
@@ -20745,7 +20745,7 @@ var require_fetch = __commonJS({
20745
20745
  headersList.append(headerName, String(value), true);
20746
20746
  }
20747
20747
  }
20748
- resolve12({
20748
+ resolve13({
20749
20749
  status: status2,
20750
20750
  statusText: STATUS_CODES[status2],
20751
20751
  headersList,
@@ -20769,7 +20769,7 @@ var require_fetch = __commonJS({
20769
20769
  headersList.append(nameStr, value.toString("latin1"), true);
20770
20770
  }
20771
20771
  }
20772
- resolve12({
20772
+ resolve13({
20773
20773
  status: status2,
20774
20774
  statusText: STATUS_CODES[status2],
20775
20775
  headersList,
@@ -21810,8 +21810,8 @@ var require_cookies = __commonJS({
21810
21810
  var { parseSetCookie } = require_parse();
21811
21811
  var { stringify: stringify5 } = require_util4();
21812
21812
  var { webidl } = require_webidl();
21813
- var { Headers } = require_headers();
21814
- var brandChecks = webidl.brandCheckMultiple([Headers, globalThis.Headers].filter(Boolean));
21813
+ var { Headers: Headers2 } = require_headers();
21814
+ var brandChecks = webidl.brandCheckMultiple([Headers2, globalThis.Headers].filter(Boolean));
21815
21815
  function getCookies(headers) {
21816
21816
  webidl.argumentLengthCheck(arguments, 1, "getCookies");
21817
21817
  brandChecks(headers);
@@ -22552,7 +22552,7 @@ var require_connection = __commonJS({
22552
22552
  var { parseExtensions, isClosed, isClosing, isEstablished, isConnecting, validateCloseCodeAndReason } = require_util5();
22553
22553
  var { makeRequest } = require_request2();
22554
22554
  var { fetching } = require_fetch();
22555
- var { Headers, getHeadersList } = require_headers();
22555
+ var { Headers: Headers2, getHeadersList } = require_headers();
22556
22556
  var { getDecodeSplit } = require_util2();
22557
22557
  var { WebsocketFrameSend } = require_frame();
22558
22558
  var assert7 = require("node:assert");
@@ -22574,7 +22574,7 @@ var require_connection = __commonJS({
22574
22574
  useURLCredentials: true
22575
22575
  });
22576
22576
  if (options.headers) {
22577
- const headersList = getHeadersList(new Headers(options.headers));
22577
+ const headersList = getHeadersList(new Headers2(options.headers));
22578
22578
  request2.headersList = headersList;
22579
22579
  }
22580
22580
  const keyValue = crypto.randomBytes(16).toString("base64");
@@ -25782,12 +25782,12 @@ var require_isexe = __commonJS({
25782
25782
  if (typeof Promise !== "function") {
25783
25783
  throw new TypeError("callback not provided");
25784
25784
  }
25785
- return new Promise(function(resolve12, reject) {
25785
+ return new Promise(function(resolve13, reject) {
25786
25786
  isexe(path6, options || {}, function(er, is) {
25787
25787
  if (er) {
25788
25788
  reject(er);
25789
25789
  } else {
25790
- resolve12(is);
25790
+ resolve13(is);
25791
25791
  }
25792
25792
  });
25793
25793
  });
@@ -25853,27 +25853,27 @@ var require_which = __commonJS({
25853
25853
  opt = {};
25854
25854
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
25855
25855
  const found = [];
25856
- const step = (i) => new Promise((resolve12, reject) => {
25856
+ const step = (i) => new Promise((resolve13, reject) => {
25857
25857
  if (i === pathEnv.length)
25858
- return opt.all && found.length ? resolve12(found) : reject(getNotFoundError(cmd));
25858
+ return opt.all && found.length ? resolve13(found) : reject(getNotFoundError(cmd));
25859
25859
  const ppRaw = pathEnv[i];
25860
25860
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
25861
25861
  const pCmd = path6.join(pathPart, cmd);
25862
25862
  const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
25863
- resolve12(subStep(p2, i, 0));
25863
+ resolve13(subStep(p2, i, 0));
25864
25864
  });
25865
- const subStep = (p2, i, ii) => new Promise((resolve12, reject) => {
25865
+ const subStep = (p2, i, ii) => new Promise((resolve13, reject) => {
25866
25866
  if (ii === pathExt.length)
25867
- return resolve12(step(i + 1));
25867
+ return resolve13(step(i + 1));
25868
25868
  const ext = pathExt[ii];
25869
25869
  isexe(p2 + ext, { pathExt: pathExtExe }, (er, is) => {
25870
25870
  if (!er && is) {
25871
25871
  if (opt.all)
25872
25872
  found.push(p2 + ext);
25873
25873
  else
25874
- return resolve12(p2 + ext);
25874
+ return resolve13(p2 + ext);
25875
25875
  }
25876
- return resolve12(subStep(p2, i, ii + 1));
25876
+ return resolve13(subStep(p2, i, ii + 1));
25877
25877
  });
25878
25878
  });
25879
25879
  return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
@@ -29446,9 +29446,9 @@ var require_index_688c5d50 = __commonJS({
29446
29446
  }
29447
29447
  // stream.promise().then(() => done, er => emitted error)
29448
29448
  promise() {
29449
- return new Promise((resolve13, reject) => {
29449
+ return new Promise((resolve14, reject) => {
29450
29450
  this.on(DESTROYED, () => reject(new Error("stream destroyed")));
29451
- this.on("end", () => resolve13());
29451
+ this.on("end", () => resolve14());
29452
29452
  this.on("error", (er) => reject(er));
29453
29453
  });
29454
29454
  }
@@ -29460,7 +29460,7 @@ var require_index_688c5d50 = __commonJS({
29460
29460
  return Promise.resolve({ done: false, value: res });
29461
29461
  if (this[EOF$1])
29462
29462
  return Promise.resolve({ done: true });
29463
- let resolve13 = null;
29463
+ let resolve14 = null;
29464
29464
  let reject = null;
29465
29465
  const onerr = (er) => {
29466
29466
  this.removeListener("data", ondata);
@@ -29471,17 +29471,17 @@ var require_index_688c5d50 = __commonJS({
29471
29471
  this.removeListener("error", onerr);
29472
29472
  this.removeListener("end", onend);
29473
29473
  this.pause();
29474
- resolve13({ value, done: !!this[EOF$1] });
29474
+ resolve14({ value, done: !!this[EOF$1] });
29475
29475
  };
29476
29476
  const onend = () => {
29477
29477
  this.removeListener("error", onerr);
29478
29478
  this.removeListener("data", ondata);
29479
- resolve13({ done: true });
29479
+ resolve14({ done: true });
29480
29480
  };
29481
29481
  const ondestroy = () => onerr(new Error("stream destroyed"));
29482
29482
  return new Promise((res2, rej) => {
29483
29483
  reject = rej;
29484
- resolve13 = res2;
29484
+ resolve14 = res2;
29485
29485
  this.once(DESTROYED, ondestroy);
29486
29486
  this.once("error", onerr);
29487
29487
  this.once("end", onend);
@@ -31908,9 +31908,9 @@ var require_index_688c5d50 = __commonJS({
31908
31908
  const parse11 = new parse$4(opt);
31909
31909
  const readSize = opt.maxReadSize || 16 * 1024 * 1024;
31910
31910
  const file2 = opt.file;
31911
- const p2 = new Promise((resolve13, reject) => {
31911
+ const p2 = new Promise((resolve14, reject) => {
31912
31912
  parse11.on("error", reject);
31913
- parse11.on("end", resolve13);
31913
+ parse11.on("end", resolve14);
31914
31914
  fs__default["default"].stat(file2, (er, stat) => {
31915
31915
  if (er)
31916
31916
  reject(er);
@@ -32121,7 +32121,7 @@ var require_index_688c5d50 = __commonJS({
32121
32121
  };
32122
32122
  fs__default["default"].read(fd, headBuf, 0, 512, position, onread);
32123
32123
  };
32124
- const promise = new Promise((resolve13, reject) => {
32124
+ const promise = new Promise((resolve14, reject) => {
32125
32125
  p2.on("error", reject);
32126
32126
  let flag = "r+";
32127
32127
  const onopen = (er, fd) => {
@@ -32143,7 +32143,7 @@ var require_index_688c5d50 = __commonJS({
32143
32143
  });
32144
32144
  p2.pipe(stream);
32145
32145
  stream.on("error", reject);
32146
- stream.on("close", resolve13);
32146
+ stream.on("close", resolve14);
32147
32147
  addFilesAsync(p2, files);
32148
32148
  });
32149
32149
  });
@@ -32220,7 +32220,7 @@ var require_index_688c5d50 = __commonJS({
32220
32220
  };
32221
32221
  var optsArg_1 = optsArg;
32222
32222
  var platform$2 = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform;
32223
- var { resolve: resolve12, parse: parse$3 } = path__default["default"];
32223
+ var { resolve: resolve13, parse: parse$3 } = path__default["default"];
32224
32224
  var pathArg = (path7) => {
32225
32225
  if (/\0/.test(path7)) {
32226
32226
  throw Object.assign(
@@ -32231,7 +32231,7 @@ var require_index_688c5d50 = __commonJS({
32231
32231
  }
32232
32232
  );
32233
32233
  }
32234
- path7 = resolve12(path7);
32234
+ path7 = resolve13(path7);
32235
32235
  if (platform$2 === "win32") {
32236
32236
  const badWinChars = /[*|"<>?:]/;
32237
32237
  const { root } = parse$3(path7);
@@ -33310,9 +33310,9 @@ var require_index_688c5d50 = __commonJS({
33310
33310
  const u2 = new unpack(opt);
33311
33311
  const readSize = opt.maxReadSize || 16 * 1024 * 1024;
33312
33312
  const file2 = opt.file;
33313
- const p2 = new Promise((resolve13, reject) => {
33313
+ const p2 = new Promise((resolve14, reject) => {
33314
33314
  u2.on("error", reject);
33315
- u2.on("close", resolve13);
33315
+ u2.on("close", resolve14);
33316
33316
  fs__default["default"].stat(file2, (er, stat) => {
33317
33317
  if (er)
33318
33318
  reject(er);
@@ -34623,9 +34623,9 @@ var require_index_688c5d50 = __commonJS({
34623
34623
  const styles5 = [];
34624
34624
  const chunks = [];
34625
34625
  let chunk = [];
34626
- temporary.replace(TEMPLATE_REGEX2, (m2, escapeCharacter, inverse, style, close, character) => {
34627
- if (escapeCharacter) {
34628
- chunk.push(unescape(escapeCharacter));
34626
+ temporary.replace(TEMPLATE_REGEX2, (m2, escapeCharacter2, inverse, style, close, character) => {
34627
+ if (escapeCharacter2) {
34628
+ chunk.push(unescape(escapeCharacter2));
34629
34629
  } else if (style) {
34630
34630
  const string = chunk.join("");
34631
34631
  chunk = [];
@@ -38627,12 +38627,12 @@ var require_index_688c5d50 = __commonJS({
38627
38627
  });
38628
38628
  function promisify7(fn) {
38629
38629
  return function(req, opts) {
38630
- return new Promise((resolve13, reject) => {
38630
+ return new Promise((resolve14, reject) => {
38631
38631
  fn.call(this, req, opts, (err, rtn) => {
38632
38632
  if (err) {
38633
38633
  reject(err);
38634
38634
  } else {
38635
- resolve13(rtn);
38635
+ resolve14(rtn);
38636
38636
  }
38637
38637
  });
38638
38638
  });
@@ -38823,7 +38823,7 @@ var require_index_688c5d50 = __commonJS({
38823
38823
  var debug_1$1 = __importDefault$2(src$1);
38824
38824
  var debug$1 = debug_1$1.default("https-proxy-agent:parse-proxy-response");
38825
38825
  function parseProxyResponse(socket) {
38826
- return new Promise((resolve13, reject) => {
38826
+ return new Promise((resolve14, reject) => {
38827
38827
  let buffersLength = 0;
38828
38828
  const buffers = [];
38829
38829
  function read() {
@@ -38863,7 +38863,7 @@ var require_index_688c5d50 = __commonJS({
38863
38863
  const firstLine = buffered.toString("ascii", 0, buffered.indexOf("\r\n"));
38864
38864
  const statusCode = +firstLine.split(" ")[1];
38865
38865
  debug$1("got proxy server response: %o", firstLine);
38866
- resolve13({
38866
+ resolve14({
38867
38867
  statusCode,
38868
38868
  buffered
38869
38869
  });
@@ -38880,11 +38880,11 @@ var require_index_688c5d50 = __commonJS({
38880
38880
  }, "__esModule", { value: true });
38881
38881
  var __awaiter2 = commonjsGlobal && commonjsGlobal.__awaiter || function(thisArg, _arguments, P2, generator) {
38882
38882
  function adopt(value) {
38883
- return value instanceof P2 ? value : new P2(function(resolve13) {
38884
- resolve13(value);
38883
+ return value instanceof P2 ? value : new P2(function(resolve14) {
38884
+ resolve14(value);
38885
38885
  });
38886
38886
  }
38887
- return new (P2 || (P2 = Promise))(function(resolve13, reject) {
38887
+ return new (P2 || (P2 = Promise))(function(resolve14, reject) {
38888
38888
  function fulfilled(value) {
38889
38889
  try {
38890
38890
  step(generator.next(value));
@@ -38900,7 +38900,7 @@ var require_index_688c5d50 = __commonJS({
38900
38900
  }
38901
38901
  }
38902
38902
  function step(result) {
38903
- result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected);
38903
+ result.done ? resolve14(result.value) : adopt(result.value).then(fulfilled, rejected);
38904
38904
  }
38905
38905
  step((generator = generator.apply(thisArg, _arguments || [])).next());
38906
38906
  });
@@ -48151,11 +48151,11 @@ function __metadata(metadataKey, metadataValue) {
48151
48151
  }
48152
48152
  function __awaiter(thisArg, _arguments, P2, generator) {
48153
48153
  function adopt(value) {
48154
- return value instanceof P2 ? value : new P2(function(resolve12) {
48155
- resolve12(value);
48154
+ return value instanceof P2 ? value : new P2(function(resolve13) {
48155
+ resolve13(value);
48156
48156
  });
48157
48157
  }
48158
- return new (P2 || (P2 = Promise))(function(resolve12, reject) {
48158
+ return new (P2 || (P2 = Promise))(function(resolve13, reject) {
48159
48159
  function fulfilled(value) {
48160
48160
  try {
48161
48161
  step(generator.next(value));
@@ -48171,7 +48171,7 @@ function __awaiter(thisArg, _arguments, P2, generator) {
48171
48171
  }
48172
48172
  }
48173
48173
  function step(result) {
48174
- result.done ? resolve12(result.value) : adopt(result.value).then(fulfilled, rejected);
48174
+ result.done ? resolve13(result.value) : adopt(result.value).then(fulfilled, rejected);
48175
48175
  }
48176
48176
  step((generator = generator.apply(thisArg, _arguments || [])).next());
48177
48177
  });
@@ -48362,14 +48362,14 @@ function __asyncValues(o) {
48362
48362
  }, i);
48363
48363
  function verb(n) {
48364
48364
  i[n] = o[n] && function(v) {
48365
- return new Promise(function(resolve12, reject) {
48366
- v = o[n](v), settle(resolve12, reject, v.done, v.value);
48365
+ return new Promise(function(resolve13, reject) {
48366
+ v = o[n](v), settle(resolve13, reject, v.done, v.value);
48367
48367
  });
48368
48368
  };
48369
48369
  }
48370
- function settle(resolve12, reject, d2, v) {
48370
+ function settle(resolve13, reject, d2, v) {
48371
48371
  Promise.resolve(v).then(function(v2) {
48372
- resolve12({ value: v2, done: d2 });
48372
+ resolve13({ value: v2, done: d2 });
48373
48373
  }, reject);
48374
48374
  }
48375
48375
  }
@@ -73294,12 +73294,12 @@ var require_packet = __commonJS({
73294
73294
  let chunklen = 0;
73295
73295
  let received = false;
73296
73296
  let expected = false;
73297
- return new Promise((resolve12, reject) => {
73297
+ return new Promise((resolve13, reject) => {
73298
73298
  const processMessage = () => {
73299
73299
  if (received) return;
73300
73300
  received = true;
73301
73301
  const buffer = Buffer.concat(chunks, chunklen);
73302
- resolve12(buffer.slice(2));
73302
+ resolve13(buffer.slice(2));
73303
73303
  };
73304
73304
  socket.on("end", processMessage);
73305
73305
  socket.on("error", reject);
@@ -73361,15 +73361,15 @@ var require_udp = __commonJS({
73361
73361
  if (message instanceof Packet) {
73362
73362
  message = message.toBuffer();
73363
73363
  }
73364
- return new Promise((resolve12, reject) => {
73364
+ return new Promise((resolve13, reject) => {
73365
73365
  this.send(message, rinfo.port, rinfo.address, (err) => {
73366
73366
  if (err) return reject(err);
73367
- resolve12(message);
73367
+ resolve13(message);
73368
73368
  });
73369
73369
  });
73370
73370
  }
73371
73371
  listen(port, address) {
73372
- return new Promise((resolve12) => this.bind(port, address, resolve12));
73372
+ return new Promise((resolve13) => this.bind(port, address, resolve13));
73373
73373
  }
73374
73374
  };
73375
73375
  module2.exports = Server;
@@ -73431,11 +73431,11 @@ var require_doh = __commonJS({
73431
73431
  }
73432
73432
  return queryData;
73433
73433
  };
73434
- var readStream = (stream) => new Promise((resolve12, reject) => {
73434
+ var readStream = (stream) => new Promise((resolve13, reject) => {
73435
73435
  let buffer = "";
73436
73436
  stream.on("error", reject).on("data", (chunk) => {
73437
73437
  buffer += chunk;
73438
- }).on("end", () => resolve12(buffer));
73438
+ }).on("end", () => resolve13(buffer));
73439
73439
  });
73440
73440
  var Server = class extends EventEmitter {
73441
73441
  constructor(options) {
@@ -73561,12 +73561,12 @@ var require_dns2 = __commonJS({
73561
73561
  }
73562
73562
  const servers = Object.values(this.servers);
73563
73563
  this.closed = Promise.all(
73564
- servers.map((server) => new Promise((resolve12) => server.once("close", resolve12)))
73564
+ servers.map((server) => new Promise((resolve13) => server.once("close", resolve13)))
73565
73565
  ).then(() => {
73566
73566
  this.emit("close");
73567
73567
  });
73568
73568
  this.listening = Promise.all(
73569
- servers.map((server) => new Promise((resolve12) => server.once("listening", resolve12)))
73569
+ servers.map((server) => new Promise((resolve13) => server.once("listening", resolve13)))
73570
73570
  ).then(() => {
73571
73571
  const addresses = this.addresses();
73572
73572
  this.emit("listening", addresses);
@@ -73698,18 +73698,18 @@ var require_tcp2 = __commonJS({
73698
73698
  var require_doh2 = __commonJS({
73699
73699
  "../../node_modules/.pnpm/dns2@2.1.0/node_modules/dns2/client/doh.js"(exports2, module2) {
73700
73700
  var Packet = require_packet();
73701
- var defaultGet = (url) => new Promise((resolve12, reject) => {
73701
+ var defaultGet = (url) => new Promise((resolve13, reject) => {
73702
73702
  const headers = {
73703
73703
  accept: "application/dns-message"
73704
73704
  };
73705
73705
  const base = url.startsWith("https") ? require("https") : require("http");
73706
- const req = base.get(url, { headers }, resolve12);
73706
+ const req = base.get(url, { headers }, resolve13);
73707
73707
  req.on("error", reject);
73708
73708
  });
73709
73709
  var readStream = (stream) => {
73710
73710
  const buffer = [];
73711
- return new Promise((resolve12, reject) => {
73712
- stream.on("error", reject).on("data", (chunk) => buffer.push(chunk)).on("end", () => resolve12(Buffer.concat(buffer)));
73711
+ return new Promise((resolve13, reject) => {
73712
+ stream.on("error", reject).on("data", (chunk) => buffer.push(chunk)).on("end", () => resolve13(Buffer.concat(buffer)));
73713
73713
  });
73714
73714
  };
73715
73715
  var DOHClient = ({ dns, http, get = defaultGet } = {}) => {
@@ -73762,12 +73762,12 @@ var require_udp2 = __commonJS({
73762
73762
  type: Packet.TYPE[type]
73763
73763
  });
73764
73764
  const client = new udp.Socket(socketType);
73765
- return new Promise((resolve12, reject) => {
73765
+ return new Promise((resolve13, reject) => {
73766
73766
  client.once("message", function onMessage(message) {
73767
73767
  client.close();
73768
73768
  const response = Packet.parse(message);
73769
73769
  equal(response.header.id, query.header.id);
73770
- resolve12(response);
73770
+ resolve13(response);
73771
73771
  });
73772
73772
  debug("send", dns, query.toBuffer());
73773
73773
  client.send(query.toBuffer(), port, dns, (err) => err && reject(err));
@@ -73781,13 +73781,13 @@ var require_udp2 = __commonJS({
73781
73781
  var require_google = __commonJS({
73782
73782
  "../../node_modules/.pnpm/dns2@2.1.0/node_modules/dns2/client/google.js"(exports2, module2) {
73783
73783
  var https = require("https");
73784
- var get = (url) => new Promise((resolve12) => https.get(url, resolve12));
73784
+ var get = (url) => new Promise((resolve13) => https.get(url, resolve13));
73785
73785
  var readStream = (stream) => {
73786
73786
  const buffer = [];
73787
- return new Promise((resolve12, reject) => {
73787
+ return new Promise((resolve13, reject) => {
73788
73788
  stream.on("error", reject).on("data", (chunk) => {
73789
73789
  buffer.push(chunk);
73790
- }).on("end", () => resolve12(Buffer.concat(buffer)));
73790
+ }).on("end", () => resolve13(Buffer.concat(buffer)));
73791
73791
  });
73792
73792
  };
73793
73793
  var GoogleClient = () => (name3, type = "ANY") => {
@@ -73848,8 +73848,8 @@ var require_dns22 = __commonJS({
73848
73848
  const { port, nameServers, recursive, resolverProtocol = "UDP" } = this;
73849
73849
  const createResolver = _DNS[resolverProtocol + "Client"];
73850
73850
  return Promise.race(nameServers.map((address) => {
73851
- const resolve12 = createResolver({ dns: address, port, recursive });
73852
- return resolve12(name3, type, cls, clientIp);
73851
+ const resolve13 = createResolver({ dns: address, port, recursive });
73852
+ return resolve13(name3, type, cls, clientIp);
73853
73853
  }));
73854
73854
  }
73855
73855
  /**
@@ -73903,7 +73903,7 @@ __export(cli_exports, {
73903
73903
  });
73904
73904
  module.exports = __toCommonJS(cli_exports);
73905
73905
  var import_node_fs21 = require("node:fs");
73906
- var import_node_path23 = require("node:path");
73906
+ var import_node_path24 = require("node:path");
73907
73907
  var import_node_process14 = require("node:process");
73908
73908
 
73909
73909
  // ../../node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js
@@ -74415,11 +74415,6 @@ var stderr = process.stderr;
74415
74415
  // ../cli/dist/check-macos-version.mjs
74416
74416
  var import_node_os3 = __toESM(require("node:os"), 1);
74417
74417
 
74418
- // ../workers-utils/dist/chunk-OZQVB3L3.mjs
74419
- var SERVICE_TAG_PREFIX = "cf:service=";
74420
- var ENVIRONMENT_TAG_PREFIX = "cf:environment=";
74421
- var PATH_TO_DEPLOY_CONFIG = ".wrangler/deploy/config.json";
74422
-
74423
74418
  // ../workers-utils/dist/chunk-DCOBXSFB.mjs
74424
74419
  var __create2 = Object.create;
74425
74420
  var __defProp2 = Object.defineProperty;
@@ -74459,7 +74454,7 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__
74459
74454
  mod
74460
74455
  ));
74461
74456
 
74462
- // ../workers-utils/dist/chunk-AKFE3ND4.mjs
74457
+ // ../workers-utils/dist/chunk-J6D57QVQ.mjs
74463
74458
  var import_node_assert = __toESM(require("node:assert"), 1);
74464
74459
  function isCompatDate(str) {
74465
74460
  return /^\d{4}-\d{2}-\d{2}$/.test(str);
@@ -74493,8 +74488,7 @@ function mapWorkerMetadataBindings(bindings) {
74493
74488
  {
74494
74489
  configObj.vars = {
74495
74490
  ...configObj.vars ?? {},
74496
- name: binding.name,
74497
- json: binding.json
74491
+ [binding.name]: binding.json
74498
74492
  };
74499
74493
  }
74500
74494
  break;
@@ -74755,9 +74749,9 @@ function mapWorkerMetadataBindings(bindings) {
74755
74749
  }
74756
74750
  ];
74757
74751
  break;
74758
- case "web_search":
74752
+ case "websearch":
74759
74753
  {
74760
- configObj.web_search = {
74754
+ configObj.websearch = {
74761
74755
  binding: binding.name
74762
74756
  };
74763
74757
  }
@@ -74890,7 +74884,7 @@ function mapWorkerMetadataBindings(bindings) {
74890
74884
  }, {});
74891
74885
  }
74892
74886
  __name(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
74893
- function convertWorkerToWranglerConfig(config49) {
74887
+ function constructWranglerConfig(config49) {
74894
74888
  const mappedBindings = mapWorkerMetadataBindings(config49.bindings);
74895
74889
  const durableObjectClassNames = config49.bindings.filter(
74896
74890
  (binding) => binding.type === "durable_object_namespace" && binding.script_name === config49.name
@@ -74938,45 +74932,9 @@ function convertWorkerToWranglerConfig(config49) {
74938
74932
  ...mappedBindings
74939
74933
  };
74940
74934
  }
74941
- __name(convertWorkerToWranglerConfig, "convertWorkerToWranglerConfig");
74942
- function constructWranglerConfig(workerOrWorkers) {
74943
- let workers;
74944
- if (Array.isArray(workerOrWorkers)) {
74945
- workers = workerOrWorkers;
74946
- } else {
74947
- workers = [workerOrWorkers];
74948
- }
74949
- const topLevelEnv = workers.find(
74950
- (w2) => !w2.tags?.some((t2) => t2.startsWith(ENVIRONMENT_TAG_PREFIX))
74951
- );
74952
- const workerName = topLevelEnv?.name ?? workers[0].name;
74953
- const entrypoint = topLevelEnv?.entrypoint ?? workers[0].entrypoint;
74954
- let combinedConfig;
74955
- if (topLevelEnv) {
74956
- combinedConfig = convertWorkerToWranglerConfig(topLevelEnv);
74957
- } else {
74958
- combinedConfig = {
74959
- name: workerName,
74960
- main: entrypoint
74961
- };
74962
- }
74963
- for (const env3 of workers) {
74964
- const serviceTag = env3.tags?.find(
74965
- (t2) => t2 === `${SERVICE_TAG_PREFIX}${workerName}`
74966
- );
74967
- const envTag = env3.tags?.find((t2) => t2.startsWith(ENVIRONMENT_TAG_PREFIX));
74968
- if (serviceTag !== `${SERVICE_TAG_PREFIX}${workerName}` || envTag === void 0) {
74969
- continue;
74970
- }
74971
- const [_2, envName] = envTag.split("=");
74972
- combinedConfig.env ??= {};
74973
- combinedConfig.env[envName] = convertWorkerToWranglerConfig(env3);
74974
- }
74975
- return combinedConfig;
74976
- }
74977
74935
  __name(constructWranglerConfig, "constructWranglerConfig");
74978
74936
 
74979
- // ../workers-utils/dist/chunk-GMTGAG26.mjs
74937
+ // ../workers-utils/dist/chunk-ULVYGN52.mjs
74980
74938
  var import_node_fs = __toESM(require("node:fs"), 1);
74981
74939
  var import_node_path = __toESM(require("node:path"), 1);
74982
74940
  var UserError = class extends Error {
@@ -77597,6 +77555,7 @@ function removeBOMAndValidate(buffer, file2) {
77597
77555
  return content;
77598
77556
  }
77599
77557
  __name(removeBOMAndValidate, "removeBOMAndValidate");
77558
+ var PATH_TO_DEPLOY_CONFIG = ".wrangler/deploy/config.json";
77600
77559
  function absolute(input, root) {
77601
77560
  return (0, import_node_path.isAbsolute)(input) ? input : (0, import_node_path.resolve)(root || ".", input);
77602
77561
  }
@@ -77839,7 +77798,9 @@ var import_node_os2 = __toESM(require("node:os"), 1);
77839
77798
  var import_node_child_process = require("node:child_process");
77840
77799
  var import_node_crypto = require("node:crypto");
77841
77800
  var import_undici = __toESM(require_undici(), 1);
77801
+ var import_node_url = require("node:url");
77842
77802
  var timersPromises = __toESM(require("node:timers/promises"), 1);
77803
+ var import_promises = require("node:timers/promises");
77843
77804
  var require_XDGAppPaths = __commonJS2({
77844
77805
  "../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js"(exports2) {
77845
77806
  exports2.__esModule = true;
@@ -78375,7 +78336,7 @@ var require_signal_exit = __commonJS2({
78375
78336
  };
78376
78337
  };
78377
78338
  } else {
78378
- assert22 = __require("assert");
78339
+ assert32 = __require("assert");
78379
78340
  signals = require_signals();
78380
78341
  isWin = /^win/i.test(process22.platform);
78381
78342
  EE = __require("events");
@@ -78398,7 +78359,7 @@ var require_signal_exit = __commonJS2({
78398
78359
  return function() {
78399
78360
  };
78400
78361
  }
78401
- assert22.equal(typeof cb, "function", "a callback must be provided for exit handler");
78362
+ assert32.equal(typeof cb, "function", "a callback must be provided for exit handler");
78402
78363
  if (loaded === false) {
78403
78364
  load();
78404
78365
  }
@@ -78504,7 +78465,7 @@ var require_signal_exit = __commonJS2({
78504
78465
  }
78505
78466
  }, "processEmit");
78506
78467
  }
78507
- var assert22;
78468
+ var assert32;
78508
78469
  var signals;
78509
78470
  var isWin;
78510
78471
  var EE;
@@ -78639,10 +78600,10 @@ var require_command_exists = __commonJS2({
78639
78600
  module2.exports = /* @__PURE__ */ __name(function commandExists(commandName, callback) {
78640
78601
  var cleanedCommandName = cleanInput(commandName);
78641
78602
  if (!callback && typeof Promise !== "undefined") {
78642
- return new Promise(function(resolve12, reject) {
78603
+ return new Promise(function(resolve13, reject) {
78643
78604
  commandExists(commandName, function(error2, output) {
78644
78605
  if (output) {
78645
- resolve12(commandName);
78606
+ resolve13(commandName);
78646
78607
  } else {
78647
78608
  reject(error2);
78648
78609
  }
@@ -79536,7 +79497,7 @@ var require_update_check = __commonJS2({
79536
79497
  });
79537
79498
  await writeFile4(file2, content, "utf8");
79538
79499
  }, "updateCache");
79539
- var loadPackage = /* @__PURE__ */ __name((url, authInfo) => new Promise((resolve12, reject) => {
79500
+ var loadPackage = /* @__PURE__ */ __name((url, authInfo) => new Promise((resolve13, reject) => {
79540
79501
  const options = {
79541
79502
  host: url.hostname,
79542
79503
  path: url.pathname,
@@ -79567,7 +79528,7 @@ var require_update_check = __commonJS2({
79567
79528
  response.on("end", () => {
79568
79529
  try {
79569
79530
  const parsedData = JSON.parse(rawData);
79570
- resolve12(parsedData);
79531
+ resolve13(parsedData);
79571
79532
  } catch (e2) {
79572
79533
  reject(e2);
79573
79534
  }
@@ -79688,7 +79649,7 @@ var defaultWranglerConfig = {
79688
79649
  vectorize: [],
79689
79650
  ai_search_namespaces: [],
79690
79651
  ai_search: [],
79691
- web_search: void 0,
79652
+ websearch: void 0,
79692
79653
  agent_memory: [],
79693
79654
  hyperdrive: [],
79694
79655
  workflows: [],
@@ -83760,6 +83721,7 @@ var getCloudflareApiBaseUrlFromEnv = getEnvironmentVariableFactory({
83760
83721
  variableName: "CLOUDFLARE_API_BASE_URL",
83761
83722
  deprecatedName: "CF_API_BASE_URL"
83762
83723
  });
83724
+ var getCloudflareApiBaseUrl = /* @__PURE__ */ __name((complianceConfig) => getCloudflareApiBaseUrlFromEnv() ?? `https://api${getComplianceRegionSubdomain(complianceConfig)}${getStagingSubdomain()}.cloudflare.com/client/v4`, "getCloudflareApiBaseUrl");
83763
83725
  function getComplianceRegionSubdomain(complianceConfig) {
83764
83726
  return getCloudflareComplianceRegion(complianceConfig) === "fedramp_high" ? ".fed" : "";
83765
83727
  }
@@ -84292,7 +84254,7 @@ var friendlyBindingNames = {
84292
84254
  vectorize: "Vectorize Index",
84293
84255
  ai_search_namespaces: "AI Search Namespace",
84294
84256
  ai_search: "AI Search Instance",
84295
- web_search: "Web Search",
84257
+ websearch: "Web Search",
84296
84258
  agent_memory: "Agent Memory",
84297
84259
  hyperdrive: "Hyperdrive Config",
84298
84260
  r2_buckets: "R2 Bucket",
@@ -84346,7 +84308,7 @@ var bindingTypeFriendlyNames = {
84346
84308
  vectorize: "Vectorize Index",
84347
84309
  ai_search_namespace: "AI Search Namespace",
84348
84310
  ai_search: "AI Search Instance",
84349
- web_search: "Web Search",
84311
+ websearch: "Web Search",
84350
84312
  agent_memory: "Agent Memory",
84351
84313
  hyperdrive: "Hyperdrive Config",
84352
84314
  service: "Worker",
@@ -85018,8 +84980,8 @@ function normalizeAndValidateRoute(diagnostics, topLevelEnv, rawEnv) {
85018
84980
  );
85019
84981
  }
85020
84982
  __name(normalizeAndValidateRoute, "normalizeAndValidateRoute");
85021
- function validateRoutes(diagnostics, topLevelEnv, rawEnv) {
85022
- return inheritable(
84983
+ function validateRoutes(diagnostics, topLevelEnv, rawEnv, envName) {
84984
+ const result = inheritable(
85023
84985
  diagnostics,
85024
84986
  topLevelEnv,
85025
84987
  rawEnv,
@@ -85027,6 +84989,18 @@ function validateRoutes(diagnostics, topLevelEnv, rawEnv) {
85027
84989
  all(isRouteArray, isMutuallyExclusiveWith(rawEnv, "route")),
85028
84990
  void 0
85029
84991
  );
84992
+ if (topLevelEnv !== void 0 && envName !== void 0 && rawEnv.routes === void 0) {
84993
+ const customDomainRoutes = topLevelEnv.routes?.filter(
84994
+ (r2) => typeof r2 === "object" && r2 !== null && r2.custom_domain === true
84995
+ );
84996
+ if (customDomainRoutes && customDomainRoutes.length > 0) {
84997
+ const customDomains = customDomainRoutes.map((r2) => r2.pattern).join(", ");
84998
+ diagnostics.warnings.push(
84999
+ `The "env.${envName}" environment inherits the top-level \`routes\` configuration, which includes the custom domain(s): ${customDomains}. Deploying this environment will reassign these custom domains away from the top-level Worker. Add \`"routes": []\` to "env.${envName}" to prevent inheritance, or copy the route configuration from the top level to hide this warning.`
85000
+ );
85001
+ }
85002
+ }
85003
+ return result;
85030
85004
  }
85031
85005
  __name(validateRoutes, "validateRoutes");
85032
85006
  function normalizeAndValidatePlacement(diagnostics, topLevelEnv, rawEnv) {
@@ -85242,7 +85216,12 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
85242
85216
  void 0,
85243
85217
  void 0
85244
85218
  );
85245
- const routes = validateRoutes(diagnostics, topLevelEnv, rawEnv);
85219
+ const routes = validateRoutes(
85220
+ diagnostics,
85221
+ topLevelEnv,
85222
+ rawEnv,
85223
+ topLevelEnv === void 0 ? void 0 : envName
85224
+ );
85246
85225
  const workers_dev = inheritable(
85247
85226
  diagnostics,
85248
85227
  topLevelEnv,
@@ -85542,13 +85521,13 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
85542
85521
  validateBindingArray(envName, validateAISearchBinding),
85543
85522
  []
85544
85523
  ),
85545
- web_search: notInheritable(
85524
+ websearch: notInheritable(
85546
85525
  diagnostics,
85547
85526
  topLevelEnv,
85548
85527
  rawConfig,
85549
85528
  rawEnv,
85550
85529
  envName,
85551
- "web_search",
85530
+ "websearch",
85552
85531
  validateNamedSimpleBinding(envName),
85553
85532
  void 0
85554
85533
  ),
@@ -86645,7 +86624,7 @@ var validateUnsafeBinding = /* @__PURE__ */ __name((diagnostics, field, value) =
86645
86624
  "ai",
86646
86625
  "ai_search_namespace",
86647
86626
  "ai_search",
86648
- "web_search",
86627
+ "websearch",
86649
86628
  "agent_memory",
86650
86629
  "kv_namespace",
86651
86630
  "durable_object_namespace",
@@ -87456,12 +87435,21 @@ var validateD1Binding = /* @__PURE__ */ __name((diagnostics, field, value) => {
87456
87435
  if (!isRemoteValid(value, field, diagnostics)) {
87457
87436
  isValid2 = false;
87458
87437
  }
87438
+ if (!isOptionalProperty(value, "migrations_pattern", "string")) {
87439
+ diagnostics.errors.push(
87440
+ `"${field}" bindings should, optionally, have a string "migrations_pattern" field but got ${JSON.stringify(
87441
+ value
87442
+ )}.`
87443
+ );
87444
+ isValid2 = false;
87445
+ }
87459
87446
  validateAdditionalProperties(diagnostics, field, Object.keys(value), [
87460
87447
  "binding",
87461
87448
  "database_id",
87462
87449
  "database_internal_env",
87463
87450
  "database_name",
87464
87451
  "migrations_dir",
87452
+ "migrations_pattern",
87465
87453
  "migrations_table",
87466
87454
  "preview_database_id",
87467
87455
  "remote"
@@ -89053,7 +89041,7 @@ var BINDING_LOCAL_SUPPORT = {
89053
89041
  flagship: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
89054
89042
  vpc_service: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
89055
89043
  vpc_network: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
89056
- web_search: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
89044
+ websearch: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator",
89057
89045
  agent_memory: "DO-NOT-USE-this-resource-will-never-have-a-local-simulator"
89058
89046
  };
89059
89047
  function getBindingLocalSupport(type) {
@@ -89843,7 +89831,7 @@ function startTunnel(options) {
89843
89831
  return;
89844
89832
  }
89845
89833
  logger?.log(
89846
- `${publicURL ? `The tunnel is still open at ${publicURL}.` : "The tunnel is still open."} It expires in ${formatTunnelDuration(remainingMs)}. ${options.extendHint ?? ""}`
89834
+ `${publicURL ? `Tunnel still open, expires in ${formatTunnelDuration(remainingMs)}: ${publicURL}` : `The tunnel is still open. It expires in ${formatTunnelDuration(remainingMs)}.`}${options.extendHint ? ` ${options.extendHint}` : ""}`
89847
89835
  );
89848
89836
  }, reminderIntervalMs);
89849
89837
  reminderInterval.unref?.();
@@ -89930,7 +89918,7 @@ function terminateCloudflared(cloudflared) {
89930
89918
  }
89931
89919
  __name(terminateCloudflared, "terminateCloudflared");
89932
89920
  function waitForQuickTunnelReady(cloudflared, timeoutMs, options) {
89933
- return new Promise((resolve12, reject) => {
89921
+ return new Promise((resolve13, reject) => {
89934
89922
  let resolved = false;
89935
89923
  let stderrOutput = "";
89936
89924
  const logger = options?.logger;
@@ -89958,7 +89946,7 @@ function waitForQuickTunnelReady(cloudflared, timeoutMs, options) {
89958
89946
  if (match && !resolved) {
89959
89947
  resolved = true;
89960
89948
  clearTimeout(timeoutId);
89961
- resolve12({ mode: "quick", publicUrl: new URL(match[0]) });
89949
+ resolve13({ mode: "quick", publicUrl: new URL(match[0]) });
89962
89950
  }
89963
89951
  });
89964
89952
  }
@@ -89994,7 +89982,7 @@ function createTunnelStartupError(message, stderrOutput, origin) {
89994
89982
  cloudflared output:
89995
89983
  ${stderrOutput || "(no output)"}
89996
89984
 
89997
- The local dev server started at ${origin.href}.
89985
+ The local dev server started at ${origin.href}
89998
89986
  ` + (isQuickTunnelRateLimited ? "Cloudflare Quick Tunnel creation was rate limited. Try again in a few minutes, or use a named tunnel if you need more reliable access." : `Check the cloudflared output above for more details, and verify that ${origin.href} is reachable from this machine if this keeps happening.`);
89999
89987
  if (isQuickTunnelRateLimited) {
90000
89988
  return new UserError(errorMessage, { telemetryMessage: false });
@@ -90002,6 +89990,344 @@ The local dev server started at ${origin.href}.
90002
89990
  return new Error(errorMessage);
90003
89991
  }
90004
89992
  __name(createTunnelStartupError, "createTunnelStartupError");
89993
+ function buildDetailedError(message, ...extra) {
89994
+ return new ParseError({
89995
+ text: message,
89996
+ notes: extra.map((text) => ({ text })),
89997
+ telemetryMessage: false
89998
+ });
89999
+ }
90000
+ __name(buildDetailedError, "buildDetailedError");
90001
+ function maybeThrowFriendlyError(error2) {
90002
+ if (error2.message === "workers.api.error.email_verification_required") {
90003
+ throw buildDetailedError(
90004
+ "Please verify your account's email address and try again.",
90005
+ "Check your email for a verification link, or login to https://dash.cloudflare.com and request a new one."
90006
+ );
90007
+ }
90008
+ }
90009
+ __name(maybeThrowFriendlyError, "maybeThrowFriendlyError");
90010
+ function logHeaders(headers, logger) {
90011
+ const clone = cloneHeaders(headers);
90012
+ clone.delete("Authorization");
90013
+ logger.debugWithSanitization(
90014
+ "HEADERS:",
90015
+ JSON.stringify(Object.fromEntries(clone), null, 2)
90016
+ );
90017
+ }
90018
+ __name(logHeaders, "logHeaders");
90019
+ async function performApiFetchBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
90020
+ (0, import_node_assert2.default)(credentials, "credentials are required for performApiFetch");
90021
+ const method = init.method ?? "GET";
90022
+ (0, import_node_assert2.default)(
90023
+ resource.startsWith("/"),
90024
+ `CF API fetch - resource path must start with a "/" but got "${resource}"`
90025
+ );
90026
+ const headers = cloneHeaders(new import_undici.Headers(init.headers));
90027
+ addAuthorizationHeader(headers, credentials);
90028
+ headers.set("User-Agent", userAgent);
90029
+ maybeAddTraceHeader(headers);
90030
+ const queryString = queryParams ? `?${queryParams.toString()}` : "";
90031
+ logger.debug(
90032
+ `-- START CF API REQUEST: ${method} ${getCloudflareApiBaseUrl(complianceConfig)}${resource}`
90033
+ );
90034
+ logger.debugWithSanitization("QUERY STRING:", queryString);
90035
+ logHeaders(headers, logger);
90036
+ logger.debugWithSanitization("INIT:", JSON.stringify({ ...init }, null, 2));
90037
+ if (init.body instanceof import_undici.FormData) {
90038
+ logger.debugWithSanitization(
90039
+ "BODY:",
90040
+ await new import_undici.Response(init.body).text(),
90041
+ null,
90042
+ 2
90043
+ );
90044
+ }
90045
+ logger.debug("-- END CF API REQUEST");
90046
+ return await (0, import_undici.fetch)(
90047
+ `${getCloudflareApiBaseUrl(complianceConfig)}${resource}${queryString}`,
90048
+ {
90049
+ method,
90050
+ ...init,
90051
+ headers,
90052
+ signal: abortSignal
90053
+ }
90054
+ );
90055
+ }
90056
+ __name(performApiFetchBase, "performApiFetchBase");
90057
+ async function fetchInternalBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
90058
+ const method = init.method ?? "GET";
90059
+ const response = await performApiFetchBase(
90060
+ complianceConfig,
90061
+ resource,
90062
+ init,
90063
+ userAgent,
90064
+ logger,
90065
+ queryParams,
90066
+ abortSignal,
90067
+ credentials
90068
+ );
90069
+ const jsonText = await response.text();
90070
+ logger.debug(
90071
+ "-- START CF API RESPONSE:",
90072
+ response.statusText,
90073
+ response.status
90074
+ );
90075
+ logHeaders(response.headers, logger);
90076
+ logger.debugWithSanitization("RESPONSE:", jsonText);
90077
+ logger.debug("-- END CF API RESPONSE");
90078
+ if (!jsonText && (response.status === 204 || response.status === 205)) {
90079
+ return {
90080
+ response: {
90081
+ result: {},
90082
+ success: true,
90083
+ errors: [],
90084
+ messages: []
90085
+ },
90086
+ status: response.status
90087
+ };
90088
+ }
90089
+ if (isWAFBlockResponse(response.headers)) {
90090
+ throwWAFBlockError(
90091
+ response.headers,
90092
+ method,
90093
+ resource,
90094
+ response.status,
90095
+ response.statusText
90096
+ );
90097
+ }
90098
+ try {
90099
+ const json = parseJSON(jsonText);
90100
+ return { response: json, status: response.status };
90101
+ } catch {
90102
+ const rayId = extractWAFBlockRayId(response.headers);
90103
+ throw new APIError({
90104
+ text: "Received a malformed response from the API",
90105
+ notes: [
90106
+ {
90107
+ text: truncate(jsonText, 100)
90108
+ },
90109
+ {
90110
+ text: `${method} ${resource} -> ${response.status} ${response.statusText}`
90111
+ },
90112
+ ...rayId ? [{ text: `Cloudflare Ray ID: ${rayId}` }] : []
90113
+ ],
90114
+ status: response.status,
90115
+ telemetryMessage: false
90116
+ });
90117
+ }
90118
+ }
90119
+ __name(fetchInternalBase, "fetchInternalBase");
90120
+ async function fetchResultBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, abortSignal, credentials) {
90121
+ const { response: json, status: status2 } = await fetchInternalBase(
90122
+ complianceConfig,
90123
+ resource,
90124
+ init,
90125
+ userAgent,
90126
+ logger,
90127
+ queryParams,
90128
+ abortSignal,
90129
+ credentials
90130
+ );
90131
+ if (json.success) {
90132
+ return json.result;
90133
+ } else {
90134
+ throwFetchError(resource, json, status2);
90135
+ }
90136
+ }
90137
+ __name(fetchResultBase, "fetchResultBase");
90138
+ async function fetchListResultBase(complianceConfig, resource, init = {}, userAgent, logger, queryParams, credentials) {
90139
+ const results = [];
90140
+ let getMoreResults = true;
90141
+ let cursor;
90142
+ while (getMoreResults) {
90143
+ if (cursor) {
90144
+ queryParams = new import_node_url.URLSearchParams(queryParams);
90145
+ queryParams.set("cursor", cursor);
90146
+ }
90147
+ const { response: json, status: status2 } = await fetchInternalBase(
90148
+ complianceConfig,
90149
+ resource,
90150
+ init,
90151
+ userAgent,
90152
+ logger,
90153
+ queryParams,
90154
+ void 0,
90155
+ credentials
90156
+ );
90157
+ if (json.success) {
90158
+ results.push(...json.result);
90159
+ if (hasCursor(json.result_info)) {
90160
+ cursor = json.result_info?.cursor;
90161
+ } else {
90162
+ getMoreResults = false;
90163
+ }
90164
+ } else {
90165
+ throwFetchError(resource, json, status2);
90166
+ }
90167
+ }
90168
+ return results;
90169
+ }
90170
+ __name(fetchListResultBase, "fetchListResultBase");
90171
+ function truncate(text, maxLength) {
90172
+ const { length } = text;
90173
+ if (length <= maxLength) {
90174
+ return text;
90175
+ }
90176
+ return `${text.substring(0, maxLength)}... (length = ${length})`;
90177
+ }
90178
+ __name(truncate, "truncate");
90179
+ function isWAFBlockResponse(headers) {
90180
+ return headers.get("cf-mitigated") === "challenge";
90181
+ }
90182
+ __name(isWAFBlockResponse, "isWAFBlockResponse");
90183
+ function extractWAFBlockRayId(headers) {
90184
+ return headers.get("cf-ray") ?? void 0;
90185
+ }
90186
+ __name(extractWAFBlockRayId, "extractWAFBlockRayId");
90187
+ function extractAccountTag(resource) {
90188
+ const re = new RegExp("/accounts/([a-zA-Z0-9]+)/?");
90189
+ const matches = re.exec(resource);
90190
+ return matches?.[1];
90191
+ }
90192
+ __name(extractAccountTag, "extractAccountTag");
90193
+ function hasMorePages(result_info) {
90194
+ const page = result_info?.page;
90195
+ const per_page = result_info?.per_page;
90196
+ const total = result_info?.total_count;
90197
+ return page !== void 0 && per_page !== void 0 && total !== void 0 && page * per_page < total;
90198
+ }
90199
+ __name(hasMorePages, "hasMorePages");
90200
+ function renderError(err, level = 0) {
90201
+ const indent2 = " ".repeat(level);
90202
+ const message = err.message ?? "";
90203
+ const chainedMessages = "error_chain" in err ? err.error_chain?.map(
90204
+ (chainedError) => `
90205
+
90206
+ ${indent2}- ${renderError(chainedError, level + 1)}`
90207
+ ).join("\n") ?? "" : "";
90208
+ return (err.code ? `${message} [code: ${err.code}]` : message) + (err.documentation_url ? `
90209
+ ${indent2}To learn more about this error, visit: ${err.documentation_url}` : "") + chainedMessages;
90210
+ }
90211
+ __name(renderError, "renderError");
90212
+ function addAuthorizationHeader(headers, auth, overrideExisting = false) {
90213
+ if (!headers.has("Authorization") || overrideExisting) {
90214
+ if ("apiToken" in auth) {
90215
+ const authorizationHeader = `Bearer ${auth.apiToken}`;
90216
+ validateAuthorizationHeaderValue(authorizationHeader);
90217
+ headers.set("Authorization", authorizationHeader);
90218
+ } else {
90219
+ headers.set("X-Auth-Key", auth.authKey);
90220
+ headers.set("X-Auth-Email", auth.authEmail);
90221
+ }
90222
+ }
90223
+ }
90224
+ __name(addAuthorizationHeader, "addAuthorizationHeader");
90225
+ function validateAuthorizationHeaderValue(value) {
90226
+ for (const character of value) {
90227
+ const codePoint = character.codePointAt(0);
90228
+ if (codePoint === void 0 || codePoint > 255) {
90229
+ throw new UserError(
90230
+ `The configured Cloudflare API token contains a character that cannot be used in an HTTP Authorization header: ${formatAuthorizationHeaderCharacter(character, codePoint)}. Recreate or copy the token again, making sure it does not include characters such as ellipses.`,
90231
+ {
90232
+ telemetryMessage: "cfetch auth invalid authorization header"
90233
+ }
90234
+ );
90235
+ }
90236
+ }
90237
+ }
90238
+ __name(validateAuthorizationHeaderValue, "validateAuthorizationHeaderValue");
90239
+ function formatAuthorizationHeaderCharacter(character, codePoint) {
90240
+ if (codePoint === void 0) {
90241
+ return '"\\u{unknown}"';
90242
+ }
90243
+ const codePointLabel = `U+${codePoint.toString(16).toUpperCase().padStart(4, "0")}`;
90244
+ const characterLabel = isPrintableCharacter(character) ? `"${character}"` : `"${escapeCharacter(character)}"`;
90245
+ return `${characterLabel} (${codePointLabel})`;
90246
+ }
90247
+ __name(formatAuthorizationHeaderCharacter, "formatAuthorizationHeaderCharacter");
90248
+ function isPrintableCharacter(character) {
90249
+ return !/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u.test(character);
90250
+ }
90251
+ __name(isPrintableCharacter, "isPrintableCharacter");
90252
+ function escapeCharacter(character) {
90253
+ return Array.from(character).map((c2) => {
90254
+ const codePoint = c2.codePointAt(0);
90255
+ if (codePoint === void 0) {
90256
+ return "";
90257
+ }
90258
+ return codePoint <= 65535 ? `\\u${codePoint.toString(16).toUpperCase().padStart(4, "0")}` : `\\u{${codePoint.toString(16).toUpperCase()}}`;
90259
+ }).join("");
90260
+ }
90261
+ __name(escapeCharacter, "escapeCharacter");
90262
+ function throwFetchError(resource, response, status2) {
90263
+ const errors = response.errors ?? [];
90264
+ for (const error22 of errors) {
90265
+ maybeThrowFriendlyError(error22);
90266
+ }
90267
+ const notes = [
90268
+ ...errors.map((err) => ({ text: renderError(err) })),
90269
+ ...response.messages?.map((msg) => ({
90270
+ text: typeof msg === "string" ? msg : msg.message ?? String(msg)
90271
+ })) ?? []
90272
+ ];
90273
+ if (notes.length === 0) {
90274
+ const raw = response;
90275
+ const fallbackMessage = typeof raw.error === "string" ? `${raw.error}${raw.code ? ` [code: ${raw.code}]` : ""}` : void 0;
90276
+ if (fallbackMessage) {
90277
+ notes.push({ text: fallbackMessage });
90278
+ }
90279
+ }
90280
+ const error2 = new APIError({
90281
+ text: `A request to the Cloudflare API (${resource}) failed.`,
90282
+ notes,
90283
+ status: status2,
90284
+ telemetryMessage: false
90285
+ });
90286
+ const code = errors[0]?.code;
90287
+ if (code) {
90288
+ error2.code = code;
90289
+ }
90290
+ error2.accountTag = extractAccountTag(resource);
90291
+ throw error2;
90292
+ }
90293
+ __name(throwFetchError, "throwFetchError");
90294
+ function throwWAFBlockError(headers, method, resource, status2, statusText) {
90295
+ const rayId = extractWAFBlockRayId(headers);
90296
+ throw new APIError({
90297
+ text: "The Cloudflare API responded with a WAF block page instead of the expected JSON response",
90298
+ notes: [
90299
+ {
90300
+ text: "Cloudflare's firewall (WAF) blocked this API request. This is usually a false positive."
90301
+ },
90302
+ ...rayId ? [{ text: `Cloudflare Ray ID: ${rayId}` }] : [],
90303
+ {
90304
+ text: rayId ? "If the issue persists, please open a Cloudflare Support ticket and include the Ray ID above." : "If the issue persists, please open a Cloudflare Support ticket. You can find the Cloudflare Ray ID on the block page in your browser."
90305
+ },
90306
+ {
90307
+ text: `${method} ${resource} -> ${status2} ${statusText}`
90308
+ }
90309
+ ],
90310
+ status: status2,
90311
+ telemetryMessage: false
90312
+ });
90313
+ }
90314
+ __name(throwWAFBlockError, "throwWAFBlockError");
90315
+ function hasCursor(result_info) {
90316
+ const cursor = result_info?.cursor;
90317
+ return cursor !== void 0 && cursor !== null && cursor !== "";
90318
+ }
90319
+ __name(hasCursor, "hasCursor");
90320
+ function maybeAddTraceHeader(headers) {
90321
+ const traceHeader = getTraceHeader();
90322
+ if (traceHeader) {
90323
+ headers.set("Cf-Trace-Id", traceHeader);
90324
+ }
90325
+ }
90326
+ __name(maybeAddTraceHeader, "maybeAddTraceHeader");
90327
+ function cloneHeaders(headers) {
90328
+ return new import_undici.Headers(headers);
90329
+ }
90330
+ __name(cloneHeaders, "cloneHeaders");
90005
90331
  var import_update_check = __toESM2(require_update_check());
90006
90332
  var UPDATE_CHECK_TIMEOUT_MS = 3e3;
90007
90333
  var TIMED_OUT = /* @__PURE__ */ Symbol("timed_out");
@@ -90031,6 +90357,74 @@ async function fetchLatestNpmVersion(name3, version3) {
90031
90357
  return { status: "update-available", latest: result.latest };
90032
90358
  }
90033
90359
  __name(fetchLatestNpmVersion, "fetchLatestNpmVersion");
90360
+ var MAX_ATTEMPTS = 3;
90361
+ async function retryOnAPIFailure(action, logger, backoff = 0, attempts = MAX_ATTEMPTS, abortSignal) {
90362
+ try {
90363
+ return await action();
90364
+ } catch (err) {
90365
+ if (err instanceof APIError) {
90366
+ if (!err.isRetryable()) {
90367
+ throw err;
90368
+ }
90369
+ } else if (err instanceof DOMException && err.name === "TimeoutError") ;
90370
+ else if (!(err instanceof TypeError)) {
90371
+ throw err;
90372
+ }
90373
+ logger.debug(`Retrying API call after error...`);
90374
+ logger.debug(err);
90375
+ if (attempts <= 1) {
90376
+ throw err;
90377
+ }
90378
+ await (0, import_promises.setTimeout)(backoff, void 0, { signal: abortSignal });
90379
+ return retryOnAPIFailure(
90380
+ action,
90381
+ logger,
90382
+ backoff + 1e3,
90383
+ attempts - 1,
90384
+ abortSignal
90385
+ );
90386
+ }
90387
+ }
90388
+ __name(retryOnAPIFailure, "retryOnAPIFailure");
90389
+ function formatTime(duration) {
90390
+ return `(${(duration / 1e3).toFixed(2)} sec)`;
90391
+ }
90392
+ __name(formatTime, "formatTime");
90393
+ function getHostFromRoute(route) {
90394
+ let host;
90395
+ if (typeof route === "string") {
90396
+ host = getHostFromUrl(route);
90397
+ } else if (typeof route === "object") {
90398
+ host = getHostFromUrl(route.pattern);
90399
+ if (host === void 0 && "zone_name" in route) {
90400
+ host = getHostFromUrl(route.zone_name);
90401
+ }
90402
+ }
90403
+ return host;
90404
+ }
90405
+ __name(getHostFromRoute, "getHostFromRoute");
90406
+ function getZoneFromRoute(route) {
90407
+ if (typeof route === "object" && "zone_name" in route && route.zone_name) {
90408
+ return route.zone_name;
90409
+ }
90410
+ return getHostFromRoute(route);
90411
+ }
90412
+ __name(getZoneFromRoute, "getZoneFromRoute");
90413
+ function getHostFromUrl(urlLike) {
90414
+ if (urlLike.startsWith("*/") || urlLike.startsWith("http://*/") || urlLike.startsWith("https://*/")) {
90415
+ return void 0;
90416
+ }
90417
+ urlLike = urlLike.replace(/\*(\.)?/g, "");
90418
+ if (!(urlLike.startsWith("http://") || urlLike.startsWith("https://"))) {
90419
+ urlLike = "http://" + urlLike;
90420
+ }
90421
+ try {
90422
+ return new URL(urlLike).host;
90423
+ } catch {
90424
+ return void 0;
90425
+ }
90426
+ }
90427
+ __name(getHostFromUrl, "getHostFromUrl");
90034
90428
 
90035
90429
  // ../cli/dist/check-macos-version.mjs
90036
90430
  var import_ci_info = __toESM(require_ci_info(), 1);
@@ -95953,12 +96347,12 @@ var YargsInstance = class {
95953
96347
  async getCompletion(args, done) {
95954
96348
  argsert("<array> [function]", [args, done], arguments.length);
95955
96349
  if (!done) {
95956
- return new Promise((resolve12, reject) => {
96350
+ return new Promise((resolve13, reject) => {
95957
96351
  __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
95958
96352
  if (err)
95959
96353
  reject(err);
95960
96354
  else
95961
- resolve12(completions);
96355
+ resolve13(completions);
95962
96356
  });
95963
96357
  });
95964
96358
  } else {
@@ -96998,11 +97392,11 @@ var Yargs = YargsFactory(esm_default2);
96998
97392
  var yargs_default = Yargs;
96999
97393
 
97000
97394
  // package.json
97001
- var version = "2.69.0";
97395
+ var version = "2.70.1";
97002
97396
 
97003
97397
  // src/metrics.ts
97004
97398
  var import_node_async_hooks = require("node:async_hooks");
97005
- var import_promises = require("node:timers/promises");
97399
+ var import_promises2 = require("node:timers/promises");
97006
97400
 
97007
97401
  // src/helpers/metrics-config.ts
97008
97402
  var import_node_crypto2 = require("node:crypto");
@@ -97237,16 +97631,16 @@ async function sendEvent(payload, enableLog) {
97237
97631
 
97238
97632
  // src/metrics.ts
97239
97633
  function promiseWithResolvers() {
97240
- let resolve12;
97634
+ let resolve13;
97241
97635
  let reject;
97242
97636
  const promise = new Promise((res, rej) => {
97243
- resolve12 = res;
97637
+ resolve13 = res;
97244
97638
  reject = rej;
97245
97639
  });
97246
- if (!resolve12 || !reject) {
97640
+ if (!resolve13 || !reject) {
97247
97641
  throw new Error("Promise resolvers not set");
97248
97642
  }
97249
- return { resolve: resolve12, reject, promise };
97643
+ return { resolve: resolve13, reject, promise };
97250
97644
  }
97251
97645
  function getPlatform() {
97252
97646
  const platform2 = process.platform;
@@ -97345,7 +97739,7 @@ function createReporter() {
97345
97739
  async function collectAsyncMetrics(options) {
97346
97740
  const cancelDeferred = promiseWithResolvers();
97347
97741
  const cancel2 = async (signal) => {
97348
- await (0, import_promises.setTimeout)(10);
97742
+ await (0, import_promises2.setTimeout)(10);
97349
97743
  cancelDeferred.reject(new CancelError(`Operation cancelled`, signal));
97350
97744
  };
97351
97745
  const tracker = !options.disableTelemetry ? createTracker(options.eventPrefix, options.props) : null;
@@ -97448,9 +97842,9 @@ var runTelemetryCommand = (action) => {
97448
97842
 
97449
97843
  // src/templates.ts
97450
97844
  var import_node_fs18 = require("node:fs");
97451
- var import_promises6 = require("node:fs/promises");
97845
+ var import_promises7 = require("node:fs/promises");
97452
97846
  var import_node_os7 = require("node:os");
97453
- var import_node_path18 = require("node:path");
97847
+ var import_node_path19 = require("node:path");
97454
97848
  var import_deepmerge = __toESM(require_cjs());
97455
97849
  var import_degit = __toESM(require_dist());
97456
97850
 
@@ -97464,7 +97858,7 @@ var import_node_path8 = __toESM(require("node:path"));
97464
97858
  // ../cli/dist/packages.mjs
97465
97859
  var import_node_path7 = __toESM(require("node:path"), 1);
97466
97860
  var import_node_assert4 = __toESM(require("node:assert"), 1);
97467
- var import_promises2 = require("node:fs/promises");
97861
+ var import_promises3 = require("node:fs/promises");
97468
97862
  var installPackages = async (packageManager, packages, config49 = {}) => {
97469
97863
  const { force, dev, startText, doneText } = config49;
97470
97864
  const isWorkspaceRoot = config49.isWorkspaceRoot ?? false;
@@ -97537,7 +97931,7 @@ var installPackages = async (packageManager, packages, config49 = {}) => {
97537
97931
  if (pkgVersion !== "latest") deps[pkgName] = pkgVersion;
97538
97932
  }
97539
97933
  }
97540
- await (0, import_promises2.writeFile)(pkgJsonPath, JSON.stringify(pkgJson, null, 2));
97934
+ await (0, import_promises3.writeFile)(pkgJsonPath, JSON.stringify(pkgJson, null, 2));
97541
97935
  }
97542
97936
  };
97543
97937
  function getWorkspaceInstallRootFlag(packageManager, isWorkspaceRoot) {
@@ -97592,14 +97986,14 @@ async function getLatestPackageVersion(packageSpecifier) {
97592
97986
  // ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
97593
97987
  var import_node_process13 = __toESM(require("node:process"), 1);
97594
97988
  var import_node_path9 = __toESM(require("node:path"), 1);
97595
- var import_node_url = require("node:url");
97989
+ var import_node_url2 = require("node:url");
97596
97990
  var import_node_child_process8 = __toESM(require("node:child_process"), 1);
97597
- var import_promises4 = __toESM(require("node:fs/promises"), 1);
97991
+ var import_promises5 = __toESM(require("node:fs/promises"), 1);
97598
97992
 
97599
97993
  // ../../node_modules/.pnpm/wsl-utils@0.3.1/node_modules/wsl-utils/index.js
97600
97994
  var import_node_util3 = require("node:util");
97601
97995
  var import_node_child_process3 = __toESM(require("node:child_process"), 1);
97602
- var import_promises3 = __toESM(require("node:fs/promises"), 1);
97996
+ var import_promises4 = __toESM(require("node:fs/promises"), 1);
97603
97997
 
97604
97998
  // ../../node_modules/.pnpm/is-wsl@3.1.0/node_modules/is-wsl/index.js
97605
97999
  var import_node_process7 = __toESM(require("node:process"), 1);
@@ -97731,14 +98125,14 @@ var wslDrivesMountPoint = /* @__PURE__ */ (() => {
97731
98125
  const configFilePath = "/etc/wsl.conf";
97732
98126
  let isConfigFileExists = false;
97733
98127
  try {
97734
- await import_promises3.default.access(configFilePath, import_promises3.constants.F_OK);
98128
+ await import_promises4.default.access(configFilePath, import_promises4.constants.F_OK);
97735
98129
  isConfigFileExists = true;
97736
98130
  } catch {
97737
98131
  }
97738
98132
  if (!isConfigFileExists) {
97739
98133
  return defaultMountPoint;
97740
98134
  }
97741
- const configContent = await import_promises3.default.readFile(configFilePath, { encoding: "utf8" });
98135
+ const configContent = await import_promises4.default.readFile(configFilePath, { encoding: "utf8" });
97742
98136
  const parsedMountPoint = parseMountPointFromConfig(configContent);
97743
98137
  if (parsedMountPoint === void 0) {
97744
98138
  return defaultMountPoint;
@@ -97758,7 +98152,7 @@ var canAccessPowerShell = async () => {
97758
98152
  canAccessPowerShellPromise ??= (async () => {
97759
98153
  try {
97760
98154
  const psPath = await powerShellPath2();
97761
- await import_promises3.default.access(psPath, import_promises3.constants.X_OK);
98155
+ await import_promises4.default.access(psPath, import_promises4.constants.X_OK);
97762
98156
  return true;
97763
98157
  } catch {
97764
98158
  return false;
@@ -97923,7 +98317,7 @@ var is_in_ssh_default = isInSsh;
97923
98317
  // ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
97924
98318
  var import_meta2 = {};
97925
98319
  var fallbackAttemptSymbol = /* @__PURE__ */ Symbol("fallbackAttempt");
97926
- var __dirname3 = import_meta2.url ? import_node_path9.default.dirname((0, import_node_url.fileURLToPath)(import_meta2.url)) : "";
98320
+ var __dirname3 = import_meta2.url ? import_node_path9.default.dirname((0, import_node_url2.fileURLToPath)(import_meta2.url)) : "";
97927
98321
  var localXdgOpenPath = import_node_path9.default.join(__dirname3, "xdg-open");
97928
98322
  var { platform, arch: arch2 } = import_node_process13.default;
97929
98323
  var tryEachApp = async (apps2, opener) => {
@@ -98072,7 +98466,7 @@ var baseOpen = async (options) => {
98072
98466
  const isBundled = !__dirname3 || __dirname3 === "/";
98073
98467
  let exeLocalXdgOpen = false;
98074
98468
  try {
98075
- await import_promises4.default.access(localXdgOpenPath, import_promises4.constants.X_OK);
98469
+ await import_promises5.default.access(localXdgOpenPath, import_promises5.constants.X_OK);
98076
98470
  exeLocalXdgOpen = true;
98077
98471
  } catch {
98078
98472
  }
@@ -98095,19 +98489,19 @@ var baseOpen = async (options) => {
98095
98489
  }
98096
98490
  const subprocess = import_node_child_process8.default.spawn(command2, cliArguments, childProcessOptions);
98097
98491
  if (options.wait) {
98098
- return new Promise((resolve12, reject) => {
98492
+ return new Promise((resolve13, reject) => {
98099
98493
  subprocess.once("error", reject);
98100
98494
  subprocess.once("close", (exitCode) => {
98101
98495
  if (!options.allowNonzeroExitCode && exitCode !== 0) {
98102
98496
  reject(new Error(`Exited with code ${exitCode}`));
98103
98497
  return;
98104
98498
  }
98105
- resolve12(subprocess);
98499
+ resolve13(subprocess);
98106
98500
  });
98107
98501
  });
98108
98502
  }
98109
98503
  if (isFallbackAttempt) {
98110
- return new Promise((resolve12, reject) => {
98504
+ return new Promise((resolve13, reject) => {
98111
98505
  subprocess.once("error", reject);
98112
98506
  subprocess.once("spawn", () => {
98113
98507
  subprocess.once("close", (exitCode) => {
@@ -98117,17 +98511,17 @@ var baseOpen = async (options) => {
98117
98511
  return;
98118
98512
  }
98119
98513
  subprocess.unref();
98120
- resolve12(subprocess);
98514
+ resolve13(subprocess);
98121
98515
  });
98122
98516
  });
98123
98517
  });
98124
98518
  }
98125
98519
  subprocess.unref();
98126
- return new Promise((resolve12, reject) => {
98520
+ return new Promise((resolve13, reject) => {
98127
98521
  subprocess.once("error", reject);
98128
98522
  subprocess.once("spawn", () => {
98129
98523
  subprocess.off("error", reject);
98130
- resolve12(subprocess);
98524
+ resolve13(subprocess);
98131
98525
  });
98132
98526
  });
98133
98527
  };
@@ -99113,6 +99507,13 @@ var readFile = (path6) => {
99113
99507
  throw new Error(error2);
99114
99508
  }
99115
99509
  };
99510
+ var removeFile = (path6) => {
99511
+ try {
99512
+ import_node_fs11.default.rmSync(path6, { force: true });
99513
+ } catch (error2) {
99514
+ throw new Error(`Remove file failed: ${path6}`, { cause: error2 });
99515
+ }
99516
+ };
99116
99517
  var readJSON = (path6) => {
99117
99518
  const contents = readFile(path6);
99118
99519
  return contents ? (0, import_comment_json.parse)(contents) : contents;
@@ -99209,15 +99610,15 @@ __name2(getPropertyName, "getPropertyName");
99209
99610
  var package_default = {
99210
99611
  name: "frameworks_clis_info",
99211
99612
  dependencies: {
99212
- "@angular/create": "21.2.12",
99213
- "@tanstack/cli": "0.68.0",
99214
- "create-analog": "2.5.2",
99613
+ "@angular/create": "22.0.0",
99614
+ "@tanstack/cli": "0.69.1",
99615
+ "create-analog": "2.6.0",
99215
99616
  "create-astro": "5.0.6",
99216
99617
  "create-docusaurus": "3.10.1",
99217
99618
  "create-hono": "0.19.4",
99218
- "create-next-app": "16.2.6",
99619
+ "create-next-app": "16.2.7",
99219
99620
  "create-qwik": "1.20.0",
99220
- "create-react-router": "7.15.1",
99621
+ "create-react-router": "7.17.0",
99221
99622
  "create-rwsdk": "3.1.3",
99222
99623
  "create-solid": "0.7.0",
99223
99624
  "create-vike": "0.0.627",
@@ -99226,7 +99627,7 @@ var package_default = {
99226
99627
  "create-waku": "0.12.5-1.0.0-alpha.10-0",
99227
99628
  gatsby: "5.16.1",
99228
99629
  nuxi: "3.35.2",
99229
- sv: "0.15.3"
99630
+ sv: "0.15.4"
99230
99631
  },
99231
99632
  info: [
99232
99633
  "This package.json is only used to keep track of the frameworks cli dependencies",
@@ -99414,7 +99815,7 @@ function updateAngularJson(ctx) {
99414
99815
  const architectSection = angularJson.projects[ctx.project.name].architect;
99415
99816
  architectSection.build.options.outputPath = "dist";
99416
99817
  architectSection.build.options.outputMode = "server";
99417
- architectSection.build.options.ssr.experimentalPlatform = "neutral";
99818
+ architectSection.build.options.ssr.platform = "neutral";
99418
99819
  architectSection.build.options.assets.push("src/_routes.json");
99419
99820
  writeFile3((0, import_node_path13.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
99420
99821
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
@@ -99500,7 +99901,7 @@ function updateAngularJson2(ctx) {
99500
99901
  const architectSection = angularJson.projects[ctx.project.name].architect;
99501
99902
  architectSection.build.options.outputPath = "dist";
99502
99903
  architectSection.build.options.outputMode = "server";
99503
- architectSection.build.options.ssr.experimentalPlatform = "neutral";
99904
+ architectSection.build.options.ssr.platform = "neutral";
99504
99905
  writeFile3((0, import_node_path14.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
99505
99906
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
99506
99907
  }
@@ -100337,7 +100738,7 @@ var c3_default28 = config25;
100337
100738
 
100338
100739
  // templates/pre-existing/c3.ts
100339
100740
  var import_node_fs14 = require("node:fs");
100340
- var import_promises5 = require("node:fs/promises");
100741
+ var import_promises6 = require("node:fs/promises");
100341
100742
  var import_node_os6 = require("node:os");
100342
100743
  var import_node_path15 = require("node:path");
100343
100744
 
@@ -100469,7 +100870,7 @@ async function copyExistingWorkerFiles(ctx) {
100469
100870
  }
100470
100871
  );
100471
100872
  }
100472
- const tempdir = await (0, import_promises5.mkdtemp)((0, import_node_path15.join)((0, import_node_os6.tmpdir)(), "c3-wrangler-init--from-dash-"));
100873
+ const tempdir = await (0, import_promises6.mkdtemp)((0, import_node_path15.join)((0, import_node_os6.tmpdir)(), "c3-wrangler-init--from-dash-"));
100473
100874
  await runCommand(
100474
100875
  [
100475
100876
  ...dlx,
@@ -100491,7 +100892,7 @@ async function copyExistingWorkerFiles(ctx) {
100491
100892
  )}`
100492
100893
  }
100493
100894
  );
100494
- await (0, import_promises5.cp)(
100895
+ await (0, import_promises6.cp)(
100495
100896
  (0, import_node_path15.join)(tempdir, ctx.args.existingScript, "src"),
100496
100897
  (0, import_node_path15.join)(ctx.project.path, "src"),
100497
100898
  { recursive: true }
@@ -100501,7 +100902,7 @@ async function copyExistingWorkerFiles(ctx) {
100501
100902
  for (const configFile of configFiles) {
100502
100903
  const sourcePath = (0, import_node_path15.join)(tempdir, ctx.args.existingScript, configFile);
100503
100904
  if ((0, import_node_fs14.existsSync)(sourcePath)) {
100504
- await (0, import_promises5.cp)(sourcePath, (0, import_node_path15.join)(ctx.project.path, configFile));
100905
+ await (0, import_promises6.cp)(sourcePath, (0, import_node_path15.join)(ctx.project.path, configFile));
100505
100906
  configFileCopied = true;
100506
100907
  break;
100507
100908
  }
@@ -100530,7 +100931,7 @@ var config26 = {
100530
100931
  };
100531
100932
  var c3_default29 = config26;
100532
100933
  function buildConfigure(params) {
100533
- return async function configure16(ctx) {
100934
+ return async function configure17(ctx) {
100534
100935
  const loginSuccess = await params.login(ctx);
100535
100936
  if (!loginSuccess) {
100536
100937
  throw new Error("Failed to login to Cloudflare");
@@ -100776,21 +101177,35 @@ var config30 = {
100776
101177
  var c3_default33 = config30;
100777
101178
 
100778
101179
  // templates/react-router/c3.ts
101180
+ var import_node_path17 = require("node:path");
100779
101181
  var { npm: npm12 } = detectPackageManager();
100780
101182
  var generate18 = async (ctx) => {
100781
101183
  await runFrameworkGenerator(ctx, [
100782
101184
  ctx.project.name,
100783
- ...ctx.args.experimental ? [] : [
100784
- "--template",
100785
- // React-router deleted the template here
100786
- "https://github.com/remix-run/react-router-templates/tree/29ac272b9532fe26463a2d2693fc73ff3c1e884b/cloudflare"
100787
- ],
100788
101185
  // to prevent asking about git twice, just let c3 do it
100789
101186
  "--no-git-init",
100790
101187
  "--no-install"
100791
101188
  ]);
100792
101189
  logRaw("");
100793
101190
  };
101191
+ var configure10 = async (ctx) => {
101192
+ await installPackages2(["@cloudflare/vite-plugin"], {
101193
+ dev: true,
101194
+ startText: "Installing the Cloudflare Vite plugin",
101195
+ doneText: `${brandColor("installed")} ${dim("@cloudflare/vite-plugin")}`
101196
+ });
101197
+ const s = spinner();
101198
+ s.start("Removing non-Cloudflare artifacts from template");
101199
+ removeFile((0, import_node_path17.resolve)(ctx.project.path, "Dockerfile"));
101200
+ removeFile((0, import_node_path17.resolve)(ctx.project.path, ".dockerignore"));
101201
+ const pkgJsonPath = (0, import_node_path17.resolve)(ctx.project.path, "package.json");
101202
+ const pkgJson = readJSON(pkgJsonPath);
101203
+ delete pkgJson.dependencies?.["@react-router/node"];
101204
+ delete pkgJson.dependencies?.["@react-router/serve"];
101205
+ delete pkgJson.scripts?.start;
101206
+ writeJSON(pkgJsonPath, pkgJson);
101207
+ s.stop(`${brandColor("removed")} ${dim("Node-server template artifacts")}`);
101208
+ };
100794
101209
  var config31 = {
100795
101210
  configVersion: 1,
100796
101211
  id: "react-router",
@@ -100801,6 +101216,7 @@ var config31 = {
100801
101216
  path: "./ts"
100802
101217
  },
100803
101218
  generate: generate18,
101219
+ configure: configure10,
100804
101220
  transformPackageJson: async () => ({
100805
101221
  dependencies: {
100806
101222
  "react-router": "^7.10.0"
@@ -100811,7 +101227,9 @@ var config31 = {
100811
101227
  scripts: {
100812
101228
  deploy: `${npm12} run build && wrangler deploy`,
100813
101229
  preview: `${npm12} run build && vite preview`,
100814
- "cf-typegen": `wrangler types`
101230
+ "cf-typegen": `wrangler types`,
101231
+ typecheck: `wrangler types && react-router typegen && tsc -b`,
101232
+ postinstall: `wrangler types`
100815
101233
  }
100816
101234
  }),
100817
101235
  devScript: "dev",
@@ -100909,7 +101327,7 @@ var generate20 = async (ctx) => {
100909
101327
  ]);
100910
101328
  logRaw("");
100911
101329
  };
100912
- var configure10 = async (ctx) => {
101330
+ var configure11 = async (ctx) => {
100913
101331
  await installPackages2(["@cloudflare/vite-plugin"], {
100914
101332
  dev: true,
100915
101333
  startText: "Installing the Cloudflare Vite plugin",
@@ -101028,7 +101446,7 @@ var config33 = {
101028
101446
  }
101029
101447
  },
101030
101448
  generate: generate20,
101031
- configure: configure10,
101449
+ configure: configure11,
101032
101450
  transformPackageJson: async (_2, ctx) => ({
101033
101451
  scripts: {
101034
101452
  deploy: `${npm14} run build && wrangler deploy`,
@@ -101102,7 +101520,7 @@ var generate22 = async (ctx) => {
101102
101520
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
101103
101521
  logRaw("");
101104
101522
  };
101105
- var configure11 = async (ctx) => {
101523
+ var configure12 = async (ctx) => {
101106
101524
  usesTypescript(ctx);
101107
101525
  const filePath = `vite.config.${usesTypescript(ctx) ? "ts" : "js"}`;
101108
101526
  updateStatus(`Updating configuration in ${blue(filePath)}`);
@@ -101140,7 +101558,7 @@ var config37 = {
101140
101558
  },
101141
101559
  path: "templates/solid",
101142
101560
  generate: generate22,
101143
- configure: configure11,
101561
+ configure: configure12,
101144
101562
  transformPackageJson: async () => ({
101145
101563
  scripts: {
101146
101564
  preview: `${npm16} run build && npx wrangler dev`,
@@ -101162,7 +101580,7 @@ var generate23 = async (ctx) => {
101162
101580
  await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
101163
101581
  logRaw("");
101164
101582
  };
101165
- var configure12 = async (ctx) => {
101583
+ var configure13 = async (ctx) => {
101166
101584
  const pkg = `@sveltejs/adapter-cloudflare`;
101167
101585
  await installPackages2([pkg], {
101168
101586
  dev: true,
@@ -101257,7 +101675,7 @@ var config38 = {
101257
101675
  },
101258
101676
  path: "templates/svelte/pages",
101259
101677
  generate: generate23,
101260
- configure: configure12,
101678
+ configure: configure13,
101261
101679
  transformPackageJson: async (original, ctx) => {
101262
101680
  let scripts = {
101263
101681
  preview: `${npm17} run build && wrangler pages dev`,
@@ -101285,7 +101703,7 @@ var generate24 = async (ctx) => {
101285
101703
  await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
101286
101704
  logRaw("");
101287
101705
  };
101288
- var configure13 = async (ctx) => {
101706
+ var configure14 = async (ctx) => {
101289
101707
  const pkg = `@sveltejs/adapter-cloudflare`;
101290
101708
  await installPackages2([pkg], {
101291
101709
  dev: true,
@@ -101356,7 +101774,7 @@ var config39 = {
101356
101774
  },
101357
101775
  path: "templates/svelte/workers",
101358
101776
  generate: generate24,
101359
- configure: configure13,
101777
+ configure: configure14,
101360
101778
  transformPackageJson: async (original, ctx) => {
101361
101779
  let scripts = {
101362
101780
  preview: `${npm18} run build && wrangler dev`,
@@ -101520,7 +101938,7 @@ var generate29 = async (ctx) => {
101520
101938
  ]);
101521
101939
  logRaw("");
101522
101940
  };
101523
- var configure14 = async (ctx) => {
101941
+ var configure15 = async (ctx) => {
101524
101942
  await installPackages2(["@cloudflare/vite-plugin"], {
101525
101943
  dev: true,
101526
101944
  startText: "Installing the Cloudflare Vite plugin",
@@ -101561,7 +101979,7 @@ var config45 = {
101561
101979
  }
101562
101980
  }
101563
101981
  },
101564
- configure: configure14,
101982
+ configure: configure15,
101565
101983
  generate: generate29,
101566
101984
  transformPackageJson: async (_2, ctx) => ({
101567
101985
  scripts: {
@@ -101686,7 +102104,7 @@ If the application uses Durable Objects or Workflows, refer to the relevant best
101686
102104
  var import_node_assert6 = __toESM(require("node:assert"));
101687
102105
 
101688
102106
  // ../wrangler/package.json
101689
- var version2 = "4.96.0";
102107
+ var version2 = "4.99.0";
101690
102108
 
101691
102109
  // src/git.ts
101692
102110
  var offerGit = async (ctx) => {
@@ -101875,7 +102293,7 @@ async function getProductionBranch(cwd) {
101875
102293
 
101876
102294
  // src/validators.ts
101877
102295
  var import_node_fs17 = require("node:fs");
101878
- var import_node_path17 = require("node:path");
102296
+ var import_node_path18 = require("node:path");
101879
102297
  var TEMPLATE_REGEX = /^(?:(?:https:\/\/)?(?<httpsUrl>[^:/]+\.[^:/]+)\/|git@(?<gitUrl>[^:/]+)[:/]|(?<shorthandUrl>[^/]+):)?(?<user>[^/\s]+)\/(?<repository>[^/\s#]+)(?:(?<subdirectoryPath>(?:\/[^/\s#]+)+))?(?:\/)?(?:#(?<tag>.+))?/;
101880
102298
  var validateTemplateUrl = (value) => {
101881
102299
  if (!String(value).match(TEMPLATE_REGEX)) {
@@ -101883,7 +102301,7 @@ var validateTemplateUrl = (value) => {
101883
102301
  }
101884
102302
  };
101885
102303
  var validateProjectDirectory = (relativePath, args) => {
101886
- const path6 = (0, import_node_path17.resolve)(relativePath);
102304
+ const path6 = (0, import_node_path18.resolve)(relativePath);
101887
102305
  const existsAlready = (0, import_node_fs17.existsSync)(path6);
101888
102306
  if (existsAlready) {
101889
102307
  for (const file2 of (0, import_node_fs17.readdirSync)(path6)) {
@@ -101893,7 +102311,7 @@ var validateProjectDirectory = (relativePath, args) => {
101893
102311
  }
101894
102312
  }
101895
102313
  if (!args.existingScript) {
101896
- const projectName = (0, import_node_path17.basename)(path6);
102314
+ const projectName = (0, import_node_path18.basename)(path6);
101897
102315
  const invalidChars = /[^a-z0-9-]/;
101898
102316
  const invalidStartEnd = /^-|-$/;
101899
102317
  if (projectName.match(invalidStartEnd)) {
@@ -102176,7 +102594,7 @@ var createContext = async (args, prevArgs) => {
102176
102594
  format: (val) => `./${val}`
102177
102595
  });
102178
102596
  const categoryOptions = [];
102179
- if (Object.keys(helloWorldTemplateMap).length) {
102597
+ if (args.platform !== "pages" && Object.keys(helloWorldTemplateMap).length) {
102180
102598
  categoryOptions.push({
102181
102599
  label: "Hello World example",
102182
102600
  value: "hello-world",
@@ -102190,7 +102608,7 @@ var createContext = async (args, prevArgs) => {
102190
102608
  description: "Select from the most popular full-stack web frameworks"
102191
102609
  });
102192
102610
  }
102193
- if (Object.keys(otherTemplateMap).length) {
102611
+ if (args.platform !== "pages" && Object.keys(otherTemplateMap).length) {
102194
102612
  categoryOptions.push({
102195
102613
  label: "Application Starter",
102196
102614
  value: "demo",
@@ -102198,6 +102616,9 @@ var createContext = async (args, prevArgs) => {
102198
102616
  });
102199
102617
  }
102200
102618
  categoryOptions.push(
102619
+ // TODO: hide "Template from a GitHub repo" when a --platform arg is
102620
+ // provided (whether workers or pages), since remote templates have no
102621
+ // platform validation and would ignore the user's platform choice
102201
102622
  {
102202
102623
  label: "Template from a GitHub repo",
102203
102624
  value: "remote-template",
@@ -102218,11 +102639,22 @@ var createContext = async (args, prevArgs) => {
102218
102639
  if (category === BACK_VALUE) {
102219
102640
  return goBack("category");
102220
102641
  }
102642
+ if (args.platform === "pages" && category !== "web-framework" && category !== "remote-template") {
102643
+ throw new Error(
102644
+ `The "${category}" category is not available for the "pages" platform`
102645
+ );
102646
+ }
102221
102647
  let template;
102222
102648
  if (category === "web-framework") {
102223
102649
  const frameworkOptions = Object.entries(frameworkMap).reduce(
102224
102650
  (acc, [key, config49]) => {
102225
102651
  if (!config49.hidden || args.framework) {
102652
+ if (args.platform && !args.framework) {
102653
+ const supportsTargetPlatform = "platformVariants" in config49 ? args.platform in config49.platformVariants : config49.platform === args.platform;
102654
+ if (!supportsTargetPlatform) {
102655
+ return acc;
102656
+ }
102657
+ }
102226
102658
  acc.push({
102227
102659
  label: config49.displayName,
102228
102660
  value: key
@@ -102333,7 +102765,7 @@ var createContext = async (args, prevArgs) => {
102333
102765
  envInterfaceName: "Env",
102334
102766
  ...template
102335
102767
  };
102336
- const path6 = (0, import_node_path18.resolve)(projectName);
102768
+ const path6 = (0, import_node_path19.resolve)(projectName);
102337
102769
  const languageVariants = template.copyFiles && !isVariantInfo(template.copyFiles) && !template.copyFiles.selectVariant ? Object.keys(template.copyFiles.variants) : [];
102338
102770
  if (languageVariants.length > 0) {
102339
102771
  if (hasTsConfig(path6)) {
@@ -102359,8 +102791,8 @@ var createContext = async (args, prevArgs) => {
102359
102791
  }
102360
102792
  }
102361
102793
  }
102362
- const name3 = (0, import_node_path18.basename)(path6);
102363
- const directory = (0, import_node_path18.dirname)(path6);
102794
+ const name3 = (0, import_node_path19.basename)(path6);
102795
+ const directory = (0, import_node_path19.dirname)(path6);
102364
102796
  const originalCWD = process.cwd();
102365
102797
  return {
102366
102798
  project: { name: name3, path: path6 },
@@ -102380,7 +102812,7 @@ async function copyTemplateFiles(ctx) {
102380
102812
  const { copyFiles } = ctx.template;
102381
102813
  let srcdir;
102382
102814
  if (isVariantInfo(copyFiles)) {
102383
- srcdir = (0, import_node_path18.join)(getTemplatePath(ctx), copyFiles.path);
102815
+ srcdir = (0, import_node_path19.join)(getTemplatePath(ctx), copyFiles.path);
102384
102816
  } else {
102385
102817
  const selectVariant = copyFiles.selectVariant ?? defaultSelectVariant;
102386
102818
  const variant = await selectVariant(ctx);
@@ -102390,21 +102822,21 @@ async function copyTemplateFiles(ctx) {
102390
102822
  `Unknown variant provided: ${JSON.stringify(variant ?? "")}`
102391
102823
  );
102392
102824
  }
102393
- srcdir = (0, import_node_path18.join)(getTemplatePath(ctx), variantInfo.path);
102825
+ srcdir = (0, import_node_path19.join)(getTemplatePath(ctx), variantInfo.path);
102394
102826
  }
102395
102827
  const copyDestDir = getCopyFilesDestinationDir(ctx);
102396
- const destdir = (0, import_node_path18.join)(ctx.project.path, ...copyDestDir ? [copyDestDir] : []);
102828
+ const destdir = (0, import_node_path19.join)(ctx.project.path, ...copyDestDir ? [copyDestDir] : []);
102397
102829
  const s = spinner();
102398
102830
  s.start(`Copying template files`);
102399
- await (0, import_promises6.cp)(srcdir, destdir, { recursive: true, force: true });
102400
- const dummyGitIgnorePath = (0, import_node_path18.join)(destdir, "__dot__gitignore");
102831
+ await (0, import_promises7.cp)(srcdir, destdir, { recursive: true, force: true });
102832
+ const dummyGitIgnorePath = (0, import_node_path19.join)(destdir, "__dot__gitignore");
102401
102833
  if ((0, import_node_fs18.existsSync)(dummyGitIgnorePath)) {
102402
- await (0, import_promises6.rename)(dummyGitIgnorePath, (0, import_node_path18.join)(destdir, ".gitignore"));
102834
+ await (0, import_promises7.rename)(dummyGitIgnorePath, (0, import_node_path19.join)(destdir, ".gitignore"));
102403
102835
  }
102404
102836
  s.stop(`${brandColor("files")} ${dim("copied to project directory")}`);
102405
102837
  }
102406
102838
  function writeAgentsMd(projectPath) {
102407
- const agentsMdPath = (0, import_node_path18.join)(projectPath, "AGENTS.md");
102839
+ const agentsMdPath = (0, import_node_path19.join)(projectPath, "AGENTS.md");
102408
102840
  if ((0, import_node_fs18.existsSync)(agentsMdPath)) {
102409
102841
  return;
102410
102842
  }
@@ -102434,25 +102866,25 @@ var validateTemplate = (path6, config49) => {
102434
102866
  return;
102435
102867
  }
102436
102868
  if (isVariantInfo(config49.copyFiles)) {
102437
- validateTemplateSrcDirectory((0, import_node_path18.resolve)(path6, config49.copyFiles.path), config49);
102869
+ validateTemplateSrcDirectory((0, import_node_path19.resolve)(path6, config49.copyFiles.path), config49);
102438
102870
  } else {
102439
102871
  for (const variant of Object.values(config49.copyFiles.variants)) {
102440
- validateTemplateSrcDirectory((0, import_node_path18.resolve)(path6, variant.path), config49);
102872
+ validateTemplateSrcDirectory((0, import_node_path19.resolve)(path6, variant.path), config49);
102441
102873
  }
102442
102874
  }
102443
102875
  };
102444
102876
  var validateTemplateSrcDirectory = (path6, config49) => {
102445
102877
  if (config49.platform === "workers") {
102446
- const wranglerTomlPath = (0, import_node_path18.resolve)(path6, "wrangler.toml");
102447
- const wranglerJsonPath = (0, import_node_path18.resolve)(path6, "wrangler.json");
102448
- const wranglerJsoncPath = (0, import_node_path18.resolve)(path6, "wrangler.jsonc");
102878
+ const wranglerTomlPath = (0, import_node_path19.resolve)(path6, "wrangler.toml");
102879
+ const wranglerJsonPath = (0, import_node_path19.resolve)(path6, "wrangler.json");
102880
+ const wranglerJsoncPath = (0, import_node_path19.resolve)(path6, "wrangler.jsonc");
102449
102881
  if (!(0, import_node_fs18.existsSync)(wranglerTomlPath) && !(0, import_node_fs18.existsSync)(wranglerJsonPath) && !(0, import_node_fs18.existsSync)(wranglerJsoncPath)) {
102450
102882
  throw new Error(
102451
102883
  `create-cloudflare templates must contain a "wrangler.toml" or "wrangler.json(c)" file.`
102452
102884
  );
102453
102885
  }
102454
102886
  }
102455
- const pkgJsonPath = (0, import_node_path18.resolve)(path6, "package.json");
102887
+ const pkgJsonPath = (0, import_node_path19.resolve)(path6, "package.json");
102456
102888
  if (!(0, import_node_fs18.existsSync)(pkgJsonPath)) {
102457
102889
  throw new Error(
102458
102890
  `create-cloudflare templates must contain a "package.json" file.`
@@ -102470,10 +102902,10 @@ var inferTemplateConfig = (path6) => {
102470
102902
  };
102471
102903
  var inferCopyFilesDefinition = (path6) => {
102472
102904
  const variants = {};
102473
- if ((0, import_node_fs18.existsSync)((0, import_node_path18.join)(path6, "js"))) {
102905
+ if ((0, import_node_fs18.existsSync)((0, import_node_path19.join)(path6, "js"))) {
102474
102906
  variants["js"] = { path: "./js" };
102475
102907
  }
102476
- if ((0, import_node_fs18.existsSync)((0, import_node_path18.join)(path6, "ts"))) {
102908
+ if ((0, import_node_fs18.existsSync)((0, import_node_path19.join)(path6, "ts"))) {
102477
102909
  variants["ts"] = { path: "./ts" };
102478
102910
  }
102479
102911
  const copyFiles = Object.keys(variants).length !== 0 ? { variants } : { path: "." };
@@ -102508,7 +102940,7 @@ Use the format "github:<owner>/<repo>/sub/directory[#<branch>]" to clone a speci
102508
102940
  force: true,
102509
102941
  mode: options.mode
102510
102942
  });
102511
- const tmpDir = options.intoFolder ?? await (0, import_promises6.mkdtemp)((0, import_node_path18.join)((0, import_node_os7.tmpdir)(), "c3-template"));
102943
+ const tmpDir = options.intoFolder ?? await (0, import_promises7.mkdtemp)((0, import_node_path19.join)((0, import_node_os7.tmpdir)(), "c3-template"));
102512
102944
  await emitter.clone(tmpDir);
102513
102945
  return tmpDir;
102514
102946
  } catch {
@@ -102517,7 +102949,7 @@ Use the format "github:<owner>/<repo>/sub/directory[#<branch>]" to clone a speci
102517
102949
  }
102518
102950
  }
102519
102951
  function updatePythonPackageName(path6, projectName) {
102520
- const pyProjectFile = (0, import_node_path18.resolve)(path6, "pyproject.toml");
102952
+ const pyProjectFile = (0, import_node_path19.resolve)(path6, "pyproject.toml");
102521
102953
  if (!(0, import_node_fs18.existsSync)(pyProjectFile)) {
102522
102954
  return;
102523
102955
  }
@@ -102530,7 +102962,7 @@ function updatePythonPackageName(path6, projectName) {
102530
102962
  }
102531
102963
  var updatePackageName = (ctx) => {
102532
102964
  const placeholderNames = ["<PACKAGE_NAME>", "<TBD>", "TBD", ""];
102533
- const pkgJsonPath = (0, import_node_path18.resolve)(ctx.project.path, "package.json");
102965
+ const pkgJsonPath = (0, import_node_path19.resolve)(ctx.project.path, "package.json");
102534
102966
  const pkgJson = readJSON(pkgJsonPath);
102535
102967
  if (!placeholderNames.includes(pkgJson.name)) {
102536
102968
  return;
@@ -102548,7 +102980,7 @@ var updatePackageScripts = async (ctx) => {
102548
102980
  }
102549
102981
  const s = spinner();
102550
102982
  s.start("Updating `package.json` scripts");
102551
- const pkgJsonPath = (0, import_node_path18.resolve)(ctx.project.path, "package.json");
102983
+ const pkgJsonPath = (0, import_node_path19.resolve)(ctx.project.path, "package.json");
102552
102984
  let pkgJson = readJSON(pkgJsonPath);
102553
102985
  const transformed = await ctx.template.transformPackageJson(pkgJson, ctx);
102554
102986
  pkgJson = (0, import_deepmerge.default)(pkgJson, transformed);
@@ -102557,9 +102989,9 @@ var updatePackageScripts = async (ctx) => {
102557
102989
  };
102558
102990
  var getTemplatePath = (ctx) => {
102559
102991
  if (ctx.template.path) {
102560
- return (0, import_node_path18.resolve)(__dirname, "..", ctx.template.path);
102992
+ return (0, import_node_path19.resolve)(__dirname, "..", ctx.template.path);
102561
102993
  }
102562
- return (0, import_node_path18.resolve)(__dirname, "..", "templates", ctx.template.id);
102994
+ return (0, import_node_path19.resolve)(__dirname, "..", "templates", ctx.template.id);
102563
102995
  };
102564
102996
  var isVariantInfo = (copyFiles) => {
102565
102997
  return "path" in copyFiles;
@@ -102603,8 +103035,17 @@ var cliDefinition = {
102603
103035
  description: `Specifies the kind of templates that should be created`,
102604
103036
  values(args) {
102605
103037
  const experimental2 = Boolean(args?.["experimental"]);
103038
+ const platform2 = args?.["platform"];
102606
103039
  if (experimental2) {
102607
103040
  return [{ name: "web-framework", description: "Framework Starter" }];
103041
+ } else if (platform2 === "pages") {
103042
+ return [
103043
+ { name: "web-framework", description: "Framework Starter" },
103044
+ {
103045
+ name: "remote-template",
103046
+ description: "Template from a GitHub repo"
103047
+ }
103048
+ ];
102608
103049
  } else {
102609
103050
  return [
102610
103051
  { name: "hello-world", description: "Hello World Starter" },
@@ -102925,12 +103366,12 @@ var processArgument = async (args, key, promptConfig) => {
102925
103366
  };
102926
103367
 
102927
103368
  // src/deploy.ts
102928
- var import_promises8 = require("node:fs/promises");
103369
+ var import_promises9 = require("node:fs/promises");
102929
103370
  var import_node_os8 = require("node:os");
102930
- var import_node_path20 = require("node:path");
103371
+ var import_node_path21 = require("node:path");
102931
103372
 
102932
103373
  // src/helpers/poll.ts
102933
- var import_promises7 = require("node:timers/promises");
103374
+ var import_promises8 = require("node:timers/promises");
102934
103375
  var import_dns2 = __toESM(require_dns22());
102935
103376
  var import_undici4 = __toESM(require_undici());
102936
103377
  var TIMEOUT_MS = 1e3 * 60 * 5;
@@ -102940,7 +103381,7 @@ var poll = async (url) => {
102940
103381
  const domain = new URL(url).host;
102941
103382
  const s = spinner();
102942
103383
  s.start("Waiting for DNS to propagate. This might take a few minutes.");
102943
- await (0, import_promises7.setTimeout)(1e4);
103384
+ await (0, import_promises8.setTimeout)(1e4);
102944
103385
  await pollDns(domain, start, s);
102945
103386
  if (await pollHttp(url, start, s)) {
102946
103387
  return true;
@@ -102961,7 +103402,7 @@ var pollDns = async (domain, start, s) => {
102961
103402
  s.stop(`${brandColor("DNS propagation")} ${dim("complete")}.`);
102962
103403
  return;
102963
103404
  }
102964
- await (0, import_promises7.setTimeout)(POLL_INTERVAL_MS);
103405
+ await (0, import_promises8.setTimeout)(POLL_INTERVAL_MS);
102965
103406
  }
102966
103407
  };
102967
103408
  var pollHttp = async (url, start, s) => {
@@ -102986,7 +103427,7 @@ var pollHttp = async (url, start, s) => {
102986
103427
  throw e;
102987
103428
  }
102988
103429
  }
102989
- await (0, import_promises7.setTimeout)(POLL_INTERVAL_MS);
103430
+ await (0, import_promises8.setTimeout)(POLL_INTERVAL_MS);
102990
103431
  }
102991
103432
  };
102992
103433
  var isDomainResolvable = async (domain) => {
@@ -103020,7 +103461,7 @@ function secondsSince(start) {
103020
103461
 
103021
103462
  // src/wrangler/config.ts
103022
103463
  var import_node_fs19 = require("node:fs");
103023
- var import_node_path19 = require("node:path");
103464
+ var import_node_path20 = require("node:path");
103024
103465
 
103025
103466
  // src/helpers/json.ts
103026
103467
  var import_comment_json2 = __toESM(require_src3());
@@ -103132,13 +103573,13 @@ ${generateHintsAsTomlComments(wranglerToml)}
103132
103573
  }
103133
103574
  };
103134
103575
  var getWranglerTomlPath = (ctx) => {
103135
- return (0, import_node_path19.resolve)(ctx.project.path, "wrangler.toml");
103576
+ return (0, import_node_path20.resolve)(ctx.project.path, "wrangler.toml");
103136
103577
  };
103137
103578
  var getWranglerJsonPath = (ctx) => {
103138
- return (0, import_node_path19.resolve)(ctx.project.path, "wrangler.json");
103579
+ return (0, import_node_path20.resolve)(ctx.project.path, "wrangler.json");
103139
103580
  };
103140
103581
  var getWranglerJsoncPath = (ctx) => {
103141
- return (0, import_node_path19.resolve)(ctx.project.path, "wrangler.jsonc");
103582
+ return (0, import_node_path20.resolve)(ctx.project.path, "wrangler.jsonc");
103142
103583
  };
103143
103584
  var wranglerTomlExists = (ctx) => {
103144
103585
  const wranglerTomlPath = getWranglerTomlPath(ctx);
@@ -103344,8 +103785,8 @@ var runDeploy = async (ctx) => {
103344
103785
  JSON.stringify(ctx.commitMessage)
103345
103786
  ] : []
103346
103787
  ];
103347
- const outputFile = (0, import_node_path20.join)(
103348
- await (0, import_promises8.mkdtemp)((0, import_node_path20.join)((0, import_node_os8.tmpdir)(), "c3-wrangler-deploy-")),
103788
+ const outputFile = (0, import_node_path21.join)(
103789
+ await (0, import_promises9.mkdtemp)((0, import_node_path21.join)((0, import_node_os8.tmpdir)(), "c3-wrangler-deploy-")),
103349
103790
  "output.json"
103350
103791
  );
103351
103792
  await runCommand(deployCmd, {
@@ -103407,7 +103848,7 @@ var hasBinding = (node) => {
103407
103848
  };
103408
103849
 
103409
103850
  // src/dialog.ts
103410
- var import_node_path21 = require("node:path");
103851
+ var import_node_path22 = require("node:path");
103411
103852
  function createDialog(lines) {
103412
103853
  const screenWidth = process.stdout.columns;
103413
103854
  const maxLineWidth = Math.max(
@@ -103447,7 +103888,7 @@ function printWelcomeMessage(version3, telemetryEnabled, args) {
103447
103888
  }
103448
103889
  var printSummary = (ctx) => {
103449
103890
  const dashboardUrl = ctx.account ? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}/production` : null;
103450
- const relativePath = (0, import_node_path21.relative)(ctx.originalCWD, ctx.project.path);
103891
+ const relativePath = (0, import_node_path22.relative)(ctx.originalCWD, ctx.project.path);
103451
103892
  const cdCommand = relativePath ? `cd ${relativePath}` : null;
103452
103893
  const { npm: npm25 } = detectPackageManager();
103453
103894
  const deployCommand = quoteShellArgs([
@@ -103818,7 +104259,7 @@ var renderValues = (values) => {
103818
104259
  };
103819
104260
 
103820
104261
  // src/helpers/retry.ts
103821
- var import_promises9 = require("node:timers/promises");
104262
+ var import_promises10 = require("node:timers/promises");
103822
104263
  var retry = async (config49, fn) => {
103823
104264
  let { times } = config49;
103824
104265
  let error2 = null;
@@ -103831,7 +104272,7 @@ var retry = async (config49, fn) => {
103831
104272
  if (config49.exitCondition?.(e)) {
103832
104273
  break;
103833
104274
  }
103834
- await (0, import_promises9.setTimeout)(config49.sleepMs ?? 1e3);
104275
+ await (0, import_promises10.setTimeout)(config49.sleepMs ?? 1e3);
103835
104276
  }
103836
104277
  }
103837
104278
  throw error2;
@@ -103919,7 +104360,7 @@ var createProject = async (ctx) => {
103919
104360
 
103920
104361
  // src/workers.ts
103921
104362
  var import_node_fs20 = require("node:fs");
103922
- var import_node_path22 = require("node:path");
104363
+ var import_node_path23 = require("node:path");
103923
104364
 
103924
104365
  // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
103925
104366
  function createScanner2(text, ignoreTrivia = false) {
@@ -105249,7 +105690,7 @@ async function addTypes(ctx) {
105249
105690
  await updateTsConfig(ctx, { usesNodeCompat });
105250
105691
  }
105251
105692
  async function generateWorkersTypes(ctx, npm25) {
105252
- const packageJsonPath = (0, import_node_path22.join)(ctx.project.path, "package.json");
105693
+ const packageJsonPath = (0, import_node_path23.join)(ctx.project.path, "package.json");
105253
105694
  if (!(0, import_node_fs20.existsSync)(packageJsonPath)) {
105254
105695
  return;
105255
105696
  }
@@ -105289,7 +105730,7 @@ var maybeInstallNodeTypes = async (ctx, npm25) => {
105289
105730
  return false;
105290
105731
  };
105291
105732
  async function updateTsConfig(ctx, { usesNodeCompat }) {
105292
- const tsconfigPath = (0, import_node_path22.join)(ctx.project.path, "tsconfig.json");
105733
+ const tsconfigPath = (0, import_node_path23.join)(ctx.project.path, "tsconfig.json");
105293
105734
  if (!(0, import_node_fs20.existsSync)(tsconfigPath)) {
105294
105735
  return;
105295
105736
  }
@@ -105409,7 +105850,7 @@ var runCli = async (args) => {
105409
105850
  checkMacOSVersion({ shouldThrow: true });
105410
105851
  const ctx = await createContext(args);
105411
105852
  await create(ctx);
105412
- await configure15(ctx);
105853
+ await configure16(ctx);
105413
105854
  await deploy(ctx);
105414
105855
  printSummary(ctx);
105415
105856
  logRaw("");
@@ -105420,7 +105861,7 @@ var setupProjectDirectory = (ctx) => {
105420
105861
  if (err) {
105421
105862
  throw new Error(err);
105422
105863
  }
105423
- const directory = (0, import_node_path23.dirname)(path6);
105864
+ const directory = (0, import_node_path24.dirname)(path6);
105424
105865
  (0, import_node_fs21.mkdirSync)(directory, { recursive: true });
105425
105866
  (0, import_node_process14.chdir)(directory);
105426
105867
  };
@@ -105442,7 +105883,7 @@ var create = async (ctx) => {
105442
105883
  }
105443
105884
  endSection(`Application created`);
105444
105885
  };
105445
- var configure15 = async (ctx) => {
105886
+ var configure16 = async (ctx) => {
105446
105887
  startSection(
105447
105888
  `Configuring your application for Cloudflare${ctx.args.experimental ? ` via \`wrangler setup\`` : ""}`,
105448
105889
  "Step 2 of 3"