create-nextly-app 0.0.2-alpha.3 → 0.0.2-alpha.30

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.
Files changed (36) hide show
  1. package/dist/{chunk-AYJ2RKVJ.mjs → chunk-C5CWOU22.mjs} +1469 -1093
  2. package/dist/chunk-C5CWOU22.mjs.map +1 -0
  3. package/dist/cli.cjs +1497 -1123
  4. package/dist/cli.cjs.map +1 -1
  5. package/dist/cli.mjs +24 -27
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/index.cjs +1462 -1084
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +2 -1
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.mjs +1 -1
  12. package/package.json +4 -4
  13. package/templates/base/next.config.ts +11 -17
  14. package/templates/base/src/app/admin/[[...params]]/page.tsx +0 -9
  15. package/templates/plugin/README.md +44 -0
  16. package/templates/plugin/dev/.env.example +8 -0
  17. package/templates/plugin/dev/instrumentation.ts +10 -0
  18. package/templates/plugin/dev/next.config.ts +30 -0
  19. package/templates/plugin/dev/nextly.config.ts +17 -0
  20. package/templates/plugin/dev/src/app/admin/[[...params]]/page.tsx +9 -0
  21. package/templates/plugin/dev/src/app/admin/api/[[...params]]/route.ts +19 -0
  22. package/templates/plugin/dev/src/app/layout.tsx +13 -0
  23. package/templates/plugin/dev/tsconfig.json +22 -0
  24. package/templates/plugin/eslint.config.mjs +8 -0
  25. package/templates/plugin/src/admin/SettingsPage.tsx +13 -0
  26. package/templates/plugin/src/admin/index.ts +21 -0
  27. package/templates/plugin/src/collections/example.ts +13 -0
  28. package/templates/plugin/src/index.ts +6 -0
  29. package/templates/plugin/src/plugin.test.ts +29 -0
  30. package/templates/plugin/src/plugin.ts +48 -0
  31. package/templates/plugin/src/types.ts +17 -0
  32. package/templates/plugin/template.json +14 -0
  33. package/templates/plugin/tsconfig.json +18 -0
  34. package/templates/plugin/tsup.config.ts +22 -0
  35. package/templates/plugin/vitest.config.ts +8 -0
  36. package/dist/chunk-AYJ2RKVJ.mjs.map +0 -1
package/dist/cli.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  var module$1 = require('module');
5
- var path = require('path');
5
+ var path15 = require('path');
6
6
  var fs = require('fs');
7
7
  var k = require('readline');
8
8
  var async_hooks = require('async_hooks');
@@ -45,7 +45,7 @@ function _interopNamespace(e) {
45
45
  return Object.freeze(n);
46
46
  }
47
47
 
48
- var path__default = /*#__PURE__*/_interopDefault(path);
48
+ var path15__default = /*#__PURE__*/_interopDefault(path15);
49
49
  var fs__default = /*#__PURE__*/_interopDefault(fs);
50
50
  var k__namespace = /*#__PURE__*/_interopNamespace(k);
51
51
  var crypto__default = /*#__PURE__*/_interopDefault(crypto);
@@ -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.3",
6262
+ version: "0.0.2-alpha.30",
6263
6263
  description: "CLI to scaffold Nextly in your Next.js project",
6264
6264
  license: "MIT",
6265
6265
  type: "module",
@@ -13764,7 +13764,7 @@ var require_dist = __commonJS2({
13764
13764
  }
13765
13765
  });
13766
13766
  var require_constants = __commonJS2({
13767
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js"(exports$1, module) {
13767
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/constants.js"(exports$1, module) {
13768
13768
  var SEMVER_SPEC_VERSION = "2.0.0";
13769
13769
  var MAX_LENGTH = 256;
13770
13770
  var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
@@ -13793,14 +13793,14 @@ var require_constants = __commonJS2({
13793
13793
  }
13794
13794
  });
13795
13795
  var require_debug = __commonJS2({
13796
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/debug.js"(exports$1, module) {
13796
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/debug.js"(exports$1, module) {
13797
13797
  var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
13798
13798
  };
13799
13799
  module.exports = debug;
13800
13800
  }
13801
13801
  });
