create-nextly-app 0.0.2-alpha.0 → 0.0.2-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -1254,8 +1254,8 @@ var require_command = __commonJS({
1254
1254
  "../../node_modules/.pnpm/commander@14.0.2/node_modules/commander/lib/command.js"(exports$1) {
1255
1255
  var EventEmitter2 = __require("events").EventEmitter;
1256
1256
  var childProcess = __require("child_process");
1257
- var path20 = __require("path");
1258
- var fs15 = __require("fs");
1257
+ var path21 = __require("path");
1258
+ var fs16 = __require("fs");
1259
1259
  var process11 = __require("process");
1260
1260
  var { Argument: Argument2, humanReadableArgName } = require_argument();
1261
1261
  var { CommanderError: CommanderError2 } = require_error();
@@ -2248,7 +2248,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2248
2248
  * @param {string} subcommandName
2249
2249
  */
2250
2250
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
2251
- if (fs15.existsSync(executableFile)) return;
2251
+ if (fs16.existsSync(executableFile)) return;
2252
2252
  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";
2253
2253
  const executableMissing = `'${executableFile}' does not exist
2254
2254
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -2266,11 +2266,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2266
2266
  let launchWithNode = false;
2267
2267
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
2268
2268
  function findFile(baseDir, baseName) {
2269
- const localBin = path20.resolve(baseDir, baseName);
2270
- if (fs15.existsSync(localBin)) return localBin;
2271
- if (sourceExt.includes(path20.extname(baseName))) return void 0;
2269
+ const localBin = path21.resolve(baseDir, baseName);
2270
+ if (fs16.existsSync(localBin)) return localBin;
2271
+ if (sourceExt.includes(path21.extname(baseName))) return void 0;
2272
2272
  const foundExt = sourceExt.find(
2273
- (ext) => fs15.existsSync(`${localBin}${ext}`)
2273
+ (ext) => fs16.existsSync(`${localBin}${ext}`)
2274
2274
  );
2275
2275
  if (foundExt) return `${localBin}${foundExt}`;
2276
2276
  return void 0;
@@ -2282,21 +2282,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
2282
2282
  if (this._scriptPath) {
2283
2283
  let resolvedScriptPath;
2284
2284
  try {
2285
- resolvedScriptPath = fs15.realpathSync(this._scriptPath);
2285
+ resolvedScriptPath = fs16.realpathSync(this._scriptPath);
2286
2286
  } catch {
2287
2287
  resolvedScriptPath = this._scriptPath;
2288
2288
  }
2289
- executableDir = path20.resolve(
2290
- path20.dirname(resolvedScriptPath),
2289
+ executableDir = path21.resolve(
2290
+ path21.dirname(resolvedScriptPath),
2291
2291
  executableDir
2292
2292
  );
2293
2293
  }
2294
2294
  if (executableDir) {
2295
2295
  let localFile = findFile(executableDir, executableFile);
2296
2296
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
2297
- const legacyName = path20.basename(
2297
+ const legacyName = path21.basename(
2298
2298
  this._scriptPath,
2299
- path20.extname(this._scriptPath)
2299
+ path21.extname(this._scriptPath)
2300
2300
  );
2301
2301
  if (legacyName !== this._name) {
2302
2302
  localFile = findFile(
@@ -2307,7 +2307,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2307
2307
  }
2308
2308
  executableFile = localFile || executableFile;
2309
2309
  }
2310
- launchWithNode = sourceExt.includes(path20.extname(executableFile));
2310
+ launchWithNode = sourceExt.includes(path21.extname(executableFile));
2311
2311
  let proc;
2312
2312
  if (process11.platform !== "win32") {
2313
2313
  if (launchWithNode) {
@@ -3222,7 +3222,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3222
3222
  * @return {Command}
3223
3223
  */
3224
3224
  nameFromFilename(filename) {
3225
- this._name = path20.basename(filename, path20.extname(filename));
3225
+ this._name = path21.basename(filename, path21.extname(filename));
3226
3226
  return this;
3227
3227
  }
3228
3228
  /**
@@ -3236,9 +3236,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
3236
3236
  * @param {string} [path]
3237
3237
  * @return {(string|null|Command)}
3238
3238
  */
3239
- executableDir(path21) {
3240
- if (path21 === void 0) return this._executableDir;
3241
- this._executableDir = path21;
3239
+ executableDir(path22) {
3240
+ if (path22 === void 0) return this._executableDir;
3241
+ this._executableDir = path22;
3242
3242
  return this;
3243
3243
  }
3244
3244
  /**
@@ -3624,54 +3624,54 @@ var require_polyfills = __commonJS({
3624
3624
  }
3625
3625
  var chdir;
3626
3626
  module.exports = patch;
3627
- function patch(fs15) {
3627
+ function patch(fs16) {
3628
3628
  if (constants4.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
3629
- patchLchmod(fs15);
3630
- }
3631
- if (!fs15.lutimes) {
3632
- patchLutimes(fs15);
3633
- }
3634
- fs15.chown = chownFix(fs15.chown);
3635
- fs15.fchown = chownFix(fs15.fchown);
3636
- fs15.lchown = chownFix(fs15.lchown);
3637
- fs15.chmod = chmodFix(fs15.chmod);
3638
- fs15.fchmod = chmodFix(fs15.fchmod);
3639
- fs15.lchmod = chmodFix(fs15.lchmod);
3640
- fs15.chownSync = chownFixSync(fs15.chownSync);
3641
- fs15.fchownSync = chownFixSync(fs15.fchownSync);
3642
- fs15.lchownSync = chownFixSync(fs15.lchownSync);
3643
- fs15.chmodSync = chmodFixSync(fs15.chmodSync);
3644
- fs15.fchmodSync = chmodFixSync(fs15.fchmodSync);
3645
- fs15.lchmodSync = chmodFixSync(fs15.lchmodSync);
3646
- fs15.stat = statFix(fs15.stat);
3647
- fs15.fstat = statFix(fs15.fstat);
3648
- fs15.lstat = statFix(fs15.lstat);
3649
- fs15.statSync = statFixSync(fs15.statSync);
3650
- fs15.fstatSync = statFixSync(fs15.fstatSync);
3651
- fs15.lstatSync = statFixSync(fs15.lstatSync);
3652
- if (fs15.chmod && !fs15.lchmod) {
3653
- fs15.lchmod = function(path20, mode, cb) {
3629
+ patchLchmod(fs16);
3630
+ }
3631
+ if (!fs16.lutimes) {
3632
+ patchLutimes(fs16);
3633
+ }
3634
+ fs16.chown = chownFix(fs16.chown);
3635
+ fs16.fchown = chownFix(fs16.fchown);
3636
+ fs16.lchown = chownFix(fs16.lchown);
3637
+ fs16.chmod = chmodFix(fs16.chmod);
3638
+ fs16.fchmod = chmodFix(fs16.fchmod);
3639
+ fs16.lchmod = chmodFix(fs16.lchmod);
3640
+ fs16.chownSync = chownFixSync(fs16.chownSync);
3641
+ fs16.fchownSync = chownFixSync(fs16.fchownSync);
3642
+ fs16.lchownSync = chownFixSync(fs16.lchownSync);
3643
+ fs16.chmodSync = chmodFixSync(fs16.chmodSync);
3644
+ fs16.fchmodSync = chmodFixSync(fs16.fchmodSync);
3645
+ fs16.lchmodSync = chmodFixSync(fs16.lchmodSync);
3646
+ fs16.stat = statFix(fs16.stat);
3647
+ fs16.fstat = statFix(fs16.fstat);
3648
+ fs16.lstat = statFix(fs16.lstat);
3649
+ fs16.statSync = statFixSync(fs16.statSync);
3650
+ fs16.fstatSync = statFixSync(fs16.fstatSync);
3651
+ fs16.lstatSync = statFixSync(fs16.lstatSync);
3652
+ if (fs16.chmod && !fs16.lchmod) {
3653
+ fs16.lchmod = function(path21, mode, cb) {
3654
3654
  if (cb) process.nextTick(cb);
3655
3655
  };
3656
- fs15.lchmodSync = function() {
3656
+ fs16.lchmodSync = function() {
3657
3657
  };
3658
3658
  }
3659
- if (fs15.chown && !fs15.lchown) {
3660
- fs15.lchown = function(path20, uid, gid, cb) {
3659
+ if (fs16.chown && !fs16.lchown) {
3660
+ fs16.lchown = function(path21, uid, gid, cb) {
3661
3661
  if (cb) process.nextTick(cb);
3662
3662
  };
3663
- fs15.lchownSync = function() {
3663
+ fs16.lchownSync = function() {
3664
3664
  };
3665
3665
  }
3666
3666
  if (platform3 === "win32") {
3667
- fs15.rename = typeof fs15.rename !== "function" ? fs15.rename : (function(fs$rename) {
3667
+ fs16.rename = typeof fs16.rename !== "function" ? fs16.rename : (function(fs$rename) {
3668
3668
  function rename(from, to2, cb) {
3669
3669
  var start = Date.now();
3670
3670
  var backoff = 0;
3671
3671
  fs$rename(from, to2, function CB(er2) {
3672
3672
  if (er2 && (er2.code === "EACCES" || er2.code === "EPERM" || er2.code === "EBUSY") && Date.now() - start < 6e4) {
3673
3673
  setTimeout(function() {
3674
- fs15.stat(to2, function(stater, st3) {
3674
+ fs16.stat(to2, function(stater, st3) {
3675
3675
  if (stater && stater.code === "ENOENT")
3676
3676
  fs$rename(from, to2, CB);
3677
3677
  else
@@ -3687,9 +3687,9 @@ var require_polyfills = __commonJS({
3687
3687
  }
3688
3688
  if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
3689
3689
  return rename;
3690
- })(fs15.rename);
3690
+ })(fs16.rename);
3691
3691
  }
3692
- fs15.read = typeof fs15.read !== "function" ? fs15.read : (function(fs$read) {
3692
+ fs16.read = typeof fs16.read !== "function" ? fs16.read : (function(fs$read) {
3693
3693
  function read(fd, buffer, offset, length, position, callback_) {
3694
3694
  var callback;
3695
3695
  if (callback_ && typeof callback_ === "function") {
@@ -3697,22 +3697,22 @@ var require_polyfills = __commonJS({
3697
3697
  callback = function(er2, _3, __) {
3698
3698
  if (er2 && er2.code === "EAGAIN" && eagCounter < 10) {
3699
3699
  eagCounter++;
3700
- return fs$read.call(fs15, fd, buffer, offset, length, position, callback);
3700
+ return fs$read.call(fs16, fd, buffer, offset, length, position, callback);
3701
3701
  }
3702
3702
  callback_.apply(this, arguments);
3703
3703
  };
3704
3704
  }
3705
- return fs$read.call(fs15, fd, buffer, offset, length, position, callback);
3705
+ return fs$read.call(fs16, fd, buffer, offset, length, position, callback);
3706
3706
  }
3707
3707
  if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
3708
3708
  return read;
3709
- })(fs15.read);
3710
- fs15.readSync = typeof fs15.readSync !== "function" ? fs15.readSync : /* @__PURE__ */ (function(fs$readSync) {
3709
+ })(fs16.read);
3710
+ fs16.readSync = typeof fs16.readSync !== "function" ? fs16.readSync : /* @__PURE__ */ (function(fs$readSync) {
3711
3711
  return function(fd, buffer, offset, length, position) {
3712
3712
  var eagCounter = 0;
3713
3713
  while (true) {
3714
3714
  try {
3715
- return fs$readSync.call(fs15, fd, buffer, offset, length, position);
3715
+ return fs$readSync.call(fs16, fd, buffer, offset, length, position);
3716
3716
  } catch (er2) {
3717
3717
  if (er2.code === "EAGAIN" && eagCounter < 10) {
3718
3718
  eagCounter++;
@@ -3722,11 +3722,11 @@ var require_polyfills = __commonJS({
3722
3722
  }
3723
3723
  }
3724
3724
  };
3725
- })(fs15.readSync);
3726
- function patchLchmod(fs16) {
3727
- fs16.lchmod = function(path20, mode, callback) {
3728
- fs16.open(
3729
- path20,
3725
+ })(fs16.readSync);
3726
+ function patchLchmod(fs17) {
3727
+ fs17.lchmod = function(path21, mode, callback) {
3728
+ fs17.open(
3729
+ path21,
3730
3730
  constants4.O_WRONLY | constants4.O_SYMLINK,
3731
3731
  mode,
3732
3732
  function(err, fd) {
@@ -3734,80 +3734,80 @@ var require_polyfills = __commonJS({
3734
3734
  if (callback) callback(err);
3735
3735
  return;
3736
3736
  }
3737
- fs16.fchmod(fd, mode, function(err2) {
3738
- fs16.close(fd, function(err22) {
3737
+ fs17.fchmod(fd, mode, function(err2) {
3738
+ fs17.close(fd, function(err22) {
3739
3739
  if (callback) callback(err2 || err22);
3740
3740
  });
3741
3741
  });
3742
3742
  }
3743
3743
  );
3744
3744
  };
3745
- fs16.lchmodSync = function(path20, mode) {
3746
- var fd = fs16.openSync(path20, constants4.O_WRONLY | constants4.O_SYMLINK, mode);
3745
+ fs17.lchmodSync = function(path21, mode) {
3746
+ var fd = fs17.openSync(path21, constants4.O_WRONLY | constants4.O_SYMLINK, mode);
3747
3747
  var threw = true;
3748
3748
  var ret;
3749
3749
  try {
3750
- ret = fs16.fchmodSync(fd, mode);
3750
+ ret = fs17.fchmodSync(fd, mode);
3751
3751
  threw = false;
3752
3752
  } finally {
3753
3753
  if (threw) {
3754
3754
  try {
3755
- fs16.closeSync(fd);
3755
+ fs17.closeSync(fd);
3756
3756
  } catch (er2) {
3757
3757
  }
3758
3758
  } else {
3759
- fs16.closeSync(fd);
3759
+ fs17.closeSync(fd);
3760
3760
  }
3761
3761
  }
3762
3762
  return ret;
3763
3763
  };
3764
3764
  }
3765
- function patchLutimes(fs16) {
3766
- if (constants4.hasOwnProperty("O_SYMLINK") && fs16.futimes) {
3767
- fs16.lutimes = function(path20, at3, mt4, cb) {
3768
- fs16.open(path20, constants4.O_SYMLINK, function(er2, fd) {
3765
+ function patchLutimes(fs17) {
3766
+ if (constants4.hasOwnProperty("O_SYMLINK") && fs17.futimes) {
3767
+ fs17.lutimes = function(path21, at3, mt4, cb) {
3768
+ fs17.open(path21, constants4.O_SYMLINK, function(er2, fd) {
3769
3769
  if (er2) {
3770
3770
  if (cb) cb(er2);
3771
3771
  return;
3772
3772
  }
3773
- fs16.futimes(fd, at3, mt4, function(er3) {
3774
- fs16.close(fd, function(er22) {
3773
+ fs17.futimes(fd, at3, mt4, function(er3) {
3774
+ fs17.close(fd, function(er22) {
3775
3775
  if (cb) cb(er3 || er22);
3776
3776
  });
3777
3777
  });
3778
3778
  });
3779
3779
  };
3780
- fs16.lutimesSync = function(path20, at3, mt4) {
3781
- var fd = fs16.openSync(path20, constants4.O_SYMLINK);
3780
+ fs17.lutimesSync = function(path21, at3, mt4) {
3781
+ var fd = fs17.openSync(path21, constants4.O_SYMLINK);
3782
3782
  var ret;
3783
3783
  var threw = true;
3784
3784
  try {
3785
- ret = fs16.futimesSync(fd, at3, mt4);
3785
+ ret = fs17.futimesSync(fd, at3, mt4);
3786
3786
  threw = false;
3787
3787
  } finally {
3788
3788
  if (threw) {
3789
3789
  try {
3790
- fs16.closeSync(fd);
3790
+ fs17.closeSync(fd);
3791
3791
  } catch (er2) {
3792
3792
  }
3793
3793
  } else {
3794
- fs16.closeSync(fd);
3794
+ fs17.closeSync(fd);
3795
3795
  }
3796
3796
  }
3797
3797
  return ret;
3798
3798
  };
3799
- } else if (fs16.futimes) {
3800
- fs16.lutimes = function(_a, _b, _c, cb) {
3799
+ } else if (fs17.futimes) {
3800
+ fs17.lutimes = function(_a, _b, _c, cb) {
3801
3801
  if (cb) process.nextTick(cb);
3802
3802
  };
3803
- fs16.lutimesSync = function() {
3803
+ fs17.lutimesSync = function() {
3804
3804
  };
3805
3805
  }
3806
3806
  }
3807
3807
  function chmodFix(orig) {
3808
3808
  if (!orig) return orig;
3809
3809
  return function(target, mode, cb) {
3810
- return orig.call(fs15, target, mode, function(er2) {
3810
+ return orig.call(fs16, target, mode, function(er2) {
3811
3811
  if (chownErOk(er2)) er2 = null;
3812
3812
  if (cb) cb.apply(this, arguments);
3813
3813
  });
@@ -3817,7 +3817,7 @@ var require_polyfills = __commonJS({
3817
3817
  if (!orig) return orig;
3818
3818
  return function(target, mode) {
3819
3819
  try {
3820
- return orig.call(fs15, target, mode);
3820
+ return orig.call(fs16, target, mode);
3821
3821
  } catch (er2) {
3822
3822
  if (!chownErOk(er2)) throw er2;
3823
3823
  }
@@ -3826,7 +3826,7 @@ var require_polyfills = __commonJS({
3826
3826
  function chownFix(orig) {
3827
3827
  if (!orig) return orig;
3828
3828
  return function(target, uid, gid, cb) {
3829
- return orig.call(fs15, target, uid, gid, function(er2) {
3829
+ return orig.call(fs16, target, uid, gid, function(er2) {
3830
3830
  if (chownErOk(er2)) er2 = null;
3831
3831
  if (cb) cb.apply(this, arguments);
3832
3832
  });
@@ -3836,7 +3836,7 @@ var require_polyfills = __commonJS({
3836
3836
  if (!orig) return orig;
3837
3837
  return function(target, uid, gid) {
3838
3838
  try {
3839
- return orig.call(fs15, target, uid, gid);
3839
+ return orig.call(fs16, target, uid, gid);
3840
3840
  } catch (er2) {
3841
3841
  if (!chownErOk(er2)) throw er2;
3842
3842
  }
@@ -3856,13 +3856,13 @@ var require_polyfills = __commonJS({
3856
3856
  }
3857
3857
  if (cb) cb.apply(this, arguments);
3858
3858
  }
3859
- return options ? orig.call(fs15, target, options, callback) : orig.call(fs15, target, callback);
3859
+ return options ? orig.call(fs16, target, options, callback) : orig.call(fs16, target, callback);
3860
3860
  };
3861
3861
  }
3862
3862
  function statFixSync(orig) {
3863
3863
  if (!orig) return orig;
3864
3864
  return function(target, options) {
3865
- var stats = options ? orig.call(fs15, target, options) : orig.call(fs15, target);
3865
+ var stats = options ? orig.call(fs16, target, options) : orig.call(fs16, target);
3866
3866
  if (stats) {
3867
3867
  if (stats.uid < 0) stats.uid += 4294967296;
3868
3868
  if (stats.gid < 0) stats.gid += 4294967296;
@@ -3891,16 +3891,16 @@ var require_legacy_streams = __commonJS({
3891
3891
  "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports$1, module) {
3892
3892
  var Stream = __require("stream").Stream;
3893
3893
  module.exports = legacy;
3894
- function legacy(fs15) {
3894
+ function legacy(fs16) {
3895
3895
  return {
3896
3896
  ReadStream,
3897
3897
  WriteStream
3898
3898
  };
3899
- function ReadStream(path20, options) {
3900
- if (!(this instanceof ReadStream)) return new ReadStream(path20, options);
3899
+ function ReadStream(path21, options) {
3900
+ if (!(this instanceof ReadStream)) return new ReadStream(path21, options);
3901
3901
  Stream.call(this);
3902
3902
  var self = this;
3903
- this.path = path20;
3903
+ this.path = path21;
3904
3904
  this.fd = null;
3905
3905
  this.readable = true;
3906
3906
  this.paused = false;
@@ -3934,7 +3934,7 @@ var require_legacy_streams = __commonJS({
3934
3934
  });
3935
3935
  return;
3936
3936
  }
3937
- fs15.open(this.path, this.flags, this.mode, function(err, fd) {
3937
+ fs16.open(this.path, this.flags, this.mode, function(err, fd) {
3938
3938
  if (err) {
3939
3939
  self.emit("error", err);
3940
3940
  self.readable = false;
@@ -3945,10 +3945,10 @@ var require_legacy_streams = __commonJS({
3945
3945
  self._read();
3946
3946
  });
3947
3947
  }
3948
- function WriteStream(path20, options) {
3949
- if (!(this instanceof WriteStream)) return new WriteStream(path20, options);
3948
+ function WriteStream(path21, options) {
3949
+ if (!(this instanceof WriteStream)) return new WriteStream(path21, options);
3950
3950
  Stream.call(this);
3951
- this.path = path20;
3951
+ this.path = path21;
3952
3952
  this.fd = null;
3953
3953
  this.writable = true;
3954
3954
  this.flags = "w";
@@ -3973,7 +3973,7 @@ var require_legacy_streams = __commonJS({
3973
3973
  this.busy = false;
3974
3974
  this._queue = [];
3975
3975
  if (this.fd === null) {
3976
- this._open = fs15.open;
3976
+ this._open = fs16.open;
3977
3977
  this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
3978
3978
  this.flush();
3979
3979
  }
@@ -4007,7 +4007,7 @@ var require_clone = __commonJS({
4007
4007
  // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
4008
4008
  var require_graceful_fs = __commonJS({
4009
4009
  "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports$1, module) {
4010
- var fs15 = __require("fs");
4010
+ var fs16 = __require("fs");
4011
4011
  var polyfills = require_polyfills();
4012
4012
  var legacy = require_legacy_streams();
4013
4013
  var clone = require_clone();
@@ -4039,12 +4039,12 @@ var require_graceful_fs = __commonJS({
4039
4039
  m2 = "GFS4: " + m2.split(/\n/).join("\nGFS4: ");
4040
4040
  console.error(m2);
4041
4041
  };
4042
- if (!fs15[gracefulQueue]) {
4042
+ if (!fs16[gracefulQueue]) {
4043
4043
  queue = global[gracefulQueue] || [];
4044
- publishQueue(fs15, queue);
4045
- fs15.close = (function(fs$close) {
4044
+ publishQueue(fs16, queue);
4045
+ fs16.close = (function(fs$close) {
4046
4046
  function close(fd, cb) {
4047
- return fs$close.call(fs15, fd, function(err) {
4047
+ return fs$close.call(fs16, fd, function(err) {
4048
4048
  if (!err) {
4049
4049
  resetQueue();
4050
4050
  }
@@ -4056,48 +4056,48 @@ var require_graceful_fs = __commonJS({
4056
4056
  value: fs$close
4057
4057
  });
4058
4058
  return close;
4059
- })(fs15.close);
4060
- fs15.closeSync = (function(fs$closeSync) {
4059
+ })(fs16.close);
4060
+ fs16.closeSync = (function(fs$closeSync) {
4061
4061
  function closeSync(fd) {
4062
- fs$closeSync.apply(fs15, arguments);
4062
+ fs$closeSync.apply(fs16, arguments);
4063
4063
  resetQueue();
4064
4064
  }
4065
4065
  Object.defineProperty(closeSync, previousSymbol, {
4066
4066
  value: fs$closeSync
4067
4067
  });
4068
4068
  return closeSync;
4069
- })(fs15.closeSync);
4069
+ })(fs16.closeSync);
4070
4070
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
4071
4071
  process.on("exit", function() {
4072
- debug(fs15[gracefulQueue]);
4073
- __require("assert").equal(fs15[gracefulQueue].length, 0);
4072
+ debug(fs16[gracefulQueue]);
4073
+ __require("assert").equal(fs16[gracefulQueue].length, 0);
4074
4074
  });
4075
4075
  }
4076
4076
  }
4077
4077
  var queue;
4078
4078
  if (!global[gracefulQueue]) {
4079
- publishQueue(global, fs15[gracefulQueue]);
4080
- }
4081
- module.exports = patch(clone(fs15));
4082
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs15.__patched) {
4083
- module.exports = patch(fs15);
4084
- fs15.__patched = true;
4085
- }
4086
- function patch(fs16) {
4087
- polyfills(fs16);
4088
- fs16.gracefulify = patch;
4089
- fs16.createReadStream = createReadStream3;
4090
- fs16.createWriteStream = createWriteStream2;
4091
- var fs$readFile = fs16.readFile;
4092
- fs16.readFile = readFile;
4093
- function readFile(path20, options, cb) {
4079
+ publishQueue(global, fs16[gracefulQueue]);
4080
+ }
4081
+ module.exports = patch(clone(fs16));
4082
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs16.__patched) {
4083
+ module.exports = patch(fs16);
4084
+ fs16.__patched = true;
4085
+ }
4086
+ function patch(fs17) {
4087
+ polyfills(fs17);
4088
+ fs17.gracefulify = patch;
4089
+ fs17.createReadStream = createReadStream3;
4090
+ fs17.createWriteStream = createWriteStream2;
4091
+ var fs$readFile = fs17.readFile;
4092
+ fs17.readFile = readFile;
4093
+ function readFile(path21, options, cb) {
4094
4094
  if (typeof options === "function")
4095
4095
  cb = options, options = null;
4096
- return go$readFile(path20, options, cb);
4097
- function go$readFile(path21, options2, cb2, startTime) {
4098
- return fs$readFile(path21, options2, function(err) {
4096
+ return go$readFile(path21, options, cb);
4097
+ function go$readFile(path22, options2, cb2, startTime) {
4098
+ return fs$readFile(path22, options2, function(err) {
4099
4099
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
4100
- enqueue([go$readFile, [path21, options2, cb2], err, startTime || Date.now(), Date.now()]);
4100
+ enqueue([go$readFile, [path22, options2, cb2], err, startTime || Date.now(), Date.now()]);
4101
4101
  else {
4102
4102
  if (typeof cb2 === "function")
4103
4103
  cb2.apply(this, arguments);
@@ -4105,16 +4105,16 @@ var require_graceful_fs = __commonJS({
4105
4105
  });
4106
4106
  }
4107
4107
  }
4108
- var fs$writeFile = fs16.writeFile;
4109
- fs16.writeFile = writeFile;
4110
- function writeFile(path20, data, options, cb) {
4108
+ var fs$writeFile = fs17.writeFile;
4109
+ fs17.writeFile = writeFile;
4110
+ function writeFile(path21, data, options, cb) {
4111
4111
  if (typeof options === "function")
4112
4112
  cb = options, options = null;
4113
- return go$writeFile(path20, data, options, cb);
4114
- function go$writeFile(path21, data2, options2, cb2, startTime) {
4115
- return fs$writeFile(path21, data2, options2, function(err) {
4113
+ return go$writeFile(path21, data, options, cb);
4114
+ function go$writeFile(path22, data2, options2, cb2, startTime) {
4115
+ return fs$writeFile(path22, data2, options2, function(err) {
4116
4116
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
4117
- enqueue([go$writeFile, [path21, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
4117
+ enqueue([go$writeFile, [path22, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
4118
4118
  else {
4119
4119
  if (typeof cb2 === "function")
4120
4120
  cb2.apply(this, arguments);
@@ -4122,17 +4122,17 @@ var require_graceful_fs = __commonJS({
4122
4122
  });
4123
4123
  }
4124
4124
  }
4125
- var fs$appendFile = fs16.appendFile;
4125
+ var fs$appendFile = fs17.appendFile;
4126
4126
  if (fs$appendFile)
4127
- fs16.appendFile = appendFile;
4128
- function appendFile(path20, data, options, cb) {
4127
+ fs17.appendFile = appendFile;
4128
+ function appendFile(path21, data, options, cb) {
4129
4129
  if (typeof options === "function")
4130
4130
  cb = options, options = null;
4131
- return go$appendFile(path20, data, options, cb);
4132
- function go$appendFile(path21, data2, options2, cb2, startTime) {
4133
- return fs$appendFile(path21, data2, options2, function(err) {
4131
+ return go$appendFile(path21, data, options, cb);
4132
+ function go$appendFile(path22, data2, options2, cb2, startTime) {
4133
+ return fs$appendFile(path22, data2, options2, function(err) {
4134
4134
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
4135
- enqueue([go$appendFile, [path21, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
4135
+ enqueue([go$appendFile, [path22, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
4136
4136
  else {
4137
4137
  if (typeof cb2 === "function")
4138
4138
  cb2.apply(this, arguments);
@@ -4140,9 +4140,9 @@ var require_graceful_fs = __commonJS({
4140
4140
  });
4141
4141
  }
4142
4142
  }
4143
- var fs$copyFile = fs16.copyFile;
4143
+ var fs$copyFile = fs17.copyFile;
4144
4144
  if (fs$copyFile)
4145
- fs16.copyFile = copyFile;
4145
+ fs17.copyFile = copyFile;
4146
4146
  function copyFile(src, dest, flags, cb) {
4147
4147
  if (typeof flags === "function") {
4148
4148
  cb = flags;
@@ -4160,34 +4160,34 @@ var require_graceful_fs = __commonJS({
4160
4160
  });
4161
4161
  }
4162
4162
  }
4163
- var fs$readdir = fs16.readdir;
4164
- fs16.readdir = readdir;
4163
+ var fs$readdir = fs17.readdir;
4164
+ fs17.readdir = readdir;
4165
4165
  var noReaddirOptionVersions = /^v[0-5]\./;
4166
- function readdir(path20, options, cb) {
4166
+ function readdir(path21, options, cb) {
4167
4167
  if (typeof options === "function")
4168
4168
  cb = options, options = null;
4169
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path21, options2, cb2, startTime) {
4170
- return fs$readdir(path21, fs$readdirCallback(
4171
- path21,
4169
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path22, options2, cb2, startTime) {
4170
+ return fs$readdir(path22, fs$readdirCallback(
4171
+ path22,
4172
4172
  options2,
4173
4173
  cb2,
4174
4174
  startTime
4175
4175
  ));
4176
- } : function go$readdir2(path21, options2, cb2, startTime) {
4177
- return fs$readdir(path21, options2, fs$readdirCallback(
4178
- path21,
4176
+ } : function go$readdir2(path22, options2, cb2, startTime) {
4177
+ return fs$readdir(path22, options2, fs$readdirCallback(
4178
+ path22,
4179
4179
  options2,
4180
4180
  cb2,
4181
4181
  startTime
4182
4182
  ));
4183
4183
  };
4184
- return go$readdir(path20, options, cb);
4185
- function fs$readdirCallback(path21, options2, cb2, startTime) {
4184
+ return go$readdir(path21, options, cb);
4185
+ function fs$readdirCallback(path22, options2, cb2, startTime) {
4186
4186
  return function(err, files) {
4187
4187
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
4188
4188
  enqueue([
4189
4189
  go$readdir,
4190
- [path21, options2, cb2],
4190
+ [path22, options2, cb2],
4191
4191
  err,
4192
4192
  startTime || Date.now(),
4193
4193
  Date.now()
@@ -4202,21 +4202,21 @@ var require_graceful_fs = __commonJS({
4202
4202
  }
4203
4203
  }
4204
4204
  if (process.version.substr(0, 4) === "v0.8") {
4205
- var legStreams = legacy(fs16);
4205
+ var legStreams = legacy(fs17);
4206
4206
  ReadStream = legStreams.ReadStream;
4207
4207
  WriteStream = legStreams.WriteStream;
4208
4208
  }
4209
- var fs$ReadStream = fs16.ReadStream;
4209
+ var fs$ReadStream = fs17.ReadStream;
4210
4210
  if (fs$ReadStream) {
4211
4211
  ReadStream.prototype = Object.create(fs$ReadStream.prototype);
4212
4212
  ReadStream.prototype.open = ReadStream$open;
4213
4213
  }
4214
- var fs$WriteStream = fs16.WriteStream;
4214
+ var fs$WriteStream = fs17.WriteStream;
4215
4215
  if (fs$WriteStream) {
4216
4216
  WriteStream.prototype = Object.create(fs$WriteStream.prototype);
4217
4217
  WriteStream.prototype.open = WriteStream$open;
4218
4218
  }
4219
- Object.defineProperty(fs16, "ReadStream", {
4219
+ Object.defineProperty(fs17, "ReadStream", {
4220
4220
  get: function() {
4221
4221
  return ReadStream;
4222
4222
  },
@@ -4226,7 +4226,7 @@ var require_graceful_fs = __commonJS({
4226
4226
  enumerable: true,
4227
4227
  configurable: true
4228
4228
  });
4229
- Object.defineProperty(fs16, "WriteStream", {
4229
+ Object.defineProperty(fs17, "WriteStream", {
4230
4230
  get: function() {
4231
4231
  return WriteStream;
4232
4232
  },
@@ -4237,7 +4237,7 @@ var require_graceful_fs = __commonJS({
4237
4237
  configurable: true
4238
4238
  });
4239
4239
  var FileReadStream = ReadStream;
4240
- Object.defineProperty(fs16, "FileReadStream", {
4240
+ Object.defineProperty(fs17, "FileReadStream", {
4241
4241
  get: function() {
4242
4242
  return FileReadStream;
4243
4243
  },
@@ -4248,7 +4248,7 @@ var require_graceful_fs = __commonJS({
4248
4248
  configurable: true
4249
4249
  });
4250
4250
  var FileWriteStream = WriteStream;
4251
- Object.defineProperty(fs16, "FileWriteStream", {
4251
+ Object.defineProperty(fs17, "FileWriteStream", {
4252
4252
  get: function() {
4253
4253
  return FileWriteStream;
4254
4254
  },
@@ -4258,7 +4258,7 @@ var require_graceful_fs = __commonJS({
4258
4258
  enumerable: true,
4259
4259
  configurable: true
4260
4260
  });
4261
- function ReadStream(path20, options) {
4261
+ function ReadStream(path21, options) {
4262
4262
  if (this instanceof ReadStream)
4263
4263
  return fs$ReadStream.apply(this, arguments), this;
4264
4264
  else
@@ -4278,7 +4278,7 @@ var require_graceful_fs = __commonJS({
4278
4278
  }
4279
4279
  });
4280
4280
  }
4281
- function WriteStream(path20, options) {
4281
+ function WriteStream(path21, options) {
4282
4282
  if (this instanceof WriteStream)
4283
4283
  return fs$WriteStream.apply(this, arguments), this;
4284
4284
  else
@@ -4296,22 +4296,22 @@ var require_graceful_fs = __commonJS({
4296
4296
  }
4297
4297
  });
4298
4298
  }
4299
- function createReadStream3(path20, options) {
4300
- return new fs16.ReadStream(path20, options);
4299
+ function createReadStream3(path21, options) {
4300
+ return new fs17.ReadStream(path21, options);
4301
4301
  }
4302
- function createWriteStream2(path20, options) {
4303
- return new fs16.WriteStream(path20, options);
4302
+ function createWriteStream2(path21, options) {
4303
+ return new fs17.WriteStream(path21, options);
4304
4304
  }
4305
- var fs$open = fs16.open;
4306
- fs16.open = open;
4307
- function open(path20, flags, mode, cb) {
4305
+ var fs$open = fs17.open;
4306
+ fs17.open = open;
4307
+ function open(path21, flags, mode, cb) {
4308
4308
  if (typeof mode === "function")
4309
4309
  cb = mode, mode = null;
4310
- return go$open(path20, flags, mode, cb);
4311
- function go$open(path21, flags2, mode2, cb2, startTime) {
4312
- return fs$open(path21, flags2, mode2, function(err, fd) {
4310
+ return go$open(path21, flags, mode, cb);
4311
+ function go$open(path22, flags2, mode2, cb2, startTime) {
4312
+ return fs$open(path22, flags2, mode2, function(err, fd) {
4313
4313
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
4314
- enqueue([go$open, [path21, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
4314
+ enqueue([go$open, [path22, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
4315
4315
  else {
4316
4316
  if (typeof cb2 === "function")
4317
4317
  cb2.apply(this, arguments);
@@ -4319,20 +4319,20 @@ var require_graceful_fs = __commonJS({
4319
4319
  });
4320
4320
  }
4321
4321
  }
4322
- return fs16;
4322
+ return fs17;
4323
4323
  }
4324
4324
  function enqueue(elem) {
4325
4325
  debug("ENQUEUE", elem[0].name, elem[1]);
4326
- fs15[gracefulQueue].push(elem);
4326
+ fs16[gracefulQueue].push(elem);
4327
4327
  retry();
4328
4328
  }
4329
4329
  var retryTimer;
4330
4330
  function resetQueue() {
4331
4331
  var now = Date.now();
4332
- for (var i2 = 0; i2 < fs15[gracefulQueue].length; ++i2) {
4333
- if (fs15[gracefulQueue][i2].length > 2) {
4334
- fs15[gracefulQueue][i2][3] = now;
4335
- fs15[gracefulQueue][i2][4] = now;
4332
+ for (var i2 = 0; i2 < fs16[gracefulQueue].length; ++i2) {
4333
+ if (fs16[gracefulQueue][i2].length > 2) {
4334
+ fs16[gracefulQueue][i2][3] = now;
4335
+ fs16[gracefulQueue][i2][4] = now;
4336
4336
  }
4337
4337
  }
4338
4338
  retry();
@@ -4340,9 +4340,9 @@ var require_graceful_fs = __commonJS({
4340
4340
  function retry() {
4341
4341
  clearTimeout(retryTimer);
4342
4342
  retryTimer = void 0;
4343
- if (fs15[gracefulQueue].length === 0)
4343
+ if (fs16[gracefulQueue].length === 0)
4344
4344
  return;
4345
- var elem = fs15[gracefulQueue].shift();
4345
+ var elem = fs16[gracefulQueue].shift();
4346
4346
  var fn2 = elem[0];
4347
4347
  var args = elem[1];
4348
4348
  var err = elem[2];
@@ -4364,7 +4364,7 @@ var require_graceful_fs = __commonJS({
4364
4364
  debug("RETRY", fn2.name, args);
4365
4365
  fn2.apply(null, args.concat([startTime]));
4366
4366
  } else {
4367
- fs15[gracefulQueue].push(elem);
4367
+ fs16[gracefulQueue].push(elem);
4368
4368
  }
4369
4369
  }
4370
4370
  if (retryTimer === void 0) {
@@ -4378,7 +4378,7 @@ var require_graceful_fs = __commonJS({
4378
4378
  var require_fs = __commonJS({
4379
4379
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/fs/index.js"(exports$1) {
4380
4380
  var u3 = require_universalify().fromCallback;
4381
- var fs15 = require_graceful_fs();
4381
+ var fs16 = require_graceful_fs();
4382
4382
  var api = [
4383
4383
  "access",
4384
4384
  "appendFile",
@@ -4419,26 +4419,26 @@ var require_fs = __commonJS({
4419
4419
  "utimes",
4420
4420
  "writeFile"
4421
4421
  ].filter((key) => {
4422
- return typeof fs15[key] === "function";
4422
+ return typeof fs16[key] === "function";
4423
4423
  });
4424
- Object.assign(exports$1, fs15);
4424
+ Object.assign(exports$1, fs16);
4425
4425
  api.forEach((method) => {
4426
- exports$1[method] = u3(fs15[method]);
4426
+ exports$1[method] = u3(fs16[method]);
4427
4427
  });
4428
4428
  exports$1.exists = function(filename, callback) {
4429
4429
  if (typeof callback === "function") {
4430
- return fs15.exists(filename, callback);
4430
+ return fs16.exists(filename, callback);
4431
4431
  }
4432
4432
  return new Promise((resolve) => {
4433
- return fs15.exists(filename, resolve);
4433
+ return fs16.exists(filename, resolve);
4434
4434
  });
4435
4435
  };
4436
4436
  exports$1.read = function(fd, buffer, offset, length, position, callback) {
4437
4437
  if (typeof callback === "function") {
4438
- return fs15.read(fd, buffer, offset, length, position, callback);
4438
+ return fs16.read(fd, buffer, offset, length, position, callback);
4439
4439
  }
4440
4440
  return new Promise((resolve, reject) => {
4441
- fs15.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
4441
+ fs16.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
4442
4442
  if (err) return reject(err);
4443
4443
  resolve({ bytesRead, buffer: buffer2 });
4444
4444
  });
@@ -4446,10 +4446,10 @@ var require_fs = __commonJS({
4446
4446
  };
4447
4447
  exports$1.write = function(fd, buffer, ...args) {
4448
4448
  if (typeof args[args.length - 1] === "function") {
4449
- return fs15.write(fd, buffer, ...args);
4449
+ return fs16.write(fd, buffer, ...args);
4450
4450
  }
4451
4451
  return new Promise((resolve, reject) => {
4452
- fs15.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
4452
+ fs16.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
4453
4453
  if (err) return reject(err);
4454
4454
  resolve({ bytesWritten, buffer: buffer2 });
4455
4455
  });
@@ -4457,10 +4457,10 @@ var require_fs = __commonJS({
4457
4457
  };
4458
4458
  exports$1.readv = function(fd, buffers, ...args) {
4459
4459
  if (typeof args[args.length - 1] === "function") {
4460
- return fs15.readv(fd, buffers, ...args);
4460
+ return fs16.readv(fd, buffers, ...args);
4461
4461
  }
4462
4462
  return new Promise((resolve, reject) => {
4463
- fs15.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
4463
+ fs16.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
4464
4464
  if (err) return reject(err);
4465
4465
  resolve({ bytesRead, buffers: buffers2 });
4466
4466
  });
@@ -4468,17 +4468,17 @@ var require_fs = __commonJS({
4468
4468
  };
4469
4469
  exports$1.writev = function(fd, buffers, ...args) {
4470
4470
  if (typeof args[args.length - 1] === "function") {
4471
- return fs15.writev(fd, buffers, ...args);
4471
+ return fs16.writev(fd, buffers, ...args);
4472
4472
  }
4473
4473
  return new Promise((resolve, reject) => {
4474
- fs15.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
4474
+ fs16.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
4475
4475
  if (err) return reject(err);
4476
4476
  resolve({ bytesWritten, buffers: buffers2 });
4477
4477
  });
4478
4478
  });
4479
4479
  };
4480
- if (typeof fs15.realpath.native === "function") {
4481
- exports$1.realpath.native = u3(fs15.realpath.native);
4480
+ if (typeof fs16.realpath.native === "function") {
4481
+ exports$1.realpath.native = u3(fs16.realpath.native);
4482
4482
  } else {
4483
4483
  process.emitWarning(
4484
4484
  "fs.realpath.native is not a function. Is fs being monkey-patched?",
@@ -4492,10 +4492,10 @@ var require_fs = __commonJS({
4492
4492
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/utils.js
4493
4493
  var require_utils2 = __commonJS({
4494
4494
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/utils.js"(exports$1, module) {
4495
- var path20 = __require("path");
4495
+ var path21 = __require("path");
4496
4496
  module.exports.checkPath = function checkPath(pth) {
4497
4497
  if (process.platform === "win32") {
4498
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path20.parse(pth).root, ""));
4498
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path21.parse(pth).root, ""));
4499
4499
  if (pathHasInvalidWinCharacters) {
4500
4500
  const error = new Error(`Path contains invalid characters: ${pth}`);
4501
4501
  error.code = "EINVAL";
@@ -4509,7 +4509,7 @@ var require_utils2 = __commonJS({
4509
4509
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/make-dir.js
4510
4510
  var require_make_dir = __commonJS({
4511
4511
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports$1, module) {
4512
- var fs15 = require_fs();
4512
+ var fs16 = require_fs();
4513
4513
  var { checkPath } = require_utils2();
4514
4514
  var getMode = (options) => {
4515
4515
  const defaults = { mode: 511 };
@@ -4518,14 +4518,14 @@ var require_make_dir = __commonJS({
4518
4518
  };
4519
4519
  module.exports.makeDir = async (dir, options) => {
4520
4520
  checkPath(dir);
4521
- return fs15.mkdir(dir, {
4521
+ return fs16.mkdir(dir, {
4522
4522
  mode: getMode(options),
4523
4523
  recursive: true
4524
4524
  });
4525
4525
  };
4526
4526
  module.exports.makeDirSync = (dir, options) => {
4527
4527
  checkPath(dir);
4528
- return fs15.mkdirSync(dir, {
4528
+ return fs16.mkdirSync(dir, {
4529
4529
  mode: getMode(options),
4530
4530
  recursive: true
4531
4531
  });
@@ -4555,13 +4555,13 @@ var require_mkdirs = __commonJS({
4555
4555
  var require_path_exists = __commonJS({
4556
4556
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/path-exists/index.js"(exports$1, module) {
4557
4557
  var u3 = require_universalify().fromPromise;
4558
- var fs15 = require_fs();
4559
- function pathExists(path20) {
4560
- return fs15.access(path20).then(() => true).catch(() => false);
4558
+ var fs16 = require_fs();
4559
+ function pathExists(path21) {
4560
+ return fs16.access(path21).then(() => true).catch(() => false);
4561
4561
  }
4562
4562
  module.exports = {
4563
4563
  pathExists: u3(pathExists),
4564
- pathExistsSync: fs15.existsSync
4564
+ pathExistsSync: fs16.existsSync
4565
4565
  };
4566
4566
  }
4567
4567
  });
@@ -4569,16 +4569,16 @@ var require_path_exists = __commonJS({
4569
4569
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/utimes.js
4570
4570
  var require_utimes = __commonJS({
4571
4571
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/utimes.js"(exports$1, module) {
4572
- var fs15 = require_fs();
4572
+ var fs16 = require_fs();
4573
4573
  var u3 = require_universalify().fromPromise;
4574
- async function utimesMillis(path20, atime, mtime) {
4575
- const fd = await fs15.open(path20, "r+");
4574
+ async function utimesMillis(path21, atime, mtime) {
4575
+ const fd = await fs16.open(path21, "r+");
4576
4576
  let closeErr = null;
4577
4577
  try {
4578
- await fs15.futimes(fd, atime, mtime);
4578
+ await fs16.futimes(fd, atime, mtime);
4579
4579
  } finally {
4580
4580
  try {
4581
- await fs15.close(fd);
4581
+ await fs16.close(fd);
4582
4582
  } catch (e) {
4583
4583
  closeErr = e;
4584
4584
  }
@@ -4587,10 +4587,10 @@ var require_utimes = __commonJS({
4587
4587
  throw closeErr;
4588
4588
  }
4589
4589
  }
4590
- function utimesMillisSync(path20, atime, mtime) {
4591
- const fd = fs15.openSync(path20, "r+");
4592
- fs15.futimesSync(fd, atime, mtime);
4593
- return fs15.closeSync(fd);
4590
+ function utimesMillisSync(path21, atime, mtime) {
4591
+ const fd = fs16.openSync(path21, "r+");
4592
+ fs16.futimesSync(fd, atime, mtime);
4593
+ return fs16.closeSync(fd);
4594
4594
  }
4595
4595
  module.exports = {
4596
4596
  utimesMillis: u3(utimesMillis),
@@ -4602,11 +4602,11 @@ var require_utimes = __commonJS({
4602
4602
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/stat.js
4603
4603
  var require_stat = __commonJS({
4604
4604
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/stat.js"(exports$1, module) {
4605
- var fs15 = require_fs();
4606
- var path20 = __require("path");
4605
+ var fs16 = require_fs();
4606
+ var path21 = __require("path");
4607
4607
  var u3 = require_universalify().fromPromise;
4608
4608
  function getStats(src, dest, opts) {
4609
- const statFunc = opts.dereference ? (file) => fs15.stat(file, { bigint: true }) : (file) => fs15.lstat(file, { bigint: true });
4609
+ const statFunc = opts.dereference ? (file) => fs16.stat(file, { bigint: true }) : (file) => fs16.lstat(file, { bigint: true });
4610
4610
  return Promise.all([
4611
4611
  statFunc(src),
4612
4612
  statFunc(dest).catch((err) => {
@@ -4617,7 +4617,7 @@ var require_stat = __commonJS({
4617
4617
  }
4618
4618
  function getStatsSync(src, dest, opts) {
4619
4619
  let destStat;
4620
- const statFunc = opts.dereference ? (file) => fs15.statSync(file, { bigint: true }) : (file) => fs15.lstatSync(file, { bigint: true });
4620
+ const statFunc = opts.dereference ? (file) => fs16.statSync(file, { bigint: true }) : (file) => fs16.lstatSync(file, { bigint: true });
4621
4621
  const srcStat = statFunc(src);
4622
4622
  try {
4623
4623
  destStat = statFunc(dest);
@@ -4631,8 +4631,8 @@ var require_stat = __commonJS({
4631
4631
  const { srcStat, destStat } = await getStats(src, dest, opts);
4632
4632
  if (destStat) {
4633
4633
  if (areIdentical(srcStat, destStat)) {
4634
- const srcBaseName = path20.basename(src);
4635
- const destBaseName = path20.basename(dest);
4634
+ const srcBaseName = path21.basename(src);
4635
+ const destBaseName = path21.basename(dest);
4636
4636
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
4637
4637
  return { srcStat, destStat, isChangingCase: true };
4638
4638
  }
@@ -4654,8 +4654,8 @@ var require_stat = __commonJS({
4654
4654
  const { srcStat, destStat } = getStatsSync(src, dest, opts);
4655
4655
  if (destStat) {
4656
4656
  if (areIdentical(srcStat, destStat)) {
4657
- const srcBaseName = path20.basename(src);
4658
- const destBaseName = path20.basename(dest);
4657
+ const srcBaseName = path21.basename(src);
4658
+ const destBaseName = path21.basename(dest);
4659
4659
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
4660
4660
  return { srcStat, destStat, isChangingCase: true };
4661
4661
  }
@@ -4674,12 +4674,12 @@ var require_stat = __commonJS({
4674
4674
  return { srcStat, destStat };
4675
4675
  }
4676
4676
  async function checkParentPaths(src, srcStat, dest, funcName) {
4677
- const srcParent = path20.resolve(path20.dirname(src));
4678
- const destParent = path20.resolve(path20.dirname(dest));
4679
- if (destParent === srcParent || destParent === path20.parse(destParent).root) return;
4677
+ const srcParent = path21.resolve(path21.dirname(src));
4678
+ const destParent = path21.resolve(path21.dirname(dest));
4679
+ if (destParent === srcParent || destParent === path21.parse(destParent).root) return;
4680
4680
  let destStat;
4681
4681
  try {
4682
- destStat = await fs15.stat(destParent, { bigint: true });
4682
+ destStat = await fs16.stat(destParent, { bigint: true });
4683
4683
  } catch (err) {
4684
4684
  if (err.code === "ENOENT") return;
4685
4685
  throw err;
@@ -4690,12 +4690,12 @@ var require_stat = __commonJS({
4690
4690
  return checkParentPaths(src, srcStat, destParent, funcName);
4691
4691
  }
4692
4692
  function checkParentPathsSync(src, srcStat, dest, funcName) {
4693
- const srcParent = path20.resolve(path20.dirname(src));
4694
- const destParent = path20.resolve(path20.dirname(dest));
4695
- if (destParent === srcParent || destParent === path20.parse(destParent).root) return;
4693
+ const srcParent = path21.resolve(path21.dirname(src));
4694
+ const destParent = path21.resolve(path21.dirname(dest));
4695
+ if (destParent === srcParent || destParent === path21.parse(destParent).root) return;
4696
4696
  let destStat;
4697
4697
  try {
4698
- destStat = fs15.statSync(destParent, { bigint: true });
4698
+ destStat = fs16.statSync(destParent, { bigint: true });
4699
4699
  } catch (err) {
4700
4700
  if (err.code === "ENOENT") return;
4701
4701
  throw err;
@@ -4709,8 +4709,8 @@ var require_stat = __commonJS({
4709
4709
  return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
4710
4710
  }
4711
4711
  function isSrcSubdir(src, dest) {
4712
- const srcArr = path20.resolve(src).split(path20.sep).filter((i2) => i2);
4713
- const destArr = path20.resolve(dest).split(path20.sep).filter((i2) => i2);
4712
+ const srcArr = path21.resolve(src).split(path21.sep).filter((i2) => i2);
4713
+ const destArr = path21.resolve(dest).split(path21.sep).filter((i2) => i2);
4714
4714
  return srcArr.every((cur, i2) => destArr[i2] === cur);
4715
4715
  }
4716
4716
  function errMsg(src, dest, funcName) {
@@ -4760,8 +4760,8 @@ var require_async = __commonJS({
4760
4760
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy.js
4761
4761
  var require_copy = __commonJS({
4762
4762
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy.js"(exports$1, module) {
4763
- var fs15 = require_fs();
4764
- var path20 = __require("path");
4763
+ var fs16 = require_fs();
4764
+ var path21 = __require("path");
4765
4765
  var { mkdirs } = require_mkdirs();
4766
4766
  var { pathExists } = require_path_exists();
4767
4767
  var { utimesMillis } = require_utimes();
@@ -4784,7 +4784,7 @@ var require_copy = __commonJS({
4784
4784
  await stat.checkParentPaths(src, srcStat, dest, "copy");
4785
4785
  const include = await runFilter(src, dest, opts);
4786
4786
  if (!include) return;
4787
- const destParent = path20.dirname(dest);
4787
+ const destParent = path21.dirname(dest);
4788
4788
  const dirExists = await pathExists(destParent);
4789
4789
  if (!dirExists) {
4790
4790
  await mkdirs(destParent);
@@ -4796,7 +4796,7 @@ var require_copy = __commonJS({
4796
4796
  return opts.filter(src, dest);
4797
4797
  }
4798
4798
  async function getStatsAndPerformCopy(destStat, src, dest, opts) {
4799
- const statFn = opts.dereference ? fs15.stat : fs15.lstat;
4799
+ const statFn = opts.dereference ? fs16.stat : fs16.lstat;
4800
4800
  const srcStat = await statFn(src);
4801
4801
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
4802
4802
  if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -4808,7 +4808,7 @@ var require_copy = __commonJS({
4808
4808
  async function onFile(srcStat, destStat, src, dest, opts) {
4809
4809
  if (!destStat) return copyFile(srcStat, src, dest, opts);
4810
4810
  if (opts.overwrite) {
4811
- await fs15.unlink(dest);
4811
+ await fs16.unlink(dest);
4812
4812
  return copyFile(srcStat, src, dest, opts);
4813
4813
  }
4814
4814
  if (opts.errorOnExist) {
@@ -4816,29 +4816,29 @@ var require_copy = __commonJS({
4816
4816
  }
4817
4817
  }
4818
4818
  async function copyFile(srcStat, src, dest, opts) {
4819
- await fs15.copyFile(src, dest);
4819
+ await fs16.copyFile(src, dest);
4820
4820
  if (opts.preserveTimestamps) {
4821
4821
  if (fileIsNotWritable(srcStat.mode)) {
4822
4822
  await makeFileWritable(dest, srcStat.mode);
4823
4823
  }
4824
- const updatedSrcStat = await fs15.stat(src);
4824
+ const updatedSrcStat = await fs16.stat(src);
4825
4825
  await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
4826
4826
  }
4827
- return fs15.chmod(dest, srcStat.mode);
4827
+ return fs16.chmod(dest, srcStat.mode);
4828
4828
  }
4829
4829
  function fileIsNotWritable(srcMode) {
4830
4830
  return (srcMode & 128) === 0;
4831
4831
  }
4832
4832
  function makeFileWritable(dest, srcMode) {
4833
- return fs15.chmod(dest, srcMode | 128);
4833
+ return fs16.chmod(dest, srcMode | 128);
4834
4834
  }
4835
4835
  async function onDir(srcStat, destStat, src, dest, opts) {
4836
4836
  if (!destStat) {
4837
- await fs15.mkdir(dest);
4837
+ await fs16.mkdir(dest);
4838
4838
  }
4839
- await asyncIteratorConcurrentProcess(await fs15.opendir(src), async (item) => {
4840
- const srcItem = path20.join(src, item.name);
4841
- const destItem = path20.join(dest, item.name);
4839
+ await asyncIteratorConcurrentProcess(await fs16.opendir(src), async (item) => {
4840
+ const srcItem = path21.join(src, item.name);
4841
+ const destItem = path21.join(dest, item.name);
4842
4842
  const include = await runFilter(srcItem, destItem, opts);
4843
4843
  if (include) {
4844
4844
  const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
@@ -4846,26 +4846,26 @@ var require_copy = __commonJS({
4846
4846
  }
4847
4847
  });
4848
4848
  if (!destStat) {
4849
- await fs15.chmod(dest, srcStat.mode);
4849
+ await fs16.chmod(dest, srcStat.mode);
4850
4850
  }
4851
4851
  }
4852
4852
  async function onLink(destStat, src, dest, opts) {
4853
- let resolvedSrc = await fs15.readlink(src);
4853
+ let resolvedSrc = await fs16.readlink(src);
4854
4854
  if (opts.dereference) {
4855
- resolvedSrc = path20.resolve(process.cwd(), resolvedSrc);
4855
+ resolvedSrc = path21.resolve(process.cwd(), resolvedSrc);
4856
4856
  }
4857
4857
  if (!destStat) {
4858
- return fs15.symlink(resolvedSrc, dest);
4858
+ return fs16.symlink(resolvedSrc, dest);
4859
4859
  }
4860
4860
  let resolvedDest = null;
4861
4861
  try {
4862
- resolvedDest = await fs15.readlink(dest);
4862
+ resolvedDest = await fs16.readlink(dest);
4863
4863
  } catch (e) {
4864
- if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs15.symlink(resolvedSrc, dest);
4864
+ if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs16.symlink(resolvedSrc, dest);
4865
4865
  throw e;
4866
4866
  }
4867
4867
  if (opts.dereference) {
4868
- resolvedDest = path20.resolve(process.cwd(), resolvedDest);
4868
+ resolvedDest = path21.resolve(process.cwd(), resolvedDest);
4869
4869
  }
4870
4870
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
4871
4871
  throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
@@ -4873,8 +4873,8 @@ var require_copy = __commonJS({
4873
4873
  if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
4874
4874
  throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
4875
4875
  }
4876
- await fs15.unlink(dest);
4877
- return fs15.symlink(resolvedSrc, dest);
4876
+ await fs16.unlink(dest);
4877
+ return fs16.symlink(resolvedSrc, dest);
4878
4878
  }
4879
4879
  module.exports = copy;
4880
4880
  }
@@ -4883,8 +4883,8 @@ var require_copy = __commonJS({
4883
4883
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy-sync.js
4884
4884
  var require_copy_sync = __commonJS({
4885
4885
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy-sync.js"(exports$1, module) {
4886
- var fs15 = require_graceful_fs();
4887
- var path20 = __require("path");
4886
+ var fs16 = require_graceful_fs();
4887
+ var path21 = __require("path");
4888
4888
  var mkdirsSync = require_mkdirs().mkdirsSync;
4889
4889
  var utimesMillisSync = require_utimes().utimesMillisSync;
4890
4890
  var stat = require_stat();
@@ -4905,12 +4905,12 @@ var require_copy_sync = __commonJS({
4905
4905
  const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
4906
4906
  stat.checkParentPathsSync(src, srcStat, dest, "copy");
4907
4907
  if (opts.filter && !opts.filter(src, dest)) return;
4908
- const destParent = path20.dirname(dest);
4909
- if (!fs15.existsSync(destParent)) mkdirsSync(destParent);
4908
+ const destParent = path21.dirname(dest);
4909
+ if (!fs16.existsSync(destParent)) mkdirsSync(destParent);
4910
4910
  return getStats(destStat, src, dest, opts);
4911
4911
  }
4912
4912
  function getStats(destStat, src, dest, opts) {
4913
- const statSync2 = opts.dereference ? fs15.statSync : fs15.lstatSync;
4913
+ const statSync2 = opts.dereference ? fs16.statSync : fs16.lstatSync;
4914
4914
  const srcStat = statSync2(src);
4915
4915
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
4916
4916
  else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -4925,14 +4925,14 @@ var require_copy_sync = __commonJS({
4925
4925
  }
4926
4926
  function mayCopyFile(srcStat, src, dest, opts) {
4927
4927
  if (opts.overwrite) {
4928
- fs15.unlinkSync(dest);
4928
+ fs16.unlinkSync(dest);
4929
4929
  return copyFile(srcStat, src, dest, opts);
4930
4930
  } else if (opts.errorOnExist) {
4931
4931
  throw new Error(`'${dest}' already exists`);
4932
4932
  }
4933
4933
  }
4934
4934
  function copyFile(srcStat, src, dest, opts) {
4935
- fs15.copyFileSync(src, dest);
4935
+ fs16.copyFileSync(src, dest);
4936
4936
  if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
4937
4937
  return setDestMode(dest, srcStat.mode);
4938
4938
  }
@@ -4947,10 +4947,10 @@ var require_copy_sync = __commonJS({
4947
4947
  return setDestMode(dest, srcMode | 128);
4948
4948
  }
4949
4949
  function setDestMode(dest, srcMode) {
4950
- return fs15.chmodSync(dest, srcMode);
4950
+ return fs16.chmodSync(dest, srcMode);
4951
4951
  }
4952
4952
  function setDestTimestamps(src, dest) {
4953
- const updatedSrcStat = fs15.statSync(src);
4953
+ const updatedSrcStat = fs16.statSync(src);
4954
4954
  return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
4955
4955
  }
4956
4956
  function onDir(srcStat, destStat, src, dest, opts) {
@@ -4958,12 +4958,12 @@ var require_copy_sync = __commonJS({
4958
4958
  return copyDir(src, dest, opts);
4959
4959
  }
4960
4960
  function mkDirAndCopy(srcMode, src, dest, opts) {
4961
- fs15.mkdirSync(dest);
4961
+ fs16.mkdirSync(dest);
4962
4962
  copyDir(src, dest, opts);
4963
4963
  return setDestMode(dest, srcMode);
4964
4964
  }
4965
4965
  function copyDir(src, dest, opts) {
4966
- const dir = fs15.opendirSync(src);
4966
+ const dir = fs16.opendirSync(src);
4967
4967
  try {
4968
4968
  let dirent;
4969
4969
  while ((dirent = dir.readSync()) !== null) {
@@ -4974,29 +4974,29 @@ var require_copy_sync = __commonJS({
4974
4974
  }
4975
4975
  }
4976
4976
  function copyDirItem(item, src, dest, opts) {
4977
- const srcItem = path20.join(src, item);
4978
- const destItem = path20.join(dest, item);
4977
+ const srcItem = path21.join(src, item);
4978
+ const destItem = path21.join(dest, item);
4979
4979
  if (opts.filter && !opts.filter(srcItem, destItem)) return;
4980
4980
  const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
4981
4981
  return getStats(destStat, srcItem, destItem, opts);
4982
4982
  }
4983
4983
  function onLink(destStat, src, dest, opts) {
4984
- let resolvedSrc = fs15.readlinkSync(src);
4984
+ let resolvedSrc = fs16.readlinkSync(src);
4985
4985
  if (opts.dereference) {
4986
- resolvedSrc = path20.resolve(process.cwd(), resolvedSrc);
4986
+ resolvedSrc = path21.resolve(process.cwd(), resolvedSrc);
4987
4987
  }
4988
4988
  if (!destStat) {
4989
- return fs15.symlinkSync(resolvedSrc, dest);
4989
+ return fs16.symlinkSync(resolvedSrc, dest);
4990
4990
  } else {
4991
4991
  let resolvedDest;
4992
4992
  try {
4993
- resolvedDest = fs15.readlinkSync(dest);
4993
+ resolvedDest = fs16.readlinkSync(dest);
4994
4994
  } catch (err) {
4995
- if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs15.symlinkSync(resolvedSrc, dest);
4995
+ if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs16.symlinkSync(resolvedSrc, dest);
4996
4996
  throw err;
4997
4997
  }
4998
4998
  if (opts.dereference) {
4999
- resolvedDest = path20.resolve(process.cwd(), resolvedDest);
4999
+ resolvedDest = path21.resolve(process.cwd(), resolvedDest);
5000
5000
  }
5001
5001
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
5002
5002
  throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
@@ -5008,8 +5008,8 @@ var require_copy_sync = __commonJS({
5008
5008
  }
5009
5009
  }
5010
5010
  function copyLink(resolvedSrc, dest) {
5011
- fs15.unlinkSync(dest);
5012
- return fs15.symlinkSync(resolvedSrc, dest);
5011
+ fs16.unlinkSync(dest);
5012
+ return fs16.symlinkSync(resolvedSrc, dest);
5013
5013
  }
5014
5014
  module.exports = copySync;
5015
5015
  }
@@ -5029,13 +5029,13 @@ var require_copy2 = __commonJS({
5029
5029
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/remove/index.js
5030
5030
  var require_remove = __commonJS({
5031
5031
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/remove/index.js"(exports$1, module) {
5032
- var fs15 = require_graceful_fs();
5032
+ var fs16 = require_graceful_fs();
5033
5033
  var u3 = require_universalify().fromCallback;
5034
- function remove(path20, callback) {
5035
- fs15.rm(path20, { recursive: true, force: true }, callback);
5034
+ function remove(path21, callback) {
5035
+ fs16.rm(path21, { recursive: true, force: true }, callback);
5036
5036
  }
5037
- function removeSync(path20) {
5038
- fs15.rmSync(path20, { recursive: true, force: true });
5037
+ function removeSync(path21) {
5038
+ fs16.rmSync(path21, { recursive: true, force: true });
5039
5039
  }
5040
5040
  module.exports = {
5041
5041
  remove: u3(remove),
@@ -5048,28 +5048,28 @@ var require_remove = __commonJS({
5048
5048
  var require_empty = __commonJS({
5049
5049
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/empty/index.js"(exports$1, module) {
5050
5050
  var u3 = require_universalify().fromPromise;
5051
- var fs15 = require_fs();
5052
- var path20 = __require("path");
5051
+ var fs16 = require_fs();
5052
+ var path21 = __require("path");
5053
5053
  var mkdir = require_mkdirs();
5054
5054
  var remove = require_remove();
5055
5055
  var emptyDir = u3(async function emptyDir2(dir) {
5056
5056
  let items;
5057
5057
  try {
5058
- items = await fs15.readdir(dir);
5058
+ items = await fs16.readdir(dir);
5059
5059
  } catch {
5060
5060
  return mkdir.mkdirs(dir);
5061
5061
  }
5062
- return Promise.all(items.map((item) => remove.remove(path20.join(dir, item))));
5062
+ return Promise.all(items.map((item) => remove.remove(path21.join(dir, item))));
5063
5063
  });
5064
5064
  function emptyDirSync(dir) {
5065
5065
  let items;
5066
5066
  try {
5067
- items = fs15.readdirSync(dir);
5067
+ items = fs16.readdirSync(dir);
5068
5068
  } catch {
5069
5069
  return mkdir.mkdirsSync(dir);
5070
5070
  }
5071
5071
  items.forEach((item) => {
5072
- item = path20.join(dir, item);
5072
+ item = path21.join(dir, item);
5073
5073
  remove.removeSync(item);
5074
5074
  });
5075
5075
  }
@@ -5086,52 +5086,52 @@ var require_empty = __commonJS({
5086
5086
  var require_file = __commonJS({
5087
5087
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/file.js"(exports$1, module) {
5088
5088
  var u3 = require_universalify().fromPromise;
5089
- var path20 = __require("path");
5090
- var fs15 = require_fs();
5089
+ var path21 = __require("path");
5090
+ var fs16 = require_fs();
5091
5091
  var mkdir = require_mkdirs();
5092
5092
  async function createFile(file) {
5093
5093
  let stats;
5094
5094
  try {
5095
- stats = await fs15.stat(file);
5095
+ stats = await fs16.stat(file);
5096
5096
  } catch {
5097
5097
  }
5098
5098
  if (stats && stats.isFile()) return;
5099
- const dir = path20.dirname(file);
5099
+ const dir = path21.dirname(file);
5100
5100
  let dirStats = null;
5101
5101
  try {
5102
- dirStats = await fs15.stat(dir);
5102
+ dirStats = await fs16.stat(dir);
5103
5103
  } catch (err) {
5104
5104
  if (err.code === "ENOENT") {
5105
5105
  await mkdir.mkdirs(dir);
5106
- await fs15.writeFile(file, "");
5106
+ await fs16.writeFile(file, "");
5107
5107
  return;
5108
5108
  } else {
5109
5109
  throw err;
5110
5110
  }
5111
5111
  }
5112
5112
  if (dirStats.isDirectory()) {
5113
- await fs15.writeFile(file, "");
5113
+ await fs16.writeFile(file, "");
5114
5114
  } else {
5115
- await fs15.readdir(dir);
5115
+ await fs16.readdir(dir);
5116
5116
  }
5117
5117
  }
5118
5118
  function createFileSync(file) {
5119
5119
  let stats;
5120
5120
  try {
5121
- stats = fs15.statSync(file);
5121
+ stats = fs16.statSync(file);
5122
5122
  } catch {
5123
5123
  }
5124
5124
  if (stats && stats.isFile()) return;
5125
- const dir = path20.dirname(file);
5125
+ const dir = path21.dirname(file);
5126
5126
  try {
5127
- if (!fs15.statSync(dir).isDirectory()) {
5128
- fs15.readdirSync(dir);
5127
+ if (!fs16.statSync(dir).isDirectory()) {
5128
+ fs16.readdirSync(dir);
5129
5129
  }
5130
5130
  } catch (err) {
5131
5131
  if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
5132
5132
  else throw err;
5133
5133
  }
5134
- fs15.writeFileSync(file, "");
5134
+ fs16.writeFileSync(file, "");
5135
5135
  }
5136
5136
  module.exports = {
5137
5137
  createFile: u3(createFile),
@@ -5144,50 +5144,50 @@ var require_file = __commonJS({
5144
5144
  var require_link = __commonJS({
5145
5145
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/link.js"(exports$1, module) {
5146
5146
  var u3 = require_universalify().fromPromise;
5147
- var path20 = __require("path");
5148
- var fs15 = require_fs();
5147
+ var path21 = __require("path");
5148
+ var fs16 = require_fs();
5149
5149
  var mkdir = require_mkdirs();
5150
5150
  var { pathExists } = require_path_exists();
5151
5151
  var { areIdentical } = require_stat();
5152
5152
  async function createLink(srcpath, dstpath) {
5153
5153
  let dstStat;
5154
5154
  try {
5155
- dstStat = await fs15.lstat(dstpath);
5155
+ dstStat = await fs16.lstat(dstpath);
5156
5156
  } catch {
5157
5157
  }
5158
5158
  let srcStat;
5159
5159
  try {
5160
- srcStat = await fs15.lstat(srcpath);
5160
+ srcStat = await fs16.lstat(srcpath);
5161
5161
  } catch (err) {
5162
5162
  err.message = err.message.replace("lstat", "ensureLink");
5163
5163
  throw err;
5164
5164
  }
5165
5165
  if (dstStat && areIdentical(srcStat, dstStat)) return;
5166
- const dir = path20.dirname(dstpath);
5166
+ const dir = path21.dirname(dstpath);
5167
5167
  const dirExists = await pathExists(dir);
5168
5168
  if (!dirExists) {
5169
5169
  await mkdir.mkdirs(dir);
5170
5170
  }
5171
- await fs15.link(srcpath, dstpath);
5171
+ await fs16.link(srcpath, dstpath);
5172
5172
  }
5173
5173
  function createLinkSync(srcpath, dstpath) {
5174
5174
  let dstStat;
5175
5175
  try {
5176
- dstStat = fs15.lstatSync(dstpath);
5176
+ dstStat = fs16.lstatSync(dstpath);
5177
5177
  } catch {
5178
5178
  }
5179
5179
  try {
5180
- const srcStat = fs15.lstatSync(srcpath);
5180
+ const srcStat = fs16.lstatSync(srcpath);
5181
5181
  if (dstStat && areIdentical(srcStat, dstStat)) return;
5182
5182
  } catch (err) {
5183
5183
  err.message = err.message.replace("lstat", "ensureLink");
5184
5184
  throw err;
5185
5185
  }
5186
- const dir = path20.dirname(dstpath);
5187
- const dirExists = fs15.existsSync(dir);
5188
- if (dirExists) return fs15.linkSync(srcpath, dstpath);
5186
+ const dir = path21.dirname(dstpath);
5187
+ const dirExists = fs16.existsSync(dir);
5188
+ if (dirExists) return fs16.linkSync(srcpath, dstpath);
5189
5189
  mkdir.mkdirsSync(dir);
5190
- return fs15.linkSync(srcpath, dstpath);
5190
+ return fs16.linkSync(srcpath, dstpath);
5191
5191
  }
5192
5192
  module.exports = {
5193
5193
  createLink: u3(createLink),
@@ -5199,14 +5199,14 @@ var require_link = __commonJS({
5199
5199
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-paths.js
5200
5200
  var require_symlink_paths = __commonJS({
5201
5201
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports$1, module) {
5202
- var path20 = __require("path");
5203
- var fs15 = require_fs();
5202
+ var path21 = __require("path");
5203
+ var fs16 = require_fs();
5204
5204
  var { pathExists } = require_path_exists();
5205
5205
  var u3 = require_universalify().fromPromise;
5206
5206
  async function symlinkPaths(srcpath, dstpath) {
5207
- if (path20.isAbsolute(srcpath)) {
5207
+ if (path21.isAbsolute(srcpath)) {
5208
5208
  try {
5209
- await fs15.lstat(srcpath);
5209
+ await fs16.lstat(srcpath);
5210
5210
  } catch (err) {
5211
5211
  err.message = err.message.replace("lstat", "ensureSymlink");
5212
5212
  throw err;
@@ -5216,8 +5216,8 @@ var require_symlink_paths = __commonJS({
5216
5216
  toDst: srcpath
5217
5217
  };
5218
5218
  }
5219
- const dstdir = path20.dirname(dstpath);
5220
- const relativeToDst = path20.join(dstdir, srcpath);
5219
+ const dstdir = path21.dirname(dstpath);
5220
+ const relativeToDst = path21.join(dstdir, srcpath);
5221
5221
  const exists = await pathExists(relativeToDst);
5222
5222
  if (exists) {
5223
5223
  return {
@@ -5226,39 +5226,39 @@ var require_symlink_paths = __commonJS({
5226
5226
  };
5227
5227
  }
5228
5228
  try {
5229
- await fs15.lstat(srcpath);
5229
+ await fs16.lstat(srcpath);
5230
5230
  } catch (err) {
5231
5231
  err.message = err.message.replace("lstat", "ensureSymlink");
5232
5232
  throw err;
5233
5233
  }
5234
5234
  return {
5235
5235
  toCwd: srcpath,
5236
- toDst: path20.relative(dstdir, srcpath)
5236
+ toDst: path21.relative(dstdir, srcpath)
5237
5237
  };
5238
5238
  }
5239
5239
  function symlinkPathsSync(srcpath, dstpath) {
5240
- if (path20.isAbsolute(srcpath)) {
5241
- const exists2 = fs15.existsSync(srcpath);
5240
+ if (path21.isAbsolute(srcpath)) {
5241
+ const exists2 = fs16.existsSync(srcpath);
5242
5242
  if (!exists2) throw new Error("absolute srcpath does not exist");
5243
5243
  return {
5244
5244
  toCwd: srcpath,
5245
5245
  toDst: srcpath
5246
5246
  };
5247
5247
  }
5248
- const dstdir = path20.dirname(dstpath);
5249
- const relativeToDst = path20.join(dstdir, srcpath);
5250
- const exists = fs15.existsSync(relativeToDst);
5248
+ const dstdir = path21.dirname(dstpath);
5249
+ const relativeToDst = path21.join(dstdir, srcpath);
5250
+ const exists = fs16.existsSync(relativeToDst);
5251
5251
  if (exists) {
5252
5252
  return {
5253
5253
  toCwd: relativeToDst,
5254
5254
  toDst: srcpath
5255
5255
  };
5256
5256
  }
5257
- const srcExists = fs15.existsSync(srcpath);
5257
+ const srcExists = fs16.existsSync(srcpath);
5258
5258
  if (!srcExists) throw new Error("relative srcpath does not exist");
5259
5259
  return {
5260
5260
  toCwd: srcpath,
5261
- toDst: path20.relative(dstdir, srcpath)
5261
+ toDst: path21.relative(dstdir, srcpath)
5262
5262
  };
5263
5263
  }
5264
5264
  module.exports = {
@@ -5271,13 +5271,13 @@ var require_symlink_paths = __commonJS({
5271
5271
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-type.js
5272
5272
  var require_symlink_type = __commonJS({
5273
5273
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports$1, module) {
5274
- var fs15 = require_fs();
5274
+ var fs16 = require_fs();
5275
5275
  var u3 = require_universalify().fromPromise;
5276
5276
  async function symlinkType(srcpath, type) {
5277
5277
  if (type) return type;
5278
5278
  let stats;
5279
5279
  try {
5280
- stats = await fs15.lstat(srcpath);
5280
+ stats = await fs16.lstat(srcpath);
5281
5281
  } catch {
5282
5282
  return "file";
5283
5283
  }
@@ -5287,7 +5287,7 @@ var require_symlink_type = __commonJS({
5287
5287
  if (type) return type;
5288
5288
  let stats;
5289
5289
  try {
5290
- stats = fs15.lstatSync(srcpath);
5290
+ stats = fs16.lstatSync(srcpath);
5291
5291
  } catch {
5292
5292
  return "file";
5293
5293
  }
@@ -5304,8 +5304,8 @@ var require_symlink_type = __commonJS({
5304
5304
  var require_symlink = __commonJS({
5305
5305
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink.js"(exports$1, module) {
5306
5306
  var u3 = require_universalify().fromPromise;
5307
- var path20 = __require("path");
5308
- var fs15 = require_fs();
5307
+ var path21 = __require("path");
5308
+ var fs16 = require_fs();
5309
5309
  var { mkdirs, mkdirsSync } = require_mkdirs();
5310
5310
  var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
5311
5311
  var { symlinkType, symlinkTypeSync } = require_symlink_type();
@@ -5314,44 +5314,44 @@ var require_symlink = __commonJS({
5314
5314
  async function createSymlink(srcpath, dstpath, type) {
5315
5315
  let stats;
5316
5316
  try {
5317
- stats = await fs15.lstat(dstpath);
5317
+ stats = await fs16.lstat(dstpath);
5318
5318
  } catch {
5319
5319
  }
5320
5320
  if (stats && stats.isSymbolicLink()) {
5321
5321
  const [srcStat, dstStat] = await Promise.all([
5322
- fs15.stat(srcpath),
5323
- fs15.stat(dstpath)
5322
+ fs16.stat(srcpath),
5323
+ fs16.stat(dstpath)
5324
5324
  ]);
5325
5325
  if (areIdentical(srcStat, dstStat)) return;
5326
5326
  }
5327
5327
  const relative = await symlinkPaths(srcpath, dstpath);
5328
5328
  srcpath = relative.toDst;
5329
5329
  const toType = await symlinkType(relative.toCwd, type);
5330
- const dir = path20.dirname(dstpath);
5330
+ const dir = path21.dirname(dstpath);
5331
5331
  if (!await pathExists(dir)) {
5332
5332
  await mkdirs(dir);
5333
5333
  }
5334
- return fs15.symlink(srcpath, dstpath, toType);
5334
+ return fs16.symlink(srcpath, dstpath, toType);
5335
5335
  }
5336
5336
  function createSymlinkSync(srcpath, dstpath, type) {
5337
5337
  let stats;
5338
5338
  try {
5339
- stats = fs15.lstatSync(dstpath);
5339
+ stats = fs16.lstatSync(dstpath);
5340
5340
  } catch {
5341
5341
  }
5342
5342
  if (stats && stats.isSymbolicLink()) {
5343
- const srcStat = fs15.statSync(srcpath);
5344
- const dstStat = fs15.statSync(dstpath);
5343
+ const srcStat = fs16.statSync(srcpath);
5344
+ const dstStat = fs16.statSync(dstpath);
5345
5345
  if (areIdentical(srcStat, dstStat)) return;
5346
5346
  }
5347
5347
  const relative = symlinkPathsSync(srcpath, dstpath);
5348
5348
  srcpath = relative.toDst;
5349
5349
  type = symlinkTypeSync(relative.toCwd, type);
5350
- const dir = path20.dirname(dstpath);
5351
- const exists = fs15.existsSync(dir);
5352
- if (exists) return fs15.symlinkSync(srcpath, dstpath, type);
5350
+ const dir = path21.dirname(dstpath);
5351
+ const exists = fs16.existsSync(dir);
5352
+ if (exists) return fs16.symlinkSync(srcpath, dstpath, type);
5353
5353
  mkdirsSync(dir);
5354
- return fs15.symlinkSync(srcpath, dstpath, type);
5354
+ return fs16.symlinkSync(srcpath, dstpath, type);
5355
5355
  }
5356
5356
  module.exports = {
5357
5357
  createSymlink: u3(createSymlink),
@@ -5417,9 +5417,9 @@ var require_jsonfile = __commonJS({
5417
5417
  if (typeof options === "string") {
5418
5418
  options = { encoding: options };
5419
5419
  }
5420
- const fs15 = options.fs || _fs;
5420
+ const fs16 = options.fs || _fs;
5421
5421
  const shouldThrow = "throws" in options ? options.throws : true;
5422
- let data = await universalify.fromCallback(fs15.readFile)(file, options);
5422
+ let data = await universalify.fromCallback(fs16.readFile)(file, options);
5423
5423
  data = stripBom(data);
5424
5424
  let obj;
5425
5425
  try {
@@ -5439,10 +5439,10 @@ var require_jsonfile = __commonJS({
5439
5439
  if (typeof options === "string") {
5440
5440
  options = { encoding: options };
5441
5441
  }
5442
- const fs15 = options.fs || _fs;
5442
+ const fs16 = options.fs || _fs;
5443
5443
  const shouldThrow = "throws" in options ? options.throws : true;
5444
5444
  try {
5445
- let content = fs15.readFileSync(file, options);
5445
+ let content = fs16.readFileSync(file, options);
5446
5446
  content = stripBom(content);
5447
5447
  return JSON.parse(content, options.reviver);
5448
5448
  } catch (err) {
@@ -5455,15 +5455,15 @@ var require_jsonfile = __commonJS({
5455
5455
  }
5456
5456
  }
5457
5457
  async function _writeFile(file, obj, options = {}) {
5458
- const fs15 = options.fs || _fs;
5458
+ const fs16 = options.fs || _fs;
5459
5459
  const str = stringify(obj, options);
5460
- await universalify.fromCallback(fs15.writeFile)(file, str, options);
5460
+ await universalify.fromCallback(fs16.writeFile)(file, str, options);
5461
5461
  }
5462
5462
  var writeFile = universalify.fromPromise(_writeFile);
5463
5463
  function writeFileSync3(file, obj, options = {}) {
5464
- const fs15 = options.fs || _fs;
5464
+ const fs16 = options.fs || _fs;
5465
5465
  const str = stringify(obj, options);
5466
- return fs15.writeFileSync(file, str, options);
5466
+ return fs16.writeFileSync(file, str, options);
5467
5467
  }
5468
5468
  module.exports = {
5469
5469
  readFile,
@@ -5492,23 +5492,23 @@ var require_jsonfile2 = __commonJS({
5492
5492
  var require_output_file = __commonJS({
5493
5493
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/output-file/index.js"(exports$1, module) {
5494
5494
  var u3 = require_universalify().fromPromise;
5495
- var fs15 = require_fs();
5496
- var path20 = __require("path");
5495
+ var fs16 = require_fs();
5496
+ var path21 = __require("path");
5497
5497
  var mkdir = require_mkdirs();
5498
5498
  var pathExists = require_path_exists().pathExists;
5499
5499
  async function outputFile(file, data, encoding = "utf-8") {
5500
- const dir = path20.dirname(file);
5500
+ const dir = path21.dirname(file);
5501
5501
  if (!await pathExists(dir)) {
5502
5502
  await mkdir.mkdirs(dir);
5503
5503
  }
5504
- return fs15.writeFile(file, data, encoding);
5504
+ return fs16.writeFile(file, data, encoding);
5505
5505
  }
5506
5506
  function outputFileSync(file, ...args) {
5507
- const dir = path20.dirname(file);
5508
- if (!fs15.existsSync(dir)) {
5507
+ const dir = path21.dirname(file);
5508
+ if (!fs16.existsSync(dir)) {
5509
5509
  mkdir.mkdirsSync(dir);
5510
5510
  }
5511
- fs15.writeFileSync(file, ...args);
5511
+ fs16.writeFileSync(file, ...args);
5512
5512
  }
5513
5513
  module.exports = {
5514
5514
  outputFile: u3(outputFile),
@@ -5563,8 +5563,8 @@ var require_json = __commonJS({
5563
5563
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move.js
5564
5564
  var require_move = __commonJS({
5565
5565
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move.js"(exports$1, module) {
5566
- var fs15 = require_fs();
5567
- var path20 = __require("path");
5566
+ var fs16 = require_fs();
5567
+ var path21 = __require("path");
5568
5568
  var { copy } = require_copy2();
5569
5569
  var { remove } = require_remove();
5570
5570
  var { mkdirp } = require_mkdirs();
@@ -5574,8 +5574,8 @@ var require_move = __commonJS({
5574
5574
  const overwrite = opts.overwrite || opts.clobber || false;
5575
5575
  const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
5576
5576
  await stat.checkParentPaths(src, srcStat, dest, "move");
5577
- const destParent = path20.dirname(dest);
5578
- const parsedParentPath = path20.parse(destParent);
5577
+ const destParent = path21.dirname(dest);
5578
+ const parsedParentPath = path21.parse(destParent);
5579
5579
  if (parsedParentPath.root !== destParent) {
5580
5580
  await mkdirp(destParent);
5581
5581
  }
@@ -5590,7 +5590,7 @@ var require_move = __commonJS({
5590
5590
  }
5591
5591
  }
5592
5592
  try {
5593
- await fs15.rename(src, dest);
5593
+ await fs16.rename(src, dest);
5594
5594
  } catch (err) {
5595
5595
  if (err.code !== "EXDEV") {
5596
5596
  throw err;
@@ -5614,8 +5614,8 @@ var require_move = __commonJS({
5614
5614
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move-sync.js
5615
5615
  var require_move_sync = __commonJS({
5616
5616
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move-sync.js"(exports$1, module) {
5617
- var fs15 = require_graceful_fs();
5618
- var path20 = __require("path");
5617
+ var fs16 = require_graceful_fs();
5618
+ var path21 = __require("path");
5619
5619
  var copySync = require_copy2().copySync;
5620
5620
  var removeSync = require_remove().removeSync;
5621
5621
  var mkdirpSync = require_mkdirs().mkdirpSync;
@@ -5625,12 +5625,12 @@ var require_move_sync = __commonJS({
5625
5625
  const overwrite = opts.overwrite || opts.clobber || false;
5626
5626
  const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
5627
5627
  stat.checkParentPathsSync(src, srcStat, dest, "move");
5628
- if (!isParentRoot(dest)) mkdirpSync(path20.dirname(dest));
5628
+ if (!isParentRoot(dest)) mkdirpSync(path21.dirname(dest));
5629
5629
  return doRename(src, dest, overwrite, isChangingCase);
5630
5630
  }
5631
5631
  function isParentRoot(dest) {
5632
- const parent = path20.dirname(dest);
5633
- const parsedPath = path20.parse(parent);
5632
+ const parent = path21.dirname(dest);
5633
+ const parsedPath = path21.parse(parent);
5634
5634
  return parsedPath.root === parent;
5635
5635
  }
5636
5636
  function doRename(src, dest, overwrite, isChangingCase) {
@@ -5639,12 +5639,12 @@ var require_move_sync = __commonJS({
5639
5639
  removeSync(dest);
5640
5640
  return rename(src, dest, overwrite);
5641
5641
  }
5642
- if (fs15.existsSync(dest)) throw new Error("dest already exists.");
5642
+ if (fs16.existsSync(dest)) throw new Error("dest already exists.");
5643
5643
  return rename(src, dest, overwrite);
5644
5644
  }
5645
5645
  function rename(src, dest, overwrite) {
5646
5646
  try {
5647
- fs15.renameSync(src, dest);
5647
+ fs16.renameSync(src, dest);
5648
5648
  } catch (err) {
5649
5649
  if (err.code !== "EXDEV") throw err;
5650
5650
  return moveAcrossDevice(src, dest, overwrite);
@@ -5771,8 +5771,8 @@ var require_windows = __commonJS({
5771
5771
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports$1, module) {
5772
5772
  module.exports = isexe;
5773
5773
  isexe.sync = sync;
5774
- var fs15 = __require("fs");
5775
- function checkPathExt(path20, options) {
5774
+ var fs16 = __require("fs");
5775
+ function checkPathExt(path21, options) {
5776
5776
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
5777
5777
  if (!pathext) {
5778
5778
  return true;
@@ -5783,25 +5783,25 @@ var require_windows = __commonJS({
5783
5783
  }
5784
5784
  for (var i2 = 0; i2 < pathext.length; i2++) {
5785
5785
  var p2 = pathext[i2].toLowerCase();
5786
- if (p2 && path20.substr(-p2.length).toLowerCase() === p2) {
5786
+ if (p2 && path21.substr(-p2.length).toLowerCase() === p2) {
5787
5787
  return true;
5788
5788
  }
5789
5789
  }
5790
5790
  return false;
5791
5791
  }
5792
- function checkStat(stat, path20, options) {
5792
+ function checkStat(stat, path21, options) {
5793
5793
  if (!stat.isSymbolicLink() && !stat.isFile()) {
5794
5794
  return false;
5795
5795
  }
5796
- return checkPathExt(path20, options);
5796
+ return checkPathExt(path21, options);
5797
5797
  }
5798
- function isexe(path20, options, cb) {
5799
- fs15.stat(path20, function(er2, stat) {
5800
- cb(er2, er2 ? false : checkStat(stat, path20, options));
5798
+ function isexe(path21, options, cb) {
5799
+ fs16.stat(path21, function(er2, stat) {
5800
+ cb(er2, er2 ? false : checkStat(stat, path21, options));
5801
5801
  });
5802
5802
  }
5803
- function sync(path20, options) {
5804
- return checkStat(fs15.statSync(path20), path20, options);
5803
+ function sync(path21, options) {
5804
+ return checkStat(fs16.statSync(path21), path21, options);
5805
5805
  }
5806
5806
  }
5807
5807
  });
@@ -5811,14 +5811,14 @@ var require_mode = __commonJS({
5811
5811
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports$1, module) {
5812
5812
  module.exports = isexe;
5813
5813
  isexe.sync = sync;
5814
- var fs15 = __require("fs");
5815
- function isexe(path20, options, cb) {
5816
- fs15.stat(path20, function(er2, stat) {
5814
+ var fs16 = __require("fs");
5815
+ function isexe(path21, options, cb) {
5816
+ fs16.stat(path21, function(er2, stat) {
5817
5817
  cb(er2, er2 ? false : checkStat(stat, options));
5818
5818
  });
5819
5819
  }
5820
- function sync(path20, options) {
5821
- return checkStat(fs15.statSync(path20), options);
5820
+ function sync(path21, options) {
5821
+ return checkStat(fs16.statSync(path21), options);
5822
5822
  }
5823
5823
  function checkStat(stat, options) {
5824
5824
  return stat.isFile() && checkMode(stat, options);
@@ -5851,7 +5851,7 @@ var require_isexe = __commonJS({
5851
5851
  }
5852
5852
  module.exports = isexe;
5853
5853
  isexe.sync = sync;
5854
- function isexe(path20, options, cb) {
5854
+ function isexe(path21, options, cb) {
5855
5855
  if (typeof options === "function") {
5856
5856
  cb = options;
5857
5857
  options = {};
@@ -5861,7 +5861,7 @@ var require_isexe = __commonJS({
5861
5861
  throw new TypeError("callback not provided");
5862
5862
  }
5863
5863
  return new Promise(function(resolve, reject) {
5864
- isexe(path20, options || {}, function(er2, is2) {
5864
+ isexe(path21, options || {}, function(er2, is2) {
5865
5865
  if (er2) {
5866
5866
  reject(er2);
5867
5867
  } else {
@@ -5870,7 +5870,7 @@ var require_isexe = __commonJS({
5870
5870
  });
5871
5871
  });
5872
5872
  }
5873
- core(path20, options || {}, function(er2, is2) {
5873
+ core(path21, options || {}, function(er2, is2) {
5874
5874
  if (er2) {
5875
5875
  if (er2.code === "EACCES" || options && options.ignoreErrors) {
5876
5876
  er2 = null;
@@ -5880,9 +5880,9 @@ var require_isexe = __commonJS({
5880
5880
  cb(er2, is2);
5881
5881
  });
5882
5882
  }
5883
- function sync(path20, options) {
5883
+ function sync(path21, options) {
5884
5884
  try {
5885
- return core.sync(path20, options || {});
5885
+ return core.sync(path21, options || {});
5886
5886
  } catch (er2) {
5887
5887
  if (options && options.ignoreErrors || er2.code === "EACCES") {
5888
5888
  return false;
@@ -5898,7 +5898,7 @@ var require_isexe = __commonJS({
5898
5898
  var require_which = __commonJS({
5899
5899
  "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports$1, module) {
5900
5900
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
5901
- var path20 = __require("path");
5901
+ var path21 = __require("path");
5902
5902
  var COLON = isWindows ? ";" : ":";
5903
5903
  var isexe = require_isexe();
5904
5904
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -5936,7 +5936,7 @@ var require_which = __commonJS({
5936
5936
  return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
5937
5937
  const ppRaw = pathEnv[i2];
5938
5938
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
5939
- const pCmd = path20.join(pathPart, cmd);
5939
+ const pCmd = path21.join(pathPart, cmd);
5940
5940
  const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
5941
5941
  resolve(subStep(p2, i2, 0));
5942
5942
  });
@@ -5963,7 +5963,7 @@ var require_which = __commonJS({
5963
5963
  for (let i2 = 0; i2 < pathEnv.length; i2++) {
5964
5964
  const ppRaw = pathEnv[i2];
5965
5965
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
5966
- const pCmd = path20.join(pathPart, cmd);
5966
+ const pCmd = path21.join(pathPart, cmd);
5967
5967
  const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
5968
5968
  for (let j3 = 0; j3 < pathExt.length; j3++) {
5969
5969
  const cur = p2 + pathExt[j3];
@@ -6009,7 +6009,7 @@ var require_path_key = __commonJS({
6009
6009
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
6010
6010
  var require_resolveCommand = __commonJS({
6011
6011
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports$1, module) {
6012
- var path20 = __require("path");
6012
+ var path21 = __require("path");
6013
6013
  var which = require_which();
6014
6014
  var getPathKey = require_path_key();
6015
6015
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -6027,7 +6027,7 @@ var require_resolveCommand = __commonJS({
6027
6027
  try {
6028
6028
  resolved = which.sync(parsed.command, {
6029
6029
  path: env2[getPathKey({ env: env2 })],
6030
- pathExt: withoutPathExt ? path20.delimiter : void 0
6030
+ pathExt: withoutPathExt ? path21.delimiter : void 0
6031
6031
  });
6032
6032
  } catch (e) {
6033
6033
  } finally {
@@ -6036,7 +6036,7 @@ var require_resolveCommand = __commonJS({
6036
6036
  }
6037
6037
  }
6038
6038
  if (resolved) {
6039
- resolved = path20.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
6039
+ resolved = path21.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
6040
6040
  }
6041
6041
  return resolved;
6042
6042
  }
@@ -6087,8 +6087,8 @@ var require_shebang_command = __commonJS({
6087
6087
  if (!match) {
6088
6088
  return null;
6089
6089
  }
6090
- const [path20, argument] = match[0].replace(/#! ?/, "").split(" ");
6091
- const binary = path20.split("/").pop();
6090
+ const [path21, argument] = match[0].replace(/#! ?/, "").split(" ");
6091
+ const binary = path21.split("/").pop();
6092
6092
  if (binary === "env") {
6093
6093
  return argument;
6094
6094
  }
@@ -6100,16 +6100,16 @@ var require_shebang_command = __commonJS({
6100
6100
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
6101
6101
  var require_readShebang = __commonJS({
6102
6102
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports$1, module) {
6103
- var fs15 = __require("fs");
6103
+ var fs16 = __require("fs");
6104
6104
  var shebangCommand = require_shebang_command();
6105
6105
  function readShebang(command) {
6106
6106
  const size = 150;
6107
6107
  const buffer = Buffer.alloc(size);
6108
6108
  let fd;
6109
6109
  try {
6110
- fd = fs15.openSync(command, "r");
6111
- fs15.readSync(fd, buffer, 0, size, 0);
6112
- fs15.closeSync(fd);
6110
+ fd = fs16.openSync(command, "r");
6111
+ fs16.readSync(fd, buffer, 0, size, 0);
6112
+ fs16.closeSync(fd);
6113
6113
  } catch (e) {
6114
6114
  }
6115
6115
  return shebangCommand(buffer.toString());
@@ -6121,7 +6121,7 @@ var require_readShebang = __commonJS({
6121
6121
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
6122
6122
  var require_parse2 = __commonJS({
6123
6123
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports$1, module) {
6124
- var path20 = __require("path");
6124
+ var path21 = __require("path");
6125
6125
  var resolveCommand = require_resolveCommand();
6126
6126
  var escape2 = require_escape();
6127
6127
  var readShebang = require_readShebang();
@@ -6146,7 +6146,7 @@ var require_parse2 = __commonJS({
6146
6146
  const needsShell = !isExecutableRegExp.test(commandFile);
6147
6147
  if (parsed.options.forceShell || needsShell) {
6148
6148
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
6149
- parsed.command = path20.normalize(parsed.command);
6149
+ parsed.command = path21.normalize(parsed.command);
6150
6150
  parsed.command = escape2.command(parsed.command);
6151
6151
  parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
6152
6152
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -6259,7 +6259,7 @@ var require_package = __commonJS({
6259
6259
  "package.json"(exports$1, module) {
6260
6260
  module.exports = {
6261
6261
  name: "create-nextly-app",
6262
- version: "0.0.2-alpha.0",
6262
+ version: "0.0.2-alpha.10",
6263
6263
  description: "CLI to scaffold Nextly in your Next.js project",
6264
6264
  license: "MIT",
6265
6265
  type: "module",
@@ -20683,13 +20683,27 @@ var {
20683
20683
  Help
20684
20684
  } = import_index.default;
20685
20685
  function resolveProjectArg(directory) {
20686
- if (!directory || directory === "") {
20686
+ const trimmed = directory?.trim();
20687
+ if (!trimmed) {
20687
20688
  return { projectName: void 0, installInCwd: false };
20688
20689
  }
20689
- if (directory === ".") {
20690
+ if (trimmed === "." || trimmed === "./") {
20690
20691
  return { projectName: void 0, installInCwd: true };
20691
20692
  }
20692
- return { projectName: path__default.default.basename(directory), installInCwd: false };
20693
+ return { projectName: path__default.default.basename(trimmed), installInCwd: false };
20694
+ }
20695
+ function validateProjectName(name) {
20696
+ if (!/^[a-z0-9][a-z0-9._-]*$/.test(name)) {
20697
+ return "Use lowercase letters, numbers, hyphens, dots, or underscores";
20698
+ }
20699
+ return void 0;
20700
+ }
20701
+ function validateProjectNamePromptInput(value) {
20702
+ const trimmed = (value ?? "").trim();
20703
+ if (trimmed === "") return void 0;
20704
+ if (trimmed === "." || trimmed === "./") return void 0;
20705
+ const candidate = trimmed.startsWith("./") ? trimmed.slice(2) : trimmed;
20706
+ return validateProjectName(path__default.default.basename(candidate));
20693
20707
  }
20694
20708
 
20695
20709
  // ../../node_modules/.pnpm/@clack+core@1.1.0/node_modules/@clack/core/dist/index.mjs
@@ -21573,7 +21587,7 @@ ${l}
21573
21587
  } }).prompt();
21574
21588
 
21575
21589
  // src/create-nextly.ts
21576
- var import_fs_extra12 = __toESM(require_lib());
21590
+ var import_fs_extra13 = __toESM(require_lib());
21577
21591
  var import_picocolors3 = __toESM(require_picocolors2());
21578
21592
 
21579
21593
  // src/generators/admin.ts
@@ -21581,9 +21595,6 @@ var import_fs_extra = __toESM(require_lib());
21581
21595
  var ADMIN_PAGE_TEMPLATE = `"use client";
21582
21596
 
21583
21597
  import "@nextlyhq/admin/style.css";
21584
- import "@nextlyhq/plugin-form-builder/admin";
21585
- import "@nextlyhq/plugin-form-builder/styles/builder.css";
21586
- import "@nextlyhq/plugin-form-builder/styles/submissions-filter.css";
21587
21598
  import { RootLayout, QueryProvider, ErrorBoundary } from "@nextlyhq/admin";
21588
21599
 
21589
21600
  export default function AdminPage() {
@@ -26132,13 +26143,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state: state2, verboseInfo, e
26132
26143
  }
26133
26144
  };
26134
26145
  var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
26135
- for (const { path: path20, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
26136
- const pathString = typeof path20 === "string" ? path20 : path20.toString();
26146
+ for (const { path: path21, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
26147
+ const pathString = typeof path21 === "string" ? path21 : path21.toString();
26137
26148
  if (append || outputFiles.has(pathString)) {
26138
- fs.appendFileSync(path20, serializedResult);
26149
+ fs.appendFileSync(path21, serializedResult);
26139
26150
  } else {
26140
26151
  outputFiles.add(pathString);
26141
- fs.writeFileSync(path20, serializedResult);
26152
+ fs.writeFileSync(path21, serializedResult);
26142
26153
  }
26143
26154
  }
26144
26155
  };
@@ -28434,90 +28445,403 @@ createExeca(mapNode);
28434
28445
  createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
28435
28446
  getIpcExport();
28436
28447
 
28437
- // src/installers/dependencies.ts
28438
- var INSTALL_COMMANDS = {
28439
- npm: ["npm", "install"],
28440
- yarn: ["yarn", "add"],
28441
- pnpm: ["pnpm", "add"],
28442
- bun: ["bun", "add"]
28448
+ // src/utils/template.ts
28449
+ var import_fs_extra8 = __toESM(require_lib());
28450
+ var PROJECT_TYPES_WITH_FORM_BUILDER = /* @__PURE__ */ new Set([
28451
+ "blog"
28452
+ ]);
28453
+ function projectUsesFormBuilder(projectType) {
28454
+ return PROJECT_TYPES_WITH_FORM_BUILDER.has(projectType);
28455
+ }
28456
+ var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
28457
+ ".ts",
28458
+ ".tsx",
28459
+ ".js",
28460
+ ".jsx",
28461
+ ".json",
28462
+ ".env",
28463
+ ".md",
28464
+ ".css",
28465
+ ".html",
28466
+ ".mjs",
28467
+ ".cjs"
28468
+ ]);
28469
+ var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
28470
+ function resolveTemplatePath(localTemplatePath) {
28471
+ const __dirname = path__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href))));
28472
+ const fromDist = path__default.default.resolve(__dirname, "../templates");
28473
+ if (import_fs_extra8.default.existsSync(fromDist)) {
28474
+ return fromDist;
28475
+ }
28476
+ const fromSrc = path__default.default.resolve(__dirname, "../../templates");
28477
+ if (import_fs_extra8.default.existsSync(fromSrc)) {
28478
+ return fromSrc;
28479
+ }
28480
+ throw new Error(
28481
+ "Could not find templates directory. Use --local-template to specify the templates path, or ensure templates are bundled."
28482
+ );
28483
+ }
28484
+ function buildPlaceholderMap(options) {
28485
+ const { database, databaseUrl } = options;
28486
+ return {
28487
+ "{{databaseDialect}}": database.type,
28488
+ "{{databaseUrl}}": databaseUrl || database.envExample
28489
+ };
28490
+ }
28491
+ async function replacePlaceholdersInFile(filePath, placeholders) {
28492
+ const ext = path__default.default.extname(filePath).toLowerCase();
28493
+ const basename = path__default.default.basename(filePath);
28494
+ const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
28495
+ if (!isTextFile) return;
28496
+ let content = await import_fs_extra8.default.readFile(filePath, "utf-8");
28497
+ let changed = false;
28498
+ for (const [placeholder, value] of Object.entries(placeholders)) {
28499
+ if (content.includes(placeholder)) {
28500
+ content = content.replaceAll(placeholder, value);
28501
+ changed = true;
28502
+ }
28503
+ }
28504
+ if (changed) {
28505
+ await import_fs_extra8.default.writeFile(filePath, content, "utf-8");
28506
+ }
28507
+ }
28508
+ async function replacePlaceholders(dir, placeholders) {
28509
+ const entries = await import_fs_extra8.default.readdir(dir, { withFileTypes: true });
28510
+ for (const entry of entries) {
28511
+ const fullPath = path__default.default.join(dir, entry.name);
28512
+ if (entry.isDirectory()) {
28513
+ if (entry.name === "node_modules" || entry.name === ".git") continue;
28514
+ await replacePlaceholders(fullPath, placeholders);
28515
+ } else if (entry.isFile()) {
28516
+ await replacePlaceholdersInFile(fullPath, placeholders);
28517
+ }
28518
+ }
28519
+ }
28520
+ var PINNED_VERSIONS = {
28521
+ // Next.js ecosystem — resolved at runtime via fetchLatestVersion()
28522
+ // (see generatePackageJson)
28523
+ react: "^19.1.0",
28524
+ "react-dom": "^19.1.0",
28525
+ // Dev dependencies
28526
+ typescript: "^5",
28527
+ "@types/node": "^20",
28528
+ "@types/react": "^19",
28529
+ "@types/react-dom": "^19",
28530
+ "@tailwindcss/postcss": "^4",
28531
+ tailwindcss: "^4",
28532
+ eslint: "^9"
28443
28533
  };
