alchemy 0.62.0 → 0.62.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/bin/alchemy.js CHANGED
@@ -21,6 +21,7 @@ import { serialize } from "node:v8";
21
21
  import { finished } from "node:stream/promises";
22
22
  import { Buffer as Buffer$1 } from "node:buffer";
23
23
  import { onExit } from "signal-exit";
24
+ import YAML from "yaml";
24
25
  import { ResultAsync, err, ok, okAsync } from "neverthrow";
25
26
  import assert from "node:assert";
26
27
  import crypto$1, { createHash } from "node:crypto";
@@ -2510,7 +2511,7 @@ var require_command = /* @__PURE__ */ __commonJS$1({ "../node_modules/trpc-cli/n
2510
2511
  const EventEmitter$1 = __require("node:events").EventEmitter;
2511
2512
  const childProcess$1 = __require("node:child_process");
2512
2513
  const path$32 = __require("node:path");
2513
- const fs$34 = __require("node:fs");
2514
+ const fs$35 = __require("node:fs");
2514
2515
  const process$1 = __require("node:process");
2515
2516
  const { Argument: Argument$1, humanReadableArgName } = require_argument();
2516
2517
  const { CommanderError: CommanderError$1 } = require_error$1();
@@ -3407,7 +3408,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3407
3408
  * @param {string} subcommandName
3408
3409
  */
3409
3410
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
3410
- if (fs$34.existsSync(executableFile)) return;
3411
+ if (fs$35.existsSync(executableFile)) return;
3411
3412
  const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
3412
3413
  const executableMissing = `'${executableFile}' does not exist
3413
3414
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -3432,9 +3433,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
3432
3433
  ];
3433
3434
  function findFile(baseDir, baseName) {
3434
3435
  const localBin = path$32.resolve(baseDir, baseName);
3435
- if (fs$34.existsSync(localBin)) return localBin;
3436
+ if (fs$35.existsSync(localBin)) return localBin;
3436
3437
  if (sourceExt.includes(path$32.extname(baseName))) return void 0;
3437
- const foundExt = sourceExt.find((ext$1) => fs$34.existsSync(`${localBin}${ext$1}`));
3438
+ const foundExt = sourceExt.find((ext$1) => fs$35.existsSync(`${localBin}${ext$1}`));
3438
3439
  if (foundExt) return `${localBin}${foundExt}`;
3439
3440
  return void 0;
3440
3441
  }
@@ -3445,7 +3446,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3445
3446
  if (this._scriptPath) {
3446
3447
  let resolvedScriptPath;
3447
3448
  try {
3448
- resolvedScriptPath = fs$34.realpathSync(this._scriptPath);
3449
+ resolvedScriptPath = fs$35.realpathSync(this._scriptPath);
3449
3450
  } catch {
3450
3451
  resolvedScriptPath = this._scriptPath;
3451
3452
  }
@@ -25482,47 +25483,47 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful
25482
25483
  if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
25483
25484
  }
25484
25485
  module.exports = patch$1;
25485
- function patch$1(fs$35) {
25486
- if (constants$4.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) patchLchmod(fs$35);
25487
- if (!fs$35.lutimes) patchLutimes(fs$35);
25488
- fs$35.chown = chownFix(fs$35.chown);
25489
- fs$35.fchown = chownFix(fs$35.fchown);
25490
- fs$35.lchown = chownFix(fs$35.lchown);
25491
- fs$35.chmod = chmodFix(fs$35.chmod);
25492
- fs$35.fchmod = chmodFix(fs$35.fchmod);
25493
- fs$35.lchmod = chmodFix(fs$35.lchmod);
25494
- fs$35.chownSync = chownFixSync(fs$35.chownSync);
25495
- fs$35.fchownSync = chownFixSync(fs$35.fchownSync);
25496
- fs$35.lchownSync = chownFixSync(fs$35.lchownSync);
25497
- fs$35.chmodSync = chmodFixSync(fs$35.chmodSync);
25498
- fs$35.fchmodSync = chmodFixSync(fs$35.fchmodSync);
25499
- fs$35.lchmodSync = chmodFixSync(fs$35.lchmodSync);
25500
- fs$35.stat = statFix(fs$35.stat);
25501
- fs$35.fstat = statFix(fs$35.fstat);
25502
- fs$35.lstat = statFix(fs$35.lstat);
25503
- fs$35.statSync = statFixSync(fs$35.statSync);
25504
- fs$35.fstatSync = statFixSync(fs$35.fstatSync);
25505
- fs$35.lstatSync = statFixSync(fs$35.lstatSync);
25506
- if (fs$35.chmod && !fs$35.lchmod) {
25507
- fs$35.lchmod = function(path$33, mode, cb) {
25486
+ function patch$1(fs$36) {
25487
+ if (constants$4.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) patchLchmod(fs$36);
25488
+ if (!fs$36.lutimes) patchLutimes(fs$36);
25489
+ fs$36.chown = chownFix(fs$36.chown);
25490
+ fs$36.fchown = chownFix(fs$36.fchown);
25491
+ fs$36.lchown = chownFix(fs$36.lchown);
25492
+ fs$36.chmod = chmodFix(fs$36.chmod);
25493
+ fs$36.fchmod = chmodFix(fs$36.fchmod);
25494
+ fs$36.lchmod = chmodFix(fs$36.lchmod);
25495
+ fs$36.chownSync = chownFixSync(fs$36.chownSync);
25496
+ fs$36.fchownSync = chownFixSync(fs$36.fchownSync);
25497
+ fs$36.lchownSync = chownFixSync(fs$36.lchownSync);
25498
+ fs$36.chmodSync = chmodFixSync(fs$36.chmodSync);
25499
+ fs$36.fchmodSync = chmodFixSync(fs$36.fchmodSync);
25500
+ fs$36.lchmodSync = chmodFixSync(fs$36.lchmodSync);
25501
+ fs$36.stat = statFix(fs$36.stat);
25502
+ fs$36.fstat = statFix(fs$36.fstat);
25503
+ fs$36.lstat = statFix(fs$36.lstat);
25504
+ fs$36.statSync = statFixSync(fs$36.statSync);
25505
+ fs$36.fstatSync = statFixSync(fs$36.fstatSync);
25506
+ fs$36.lstatSync = statFixSync(fs$36.lstatSync);
25507
+ if (fs$36.chmod && !fs$36.lchmod) {
25508
+ fs$36.lchmod = function(path$33, mode, cb) {
25508
25509
  if (cb) process.nextTick(cb);
25509
25510
  };
25510
- fs$35.lchmodSync = function() {};
25511
+ fs$36.lchmodSync = function() {};
25511
25512
  }
25512
- if (fs$35.chown && !fs$35.lchown) {
25513
- fs$35.lchown = function(path$33, uid, gid, cb) {
25513
+ if (fs$36.chown && !fs$36.lchown) {
25514
+ fs$36.lchown = function(path$33, uid, gid, cb) {
25514
25515
  if (cb) process.nextTick(cb);
25515
25516
  };
25516
- fs$35.lchownSync = function() {};
25517
+ fs$36.lchownSync = function() {};
25517
25518
  }
25518
- if (platform$2 === "win32") fs$35.rename = typeof fs$35.rename !== "function" ? fs$35.rename : (function(fs$rename) {
25519
+ if (platform$2 === "win32") fs$36.rename = typeof fs$36.rename !== "function" ? fs$36.rename : (function(fs$rename) {
25519
25520
  function rename$1(from, to, cb) {
25520
25521
  var start = Date.now();
25521
25522
  var backoff = 0;
25522
25523
  fs$rename(from, to, function CB(er) {
25523
25524
  if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
25524
25525
  setTimeout(function() {
25525
- fs$35.stat(to, function(stater, st) {
25526
+ fs$36.stat(to, function(stater, st) {
25526
25527
  if (stater && stater.code === "ENOENT") fs$rename(from, to, CB);
25527
25528
  else cb(er);
25528
25529
  });
@@ -25535,8 +25536,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful
25535
25536
  }
25536
25537
  if (Object.setPrototypeOf) Object.setPrototypeOf(rename$1, fs$rename);
25537
25538
  return rename$1;
25538
- })(fs$35.rename);
25539
- fs$35.read = typeof fs$35.read !== "function" ? fs$35.read : (function(fs$read) {
25539
+ })(fs$36.rename);
25540
+ fs$36.read = typeof fs$36.read !== "function" ? fs$36.read : (function(fs$read) {
25540
25541
  function read$4(fd, buffer, offset, length, position, callback_) {
25541
25542
  var callback;
25542
25543
  if (callback_ && typeof callback_ === "function") {
@@ -25544,21 +25545,21 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful
25544
25545
  callback = function(er, _$2, __) {
25545
25546
  if (er && er.code === "EAGAIN" && eagCounter < 10) {
25546
25547
  eagCounter++;
25547
- return fs$read.call(fs$35, fd, buffer, offset, length, position, callback);
25548
+ return fs$read.call(fs$36, fd, buffer, offset, length, position, callback);
25548
25549
  }
25549
25550
  callback_.apply(this, arguments);
25550
25551
  };
25551
25552
  }
25552
- return fs$read.call(fs$35, fd, buffer, offset, length, position, callback);
25553
+ return fs$read.call(fs$36, fd, buffer, offset, length, position, callback);
25553
25554
  }
25554
25555
  if (Object.setPrototypeOf) Object.setPrototypeOf(read$4, fs$read);
25555
25556
  return read$4;
25556
- })(fs$35.read);
25557
- fs$35.readSync = typeof fs$35.readSync !== "function" ? fs$35.readSync : (function(fs$readSync) {
25557
+ })(fs$36.read);
25558
+ fs$36.readSync = typeof fs$36.readSync !== "function" ? fs$36.readSync : (function(fs$readSync) {
25558
25559
  return function(fd, buffer, offset, length, position) {
25559
25560
  var eagCounter = 0;
25560
25561
  while (true) try {
25561
- return fs$readSync.call(fs$35, fd, buffer, offset, length, position);
25562
+ return fs$readSync.call(fs$36, fd, buffer, offset, length, position);
25562
25563
  } catch (er) {
25563
25564
  if (er.code === "EAGAIN" && eagCounter < 10) {
25564
25565
  eagCounter++;
@@ -25567,78 +25568,78 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful
25567
25568
  throw er;
25568
25569
  }
25569
25570
  };
25570
- })(fs$35.readSync);
25571
- function patchLchmod(fs$36) {
25572
- fs$36.lchmod = function(path$33, mode, callback) {
25573
- fs$36.open(path$33, constants$4.O_WRONLY | constants$4.O_SYMLINK, mode, function(err$1, fd) {
25571
+ })(fs$36.readSync);
25572
+ function patchLchmod(fs$37) {
25573
+ fs$37.lchmod = function(path$33, mode, callback) {
25574
+ fs$37.open(path$33, constants$4.O_WRONLY | constants$4.O_SYMLINK, mode, function(err$1, fd) {
25574
25575
  if (err$1) {
25575
25576
  if (callback) callback(err$1);
25576
25577
  return;
25577
25578
  }
25578
- fs$36.fchmod(fd, mode, function(err$2) {
25579
- fs$36.close(fd, function(err2) {
25579
+ fs$37.fchmod(fd, mode, function(err$2) {
25580
+ fs$37.close(fd, function(err2) {
25580
25581
  if (callback) callback(err$2 || err2);
25581
25582
  });
25582
25583
  });
25583
25584
  });
25584
25585
  };
25585
- fs$36.lchmodSync = function(path$33, mode) {
25586
- var fd = fs$36.openSync(path$33, constants$4.O_WRONLY | constants$4.O_SYMLINK, mode);
25586
+ fs$37.lchmodSync = function(path$33, mode) {
25587
+ var fd = fs$37.openSync(path$33, constants$4.O_WRONLY | constants$4.O_SYMLINK, mode);
25587
25588
  var threw = true;
25588
25589
  var ret;
25589
25590
  try {
25590
- ret = fs$36.fchmodSync(fd, mode);
25591
+ ret = fs$37.fchmodSync(fd, mode);
25591
25592
  threw = false;
25592
25593
  } finally {
25593
25594
  if (threw) try {
25594
- fs$36.closeSync(fd);
25595
+ fs$37.closeSync(fd);
25595
25596
  } catch (er) {}
25596
- else fs$36.closeSync(fd);
25597
+ else fs$37.closeSync(fd);
25597
25598
  }
25598
25599
  return ret;
25599
25600
  };
25600
25601
  }
25601
- function patchLutimes(fs$36) {
25602
- if (constants$4.hasOwnProperty("O_SYMLINK") && fs$36.futimes) {
25603
- fs$36.lutimes = function(path$33, at, mt, cb) {
25604
- fs$36.open(path$33, constants$4.O_SYMLINK, function(er, fd) {
25602
+ function patchLutimes(fs$37) {
25603
+ if (constants$4.hasOwnProperty("O_SYMLINK") && fs$37.futimes) {
25604
+ fs$37.lutimes = function(path$33, at, mt, cb) {
25605
+ fs$37.open(path$33, constants$4.O_SYMLINK, function(er, fd) {
25605
25606
  if (er) {
25606
25607
  if (cb) cb(er);
25607
25608
  return;
25608
25609
  }
25609
- fs$36.futimes(fd, at, mt, function(er$1) {
25610
- fs$36.close(fd, function(er2) {
25610
+ fs$37.futimes(fd, at, mt, function(er$1) {
25611
+ fs$37.close(fd, function(er2) {
25611
25612
  if (cb) cb(er$1 || er2);
25612
25613
  });
25613
25614
  });
25614
25615
  });
25615
25616
  };
25616
- fs$36.lutimesSync = function(path$33, at, mt) {
25617
- var fd = fs$36.openSync(path$33, constants$4.O_SYMLINK);
25617
+ fs$37.lutimesSync = function(path$33, at, mt) {
25618
+ var fd = fs$37.openSync(path$33, constants$4.O_SYMLINK);
25618
25619
  var ret;
25619
25620
  var threw = true;
25620
25621
  try {
25621
- ret = fs$36.futimesSync(fd, at, mt);
25622
+ ret = fs$37.futimesSync(fd, at, mt);
25622
25623
  threw = false;
25623
25624
  } finally {
25624
25625
  if (threw) try {
25625
- fs$36.closeSync(fd);
25626
+ fs$37.closeSync(fd);
25626
25627
  } catch (er) {}
25627
- else fs$36.closeSync(fd);
25628
+ else fs$37.closeSync(fd);
25628
25629
  }
25629
25630
  return ret;
25630
25631
  };
25631
- } else if (fs$36.futimes) {
25632
- fs$36.lutimes = function(_a, _b, _c, cb) {
25632
+ } else if (fs$37.futimes) {
25633
+ fs$37.lutimes = function(_a, _b, _c, cb) {
25633
25634
  if (cb) process.nextTick(cb);
25634
25635
  };
25635
- fs$36.lutimesSync = function() {};
25636
+ fs$37.lutimesSync = function() {};
25636
25637
  }
25637
25638
  }
25638
25639
  function chmodFix(orig) {
25639
25640
  if (!orig) return orig;
25640
25641
  return function(target, mode, cb) {
25641
- return orig.call(fs$35, target, mode, function(er) {
25642
+ return orig.call(fs$36, target, mode, function(er) {
25642
25643
  if (chownErOk(er)) er = null;
25643
25644
  if (cb) cb.apply(this, arguments);
25644
25645
  });
@@ -25648,7 +25649,7 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful
25648
25649
  if (!orig) return orig;
25649
25650
  return function(target, mode) {
25650
25651
  try {
25651
- return orig.call(fs$35, target, mode);
25652
+ return orig.call(fs$36, target, mode);
25652
25653
  } catch (er) {
25653
25654
  if (!chownErOk(er)) throw er;
25654
25655
  }
@@ -25657,7 +25658,7 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful
25657
25658
  function chownFix(orig) {
25658
25659
  if (!orig) return orig;
25659
25660
  return function(target, uid, gid, cb) {
25660
- return orig.call(fs$35, target, uid, gid, function(er) {
25661
+ return orig.call(fs$36, target, uid, gid, function(er) {
25661
25662
  if (chownErOk(er)) er = null;
25662
25663
  if (cb) cb.apply(this, arguments);
25663
25664
  });
@@ -25667,7 +25668,7 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful
25667
25668
  if (!orig) return orig;
25668
25669
  return function(target, uid, gid) {
25669
25670
  try {
25670
- return orig.call(fs$35, target, uid, gid);
25671
+ return orig.call(fs$36, target, uid, gid);
25671
25672
  } catch (er) {
25672
25673
  if (!chownErOk(er)) throw er;
25673
25674
  }
@@ -25687,13 +25688,13 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful
25687
25688
  }
25688
25689
  if (cb) cb.apply(this, arguments);
25689
25690
  }
25690
- return options ? orig.call(fs$35, target, options, callback) : orig.call(fs$35, target, callback);
25691
+ return options ? orig.call(fs$36, target, options, callback) : orig.call(fs$36, target, callback);
25691
25692
  };
25692
25693
  }
25693
25694
  function statFixSync(orig) {
25694
25695
  if (!orig) return orig;
25695
25696
  return function(target, options) {
25696
- var stats = options ? orig.call(fs$35, target, options) : orig.call(fs$35, target);
25697
+ var stats = options ? orig.call(fs$36, target, options) : orig.call(fs$36, target);
25697
25698
  if (stats) {
25698
25699
  if (stats.uid < 0) stats.uid += 4294967296;
25699
25700
  if (stats.gid < 0) stats.gid += 4294967296;
@@ -25718,7 +25719,7 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful
25718
25719
  var require_legacy_streams = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful-fs/legacy-streams.js": ((exports, module) => {
25719
25720
  var Stream$1 = __require("stream").Stream;
25720
25721
  module.exports = legacy$1;
25721
- function legacy$1(fs$35) {
25722
+ function legacy$1(fs$36) {
25722
25723
  return {
25723
25724
  ReadStream,
25724
25725
  WriteStream
@@ -25754,7 +25755,7 @@ var require_legacy_streams = /* @__PURE__ */ __commonJS$1({ "../node_modules/gra
25754
25755
  });
25755
25756
  return;
25756
25757
  }
25757
- fs$35.open(this.path, this.flags, this.mode, function(err$1, fd) {
25758
+ fs$36.open(this.path, this.flags, this.mode, function(err$1, fd) {
25758
25759
  if (err$1) {
25759
25760
  self.emit("error", err$1);
25760
25761
  self.readable = false;
@@ -25789,7 +25790,7 @@ var require_legacy_streams = /* @__PURE__ */ __commonJS$1({ "../node_modules/gra
25789
25790
  this.busy = false;
25790
25791
  this._queue = [];
25791
25792
  if (this.fd === null) {
25792
- this._open = fs$35.open;
25793
+ this._open = fs$36.open;
25793
25794
  this._queue.push([
25794
25795
  this._open,
25795
25796
  this.path,
@@ -25824,7 +25825,7 @@ var require_clone = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful-fs/
25824
25825
  //#endregion
25825
25826
  //#region ../node_modules/graceful-fs/graceful-fs.js
25826
25827
  var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/graceful-fs/graceful-fs.js": ((exports, module) => {
25827
- var fs$33 = __require("fs");
25828
+ var fs$34 = __require("fs");
25828
25829
  var polyfills = require_polyfills();
25829
25830
  var legacy = require_legacy_streams();
25830
25831
  var clone$1 = require_clone();
@@ -25853,45 +25854,45 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
25853
25854
  m$1 = "GFS4: " + m$1.split(/\n/).join("\nGFS4: ");
25854
25855
  console.error(m$1);
25855
25856
  };
25856
- if (!fs$33[gracefulQueue]) {
25857
+ if (!fs$34[gracefulQueue]) {
25857
25858
  var queue = global[gracefulQueue] || [];
25858
- publishQueue(fs$33, queue);
25859
- fs$33.close = (function(fs$close) {
25859
+ publishQueue(fs$34, queue);
25860
+ fs$34.close = (function(fs$close) {
25860
25861
  function close(fd, cb) {
25861
- return fs$close.call(fs$33, fd, function(err$1) {
25862
+ return fs$close.call(fs$34, fd, function(err$1) {
25862
25863
  if (!err$1) resetQueue();
25863
25864
  if (typeof cb === "function") cb.apply(this, arguments);
25864
25865
  });
25865
25866
  }
25866
25867
  Object.defineProperty(close, previousSymbol, { value: fs$close });
25867
25868
  return close;
25868
- })(fs$33.close);
25869
- fs$33.closeSync = (function(fs$closeSync) {
25869
+ })(fs$34.close);
25870
+ fs$34.closeSync = (function(fs$closeSync) {
25870
25871
  function closeSync(fd) {
25871
- fs$closeSync.apply(fs$33, arguments);
25872
+ fs$closeSync.apply(fs$34, arguments);
25872
25873
  resetQueue();
25873
25874
  }
25874
25875
  Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync });
25875
25876
  return closeSync;
25876
- })(fs$33.closeSync);
25877
+ })(fs$34.closeSync);
25877
25878
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
25878
- debug(fs$33[gracefulQueue]);
25879
- __require("assert").equal(fs$33[gracefulQueue].length, 0);
25880
- });
25881
- }
25882
- if (!global[gracefulQueue]) publishQueue(global, fs$33[gracefulQueue]);
25883
- module.exports = patch(clone$1(fs$33));
25884
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$33.__patched) {
25885
- module.exports = patch(fs$33);
25886
- fs$33.__patched = true;
25887
- }
25888
- function patch(fs$35) {
25889
- polyfills(fs$35);
25890
- fs$35.gracefulify = patch;
25891
- fs$35.createReadStream = createReadStream$1;
25892
- fs$35.createWriteStream = createWriteStream$1;
25893
- var fs$readFile = fs$35.readFile;
25894
- fs$35.readFile = readFile$2;
25879
+ debug(fs$34[gracefulQueue]);
25880
+ __require("assert").equal(fs$34[gracefulQueue].length, 0);
25881
+ });
25882
+ }
25883
+ if (!global[gracefulQueue]) publishQueue(global, fs$34[gracefulQueue]);
25884
+ module.exports = patch(clone$1(fs$34));
25885
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$34.__patched) {
25886
+ module.exports = patch(fs$34);
25887
+ fs$34.__patched = true;
25888
+ }
25889
+ function patch(fs$36) {
25890
+ polyfills(fs$36);
25891
+ fs$36.gracefulify = patch;
25892
+ fs$36.createReadStream = createReadStream$1;
25893
+ fs$36.createWriteStream = createWriteStream$1;
25894
+ var fs$readFile = fs$36.readFile;
25895
+ fs$36.readFile = readFile$2;
25895
25896
  function readFile$2(path$33, options, cb) {
25896
25897
  if (typeof options === "function") cb = options, options = null;
25897
25898
  return go$readFile(path$33, options, cb);
@@ -25912,8 +25913,8 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
25912
25913
  });
25913
25914
  }
25914
25915
  }
25915
- var fs$writeFile = fs$35.writeFile;
25916
- fs$35.writeFile = writeFile$2;
25916
+ var fs$writeFile = fs$36.writeFile;
25917
+ fs$36.writeFile = writeFile$2;
25917
25918
  function writeFile$2(path$33, data, options, cb) {
25918
25919
  if (typeof options === "function") cb = options, options = null;
25919
25920
  return go$writeFile(path$33, data, options, cb);
@@ -25935,8 +25936,8 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
25935
25936
  });
25936
25937
  }
25937
25938
  }
25938
- var fs$appendFile = fs$35.appendFile;
25939
- if (fs$appendFile) fs$35.appendFile = appendFile;
25939
+ var fs$appendFile = fs$36.appendFile;
25940
+ if (fs$appendFile) fs$36.appendFile = appendFile;
25940
25941
  function appendFile(path$33, data, options, cb) {
25941
25942
  if (typeof options === "function") cb = options, options = null;
25942
25943
  return go$appendFile(path$33, data, options, cb);
@@ -25958,8 +25959,8 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
25958
25959
  });
25959
25960
  }
25960
25961
  }
25961
- var fs$copyFile = fs$35.copyFile;
25962
- if (fs$copyFile) fs$35.copyFile = copyFile$2;
25962
+ var fs$copyFile = fs$36.copyFile;
25963
+ if (fs$copyFile) fs$36.copyFile = copyFile$2;
25963
25964
  function copyFile$2(src, dest, flags, cb) {
25964
25965
  if (typeof flags === "function") {
25965
25966
  cb = flags;
@@ -25984,8 +25985,8 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
25984
25985
  });
25985
25986
  }
25986
25987
  }
25987
- var fs$readdir = fs$35.readdir;
25988
- fs$35.readdir = readdir$2;
25988
+ var fs$readdir = fs$36.readdir;
25989
+ fs$36.readdir = readdir$2;
25989
25990
  var noReaddirOptionVersions = /^v[0-5]\./;
25990
25991
  function readdir$2(path$33, options, cb) {
25991
25992
  if (typeof options === "function") cb = options, options = null;
@@ -26016,21 +26017,21 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
26016
26017
  }
26017
26018
  }
26018
26019
  if (process.version.substr(0, 4) === "v0.8") {
26019
- var legStreams = legacy(fs$35);
26020
+ var legStreams = legacy(fs$36);
26020
26021
  ReadStream = legStreams.ReadStream;
26021
26022
  WriteStream = legStreams.WriteStream;
26022
26023
  }
26023
- var fs$ReadStream = fs$35.ReadStream;
26024
+ var fs$ReadStream = fs$36.ReadStream;
26024
26025
  if (fs$ReadStream) {
26025
26026
  ReadStream.prototype = Object.create(fs$ReadStream.prototype);
26026
26027
  ReadStream.prototype.open = ReadStream$open;
26027
26028
  }
26028
- var fs$WriteStream = fs$35.WriteStream;
26029
+ var fs$WriteStream = fs$36.WriteStream;
26029
26030
  if (fs$WriteStream) {
26030
26031
  WriteStream.prototype = Object.create(fs$WriteStream.prototype);
26031
26032
  WriteStream.prototype.open = WriteStream$open;
26032
26033
  }
26033
- Object.defineProperty(fs$35, "ReadStream", {
26034
+ Object.defineProperty(fs$36, "ReadStream", {
26034
26035
  get: function() {
26035
26036
  return ReadStream;
26036
26037
  },
@@ -26040,7 +26041,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
26040
26041
  enumerable: true,
26041
26042
  configurable: true
26042
26043
  });
26043
- Object.defineProperty(fs$35, "WriteStream", {
26044
+ Object.defineProperty(fs$36, "WriteStream", {
26044
26045
  get: function() {
26045
26046
  return WriteStream;
26046
26047
  },
@@ -26051,7 +26052,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
26051
26052
  configurable: true
26052
26053
  });
26053
26054
  var FileReadStream = ReadStream;
26054
- Object.defineProperty(fs$35, "FileReadStream", {
26055
+ Object.defineProperty(fs$36, "FileReadStream", {
26055
26056
  get: function() {
26056
26057
  return FileReadStream;
26057
26058
  },
@@ -26062,7 +26063,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
26062
26063
  configurable: true
26063
26064
  });
26064
26065
  var FileWriteStream = WriteStream;
26065
- Object.defineProperty(fs$35, "FileWriteStream", {
26066
+ Object.defineProperty(fs$36, "FileWriteStream", {
26066
26067
  get: function() {
26067
26068
  return FileWriteStream;
26068
26069
  },
@@ -26106,13 +26107,13 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
26106
26107
  });
26107
26108
  }
26108
26109
  function createReadStream$1(path$33, options) {
26109
- return new fs$35.ReadStream(path$33, options);
26110
+ return new fs$36.ReadStream(path$33, options);
26110
26111
  }
26111
26112
  function createWriteStream$1(path$33, options) {
26112
- return new fs$35.WriteStream(path$33, options);
26113
+ return new fs$36.WriteStream(path$33, options);
26113
26114
  }
26114
- var fs$open = fs$35.open;
26115
- fs$35.open = open$1;
26115
+ var fs$open = fs$36.open;
26116
+ fs$36.open = open$1;
26116
26117
  function open$1(path$33, flags, mode, cb) {
26117
26118
  if (typeof mode === "function") cb = mode, mode = null;
26118
26119
  return go$open(path$33, flags, mode, cb);
@@ -26134,27 +26135,27 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
26134
26135
  });
26135
26136
  }
26136
26137
  }
26137
- return fs$35;
26138
+ return fs$36;
26138
26139
  }
26139
26140
  function enqueue(elem) {
26140
26141
  debug("ENQUEUE", elem[0].name, elem[1]);
26141
- fs$33[gracefulQueue].push(elem);
26142
+ fs$34[gracefulQueue].push(elem);
26142
26143
  retry();
26143
26144
  }
26144
26145
  var retryTimer;
26145
26146
  function resetQueue() {
26146
26147
  var now = Date.now();
26147
- for (var i$1 = 0; i$1 < fs$33[gracefulQueue].length; ++i$1) if (fs$33[gracefulQueue][i$1].length > 2) {
26148
- fs$33[gracefulQueue][i$1][3] = now;
26149
- fs$33[gracefulQueue][i$1][4] = now;
26148
+ for (var i$1 = 0; i$1 < fs$34[gracefulQueue].length; ++i$1) if (fs$34[gracefulQueue][i$1].length > 2) {
26149
+ fs$34[gracefulQueue][i$1][3] = now;
26150
+ fs$34[gracefulQueue][i$1][4] = now;
26150
26151
  }
26151
26152
  retry();
26152
26153
  }
26153
26154
  function retry() {
26154
26155
  clearTimeout(retryTimer);
26155
26156
  retryTimer = void 0;
26156
- if (fs$33[gracefulQueue].length === 0) return;
26157
- var elem = fs$33[gracefulQueue].shift();
26157
+ if (fs$34[gracefulQueue].length === 0) return;
26158
+ var elem = fs$34[gracefulQueue].shift();
26158
26159
  var fn = elem[0];
26159
26160
  var args = elem[1];
26160
26161
  var err$1 = elem[2];
@@ -26174,7 +26175,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
26174
26175
  if (sinceAttempt >= desiredDelay) {
26175
26176
  debug("RETRY", fn.name, args);
26176
26177
  fn.apply(null, args.concat([startTime]));
26177
- } else fs$33[gracefulQueue].push(elem);
26178
+ } else fs$34[gracefulQueue].push(elem);
26178
26179
  }
26179
26180
  if (retryTimer === void 0) retryTimer = setTimeout(retry, 0);
26180
26181
  }
@@ -26184,7 +26185,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../node_modules/gracef
26184
26185
  //#region ../node_modules/fs-extra/lib/fs/index.js
26185
26186
  var require_fs$4 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/fs/index.js": ((exports) => {
26186
26187
  const u$16 = require_universalify().fromCallback;
26187
- const fs$32 = require_graceful_fs();
26188
+ const fs$33 = require_graceful_fs();
26188
26189
  const api = [
26189
26190
  "access",
26190
26191
  "appendFile",
@@ -26225,22 +26226,22 @@ var require_fs$4 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26225
26226
  "utimes",
26226
26227
  "writeFile"
26227
26228
  ].filter((key) => {
26228
- return typeof fs$32[key] === "function";
26229
+ return typeof fs$33[key] === "function";
26229
26230
  });
26230
- Object.assign(exports, fs$32);
26231
+ Object.assign(exports, fs$33);
26231
26232
  api.forEach((method) => {
26232
- exports[method] = u$16(fs$32[method]);
26233
+ exports[method] = u$16(fs$33[method]);
26233
26234
  });
26234
26235
  exports.exists = function(filename, callback) {
26235
- if (typeof callback === "function") return fs$32.exists(filename, callback);
26236
+ if (typeof callback === "function") return fs$33.exists(filename, callback);
26236
26237
  return new Promise((resolve$1) => {
26237
- return fs$32.exists(filename, resolve$1);
26238
+ return fs$33.exists(filename, resolve$1);
26238
26239
  });
26239
26240
  };
26240
26241
  exports.read = function(fd, buffer, offset, length, position, callback) {
26241
- if (typeof callback === "function") return fs$32.read(fd, buffer, offset, length, position, callback);
26242
+ if (typeof callback === "function") return fs$33.read(fd, buffer, offset, length, position, callback);
26242
26243
  return new Promise((resolve$1, reject) => {
26243
- fs$32.read(fd, buffer, offset, length, position, (err$1, bytesRead, buffer$1) => {
26244
+ fs$33.read(fd, buffer, offset, length, position, (err$1, bytesRead, buffer$1) => {
26244
26245
  if (err$1) return reject(err$1);
26245
26246
  resolve$1({
26246
26247
  bytesRead,
@@ -26250,9 +26251,9 @@ var require_fs$4 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26250
26251
  });
26251
26252
  };
26252
26253
  exports.write = function(fd, buffer, ...args) {
26253
- if (typeof args[args.length - 1] === "function") return fs$32.write(fd, buffer, ...args);
26254
+ if (typeof args[args.length - 1] === "function") return fs$33.write(fd, buffer, ...args);
26254
26255
  return new Promise((resolve$1, reject) => {
26255
- fs$32.write(fd, buffer, ...args, (err$1, bytesWritten, buffer$1) => {
26256
+ fs$33.write(fd, buffer, ...args, (err$1, bytesWritten, buffer$1) => {
26256
26257
  if (err$1) return reject(err$1);
26257
26258
  resolve$1({
26258
26259
  bytesWritten,
@@ -26262,9 +26263,9 @@ var require_fs$4 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26262
26263
  });
26263
26264
  };
26264
26265
  exports.readv = function(fd, buffers, ...args) {
26265
- if (typeof args[args.length - 1] === "function") return fs$32.readv(fd, buffers, ...args);
26266
+ if (typeof args[args.length - 1] === "function") return fs$33.readv(fd, buffers, ...args);
26266
26267
  return new Promise((resolve$1, reject) => {
26267
- fs$32.readv(fd, buffers, ...args, (err$1, bytesRead, buffers$1) => {
26268
+ fs$33.readv(fd, buffers, ...args, (err$1, bytesRead, buffers$1) => {
26268
26269
  if (err$1) return reject(err$1);
26269
26270
  resolve$1({
26270
26271
  bytesRead,
@@ -26274,9 +26275,9 @@ var require_fs$4 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26274
26275
  });
26275
26276
  };
26276
26277
  exports.writev = function(fd, buffers, ...args) {
26277
- if (typeof args[args.length - 1] === "function") return fs$32.writev(fd, buffers, ...args);
26278
+ if (typeof args[args.length - 1] === "function") return fs$33.writev(fd, buffers, ...args);
26278
26279
  return new Promise((resolve$1, reject) => {
26279
- fs$32.writev(fd, buffers, ...args, (err$1, bytesWritten, buffers$1) => {
26280
+ fs$33.writev(fd, buffers, ...args, (err$1, bytesWritten, buffers$1) => {
26280
26281
  if (err$1) return reject(err$1);
26281
26282
  resolve$1({
26282
26283
  bytesWritten,
@@ -26285,7 +26286,7 @@ var require_fs$4 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26285
26286
  });
26286
26287
  });
26287
26288
  };
26288
- if (typeof fs$32.realpath.native === "function") exports.realpath.native = u$16(fs$32.realpath.native);
26289
+ if (typeof fs$33.realpath.native === "function") exports.realpath.native = u$16(fs$33.realpath.native);
26289
26290
  else process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?", "Warning", "fs-extra-WARN0003");
26290
26291
  }) });
26291
26292
 
@@ -26308,7 +26309,7 @@ var require_utils$5 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/l
26308
26309
  //#endregion
26309
26310
  //#region ../node_modules/fs-extra/lib/mkdirs/make-dir.js
26310
26311
  var require_make_dir = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/mkdirs/make-dir.js": ((exports, module) => {
26311
- const fs$31 = require_fs$4();
26312
+ const fs$32 = require_fs$4();
26312
26313
  const { checkPath: checkPath$1 } = require_utils$5();
26313
26314
  const getMode = (options) => {
26314
26315
  const defaults$1 = { mode: 511 };
@@ -26320,14 +26321,14 @@ var require_make_dir = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/
26320
26321
  };
26321
26322
  module.exports.makeDir = async (dir, options) => {
26322
26323
  checkPath$1(dir);
26323
- return fs$31.mkdir(dir, {
26324
+ return fs$32.mkdir(dir, {
26324
26325
  mode: getMode(options),
26325
26326
  recursive: true
26326
26327
  });
26327
26328
  };
26328
26329
  module.exports.makeDirSync = (dir, options) => {
26329
26330
  checkPath$1(dir);
26330
- return fs$31.mkdirSync(dir, {
26331
+ return fs$32.mkdirSync(dir, {
26331
26332
  mode: getMode(options),
26332
26333
  recursive: true
26333
26334
  });
@@ -26354,29 +26355,29 @@ var require_mkdirs = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/li
26354
26355
  //#region ../node_modules/fs-extra/lib/path-exists/index.js
26355
26356
  var require_path_exists = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/path-exists/index.js": ((exports, module) => {
26356
26357
  const u$14 = require_universalify().fromPromise;
26357
- const fs$30 = require_fs$4();
26358
+ const fs$31 = require_fs$4();
26358
26359
  function pathExists$6(path$33) {
26359
- return fs$30.access(path$33).then(() => true).catch(() => false);
26360
+ return fs$31.access(path$33).then(() => true).catch(() => false);
26360
26361
  }
26361
26362
  module.exports = {
26362
26363
  pathExists: u$14(pathExists$6),
26363
- pathExistsSync: fs$30.existsSync
26364
+ pathExistsSync: fs$31.existsSync
26364
26365
  };
26365
26366
  }) });
26366
26367
 
26367
26368
  //#endregion
26368
26369
  //#region ../node_modules/fs-extra/lib/util/utimes.js
26369
26370
  var require_utimes = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/util/utimes.js": ((exports, module) => {
26370
- const fs$29 = require_fs$4();
26371
+ const fs$30 = require_fs$4();
26371
26372
  const u$13 = require_universalify().fromPromise;
26372
26373
  async function utimesMillis$1(path$33, atime, mtime) {
26373
- const fd = await fs$29.open(path$33, "r+");
26374
+ const fd = await fs$30.open(path$33, "r+");
26374
26375
  let closeErr = null;
26375
26376
  try {
26376
- await fs$29.futimes(fd, atime, mtime);
26377
+ await fs$30.futimes(fd, atime, mtime);
26377
26378
  } finally {
26378
26379
  try {
26379
- await fs$29.close(fd);
26380
+ await fs$30.close(fd);
26380
26381
  } catch (e) {
26381
26382
  closeErr = e;
26382
26383
  }
@@ -26384,9 +26385,9 @@ var require_utimes = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/li
26384
26385
  if (closeErr) throw closeErr;
26385
26386
  }
26386
26387
  function utimesMillisSync$1(path$33, atime, mtime) {
26387
- const fd = fs$29.openSync(path$33, "r+");
26388
- fs$29.futimesSync(fd, atime, mtime);
26389
- return fs$29.closeSync(fd);
26388
+ const fd = fs$30.openSync(path$33, "r+");
26389
+ fs$30.futimesSync(fd, atime, mtime);
26390
+ return fs$30.closeSync(fd);
26390
26391
  }
26391
26392
  module.exports = {
26392
26393
  utimesMillis: u$13(utimesMillis$1),
@@ -26397,11 +26398,11 @@ var require_utimes = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/li
26397
26398
  //#endregion
26398
26399
  //#region ../node_modules/fs-extra/lib/util/stat.js
26399
26400
  var require_stat = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/util/stat.js": ((exports, module) => {
26400
- const fs$28 = require_fs$4();
26401
+ const fs$29 = require_fs$4();
26401
26402
  const path$30 = __require("path");
26402
26403
  const u$12 = require_universalify().fromPromise;
26403
26404
  function getStats$1(src, dest, opts) {
26404
- const statFunc = opts.dereference ? (file$2) => fs$28.stat(file$2, { bigint: true }) : (file$2) => fs$28.lstat(file$2, { bigint: true });
26405
+ const statFunc = opts.dereference ? (file$2) => fs$29.stat(file$2, { bigint: true }) : (file$2) => fs$29.lstat(file$2, { bigint: true });
26405
26406
  return Promise.all([statFunc(src), statFunc(dest).catch((err$1) => {
26406
26407
  if (err$1.code === "ENOENT") return null;
26407
26408
  throw err$1;
@@ -26412,7 +26413,7 @@ var require_stat = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26412
26413
  }
26413
26414
  function getStatsSync(src, dest, opts) {
26414
26415
  let destStat;
26415
- const statFunc = opts.dereference ? (file$2) => fs$28.statSync(file$2, { bigint: true }) : (file$2) => fs$28.lstatSync(file$2, { bigint: true });
26416
+ const statFunc = opts.dereference ? (file$2) => fs$29.statSync(file$2, { bigint: true }) : (file$2) => fs$29.lstatSync(file$2, { bigint: true });
26416
26417
  const srcStat = statFunc(src);
26417
26418
  try {
26418
26419
  destStat = statFunc(dest);
@@ -26478,7 +26479,7 @@ var require_stat = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26478
26479
  if (destParent === srcParent || destParent === path$30.parse(destParent).root) return;
26479
26480
  let destStat;
26480
26481
  try {
26481
- destStat = await fs$28.stat(destParent, { bigint: true });
26482
+ destStat = await fs$29.stat(destParent, { bigint: true });
26482
26483
  } catch (err$1) {
26483
26484
  if (err$1.code === "ENOENT") return;
26484
26485
  throw err$1;
@@ -26492,7 +26493,7 @@ var require_stat = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26492
26493
  if (destParent === srcParent || destParent === path$30.parse(destParent).root) return;
26493
26494
  let destStat;
26494
26495
  try {
26495
- destStat = fs$28.statSync(destParent, { bigint: true });
26496
+ destStat = fs$29.statSync(destParent, { bigint: true });
26496
26497
  } catch (err$1) {
26497
26498
  if (err$1.code === "ENOENT") return;
26498
26499
  throw err$1;
@@ -26524,7 +26525,7 @@ var require_stat = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26524
26525
  //#endregion
26525
26526
  //#region ../node_modules/fs-extra/lib/copy/copy.js
26526
26527
  var require_copy$1 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/copy/copy.js": ((exports, module) => {
26527
- const fs$27 = require_fs$4();
26528
+ const fs$28 = require_fs$4();
26528
26529
  const path$29 = __require("path");
26529
26530
  const { mkdirs: mkdirs$1 } = require_mkdirs();
26530
26531
  const { pathExists: pathExists$5 } = require_path_exists();
@@ -26549,7 +26550,7 @@ var require_copy$1 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/li
26549
26550
  return opts.filter(src, dest);
26550
26551
  }
26551
26552
  async function getStatsAndPerformCopy(destStat, src, dest, opts) {
26552
- const statFn = opts.dereference ? fs$27.stat : fs$27.lstat;
26553
+ const statFn = opts.dereference ? fs$28.stat : fs$28.lstat;
26553
26554
  const srcStat = await statFn(src);
26554
26555
  if (srcStat.isDirectory()) return onDir$1(srcStat, destStat, src, dest, opts);
26555
26556
  if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile$1(srcStat, destStat, src, dest, opts);
@@ -26561,30 +26562,30 @@ var require_copy$1 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/li
26561
26562
  async function onFile$1(srcStat, destStat, src, dest, opts) {
26562
26563
  if (!destStat) return copyFile$1(srcStat, src, dest, opts);
26563
26564
  if (opts.overwrite) {
26564
- await fs$27.unlink(dest);
26565
+ await fs$28.unlink(dest);
26565
26566
  return copyFile$1(srcStat, src, dest, opts);
26566
26567
  }
26567
26568
  if (opts.errorOnExist) throw new Error(`'${dest}' already exists`);
26568
26569
  }
26569
26570
  async function copyFile$1(srcStat, src, dest, opts) {
26570
- await fs$27.copyFile(src, dest);
26571
+ await fs$28.copyFile(src, dest);
26571
26572
  if (opts.preserveTimestamps) {
26572
26573
  if (fileIsNotWritable$1(srcStat.mode)) await makeFileWritable$1(dest, srcStat.mode);
26573
- const updatedSrcStat = await fs$27.stat(src);
26574
+ const updatedSrcStat = await fs$28.stat(src);
26574
26575
  await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
26575
26576
  }
26576
- return fs$27.chmod(dest, srcStat.mode);
26577
+ return fs$28.chmod(dest, srcStat.mode);
26577
26578
  }
26578
26579
  function fileIsNotWritable$1(srcMode) {
26579
26580
  return (srcMode & 128) === 0;
26580
26581
  }
26581
26582
  function makeFileWritable$1(dest, srcMode) {
26582
- return fs$27.chmod(dest, srcMode | 128);
26583
+ return fs$28.chmod(dest, srcMode | 128);
26583
26584
  }
26584
26585
  async function onDir$1(srcStat, destStat, src, dest, opts) {
26585
- if (!destStat) await fs$27.mkdir(dest);
26586
+ if (!destStat) await fs$28.mkdir(dest);
26586
26587
  const promises = [];
26587
- for await (const item of await fs$27.opendir(src)) {
26588
+ for await (const item of await fs$28.opendir(src)) {
26588
26589
  const srcItem = path$29.join(src, item.name);
26589
26590
  const destItem = path$29.join(dest, item.name);
26590
26591
  promises.push(runFilter(srcItem, destItem, opts).then((include) => {
@@ -26594,24 +26595,24 @@ var require_copy$1 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/li
26594
26595
  }));
26595
26596
  }
26596
26597
  await Promise.all(promises);
26597
- if (!destStat) await fs$27.chmod(dest, srcStat.mode);
26598
+ if (!destStat) await fs$28.chmod(dest, srcStat.mode);
26598
26599
  }
26599
26600
  async function onLink$1(destStat, src, dest, opts) {
26600
- let resolvedSrc = await fs$27.readlink(src);
26601
+ let resolvedSrc = await fs$28.readlink(src);
26601
26602
  if (opts.dereference) resolvedSrc = path$29.resolve(process.cwd(), resolvedSrc);
26602
- if (!destStat) return fs$27.symlink(resolvedSrc, dest);
26603
+ if (!destStat) return fs$28.symlink(resolvedSrc, dest);
26603
26604
  let resolvedDest = null;
26604
26605
  try {
26605
- resolvedDest = await fs$27.readlink(dest);
26606
+ resolvedDest = await fs$28.readlink(dest);
26606
26607
  } catch (e) {
26607
- if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs$27.symlink(resolvedSrc, dest);
26608
+ if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs$28.symlink(resolvedSrc, dest);
26608
26609
  throw e;
26609
26610
  }
26610
26611
  if (opts.dereference) resolvedDest = path$29.resolve(process.cwd(), resolvedDest);
26611
26612
  if (stat$4.isSrcSubdir(resolvedSrc, resolvedDest)) throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
26612
26613
  if (stat$4.isSrcSubdir(resolvedDest, resolvedSrc)) throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
26613
- await fs$27.unlink(dest);
26614
- return fs$27.symlink(resolvedSrc, dest);
26614
+ await fs$28.unlink(dest);
26615
+ return fs$28.symlink(resolvedSrc, dest);
26615
26616
  }
26616
26617
  module.exports = copy$1;
26617
26618
  }) });
@@ -26619,7 +26620,7 @@ var require_copy$1 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/li
26619
26620
  //#endregion
26620
26621
  //#region ../node_modules/fs-extra/lib/copy/copy-sync.js
26621
26622
  var require_copy_sync = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/copy/copy-sync.js": ((exports, module) => {
26622
- const fs$26 = require_graceful_fs();
26623
+ const fs$27 = require_graceful_fs();
26623
26624
  const path$28 = __require("path");
26624
26625
  const mkdirsSync$1 = require_mkdirs().mkdirsSync;
26625
26626
  const utimesMillisSync = require_utimes().utimesMillisSync;
@@ -26634,11 +26635,11 @@ var require_copy_sync = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra
26634
26635
  stat$3.checkParentPathsSync(src, srcStat, dest, "copy");
26635
26636
  if (opts.filter && !opts.filter(src, dest)) return;
26636
26637
  const destParent = path$28.dirname(dest);
26637
- if (!fs$26.existsSync(destParent)) mkdirsSync$1(destParent);
26638
+ if (!fs$27.existsSync(destParent)) mkdirsSync$1(destParent);
26638
26639
  return getStats(destStat, src, dest, opts);
26639
26640
  }
26640
26641
  function getStats(destStat, src, dest, opts) {
26641
- const statSync$2 = opts.dereference ? fs$26.statSync : fs$26.lstatSync;
26642
+ const statSync$2 = opts.dereference ? fs$27.statSync : fs$27.lstatSync;
26642
26643
  const srcStat = statSync$2(src);
26643
26644
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
26644
26645
  else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -26653,12 +26654,12 @@ var require_copy_sync = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra
26653
26654
  }
26654
26655
  function mayCopyFile(srcStat, src, dest, opts) {
26655
26656
  if (opts.overwrite) {
26656
- fs$26.unlinkSync(dest);
26657
+ fs$27.unlinkSync(dest);
26657
26658
  return copyFile(srcStat, src, dest, opts);
26658
26659
  } else if (opts.errorOnExist) throw new Error(`'${dest}' already exists`);
26659
26660
  }
26660
26661
  function copyFile(srcStat, src, dest, opts) {
26661
- fs$26.copyFileSync(src, dest);
26662
+ fs$27.copyFileSync(src, dest);
26662
26663
  if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
26663
26664
  return setDestMode(dest, srcStat.mode);
26664
26665
  }
@@ -26673,10 +26674,10 @@ var require_copy_sync = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra
26673
26674
  return setDestMode(dest, srcMode | 128);
26674
26675
  }
26675
26676
  function setDestMode(dest, srcMode) {
26676
- return fs$26.chmodSync(dest, srcMode);
26677
+ return fs$27.chmodSync(dest, srcMode);
26677
26678
  }
26678
26679
  function setDestTimestamps(src, dest) {
26679
- const updatedSrcStat = fs$26.statSync(src);
26680
+ const updatedSrcStat = fs$27.statSync(src);
26680
26681
  return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
26681
26682
  }
26682
26683
  function onDir(srcStat, destStat, src, dest, opts) {
@@ -26684,12 +26685,12 @@ var require_copy_sync = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra
26684
26685
  return copyDir(src, dest, opts);
26685
26686
  }
26686
26687
  function mkDirAndCopy(srcMode, src, dest, opts) {
26687
- fs$26.mkdirSync(dest);
26688
+ fs$27.mkdirSync(dest);
26688
26689
  copyDir(src, dest, opts);
26689
26690
  return setDestMode(dest, srcMode);
26690
26691
  }
26691
26692
  function copyDir(src, dest, opts) {
26692
- const dir = fs$26.opendirSync(src);
26693
+ const dir = fs$27.opendirSync(src);
26693
26694
  try {
26694
26695
  let dirent;
26695
26696
  while ((dirent = dir.readSync()) !== null) copyDirItem(dirent.name, src, dest, opts);
@@ -26705,15 +26706,15 @@ var require_copy_sync = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra
26705
26706
  return getStats(destStat, srcItem, destItem, opts);
26706
26707
  }
26707
26708
  function onLink(destStat, src, dest, opts) {
26708
- let resolvedSrc = fs$26.readlinkSync(src);
26709
+ let resolvedSrc = fs$27.readlinkSync(src);
26709
26710
  if (opts.dereference) resolvedSrc = path$28.resolve(process.cwd(), resolvedSrc);
26710
- if (!destStat) return fs$26.symlinkSync(resolvedSrc, dest);
26711
+ if (!destStat) return fs$27.symlinkSync(resolvedSrc, dest);
26711
26712
  else {
26712
26713
  let resolvedDest;
26713
26714
  try {
26714
- resolvedDest = fs$26.readlinkSync(dest);
26715
+ resolvedDest = fs$27.readlinkSync(dest);
26715
26716
  } catch (err$1) {
26716
- if (err$1.code === "EINVAL" || err$1.code === "UNKNOWN") return fs$26.symlinkSync(resolvedSrc, dest);
26717
+ if (err$1.code === "EINVAL" || err$1.code === "UNKNOWN") return fs$27.symlinkSync(resolvedSrc, dest);
26717
26718
  throw err$1;
26718
26719
  }
26719
26720
  if (opts.dereference) resolvedDest = path$28.resolve(process.cwd(), resolvedDest);
@@ -26723,8 +26724,8 @@ var require_copy_sync = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra
26723
26724
  }
26724
26725
  }
26725
26726
  function copyLink(resolvedSrc, dest) {
26726
- fs$26.unlinkSync(dest);
26727
- return fs$26.symlinkSync(resolvedSrc, dest);
26727
+ fs$27.unlinkSync(dest);
26728
+ return fs$27.symlinkSync(resolvedSrc, dest);
26728
26729
  }
26729
26730
  module.exports = copySync$1;
26730
26731
  }) });
@@ -26742,16 +26743,16 @@ var require_copy = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26742
26743
  //#endregion
26743
26744
  //#region ../node_modules/fs-extra/lib/remove/index.js
26744
26745
  var require_remove = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/remove/index.js": ((exports, module) => {
26745
- const fs$25 = require_graceful_fs();
26746
+ const fs$26 = require_graceful_fs();
26746
26747
  const u$10 = require_universalify().fromCallback;
26747
26748
  function remove$2(path$33, callback) {
26748
- fs$25.rm(path$33, {
26749
+ fs$26.rm(path$33, {
26749
26750
  recursive: true,
26750
26751
  force: true
26751
26752
  }, callback);
26752
26753
  }
26753
26754
  function removeSync$1(path$33) {
26754
- fs$25.rmSync(path$33, {
26755
+ fs$26.rmSync(path$33, {
26755
26756
  recursive: true,
26756
26757
  force: true
26757
26758
  });
@@ -26766,14 +26767,14 @@ var require_remove = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/li
26766
26767
  //#region ../node_modules/fs-extra/lib/empty/index.js
26767
26768
  var require_empty = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/empty/index.js": ((exports, module) => {
26768
26769
  const u$9 = require_universalify().fromPromise;
26769
- const fs$24 = require_fs$4();
26770
+ const fs$25 = require_fs$4();
26770
26771
  const path$27 = __require("path");
26771
26772
  const mkdir$4 = require_mkdirs();
26772
26773
  const remove$1 = require_remove();
26773
26774
  const emptyDir = u$9(async function emptyDir$1(dir) {
26774
26775
  let items;
26775
26776
  try {
26776
- items = await fs$24.readdir(dir);
26777
+ items = await fs$25.readdir(dir);
26777
26778
  } catch {
26778
26779
  return mkdir$4.mkdirs(dir);
26779
26780
  }
@@ -26782,7 +26783,7 @@ var require_empty = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib
26782
26783
  function emptyDirSync(dir) {
26783
26784
  let items;
26784
26785
  try {
26785
- items = fs$24.readdirSync(dir);
26786
+ items = fs$25.readdirSync(dir);
26786
26787
  } catch {
26787
26788
  return mkdir$4.mkdirsSync(dir);
26788
26789
  }
@@ -26804,42 +26805,42 @@ var require_empty = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib
26804
26805
  var require_file = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/ensure/file.js": ((exports, module) => {
26805
26806
  const u$8 = require_universalify().fromPromise;
26806
26807
  const path$26 = __require("path");
26807
- const fs$23 = require_fs$4();
26808
+ const fs$24 = require_fs$4();
26808
26809
  const mkdir$3 = require_mkdirs();
26809
26810
  async function createFile$1(file$2) {
26810
26811
  let stats;
26811
26812
  try {
26812
- stats = await fs$23.stat(file$2);
26813
+ stats = await fs$24.stat(file$2);
26813
26814
  } catch {}
26814
26815
  if (stats && stats.isFile()) return;
26815
26816
  const dir = path$26.dirname(file$2);
26816
26817
  let dirStats = null;
26817
26818
  try {
26818
- dirStats = await fs$23.stat(dir);
26819
+ dirStats = await fs$24.stat(dir);
26819
26820
  } catch (err$1) {
26820
26821
  if (err$1.code === "ENOENT") {
26821
26822
  await mkdir$3.mkdirs(dir);
26822
- await fs$23.writeFile(file$2, "");
26823
+ await fs$24.writeFile(file$2, "");
26823
26824
  return;
26824
26825
  } else throw err$1;
26825
26826
  }
26826
- if (dirStats.isDirectory()) await fs$23.writeFile(file$2, "");
26827
- else await fs$23.readdir(dir);
26827
+ if (dirStats.isDirectory()) await fs$24.writeFile(file$2, "");
26828
+ else await fs$24.readdir(dir);
26828
26829
  }
26829
26830
  function createFileSync$1(file$2) {
26830
26831
  let stats;
26831
26832
  try {
26832
- stats = fs$23.statSync(file$2);
26833
+ stats = fs$24.statSync(file$2);
26833
26834
  } catch {}
26834
26835
  if (stats && stats.isFile()) return;
26835
26836
  const dir = path$26.dirname(file$2);
26836
26837
  try {
26837
- if (!fs$23.statSync(dir).isDirectory()) fs$23.readdirSync(dir);
26838
+ if (!fs$24.statSync(dir).isDirectory()) fs$24.readdirSync(dir);
26838
26839
  } catch (err$1) {
26839
26840
  if (err$1 && err$1.code === "ENOENT") mkdir$3.mkdirsSync(dir);
26840
26841
  else throw err$1;
26841
26842
  }
26842
- fs$23.writeFileSync(file$2, "");
26843
+ fs$24.writeFileSync(file$2, "");
26843
26844
  }
26844
26845
  module.exports = {
26845
26846
  createFile: u$8(createFile$1),
@@ -26852,18 +26853,18 @@ var require_file = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26852
26853
  var require_link = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/ensure/link.js": ((exports, module) => {
26853
26854
  const u$7 = require_universalify().fromPromise;
26854
26855
  const path$25 = __require("path");
26855
- const fs$22 = require_fs$4();
26856
+ const fs$23 = require_fs$4();
26856
26857
  const mkdir$2 = require_mkdirs();
26857
26858
  const { pathExists: pathExists$4 } = require_path_exists();
26858
26859
  const { areIdentical: areIdentical$1 } = require_stat();
26859
26860
  async function createLink$1(srcpath, dstpath) {
26860
26861
  let dstStat;
26861
26862
  try {
26862
- dstStat = await fs$22.lstat(dstpath);
26863
+ dstStat = await fs$23.lstat(dstpath);
26863
26864
  } catch {}
26864
26865
  let srcStat;
26865
26866
  try {
26866
- srcStat = await fs$22.lstat(srcpath);
26867
+ srcStat = await fs$23.lstat(srcpath);
26867
26868
  } catch (err$1) {
26868
26869
  err$1.message = err$1.message.replace("lstat", "ensureLink");
26869
26870
  throw err$1;
@@ -26872,25 +26873,25 @@ var require_link = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26872
26873
  const dir = path$25.dirname(dstpath);
26873
26874
  const dirExists = await pathExists$4(dir);
26874
26875
  if (!dirExists) await mkdir$2.mkdirs(dir);
26875
- await fs$22.link(srcpath, dstpath);
26876
+ await fs$23.link(srcpath, dstpath);
26876
26877
  }
26877
26878
  function createLinkSync$1(srcpath, dstpath) {
26878
26879
  let dstStat;
26879
26880
  try {
26880
- dstStat = fs$22.lstatSync(dstpath);
26881
+ dstStat = fs$23.lstatSync(dstpath);
26881
26882
  } catch {}
26882
26883
  try {
26883
- const srcStat = fs$22.lstatSync(srcpath);
26884
+ const srcStat = fs$23.lstatSync(srcpath);
26884
26885
  if (dstStat && areIdentical$1(srcStat, dstStat)) return;
26885
26886
  } catch (err$1) {
26886
26887
  err$1.message = err$1.message.replace("lstat", "ensureLink");
26887
26888
  throw err$1;
26888
26889
  }
26889
26890
  const dir = path$25.dirname(dstpath);
26890
- const dirExists = fs$22.existsSync(dir);
26891
- if (dirExists) return fs$22.linkSync(srcpath, dstpath);
26891
+ const dirExists = fs$23.existsSync(dir);
26892
+ if (dirExists) return fs$23.linkSync(srcpath, dstpath);
26892
26893
  mkdir$2.mkdirsSync(dir);
26893
- return fs$22.linkSync(srcpath, dstpath);
26894
+ return fs$23.linkSync(srcpath, dstpath);
26894
26895
  }
26895
26896
  module.exports = {
26896
26897
  createLink: u$7(createLink$1),
@@ -26902,7 +26903,7 @@ var require_link = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
26902
26903
  //#region ../node_modules/fs-extra/lib/ensure/symlink-paths.js
26903
26904
  var require_symlink_paths = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/ensure/symlink-paths.js": ((exports, module) => {
26904
26905
  const path$24 = __require("path");
26905
- const fs$21 = require_fs$4();
26906
+ const fs$22 = require_fs$4();
26906
26907
  const { pathExists: pathExists$3 } = require_path_exists();
26907
26908
  const u$6 = require_universalify().fromPromise;
26908
26909
  /**
@@ -26929,7 +26930,7 @@ var require_symlink_paths = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-e
26929
26930
  async function symlinkPaths$1(srcpath, dstpath) {
26930
26931
  if (path$24.isAbsolute(srcpath)) {
26931
26932
  try {
26932
- await fs$21.lstat(srcpath);
26933
+ await fs$22.lstat(srcpath);
26933
26934
  } catch (err$1) {
26934
26935
  err$1.message = err$1.message.replace("lstat", "ensureSymlink");
26935
26936
  throw err$1;
@@ -26947,7 +26948,7 @@ var require_symlink_paths = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-e
26947
26948
  toDst: srcpath
26948
26949
  };
26949
26950
  try {
26950
- await fs$21.lstat(srcpath);
26951
+ await fs$22.lstat(srcpath);
26951
26952
  } catch (err$1) {
26952
26953
  err$1.message = err$1.message.replace("lstat", "ensureSymlink");
26953
26954
  throw err$1;
@@ -26959,7 +26960,7 @@ var require_symlink_paths = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-e
26959
26960
  }
26960
26961
  function symlinkPathsSync$1(srcpath, dstpath) {
26961
26962
  if (path$24.isAbsolute(srcpath)) {
26962
- const exists$2 = fs$21.existsSync(srcpath);
26963
+ const exists$2 = fs$22.existsSync(srcpath);
26963
26964
  if (!exists$2) throw new Error("absolute srcpath does not exist");
26964
26965
  return {
26965
26966
  toCwd: srcpath,
@@ -26968,12 +26969,12 @@ var require_symlink_paths = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-e
26968
26969
  }
26969
26970
  const dstdir = path$24.dirname(dstpath);
26970
26971
  const relativeToDst = path$24.join(dstdir, srcpath);
26971
- const exists$1 = fs$21.existsSync(relativeToDst);
26972
+ const exists$1 = fs$22.existsSync(relativeToDst);
26972
26973
  if (exists$1) return {
26973
26974
  toCwd: relativeToDst,
26974
26975
  toDst: srcpath
26975
26976
  };
26976
- const srcExists = fs$21.existsSync(srcpath);
26977
+ const srcExists = fs$22.existsSync(srcpath);
26977
26978
  if (!srcExists) throw new Error("relative srcpath does not exist");
26978
26979
  return {
26979
26980
  toCwd: srcpath,
@@ -26989,13 +26990,13 @@ var require_symlink_paths = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-e
26989
26990
  //#endregion
26990
26991
  //#region ../node_modules/fs-extra/lib/ensure/symlink-type.js
26991
26992
  var require_symlink_type = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/ensure/symlink-type.js": ((exports, module) => {
26992
- const fs$20 = require_fs$4();
26993
+ const fs$21 = require_fs$4();
26993
26994
  const u$5 = require_universalify().fromPromise;
26994
26995
  async function symlinkType$1(srcpath, type$1) {
26995
26996
  if (type$1) return type$1;
26996
26997
  let stats;
26997
26998
  try {
26998
- stats = await fs$20.lstat(srcpath);
26999
+ stats = await fs$21.lstat(srcpath);
26999
27000
  } catch {
27000
27001
  return "file";
27001
27002
  }
@@ -27005,7 +27006,7 @@ var require_symlink_type = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-ex
27005
27006
  if (type$1) return type$1;
27006
27007
  let stats;
27007
27008
  try {
27008
- stats = fs$20.lstatSync(srcpath);
27009
+ stats = fs$21.lstatSync(srcpath);
27009
27010
  } catch {
27010
27011
  return "file";
27011
27012
  }
@@ -27022,7 +27023,7 @@ var require_symlink_type = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-ex
27022
27023
  var require_symlink = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/ensure/symlink.js": ((exports, module) => {
27023
27024
  const u$4 = require_universalify().fromPromise;
27024
27025
  const path$23 = __require("path");
27025
- const fs$19 = require_fs$4();
27026
+ const fs$20 = require_fs$4();
27026
27027
  const { mkdirs, mkdirsSync } = require_mkdirs();
27027
27028
  const { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
27028
27029
  const { symlinkType, symlinkTypeSync } = require_symlink_type();
@@ -27031,10 +27032,10 @@ var require_symlink = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/l
27031
27032
  async function createSymlink$1(srcpath, dstpath, type$1) {
27032
27033
  let stats;
27033
27034
  try {
27034
- stats = await fs$19.lstat(dstpath);
27035
+ stats = await fs$20.lstat(dstpath);
27035
27036
  } catch {}
27036
27037
  if (stats && stats.isSymbolicLink()) {
27037
- const [srcStat, dstStat] = await Promise.all([fs$19.stat(srcpath), fs$19.stat(dstpath)]);
27038
+ const [srcStat, dstStat] = await Promise.all([fs$20.stat(srcpath), fs$20.stat(dstpath)]);
27038
27039
  if (areIdentical(srcStat, dstStat)) return;
27039
27040
  }
27040
27041
  const relative$2 = await symlinkPaths(srcpath, dstpath);
@@ -27042,26 +27043,26 @@ var require_symlink = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/l
27042
27043
  const toType = await symlinkType(relative$2.toCwd, type$1);
27043
27044
  const dir = path$23.dirname(dstpath);
27044
27045
  if (!await pathExists$2(dir)) await mkdirs(dir);
27045
- return fs$19.symlink(srcpath, dstpath, toType);
27046
+ return fs$20.symlink(srcpath, dstpath, toType);
27046
27047
  }
27047
27048
  function createSymlinkSync$1(srcpath, dstpath, type$1) {
27048
27049
  let stats;
27049
27050
  try {
27050
- stats = fs$19.lstatSync(dstpath);
27051
+ stats = fs$20.lstatSync(dstpath);
27051
27052
  } catch {}
27052
27053
  if (stats && stats.isSymbolicLink()) {
27053
- const srcStat = fs$19.statSync(srcpath);
27054
- const dstStat = fs$19.statSync(dstpath);
27054
+ const srcStat = fs$20.statSync(srcpath);
27055
+ const dstStat = fs$20.statSync(dstpath);
27055
27056
  if (areIdentical(srcStat, dstStat)) return;
27056
27057
  }
27057
27058
  const relative$2 = symlinkPathsSync(srcpath, dstpath);
27058
27059
  srcpath = relative$2.toDst;
27059
27060
  type$1 = symlinkTypeSync(relative$2.toCwd, type$1);
27060
27061
  const dir = path$23.dirname(dstpath);
27061
- const exists$1 = fs$19.existsSync(dir);
27062
- if (exists$1) return fs$19.symlinkSync(srcpath, dstpath, type$1);
27062
+ const exists$1 = fs$20.existsSync(dir);
27063
+ if (exists$1) return fs$20.symlinkSync(srcpath, dstpath, type$1);
27063
27064
  mkdirsSync(dir);
27064
- return fs$19.symlinkSync(srcpath, dstpath, type$1);
27065
+ return fs$20.symlinkSync(srcpath, dstpath, type$1);
27065
27066
  }
27066
27067
  module.exports = {
27067
27068
  createSymlink: u$4(createSymlink$1),
@@ -27122,9 +27123,9 @@ var require_jsonfile$1 = /* @__PURE__ */ __commonJS$1({ "../node_modules/jsonfil
27122
27123
  const { stringify: stringify$6, stripBom } = require_utils$4();
27123
27124
  async function _readFile(file$2, options = {}) {
27124
27125
  if (typeof options === "string") options = { encoding: options };
27125
- const fs$35 = options.fs || _fs;
27126
+ const fs$36 = options.fs || _fs;
27126
27127
  const shouldThrow = "throws" in options ? options.throws : true;
27127
- let data = await universalify.fromCallback(fs$35.readFile)(file$2, options);
27128
+ let data = await universalify.fromCallback(fs$36.readFile)(file$2, options);
27128
27129
  data = stripBom(data);
27129
27130
  let obj;
27130
27131
  try {
@@ -27140,10 +27141,10 @@ var require_jsonfile$1 = /* @__PURE__ */ __commonJS$1({ "../node_modules/jsonfil
27140
27141
  const readFile$1 = universalify.fromPromise(_readFile);
27141
27142
  function readFileSync$1(file$2, options = {}) {
27142
27143
  if (typeof options === "string") options = { encoding: options };
27143
- const fs$35 = options.fs || _fs;
27144
+ const fs$36 = options.fs || _fs;
27144
27145
  const shouldThrow = "throws" in options ? options.throws : true;
27145
27146
  try {
27146
- let content = fs$35.readFileSync(file$2, options);
27147
+ let content = fs$36.readFileSync(file$2, options);
27147
27148
  content = stripBom(content);
27148
27149
  return JSON.parse(content, options.reviver);
27149
27150
  } catch (err$1) {
@@ -27154,15 +27155,15 @@ var require_jsonfile$1 = /* @__PURE__ */ __commonJS$1({ "../node_modules/jsonfil
27154
27155
  }
27155
27156
  }
27156
27157
  async function _writeFile(file$2, obj, options = {}) {
27157
- const fs$35 = options.fs || _fs;
27158
+ const fs$36 = options.fs || _fs;
27158
27159
  const str = stringify$6(obj, options);
27159
- await universalify.fromCallback(fs$35.writeFile)(file$2, str, options);
27160
+ await universalify.fromCallback(fs$36.writeFile)(file$2, str, options);
27160
27161
  }
27161
27162
  const writeFile$1 = universalify.fromPromise(_writeFile);
27162
27163
  function writeFileSync$1(file$2, obj, options = {}) {
27163
- const fs$35 = options.fs || _fs;
27164
+ const fs$36 = options.fs || _fs;
27164
27165
  const str = stringify$6(obj, options);
27165
- return fs$35.writeFileSync(file$2, str, options);
27166
+ return fs$36.writeFileSync(file$2, str, options);
27166
27167
  }
27167
27168
  const jsonfile = {
27168
27169
  readFile: readFile$1,
@@ -27189,19 +27190,19 @@ var require_jsonfile = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/
27189
27190
  //#region ../node_modules/fs-extra/lib/output-file/index.js
27190
27191
  var require_output_file = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/output-file/index.js": ((exports, module) => {
27191
27192
  const u$3 = require_universalify().fromPromise;
27192
- const fs$18 = require_fs$4();
27193
+ const fs$19 = require_fs$4();
27193
27194
  const path$22 = __require("path");
27194
27195
  const mkdir$1 = require_mkdirs();
27195
27196
  const pathExists$1 = require_path_exists().pathExists;
27196
27197
  async function outputFile$1(file$2, data, encoding = "utf-8") {
27197
27198
  const dir = path$22.dirname(file$2);
27198
27199
  if (!await pathExists$1(dir)) await mkdir$1.mkdirs(dir);
27199
- return fs$18.writeFile(file$2, data, encoding);
27200
+ return fs$19.writeFile(file$2, data, encoding);
27200
27201
  }
27201
27202
  function outputFileSync$1(file$2, ...args) {
27202
27203
  const dir = path$22.dirname(file$2);
27203
- if (!fs$18.existsSync(dir)) mkdir$1.mkdirsSync(dir);
27204
- fs$18.writeFileSync(file$2, ...args);
27204
+ if (!fs$19.existsSync(dir)) mkdir$1.mkdirsSync(dir);
27205
+ fs$19.writeFileSync(file$2, ...args);
27205
27206
  }
27206
27207
  module.exports = {
27207
27208
  outputFile: u$3(outputFile$1),
@@ -27252,7 +27253,7 @@ var require_json = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/
27252
27253
  //#endregion
27253
27254
  //#region ../node_modules/fs-extra/lib/move/move.js
27254
27255
  var require_move$1 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/move/move.js": ((exports, module) => {
27255
- const fs$17 = require_fs$4();
27256
+ const fs$18 = require_fs$4();
27256
27257
  const path$21 = __require("path");
27257
27258
  const { copy } = require_copy();
27258
27259
  const { remove } = require_remove();
@@ -27274,7 +27275,7 @@ var require_move$1 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/li
27274
27275
  else if (await pathExists(dest)) throw new Error("dest already exists.");
27275
27276
  }
27276
27277
  try {
27277
- await fs$17.rename(src, dest);
27278
+ await fs$18.rename(src, dest);
27278
27279
  } catch (err$1) {
27279
27280
  if (err$1.code !== "EXDEV") throw err$1;
27280
27281
  await moveAcrossDevice$1(src, dest, overwrite);
@@ -27295,7 +27296,7 @@ var require_move$1 = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/li
27295
27296
  //#endregion
27296
27297
  //#region ../node_modules/fs-extra/lib/move/move-sync.js
27297
27298
  var require_move_sync = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra/lib/move/move-sync.js": ((exports, module) => {
27298
- const fs$16 = require_graceful_fs();
27299
+ const fs$17 = require_graceful_fs();
27299
27300
  const path$20 = __require("path");
27300
27301
  const copySync = require_copy().copySync;
27301
27302
  const removeSync = require_remove().removeSync;
@@ -27320,12 +27321,12 @@ var require_move_sync = /* @__PURE__ */ __commonJS$1({ "../node_modules/fs-extra
27320
27321
  removeSync(dest);
27321
27322
  return rename(src, dest, overwrite);
27322
27323
  }
27323
- if (fs$16.existsSync(dest)) throw new Error("dest already exists.");
27324
+ if (fs$17.existsSync(dest)) throw new Error("dest already exists.");
27324
27325
  return rename(src, dest, overwrite);
27325
27326
  }
27326
27327
  function rename(src, dest, overwrite) {
27327
27328
  try {
27328
- fs$16.renameSync(src, dest);
27329
+ fs$17.renameSync(src, dest);
27329
27330
  } catch (err$1) {
27330
27331
  if (err$1.code !== "EXDEV") throw err$1;
27331
27332
  return moveAcrossDevice(src, dest, overwrite);
@@ -38758,7 +38759,7 @@ const handleCommand = (filePath, rawArguments, rawOptions) => {
38758
38759
  var require_windows = /* @__PURE__ */ __commonJS$1({ "../node_modules/cross-spawn/node_modules/which/node_modules/isexe/windows.js": ((exports, module) => {
38759
38760
  module.exports = isexe$3;
38760
38761
  isexe$3.sync = sync$4;
38761
- var fs$15 = __require("fs");
38762
+ var fs$16 = __require("fs");
38762
38763
  function checkPathExt(path$33, options) {
38763
38764
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
38764
38765
  if (!pathext) return true;
@@ -38775,12 +38776,12 @@ var require_windows = /* @__PURE__ */ __commonJS$1({ "../node_modules/cross-spaw
38775
38776
  return checkPathExt(path$33, options);
38776
38777
  }
38777
38778
  function isexe$3(path$33, options, cb) {
38778
- fs$15.stat(path$33, function(er, stat$5) {
38779
+ fs$16.stat(path$33, function(er, stat$5) {
38779
38780
  cb(er, er ? false : checkStat$1(stat$5, path$33, options));
38780
38781
  });
38781
38782
  }
38782
38783
  function sync$4(path$33, options) {
38783
- return checkStat$1(fs$15.statSync(path$33), path$33, options);
38784
+ return checkStat$1(fs$16.statSync(path$33), path$33, options);
38784
38785
  }
38785
38786
  }) });
38786
38787
 
@@ -38789,14 +38790,14 @@ var require_windows = /* @__PURE__ */ __commonJS$1({ "../node_modules/cross-spaw
38789
38790
  var require_mode = /* @__PURE__ */ __commonJS$1({ "../node_modules/cross-spawn/node_modules/which/node_modules/isexe/mode.js": ((exports, module) => {
38790
38791
  module.exports = isexe$2;
38791
38792
  isexe$2.sync = sync$3;
38792
- var fs$14 = __require("fs");
38793
+ var fs$15 = __require("fs");
38793
38794
  function isexe$2(path$33, options, cb) {
38794
- fs$14.stat(path$33, function(er, stat$5) {
38795
+ fs$15.stat(path$33, function(er, stat$5) {
38795
38796
  cb(er, er ? false : checkStat(stat$5, options));
38796
38797
  });
38797
38798
  }
38798
38799
  function sync$3(path$33, options) {
38799
- return checkStat(fs$14.statSync(path$33), options);
38800
+ return checkStat(fs$15.statSync(path$33), options);
38800
38801
  }
38801
38802
  function checkStat(stat$5, options) {
38802
38803
  return stat$5.isFile() && checkMode(stat$5, options);
@@ -39023,16 +39024,16 @@ var require_shebang_command = /* @__PURE__ */ __commonJS$1({ "../node_modules/sh
39023
39024
  //#endregion
39024
39025
  //#region ../node_modules/cross-spawn/lib/util/readShebang.js
39025
39026
  var require_readShebang = /* @__PURE__ */ __commonJS$1({ "../node_modules/cross-spawn/lib/util/readShebang.js": ((exports, module) => {
39026
- const fs$13 = __require("fs");
39027
+ const fs$14 = __require("fs");
39027
39028
  const shebangCommand = require_shebang_command();
39028
39029
  function readShebang$1(command) {
39029
39030
  const size = 150;
39030
39031
  const buffer = Buffer.alloc(size);
39031
39032
  let fd;
39032
39033
  try {
39033
- fd = fs$13.openSync(command, "r");
39034
- fs$13.readSync(fd, buffer, 0, size, 0);
39035
- fs$13.closeSync(fd);
39034
+ fd = fs$14.openSync(command, "r");
39035
+ fs$14.readSync(fd, buffer, 0, size, 0);
39036
+ fs$14.closeSync(fd);
39036
39037
  } catch (e) {}
39037
39038
  return shebangCommand(buffer.toString());
39038
39039
  }
@@ -44195,194 +44196,6 @@ async function initializeGitRepo(context$1) {
44195
44196
  }
44196
44197
  }
44197
44198
 
44198
- //#endregion
44199
- //#region bin/services/github-workflow.ts
44200
- var import_lib$6 = /* @__PURE__ */ __toESM$1(require_lib(), 1);
44201
- async function addGitHubWorkflowToAlchemy(context$1) {
44202
- const alchemyFilePath = path.join(context$1.path, "alchemy.run.ts");
44203
- const s = Y();
44204
- s.start("Setting up GitHub Actions...");
44205
- try {
44206
- const workflowDir = path.join(context$1.path, ".github", "workflows");
44207
- await import_lib$6.ensureDir(workflowDir);
44208
- const prPreviewWorkflow = `name: Preview
44209
-
44210
- on:
44211
- pull_request:
44212
- types: [opened, reopened, synchronize, closed]
44213
-
44214
- # Ensure only one workflow runs at a time per PR
44215
- concurrency:
44216
- group: "pr-preview-\${{ github.event.pull_request.number }}"
44217
- cancel-in-progress: false
44218
-
44219
- jobs:
44220
- deploy-preview:
44221
- if: \${{ github.event.action != 'closed' }}
44222
- runs-on: ubuntu-latest
44223
- permissions:
44224
- contents: read
44225
- pull-requests: write
44226
- steps:
44227
- - uses: actions/checkout@v4
44228
-
44229
- - name: Setup Bun
44230
- uses: oven-sh/setup-bun@v1
44231
- with:
44232
- bun-version: latest
44233
-
44234
- - name: Install dependencies
44235
- shell: bash
44236
- run: bun install
44237
-
44238
- - name: Deploy Preview
44239
- run: bun run deploy
44240
- env:
44241
- BRANCH_PREFIX: pr-\${{ github.event.pull_request.number }}
44242
- GITHUB_SHA: \${{ github.event.pull_request.head.sha }}
44243
- GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
44244
- GITHUB_REPOSITORY_OWNER: \${{ github.repository_owner }}
44245
- GITHUB_REPOSITORY_NAME: \${{ github.event.repository.name }}
44246
- PULL_REQUEST: \${{ github.event.pull_request.number }}
44247
- CLOUDFLARE_API_TOKEN: \${{ secrets.CLOUDFLARE_API_TOKEN }}
44248
- CLOUDFLARE_ACCOUNT_ID: \${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
44249
-
44250
- cleanup-preview:
44251
- if: \${{ github.event.action == 'closed' }}
44252
- runs-on: ubuntu-latest
44253
- permissions:
44254
- contents: read
44255
- pull-requests: write
44256
- steps:
44257
- - uses: actions/checkout@v4
44258
-
44259
- - name: Setup Bun
44260
- uses: oven-sh/setup-bun@v1
44261
- with:
44262
- bun-version: latest
44263
-
44264
- - name: Install dependencies
44265
- shell: bash
44266
- run: bun install
44267
-
44268
- - name: Cleanup Preview
44269
- run: bun run destroy
44270
- env:
44271
- BRANCH_PREFIX: pr-\${{ github.event.pull_request.number }}
44272
- GITHUB_SHA: \${{ github.event.pull_request.head.sha }}
44273
- GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
44274
- GITHUB_REPOSITORY_OWNER: \${{ github.repository_owner }}
44275
- GITHUB_REPOSITORY_NAME: \${{ github.event.repository.name }}
44276
- PULL_REQUEST: \${{ github.event.pull_request.number }}
44277
- CLOUDFLARE_API_TOKEN: \${{ secrets.CLOUDFLARE_API_TOKEN }}
44278
- CLOUDFLARE_ACCOUNT_ID: \${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
44279
- `;
44280
- const publishWorkflow = `name: Publish
44281
-
44282
- on:
44283
- push:
44284
- branches: [main]
44285
-
44286
- # Ensure only one workflow runs at a time
44287
- concurrency:
44288
- group: "publish"
44289
- cancel-in-progress: false
44290
-
44291
- jobs:
44292
- publish:
44293
- runs-on: ubuntu-latest
44294
- permissions:
44295
- contents: read
44296
- steps:
44297
- - uses: actions/checkout@v4
44298
-
44299
- - name: Setup Bun
44300
- uses: oven-sh/setup-bun@v1
44301
- with:
44302
- bun-version: latest
44303
-
44304
- - name: Install dependencies
44305
- shell: bash
44306
- run: bun install
44307
-
44308
- - name: Deploy to Production
44309
- run: bun run deploy
44310
- env:
44311
- STAGE: prod
44312
- GITHUB_SHA: \${{ github.sha }}
44313
- CLOUDFLARE_API_TOKEN: \${{ secrets.CLOUDFLARE_API_TOKEN }}
44314
- CLOUDFLARE_ACCOUNT_ID: \${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
44315
- `;
44316
- await import_lib$6.writeFile(path.join(workflowDir, "pr-preview.yml"), prPreviewWorkflow);
44317
- await import_lib$6.writeFile(path.join(workflowDir, "publish.yml"), publishWorkflow);
44318
- let code = await import_lib$6.readFile(alchemyFilePath, "utf-8");
44319
- const alchemyImportRegex = /(import alchemy from "alchemy";)/;
44320
- const alchemyImportMatch = code.match(alchemyImportRegex);
44321
- if (alchemyImportMatch) {
44322
- const githubImport = "\nimport { GitHubComment } from \"alchemy/github\";";
44323
- code = code.replace(alchemyImportRegex, `$1${githubImport}`);
44324
- }
44325
- const lastImportRegex = /import[^;]+from[^;]+;(\s*\n)*/g;
44326
- let lastImportMatch;
44327
- let lastImportEnd = 0;
44328
- while ((lastImportMatch = lastImportRegex.exec(code)) !== null) lastImportEnd = lastImportMatch.index + lastImportMatch[0].length;
44329
- if (lastImportEnd > 0) {
44330
- const stageVariable = `
44331
- const stage = process.env.STAGE || process.env.BRANCH_PREFIX || "dev";
44332
- `;
44333
- code = code.slice(0, lastImportEnd) + stageVariable + code.slice(lastImportEnd);
44334
- }
44335
- const appCallRegex = /const app = await alchemy\("([^"]+)"\);/;
44336
- const appMatch = code.match(appCallRegex);
44337
- if (appMatch) {
44338
- const appName = appMatch[1];
44339
- code = code.replace(appCallRegex, `const app = await alchemy("${appName}", {
44340
- stage,
44341
- });`);
44342
- }
44343
- const cloudflareResourceRegex = /(await (?:Worker|TanStackStart|Nuxt|Astro|Website|SvelteKit|Redwood|ReactRouter|Vite)\([^,]+,\s*{[^}]*)(}\);)/g;
44344
- code = code.replace(cloudflareResourceRegex, (match$1, beforeClosing, closing) => {
44345
- if (beforeClosing.includes("version:")) return match$1;
44346
- const hasTrailingComma = beforeClosing.trim().endsWith(",");
44347
- const versionProp = hasTrailingComma ? ` version: stage === "prod" ? undefined : stage,\n` : `,\n version: stage === "prod" ? undefined : stage,\n`;
44348
- return beforeClosing + versionProp + closing;
44349
- });
44350
- const finalizeRegex = /(await app\.finalize\(\);)/;
44351
- const finalizeMatch = code.match(finalizeRegex);
44352
- if (finalizeMatch) {
44353
- const githubWorkflowCode = `
44354
- if (process.env.PULL_REQUEST) {
44355
- const previewUrl = worker.url;
44356
-
44357
- await GitHubComment("pr-preview-comment", {
44358
- owner: process.env.GITHUB_REPOSITORY_OWNER || "your-username",
44359
- repository: process.env.GITHUB_REPOSITORY_NAME || "${context$1.name}",
44360
- issueNumber: Number(process.env.PULL_REQUEST),
44361
- body: \`
44362
- ## 🚀 Preview Deployed
44363
-
44364
- Your preview is ready!
44365
-
44366
- **Preview URL:** \${previewUrl}
44367
-
44368
- This preview was built from commit \${process.env.GITHUB_SHA}
44369
-
44370
- ---
44371
- <sub>🤖 This comment will be updated automatically when you push new commits to this PR.</sub>\`,
44372
- });
44373
- }
44374
-
44375
- `;
44376
- code = code.replace(finalizeRegex, `${githubWorkflowCode}$1`);
44377
- }
44378
- await import_lib$6.writeFile(alchemyFilePath, code, "utf-8");
44379
- s.stop("GitHub Actions configured");
44380
- } catch (error$81) {
44381
- s.stop("GitHub Actions setup failed");
44382
- throwWithContext(error$81, "Failed to add GitHub workflow setup");
44383
- }
44384
- }
44385
-
44386
44199
  //#endregion
44387
44200
  //#region bin/services/package-manager.ts
44388
44201
  const PackageManager = {
@@ -44457,6 +44270,233 @@ async function installDependencies(context$1, { dependencies: dependencies$1, de
44457
44270
  }
44458
44271
  }
44459
44272
 
44273
+ //#endregion
44274
+ //#region bin/services/github-workflow.ts
44275
+ var import_lib$6 = /* @__PURE__ */ __toESM$1(require_lib(), 1);
44276
+ async function addGitHubWorkflowToAlchemy(context$1) {
44277
+ const alchemyFilePath = path.join(context$1.path, "alchemy.run.ts");
44278
+ const s = Y();
44279
+ s.start("Setting up GitHub Actions...");
44280
+ try {
44281
+ const workflowDir = path.join(context$1.path, ".github", "workflows");
44282
+ await import_lib$6.default.ensureDir(workflowDir);
44283
+ const pmCommands = PackageManager[context$1.packageManager] ?? PackageManager.bun;
44284
+ const installCmd = pmCommands.install;
44285
+ const runCmd = pmCommands.run;
44286
+ const nodeVersion = process.version.match(/^v(\d+)/)?.[1] || "22";
44287
+ const installRuntime = context$1.packageManager === "bun" ? {
44288
+ name: "Setup Bun",
44289
+ uses: "oven-sh/setup-bun@v1",
44290
+ with: { "bun-version": "latest" }
44291
+ } : context$1.packageManager === "deno" ? {
44292
+ name: "Setup Deno",
44293
+ uses: "denoland/setup-deno@v1",
44294
+ with: { "deno-version": "v1.x" }
44295
+ } : {
44296
+ name: "Setup Node.js",
44297
+ uses: "actions/setup-node@v4",
44298
+ with: {
44299
+ "node-version": nodeVersion,
44300
+ ...context$1.packageManager === "pnpm" || context$1.packageManager === "yarn" ? { cache: context$1.packageManager } : {}
44301
+ }
44302
+ };
44303
+ const installAdditionalPackageManager = context$1.packageManager === "pnpm" ? [{
44304
+ name: "Setup pnpm",
44305
+ uses: "pnpm/action-setup@v3",
44306
+ with: { version: "9" }
44307
+ }] : [];
44308
+ const installDependencies$1 = {
44309
+ name: "Install dependencies",
44310
+ shell: "bash",
44311
+ run: installCmd
44312
+ };
44313
+ await import_lib$6.default.writeFile(path.join(workflowDir, "pr-preview.yml"), YAML.stringify({
44314
+ name: "Preview",
44315
+ on: { pull_request: { types: [
44316
+ "opened",
44317
+ "reopened",
44318
+ "synchronize",
44319
+ "closed"
44320
+ ] } },
44321
+ concurrency: {
44322
+ group: "pr-preview-${{ github.event.pull_request.number }}",
44323
+ "cancel-in-progress": false
44324
+ },
44325
+ jobs: {
44326
+ "deploy-preview": {
44327
+ if: "${{ github.event.action != 'closed' }}",
44328
+ "runs-on": "ubuntu-latest",
44329
+ permissions: {
44330
+ contents: "read",
44331
+ "pull-requests": "write"
44332
+ },
44333
+ steps: [
44334
+ { uses: "actions/checkout@v4" },
44335
+ installRuntime,
44336
+ ...installAdditionalPackageManager,
44337
+ installDependencies$1,
44338
+ {
44339
+ name: "Deploy Preview",
44340
+ run: `${runCmd} deploy --stage pr-\${{ github.event.pull_request.number }}`,
44341
+ env: {
44342
+ GITHUB_SHA: "${{ github.event.pull_request.head.sha }}",
44343
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}",
44344
+ GITHUB_REPOSITORY_OWNER: "${{ github.repository_owner }}",
44345
+ GITHUB_REPOSITORY_NAME: "${{ github.event.repository.name }}",
44346
+ PULL_REQUEST: "${{ github.event.pull_request.number }}",
44347
+ CLOUDFLARE_EMAIL: "${{ secrets.CLOUDFLARE_EMAIL }}",
44348
+ CLOUDFLARE_API_TOKEN: "${{ secrets.CLOUDFLARE_API_TOKEN }}",
44349
+ CLOUDFLARE_ACCOUNT_ID: "${{ secrets.CLOUDFLARE_ACCOUNT_ID }}",
44350
+ ALCHEMY_PASSWORD: "${{ secrets.ALCHEMY_PASSWORD }}",
44351
+ ALCHEMY_STATE_TOKEN: "${{ secrets.ALCHEMY_STATE_TOKEN }}"
44352
+ }
44353
+ }
44354
+ ]
44355
+ },
44356
+ "cleanup-preview": {
44357
+ if: "${{ github.event.action == 'closed' }}",
44358
+ "runs-on": "ubuntu-latest",
44359
+ permissions: {
44360
+ contents: "read",
44361
+ "pull-requests": "write"
44362
+ },
44363
+ steps: [
44364
+ { uses: "actions/checkout@v4" },
44365
+ installRuntime,
44366
+ ...installAdditionalPackageManager,
44367
+ installDependencies$1,
44368
+ {
44369
+ name: "Cleanup Preview",
44370
+ run: `${runCmd} destroy`,
44371
+ env: {
44372
+ GITHUB_SHA: "${{ github.event.pull_request.head.sha }}",
44373
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}",
44374
+ GITHUB_REPOSITORY_OWNER: "${{ github.repository_owner }}",
44375
+ GITHUB_REPOSITORY_NAME: "${{ github.event.repository.name }}",
44376
+ PULL_REQUEST: "${{ github.event.pull_request.number }}",
44377
+ CLOUDFLARE_EMAIL: "${{ secrets.CLOUDFLARE_EMAIL }}",
44378
+ CLOUDFLARE_API_TOKEN: "${{ secrets.CLOUDFLARE_API_TOKEN }}",
44379
+ CLOUDFLARE_ACCOUNT_ID: "${{ secrets.CLOUDFLARE_ACCOUNT_ID }}",
44380
+ ALCHEMY_PASSWORD: "${{ secrets.ALCHEMY_PASSWORD }}",
44381
+ ALCHEMY_STATE_TOKEN: "${{ secrets.ALCHEMY_STATE_TOKEN }}"
44382
+ }
44383
+ }
44384
+ ]
44385
+ }
44386
+ }
44387
+ }));
44388
+ await import_lib$6.default.writeFile(path.join(workflowDir, "publish.yml"), YAML.stringify({
44389
+ name: "Publish",
44390
+ on: { push: { branches: ["main"] } },
44391
+ concurrency: {
44392
+ group: "publish",
44393
+ "cancel-in-progress": false
44394
+ },
44395
+ jobs: { publish: {
44396
+ "runs-on": "ubuntu-latest",
44397
+ permissions: { contents: "read" },
44398
+ steps: [
44399
+ { uses: "actions/checkout@v4" },
44400
+ context$1.packageManager === "bun" ? {
44401
+ name: "Setup Bun",
44402
+ uses: "oven-sh/setup-bun@v1",
44403
+ with: { "bun-version": "latest" }
44404
+ } : context$1.packageManager === "deno" ? {
44405
+ name: "Setup Deno",
44406
+ uses: "denoland/setup-deno@v1",
44407
+ with: { "deno-version": "v1.x" }
44408
+ } : {
44409
+ name: "Setup Node.js",
44410
+ uses: "actions/setup-node@v4",
44411
+ with: {
44412
+ "node-version": nodeVersion,
44413
+ ...context$1.packageManager === "pnpm" || context$1.packageManager === "yarn" ? { cache: context$1.packageManager } : {}
44414
+ }
44415
+ },
44416
+ ...context$1.packageManager === "pnpm" ? [{
44417
+ name: "Setup pnpm",
44418
+ uses: "pnpm/action-setup@v3",
44419
+ with: { version: "9" }
44420
+ }] : [],
44421
+ {
44422
+ name: "Install dependencies",
44423
+ shell: "bash",
44424
+ run: installCmd
44425
+ },
44426
+ {
44427
+ name: "Deploy to Production",
44428
+ run: `${runCmd} deploy`,
44429
+ env: {
44430
+ STAGE: "prod",
44431
+ GITHUB_SHA: "${{ github.sha }}",
44432
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}",
44433
+ CLOUDFLARE_EMAIL: "${{ secrets.CLOUDFLARE_EMAIL }}",
44434
+ CLOUDFLARE_API_TOKEN: "${{ secrets.CLOUDFLARE_API_TOKEN }}",
44435
+ CLOUDFLARE_ACCOUNT_ID: "${{ secrets.CLOUDFLARE_ACCOUNT_ID }}",
44436
+ ALCHEMY_PASSWORD: "${{ secrets.ALCHEMY_PASSWORD }}",
44437
+ ALCHEMY_STATE_TOKEN: "${{ secrets.ALCHEMY_STATE_TOKEN }}"
44438
+ }
44439
+ }
44440
+ ]
44441
+ } }
44442
+ }));
44443
+ let code = await import_lib$6.default.readFile(alchemyFilePath, "utf-8");
44444
+ code = code.replace("{projectName}", context$1.name);
44445
+ const alchemyImportRegex = /(import alchemy from "alchemy";)/;
44446
+ const alchemyImportMatch = code.match(alchemyImportRegex);
44447
+ if (alchemyImportMatch) {
44448
+ const githubImport = `\nimport { GitHubComment } from "alchemy/github";
44449
+ import { CloudflareStateStore } from "alchemy/state";`;
44450
+ code = code.replace(alchemyImportRegex, `$1${githubImport}`);
44451
+ }
44452
+ const lastImportRegex = /import[^;]+from[^;]+;(\s*\n)*/g;
44453
+ let lastImportMatch;
44454
+ let lastImportEnd = 0;
44455
+ while ((lastImportMatch = lastImportRegex.exec(code)) !== null) lastImportMatch.index + lastImportMatch[0].length;
44456
+ const appCallRegex = /const app = await alchemy\("([^"]+)"\);/;
44457
+ const appMatch = code.match(appCallRegex);
44458
+ if (appMatch) {
44459
+ const appName = appMatch[1];
44460
+ code = code.replace(appCallRegex, `const app = await alchemy("${appName}", {
44461
+ stateStore: (scope) => new CloudflareStateStore(scope),
44462
+ });`);
44463
+ }
44464
+ const finalizeRegex = /(await app\.finalize\(\);)/;
44465
+ const finalizeMatch = code.match(finalizeRegex);
44466
+ if (finalizeMatch) {
44467
+ const githubWorkflowCode = `
44468
+ if (process.env.PULL_REQUEST) {
44469
+ const previewUrl = worker.url;
44470
+
44471
+ await GitHubComment("pr-preview-comment", {
44472
+ owner: process.env.GITHUB_REPOSITORY_OWNER || "your-username",
44473
+ repository: process.env.GITHUB_REPOSITORY_NAME || "${context$1.name}",
44474
+ issueNumber: Number(process.env.PULL_REQUEST),
44475
+ body: \`
44476
+ ## 🚀 Preview Deployed
44477
+
44478
+ Your preview is ready!
44479
+
44480
+ **Preview URL:** \${previewUrl}
44481
+
44482
+ This preview was built from commit \${process.env.GITHUB_SHA}
44483
+
44484
+ ---
44485
+ <sub>🤖 This comment will be updated automatically when you push new commits to this PR.</sub>\`,
44486
+ });
44487
+ }
44488
+
44489
+ `;
44490
+ code = code.replace(finalizeRegex, `${githubWorkflowCode}$1`);
44491
+ }
44492
+ await import_lib$6.default.writeFile(alchemyFilePath, code, "utf-8");
44493
+ s.stop("GitHub Actions configured");
44494
+ } catch (error$81) {
44495
+ s.stop("GitHub Actions setup failed");
44496
+ throwWithContext(error$81, "Failed to add GitHub workflow setup");
44497
+ }
44498
+ }
44499
+
44460
44500
  //#endregion
44461
44501
  //#region ../node_modules/@sindresorhus/merge-streams/index.js
44462
44502
  function mergeStreams(streams) {
@@ -50945,7 +50985,7 @@ const POSTHOG_PROJECT_ID = process.env.POSTHOG_PROJECT_ID ?? "phc_A51Mi7Q63TvnNr
50945
50985
  //#endregion
50946
50986
  //#region package.json
50947
50987
  var name = "alchemy";
50948
- var version = "0.62.0";
50988
+ var version = "0.62.1";
50949
50989
  var license = "Apache-2.0";
50950
50990
  var author = "Sam Goodwin <sam@alchemy.run>";
50951
50991
  var homepage = "https://alchemy.run";
@@ -58780,10 +58820,10 @@ var require_typescript = /* @__PURE__ */ __commonJS$1({ "../node_modules/@ts-mor
58780
58820
  function and(f, g$1) {
58781
58821
  return (arg) => f(arg) && g$1(arg);
58782
58822
  }
58783
- function or(...fs$35) {
58823
+ function or(...fs$36) {
58784
58824
  return (...args) => {
58785
58825
  let lastResult;
58786
- for (const f of fs$35) {
58826
+ for (const f of fs$36) {
58787
58827
  lastResult = f(...args);
58788
58828
  if (lastResult) return lastResult;
58789
58829
  }
@@ -59974,7 +60014,7 @@ ${lanes.join("\n")}
59974
60014
  var tracing;
59975
60015
  var tracingEnabled;
59976
60016
  ((tracingEnabled2) => {
59977
- let fs$35;
60017
+ let fs$36;
59978
60018
  let traceCount = 0;
59979
60019
  let traceFd = 0;
59980
60020
  let mode;
@@ -59983,8 +60023,8 @@ ${lanes.join("\n")}
59983
60023
  const legend = [];
59984
60024
  function startTracing2(tracingMode, traceDir, configFilePath) {
59985
60025
  Debug.assert(!tracing, "Tracing already started");
59986
- if (fs$35 === void 0) try {
59987
- fs$35 = __require("fs");
60026
+ if (fs$36 === void 0) try {
60027
+ fs$36 = __require("fs");
59988
60028
  } catch (e) {
59989
60029
  throw new Error(`tracing requires having fs
59990
60030
  (original error: ${e.message || e})`);
@@ -59992,7 +60032,7 @@ ${lanes.join("\n")}
59992
60032
  mode = tracingMode;
59993
60033
  typeCatalog.length = 0;
59994
60034
  if (legendPath === void 0) legendPath = combinePaths(traceDir, "legend.json");
59995
- if (!fs$35.existsSync(traceDir)) fs$35.mkdirSync(traceDir, { recursive: true });
60035
+ if (!fs$36.existsSync(traceDir)) fs$36.mkdirSync(traceDir, { recursive: true });
59996
60036
  const countPart = mode === "build" ? `.${process.pid}-${++traceCount}` : mode === "server" ? `.${process.pid}` : ``;
59997
60037
  const tracePath = combinePaths(traceDir, `trace${countPart}.json`);
59998
60038
  const typesPath = combinePaths(traceDir, `types${countPart}.json`);
@@ -60001,7 +60041,7 @@ ${lanes.join("\n")}
60001
60041
  tracePath,
60002
60042
  typesPath
60003
60043
  });
60004
- traceFd = fs$35.openSync(tracePath, "w");
60044
+ traceFd = fs$36.openSync(tracePath, "w");
60005
60045
  tracing = tracingEnabled2;
60006
60046
  const meta = {
60007
60047
  cat: "__metadata",
@@ -60010,7 +60050,7 @@ ${lanes.join("\n")}
60010
60050
  pid: 1,
60011
60051
  tid: 1
60012
60052
  };
60013
- fs$35.writeSync(traceFd, "[\n" + [
60053
+ fs$36.writeSync(traceFd, "[\n" + [
60014
60054
  {
60015
60055
  name: "process_name",
60016
60056
  args: { name: "tsc" },
@@ -60032,10 +60072,10 @@ ${lanes.join("\n")}
60032
60072
  function stopTracing() {
60033
60073
  Debug.assert(tracing, "Tracing is not in progress");
60034
60074
  Debug.assert(!!typeCatalog.length === (mode !== "server"));
60035
- fs$35.writeSync(traceFd, `
60075
+ fs$36.writeSync(traceFd, `
60036
60076
  ]
60037
60077
  `);
60038
- fs$35.closeSync(traceFd);
60078
+ fs$36.closeSync(traceFd);
60039
60079
  tracing = void 0;
60040
60080
  if (typeCatalog.length) dumpTypes(typeCatalog);
60041
60081
  else legend[legend.length - 1].typesPath = void 0;
@@ -60097,11 +60137,11 @@ ${lanes.join("\n")}
60097
60137
  function writeEvent(eventType, phase, name$1, args, extras, time$4 = 1e3 * timestamp()) {
60098
60138
  if (mode === "server" && phase === "checkTypes") return;
60099
60139
  mark("beginTracing");
60100
- fs$35.writeSync(traceFd, `,
60140
+ fs$36.writeSync(traceFd, `,
60101
60141
  {"pid":1,"tid":1,"ph":"${eventType}","cat":"${phase}","ts":${time$4},"name":"${name$1}"`);
60102
- if (extras) fs$35.writeSync(traceFd, `,${extras}`);
60103
- if (args) fs$35.writeSync(traceFd, `,"args":${JSON.stringify(args)}`);
60104
- fs$35.writeSync(traceFd, `}`);
60142
+ if (extras) fs$36.writeSync(traceFd, `,${extras}`);
60143
+ if (args) fs$36.writeSync(traceFd, `,"args":${JSON.stringify(args)}`);
60144
+ fs$36.writeSync(traceFd, `}`);
60105
60145
  mark("endTracing");
60106
60146
  measure("Tracing", "beginTracing", "endTracing");
60107
60147
  }
@@ -60123,9 +60163,9 @@ ${lanes.join("\n")}
60123
60163
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
60124
60164
  mark("beginDumpTypes");
60125
60165
  const typesPath = legend[legend.length - 1].typesPath;
60126
- const typesFd = fs$35.openSync(typesPath, "w");
60166
+ const typesFd = fs$36.openSync(typesPath, "w");
60127
60167
  const recursionIdentityMap = /* @__PURE__ */ new Map();
60128
- fs$35.writeSync(typesFd, "[");
60168
+ fs$36.writeSync(typesFd, "[");
60129
60169
  const numTypes = types$1.length;
60130
60170
  for (let i$1 = 0; i$1 < numTypes; i$1++) {
60131
60171
  const type$1 = types$1[i$1];
@@ -60219,17 +60259,17 @@ ${lanes.join("\n")}
60219
60259
  flags: Debug.formatTypeFlags(type$1.flags).split("|"),
60220
60260
  display
60221
60261
  };
60222
- fs$35.writeSync(typesFd, JSON.stringify(descriptor));
60223
- if (i$1 < numTypes - 1) fs$35.writeSync(typesFd, ",\n");
60262
+ fs$36.writeSync(typesFd, JSON.stringify(descriptor));
60263
+ if (i$1 < numTypes - 1) fs$36.writeSync(typesFd, ",\n");
60224
60264
  }
60225
- fs$35.writeSync(typesFd, "]\n");
60226
- fs$35.closeSync(typesFd);
60265
+ fs$36.writeSync(typesFd, "]\n");
60266
+ fs$36.closeSync(typesFd);
60227
60267
  mark("endDumpTypes");
60228
60268
  measure("Dump types", "beginDumpTypes", "endDumpTypes");
60229
60269
  }
60230
60270
  function dumpLegend() {
60231
60271
  if (!legendPath) return;
60232
- fs$35.writeFileSync(legendPath, JSON.stringify(legend));
60272
+ fs$36.writeFileSync(legendPath, JSON.stringify(legend));
60233
60273
  }
60234
60274
  tracingEnabled2.dumpLegend = dumpLegend;
60235
60275
  })(tracingEnabled || (tracingEnabled = {}));