13802
13802
  var require_re = __commonJS2({
13803
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js"(exports$1, module) {
13803
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/re.js"(exports$1, module) {
13804
13804
  var {
13805
13805
  MAX_SAFE_COMPONENT_LENGTH,
13806
13806
  MAX_SAFE_BUILD_LENGTH,
@@ -13885,7 +13885,7 @@ var require_re = __commonJS2({
13885
13885
  }
13886
13886
  });
13887
13887
  var require_parse_options = __commonJS2({
13888
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js"(exports$1, module) {
13888
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/parse-options.js"(exports$1, module) {
13889
13889
  var looseOption = Object.freeze({ loose: true });
13890
13890
  var emptyOpts = Object.freeze({});
13891
13891
  var parseOptions = (options) => {
@@ -13901,9 +13901,12 @@ var require_parse_options = __commonJS2({
13901
13901
  }
13902
13902
  });
13903
13903
  var require_identifiers = __commonJS2({
13904
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js"(exports$1, module) {
13904
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/identifiers.js"(exports$1, module) {
13905
13905
  var numeric = /^[0-9]+$/;
13906
13906
  var compareIdentifiers = (a2, b2) => {
13907
+ if (typeof a2 === "number" && typeof b2 === "number") {
13908
+ return a2 === b2 ? 0 : a2 < b2 ? -1 : 1;
13909
+ }
13907
13910
  const anum = numeric.test(a2);
13908
13911
  const bnum = numeric.test(b2);
13909
13912
  if (anum && bnum) {
@@ -13920,7 +13923,7 @@ var require_identifiers = __commonJS2({
13920
13923
  }
13921
13924
  });
13922
13925
  var require_semver = __commonJS2({
13923
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js"(exports$1, module) {
13926
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/semver.js"(exports$1, module) {
13924
13927
  var debug = require_debug();
13925
13928
  var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
13926
13929
  var { safeRe: re3, t: t2 } = require_re();
@@ -14007,7 +14010,25 @@ var require_semver = __commonJS2({
14007
14010
  if (!(other instanceof _SemVer)) {
14008
14011
  other = new _SemVer(other, this.options);
14009
14012
  }
14010
- return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
14013
+ if (this.major < other.major) {
14014
+ return -1;
14015
+ }
14016
+ if (this.major > other.major) {
14017
+ return 1;
14018
+ }
14019
+ if (this.minor < other.minor) {
14020
+ return -1;
14021
+ }
14022
+ if (this.minor > other.minor) {
14023
+ return 1;
14024
+ }
14025
+ if (this.patch < other.patch) {
14026
+ return -1;
14027
+ }
14028
+ if (this.patch > other.patch) {
14029
+ return 1;
14030
+ }
14031
+ return 0;
14011
14032
  }
14012
14033
  comparePre(other) {
14013
14034
  if (!(other instanceof _SemVer)) {
@@ -14178,7 +14199,7 @@ var require_semver = __commonJS2({
14178
14199
  }
14179
14200
  });
14180
14201
  var require_parse = __commonJS2({
14181
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js"(exports$1, module) {
14202
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/parse.js"(exports$1, module) {
14182
14203
  var SemVer = require_semver();
14183
14204
  var parse = (version2, options, throwErrors = false) => {
14184
14205
  if (version2 instanceof SemVer) {
@@ -14197,7 +14218,7 @@ var require_parse = __commonJS2({
14197
14218
  }
14198
14219
  });
14199
14220
  var require_valid = __commonJS2({
14200
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js"(exports$1, module) {
14221
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/valid.js"(exports$1, module) {
14201
14222
  var parse = require_parse();
14202
14223
  var valid = (version2, options) => {
14203
14224
  const v2 = parse(version2, options);
@@ -14207,7 +14228,7 @@ var require_valid = __commonJS2({
14207
14228
  }
14208
14229
  });
14209
14230
  var require_clean = __commonJS2({
14210
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js"(exports$1, module) {
14231
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/clean.js"(exports$1, module) {
14211
14232
  var parse = require_parse();
14212
14233
  var clean = (version2, options) => {
14213
14234
  const s3 = parse(version2.trim().replace(/^[=v]+/, ""), options);
@@ -14217,7 +14238,7 @@ var require_clean = __commonJS2({
14217
14238
  }
14218
14239
  });
14219
14240
  var require_inc = __commonJS2({
14220
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/inc.js"(exports$1, module) {
14241
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/inc.js"(exports$1, module) {
14221
14242
  var SemVer = require_semver();
14222
14243
  var inc = (version2, release, options, identifier, identifierBase) => {
14223
14244
  if (typeof options === "string") {
@@ -14238,7 +14259,7 @@ var require_inc = __commonJS2({
14238
14259
  }
14239
14260
  });
14240
14261
  var require_diff = __commonJS2({
14241
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/diff.js"(exports$1, module) {
14262
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/diff.js"(exports$1, module) {
14242
14263
  var parse = require_parse();
14243
14264
  var diff = (version1, version2) => {
14244
14265
  const v1 = parse(version1, null, true);
@@ -14279,28 +14300,28 @@ var require_diff = __commonJS2({
14279
14300
  }
14280
14301
  });
14281
14302
  var require_major = __commonJS2({
14282
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/major.js"(exports$1, module) {
14303
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/major.js"(exports$1, module) {
14283
14304
  var SemVer = require_semver();
14284
14305
  var major = (a2, loose) => new SemVer(a2, loose).major;
14285
14306
  module.exports = major;
14286
14307
  }
14287
14308
  });
14288
14309
  var require_minor = __commonJS2({
14289
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/minor.js"(exports$1, module) {
14310
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/minor.js"(exports$1, module) {
14290
14311
  var SemVer = require_semver();
14291
14312
  var minor = (a2, loose) => new SemVer(a2, loose).minor;
14292
14313
  module.exports = minor;
14293
14314
  }
14294
14315
  });
14295
14316
  var require_patch = __commonJS2({
14296
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/patch.js"(exports$1, module) {
14317
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/patch.js"(exports$1, module) {
14297
14318
  var SemVer = require_semver();
14298
14319
  var patch = (a2, loose) => new SemVer(a2, loose).patch;
14299
14320
  module.exports = patch;
14300
14321
  }
14301
14322
  });
14302
14323
  var require_prerelease = __commonJS2({
14303
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/prerelease.js"(exports$1, module) {
14324
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/prerelease.js"(exports$1, module) {
14304
14325
  var parse = require_parse();
14305
14326
  var prerelease = (version2, options) => {
14306
14327
  const parsed = parse(version2, options);
@@ -14310,28 +14331,28 @@ var require_prerelease = __commonJS2({
14310
14331
  }
14311
14332
  });
14312
14333
  var require_compare = __commonJS2({
14313
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare.js"(exports$1, module) {
14334
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare.js"(exports$1, module) {
14314
14335
  var SemVer = require_semver();
14315
14336
  var compare = (a2, b2, loose) => new SemVer(a2, loose).compare(new SemVer(b2, loose));
14316
14337
  module.exports = compare;
14317
14338
  }
14318
14339
  });
14319
14340
  var require_rcompare = __commonJS2({
14320
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rcompare.js"(exports$1, module) {
14341
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rcompare.js"(exports$1, module) {
14321
14342
  var compare = require_compare();
14322
14343
  var rcompare = (a2, b2, loose) => compare(b2, a2, loose);
14323
14344
  module.exports = rcompare;
14324
14345
  }
14325
14346
  });
14326
14347
  var require_compare_loose = __commonJS2({
14327
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-loose.js"(exports$1, module) {
14348
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-loose.js"(exports$1, module) {
14328
14349
  var compare = require_compare();
14329
14350
  var compareLoose = (a2, b2) => compare(a2, b2, true);
14330
14351
  module.exports = compareLoose;
14331
14352
  }
14332
14353
  });
14333
14354
  var require_compare_build = __commonJS2({
14334
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/compare-build.js"(exports$1, module) {
14355
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-build.js"(exports$1, module) {
14335
14356
  var SemVer = require_semver();
14336
14357
  var compareBuild = (a2, b2, loose) => {
14337
14358
  const versionA = new SemVer(a2, loose);
@@ -14342,63 +14363,63 @@ var require_compare_build = __commonJS2({
14342
14363
  }
14343
14364
  });
14344
14365
  var require_sort = __commonJS2({
14345
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/sort.js"(exports$1, module) {
14366
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/sort.js"(exports$1, module) {
14346
14367
  var compareBuild = require_compare_build();
14347
14368
  var sort = (list, loose) => list.sort((a2, b2) => compareBuild(a2, b2, loose));
14348
14369
  module.exports = sort;
14349
14370
  }
14350
14371
  });
14351
14372
  var require_rsort = __commonJS2({
14352
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/rsort.js"(exports$1, module) {
14373
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rsort.js"(exports$1, module) {
14353
14374
  var compareBuild = require_compare_build();
14354
14375
  var rsort = (list, loose) => list.sort((a2, b2) => compareBuild(b2, a2, loose));
14355
14376
  module.exports = rsort;
14356
14377
  }
14357
14378
  });
14358
14379
  var require_gt = __commonJS2({
14359
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gt.js"(exports$1, module) {
14380
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gt.js"(exports$1, module) {
14360
14381
  var compare = require_compare();
14361
14382
  var gt4 = (a2, b2, loose) => compare(a2, b2, loose) > 0;
14362
14383
  module.exports = gt4;
14363
14384
  }
14364
14385
  });
14365
14386
  var require_lt = __commonJS2({
14366
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lt.js"(exports$1, module) {
14387
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lt.js"(exports$1, module) {
14367
14388
  var compare = require_compare();
14368
14389
  var lt3 = (a2, b2, loose) => compare(a2, b2, loose) < 0;
14369
14390
  module.exports = lt3;
14370
14391
  }
14371
14392
  });
14372
14393
  var require_eq = __commonJS2({
14373
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/eq.js"(exports$1, module) {
14394
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/eq.js"(exports$1, module) {
14374
14395
  var compare = require_compare();
14375
14396
  var eq = (a2, b2, loose) => compare(a2, b2, loose) === 0;
14376
14397
  module.exports = eq;
14377
14398
  }
14378
14399
  });
14379
14400
  var require_neq = __commonJS2({
14380
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/neq.js"(exports$1, module) {
14401
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/neq.js"(exports$1, module) {
14381
14402
  var compare = require_compare();
14382
14403
  var neq = (a2, b2, loose) => compare(a2, b2, loose) !== 0;
14383
14404
  module.exports = neq;
14384
14405
  }
14385
14406
  });
14386
14407
  var require_gte = __commonJS2({
14387
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/gte.js"(exports$1, module) {
14408
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gte.js"(exports$1, module) {
14388
14409
  var compare = require_compare();
14389
14410
  var gte = (a2, b2, loose) => compare(a2, b2, loose) >= 0;
14390
14411
  module.exports = gte;
14391
14412
  }
14392
14413
  });
14393
14414
  var require_lte = __commonJS2({
14394
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/lte.js"(exports$1, module) {
14415
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lte.js"(exports$1, module) {
14395
14416
  var compare = require_compare();
14396
14417
  var lte = (a2, b2, loose) => compare(a2, b2, loose) <= 0;
14397
14418
  module.exports = lte;
14398
14419
  }
14399
14420
  });
14400
14421
  var require_cmp = __commonJS2({
14401
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/cmp.js"(exports$1, module) {
14422
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/cmp.js"(exports$1, module) {
14402
14423
  var eq = require_eq();
14403
14424
  var neq = require_neq();
14404
14425
  var gt4 = require_gt();
@@ -14445,7 +14466,7 @@ var require_cmp = __commonJS2({
14445
14466
  }
14446
14467
  });
14447
14468
  var require_coerce = __commonJS2({
14448
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/coerce.js"(exports$1, module) {
14469
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/coerce.js"(exports$1, module) {
14449
14470
  var SemVer = require_semver();
14450
14471
  var parse = require_parse();
14451
14472
  var { safeRe: re3, t: t2 } = require_re();
@@ -14487,8 +14508,46 @@ var require_coerce = __commonJS2({
14487
14508
  module.exports = coerce;
14488
14509
  }
14489
14510
  });
14511
+ var require_truncate = __commonJS2({
14512
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/truncate.js"(exports$1, module) {
14513
+ var parse = require_parse();
14514
+ var constants4 = require_constants();
14515
+ var SemVer = require_semver();
14516
+ var truncate = (version2, truncation, options) => {
14517
+ if (!constants4.RELEASE_TYPES.includes(truncation)) {
14518
+ return null;
14519
+ }
14520
+ const clonedVersion = cloneInputVersion(version2, options);
14521
+ return clonedVersion && doTruncation(clonedVersion, truncation);
14522
+ };
14523
+ var cloneInputVersion = (version2, options) => {
14524
+ const versionStringToParse = version2 instanceof SemVer ? version2.version : version2;
14525
+ return parse(versionStringToParse, options);
14526
+ };
14527
+ var doTruncation = (version2, truncation) => {
14528
+ if (isPrerelease(truncation)) {
14529
+ return version2.version;
14530
+ }
14531
+ version2.prerelease = [];
14532
+ switch (truncation) {
14533
+ case "major":
14534
+ version2.minor = 0;
14535
+ version2.patch = 0;
14536
+ break;
14537
+ case "minor":
14538
+ version2.patch = 0;
14539
+ break;
14540
+ }
14541
+ return version2.format();
14542
+ };
14543
+ var isPrerelease = (type) => {
14544
+ return type.startsWith("pre");
14545
+ };
14546
+ module.exports = truncate;
14547
+ }
14548
+ });
14490
14549
  var require_lrucache = __commonJS2({
14491
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/lrucache.js"(exports$1, module) {
14550
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/lrucache.js"(exports$1, module) {
14492
14551
  var LRUCache = class {
14493
14552
  constructor() {
14494
14553
  this.max = 1e3;
@@ -14523,7 +14582,7 @@ var require_lrucache = __commonJS2({
14523
14582
  }
14524
14583
  });
14525
14584
  var require_range = __commonJS2({
14526
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js"(exports$1, module) {
14585
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/range.js"(exports$1, module) {
14527
14586
  var SPACE_CHARACTERS = /\s+/g;
14528
14587
  var Range = class _Range {
14529
14588
  constructor(range, options) {
@@ -14693,6 +14752,7 @@ var require_range = __commonJS2({
14693
14752
  return result;
14694
14753
  };
14695
14754
  var parseComparator = (comp, options) => {
14755
+ comp = comp.replace(re3[t2.BUILD], "");
14696
14756
  debug("comp", comp, options);
14697
14757
  comp = replaceCarets(comp, options);
14698
14758
  debug("caret", comp);
@@ -14896,7 +14956,7 @@ var require_range = __commonJS2({
14896
14956
  }
14897
14957
  });
14898
14958
  var require_comparator = __commonJS2({
14899
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/comparator.js"(exports$1, module) {
14959
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/comparator.js"(exports$1, module) {
14900
14960
  var ANY = Symbol("SemVer ANY");
14901
14961
  var Comparator = class _Comparator {
14902
14962
  static get ANY() {
@@ -15006,7 +15066,7 @@ var require_comparator = __commonJS2({
15006
15066
  }
15007
15067
  });
15008
15068
  var require_satisfies = __commonJS2({
15009
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js"(exports$1, module) {
15069
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/satisfies.js"(exports$1, module) {
15010
15070
  var Range = require_range();
15011
15071
  var satisfies = (version2, range, options) => {
15012
15072
  try {
@@ -15020,14 +15080,14 @@ var require_satisfies = __commonJS2({
15020
15080
  }
15021
15081
  });
15022
15082
  var require_to_comparators = __commonJS2({
15023
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js"(exports$1, module) {
15083
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/to-comparators.js"(exports$1, module) {
15024
15084
  var Range = require_range();
15025
15085
  var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c3) => c3.value).join(" ").trim().split(" "));
15026
15086
  module.exports = toComparators;
15027
15087
  }
15028
15088
  });
15029
15089
  var require_max_satisfying = __commonJS2({
15030
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js"(exports$1, module) {
15090
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/max-satisfying.js"(exports$1, module) {
15031
15091
  var SemVer = require_semver();
15032
15092
  var Range = require_range();
15033
15093
  var maxSatisfying = (versions, range, options) => {
@@ -15053,7 +15113,7 @@ var require_max_satisfying = __commonJS2({
15053
15113
  }
15054
15114
  });
15055
15115
  var require_min_satisfying = __commonJS2({
15056
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js"(exports$1, module) {
15116
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-satisfying.js"(exports$1, module) {
15057
15117
  var SemVer = require_semver();
15058
15118
  var Range = require_range();
15059
15119
  var minSatisfying = (versions, range, options) => {
@@ -15079,7 +15139,7 @@ var require_min_satisfying = __commonJS2({
15079
15139
  }
15080
15140
  });
15081
15141
  var require_min_version = __commonJS2({
15082
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-version.js"(exports$1, module) {
15142
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-version.js"(exports$1, module) {
15083
15143
  var SemVer = require_semver();
15084
15144
  var Range = require_range();
15085
15145
  var gt4 = require_gt();
@@ -15135,7 +15195,7 @@ var require_min_version = __commonJS2({
15135
15195
  }
15136
15196
  });
15137
15197
  var require_valid2 = __commonJS2({
15138
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js"(exports$1, module) {
15198
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/valid.js"(exports$1, module) {
15139
15199
  var Range = require_range();
15140
15200
  var validRange = (range, options) => {
15141
15201
  try {
@@ -15148,7 +15208,7 @@ var require_valid2 = __commonJS2({
15148
15208
  }
15149
15209
  });
15150
15210
  var require_outside = __commonJS2({
15151
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/outside.js"(exports$1, module) {
15211
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/outside.js"(exports$1, module) {
15152
15212
  var SemVer = require_semver();
15153
15213
  var Comparator = require_comparator();
15154
15214
  var { ANY } = Comparator;
@@ -15214,21 +15274,21 @@ var require_outside = __commonJS2({
15214
15274
  }
15215
15275
  });
15216
15276
  var require_gtr = __commonJS2({
15217
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js"(exports$1, module) {
15277
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/gtr.js"(exports$1, module) {
15218
15278
  var outside = require_outside();
15219
15279
  var gtr = (version2, range, options) => outside(version2, range, ">", options);
15220
15280
  module.exports = gtr;
15221
15281
  }
15222
15282
  });
15223
15283
  var require_ltr = __commonJS2({
15224
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js"(exports$1, module) {
15284
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/ltr.js"(exports$1, module) {
15225
15285
  var outside = require_outside();
15226
15286
  var ltr = (version2, range, options) => outside(version2, range, "<", options);
15227
15287
  module.exports = ltr;
15228
15288
  }
15229
15289
  });
15230
15290
  var require_intersects = __commonJS2({
15231
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js"(exports$1, module) {
15291
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/intersects.js"(exports$1, module) {
15232
15292
  var Range = require_range();
15233
15293
  var intersects = (r1, r2, options) => {
15234
15294
  r1 = new Range(r1, options);
@@ -15239,7 +15299,7 @@ var require_intersects = __commonJS2({
15239
15299
  }
15240
15300
  });
15241
15301
  var require_simplify = __commonJS2({
15242
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js"(exports$1, module) {
15302
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/simplify.js"(exports$1, module) {
15243
15303
  var satisfies = require_satisfies();
15244
15304
  var compare = require_compare();
15245
15305
  module.exports = (versions, range, options) => {
@@ -15286,7 +15346,7 @@ var require_simplify = __commonJS2({
15286
15346
  }
15287
15347
  });
15288
15348
  var require_subset = __commonJS2({
15289
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js"(exports$1, module) {
15349
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/subset.js"(exports$1, module) {
15290
15350
  var Range = require_range();
15291
15351
  var Comparator = require_comparator();
15292
15352
  var { ANY } = Comparator;
@@ -15445,7 +15505,7 @@ var require_subset = __commonJS2({
15445
15505
  }
15446
15506
  });
15447
15507
  var require_semver2 = __commonJS2({
15448
- "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/index.js"(exports$1, module) {
15508
+ "../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/index.js"(exports$1, module) {
15449
15509
  var internalRe = require_re();
15450
15510
  var constants4 = require_constants();
15451
15511
  var SemVer = require_semver();
@@ -15473,6 +15533,7 @@ var require_semver2 = __commonJS2({
15473
15533
  var lte = require_lte();
15474
15534
  var cmp = require_cmp();
15475
15535
  var coerce = require_coerce();
15536
+ var truncate = require_truncate();
15476
15537
  var Comparator = require_comparator();
15477
15538
  var Range = require_range();
15478
15539
  var satisfies = require_satisfies();
@@ -15511,6 +15572,7 @@ var require_semver2 = __commonJS2({
15511
15572
  lte,
15512
15573
  cmp,
15513
15574
  coerce,
15575
+ truncate,
15514
15576
  Comparator,
15515
15577
  Range,
15516
15578
  satisfies,
@@ -15568,12 +15630,12 @@ function createModulerModifier() {
15568
15630
  return frames;
15569
15631
  };
15570
15632
  }
15571
- function createGetModuleFromFilename(basePath = process.argv[1] ? path.dirname(process.argv[1]) : process.cwd(), isWindows = "\\" === path.sep) {
15633
+ function createGetModuleFromFilename(basePath = process.argv[1] ? path15.dirname(process.argv[1]) : process.cwd(), isWindows = "\\" === path15.sep) {
15572
15634
  const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
15573
15635
  return (filename) => {
15574
15636
  if (!filename) return;
15575
15637
  const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
15576
- let { dir, base: file, ext } = path.posix.parse(normalizedFilename);
15638
+ let { dir, base: file, ext } = path15.posix.parse(normalizedFilename);
15577
15639
  if (".js" === ext || ".mjs" === ext || ".cjs" === ext) file = file.slice(0, -1 * ext.length);
15578
15640
  const decodedFile = decodeURIComponent(file);
15579
15641
  if (!dir) dir = ".";
@@ -19499,36 +19561,36 @@ var homedir = os__default.default.homedir();
19499
19561
  var tmpdir = os__default.default.tmpdir();
19500
19562
  var { env } = process4__default.default;
19501
19563
  var macos = (name) => {
19502
- const library = path__default.default.join(homedir, "Library");
19564
+ const library = path15__default.default.join(homedir, "Library");
19503
19565
  return {
19504
- data: path__default.default.join(library, "Application Support", name),
19505
- config: path__default.default.join(library, "Preferences", name),
19506
- cache: path__default.default.join(library, "Caches", name),
19507
- log: path__default.default.join(library, "Logs", name),
19508
- temp: path__default.default.join(tmpdir, name)
19566
+ data: path15__default.default.join(library, "Application Support", name),
19567
+ config: path15__default.default.join(library, "Preferences", name),
19568
+ cache: path15__default.default.join(library, "Caches", name),
19569
+ log: path15__default.default.join(library, "Logs", name),
19570
+ temp: path15__default.default.join(tmpdir, name)
19509
19571
  };
19510
19572
  };
19511
19573
  var windows = (name) => {
19512
- const appData = env.APPDATA || path__default.default.join(homedir, "AppData", "Roaming");
19513
- const localAppData = env.LOCALAPPDATA || path__default.default.join(homedir, "AppData", "Local");
19574
+ const appData = env.APPDATA || path15__default.default.join(homedir, "AppData", "Roaming");
19575
+ const localAppData = env.LOCALAPPDATA || path15__default.default.join(homedir, "AppData", "Local");
19514
19576
  return {
19515
19577
  // Data/config/cache/log are invented by me as Windows isn't opinionated about this
19516
- data: path__default.default.join(localAppData, name, "Data"),
19517
- config: path__default.default.join(appData, name, "Config"),
19518
- cache: path__default.default.join(localAppData, name, "Cache"),
19519
- log: path__default.default.join(localAppData, name, "Log"),
19520
- temp: path__default.default.join(tmpdir, name)
19578
+ data: path15__default.default.join(localAppData, name, "Data"),
19579
+ config: path15__default.default.join(appData, name, "Config"),
19580
+ cache: path15__default.default.join(localAppData, name, "Cache"),
19581
+ log: path15__default.default.join(localAppData, name, "Log"),
19582
+ temp: path15__default.default.join(tmpdir, name)
19521
19583
  };
19522
19584
  };
19523
19585
  var linux = (name) => {
19524
- const username = path__default.default.basename(homedir);
19586
+ const username = path15__default.default.basename(homedir);
19525
19587
  return {
19526
- data: path__default.default.join(env.XDG_DATA_HOME || path__default.default.join(homedir, ".local", "share"), name),
19527
- config: path__default.default.join(env.XDG_CONFIG_HOME || path__default.default.join(homedir, ".config"), name),
19528
- cache: path__default.default.join(env.XDG_CACHE_HOME || path__default.default.join(homedir, ".cache"), name),
19588
+ data: path15__default.default.join(env.XDG_DATA_HOME || path15__default.default.join(homedir, ".local", "share"), name),
19589
+ config: path15__default.default.join(env.XDG_CONFIG_HOME || path15__default.default.join(homedir, ".config"), name),
19590
+ cache: path15__default.default.join(env.XDG_CACHE_HOME || path15__default.default.join(homedir, ".cache"), name),
19529
19591
  // https://wiki.debian.org/XDGBaseDirectorySpecification#state
19530
- log: path__default.default.join(env.XDG_STATE_HOME || path__default.default.join(homedir, ".local", "state"), name),
19531
- temp: path__default.default.join(tmpdir, username, name)
19592
+ log: path15__default.default.join(env.XDG_STATE_HOME || path15__default.default.join(homedir, ".local", "state"), name),
19593
+ temp: path15__default.default.join(tmpdir, username, name)
19532
19594
  };
19533
19595
  };
19534
19596
  function envPaths(name, { suffix = "nodejs" } = {}) {
@@ -19805,7 +19867,7 @@ var Temp = {
19805
19867
  }
19806
19868
  },
19807
19869
  truncate: (filePath) => {
19808
- const basename = path__default.default.basename(filePath);
19870
+ const basename = path15__default.default.basename(filePath);
19809
19871
  if (basename.length <= LIMIT_BASENAME_LENGTH)
19810
19872
  return filePath;
19811
19873
  const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename);
@@ -19845,7 +19907,7 @@ function writeFileSync(filePath, data, options = DEFAULT_WRITE_OPTIONS) {
19845
19907
  }
19846
19908
  }
19847
19909
  if (!filePathExists) {
19848
- const parentPath = path__default.default.dirname(filePath);
19910
+ const parentPath = path15__default.default.dirname(filePath);
19849
19911
  dist_default.attempt.mkdirSync(parentPath, {
19850
19912
  mode: DEFAULT_FOLDER_MODE,
19851
19913
  recursive: true
@@ -20148,7 +20210,7 @@ var Conf = class {
20148
20210
  this.events = new EventTarget();
20149
20211
  this.#encryptionKey = options.encryptionKey;
20150
20212
  const fileExtension = options.fileExtension ? `.${options.fileExtension}` : "";
20151
- this.path = path__default.default.resolve(options.cwd, `${options.configName ?? "config"}${fileExtension}`);
20213
+ this.path = path15__default.default.resolve(options.cwd, `${options.configName ?? "config"}${fileExtension}`);
20152
20214
  const fileStore = this.store;
20153
20215
  const store = Object.assign(createPlainObject(), options.defaults, fileStore);
20154
20216
  if (options.migrations) {
@@ -20353,7 +20415,7 @@ var Conf = class {
20353
20415
  throw new Error("Config schema violation: " + errors.join("; "));
20354
20416
  }
20355
20417
  _ensureDirectory() {
20356
- fs__default.default.mkdirSync(path__default.default.dirname(this.path), { recursive: true });
20418
+ fs__default.default.mkdirSync(path15__default.default.dirname(this.path), { recursive: true });
20357
20419
  }
20358
20420
  _write(value) {
20359
20421
  let data = this._serialize(value);
@@ -20683,13 +20745,27 @@ var {
20683
20745
  Help
20684
20746
  } = import_index.default;
20685
20747
  function resolveProjectArg(directory) {
20686
- if (!directory || directory === "") {
20748
+ const trimmed = directory?.trim();
20749
+ if (!trimmed) {
20687
20750
  return { projectName: void 0, installInCwd: false };
20688
20751
  }
20689
- if (directory === ".") {
20752
+ if (trimmed === "." || trimmed === "./") {
20690
20753
  return { projectName: void 0, installInCwd: true };
20691
20754
  }
20692
- return { projectName: path__default.default.basename(directory), installInCwd: false };
20755
+ return { projectName: path15__default.default.basename(trimmed), installInCwd: false };
20756
+ }
20757
+ function validateProjectName(name) {
20758
+ if (!/^[a-z0-9][a-z0-9._-]*$/.test(name)) {
20759
+ return "Use lowercase letters, numbers, hyphens, dots, or underscores";
20760
+ }
20761
+ return void 0;
20762
+ }
20763
+ function validateProjectNamePromptInput(value) {
20764
+ const trimmed = (value ?? "").trim();
20765
+ if (trimmed === "") return void 0;
20766
+ if (trimmed === "." || trimmed === "./") return void 0;
20767
+ const candidate = trimmed.startsWith("./") ? trimmed.slice(2) : trimmed;
20768
+ return validateProjectName(path15__default.default.basename(candidate));
20693
20769
  }
20694
20770
 
20695
20771
  // ../../node_modules/.pnpm/@clack+core@1.1.0/node_modules/@clack/core/dist/index.mjs
@@ -21573,7 +21649,7 @@ ${l}
21573
21649
  } }).prompt();
21574
21650
 
21575
21651
  // src/create-nextly.ts
21576
- var import_fs_extra12 = __toESM(require_lib());
21652
+ var import_fs_extra13 = __toESM(require_lib());
21577
21653
  var import_picocolors3 = __toESM(require_picocolors2());
21578
21654
 
21579
21655
  // src/generators/admin.ts
@@ -21581,9 +21657,6 @@ var import_fs_extra = __toESM(require_lib());
21581
21657
  var ADMIN_PAGE_TEMPLATE = `"use client";
21582
21658
 
21583
21659
  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
21660
  import { RootLayout, QueryProvider, ErrorBoundary } from "@nextlyhq/admin";
21588
21661
 
21589
21662
  export default function AdminPage() {
@@ -21625,9 +21698,9 @@ export default function AdminLayout({
21625
21698
  `;
21626
21699
  }
21627
21700
  async function generateAdminPage(cwd, projectInfo) {
21628
- const adminDir = path__default.default.join(cwd, projectInfo.appDir, "admin", "[[...params]]");
21629
- const pagePath = path__default.default.join(adminDir, "page.tsx");
21630
- const layoutPath = path__default.default.join(adminDir, "layout.tsx");
21701
+ const adminDir = path15__default.default.join(cwd, projectInfo.appDir, "admin", "[[...params]]");
21702
+ const pagePath = path15__default.default.join(adminDir, "page.tsx");
21703
+ const layoutPath = path15__default.default.join(adminDir, "layout.tsx");
21631
21704
  if (await import_fs_extra.default.pathExists(pagePath)) {
21632
21705
  throw new Error(
21633
21706
  "Admin page already exists at admin/[[...params]]/page.tsx"
@@ -21680,7 +21753,7 @@ ${singlesLine}
21680
21753
  return template;
21681
21754
  }
21682
21755
  async function generateConfig(cwd, projectType) {
21683
- const configPath = path__default.default.join(cwd, "nextly.config.ts");
21756
+ const configPath = path15__default.default.join(cwd, "nextly.config.ts");
21684
21757
  if (await import_fs_extra2.default.pathExists(configPath)) {
21685
21758
  throw new Error(
21686
21759
  "nextly.config.ts already exists. Please remove it first or run in a fresh project."
@@ -21711,8 +21784,8 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000
21711
21784
  `;
21712
21785
  }
21713
21786
  async function generateEnv(cwd, database) {
21714
- const envPath = path__default.default.join(cwd, ".env");
21715
- const envExamplePath = path__default.default.join(cwd, ".env.example");
21787
+ const envPath = path15__default.default.join(cwd, ".env");
21788
+ const envExamplePath = path15__default.default.join(cwd, ".env.example");
21716
21789
  const envContent = getEnvTemplate(database);
21717
21790
  await import_fs_extra3.default.writeFile(envExamplePath, envContent, "utf-8");
21718
21791
  if (await import_fs_extra3.default.pathExists(envPath)) {
@@ -21776,50 +21849,70 @@ var HEALTH_ROUTE_TEMPLATE = `/**
21776
21849
  export { GET, HEAD } from "nextly/api/health";
21777
21850
  `;
21778
21851
  async function generateMediaRoutes(cwd, projectInfo) {
21779
- const apiDir = path__default.default.join(cwd, projectInfo.appDir, "api");
21780
- const mediaDir = path__default.default.join(apiDir, "media");
21852
+ const apiDir = path15__default.default.join(cwd, projectInfo.appDir, "api");
21853
+ const mediaDir = path15__default.default.join(apiDir, "media");
21781
21854
  if (await import_fs_extra4.default.pathExists(mediaDir)) {
21782
21855
  throw new Error(
21783
21856
  "Media API routes already exist at api/media. Please remove them first."
21784
21857
  );
21785
21858
  }
21786
- const mediaRoutePath = path__default.default.join(apiDir, "media", "[[...path]]", "route.ts");
21859
+ const mediaRoutePath = path15__default.default.join(apiDir, "media", "[[...path]]", "route.ts");
21787
21860
  const configImportPath = getConfigImportPath(
21788
21861
  projectInfo.appDir.startsWith("src")
21789
21862
  );
21790
- await import_fs_extra4.default.ensureDir(path__default.default.dirname(mediaRoutePath));
21863
+ await import_fs_extra4.default.ensureDir(path15__default.default.dirname(mediaRoutePath));
21791
21864
  await import_fs_extra4.default.writeFile(
21792
21865
  mediaRoutePath,
21793
21866
  MEDIA_CATCH_ALL_TEMPLATE(configImportPath),
21794
21867
  "utf-8"
21795
21868
  );
21796
- const healthRoutePath = path__default.default.join(apiDir, "health", "route.ts");
21797
- await import_fs_extra4.default.ensureDir(path__default.default.dirname(healthRoutePath));
21869
+ const healthRoutePath = path15__default.default.join(apiDir, "health", "route.ts");
21870
+ await import_fs_extra4.default.ensureDir(path15__default.default.dirname(healthRoutePath));
21798
21871
  await import_fs_extra4.default.writeFile(healthRoutePath, HEALTH_ROUTE_TEMPLATE, "utf-8");
21799
21872
  }
21800
21873
 
21801
21874
  // src/generators/next-config.ts
21802
21875
  var import_fs_extra5 = __toESM(require_lib());
21803
- var SERVER_EXTERNAL_PACKAGES = [
21876
+ var COMMON_SERVER_EXTERNAL_PACKAGES = [
21804
21877
  "nextly",
21805
21878
  "@nextlyhq/adapter-drizzle",
21806
- "@nextlyhq/adapter-postgres",
21807
- "@nextlyhq/adapter-mysql",
21808
- "@nextlyhq/adapter-sqlite",
21809
21879
  "drizzle-orm",
21810
21880
  "drizzle-kit",
21811
- "pg",
21812
- "mysql2",
21813
- "better-sqlite3",
21814
21881
  "bcryptjs",
21815
21882
  "sharp",
21816
21883
  "esbuild"
21817
21884
  ];
21818
- async function patchNextConfig(cwd) {
21885
+ var DATABASE_SERVER_EXTERNAL_PACKAGES = {
21886
+ postgresql: ["@nextlyhq/adapter-postgres", "pg"],
21887
+ mysql: ["@nextlyhq/adapter-mysql", "mysql2"],
21888
+ sqlite: ["@nextlyhq/adapter-sqlite", "better-sqlite3"]
21889
+ };
21890
+ function getServerExternalPackages(database) {
21891
+ return [
21892
+ ...COMMON_SERVER_EXTERNAL_PACKAGES,
21893
+ ...DATABASE_SERVER_EXTERNAL_PACKAGES[database.type]
21894
+ ];
21895
+ }
21896
+ function buildNextConfigTemplate(database) {
21897
+ const packagesArray = JSON.stringify(
21898
+ getServerExternalPackages(database),
21899
+ null,
21900
+ 2
21901
+ ).replace(/\n/g, "\n ");
21902
+ return `import type { NextConfig } from "next";
21903
+
21904
+ const nextConfig: NextConfig = {
21905
+ serverExternalPackages: ${packagesArray},
21906
+ };
21907
+
21908
+ export default nextConfig;
21909
+ `;
21910
+ }
21911
+ async function patchNextConfig(cwd, database) {
21819
21912
  const candidates = ["next.config.ts", "next.config.mjs", "next.config.js"];
21820
21913
  let configPath = null;
21821
21914
  for (const name of candidates) {
21822
- const full = path__default.default.join(cwd, name);
21915
+ const full = path15__default.default.join(cwd, name);
21823
21916
  if (await import_fs_extra5.default.pathExists(full)) {
21824
21917
  configPath = full;
21825
21918
  break;
@@ -21832,7 +21925,11 @@ async function patchNextConfig(cwd) {
21832
21925
  if (content.includes("serverExternalPackages")) {
21833
21926
  return;
21834
21927
  }
21835
- const packagesArray = JSON.stringify(SERVER_EXTERNAL_PACKAGES, null, 4).replace(/\n/g, "\n ");
21928
+ const packagesArray = JSON.stringify(
21929
+ getServerExternalPackages(database),
21930
+ null,
21931
+ 2
21932
+ ).replace(/\n/g, "\n ");
21836
21933
  const configObjectPattern = /(const\s+\w+\s*(?::\s*NextConfig\s*)?=\s*\{)/;
21837
21934
  if (configObjectPattern.test(content)) {
21838
21935
  const patched = content.replace(
@@ -21872,7 +21969,7 @@ export const DELETE = handlers.DELETE;
21872
21969
  export const OPTIONS = handlers.OPTIONS;
21873
21970
  `;
21874
21971
  async function generateRoutes(cwd, projectInfo) {
21875
- const routePath = path__default.default.join(
21972
+ const routePath = path15__default.default.join(
21876
21973
  cwd,
21877
21974
  projectInfo.appDir,
21878
21975
  "admin",
@@ -21885,7 +21982,7 @@ async function generateRoutes(cwd, projectInfo) {
21885
21982
  "API route already exists at admin/api/[[...params]]/route.ts"
21886
21983
  );
21887
21984
  }
21888
- await import_fs_extra6.default.ensureDir(path__default.default.dirname(routePath));
21985
+ await import_fs_extra6.default.ensureDir(path15__default.default.dirname(routePath));
21889
21986
  await import_fs_extra6.default.writeFile(routePath, API_ROUTE_TEMPLATE, "utf-8");
21890
21987
  }
21891
21988
 
@@ -21893,13 +21990,13 @@ async function generateRoutes(cwd, projectInfo) {
21893
21990
  var import_fs_extra7 = __toESM(require_lib());
21894
21991
  async function generateTypesDirectory(cwd, projectInfo) {
21895
21992
  const baseDir = projectInfo.srcDir ? "src" : ".";
21896
- const typesDir = path__default.default.join(cwd, baseDir, "types", "generated");
21993
+ const typesDir = path15__default.default.join(cwd, baseDir, "types", "generated");
21897
21994
  await import_fs_extra7.default.ensureDir(typesDir);
21898
- const gitkeepPath = path__default.default.join(typesDir, ".gitkeep");
21995
+ const gitkeepPath = path15__default.default.join(typesDir, ".gitkeep");
21899
21996
  if (!await import_fs_extra7.default.pathExists(gitkeepPath)) {
21900
21997
  await import_fs_extra7.default.writeFile(gitkeepPath, "", "utf-8");
21901
21998
  }
21902
- const placeholderPath = path__default.default.join(typesDir, "nextly-types.ts");
21999
+ const placeholderPath = path15__default.default.join(typesDir, "nextly-types.ts");
21903
22000
  if (!await import_fs_extra7.default.pathExists(placeholderPath)) {
21904
22001
  const placeholderContent = `/**
21905
22002
  * Nextly Generated Types
@@ -22710,12 +22807,12 @@ function toPath(urlOrPath) {
22710
22807
  function traversePathUp(startPath) {
22711
22808
  return {
22712
22809
  *[Symbol.iterator]() {
22713
- let currentPath = path__default.default.resolve(toPath(startPath));
22810
+ let currentPath = path15__default.default.resolve(toPath(startPath));
22714
22811
  let previousPath;
22715
22812
  while (previousPath !== currentPath) {
22716
22813
  yield currentPath;
22717
22814
  previousPath = currentPath;
22718
- currentPath = path__default.default.resolve(currentPath, "..");
22815
+ currentPath = path15__default.default.resolve(currentPath, "..");
22719
22816
  }
22720
22817
  }
22721
22818
  };
@@ -22729,27 +22826,27 @@ var npmRunPath = ({
22729
22826
  execPath: execPath2 = process4__default.default.execPath,
22730
22827
  addExecPath = true
22731
22828
  } = {}) => {
22732
- const cwdPath = path__default.default.resolve(toPath(cwd));
22829
+ const cwdPath = path15__default.default.resolve(toPath(cwd));
22733
22830
  const result = [];
22734
- const pathParts = pathOption.split(path__default.default.delimiter);
22831
+ const pathParts = pathOption.split(path15__default.default.delimiter);
22735
22832
  if (preferLocal) {
22736
22833
  applyPreferLocal(result, pathParts, cwdPath);
22737
22834
  }
22738
22835
  if (addExecPath) {
22739
22836
  applyExecPath(result, pathParts, execPath2, cwdPath);
22740
22837
  }
22741
- return pathOption === "" || pathOption === path__default.default.delimiter ? `${result.join(path__default.default.delimiter)}${pathOption}` : [...result, pathOption].join(path__default.default.delimiter);
22838
+ return pathOption === "" || pathOption === path15__default.default.delimiter ? `${result.join(path15__default.default.delimiter)}${pathOption}` : [...result, pathOption].join(path15__default.default.delimiter);
22742
22839
  };
22743
22840
  var applyPreferLocal = (result, pathParts, cwdPath) => {
22744
22841
  for (const directory of traversePathUp(cwdPath)) {
22745
- const pathPart = path__default.default.join(directory, "node_modules/.bin");
22842
+ const pathPart = path15__default.default.join(directory, "node_modules/.bin");
22746
22843
  if (!pathParts.includes(pathPart)) {
22747
22844
  result.push(pathPart);
22748
22845
  }
22749
22846
  }
22750
22847
  };
22751
22848
  var applyExecPath = (result, pathParts, execPath2, cwdPath) => {
22752
- const pathPart = path__default.default.resolve(cwdPath, toPath(execPath2), "..");
22849
+ const pathPart = path15__default.default.resolve(cwdPath, toPath(execPath2), "..");
22753
22850
  if (!pathParts.includes(pathPart)) {
22754
22851
  result.push(pathPart);
22755
22852
  }
@@ -23882,7 +23979,7 @@ var handleNodeOption = (file, commandArguments, {
23882
23979
  throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
23883
23980
  }
23884
23981
  const normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The "nodePath" option');
23885
- const resolvedNodePath = path__default.default.resolve(cwd, normalizedNodePath);
23982
+ const resolvedNodePath = path15__default.default.resolve(cwd, normalizedNodePath);
23886
23983
  const newOptions = {
23887
23984
  ...options,
23888
23985
  nodePath: resolvedNodePath,
@@ -23892,7 +23989,7 @@ var handleNodeOption = (file, commandArguments, {
23892
23989
  if (!shouldHandleNode) {
23893
23990
  return [file, commandArguments, newOptions];
23894
23991
  }
23895
- if (path__default.default.basename(file, ".exe") === "node") {
23992
+ if (path15__default.default.basename(file, ".exe") === "node") {
23896
23993
  throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
23897
23994
  }
23898
23995
  return [
@@ -23978,7 +24075,7 @@ var ENCODING_ALIASES = {
23978
24075
  var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding);
23979
24076
  var normalizeCwd = (cwd = getDefaultCwd()) => {
23980
24077
  const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
23981
- return path__default.default.resolve(cwdString);
24078
+ return path15__default.default.resolve(cwdString);
23982
24079
  };
23983
24080
  var getDefaultCwd = () => {
23984
24081
  try {
@@ -24025,7 +24122,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
24025
24122
  options.killSignal = normalizeKillSignal(options.killSignal);
24026
24123
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
24027
24124
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
24028
- if (process4__default.default.platform === "win32" && path__default.default.basename(file, ".exe") === "cmd") {
24125
+ if (process4__default.default.platform === "win32" && path15__default.default.basename(file, ".exe") === "cmd") {
24029
24126
  commandArguments.unshift("/q");
24030
24127
  }
24031
24128
  return { file, commandArguments, options };
@@ -26132,13 +26229,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state: state2, verboseInfo, e
26132
26229
  }
26133
26230
  };
26134
26231
  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();
26232
+ for (const { path: path21, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
26233
+ const pathString = typeof path21 === "string" ? path21 : path21.toString();
26137
26234
  if (append || outputFiles.has(pathString)) {
26138
- fs.appendFileSync(path20, serializedResult);
26235
+ fs.appendFileSync(path21, serializedResult);
26139
26236
  } else {
26140
26237
  outputFiles.add(pathString);
26141
- fs.writeFileSync(path20, serializedResult);
26238
+ fs.writeFileSync(path21, serializedResult);
26142
26239
  }
26143
26240
  }
26144
26241
  };
@@ -28434,102 +28531,576 @@ createExeca(mapNode);
28434
28531
  createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
28435
28532
  getIpcExport();
28436
28533
 
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"]
28534
+ // src/utils/template.ts
28535
+ var import_fs_extra8 = __toESM(require_lib());
28536
+ var PROJECT_TYPES_WITH_FORM_BUILDER = /* @__PURE__ */ new Set([
28537
+ "blog"
28538
+ ]);
28539
+ function projectUsesFormBuilder(projectType) {
28540
+ return PROJECT_TYPES_WITH_FORM_BUILDER.has(projectType);
28541
+ }
28542
+ var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
28543
+ ".ts",
28544
+ ".tsx",
28545
+ ".js",
28546
+ ".jsx",
28547
+ ".json",
28548
+ ".env",
28549
+ ".md",
28550
+ ".css",
28551
+ ".html",
28552
+ ".mjs",
28553
+ ".cjs"
28554
+ ]);
28555
+ var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
28556
+ function resolveTemplatePath(localTemplatePath) {
28557
+ const __dirname = path15__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))));
28558
+ const fromDist = path15__default.default.resolve(__dirname, "../templates");
28559
+ if (import_fs_extra8.default.existsSync(fromDist)) {
28560
+ return fromDist;
28561
+ }
28562
+ const fromSrc = path15__default.default.resolve(__dirname, "../../templates");
28563
+ if (import_fs_extra8.default.existsSync(fromSrc)) {
28564
+ return fromSrc;
28565
+ }
28566
+ throw new Error(
28567
+ "Could not find templates directory. Use --local-template to specify the templates path, or ensure templates are bundled."
28568
+ );
28569
+ }
28570
+ function buildPlaceholderMap(options) {
28571
+ const { database, databaseUrl, pluginName, nextlyRange } = options;
28572
+ const map = {};
28573
+ if (database) {
28574
+ map["{{databaseDialect}}"] = database.type;
28575
+ map["{{databaseUrl}}"] = databaseUrl || database.envExample;
28576
+ }
28577
+ if (pluginName) map["{{pluginName}}"] = pluginName;
28578
+ if (nextlyRange) map["{{nextlyRange}}"] = nextlyRange;
28579
+ return map;
28580
+ }
28581
+ async function replacePlaceholdersInFile(filePath, placeholders) {
28582
+ const ext = path15__default.default.extname(filePath).toLowerCase();
28583
+ const basename = path15__default.default.basename(filePath);
28584
+ const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
28585
+ if (!isTextFile) return;
28586
+ let content = await import_fs_extra8.default.readFile(filePath, "utf-8");
28587
+ let changed = false;
28588
+ for (const [placeholder, value] of Object.entries(placeholders)) {
28589
+ if (content.includes(placeholder)) {
28590
+ content = content.replaceAll(placeholder, value);
28591
+ changed = true;
28592
+ }
28593
+ }
28594
+ if (changed) {
28595
+ await import_fs_extra8.default.writeFile(filePath, content, "utf-8");
28596
+ }
28597
+ }
28598
+ async function replacePlaceholders(dir, placeholders) {
28599
+ const entries = await import_fs_extra8.default.readdir(dir, { withFileTypes: true });
28600
+ for (const entry of entries) {
28601
+ const fullPath = path15__default.default.join(dir, entry.name);
28602
+ if (entry.isDirectory()) {
28603
+ if (entry.name === "node_modules" || entry.name === ".git") continue;
28604
+ await replacePlaceholders(fullPath, placeholders);
28605
+ } else if (entry.isFile()) {
28606
+ await replacePlaceholdersInFile(fullPath, placeholders);
28607
+ }
28608
+ }
28609
+ }
28610
+ var PINNED_VERSIONS = {
28611
+ // Next.js ecosystem — resolved at runtime via fetchLatestVersion()
28612
+ // (see generatePackageJson)
28613
+ react: "^19.1.0",
28614
+ "react-dom": "^19.1.0",
28615
+ // Dev dependencies
28616
+ typescript: "^5",
28617
+ "@types/node": "^20",
28618
+ "@types/react": "^19",
28619
+ "@types/react-dom": "^19",
28620
+ "@tailwindcss/postcss": "^4",
28621
+ tailwindcss: "^4",
28622
+ eslint: "^9"
28443
28623
  };
28444
- var CORE_PACKAGES = [
28624
+ var RUNTIME_RESOLVED_PACKAGES = ["next", "eslint-config-next"];
28625
+ var NEXTLY_PACKAGES = [
28445
28626
  "nextly",
28446
28627
  "@nextlyhq/admin",
28447
- "@nextlyhq/adapter-drizzle",
28448
28628
  "@nextlyhq/ui",
28449
- "@tanstack/react-query"
28450
- ];
28451
- var ALL_ADAPTER_PACKAGES = [
28629
+ "@nextlyhq/adapter-drizzle",
28452
28630
  "@nextlyhq/adapter-postgres",
28453
28631
  "@nextlyhq/adapter-mysql",
28454
- "@nextlyhq/adapter-sqlite"
28455
- ];
28456
- var TEMPLATE_PLUGIN_PACKAGES = [
28457
- "@nextlyhq/plugin-form-builder"
28632
+ "@nextlyhq/adapter-sqlite",
28633
+ "@nextlyhq/plugin-form-builder",
28634
+ "@nextlyhq/plugin-sdk"
28458
28635
  ];
28459
- function getPackagesToInstall(database) {
28460
- return [...CORE_PACKAGES, database.adapter];
28636
+ var resolvedNextlyVersions = null;
28637
+ async function fetchLatestVersion(pkg2) {
28638
+ try {
28639
+ const res = await fetch(
28640
+ `https://registry.npmjs.org/-/package/${encodeURIComponent(pkg2)}/dist-tags`,
28641
+ { signal: AbortSignal.timeout(5e3) }
28642
+ );
28643
+ if (!res.ok) return "latest";
28644
+ const data = await res.json();
28645
+ return data.latest ? `^${data.latest}` : "latest";
28646
+ } catch {
28647
+ return "latest";
28648
+ }
28461
28649
  }
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 });
28650
+ async function resolveNextlyVersions() {
28651
+ if (resolvedNextlyVersions) return resolvedNextlyVersions;
28652
+ const entries = await Promise.all(
28653
+ NEXTLY_PACKAGES.map(
28654
+ async (pkg2) => [pkg2, await fetchLatestVersion(pkg2)]
28655
+ )
28656
+ );
28657
+ resolvedNextlyVersions = Object.fromEntries(entries);
28658
+ return resolvedNextlyVersions;
28659
+ }
28660
+ var resolvedRuntimeVersions = null;
28661
+ async function resolveRuntimeVersions() {
28662
+ if (resolvedRuntimeVersions) return resolvedRuntimeVersions;
28663
+ const FALLBACKS = {
28664
+ next: "^16.1.0",
28665
+ "eslint-config-next": "^16.1.0"
28666
+ };
28667
+ const entries = await Promise.all(
28668
+ RUNTIME_RESOLVED_PACKAGES.map(async (pkg2) => {
28669
+ const version2 = await fetchLatestVersion(pkg2);
28670
+ return [pkg2, version2 === "latest" ? FALLBACKS[pkg2] : version2];
28671
+ })
28672
+ );
28673
+ resolvedRuntimeVersions = Object.fromEntries(entries);
28674
+ return resolvedRuntimeVersions;
28675
+ }
28676
+ async function generatePackageJson(projectName, database, useYalc = false, projectType = "blank") {
28677
+ if (projectType === "plugin") {
28678
+ return generatePluginPackageJson(projectName, useYalc);
28679
+ }
28680
+ const runtimeVersions = await resolveRuntimeVersions();
28681
+ const dependencies = {
28682
+ next: runtimeVersions.next,
28683
+ react: PINNED_VERSIONS.react,
28684
+ "react-dom": PINNED_VERSIONS["react-dom"]
28685
+ };
28686
+ dependencies["@tanstack/react-query"] = "^5.62.0";
28687
+ if (!useYalc) {
28688
+ const versions = await resolveNextlyVersions();
28689
+ dependencies["nextly"] = versions["nextly"];
28690
+ dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
28691
+ dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";
28692
+ dependencies["@nextlyhq/adapter-drizzle"] = versions["@nextlyhq/adapter-drizzle"];
28693
+ dependencies[database.adapter] = versions[database.adapter] || "latest";
28694
+ if (projectUsesFormBuilder(projectType)) {
28695
+ dependencies["@nextlyhq/plugin-form-builder"] = versions["@nextlyhq/plugin-form-builder"] || "latest";
28504
28696
  }
28505
28697
  }
28506
- }
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");
28521
- var Le2 = Symbol("emittingEnd");
28522
- var jt2 = Symbol("emittedError");
28523
- var Ne2 = Symbol("closed");
28524
- var Ts = Symbol("read");
28525
- var Ae2 = Symbol("flush");
28526
- var xs = Symbol("flushChunk");
28527
- var z3 = Symbol("encoding");
28528
- var Mt2 = Symbol("decoder");
28529
- var b = Symbol("flowing");
28530
- var Qt = Symbol("paused");
28531
- var Bt2 = Symbol("resume");
28532
- var _2 = Symbol("buffer");
28698
+ const devDependencies = {
28699
+ typescript: PINNED_VERSIONS.typescript,
28700
+ "@types/node": PINNED_VERSIONS["@types/node"],
28701
+ "@types/react": PINNED_VERSIONS["@types/react"],
28702
+ "@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
28703
+ "@tailwindcss/postcss": PINNED_VERSIONS["@tailwindcss/postcss"],
28704
+ tailwindcss: PINNED_VERSIONS.tailwindcss,
28705
+ eslint: PINNED_VERSIONS.eslint,
28706
+ "eslint-config-next": runtimeVersions["eslint-config-next"],
28707
+ // Pagefind powers /search in the blog template. Zero-config
28708
+ // static index generated at `next build` time. Templates that
28709
+ // don't ship a /search page simply won't invoke it.
28710
+ pagefind: "^1.1.0"
28711
+ };
28712
+ const pkg2 = {
28713
+ name: projectName,
28714
+ version: "0.1.0",
28715
+ private: true,
28716
+ scripts: {
28717
+ // F1 PR 4: dev now boots Nextly in single-process mode via `next dev`.
28718
+ // The lazy drizzle-kit/api import (PR 1) plus the in-process HMR
28719
+ // listener (PR 2) replaced the wrapper that previously owned the
28720
+ // terminal, schema prompts, and child supervision. `nextly dev` is
28721
+ // gone; the only supported dev command is the standard `next dev`.
28722
+ dev: "next dev --turbopack",
28723
+ // Build: migrate DB + compile Next.js + (if present) generate
28724
+ // the Pagefind search index. Templates without the search
28725
+ // script silently skip the last step.
28726
+ build: "nextly migrate && next build && (test -f scripts/build-search-index.mjs && node scripts/build-search-index.mjs || true)",
28727
+ "search:index": "node scripts/build-search-index.mjs",
28728
+ start: "next start",
28729
+ lint: "next lint",
28730
+ nextly: "nextly",
28731
+ // First-time setup: sync schema + seed system permissions. Demo
28732
+ // content is seeded separately from the admin UI (visit /welcome
28733
+ // after running `pnpm dev` and completing /admin/setup).
28734
+ "db:setup": "nextly db:sync",
28735
+ "db:migrate": "nextly migrate",
28736
+ "db:migrate:status": "nextly migrate:status",
28737
+ "db:migrate:fresh": "nextly migrate:fresh",
28738
+ "db:migrate:reset": "nextly migrate:reset",
28739
+ "types:generate": "nextly generate:types"
28740
+ },
28741
+ dependencies,
28742
+ devDependencies
28743
+ };
28744
+ return JSON.stringify(pkg2, null, 2) + "\n";
28745
+ }
28746
+ async function resolvePluginNextlyRange(useYalc) {
28747
+ if (useYalc) return ">=0.0.0";
28748
+ const versions = await resolveNextlyVersions();
28749
+ const v2 = versions["nextly"];
28750
+ return v2 && v2 !== "latest" ? v2 : ">=0.0.0";
28751
+ }
28752
+ async function generatePluginPackageJson(projectName, useYalc) {
28753
+ const versions = useYalc ? {} : await resolveNextlyVersions();
28754
+ const runtimeVersions = await resolveRuntimeVersions();
28755
+ const range = (pkg3) => versions[pkg3] ?? "latest";
28756
+ const peerDependencies = {
28757
+ nextly: range("nextly"),
28758
+ "@nextlyhq/admin": range("@nextlyhq/admin"),
28759
+ "@nextlyhq/plugin-sdk": range("@nextlyhq/plugin-sdk"),
28760
+ react: PINNED_VERSIONS.react,
28761
+ "react-dom": PINNED_VERSIONS["react-dom"]
28762
+ };
28763
+ const devDependencies = {
28764
+ nextly: range("nextly"),
28765
+ "@nextlyhq/admin": range("@nextlyhq/admin"),
28766
+ "@nextlyhq/ui": range("@nextlyhq/ui"),
28767
+ "@nextlyhq/plugin-sdk": range("@nextlyhq/plugin-sdk"),
28768
+ "@nextlyhq/adapter-drizzle": range("@nextlyhq/adapter-drizzle"),
28769
+ "@nextlyhq/adapter-sqlite": range("@nextlyhq/adapter-sqlite"),
28770
+ next: runtimeVersions.next,
28771
+ react: PINNED_VERSIONS.react,
28772
+ "react-dom": PINNED_VERSIONS["react-dom"],
28773
+ "better-sqlite3": "^12.0.0",
28774
+ "@types/node": PINNED_VERSIONS["@types/node"],
28775
+ "@types/react": PINNED_VERSIONS["@types/react"],
28776
+ "@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
28777
+ typescript: PINNED_VERSIONS.typescript,
28778
+ tsup: "^8.5.0",
28779
+ vitest: "^4.0.8",
28780
+ eslint: PINNED_VERSIONS.eslint,
28781
+ "@eslint/js": PINNED_VERSIONS.eslint,
28782
+ "typescript-eslint": "^8.0.0"
28783
+ };
28784
+ const pkg2 = {
28785
+ name: projectName,
28786
+ version: "0.1.0",
28787
+ description: "A Nextly plugin.",
28788
+ type: "module",
28789
+ main: "./dist/index.mjs",
28790
+ module: "./dist/index.mjs",
28791
+ types: "./dist/index.d.ts",
28792
+ exports: {
28793
+ ".": {
28794
+ types: "./dist/index.d.ts",
28795
+ import: "./dist/index.mjs"
28796
+ },
28797
+ "./admin": {
28798
+ types: "./dist/admin/index.d.ts",
28799
+ import: "./dist/admin/index.mjs"
28800
+ }
28801
+ },
28802
+ // Only the built library ships. The dev/ playground is never published.
28803
+ files: ["dist"],
28804
+ keywords: ["nextly", "nextly-plugin"],
28805
+ scripts: {
28806
+ build: "tsup",
28807
+ // Runs the embedded playground (next dev with dev/ as the project root).
28808
+ dev: "next dev dev --turbopack",
28809
+ "check-types": "tsc --noEmit",
28810
+ lint: "eslint .",
28811
+ test: "vitest run",
28812
+ "types:generate": "nextly generate:types"
28813
+ },
28814
+ peerDependencies,
28815
+ devDependencies
28816
+ // Native build-script allowlist is NOT emitted here: pnpm 11 ignores the
28817
+ // package.json `pnpm` field. It lives in pnpm-workspace.yaml instead (written
28818
+ // by copyPluginTemplate via generatePnpmWorkspaceYaml).
28819
+ };
28820
+ return JSON.stringify(pkg2, null, 2) + "\n";
28821
+ }
28822
+ var NATIVE_BUILD_DEPENDENCIES = [
28823
+ "better-sqlite3",
28824
+ "esbuild",
28825
+ "sharp",
28826
+ "unrs-resolver"
28827
+ ];
28828
+ function generatePnpmWorkspaceYaml() {
28829
+ const allowBuilds = NATIVE_BUILD_DEPENDENCIES.map(
28830
+ (dep) => ` ${dep}: true`
28831
+ ).join("\n");
28832
+ const onlyBuilt = NATIVE_BUILD_DEPENDENCIES.map((dep) => ` - ${dep}`).join(
28833
+ "\n"
28834
+ );
28835
+ return `# Allow native dependencies to run their build scripts. pnpm 10+ blocks
28836
+ # dependency build scripts by default; without this better-sqlite3 has no
28837
+ # compiled binding (sqlite apps crash at boot) and sharp/esbuild degrade.
28838
+ #
28839
+ # pnpm 11+ reads \`allowBuilds\`; pnpm 10.6+ reads \`onlyBuiltDependencies\`.
28840
+ # npm, yarn, and pnpm 9 ignore this file (they run build scripts by default).
28841
+ allowBuilds:
28842
+ ${allowBuilds}
28843
+ onlyBuiltDependencies:
28844
+ ${onlyBuilt}
28845
+ `;
28846
+ }
28847
+ async function copyTemplate(options) {
28848
+ const {
28849
+ projectName,
28850
+ projectType,
28851
+ targetDir,
28852
+ database,
28853
+ databaseUrl,
28854
+ useYalc = false,
28855
+ approach,
28856
+ templateSource,
28857
+ allowExistingTarget = false
28858
+ } = options;
28859
+ if (!allowExistingTarget && targetDir !== process.cwd() && await import_fs_extra8.default.pathExists(targetDir)) {
28860
+ throw new Error(
28861
+ `Directory "${path15__default.default.basename(targetDir)}" already exists. Please choose a different name.`
28862
+ );
28863
+ }
28864
+ let baseDir;
28865
+ let typeDir;
28866
+ if (templateSource) {
28867
+ baseDir = templateSource.basePath;
28868
+ typeDir = templateSource.templatePath;
28869
+ } else {
28870
+ const templatesRoot = resolveTemplatePath();
28871
+ baseDir = path15__default.default.join(templatesRoot, "base");
28872
+ typeDir = path15__default.default.join(templatesRoot, projectType);
28873
+ }
28874
+ if (projectType === "plugin") {
28875
+ await copyPluginTemplate({ projectName, typeDir, targetDir, useYalc });
28876
+ return;
28877
+ }
28878
+ if (!await import_fs_extra8.default.pathExists(baseDir)) {
28879
+ throw new Error(
28880
+ `Base template not found at ${baseDir}. The package may be corrupted or the download failed.`
28881
+ );
28882
+ }
28883
+ if (!await import_fs_extra8.default.pathExists(typeDir)) {
28884
+ throw new Error(
28885
+ `Template "${projectType}" not found at ${typeDir}. Available templates: blank, blog.`
28886
+ );
28887
+ }
28888
+ await import_fs_extra8.default.copy(baseDir, targetDir, {
28889
+ filter: (_src) => {
28890
+ const basename = path15__default.default.basename(_src);
28891
+ return !SKIP_FILES.has(basename);
28892
+ }
28893
+ });
28894
+ const templateSrcDir = path15__default.default.join(typeDir, "src");
28895
+ if (await import_fs_extra8.default.pathExists(templateSrcDir)) {
28896
+ await import_fs_extra8.default.copy(templateSrcDir, path15__default.default.join(targetDir, "src"), {
28897
+ overwrite: true,
28898
+ filter: (_src) => {
28899
+ const basename = path15__default.default.basename(_src);
28900
+ return !SKIP_FILES.has(basename);
28901
+ }
28902
+ });
28903
+ }
28904
+ const templateRootConfig = path15__default.default.join(typeDir, "nextly.config.ts");
28905
+ if (await import_fs_extra8.default.pathExists(templateRootConfig)) {
28906
+ await import_fs_extra8.default.copy(
28907
+ templateRootConfig,
28908
+ path15__default.default.join(targetDir, "nextly.config.ts"),
28909
+ { overwrite: true }
28910
+ );
28911
+ }
28912
+ const configsDir = path15__default.default.join(typeDir, "configs");
28913
+ if (approach && await import_fs_extra8.default.pathExists(configsDir)) {
28914
+ const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
28915
+ const configSrc = path15__default.default.join(configsDir, configFileName);
28916
+ if (await import_fs_extra8.default.pathExists(configSrc)) {
28917
+ await import_fs_extra8.default.copy(configSrc, path15__default.default.join(targetDir, "nextly.config.ts"), {
28918
+ overwrite: true
28919
+ });
28920
+ }
28921
+ const sharedSrc = path15__default.default.join(configsDir, "shared.ts");
28922
+ if (await import_fs_extra8.default.pathExists(sharedSrc)) {
28923
+ await import_fs_extra8.default.copy(sharedSrc, path15__default.default.join(targetDir, "shared.ts"), {
28924
+ overwrite: true
28925
+ });
28926
+ }
28927
+ }
28928
+ const frontendPagePath = path15__default.default.join(
28929
+ targetDir,
28930
+ "src",
28931
+ "app",
28932
+ "(frontend)",
28933
+ "page.tsx"
28934
+ );
28935
+ const basePagePath = path15__default.default.join(targetDir, "src", "app", "page.tsx");
28936
+ if (await import_fs_extra8.default.pathExists(frontendPagePath) && await import_fs_extra8.default.pathExists(basePagePath)) {
28937
+ await import_fs_extra8.default.remove(basePagePath);
28938
+ }
28939
+ const packageJsonContent = await generatePackageJson(
28940
+ projectName,
28941
+ database,
28942
+ useYalc,
28943
+ projectType
28944
+ );
28945
+ await import_fs_extra8.default.writeFile(
28946
+ path15__default.default.join(targetDir, "package.json"),
28947
+ packageJsonContent,
28948
+ "utf-8"
28949
+ );
28950
+ await import_fs_extra8.default.writeFile(
28951
+ path15__default.default.join(targetDir, "pnpm-workspace.yaml"),
28952
+ generatePnpmWorkspaceYaml(),
28953
+ "utf-8"
28954
+ );
28955
+ if (database.type === "sqlite") {
28956
+ await import_fs_extra8.default.ensureDir(path15__default.default.join(targetDir, "data"));
28957
+ }
28958
+ await import_fs_extra8.default.writeFile(
28959
+ path15__default.default.join(targetDir, "next.config.ts"),
28960
+ buildNextConfigTemplate(database),
28961
+ "utf-8"
28962
+ );
28963
+ const placeholders = buildPlaceholderMap({ database, databaseUrl });
28964
+ if (approach) {
28965
+ placeholders["{{approach}}"] = approach;
28966
+ }
28967
+ await replacePlaceholders(targetDir, placeholders);
28968
+ }
28969
+ async function copyPluginTemplate(opts) {
28970
+ const { projectName, typeDir, targetDir, useYalc } = opts;
28971
+ if (!await import_fs_extra8.default.pathExists(typeDir)) {
28972
+ throw new Error(
28973
+ `Plugin template not found at ${typeDir}. The package may be corrupted or the download failed.`
28974
+ );
28975
+ }
28976
+ await import_fs_extra8.default.copy(typeDir, targetDir, {
28977
+ overwrite: true,
28978
+ filter: (src) => {
28979
+ const basename = path15__default.default.basename(src);
28980
+ return !SKIP_FILES.has(basename) && basename !== "template.json";
28981
+ }
28982
+ });
28983
+ const packageJsonContent = await generatePackageJson(
28984
+ projectName,
28985
+ { },
28986
+ useYalc,
28987
+ "plugin"
28988
+ );
28989
+ await import_fs_extra8.default.writeFile(
28990
+ path15__default.default.join(targetDir, "package.json"),
28991
+ packageJsonContent,
28992
+ "utf-8"
28993
+ );
28994
+ await import_fs_extra8.default.writeFile(
28995
+ path15__default.default.join(targetDir, "pnpm-workspace.yaml"),
28996
+ generatePnpmWorkspaceYaml(),
28997
+ "utf-8"
28998
+ );
28999
+ const nextlyRange = await resolvePluginNextlyRange(useYalc);
29000
+ await replacePlaceholders(
29001
+ targetDir,
29002
+ buildPlaceholderMap({ pluginName: projectName, nextlyRange })
29003
+ );
29004
+ }
29005
+
29006
+ // src/installers/dependencies.ts
29007
+ var INSTALL_COMMANDS = {
29008
+ npm: ["npm", "install"],
29009
+ yarn: ["yarn", "add"],
29010
+ pnpm: ["pnpm", "add"],
29011
+ bun: ["bun", "add"]
29012
+ };
29013
+ var CORE_PACKAGES = [
29014
+ "nextly",
29015
+ "@nextlyhq/admin",
29016
+ "@nextlyhq/adapter-drizzle",
29017
+ "@nextlyhq/ui",
29018
+ "@tanstack/react-query"
29019
+ ];
29020
+ var ALL_ADAPTER_PACKAGES = [
29021
+ "@nextlyhq/adapter-postgres",
29022
+ "@nextlyhq/adapter-mysql",
29023
+ "@nextlyhq/adapter-sqlite"
29024
+ ];
29025
+ var TEMPLATE_PLUGIN_PACKAGES = ["@nextlyhq/plugin-form-builder"];
29026
+ function templatePluginPackages(projectType) {
29027
+ return projectType && projectUsesFormBuilder(projectType) ? TEMPLATE_PLUGIN_PACKAGES : [];
29028
+ }
29029
+ function getPackagesToInstall(database) {
29030
+ return [...CORE_PACKAGES, database.adapter];
29031
+ }
29032
+ async function installDependencies(cwd, projectInfo, database, useYalc = false, isFreshProject = false, projectType) {
29033
+ const pm = projectInfo.packageManager;
29034
+ const pluginPackages = templatePluginPackages(projectType);
29035
+ if (isFreshProject) {
29036
+ if (useYalc) {
29037
+ const yalcPackages = [
29038
+ .../* @__PURE__ */ new Set([
29039
+ "nextly",
29040
+ "@nextlyhq/admin",
29041
+ "@nextlyhq/ui",
29042
+ "@nextlyhq/adapter-drizzle",
29043
+ ...ALL_ADAPTER_PACKAGES,
29044
+ ...pluginPackages
29045
+ ])
29046
+ ];
29047
+ await execa(pm, ["install"], { cwd });
29048
+ for (const pkg2 of yalcPackages) {
29049
+ await execa("yalc", ["add", pkg2], { cwd });
29050
+ }
29051
+ await execa(pm, ["install"], { cwd });
29052
+ } else {
29053
+ await execa(pm, ["install"], { cwd });
29054
+ }
29055
+ } else {
29056
+ const allPackages = getPackagesToInstall(database);
29057
+ if (useYalc) {
29058
+ const yalcPackages = [
29059
+ .../* @__PURE__ */ new Set([
29060
+ "nextly",
29061
+ "@nextlyhq/admin",
29062
+ "@nextlyhq/ui",
29063
+ "@nextlyhq/adapter-drizzle",
29064
+ ...ALL_ADAPTER_PACKAGES,
29065
+ ...pluginPackages
29066
+ ])
29067
+ ];
29068
+ for (const pkg2 of yalcPackages) {
29069
+ await execa("yalc", ["add", pkg2], { cwd });
29070
+ }
29071
+ await execa(pm, ["install"], { cwd });
29072
+ } else {
29073
+ const [cmd, ...args] = INSTALL_COMMANDS[pm];
29074
+ await execa(cmd, [...args, ...allPackages], { cwd });
29075
+ }
29076
+ }
29077
+ }
29078
+
29079
+ // src/lib/download-template.ts
29080
+ var import_fs_extra9 = __toESM(require_lib());
29081
+ var kr = Object.defineProperty;
29082
+ var vr = (s3, t2) => {
29083
+ for (var e in t2) kr(s3, e, { get: t2[e], enumerable: true });
29084
+ };
29085
+ var Os = typeof process == "object" && process ? process : { stdout: null, stderr: null };
29086
+ var Br = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof D3 || s3 instanceof Ns__default.default || Pr(s3) || zr(s3));
29087
+ var Pr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.pipe == "function" && s3.pipe !== Ns__default.default.Writable.prototype.pipe;
29088
+ var zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
29089
+ var q3 = Symbol("EOF");
29090
+ var j2 = Symbol("maybeEmitEnd");
29091
+ var rt2 = Symbol("emittedEnd");
29092
+ var Le2 = Symbol("emittingEnd");
29093
+ var jt2 = Symbol("emittedError");
29094
+ var Ne2 = Symbol("closed");
29095
+ var Ts = Symbol("read");
29096
+ var Ae2 = Symbol("flush");
29097
+ var xs = Symbol("flushChunk");
29098
+ var z3 = Symbol("encoding");
29099
+ var Mt2 = Symbol("decoder");
29100
+ var b = Symbol("flowing");
29101
+ var Qt = Symbol("paused");
29102
+ var Bt2 = Symbol("resume");
29103
+ var _2 = Symbol("buffer");
28533
29104
  var A = Symbol("pipes");
28534
29105
  var g = Symbol("bufferLength");
28535
29106
  var yi = Symbol("bufferPush");
@@ -29399,12 +29970,12 @@ var F = class {
29399
29970
  }
29400
29971
  };
29401
29972
  var an = (s3, t2) => {
29402
- let i2 = s3, r = "", n2, o2 = path.posix.parse(s3).root || ".";
29973
+ let i2 = s3, r = "", n2, o2 = path15.posix.parse(s3).root || ".";
29403
29974
  if (Buffer.byteLength(i2) < 100) n2 = [i2, r, false];
29404
29975
  else {
29405
- r = path.posix.dirname(i2), i2 = path.posix.basename(i2);
29976
+ r = path15.posix.dirname(i2), i2 = path15.posix.basename(i2);
29406
29977
  do
29407
- Buffer.byteLength(i2) <= 100 && Buffer.byteLength(r) <= t2 ? n2 = [i2, r, false] : Buffer.byteLength(i2) > 100 && Buffer.byteLength(r) <= t2 ? n2 = [i2.slice(0, 99), r, true] : (i2 = path.posix.join(path.posix.basename(r), i2), r = path.posix.dirname(r));
29978
+ Buffer.byteLength(i2) <= 100 && Buffer.byteLength(r) <= t2 ? n2 = [i2, r, false] : Buffer.byteLength(i2) > 100 && Buffer.byteLength(r) <= t2 ? n2 = [i2.slice(0, 99), r, true] : (i2 = path15.posix.join(path15.posix.basename(r), i2), r = path15.posix.dirname(r));
29408
29979
  while (r !== o2 && n2 === void 0);
29409
29980
  n2 || (n2 = [s3.slice(0, 99), "", true]);
29410
29981
  }
@@ -29450,7 +30021,7 @@ var ct2 = class s {
29450
30021
  if (t2 === "") return Buffer.allocUnsafe(0);
29451
30022
  let e = Buffer.byteLength(t2), i2 = 512 * Math.ceil(1 + e / 512), r = Buffer.allocUnsafe(i2);
29452
30023
  for (let n2 = 0; n2 < 512; n2++) r[n2] = 0;
29453
- new F({ path: ("PaxHeader/" + path.basename(this.path ?? "")).slice(0, 99), mode: this.mode || 420, uid: this.uid, gid: this.gid, size: e, mtime: this.mtime, type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", linkpath: "", uname: this.uname || "", gname: this.gname || "", devmaj: 0, devmin: 0, atime: this.atime, ctime: this.ctime }).encode(r), r.write(t2, 512, e, "utf8");
30024
+ new F({ path: ("PaxHeader/" + path15.basename(this.path ?? "")).slice(0, 99), mode: this.mode || 420, uid: this.uid, gid: this.gid, size: e, mtime: this.mtime, type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", linkpath: "", uname: this.uname || "", gname: this.gname || "", devmaj: 0, devmin: 0, atime: this.atime, ctime: this.ctime }).encode(r), r.write(t2, 512, e, "utf8");
29454
30025
  for (let n2 = e + 512; n2 < r.length; n2++) r[n2] = 0;
29455
30026
  return r;
29456
30027
  }
@@ -29812,11 +30383,11 @@ var Nn = (s3) => {
29812
30383
  };
29813
30384
  var Ki = (s3, t2) => {
29814
30385
  let e = new Map(t2.map((n2) => [mt3(n2), true])), i2 = s3.filter, r = (n2, o2 = "") => {
29815
- let h3 = o2 || path.parse(n2).root || ".", a2;
30386
+ let h3 = o2 || path15.parse(n2).root || ".", a2;
29816
30387
  if (n2 === h3) a2 = false;
29817
30388
  else {
29818
30389
  let l = e.get(n2);
29819
- a2 = l !== void 0 ? l : r(path.dirname(n2), h3);
30390
+ a2 = l !== void 0 ? l : r(path15.dirname(n2), h3);
29820
30391
  }
29821
30392
  return e.set(n2, a2), a2;
29822
30393
  };
@@ -29862,7 +30433,7 @@ var It3 = K2(An, Dn, (s3) => new st2(s3), (s3) => new st2(s3), (s3, t2) => {
29862
30433
  t2?.length && Ki(s3, t2), s3.noResume || Nn(s3);
29863
30434
  });
29864
30435
  var Vi = (s3, t2, e) => (s3 &= 4095, e && (s3 = (s3 | 384) & -19), t2 && (s3 & 256 && (s3 |= 64), s3 & 32 && (s3 |= 8), s3 & 4 && (s3 |= 1)), s3);
29865
- var { isAbsolute: Cn, parse: Ys } = path.win32;
30436
+ var { isAbsolute: Cn, parse: Ys } = path15.win32;
29866
30437
  var ce2 = (s3) => {
29867
30438
  let t2 = "", e = Ys(s3);
29868
30439
  for (; Cn(s3) || e.root; ) {
@@ -29936,7 +30507,7 @@ var de2 = class extends D3 {
29936
30507
  let [o2, h3] = ce2(this.path);
29937
30508
  o2 && typeof h3 == "string" && (this.path = h3, r = o2);
29938
30509
  }
29939
- this.win32 = !!i2.win32 || process.platform === "win32", this.win32 && (this.path = Ks(this.path.replaceAll(/\\/g, "/")), t2 = t2.replaceAll(/\\/g, "/")), this.absolute = f(i2.absolute || path__default.default.resolve(this.cwd, t2)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, { entry: this, path: r + this.path });
30510
+ this.win32 = !!i2.win32 || process.platform === "win32", this.win32 && (this.path = Ks(this.path.replaceAll(/\\/g, "/")), t2 = t2.replaceAll(/\\/g, "/")), this.absolute = f(i2.absolute || path15__default.default.resolve(this.cwd, t2)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, { entry: this, path: r + this.path });
29940
30511
  let n2 = this.statCache.get(this.absolute);
29941
30512
  n2 ? this[ei](n2) : this[Qi]();
29942
30513
  }
@@ -29995,7 +30566,7 @@ var de2 = class extends D3 {
29995
30566
  }
29996
30567
  [Qs](t2) {
29997
30568
  if (!this.stat) throw new Error("cannot create link entry without stat");
29998
- this.type = "Link", this.linkpath = f(path__default.default.relative(this.cwd, t2)), this.stat.size = 0, this[fe2](), this.end();
30569
+ this.type = "Link", this.linkpath = f(path15__default.default.relative(this.cwd, t2)), this.stat.size = 0, this[fe2](), this.end();
29999
30570
  }
30000
30571
  [qs]() {
30001
30572
  if (!this.stat) throw new Error("cannot create file entry without stat");
@@ -30406,7 +30977,7 @@ var Et3 = class extends D3 {
30406
30977
  return t2 instanceof Yt ? this[er](t2) : this[hi](t2), this.flowing;
30407
30978
  }
30408
30979
  [er](t2) {
30409
- let e = f(path__default.default.resolve(this.cwd, t2.path));
30980
+ let e = f(path15__default.default.resolve(this.cwd, t2.path));
30410
30981
  if (!this.filter(t2.path, t2)) t2.resume();
30411
30982
  else {
30412
30983
  let i2 = new di(t2.path, e);
@@ -30415,7 +30986,7 @@ var Et3 = class extends D3 {
30415
30986
  this[Ft3]();
30416
30987
  }
30417
30988
  [hi](t2) {
30418
- let e = f(path__default.default.resolve(this.cwd, t2));
30989
+ let e = f(path15__default.default.resolve(this.cwd, t2));
30419
30990
  this[W3].push(new di(t2, e)), this[Ft3]();
30420
30991
  }
30421
30992
  [as](t2) {
@@ -30553,11 +31124,11 @@ var Hn = (s3, t2) => {
30553
31124
  };
30554
31125
  var or = (s3, t2) => {
30555
31126
  t2.forEach((e) => {
30556
- e.charAt(0) === "@" ? It3({ file: path__default.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
31127
+ e.charAt(0) === "@" ? It3({ file: path15__default.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
30557
31128
  }), s3.end();
30558
31129
  };
30559
31130
  var hr = async (s3, t2) => {
30560
- for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path__default.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => {
31131
+ for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path15__default.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => {
30561
31132
  s3.add(i2);
30562
31133
  } }) : s3.add(e);
30563
31134
  s3.end();
@@ -30582,7 +31153,7 @@ var Vn = 512 * 1024;
30582
31153
  var $n = pr | ur | dr | mr;
30583
31154
  var lr = !fr && typeof ar == "number" ? ar | ur | dr | mr : null;
30584
31155
  var cs = lr !== null ? () => lr : Kn ? (s3) => s3 < Vn ? $n : "w" : () => "w";
30585
- var fs9 = (s3, t2, e) => {
31156
+ var fs10 = (s3, t2, e) => {
30586
31157
  try {
30587
31158
  return fs__default.default.lchownSync(s3, t2, e);
30588
31159
  } catch (i2) {
@@ -30595,13 +31166,13 @@ var ui = (s3, t2, e, i2) => {
30595
31166
  });
30596
31167
  };
30597
31168
  var Xn = (s3, t2, e, i2, r) => {
30598
- if (t2.isDirectory()) ds(path__default.default.resolve(s3, t2.name), e, i2, (n2) => {
31169
+ if (t2.isDirectory()) ds(path15__default.default.resolve(s3, t2.name), e, i2, (n2) => {
30599
31170
  if (n2) return r(n2);
30600
- let o2 = path__default.default.resolve(s3, t2.name);
31171
+ let o2 = path15__default.default.resolve(s3, t2.name);
30601
31172
  ui(o2, e, i2, r);
30602
31173
  });
30603
31174
  else {
30604
- let n2 = path__default.default.resolve(s3, t2.name);
31175
+ let n2 = path15__default.default.resolve(s3, t2.name);
30605
31176
  ui(n2, e, i2, r);
30606
31177
  }
30607
31178
  };
@@ -30622,7 +31193,7 @@ var ds = (s3, t2, e, i2) => {
30622
31193
  });
30623
31194
  };
30624
31195
  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);
31196
+ t2.isDirectory() && us(path15__default.default.resolve(s3, t2.name), e, i2), fs10(path15__default.default.resolve(s3, t2.name), e, i2);
30626
31197
  };
30627
31198
  var us = (s3, t2, e) => {
30628
31199
  let i2;
@@ -30631,11 +31202,11 @@ var us = (s3, t2, e) => {
30631
31202
  } catch (r) {
30632
31203
  let n2 = r;
30633
31204
  if (n2?.code === "ENOENT") return;
30634
- if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return fs9(s3, t2, e);
31205
+ if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return fs10(s3, t2, e);
30635
31206
  throw n2;
30636
31207
  }
30637
31208
  for (let r of i2) qn(s3, r, t2, e);
30638
- return fs9(s3, t2, e);
31209
+ return fs10(s3, t2, e);
30639
31210
  };
30640
31211
  var we2 = class extends Error {
30641
31212
  path;
@@ -30672,12 +31243,12 @@ var Er = (s3, t2, e) => {
30672
31243
  };
30673
31244
  if (s3 === d) return Qn(s3, S2);
30674
31245
  if (l) return jn__default.default.mkdir(s3, { mode: r, recursive: true }).then((E) => S2(null, E ?? void 0), S2);
30675
- let N3 = f(path__default.default.relative(d, s3)).split("/");
31246
+ let N3 = f(path15__default.default.relative(d, s3)).split("/");
30676
31247
  ms(d, N3, r, c3, d, void 0, S2);
30677
31248
  };
30678
31249
  var ms = (s3, t2, e, i2, r, n2, o2) => {
30679
31250
  if (t2.length === 0) return o2(null, n2);
30680
- let h3 = t2.shift(), a2 = f(path__default.default.resolve(s3 + "/" + h3));
31251
+ let h3 = t2.shift(), a2 = f(path15__default.default.resolve(s3 + "/" + h3));
30681
31252
  fs__default.default.mkdir(a2, e, wr(a2, t2, e, i2, r, n2, o2));
30682
31253
  };
30683
31254
  var wr = (s3, t2, e, i2, r, n2, o2) => (h3) => {
@@ -30711,9 +31282,9 @@ var Sr = (s3, t2) => {
30711
31282
  };
30712
31283
  if (s3 === c3) return Jn(c3), d();
30713
31284
  if (a2) return d(fs__default.default.mkdirSync(s3, { mode: i2, recursive: true }) ?? void 0);
30714
- let T2 = f(path__default.default.relative(c3, s3)).split("/"), N3;
31285
+ let T2 = f(path15__default.default.relative(c3, s3)).split("/"), N3;
30715
31286
  for (let E = T2.shift(), x3 = c3; E && (x3 += "/" + E); E = T2.shift()) {
30716
- x3 = f(path__default.default.resolve(x3));
31287
+ x3 = f(path15__default.default.resolve(x3));
30717
31288
  try {
30718
31289
  fs__default.default.mkdirSync(x3, i2), N3 = N3 || x3;
30719
31290
  } catch {
@@ -30742,14 +31313,14 @@ var to = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
30742
31313
  var eo = to === "win32";
30743
31314
  var io = (s3) => s3.split("/").slice(0, -1).reduce((e, i2) => {
30744
31315
  let r = e.at(-1);
30745
- return r !== void 0 && (i2 = path.join(r, i2)), e.push(i2 || "/"), e;
31316
+ return r !== void 0 && (i2 = path15.join(r, i2)), e.push(i2 || "/"), e;
30746
31317
  }, []);
30747
31318
  var Ei = class {
30748
31319
  #t = /* @__PURE__ */ new Map();
30749
31320
  #i = /* @__PURE__ */ new Map();
30750
31321
  #s = /* @__PURE__ */ new Set();
30751
31322
  reserve(t2, e) {
30752
- t2 = eo ? ["win32 parallelization disabled"] : t2.map((r) => mt3(path.join(Rr(r))));
31323
+ t2 = eo ? ["win32 parallelization disabled"] : t2.map((r) => mt3(path15.join(Rr(r))));
30753
31324
  let i2 = new Set(t2.map((r) => io(r)).reduce((r, n2) => r.concat(n2)));
30754
31325
  this.#i.set(e, { dirs: i2, paths: t2 });
30755
31326
  for (let r of t2) {
@@ -30889,7 +31460,7 @@ var qt = class extends st2 {
30889
31460
  if (t2.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
30890
31461
  this.uid = t2.uid, this.gid = t2.gid, this.setOwner = true;
30891
31462
  } else this.uid = void 0, this.gid = void 0, this.setOwner = false;
30892
- this.preserveOwner = t2.preserveOwner === void 0 && typeof t2.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t2.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t2.maxDepth == "number" ? t2.maxDepth : no, this.forceChown = t2.forceChown === true, this.win32 = !!t2.win32 || Oe2, this.newer = !!t2.newer, this.keep = !!t2.keep, this.noMtime = !!t2.noMtime, this.preservePaths = !!t2.preservePaths, this.unlink = !!t2.unlink, this.cwd = f(path__default.default.resolve(t2.cwd || process.cwd())), this.strip = Number(t2.strip) || 0, this.processUmask = this.chmod ? typeof t2.processUmask == "number" ? t2.processUmask : _r() : 0, this.umask = typeof t2.umask == "number" ? t2.umask : this.processUmask, this.dmode = t2.dmode || 511 & ~this.umask, this.fmode = t2.fmode || 438 & ~this.umask, this.on("entry", (e) => this[gr](e));
31463
+ this.preserveOwner = t2.preserveOwner === void 0 && typeof t2.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t2.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t2.maxDepth == "number" ? t2.maxDepth : no, this.forceChown = t2.forceChown === true, this.win32 = !!t2.win32 || Oe2, this.newer = !!t2.newer, this.keep = !!t2.keep, this.noMtime = !!t2.noMtime, this.preservePaths = !!t2.preservePaths, this.unlink = !!t2.unlink, this.cwd = f(path15__default.default.resolve(t2.cwd || process.cwd())), this.strip = Number(t2.strip) || 0, this.processUmask = this.chmod ? typeof t2.processUmask == "number" ? t2.processUmask : _r() : 0, this.umask = typeof t2.umask == "number" ? t2.umask : this.processUmask, this.dmode = t2.dmode || 511 & ~this.umask, this.fmode = t2.fmode || 438 & ~this.umask, this.on("entry", (e) => this[gr](e));
30893
31464
  }
30894
31465
  warn(t2, e, i2 = {}) {
30895
31466
  return (t2 === "TAR_BAD_ARCHIVE" || t2 === "TAR_ABORT") && (i2.recoverable = false), super.warn(t2, e, i2);
@@ -30903,7 +31474,7 @@ var qt = class extends st2 {
30903
31474
  let [n2, o2] = ce2(i2), h3 = o2.replaceAll(/\\/g, "/").split("/");
30904
31475
  if (h3.includes("..") || Oe2 && /^[a-z]:\.\.$/i.test(h3[0] ?? "")) {
30905
31476
  if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t2, [e]: i2 }), false;
30906
- let a2 = path__default.default.posix.dirname(t2.path), l = path__default.default.posix.normalize(path__default.default.posix.join(a2, h3.join("/")));
31477
+ let a2 = path15__default.default.posix.dirname(t2.path), l = path15__default.default.posix.normalize(path15__default.default.posix.join(a2, h3.join("/")));
30907
31478
  if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t2, [e]: i2 }), false;
30908
31479
  }
30909
31480
  return n2 && (t2[e] = String(o2), this.warn("TAR_ENTRY_INFO", `stripping ${n2} from absolute ${e}`, { entry: t2, [e]: i2 })), true;
@@ -30921,12 +31492,12 @@ var qt = class extends st2 {
30921
31492
  }
30922
31493
  if (isFinite(this.maxDepth) && i2.length > this.maxDepth) return this.warn("TAR_ENTRY_ERROR", "path excessively deep", { entry: t2, path: e, depth: i2.length, maxDepth: this.maxDepth }), false;
30923
31494
  if (!this[Es](t2, "path") || !this[Es](t2, "linkpath")) return false;
30924
- if (t2.absolute = path__default.default.isAbsolute(t2.path) ? f(path__default.default.resolve(t2.path)) : f(path__default.default.resolve(this.cwd, t2.path)), !this.preservePaths && typeof t2.absolute == "string" && t2.absolute.indexOf(this.cwd + "/") !== 0 && t2.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { entry: t2, path: f(t2.path), resolvedPath: t2.absolute, cwd: this.cwd }), false;
31495
+ if (t2.absolute = path15__default.default.isAbsolute(t2.path) ? f(path15__default.default.resolve(t2.path)) : f(path15__default.default.resolve(this.cwd, t2.path)), !this.preservePaths && typeof t2.absolute == "string" && t2.absolute.indexOf(this.cwd + "/") !== 0 && t2.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { entry: t2, path: f(t2.path), resolvedPath: t2.absolute, cwd: this.cwd }), false;
30925
31496
  if (t2.absolute === this.cwd && t2.type !== "Directory" && t2.type !== "GNUDumpDir") return false;
30926
31497
  if (this.win32) {
30927
- let { root: r } = path__default.default.win32.parse(String(t2.absolute));
31498
+ let { root: r } = path15__default.default.win32.parse(String(t2.absolute));
30928
31499
  t2.absolute = r + Xi(String(t2.absolute).slice(r.length));
30929
- let { root: n2 } = path__default.default.win32.parse(t2.path);
31500
+ let { root: n2 } = path15__default.default.win32.parse(t2.path);
30930
31501
  t2.path = n2 + Xi(t2.path.slice(n2.length));
30931
31502
  }
30932
31503
  return true;
@@ -31014,13 +31585,13 @@ var qt = class extends st2 {
31014
31585
  t2.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t2.type}`, { entry: t2 }), t2.resume();
31015
31586
  }
31016
31587
  [Tr](t2, e) {
31017
- let i2 = f(path__default.default.relative(this.cwd, path__default.default.resolve(path__default.default.dirname(String(t2.absolute)), String(t2.linkpath)))).split("/");
31588
+ let i2 = f(path15__default.default.relative(this.cwd, path15__default.default.resolve(path15__default.default.dirname(String(t2.absolute)), String(t2.linkpath)))).split("/");
31018
31589
  this[ye2](t2, this.cwd, i2, () => this[Si](t2, String(t2.linkpath), "symlink", e), (r) => {
31019
31590
  this[O2](r, t2), e();
31020
31591
  });
31021
31592
  }
31022
31593
  [xr](t2, e) {
31023
- let i2 = f(path__default.default.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
31594
+ let i2 = f(path15__default.default.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
31024
31595
  this[ye2](t2, this.cwd, r, () => this[Si](t2, i2, "link", e), (n2) => {
31025
31596
  this[O2](n2, t2), e();
31026
31597
  });
@@ -31028,10 +31599,10 @@ var qt = class extends st2 {
31028
31599
  [ye2](t2, e, i2, r, n2) {
31029
31600
  let o2 = i2.shift();
31030
31601
  if (this.preservePaths || o2 === void 0) return r();
31031
- let h3 = path__default.default.resolve(e, o2);
31602
+ let h3 = path15__default.default.resolve(e, o2);
31032
31603
  fs__default.default.lstat(h3, (a2, l) => {
31033
31604
  if (a2) return r();
31034
- if (l?.isSymbolicLink()) return n2(new wt2(h3, path__default.default.resolve(h3, i2.join("/"))));
31605
+ if (l?.isSymbolicLink()) return n2(new wt2(h3, path15__default.default.resolve(h3, i2.join("/"))));
31035
31606
  this[ye2](t2, h3, i2, r, n2);
31036
31607
  });
31037
31608
  }
@@ -31065,7 +31636,7 @@ var qt = class extends st2 {
31065
31636
  });
31066
31637
  }, n2 = () => {
31067
31638
  if (t2.absolute !== this.cwd) {
31068
- let h3 = f(path__default.default.dirname(String(t2.absolute)));
31639
+ let h3 = f(path15__default.default.dirname(String(t2.absolute)));
31069
31640
  if (h3 !== this.cwd) return this[St2](h3, this.dmode, (a2) => {
31070
31641
  if (a2) {
31071
31642
  this[O2](a2, t2), i2();
@@ -31140,7 +31711,7 @@ var Te2 = class extends qt {
31140
31711
  this[ge2] = true;
31141
31712
  }
31142
31713
  if (t2.absolute !== this.cwd) {
31143
- let n2 = f(path__default.default.dirname(String(t2.absolute)));
31714
+ let n2 = f(path15__default.default.dirname(String(t2.absolute)));
31144
31715
  if (n2 !== this.cwd) {
31145
31716
  let o2 = this[St2](n2, this.dmode);
31146
31717
  if (o2) return this[O2](o2, t2);
@@ -31240,10 +31811,10 @@ var Te2 = class extends qt {
31240
31811
  if (this.preservePaths || i2.length === 0) return r();
31241
31812
  let o2 = e;
31242
31813
  for (let h3 of i2) {
31243
- o2 = path__default.default.resolve(o2, h3);
31814
+ o2 = path15__default.default.resolve(o2, h3);
31244
31815
  let [a2, l] = Se2(() => fs__default.default.lstatSync(o2));
31245
31816
  if (a2) return r();
31246
- if (l.isSymbolicLink()) return n2(new wt2(o2, path__default.default.resolve(e, i2.join("/"))));
31817
+ if (l.isSymbolicLink()) return n2(new wt2(o2, path15__default.default.resolve(e, i2.join("/"))));
31247
31818
  }
31248
31819
  r();
31249
31820
  }
@@ -31347,11 +31918,11 @@ var mo = (s3, t2) => {
31347
31918
  };
31348
31919
  var po = (s3, t2) => {
31349
31920
  t2.forEach((e) => {
31350
- e.charAt(0) === "@" ? It3({ file: path__default.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
31921
+ e.charAt(0) === "@" ? It3({ file: path15__default.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
31351
31922
  }), s3.end();
31352
31923
  };
31353
31924
  var Eo = async (s3, t2) => {
31354
- for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path__default.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
31925
+ for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path15__default.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
31355
31926
  s3.end();
31356
31927
  };
31357
31928
  var vt3 = K2(fo, mo, () => {
@@ -31376,11 +31947,11 @@ var GITHUB_ORG = "nextlyhq";
31376
31947
  var GITHUB_REPO = "nextly";
31377
31948
  async function downloadTemplate(templateName, branch = "main") {
31378
31949
  const url = `https://codeload.github.com/${GITHUB_ORG}/${GITHUB_REPO}/tar.gz/${branch}`;
31379
- const tmpDir = path__default.default.join(
31950
+ const tmpDir = path15__default.default.join(
31380
31951
  process.env.TMPDIR || "/tmp",
31381
31952
  `nextly-template-${Date.now()}`
31382
31953
  );
31383
- await import_fs_extra8.default.ensureDir(tmpDir);
31954
+ await import_fs_extra9.default.ensureDir(tmpDir);
31384
31955
  const repoPrefix = `${GITHUB_REPO}-${branch}`;
31385
31956
  const baseFilter = `${repoPrefix}/templates/base/`;
31386
31957
  const templateFilter = `${repoPrefix}/templates/${templateName}/`;
@@ -31409,7 +31980,7 @@ async function downloadTemplate(templateName, branch = "main") {
31409
31980
  })
31410
31981
  );
31411
31982
  } catch (error) {
31412
- await import_fs_extra8.default.remove(tmpDir).catch(() => {
31983
+ await import_fs_extra9.default.remove(tmpDir).catch(() => {
31413
31984
  });
31414
31985
  if (error instanceof Error && error.name === "TimeoutError") {
31415
31986
  throw new Error(
@@ -31418,17 +31989,17 @@ async function downloadTemplate(templateName, branch = "main") {
31418
31989
  }
31419
31990
  throw error;
31420
31991
  }
31421
- const basePath = path__default.default.join(tmpDir, "templates", "base");
31422
- 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(() => {
31992
+ const basePath = path15__default.default.join(tmpDir, "templates", "base");
31993
+ const templatePath = path15__default.default.join(tmpDir, "templates", templateName);
31994
+ if (!await import_fs_extra9.default.pathExists(basePath)) {
31995
+ await import_fs_extra9.default.remove(tmpDir).catch(() => {
31425
31996
  });
31426
31997
  throw new Error(
31427
31998
  `Base template not found in downloaded archive. The branch "${branch}" may not contain templates.`
31428
31999
  );
31429
32000
  }
31430
- if (!await import_fs_extra8.default.pathExists(templatePath)) {
31431
- await import_fs_extra8.default.remove(tmpDir).catch(() => {
32001
+ if (!await import_fs_extra9.default.pathExists(templatePath)) {
32002
+ await import_fs_extra9.default.remove(tmpDir).catch(() => {
31432
32003
  });
31433
32004
  throw new Error(
31434
32005
  `Template "${templateName}" not found in downloaded archive. Available templates may differ on branch "${branch}".`
@@ -31437,14 +32008,14 @@ async function downloadTemplate(templateName, branch = "main") {
31437
32008
  return { basePath, templatePath };
31438
32009
  }
31439
32010
  async function resolveLocalTemplate(localPath, templateName) {
31440
- const basePath = path__default.default.join(localPath, "base");
31441
- const templatePath = path__default.default.join(localPath, templateName);
31442
- if (!await import_fs_extra8.default.pathExists(basePath)) {
32011
+ const basePath = path15__default.default.join(localPath, "base");
32012
+ const templatePath = path15__default.default.join(localPath, templateName);
32013
+ if (!await import_fs_extra9.default.pathExists(basePath)) {
31443
32014
  throw new Error(
31444
32015
  `Base template not found at ${basePath}. Check the --local-template path points to the templates/ directory.`
31445
32016
  );
31446
32017
  }
31447
- if (!await import_fs_extra8.default.pathExists(templatePath)) {
32018
+ if (!await import_fs_extra9.default.pathExists(templatePath)) {
31448
32019
  throw new Error(
31449
32020
  `Template "${templateName}" not found at ${templatePath}. Check the --local-template path points to the templates/ directory.`
31450
32021
  );
@@ -31461,8 +32032,8 @@ async function resolveTemplateSource(templateName, options = {}) {
31461
32032
  async function cleanupDownload(source) {
31462
32033
  const tmpBase = process.env.TMPDIR || "/tmp";
31463
32034
  if (source.basePath.startsWith(tmpBase)) {
31464
- const extractionRoot = path__default.default.resolve(source.basePath, "../..");
31465
- await import_fs_extra8.default.remove(extractionRoot).catch(() => {
32035
+ const extractionRoot = path15__default.default.resolve(source.basePath, "../..");
32036
+ await import_fs_extra9.default.remove(extractionRoot).catch(() => {
31466
32037
  });
31467
32038
  }
31468
32039
  }
@@ -31496,6 +32067,22 @@ var AVAILABLE_TEMPLATES = [
31496
32067
  hasFrontendPages: true,
31497
32068
  recommendedDatabase: "any",
31498
32069
  release: "alpha"
32070
+ },
32071
+ {
32072
+ name: "plugin",
32073
+ label: "Plugin",
32074
+ description: "Build a reusable Nextly plugin (publishable npm package)",
32075
+ hint: "Plugin package + embedded /dev playground; no schema approach",
32076
+ // Plugins don't ask code-first vs visual, ship no app frontend, and bring
32077
+ // their own collections — they are a publishable library, not an app.
32078
+ approaches: [],
32079
+ defaultApproach: null,
32080
+ collections: [],
32081
+ singles: [],
32082
+ hasDemoData: false,
32083
+ hasFrontendPages: false,
32084
+ recommendedDatabase: "sqlite",
32085
+ release: "alpha"
31499
32086
  }
31500
32087
  ];
31501
32088
  function getTemplate(name) {
@@ -31564,14 +32151,12 @@ var DATABASE_LABELS = {
31564
32151
  hint: "Popular alternative for production"
31565
32152
  }
31566
32153
  };
31567
-
31568
- // src/prompts/project-name.ts
31569
- var import_fs_extra9 = __toESM(require_lib());
32154
+ var import_fs_extra10 = __toESM(require_lib());
31570
32155
  async function isExistingNextProject(cwd) {
31571
- const packageJsonPath = path__default.default.join(cwd, "package.json");
31572
- if (!await import_fs_extra9.default.pathExists(packageJsonPath)) return false;
32156
+ const packageJsonPath = path15__default.default.join(cwd, "package.json");
32157
+ if (!await import_fs_extra10.default.pathExists(packageJsonPath)) return false;
31573
32158
  try {
31574
- const packageJson = await import_fs_extra9.default.readJson(packageJsonPath);
32159
+ const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
31575
32160
  const deps = {
31576
32161
  ...packageJson.dependencies,
31577
32162
  ...packageJson.devDependencies
@@ -31581,6 +32166,42 @@ async function isExistingNextProject(cwd) {
31581
32166
  return false;
31582
32167
  }
31583
32168
  }
32169
+ var DEFAULT_PROJECT_NAME = "my-nextly-app";
32170
+ async function promptForProjectName() {
32171
+ const answer = await Zt({
32172
+ message: "What should your project be called?",
32173
+ // `initialValue` pre-fills the buffer so Enter accepts the default.
32174
+ // The previous version used `placeholder` alone, which returned an
32175
+ // empty string on Enter and silently fell through to a cwd install —
32176
+ // the root cause of the original bug. `placeholder` is omitted here
32177
+ // because clack only shows it when the buffer is empty, and the
32178
+ // initialValue keeps it populated.
32179
+ initialValue: DEFAULT_PROJECT_NAME,
32180
+ validate: validateProjectNamePromptInput
32181
+ });
32182
+ if (Ct(answer)) {
32183
+ return { kind: "cancelled" };
32184
+ }
32185
+ return { kind: "resolved", value: resolveProjectArg(answer) };
32186
+ }
32187
+ async function promptDirectoryConflict(targetLabel) {
32188
+ const choice = await Jt({
32189
+ message: `Target directory ${targetLabel} is not empty. How would you like to proceed?`,
32190
+ options: [
32191
+ { value: "cancel", label: "Cancel operation" },
32192
+ {
32193
+ value: "remove",
32194
+ label: "Remove existing files and continue"
32195
+ },
32196
+ {
32197
+ value: "ignore",
32198
+ label: "Ignore files and continue"
32199
+ }
32200
+ ]
32201
+ });
32202
+ if (Ct(choice)) return "cancel";
32203
+ return choice;
32204
+ }
31584
32205
 
31585
32206
  // src/prompts/template.ts
31586
32207
  var import_picocolors2 = __toESM(require_picocolors2());
@@ -31596,6 +32217,11 @@ function getTemplatePromptOptions() {
31596
32217
  label: "Blog",
31597
32218
  hint: "Posts, authors, categories, clean design"
31598
32219
  },
32220
+ {
32221
+ value: "plugin",
32222
+ label: "Plugin",
32223
+ hint: "Build a reusable Nextly plugin + embedded /dev playground"
32224
+ },
31599
32225
  {
31600
32226
  value: "_coming_soon",
31601
32227
  label: import_picocolors2.default.dim("More templates coming soon"),
@@ -31603,388 +32229,105 @@ function getTemplatePromptOptions() {
31603
32229
  }
31604
32230
  ];
31605
32231
  }
31606
- function isValidTemplateSelection(value) {
31607
- return value !== "_coming_soon";
31608
- }
31609
-
31610
- // src/utils/detect.ts
31611
- var import_fs_extra10 = __toESM(require_lib());
31612
-
31613
- // src/utils/detect-pm-from-user-agent.ts
31614
- function detectPmFromUserAgent(userAgent) {
31615
- if (!userAgent) return null;
31616
- if (userAgent.startsWith("pnpm/")) return "pnpm";
31617
- if (userAgent.startsWith("yarn/")) return "yarn";
31618
- if (userAgent.startsWith("bun/")) return "bun";
31619
- if (userAgent.startsWith("npm/")) return "npm";
31620
- return null;
31621
- }
31622
-
31623
- // src/utils/detect.ts
31624
- async function detectPackageManager2(cwd) {
31625
- const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
31626
- 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";
31630
- return "npm";
31631
- }
31632
- async function detectProject(cwd) {
31633
- const packageJsonPath = path__default.default.join(cwd, "package.json");
31634
- if (!await import_fs_extra10.default.pathExists(packageJsonPath)) {
31635
- throw new Error(
31636
- "No package.json found. Please run this command in a Next.js project."
31637
- );
31638
- }
31639
- const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
31640
- const deps = {
31641
- ...packageJson.dependencies,
31642
- ...packageJson.devDependencies
31643
- };
31644
- const isNextJs = "next" in deps;
31645
- if (!isNextJs) {
31646
- throw new Error(
31647
- "Next.js not found in dependencies. Please run this in a Next.js project."
31648
- );
31649
- }
31650
- const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
31651
- const srcDir = await import_fs_extra10.default.pathExists(path__default.default.join(cwd, "src"));
31652
- const appDirPaths = srcDir ? [path__default.default.join(cwd, "src", "app")] : [path__default.default.join(cwd, "app")];
31653
- let isAppRouter = false;
31654
- for (const appPath of appDirPaths) {
31655
- if (await import_fs_extra10.default.pathExists(appPath)) {
31656
- isAppRouter = true;
31657
- break;
31658
- }
31659
- }
31660
- if (!isAppRouter) {
31661
- throw new Error(
31662
- "App Router not detected. Nextly requires Next.js App Router (app/ directory)."
31663
- );
31664
- }
31665
- const hasTypescript = await import_fs_extra10.default.pathExists(path__default.default.join(cwd, "tsconfig.json"));
31666
- const packageManager = await detectPackageManager2(cwd);
31667
- const appDir = srcDir ? "src/app" : "app";
31668
- return {
31669
- isNextJs,
31670
- isAppRouter,
31671
- hasTypescript,
31672
- packageManager,
31673
- nextVersion,
31674
- srcDir,
31675
- appDir
31676
- };
31677
- }
31678
-
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;
32232
+ function isValidTemplateSelection(value) {
32233
+ return value !== "_coming_soon";
31791
32234
  }
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;
32235
+
32236
+ // src/utils/detect.ts
32237
+ var import_fs_extra11 = __toESM(require_lib());
32238
+
32239
+ // src/utils/detect-pm-from-user-agent.ts
32240
+ function detectPmFromUserAgent(userAgent) {
32241
+ if (!userAgent) return null;
32242
+ if (userAgent.startsWith("pnpm/")) return "pnpm";
32243
+ if (userAgent.startsWith("yarn/")) return "yarn";
32244
+ if (userAgent.startsWith("bun/")) return "bun";
32245
+ if (userAgent.startsWith("npm/")) return "npm";
32246
+ return null;
31807
32247
  }
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";
32248
+
32249
+ // src/utils/detect.ts
32250
+ async function detectPackageManager2(cwd) {
32251
+ const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
32252
+ if (fromUa) return fromUa;
32253
+ if (await import_fs_extra11.default.pathExists(path15__default.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
32254
+ if (await import_fs_extra11.default.pathExists(path15__default.default.join(cwd, "yarn.lock"))) return "yarn";
32255
+ if (await import_fs_extra11.default.pathExists(path15__default.default.join(cwd, "bun.lockb"))) return "bun";
32256
+ return "npm";
31872
32257
  }
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)) {
32258
+ async function detectProject(cwd) {
32259
+ const packageJsonPath = path15__default.default.join(cwd, "package.json");
32260
+ if (!await import_fs_extra11.default.pathExists(packageJsonPath)) {
31900
32261
  throw new Error(
31901
- `Base template not found at ${baseDir}. The package may be corrupted or the download failed.`
32262
+ "No package.json found. Please run this command in a Next.js project."
31902
32263
  );
31903
32264
  }
31904
- if (!await import_fs_extra11.default.pathExists(typeDir)) {
32265
+ const packageJson = await import_fs_extra11.default.readJson(packageJsonPath);
32266
+ const deps = {
32267
+ ...packageJson.dependencies,
32268
+ ...packageJson.devDependencies
32269
+ };
32270
+ const isNextJs = "next" in deps;
32271
+ if (!isNextJs) {
31905
32272
  throw new Error(
31906
- `Template "${projectType}" not found at ${typeDir}. Available templates: blank, blog.`
32273
+ "Next.js not found in dependencies. Please run this in a Next.js project."
31907
32274
  );
31908
32275
  }
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);
32276
+ const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
32277
+ const srcDir = await import_fs_extra11.default.pathExists(path15__default.default.join(cwd, "src"));
32278
+ const appDirPaths = srcDir ? [path15__default.default.join(cwd, "src", "app")] : [path15__default.default.join(cwd, "app")];
32279
+ let isAppRouter = false;
32280
+ for (const appPath of appDirPaths) {
32281
+ if (await import_fs_extra11.default.pathExists(appPath)) {
32282
+ isAppRouter = true;
32283
+ break;
31913
32284
  }
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
32285
  }
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 }
32286
+ if (!isAppRouter) {
32287
+ throw new Error(
32288
+ "App Router not detected. Nextly requires Next.js App Router (app/ directory)."
31931
32289
  );
31932
32290
  }
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;
32291
+ const hasTypescript = await import_fs_extra11.default.pathExists(path15__default.default.join(cwd, "tsconfig.json"));
32292
+ const packageManager = await detectPackageManager2(cwd);
32293
+ const appDir = srcDir ? "src/app" : "app";
32294
+ return {
32295
+ isNextJs,
32296
+ isAppRouter,
32297
+ hasTypescript,
32298
+ packageManager,
32299
+ nextVersion,
32300
+ srcDir,
32301
+ appDir
32302
+ };
32303
+ }
32304
+
32305
+ // src/utils/fs.ts
32306
+ var import_fs_extra12 = __toESM(require_lib());
32307
+ async function isDirectoryNotEmpty(dir) {
32308
+ if (!await import_fs_extra12.default.pathExists(dir)) return false;
32309
+ const entries = await import_fs_extra12.default.readdir(dir);
32310
+ return entries.some((entry) => entry !== ".git");
32311
+ }
32312
+ async function emptyDirectory(dir) {
32313
+ if (!await import_fs_extra12.default.pathExists(dir)) return;
32314
+ for (const entry of await import_fs_extra12.default.readdir(dir)) {
32315
+ if (entry === ".git") continue;
32316
+ await import_fs_extra12.default.remove(path15__default.default.join(dir, entry));
31976
32317
  }
31977
- await replacePlaceholders(targetDir, placeholders);
31978
32318
  }
31979
32319
 
31980
32320
  // src/create-nextly.ts
32321
+ function cwdProjectName(cwd) {
32322
+ const basename = path15__default.default.basename(cwd);
32323
+ if (!/^[a-z0-9][a-z0-9._-]*$/.test(basename)) {
32324
+ return DEFAULT_PROJECT_NAME;
32325
+ }
32326
+ return basename;
32327
+ }
31981
32328
  async function createNextly(options = {}) {
31982
- const {
31983
- defaults = false,
31984
- skipInstall = false,
31985
- useYalc = false,
31986
- installInCwd = false
31987
- } = options;
32329
+ const { defaults = false, skipInstall = false, useYalc = false } = options;
32330
+ let installInCwd = options.installInCwd ?? false;
31988
32331
  let { cwd = process.cwd() } = options;
31989
32332
  let isFreshProject = false;
31990
32333
  let projectName;
@@ -32006,37 +32349,48 @@ async function createNextly(options = {}) {
32006
32349
  }
32007
32350
  }
32008
32351
  } else if (installInCwd) {
32009
- projectName = path__default.default.basename(cwd);
32352
+ projectName = cwdProjectName(cwd);
32010
32353
  isFreshProject = true;
32011
32354
  } else {
32012
32355
  if (options.projectNameFromArg) {
32013
32356
  projectName = options.projectNameFromArg;
32014
32357
  } 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)) {
32358
+ const result = await promptForProjectName();
32359
+ if (result.kind === "cancelled") {
32027
32360
  Nt("Cancelled.");
32028
32361
  return;
32029
32362
  }
32030
- projectName = name;
32363
+ if (result.value.installInCwd) {
32364
+ installInCwd = true;
32365
+ projectName = cwdProjectName(cwd);
32366
+ } else {
32367
+ projectName = result.value.projectName ?? DEFAULT_PROJECT_NAME;
32368
+ }
32031
32369
  } else {
32032
- projectName = "my-nextly-app";
32370
+ projectName = DEFAULT_PROJECT_NAME;
32033
32371
  }
32034
32372
  isFreshProject = true;
32035
32373
  }
32374
+ let allowExistingTarget = false;
32375
+ if (isFreshProject && projectName) {
32376
+ const conflictTargetDir = installInCwd ? cwd : path15__default.default.join(cwd, projectName);
32377
+ if (await isDirectoryNotEmpty(conflictTargetDir)) {
32378
+ const targetLabel = installInCwd ? "the current directory" : `"${projectName}"`;
32379
+ const choice = await promptDirectoryConflict(targetLabel);
32380
+ if (choice === "cancel") {
32381
+ Nt("Cancelled. No changes were made.");
32382
+ return;
32383
+ }
32384
+ allowExistingTarget = true;
32385
+ if (choice === "remove") {
32386
+ await emptyDirectory(conflictTargetDir);
32387
+ }
32388
+ }
32389
+ }
32036
32390
  let projectType;
32037
32391
  if (options.projectType) {
32038
32392
  projectType = options.projectType;
32039
- } else if (defaults) {
32393
+ } else if (defaults || existingProject) {
32040
32394
  projectType = "blank";
32041
32395
  } else {
32042
32396
  const template = await Jt({
@@ -32129,6 +32483,7 @@ async function createNextly(options = {}) {
32129
32483
  databaseUrl = url?.trim() || database.connectionUrl;
32130
32484
  }
32131
32485
  if (isFreshProject && projectName) {
32486
+ const targetDir = installInCwd ? cwd : path15__default.default.join(cwd, projectName);
32132
32487
  const s3 = be();
32133
32488
  let templateSource;
32134
32489
  try {
@@ -32143,47 +32498,29 @@ async function createNextly(options = {}) {
32143
32498
  } else {
32144
32499
  s3.start("Scaffolding project...");
32145
32500
  }
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
- }
32501
+ await copyTemplate({
32502
+ projectName,
32503
+ projectType,
32504
+ targetDir,
32505
+ database,
32506
+ databaseUrl,
32507
+ useYalc,
32508
+ approach,
32509
+ templateSource,
32510
+ // Suppress copyTemplate's "directory already exists" guard when the
32511
+ // installer has already negotiated the conflict with the user
32512
+ // (either by emptying the dir or accepting an overlay). Without
32513
+ // this, the "ignore" path would still throw on the subdirectory
32514
+ // case where the target was non-empty.
32515
+ allowExistingTarget
32516
+ });
32517
+ if (!installInCwd) cwd = targetDir;
32180
32518
  s3.stop("Project scaffolded");
32181
32519
  } catch (error) {
32182
32520
  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);
32521
+ if (!installInCwd && !allowExistingTarget) {
32522
+ if (await import_fs_extra13.default.pathExists(targetDir)) {
32523
+ await import_fs_extra13.default.remove(targetDir);
32187
32524
  }
32188
32525
  }
32189
32526
  capture("scaffold_failed", {
@@ -32230,7 +32567,8 @@ async function createNextly(options = {}) {
32230
32567
  projectInfo,
32231
32568
  database,
32232
32569
  useYalc,
32233
- isFreshProject
32570
+ isFreshProject,
32571
+ projectType
32234
32572
  );
32235
32573
  s3.stop("Dependencies installed");
32236
32574
  capture("install_completed", {
@@ -32256,10 +32594,12 @@ async function createNextly(options = {}) {
32256
32594
  await generateAdminPage(cwd, projectInfo);
32257
32595
  await generateMediaRoutes(cwd, projectInfo);
32258
32596
  await generateTypesDirectory(cwd, projectInfo);
32259
- await patchNextConfig(cwd);
32597
+ await patchNextConfig(cwd, database);
32598
+ }
32599
+ if (projectType !== "plugin") {
32600
+ const envDatabase = databaseUrl ? { ...database, connectionUrl: databaseUrl, envExample: databaseUrl } : database;
32601
+ await generateEnv(cwd, envDatabase);
32260
32602
  }
32261
- const envDatabase = databaseUrl ? { ...database, connectionUrl: databaseUrl, envExample: databaseUrl } : database;
32262
- await generateEnv(cwd, envDatabase);
32263
32603
  s3.stop("Environment configured");
32264
32604
  } catch (error) {
32265
32605
  s3.stop("Failed to generate configuration");
@@ -32278,31 +32618,58 @@ async function createNextly(options = {}) {
32278
32618
  if (isFreshProject && projectName && !installInCwd) {
32279
32619
  lines.push(` ${import_picocolors3.default.bold("cd")} ${projectName}`);
32280
32620
  }
32281
- lines.push(` ${import_picocolors3.default.bold(devCommand)}`);
32282
- lines.push("");
32283
- if (databaseType === "sqlite") {
32621
+ if (projectType === "plugin") {
32622
+ lines.push(` ${import_picocolors3.default.bold(devCommand)}`);
32623
+ lines.push(
32624
+ ` ${import_picocolors3.default.dim("\u2192 runs the embedded /dev playground (SQLite, hot-reload)")}`
32625
+ );
32626
+ lines.push("");
32627
+ lines.push(
32628
+ ` Open ${import_picocolors3.default.cyan("http://localhost:3000/admin")} \u2014 your plugin is registered.`
32629
+ );
32630
+ lines.push(
32631
+ ` Edit your plugin in ${import_picocolors3.default.dim("src/")}; the ${import_picocolors3.default.dim("dev/")} app is never published.`
32632
+ );
32633
+ lines.push("");
32634
+ lines.push(
32635
+ ` ${import_picocolors3.default.bold(`${pm} test`)} runs the in-memory integration harness.`
32636
+ );
32637
+ lines.push(
32638
+ ` ${import_picocolors3.default.bold(`${pm} run build`)}, then ${import_picocolors3.default.bold("npm publish")} to ship.`
32639
+ );
32640
+ lines.push("");
32284
32641
  lines.push(
32285
- ` Your database (SQLite) is stored at ${import_picocolors3.default.dim("./data/nextly.db")}`
32642
+ ` Use it in an app: add ${import_picocolors3.default.dim("myPlugin()")} to ${import_picocolors3.default.dim("plugins")} in nextly.config.ts.`
32286
32643
  );
32287
32644
  } else {
32645
+ lines.push(` ${import_picocolors3.default.bold(devCommand)}`);
32646
+ lines.push("");
32647
+ if (databaseType === "sqlite") {
32648
+ lines.push(
32649
+ ` Your database (SQLite) is stored at ${import_picocolors3.default.dim("./data/nextly.db")}`
32650
+ );
32651
+ } else {
32652
+ lines.push(
32653
+ ` Make sure your ${DATABASE_LABELS[databaseType].label} server is running before starting.`
32654
+ );
32655
+ }
32288
32656
  lines.push(
32289
- ` Make sure your ${DATABASE_LABELS[databaseType].label} server is running before starting.`
32657
+ ` ${import_picocolors3.default.bold(devCommand)} will create system tables on first run.`
32290
32658
  );
32659
+ if (projectType === "blog") {
32660
+ lines.push(
32661
+ ` Visit ${import_picocolors3.default.cyan("http://localhost:3000")} to see your blog.`
32662
+ );
32663
+ }
32664
+ lines.push(
32665
+ ` Visit ${import_picocolors3.default.cyan("http://localhost:3000/admin/setup")} to create your admin account.`
32666
+ );
32667
+ lines.push("");
32668
+ lines.push(
32669
+ ` Storage: Using local disk ${import_picocolors3.default.dim("(./public/uploads)")} by default.`
32670
+ );
32671
+ lines.push(" See docs to configure S3, Vercel Blob, or other providers.");
32291
32672
  }
32292
- lines.push(
32293
- ` ${import_picocolors3.default.bold(devCommand)} will create system tables on first run.`
32294
- );
32295
- if (projectType === "blog") {
32296
- lines.push(` Visit ${import_picocolors3.default.cyan("http://localhost:3000")} to see your blog.`);
32297
- }
32298
- lines.push(
32299
- ` Visit ${import_picocolors3.default.cyan("http://localhost:3000/admin/setup")} to create your admin account.`
32300
- );
32301
- lines.push("");
32302
- lines.push(
32303
- ` Storage: Using local disk ${import_picocolors3.default.dim("(./public/uploads)")} by default.`
32304
- );
32305
- lines.push(" See docs to configure S3, Vercel Blob, or other providers.");
32306
32673
  Vt2(lines.join("\n"), "Next steps");
32307
32674
  capture("scaffold_completed", {
32308
32675
  total_duration_ms: Date.now() - overallStartedAt,
@@ -32320,8 +32687,7 @@ program2.name("create-nextly-app").description(
32320
32687
  "Scaffold a new Nextly CMS project or add Nextly to an existing Next.js app"
32321
32688
  ).version("0.1.0").argument(
32322
32689
  "[directory]",
32323
- "Project name or '.' to install in the current directory",
32324
- "."
32690
+ "Project name or '.' to install in the current directory (omit to be prompted)"
32325
32691
  ).option(
32326
32692
  "-y, --yes",
32327
32693
  "Skip prompts and use defaults (blank template, SQLite, local storage)"
@@ -32338,11 +32704,12 @@ program2.name("create-nextly-app").description(
32338
32704
  "after",
32339
32705
  `
32340
32706
  Examples:
32707
+ $ npx create-nextly-app@alpha (prompts for folder name)
32341
32708
  $ npx create-nextly-app@alpha my-project
32342
32709
  $ npx create-nextly-app@alpha my-project -y
32343
32710
  $ npx create-nextly-app@alpha my-blog -t blog -a code-first
32344
32711
  $ npx create-nextly-app@alpha my-project --database postgresql
32345
- $ npx create-nextly-app@alpha .
32712
+ $ npx create-nextly-app@alpha . (install in the current directory)
32346
32713
  `
32347
32714
  ).action(
32348
32715
  async (directory, options) => {
@@ -32353,6 +32720,13 @@ Examples:
32353
32720
  try {
32354
32721
  const cwd = process.cwd();
32355
32722
  const { projectName, installInCwd } = resolveProjectArg(directory);
32723
+ if (projectName) {
32724
+ const nameError = validateProjectName(projectName);
32725
+ if (nameError) {
32726
+ console.error(`Error: Invalid project name '${projectName}'. ${nameError}.`);
32727
+ process.exit(1);
32728
+ }
32729
+ }
32356
32730
  const projectType = options.template;
32357
32731
  const validTypes = ["blank", "blog"];
32358
32732
  if (projectType && !validTypes.includes(projectType)) {