28444
- var CORE_PACKAGES = [
28534
+ var RUNTIME_RESOLVED_PACKAGES = ["next", "eslint-config-next"];
28535
+ var NEXTLY_PACKAGES = [
28445
28536
  "nextly",
28446
28537
  "@nextlyhq/admin",
28447
28538
  "@nextlyhq/adapter-drizzle",
28448
- "@nextlyhq/ui",
28449
- "@tanstack/react-query"
28450
- ];
28451
- var ALL_ADAPTER_PACKAGES = [
28452
28539
  "@nextlyhq/adapter-postgres",
28453
28540
  "@nextlyhq/adapter-mysql",
28454
28541
  "@nextlyhq/adapter-sqlite"
28455
28542
  ];
28456
- var TEMPLATE_PLUGIN_PACKAGES = [
28457
- "@nextlyhq/plugin-form-builder"
28458
- ];
28459
- function getPackagesToInstall(database) {
28460
- return [...CORE_PACKAGES, database.adapter];
28543
+ var resolvedNextlyVersions = null;
28544
+ async function fetchLatestVersion(pkg2) {
28545
+ try {
28546
+ const res = await fetch(
28547
+ `https://registry.npmjs.org/-/package/${encodeURIComponent(pkg2)}/dist-tags`,
28548
+ { signal: AbortSignal.timeout(5e3) }
28549
+ );
28550
+ if (!res.ok) return "latest";
28551
+ const data = await res.json();
28552
+ return data.latest ? `^${data.latest}` : "latest";
28553
+ } catch {
28554
+ return "latest";
28555
+ }
28461
28556
  }
28462
- async function installDependencies(cwd, projectInfo, database, useYalc = false, isFreshProject = false) {
28463
- const pm = projectInfo.packageManager;
28464
- if (isFreshProject) {
28465
- if (useYalc) {
28466
- const yalcPackages = [
28467
- .../* @__PURE__ */ new Set([
28468
- "nextly",
28469
- "@nextlyhq/admin",
28470
- "@nextlyhq/ui",
28471
- "@nextlyhq/adapter-drizzle",
28472
- ...ALL_ADAPTER_PACKAGES,
28473
- ...TEMPLATE_PLUGIN_PACKAGES
28474
- ])
28475
- ];
28476
- await execa(pm, ["install"], { cwd });
28477
- for (const pkg2 of yalcPackages) {
28478
- await execa("yalc", ["add", pkg2], { cwd });
28479
- }
28480
- await execa(pm, ["install"], { cwd });
28481
- } else {
28482
- await execa(pm, ["install"], { cwd });
28483
- }
28484
- } else {
28485
- const allPackages = getPackagesToInstall(database);
28486
- if (useYalc) {
28487
- const yalcPackages = [
28488
- .../* @__PURE__ */ new Set([
28489
- "nextly",
28490
- "@nextlyhq/admin",
28491
- "@nextlyhq/ui",
28492
- "@nextlyhq/adapter-drizzle",
28493
- ...ALL_ADAPTER_PACKAGES,
28494
- ...TEMPLATE_PLUGIN_PACKAGES
28495
- ])
28496
- ];
28497
- for (const pkg2 of yalcPackages) {
28498
- await execa("yalc", ["add", pkg2], { cwd });
28499
- }
28500
- await execa(pm, ["install"], { cwd });
28501
- } else {
28502
- const [cmd, ...args] = INSTALL_COMMANDS[pm];
28503
- await execa(cmd, [...args, ...allPackages], { cwd });
28557
+ async function resolveNextlyVersions() {
28558
+ if (resolvedNextlyVersions) return resolvedNextlyVersions;
28559
+ const entries = await Promise.all(
28560
+ NEXTLY_PACKAGES.map(
28561
+ async (pkg2) => [pkg2, await fetchLatestVersion(pkg2)]
28562
+ )
28563
+ );
28564
+ resolvedNextlyVersions = Object.fromEntries(entries);
28565
+ return resolvedNextlyVersions;
28566
+ }
28567
+ var resolvedRuntimeVersions = null;
28568
+ async function resolveRuntimeVersions() {
28569
+ if (resolvedRuntimeVersions) return resolvedRuntimeVersions;
28570
+ const FALLBACKS = {
28571
+ next: "^16.1.0",
28572
+ "eslint-config-next": "^16.1.0"
28573
+ };
28574
+ const entries = await Promise.all(
28575
+ RUNTIME_RESOLVED_PACKAGES.map(async (pkg2) => {
28576
+ const version2 = await fetchLatestVersion(pkg2);
28577
+ return [pkg2, version2 === "latest" ? FALLBACKS[pkg2] : version2];
28578
+ })
28579
+ );
28580
+ resolvedRuntimeVersions = Object.fromEntries(entries);
28581
+ return resolvedRuntimeVersions;
28582
+ }
28583
+ async function generatePackageJson(projectName, database, useYalc = false, projectType = "blank") {
28584
+ const runtimeVersions = await resolveRuntimeVersions();
28585
+ const dependencies = {
28586
+ next: runtimeVersions.next,
28587
+ react: PINNED_VERSIONS.react,
28588
+ "react-dom": PINNED_VERSIONS["react-dom"]
28589
+ };
28590
+ dependencies["@tanstack/react-query"] = "^5.62.0";
28591
+ if (!useYalc) {
28592
+ const versions = await resolveNextlyVersions();
28593
+ dependencies["nextly"] = versions["nextly"];
28594
+ dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
28595
+ dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";
28596
+ dependencies["@nextlyhq/adapter-drizzle"] = versions["@nextlyhq/adapter-drizzle"];
28597
+ dependencies[database.adapter] = versions[database.adapter] || "latest";
28598
+ if (projectUsesFormBuilder(projectType)) {
28599
+ dependencies["@nextlyhq/plugin-form-builder"] = versions["@nextlyhq/plugin-form-builder"] || "latest";
28504
28600
  }
28505
28601
  }
28602
+ const devDependencies = {
28603
+ typescript: PINNED_VERSIONS.typescript,
28604
+ "@types/node": PINNED_VERSIONS["@types/node"],
28605
+ "@types/react": PINNED_VERSIONS["@types/react"],
28606
+ "@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
28607
+ "@tailwindcss/postcss": PINNED_VERSIONS["@tailwindcss/postcss"],
28608
+ tailwindcss: PINNED_VERSIONS.tailwindcss,
28609
+ eslint: PINNED_VERSIONS.eslint,
28610
+ "eslint-config-next": runtimeVersions["eslint-config-next"],
28611
+ // Pagefind powers /search in the blog template. Zero-config
28612
+ // static index generated at `next build` time. Templates that
28613
+ // don't ship a /search page simply won't invoke it.
28614
+ pagefind: "^1.1.0"
28615
+ };
28616
+ const pkg2 = {
28617
+ name: projectName,
28618
+ version: "0.1.0",
28619
+ private: true,
28620
+ scripts: {
28621
+ // F1 PR 4: dev now boots Nextly in single-process mode via `next dev`.
28622
+ // The lazy drizzle-kit/api import (PR 1) plus the in-process HMR
28623
+ // listener (PR 2) replaced the wrapper that previously owned the
28624
+ // terminal, schema prompts, and child supervision. `nextly dev` is
28625
+ // gone; the only supported dev command is the standard `next dev`.
28626
+ dev: "next dev --turbopack",
28627
+ // Build: migrate DB + compile Next.js + (if present) generate
28628
+ // the Pagefind search index. Templates without the search
28629
+ // script silently skip the last step.
28630
+ build: "nextly migrate && next build && (test -f scripts/build-search-index.mjs && node scripts/build-search-index.mjs || true)",
28631
+ "search:index": "node scripts/build-search-index.mjs",
28632
+ start: "next start",
28633
+ lint: "next lint",
28634
+ nextly: "nextly",
28635
+ // First-time setup: sync schema + seed system permissions. Demo
28636
+ // content is seeded separately from the admin UI (visit /welcome
28637
+ // after running `pnpm dev` and completing /admin/setup).
28638
+ "db:setup": "nextly db:sync",
28639
+ "db:migrate": "nextly migrate",
28640
+ "db:migrate:status": "nextly migrate:status",
28641
+ "db:migrate:fresh": "nextly migrate:fresh",
28642
+ "db:migrate:reset": "nextly migrate:reset",
28643
+ "types:generate": "nextly generate:types"
28644
+ },
28645
+ dependencies,
28646
+ devDependencies
28647
+ };
28648
+ return JSON.stringify(pkg2, null, 2) + "\n";
28506
28649
  }
28507
-
28508
- // src/lib/download-template.ts
28509
- var import_fs_extra8 = __toESM(require_lib());
28510
- var kr = Object.defineProperty;
28511
- var vr = (s3, t2) => {
28512
- for (var e in t2) kr(s3, e, { get: t2[e], enumerable: true });
28513
- };
28514
- var Os = typeof process == "object" && process ? process : { stdout: null, stderr: null };
28515
- var Br = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof D3 || s3 instanceof Ns__default.default || Pr(s3) || zr(s3));
28516
- var Pr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.pipe == "function" && s3.pipe !== Ns__default.default.Writable.prototype.pipe;
28517
- var zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
28518
- var q3 = Symbol("EOF");
28519
- var j2 = Symbol("maybeEmitEnd");
28520
- var rt2 = Symbol("emittedEnd");
28650
+ async function copyTemplate(options) {
28651
+ const {
28652
+ projectName,
28653
+ projectType,
28654
+ targetDir,
28655
+ database,
28656
+ databaseUrl,
28657
+ useYalc = false,
28658
+ approach,
28659
+ templateSource,
28660
+ allowExistingTarget = false
28661
+ } = options;
28662
+ if (!allowExistingTarget && targetDir !== process.cwd() && await import_fs_extra8.default.pathExists(targetDir)) {
28663
+ throw new Error(
28664
+ `Directory "${path__default.default.basename(targetDir)}" already exists. Please choose a different name.`
28665
+ );
28666
+ }
28667
+ let baseDir;
28668
+ let typeDir;
28669
+ if (templateSource) {
28670
+ baseDir = templateSource.basePath;
28671
+ typeDir = templateSource.templatePath;
28672
+ } else {
28673
+ const templatesRoot = resolveTemplatePath();
28674
+ baseDir = path__default.default.join(templatesRoot, "base");
28675
+ typeDir = path__default.default.join(templatesRoot, projectType);
28676
+ }
28677
+ if (!await import_fs_extra8.default.pathExists(baseDir)) {
28678
+ throw new Error(
28679
+ `Base template not found at ${baseDir}. The package may be corrupted or the download failed.`
28680
+ );
28681
+ }
28682
+ if (!await import_fs_extra8.default.pathExists(typeDir)) {
28683
+ throw new Error(
28684
+ `Template "${projectType}" not found at ${typeDir}. Available templates: blank, blog.`
28685
+ );
28686
+ }
28687
+ await import_fs_extra8.default.copy(baseDir, targetDir, {
28688
+ filter: (_src) => {
28689
+ const basename = path__default.default.basename(_src);
28690
+ return !SKIP_FILES.has(basename);
28691
+ }
28692
+ });
28693
+ const templateSrcDir = path__default.default.join(typeDir, "src");
28694
+ if (await import_fs_extra8.default.pathExists(templateSrcDir)) {
28695
+ await import_fs_extra8.default.copy(templateSrcDir, path__default.default.join(targetDir, "src"), {
28696
+ overwrite: true,
28697
+ filter: (_src) => {
28698
+ const basename = path__default.default.basename(_src);
28699
+ return !SKIP_FILES.has(basename);
28700
+ }
28701
+ });
28702
+ }
28703
+ const templateRootConfig = path__default.default.join(typeDir, "nextly.config.ts");
28704
+ if (await import_fs_extra8.default.pathExists(templateRootConfig)) {
28705
+ await import_fs_extra8.default.copy(
28706
+ templateRootConfig,
28707
+ path__default.default.join(targetDir, "nextly.config.ts"),
28708
+ { overwrite: true }
28709
+ );
28710
+ }
28711
+ const configsDir = path__default.default.join(typeDir, "configs");
28712
+ if (approach && await import_fs_extra8.default.pathExists(configsDir)) {
28713
+ const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
28714
+ const configSrc = path__default.default.join(configsDir, configFileName);
28715
+ if (await import_fs_extra8.default.pathExists(configSrc)) {
28716
+ await import_fs_extra8.default.copy(configSrc, path__default.default.join(targetDir, "nextly.config.ts"), {
28717
+ overwrite: true
28718
+ });
28719
+ }
28720
+ const sharedSrc = path__default.default.join(configsDir, "shared.ts");
28721
+ if (await import_fs_extra8.default.pathExists(sharedSrc)) {
28722
+ await import_fs_extra8.default.copy(sharedSrc, path__default.default.join(targetDir, "shared.ts"), {
28723
+ overwrite: true
28724
+ });
28725
+ }
28726
+ }
28727
+ const frontendPagePath = path__default.default.join(
28728
+ targetDir,
28729
+ "src",
28730
+ "app",
28731
+ "(frontend)",
28732
+ "page.tsx"
28733
+ );
28734
+ const basePagePath = path__default.default.join(targetDir, "src", "app", "page.tsx");
28735
+ if (await import_fs_extra8.default.pathExists(frontendPagePath) && await import_fs_extra8.default.pathExists(basePagePath)) {
28736
+ await import_fs_extra8.default.remove(basePagePath);
28737
+ }
28738
+ const packageJsonContent = await generatePackageJson(
28739
+ projectName,
28740
+ database,
28741
+ useYalc,
28742
+ projectType
28743
+ );
28744
+ await import_fs_extra8.default.writeFile(
28745
+ path__default.default.join(targetDir, "package.json"),
28746
+ packageJsonContent,
28747
+ "utf-8"
28748
+ );
28749
+ if (database.type === "sqlite") {
28750
+ await import_fs_extra8.default.ensureDir(path__default.default.join(targetDir, "data"));
28751
+ }
28752
+ const placeholders = buildPlaceholderMap({ database, databaseUrl });
28753
+ if (approach) {
28754
+ placeholders["{{approach}}"] = approach;
28755
+ }
28756
+ await replacePlaceholders(targetDir, placeholders);
28757
+ }
28758
+
28759
+ // src/installers/dependencies.ts
28760
+ var INSTALL_COMMANDS = {
28761
+ npm: ["npm", "install"],
28762
+ yarn: ["yarn", "add"],
28763
+ pnpm: ["pnpm", "add"],
28764
+ bun: ["bun", "add"]
28765
+ };
28766
+ var CORE_PACKAGES = [
28767
+ "nextly",
28768
+ "@nextlyhq/admin",
28769
+ "@nextlyhq/adapter-drizzle",
28770
+ "@nextlyhq/ui",
28771
+ "@tanstack/react-query"
28772
+ ];
28773
+ var ALL_ADAPTER_PACKAGES = [
28774
+ "@nextlyhq/adapter-postgres",
28775
+ "@nextlyhq/adapter-mysql",
28776
+ "@nextlyhq/adapter-sqlite"
28777
+ ];
28778
+ var TEMPLATE_PLUGIN_PACKAGES = ["@nextlyhq/plugin-form-builder"];
28779
+ function templatePluginPackages(projectType) {
28780
+ return projectType && projectUsesFormBuilder(projectType) ? TEMPLATE_PLUGIN_PACKAGES : [];
28781
+ }
28782
+ function getPackagesToInstall(database) {
28783
+ return [...CORE_PACKAGES, database.adapter];
28784
+ }
28785
+ async function installDependencies(cwd, projectInfo, database, useYalc = false, isFreshProject = false, projectType) {
28786
+ const pm = projectInfo.packageManager;
28787
+ const pluginPackages = templatePluginPackages(projectType);
28788
+ if (isFreshProject) {
28789
+ if (useYalc) {
28790
+ const yalcPackages = [
28791
+ .../* @__PURE__ */ new Set([
28792
+ "nextly",
28793
+ "@nextlyhq/admin",
28794
+ "@nextlyhq/ui",
28795
+ "@nextlyhq/adapter-drizzle",
28796
+ ...ALL_ADAPTER_PACKAGES,
28797
+ ...pluginPackages
28798
+ ])
28799
+ ];
28800
+ await execa(pm, ["install"], { cwd });
28801
+ for (const pkg2 of yalcPackages) {
28802
+ await execa("yalc", ["add", pkg2], { cwd });
28803
+ }
28804
+ await execa(pm, ["install"], { cwd });
28805
+ } else {
28806
+ await execa(pm, ["install"], { cwd });
28807
+ }
28808
+ } else {
28809
+ const allPackages = getPackagesToInstall(database);
28810
+ if (useYalc) {
28811
+ const yalcPackages = [
28812
+ .../* @__PURE__ */ new Set([
28813
+ "nextly",
28814
+ "@nextlyhq/admin",
28815
+ "@nextlyhq/ui",
28816
+ "@nextlyhq/adapter-drizzle",
28817
+ ...ALL_ADAPTER_PACKAGES,
28818
+ ...pluginPackages
28819
+ ])
28820
+ ];
28821
+ for (const pkg2 of yalcPackages) {
28822
+ await execa("yalc", ["add", pkg2], { cwd });
28823
+ }
28824
+ await execa(pm, ["install"], { cwd });
28825
+ } else {
28826
+ const [cmd, ...args] = INSTALL_COMMANDS[pm];
28827
+ await execa(cmd, [...args, ...allPackages], { cwd });
28828
+ }
28829
+ }
28830
+ }
28831
+
28832
+ // src/lib/download-template.ts
28833
+ var import_fs_extra9 = __toESM(require_lib());
28834
+ var kr = Object.defineProperty;
28835
+ var vr = (s3, t2) => {
28836
+ for (var e in t2) kr(s3, e, { get: t2[e], enumerable: true });
28837
+ };
28838
+ var Os = typeof process == "object" && process ? process : { stdout: null, stderr: null };
28839
+ var Br = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof D3 || s3 instanceof Ns__default.default || Pr(s3) || zr(s3));
28840
+ var Pr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.pipe == "function" && s3.pipe !== Ns__default.default.Writable.prototype.pipe;
28841
+ var zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
28842
+ var q3 = Symbol("EOF");
28843
+ var j2 = Symbol("maybeEmitEnd");
28844
+ var rt2 = Symbol("emittedEnd");
28521
28845
  var Le2 = Symbol("emittingEnd");
28522
28846
  var jt2 = Symbol("emittedError");
28523
28847
  var Ne2 = Symbol("closed");
@@ -30582,7 +30906,7 @@ var Vn = 512 * 1024;
30582
30906
  var $n = pr | ur | dr | mr;
30583
30907
  var lr = !fr && typeof ar == "number" ? ar | ur | dr | mr : null;
30584
30908
  var cs = lr !== null ? () => lr : Kn ? (s3) => s3 < Vn ? $n : "w" : () => "w";
30585
- var fs9 = (s3, t2, e) => {
30909
+ var fs10 = (s3, t2, e) => {
30586
30910
  try {
30587
30911
  return fs__default.default.lchownSync(s3, t2, e);
30588
30912
  } catch (i2) {
@@ -30622,7 +30946,7 @@ var ds = (s3, t2, e, i2) => {
30622
30946
  });
30623
30947
  };
30624
30948
  var qn = (s3, t2, e, i2) => {
30625
- t2.isDirectory() && us(path__default.default.resolve(s3, t2.name), e, i2), fs9(path__default.default.resolve(s3, t2.name), e, i2);
30949
+ t2.isDirectory() && us(path__default.default.resolve(s3, t2.name), e, i2), fs10(path__default.default.resolve(s3, t2.name), e, i2);
30626
30950
  };
30627
30951
  var us = (s3, t2, e) => {
30628
30952
  let i2;
@@ -30631,11 +30955,11 @@ var us = (s3, t2, e) => {
30631
30955
  } catch (r) {
30632
30956
  let n2 = r;
30633
30957
  if (n2?.code === "ENOENT") return;
30634
- if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return fs9(s3, t2, e);
30958
+ if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return fs10(s3, t2, e);
30635
30959
  throw n2;
30636
30960
  }
30637
30961
  for (let r of i2) qn(s3, r, t2, e);
30638
- return fs9(s3, t2, e);
30962
+ return fs10(s3, t2, e);
30639
30963
  };
30640
30964
  var we2 = class extends Error {
30641
30965
  path;
@@ -31380,7 +31704,7 @@ async function downloadTemplate(templateName, branch = "main") {
31380
31704
  process.env.TMPDIR || "/tmp",
31381
31705
  `nextly-template-${Date.now()}`
31382
31706
  );
31383
- await import_fs_extra8.default.ensureDir(tmpDir);
31707
+ await import_fs_extra9.default.ensureDir(tmpDir);
31384
31708
  const repoPrefix = `${GITHUB_REPO}-${branch}`;
31385
31709
  const baseFilter = `${repoPrefix}/templates/base/`;
31386
31710
  const templateFilter = `${repoPrefix}/templates/${templateName}/`;
@@ -31409,7 +31733,7 @@ async function downloadTemplate(templateName, branch = "main") {
31409
31733
  })
31410
31734
  );
31411
31735
  } catch (error) {
31412
- await import_fs_extra8.default.remove(tmpDir).catch(() => {
31736
+ await import_fs_extra9.default.remove(tmpDir).catch(() => {
31413
31737
  });
31414
31738
  if (error instanceof Error && error.name === "TimeoutError") {
31415
31739
  throw new Error(
@@ -31420,15 +31744,15 @@ async function downloadTemplate(templateName, branch = "main") {
31420
31744
  }
31421
31745
  const basePath = path__default.default.join(tmpDir, "templates", "base");
31422
31746
  const templatePath = path__default.default.join(tmpDir, "templates", templateName);
31423
- if (!await import_fs_extra8.default.pathExists(basePath)) {
31424
- await import_fs_extra8.default.remove(tmpDir).catch(() => {
31747
+ if (!await import_fs_extra9.default.pathExists(basePath)) {
31748
+ await import_fs_extra9.default.remove(tmpDir).catch(() => {
31425
31749
  });
31426
31750
  throw new Error(
31427
31751
  `Base template not found in downloaded archive. The branch "${branch}" may not contain templates.`
31428
31752
  );
31429
31753
  }
31430
- if (!await import_fs_extra8.default.pathExists(templatePath)) {
31431
- await import_fs_extra8.default.remove(tmpDir).catch(() => {
31754
+ if (!await import_fs_extra9.default.pathExists(templatePath)) {
31755
+ await import_fs_extra9.default.remove(tmpDir).catch(() => {
31432
31756
  });
31433
31757
  throw new Error(
31434
31758
  `Template "${templateName}" not found in downloaded archive. Available templates may differ on branch "${branch}".`
@@ -31439,12 +31763,12 @@ async function downloadTemplate(templateName, branch = "main") {
31439
31763
  async function resolveLocalTemplate(localPath, templateName) {
31440
31764
  const basePath = path__default.default.join(localPath, "base");
31441
31765
  const templatePath = path__default.default.join(localPath, templateName);
31442
- if (!await import_fs_extra8.default.pathExists(basePath)) {
31766
+ if (!await import_fs_extra9.default.pathExists(basePath)) {
31443
31767
  throw new Error(
31444
31768
  `Base template not found at ${basePath}. Check the --local-template path points to the templates/ directory.`
31445
31769
  );
31446
31770
  }
31447
- if (!await import_fs_extra8.default.pathExists(templatePath)) {
31771
+ if (!await import_fs_extra9.default.pathExists(templatePath)) {
31448
31772
  throw new Error(
31449
31773
  `Template "${templateName}" not found at ${templatePath}. Check the --local-template path points to the templates/ directory.`
31450
31774
  );
@@ -31462,7 +31786,7 @@ async function cleanupDownload(source) {
31462
31786
  const tmpBase = process.env.TMPDIR || "/tmp";
31463
31787
  if (source.basePath.startsWith(tmpBase)) {
31464
31788
  const extractionRoot = path__default.default.resolve(source.basePath, "../..");
31465
- await import_fs_extra8.default.remove(extractionRoot).catch(() => {
31789
+ await import_fs_extra9.default.remove(extractionRoot).catch(() => {
31466
31790
  });
31467
31791
  }
31468
31792
  }
@@ -31564,14 +31888,12 @@ var DATABASE_LABELS = {
31564
31888
  hint: "Popular alternative for production"
31565
31889
  }
31566
31890
  };
31567
-
31568
- // src/prompts/project-name.ts
31569
- var import_fs_extra9 = __toESM(require_lib());
31891
+ var import_fs_extra10 = __toESM(require_lib());
31570
31892
  async function isExistingNextProject(cwd) {
31571
31893
  const packageJsonPath = path__default.default.join(cwd, "package.json");
31572
- if (!await import_fs_extra9.default.pathExists(packageJsonPath)) return false;
31894
+ if (!await import_fs_extra10.default.pathExists(packageJsonPath)) return false;
31573
31895
  try {
31574
- const packageJson = await import_fs_extra9.default.readJson(packageJsonPath);
31896
+ const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
31575
31897
  const deps = {
31576
31898
  ...packageJson.dependencies,
31577
31899
  ...packageJson.devDependencies
@@ -31581,6 +31903,42 @@ async function isExistingNextProject(cwd) {
31581
31903
  return false;
31582
31904
  }
31583
31905
  }
31906
+ var DEFAULT_PROJECT_NAME = "my-nextly-app";
31907
+ async function promptForProjectName() {
31908
+ const answer = await Zt({
31909
+ message: "What should your project be called?",
31910
+ // `initialValue` pre-fills the buffer so Enter accepts the default.
31911
+ // The previous version used `placeholder` alone, which returned an
31912
+ // empty string on Enter and silently fell through to a cwd install —
31913
+ // the root cause of the original bug. `placeholder` is omitted here
31914
+ // because clack only shows it when the buffer is empty, and the
31915
+ // initialValue keeps it populated.
31916
+ initialValue: DEFAULT_PROJECT_NAME,
31917
+ validate: validateProjectNamePromptInput
31918
+ });
31919
+ if (Ct(answer)) {
31920
+ return { kind: "cancelled" };
31921
+ }
31922
+ return { kind: "resolved", value: resolveProjectArg(answer) };
31923
+ }
31924
+ async function promptDirectoryConflict(targetLabel) {
31925
+ const choice = await Jt({
31926
+ message: `Target directory ${targetLabel} is not empty. How would you like to proceed?`,
31927
+ options: [
31928
+ { value: "cancel", label: "Cancel operation" },
31929
+ {
31930
+ value: "remove",
31931
+ label: "Remove existing files and continue"
31932
+ },
31933
+ {
31934
+ value: "ignore",
31935
+ label: "Ignore files and continue"
31936
+ }
31937
+ ]
31938
+ });
31939
+ if (Ct(choice)) return "cancel";
31940
+ return choice;
31941
+ }
31584
31942
 
31585
31943
  // src/prompts/template.ts
31586
31944
  var import_picocolors2 = __toESM(require_picocolors2());
@@ -31608,7 +31966,7 @@ function isValidTemplateSelection(value) {
31608
31966
  }
31609
31967
 
31610
31968
  // src/utils/detect.ts
31611
- var import_fs_extra10 = __toESM(require_lib());
31969
+ var import_fs_extra11 = __toESM(require_lib());
31612
31970
 
31613
31971
  // src/utils/detect-pm-from-user-agent.ts
31614
31972
  function detectPmFromUserAgent(userAgent) {
@@ -31624,19 +31982,19 @@ function detectPmFromUserAgent(userAgent) {
31624
31982
  async function detectPackageManager2(cwd) {
31625
31983
  const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
31626
31984
  if (fromUa) return fromUa;
31627
- if (await import_fs_extra10.default.pathExists(path__default.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
31628
- if (await import_fs_extra10.default.pathExists(path__default.default.join(cwd, "yarn.lock"))) return "yarn";
31629
- if (await import_fs_extra10.default.pathExists(path__default.default.join(cwd, "bun.lockb"))) return "bun";
31985
+ if (await import_fs_extra11.default.pathExists(path__default.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
31986
+ if (await import_fs_extra11.default.pathExists(path__default.default.join(cwd, "yarn.lock"))) return "yarn";
31987
+ if (await import_fs_extra11.default.pathExists(path__default.default.join(cwd, "bun.lockb"))) return "bun";
31630
31988
  return "npm";
31631
31989
  }
31632
31990
  async function detectProject(cwd) {
31633
31991
  const packageJsonPath = path__default.default.join(cwd, "package.json");
31634
- if (!await import_fs_extra10.default.pathExists(packageJsonPath)) {
31992
+ if (!await import_fs_extra11.default.pathExists(packageJsonPath)) {
31635
31993
  throw new Error(
31636
31994
  "No package.json found. Please run this command in a Next.js project."
31637
31995
  );
31638
31996
  }
31639
- const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
31997
+ const packageJson = await import_fs_extra11.default.readJson(packageJsonPath);
31640
31998
  const deps = {
31641
31999
  ...packageJson.dependencies,
31642
32000
  ...packageJson.devDependencies
@@ -31648,11 +32006,11 @@ async function detectProject(cwd) {
31648
32006
  );
31649
32007
  }
31650
32008
  const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
31651
- const srcDir = await import_fs_extra10.default.pathExists(path__default.default.join(cwd, "src"));
32009
+ const srcDir = await import_fs_extra11.default.pathExists(path__default.default.join(cwd, "src"));
31652
32010
  const appDirPaths = srcDir ? [path__default.default.join(cwd, "src", "app")] : [path__default.default.join(cwd, "app")];
31653
32011
  let isAppRouter = false;
31654
32012
  for (const appPath of appDirPaths) {
31655
- if (await import_fs_extra10.default.pathExists(appPath)) {
32013
+ if (await import_fs_extra11.default.pathExists(appPath)) {
31656
32014
  isAppRouter = true;
31657
32015
  break;
31658
32016
  }
@@ -31662,7 +32020,7 @@ async function detectProject(cwd) {
31662
32020
  "App Router not detected. Nextly requires Next.js App Router (app/ directory)."
31663
32021
  );
31664
32022
  }
31665
- const hasTypescript = await import_fs_extra10.default.pathExists(path__default.default.join(cwd, "tsconfig.json"));
32023
+ const hasTypescript = await import_fs_extra11.default.pathExists(path__default.default.join(cwd, "tsconfig.json"));
31666
32024
  const packageManager = await detectPackageManager2(cwd);
31667
32025
  const appDir = srcDir ? "src/app" : "app";
31668
32026
  return {
@@ -31676,315 +32034,36 @@ async function detectProject(cwd) {
31676
32034
  };
31677
32035
  }
31678
32036
 
31679
- // src/utils/template.ts
31680
- var import_fs_extra11 = __toESM(require_lib());
31681
- var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
31682
- ".ts",
31683
- ".tsx",
31684
- ".js",
31685
- ".jsx",
31686
- ".json",
31687
- ".env",
31688
- ".md",
31689
- ".css",
31690
- ".html",
31691
- ".mjs",
31692
- ".cjs"
31693
- ]);
31694
- var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
31695
- function resolveTemplatePath(localTemplatePath) {
31696
- const __dirname = path__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href))));
31697
- const fromDist = path__default.default.resolve(__dirname, "../templates");
31698
- if (import_fs_extra11.default.existsSync(fromDist)) {
31699
- return fromDist;
31700
- }
31701
- const fromSrc = path__default.default.resolve(__dirname, "../../templates");
31702
- if (import_fs_extra11.default.existsSync(fromSrc)) {
31703
- return fromSrc;
31704
- }
31705
- throw new Error(
31706
- "Could not find templates directory. Use --local-template to specify the templates path, or ensure templates are bundled."
31707
- );
31708
- }
31709
- function buildPlaceholderMap(options) {
31710
- const { database, databaseUrl } = options;
31711
- return {
31712
- "{{databaseDialect}}": database.type,
31713
- "{{databaseUrl}}": databaseUrl || database.envExample
31714
- };
31715
- }
31716
- async function replacePlaceholdersInFile(filePath, placeholders) {
31717
- const ext = path__default.default.extname(filePath).toLowerCase();
31718
- const basename = path__default.default.basename(filePath);
31719
- const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
31720
- if (!isTextFile) return;
31721
- let content = await import_fs_extra11.default.readFile(filePath, "utf-8");
31722
- let changed = false;
31723
- for (const [placeholder, value] of Object.entries(placeholders)) {
31724
- if (content.includes(placeholder)) {
31725
- content = content.replaceAll(placeholder, value);
31726
- changed = true;
31727
- }
31728
- }
31729
- if (changed) {
31730
- await import_fs_extra11.default.writeFile(filePath, content, "utf-8");
31731
- }
31732
- }
31733
- async function replacePlaceholders(dir, placeholders) {
31734
- const entries = await import_fs_extra11.default.readdir(dir, { withFileTypes: true });
31735
- for (const entry of entries) {
31736
- const fullPath = path__default.default.join(dir, entry.name);
31737
- if (entry.isDirectory()) {
31738
- if (entry.name === "node_modules" || entry.name === ".git") continue;
31739
- await replacePlaceholders(fullPath, placeholders);
31740
- } else if (entry.isFile()) {
31741
- await replacePlaceholdersInFile(fullPath, placeholders);
31742
- }
31743
- }
31744
- }
31745
- var PINNED_VERSIONS = {
31746
- // Next.js ecosystem — resolved at runtime via fetchLatestVersion()
31747
- // (see generatePackageJson)
31748
- react: "^19.1.0",
31749
- "react-dom": "^19.1.0",
31750
- // Dev dependencies
31751
- typescript: "^5",
31752
- "@types/node": "^20",
31753
- "@types/react": "^19",
31754
- "@types/react-dom": "^19",
31755
- "@tailwindcss/postcss": "^4",
31756
- tailwindcss: "^4",
31757
- eslint: "^9"
31758
- };
31759
- var RUNTIME_RESOLVED_PACKAGES = ["next", "eslint-config-next"];
31760
- var NEXTLY_PACKAGES = [
31761
- "nextly",
31762
- "@nextlyhq/admin",
31763
- "@nextlyhq/adapter-drizzle",
31764
- "@nextlyhq/adapter-postgres",
31765
- "@nextlyhq/adapter-mysql",
31766
- "@nextlyhq/adapter-sqlite"
31767
- ];
31768
- var resolvedNextlyVersions = null;
31769
- async function fetchLatestVersion(pkg2) {
31770
- try {
31771
- const res = await fetch(
31772
- `https://registry.npmjs.org/-/package/${encodeURIComponent(pkg2)}/dist-tags`,
31773
- { signal: AbortSignal.timeout(5e3) }
31774
- );
31775
- if (!res.ok) return "latest";
31776
- const data = await res.json();
31777
- return data.latest ? `^${data.latest}` : "latest";
31778
- } catch {
31779
- return "latest";
31780
- }
31781
- }
31782
- async function resolveNextlyVersions() {
31783
- if (resolvedNextlyVersions) return resolvedNextlyVersions;
31784
- const entries = await Promise.all(
31785
- NEXTLY_PACKAGES.map(
31786
- async (pkg2) => [pkg2, await fetchLatestVersion(pkg2)]
31787
- )
31788
- );
31789
- resolvedNextlyVersions = Object.fromEntries(entries);
31790
- return resolvedNextlyVersions;
31791
- }
31792
- var resolvedRuntimeVersions = null;
31793
- async function resolveRuntimeVersions() {
31794
- if (resolvedRuntimeVersions) return resolvedRuntimeVersions;
31795
- const FALLBACKS = {
31796
- next: "^16.1.0",
31797
- "eslint-config-next": "^16.1.0"
31798
- };
31799
- const entries = await Promise.all(
31800
- RUNTIME_RESOLVED_PACKAGES.map(async (pkg2) => {
31801
- const version2 = await fetchLatestVersion(pkg2);
31802
- return [pkg2, version2 === "latest" ? FALLBACKS[pkg2] : version2];
31803
- })
31804
- );
31805
- resolvedRuntimeVersions = Object.fromEntries(entries);
31806
- return resolvedRuntimeVersions;
31807
- }
31808
- async function generatePackageJson(projectName, database, useYalc = false) {
31809
- const runtimeVersions = await resolveRuntimeVersions();
31810
- const dependencies = {
31811
- next: runtimeVersions.next,
31812
- react: PINNED_VERSIONS.react,
31813
- "react-dom": PINNED_VERSIONS["react-dom"]
31814
- };
31815
- dependencies["@tanstack/react-query"] = "^5.62.0";
31816
- if (!useYalc) {
31817
- const versions = await resolveNextlyVersions();
31818
- dependencies["nextly"] = versions["nextly"];
31819
- dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
31820
- dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";
31821
- dependencies["@nextlyhq/adapter-drizzle"] = versions["@nextlyhq/adapter-drizzle"];
31822
- dependencies[database.adapter] = versions[database.adapter] || "latest";
31823
- dependencies["@nextlyhq/plugin-form-builder"] = versions["@nextlyhq/plugin-form-builder"] || "latest";
31824
- }
31825
- const devDependencies = {
31826
- typescript: PINNED_VERSIONS.typescript,
31827
- "@types/node": PINNED_VERSIONS["@types/node"],
31828
- "@types/react": PINNED_VERSIONS["@types/react"],
31829
- "@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
31830
- "@tailwindcss/postcss": PINNED_VERSIONS["@tailwindcss/postcss"],
31831
- tailwindcss: PINNED_VERSIONS.tailwindcss,
31832
- eslint: PINNED_VERSIONS.eslint,
31833
- "eslint-config-next": runtimeVersions["eslint-config-next"],
31834
- // Pagefind powers /search in the blog template. Zero-config
31835
- // static index generated at `next build` time. Templates that
31836
- // don't ship a /search page simply won't invoke it.
31837
- pagefind: "^1.1.0"
31838
- };
31839
- const pkg2 = {
31840
- name: projectName,
31841
- version: "0.1.0",
31842
- private: true,
31843
- scripts: {
31844
- // F1 PR 4: dev now boots Nextly in single-process mode via `next dev`.
31845
- // The lazy drizzle-kit/api import (PR 1) plus the in-process HMR
31846
- // listener (PR 2) replaced the wrapper that previously owned the
31847
- // terminal, schema prompts, and child supervision. `nextly dev` is
31848
- // gone; the only supported dev command is the standard `next dev`.
31849
- dev: "next dev --turbopack",
31850
- // Build: migrate DB + compile Next.js + (if present) generate
31851
- // the Pagefind search index. Templates without the search
31852
- // script silently skip the last step.
31853
- build: "nextly migrate && next build && (test -f scripts/build-search-index.mjs && node scripts/build-search-index.mjs || true)",
31854
- "search:index": "node scripts/build-search-index.mjs",
31855
- start: "next start",
31856
- lint: "next lint",
31857
- nextly: "nextly",
31858
- // First-time setup: sync schema + seed system permissions. Demo
31859
- // content is seeded separately from the admin UI (visit /welcome
31860
- // after running `pnpm dev` and completing /admin/setup).
31861
- "db:setup": "nextly db:sync",
31862
- "db:migrate": "nextly migrate",
31863
- "db:migrate:status": "nextly migrate:status",
31864
- "db:migrate:fresh": "nextly migrate:fresh",
31865
- "db:migrate:reset": "nextly migrate:reset",
31866
- "types:generate": "nextly generate:types"
31867
- },
31868
- dependencies,
31869
- devDependencies
31870
- };
31871
- return JSON.stringify(pkg2, null, 2) + "\n";
32037
+ // src/utils/fs.ts
32038
+ var import_fs_extra12 = __toESM(require_lib());
32039
+ async function isDirectoryNotEmpty(dir) {
32040
+ if (!await import_fs_extra12.default.pathExists(dir)) return false;
32041
+ const entries = await import_fs_extra12.default.readdir(dir);
32042
+ return entries.some((entry) => entry !== ".git");
31872
32043
  }
31873
- async function copyTemplate(options) {
31874
- const {
31875
- projectName,
31876
- projectType,
31877
- targetDir,
31878
- database,
31879
- databaseUrl,
31880
- useYalc = false,
31881
- approach,
31882
- templateSource
31883
- } = options;
31884
- if (targetDir !== process.cwd() && await import_fs_extra11.default.pathExists(targetDir)) {
31885
- throw new Error(
31886
- `Directory "${path__default.default.basename(targetDir)}" already exists. Please choose a different name.`
31887
- );
31888
- }
31889
- let baseDir;
31890
- let typeDir;
31891
- if (templateSource) {
31892
- baseDir = templateSource.basePath;
31893
- typeDir = templateSource.templatePath;
31894
- } else {
31895
- const templatesRoot = resolveTemplatePath();
31896
- baseDir = path__default.default.join(templatesRoot, "base");
31897
- typeDir = path__default.default.join(templatesRoot, projectType);
31898
- }
31899
- if (!await import_fs_extra11.default.pathExists(baseDir)) {
31900
- throw new Error(
31901
- `Base template not found at ${baseDir}. The package may be corrupted or the download failed.`
31902
- );
31903
- }
31904
- if (!await import_fs_extra11.default.pathExists(typeDir)) {
31905
- throw new Error(
31906
- `Template "${projectType}" not found at ${typeDir}. Available templates: blank, blog.`
31907
- );
31908
- }
31909
- await import_fs_extra11.default.copy(baseDir, targetDir, {
31910
- filter: (_src) => {
31911
- const basename = path__default.default.basename(_src);
31912
- return !SKIP_FILES.has(basename);
31913
- }
31914
- });
31915
- const templateSrcDir = path__default.default.join(typeDir, "src");
31916
- if (await import_fs_extra11.default.pathExists(templateSrcDir)) {
31917
- await import_fs_extra11.default.copy(templateSrcDir, path__default.default.join(targetDir, "src"), {
31918
- overwrite: true,
31919
- filter: (_src) => {
31920
- const basename = path__default.default.basename(_src);
31921
- return !SKIP_FILES.has(basename);
31922
- }
31923
- });
31924
- }
31925
- const templateRootConfig = path__default.default.join(typeDir, "nextly.config.ts");
31926
- if (await import_fs_extra11.default.pathExists(templateRootConfig)) {
31927
- await import_fs_extra11.default.copy(
31928
- templateRootConfig,
31929
- path__default.default.join(targetDir, "nextly.config.ts"),
31930
- { overwrite: true }
31931
- );
31932
- }
31933
- const configsDir = path__default.default.join(typeDir, "configs");
31934
- if (approach && await import_fs_extra11.default.pathExists(configsDir)) {
31935
- const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
31936
- const configSrc = path__default.default.join(configsDir, configFileName);
31937
- if (await import_fs_extra11.default.pathExists(configSrc)) {
31938
- await import_fs_extra11.default.copy(configSrc, path__default.default.join(targetDir, "nextly.config.ts"), {
31939
- overwrite: true
31940
- });
31941
- }
31942
- const sharedSrc = path__default.default.join(configsDir, "shared.ts");
31943
- if (await import_fs_extra11.default.pathExists(sharedSrc)) {
31944
- await import_fs_extra11.default.copy(sharedSrc, path__default.default.join(targetDir, "shared.ts"), {
31945
- overwrite: true
31946
- });
31947
- }
31948
- }
31949
- const frontendPagePath = path__default.default.join(
31950
- targetDir,
31951
- "src",
31952
- "app",
31953
- "(frontend)",
31954
- "page.tsx"
31955
- );
31956
- const basePagePath = path__default.default.join(targetDir, "src", "app", "page.tsx");
31957
- if (await import_fs_extra11.default.pathExists(frontendPagePath) && await import_fs_extra11.default.pathExists(basePagePath)) {
31958
- await import_fs_extra11.default.remove(basePagePath);
31959
- }
31960
- const packageJsonContent = await generatePackageJson(
31961
- projectName,
31962
- database,
31963
- useYalc
31964
- );
31965
- await import_fs_extra11.default.writeFile(
31966
- path__default.default.join(targetDir, "package.json"),
31967
- packageJsonContent,
31968
- "utf-8"
31969
- );
31970
- if (database.type === "sqlite") {
31971
- await import_fs_extra11.default.ensureDir(path__default.default.join(targetDir, "data"));
31972
- }
31973
- const placeholders = buildPlaceholderMap({ database, databaseUrl });
31974
- if (approach) {
31975
- placeholders["{{approach}}"] = approach;
32044
+ async function emptyDirectory(dir) {
32045
+ if (!await import_fs_extra12.default.pathExists(dir)) return;
32046
+ for (const entry of await import_fs_extra12.default.readdir(dir)) {
32047
+ if (entry === ".git") continue;
32048
+ await import_fs_extra12.default.remove(path__default.default.join(dir, entry));
31976
32049
  }
31977
- await replacePlaceholders(targetDir, placeholders);
31978
32050
  }
31979
32051
 
31980
32052
  // src/create-nextly.ts
32053
+ function cwdProjectName(cwd) {
32054
+ const basename = path__default.default.basename(cwd);
32055
+ if (!/^[a-z0-9][a-z0-9._-]*$/.test(basename)) {
32056
+ return DEFAULT_PROJECT_NAME;
32057
+ }
32058
+ return basename;
32059
+ }
31981
32060
  async function createNextly(options = {}) {
31982
32061
  const {
31983
32062
  defaults = false,
31984
32063
  skipInstall = false,
31985
- useYalc = false,
31986
- installInCwd = false
32064
+ useYalc = false
31987
32065
  } = options;
32066
+ let installInCwd = options.installInCwd ?? false;
31988
32067
  let { cwd = process.cwd() } = options;
31989
32068
  let isFreshProject = false;
31990
32069
  let projectName;
@@ -32006,33 +32085,44 @@ async function createNextly(options = {}) {
32006
32085
  }
32007
32086
  }
32008
32087
  } else if (installInCwd) {
32009
- projectName = path__default.default.basename(cwd);
32088
+ projectName = cwdProjectName(cwd);
32010
32089
  isFreshProject = true;
32011
32090
  } else {
32012
32091
  if (options.projectNameFromArg) {
32013
32092
  projectName = options.projectNameFromArg;
32014
32093
  } else if (!defaults) {
32015
- const name = await Zt({
32016
- message: "What should your project be called?",
32017
- placeholder: "my-nextly-app",
32018
- defaultValue: "my-nextly-app",
32019
- validate: (value) => {
32020
- if (!value || !value.trim()) return void 0;
32021
- if (!/^[a-z0-9][a-z0-9._-]*$/.test(value)) {
32022
- return "Use lowercase letters, numbers, hyphens, dots, or underscores";
32023
- }
32024
- }
32025
- });
32026
- if (Ct(name)) {
32094
+ const result = await promptForProjectName();
32095
+ if (result.kind === "cancelled") {
32027
32096
  Nt("Cancelled.");
32028
32097
  return;
32029
32098
  }
32030
- projectName = name;
32099
+ if (result.value.installInCwd) {
32100
+ installInCwd = true;
32101
+ projectName = cwdProjectName(cwd);
32102
+ } else {
32103
+ projectName = result.value.projectName ?? DEFAULT_PROJECT_NAME;
32104
+ }
32031
32105
  } else {
32032
- projectName = "my-nextly-app";
32106
+ projectName = DEFAULT_PROJECT_NAME;
32033
32107
  }
32034
32108
  isFreshProject = true;
32035
32109
  }
32110
+ let allowExistingTarget = false;
32111
+ if (isFreshProject && projectName) {
32112
+ const conflictTargetDir = installInCwd ? cwd : path__default.default.join(cwd, projectName);
32113
+ if (await isDirectoryNotEmpty(conflictTargetDir)) {
32114
+ const targetLabel = installInCwd ? "the current directory" : `"${projectName}"`;
32115
+ const choice = await promptDirectoryConflict(targetLabel);
32116
+ if (choice === "cancel") {
32117
+ Nt("Cancelled. No changes were made.");
32118
+ return;
32119
+ }
32120
+ allowExistingTarget = true;
32121
+ if (choice === "remove") {
32122
+ await emptyDirectory(conflictTargetDir);
32123
+ }
32124
+ }
32125
+ }
32036
32126
  let projectType;
32037
32127
  if (options.projectType) {
32038
32128
  projectType = options.projectType;
@@ -32129,6 +32219,7 @@ async function createNextly(options = {}) {
32129
32219
  databaseUrl = url?.trim() || database.connectionUrl;
32130
32220
  }
32131
32221
  if (isFreshProject && projectName) {
32222
+ const targetDir = installInCwd ? cwd : path__default.default.join(cwd, projectName);
32132
32223
  const s3 = be();
32133
32224
  let templateSource;
32134
32225
  try {
@@ -32143,47 +32234,29 @@ async function createNextly(options = {}) {
32143
32234
  } else {
32144
32235
  s3.start("Scaffolding project...");
32145
32236
  }
32146
- const targetDir = installInCwd ? cwd : path__default.default.join(cwd, projectName);
32147
- if (installInCwd) {
32148
- const entries = await import_fs_extra12.default.readdir(cwd);
32149
- const nonHidden = entries.filter((e) => !e.startsWith("."));
32150
- if (nonHidden.length > 0) {
32151
- s3.stop("Directory not empty");
32152
- Nt(
32153
- "Directory is not empty. Remove existing files or use a project name to create a subdirectory."
32154
- );
32155
- return;
32156
- }
32157
- await copyTemplate({
32158
- projectName,
32159
- projectType,
32160
- targetDir: cwd,
32161
- database,
32162
- databaseUrl,
32163
- useYalc,
32164
- approach,
32165
- templateSource
32166
- });
32167
- } else {
32168
- await copyTemplate({
32169
- projectName,
32170
- projectType,
32171
- targetDir,
32172
- database,
32173
- databaseUrl,
32174
- useYalc,
32175
- approach,
32176
- templateSource
32177
- });
32178
- cwd = targetDir;
32179
- }
32237
+ await copyTemplate({
32238
+ projectName,
32239
+ projectType,
32240
+ targetDir,
32241
+ database,
32242
+ databaseUrl,
32243
+ useYalc,
32244
+ approach,
32245
+ templateSource,
32246
+ // Suppress copyTemplate's "directory already exists" guard when the
32247
+ // installer has already negotiated the conflict with the user
32248
+ // (either by emptying the dir or accepting an overlay). Without
32249
+ // this, the "ignore" path would still throw on the subdirectory
32250
+ // case where the target was non-empty.
32251
+ allowExistingTarget
32252
+ });
32253
+ if (!installInCwd) cwd = targetDir;
32180
32254
  s3.stop("Project scaffolded");
32181
32255
  } catch (error) {
32182
32256
  s3.stop("Scaffolding failed");
32183
- if (!installInCwd) {
32184
- const targetDir = path__default.default.join(cwd, projectName);
32185
- if (await import_fs_extra12.default.pathExists(targetDir)) {
32186
- await import_fs_extra12.default.remove(targetDir);
32257
+ if (!installInCwd && !allowExistingTarget) {
32258
+ if (await import_fs_extra13.default.pathExists(targetDir)) {
32259
+ await import_fs_extra13.default.remove(targetDir);
32187
32260
  }
32188
32261
  }
32189
32262
  capture("scaffold_failed", {
@@ -32230,7 +32303,8 @@ async function createNextly(options = {}) {
32230
32303
  projectInfo,
32231
32304
  database,
32232
32305
  useYalc,
32233
- isFreshProject
32306
+ isFreshProject,
32307
+ projectType
32234
32308
  );
32235
32309
  s3.stop("Dependencies installed");
32236
32310
  capture("install_completed", {
@@ -32320,8 +32394,7 @@ program2.name("create-nextly-app").description(
32320
32394
  "Scaffold a new Nextly CMS project or add Nextly to an existing Next.js app"
32321
32395
  ).version("0.1.0").argument(
32322
32396
  "[directory]",
32323
- "Project name or '.' to install in the current directory",
32324
- "."
32397
+ "Project name or '.' to install in the current directory (omit to be prompted)"
32325
32398
  ).option(
32326
32399
  "-y, --yes",
32327
32400
  "Skip prompts and use defaults (blank template, SQLite, local storage)"
@@ -32338,12 +32411,13 @@ program2.name("create-nextly-app").description(
32338
32411
  "after",
32339
32412
  `
32340
32413
  Examples:
32341
- $ npx create-nextly-app my-project
32342
- $ npx create-nextly-app my-project -y
32343
- $ npx create-nextly-app my-blog -t blog -a code-first
32344
- $ npx create-nextly-app my-project --database postgresql
32345
- $ npx create-nextly-app .
32346
- `
32414
+ $ npx create-nextly-app@alpha (prompts for folder name)
32415
+ $ npx create-nextly-app@alpha my-project
32416
+ $ npx create-nextly-app@alpha my-project -y
32417
+ $ npx create-nextly-app@alpha my-blog -t blog -a code-first
32418
+ $ npx create-nextly-app@alpha my-project --database postgresql
32419
+ $ npx create-nextly-app@alpha . (install in the current directory)
32420
+ `
32347
32421
  ).action(
32348
32422
  async (directory, options) => {
32349
32423
  await init({
@@ -32353,6 +32427,13 @@ Examples:
32353
32427
  try {
32354
32428
  const cwd = process.cwd();
32355
32429
  const { projectName, installInCwd } = resolveProjectArg(directory);
32430
+ if (projectName) {
32431
+ const nameError = validateProjectName(projectName);
32432
+ if (nameError) {
32433
+ console.error(`Error: Invalid project name '${projectName}'. ${nameError}.`);
32434
+ process.exit(1);
32435
+ }
32436
+ }
32356
32437
  const projectType = options.template;
32357
32438
  const validTypes = ["blank", "blog"];
32358
32439
  if (projectType && !validTypes.includes(projectType)) {