create-nextly-app 0.0.2-alpha.5 → 0.0.2-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var module$1 = require('module');
4
- var path17 = require('path');
4
+ var path14 = require('path');
5
5
  var util = require('util');
6
6
  var process4 = require('process');
7
7
  var k = require('readline');
@@ -43,7 +43,7 @@ function _interopNamespace(e) {
43
43
  return Object.freeze(n);
44
44
  }
45
45
 
46
- var path17__default = /*#__PURE__*/_interopDefault(path17);
46
+ var path14__default = /*#__PURE__*/_interopDefault(path14);
47
47
  var process4__default = /*#__PURE__*/_interopDefault(process4);
48
48
  var k__namespace = /*#__PURE__*/_interopNamespace(k);
49
49
  var tty__default = /*#__PURE__*/_interopDefault(tty);
@@ -197,54 +197,54 @@ var require_polyfills = __commonJS({
197
197
  }
198
198
  var chdir;
199
199
  module.exports = patch;
200
- function patch(fs15) {
200
+ function patch(fs16) {
201
201
  if (constants4.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
202
- patchLchmod(fs15);
203
- }
204
- if (!fs15.lutimes) {
205
- patchLutimes(fs15);
206
- }
207
- fs15.chown = chownFix(fs15.chown);
208
- fs15.fchown = chownFix(fs15.fchown);
209
- fs15.lchown = chownFix(fs15.lchown);
210
- fs15.chmod = chmodFix(fs15.chmod);
211
- fs15.fchmod = chmodFix(fs15.fchmod);
212
- fs15.lchmod = chmodFix(fs15.lchmod);
213
- fs15.chownSync = chownFixSync(fs15.chownSync);
214
- fs15.fchownSync = chownFixSync(fs15.fchownSync);
215
- fs15.lchownSync = chownFixSync(fs15.lchownSync);
216
- fs15.chmodSync = chmodFixSync(fs15.chmodSync);
217
- fs15.fchmodSync = chmodFixSync(fs15.fchmodSync);
218
- fs15.lchmodSync = chmodFixSync(fs15.lchmodSync);
219
- fs15.stat = statFix(fs15.stat);
220
- fs15.fstat = statFix(fs15.fstat);
221
- fs15.lstat = statFix(fs15.lstat);
222
- fs15.statSync = statFixSync(fs15.statSync);
223
- fs15.fstatSync = statFixSync(fs15.fstatSync);
224
- fs15.lstatSync = statFixSync(fs15.lstatSync);
225
- if (fs15.chmod && !fs15.lchmod) {
226
- fs15.lchmod = function(path19, mode, cb) {
202
+ patchLchmod(fs16);
203
+ }
204
+ if (!fs16.lutimes) {
205
+ patchLutimes(fs16);
206
+ }
207
+ fs16.chown = chownFix(fs16.chown);
208
+ fs16.fchown = chownFix(fs16.fchown);
209
+ fs16.lchown = chownFix(fs16.lchown);
210
+ fs16.chmod = chmodFix(fs16.chmod);
211
+ fs16.fchmod = chmodFix(fs16.fchmod);
212
+ fs16.lchmod = chmodFix(fs16.lchmod);
213
+ fs16.chownSync = chownFixSync(fs16.chownSync);
214
+ fs16.fchownSync = chownFixSync(fs16.fchownSync);
215
+ fs16.lchownSync = chownFixSync(fs16.lchownSync);
216
+ fs16.chmodSync = chmodFixSync(fs16.chmodSync);
217
+ fs16.fchmodSync = chmodFixSync(fs16.fchmodSync);
218
+ fs16.lchmodSync = chmodFixSync(fs16.lchmodSync);
219
+ fs16.stat = statFix(fs16.stat);
220
+ fs16.fstat = statFix(fs16.fstat);
221
+ fs16.lstat = statFix(fs16.lstat);
222
+ fs16.statSync = statFixSync(fs16.statSync);
223
+ fs16.fstatSync = statFixSync(fs16.fstatSync);
224
+ fs16.lstatSync = statFixSync(fs16.lstatSync);
225
+ if (fs16.chmod && !fs16.lchmod) {
226
+ fs16.lchmod = function(path21, mode, cb) {
227
227
  if (cb) process.nextTick(cb);
228
228
  };
229
- fs15.lchmodSync = function() {
229
+ fs16.lchmodSync = function() {
230
230
  };
231
231
  }
232
- if (fs15.chown && !fs15.lchown) {
233
- fs15.lchown = function(path19, uid, gid, cb) {
232
+ if (fs16.chown && !fs16.lchown) {
233
+ fs16.lchown = function(path21, uid, gid, cb) {
234
234
  if (cb) process.nextTick(cb);
235
235
  };
236
- fs15.lchownSync = function() {
236
+ fs16.lchownSync = function() {
237
237
  };
238
238
  }
239
239
  if (platform3 === "win32") {
240
- fs15.rename = typeof fs15.rename !== "function" ? fs15.rename : (function(fs$rename) {
240
+ fs16.rename = typeof fs16.rename !== "function" ? fs16.rename : (function(fs$rename) {
241
241
  function rename(from, to2, cb) {
242
242
  var start = Date.now();
243
243
  var backoff = 0;
244
244
  fs$rename(from, to2, function CB(er2) {
245
245
  if (er2 && (er2.code === "EACCES" || er2.code === "EPERM" || er2.code === "EBUSY") && Date.now() - start < 6e4) {
246
246
  setTimeout(function() {
247
- fs15.stat(to2, function(stater, st3) {
247
+ fs16.stat(to2, function(stater, st3) {
248
248
  if (stater && stater.code === "ENOENT")
249
249
  fs$rename(from, to2, CB);
250
250
  else
@@ -260,9 +260,9 @@ var require_polyfills = __commonJS({
260
260
  }
261
261
  if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
262
262
  return rename;
263
- })(fs15.rename);
263
+ })(fs16.rename);
264
264
  }
265
- fs15.read = typeof fs15.read !== "function" ? fs15.read : (function(fs$read) {
265
+ fs16.read = typeof fs16.read !== "function" ? fs16.read : (function(fs$read) {
266
266
  function read(fd, buffer, offset, length, position, callback_) {
267
267
  var callback;
268
268
  if (callback_ && typeof callback_ === "function") {
@@ -270,22 +270,22 @@ var require_polyfills = __commonJS({
270
270
  callback = function(er2, _3, __) {
271
271
  if (er2 && er2.code === "EAGAIN" && eagCounter < 10) {
272
272
  eagCounter++;
273
- return fs$read.call(fs15, fd, buffer, offset, length, position, callback);
273
+ return fs$read.call(fs16, fd, buffer, offset, length, position, callback);
274
274
  }
275
275
  callback_.apply(this, arguments);
276
276
  };
277
277
  }
278
- return fs$read.call(fs15, fd, buffer, offset, length, position, callback);
278
+ return fs$read.call(fs16, fd, buffer, offset, length, position, callback);
279
279
  }
280
280
  if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
281
281
  return read;
282
- })(fs15.read);
283
- fs15.readSync = typeof fs15.readSync !== "function" ? fs15.readSync : /* @__PURE__ */ (function(fs$readSync) {
282
+ })(fs16.read);
283
+ fs16.readSync = typeof fs16.readSync !== "function" ? fs16.readSync : /* @__PURE__ */ (function(fs$readSync) {
284
284
  return function(fd, buffer, offset, length, position) {
285
285
  var eagCounter = 0;
286
286
  while (true) {
287
287
  try {
288
- return fs$readSync.call(fs15, fd, buffer, offset, length, position);
288
+ return fs$readSync.call(fs16, fd, buffer, offset, length, position);
289
289
  } catch (er2) {
290
290
  if (er2.code === "EAGAIN" && eagCounter < 10) {
291
291
  eagCounter++;
@@ -295,11 +295,11 @@ var require_polyfills = __commonJS({
295
295
  }
296
296
  }
297
297
  };
298
- })(fs15.readSync);
299
- function patchLchmod(fs16) {
300
- fs16.lchmod = function(path19, mode, callback) {
301
- fs16.open(
302
- path19,
298
+ })(fs16.readSync);
299
+ function patchLchmod(fs17) {
300
+ fs17.lchmod = function(path21, mode, callback) {
301
+ fs17.open(
302
+ path21,
303
303
  constants4.O_WRONLY | constants4.O_SYMLINK,
304
304
  mode,
305
305
  function(err, fd) {
@@ -307,80 +307,80 @@ var require_polyfills = __commonJS({
307
307
  if (callback) callback(err);
308
308
  return;
309
309
  }
310
- fs16.fchmod(fd, mode, function(err2) {
311
- fs16.close(fd, function(err22) {
310
+ fs17.fchmod(fd, mode, function(err2) {
311
+ fs17.close(fd, function(err22) {
312
312
  if (callback) callback(err2 || err22);
313
313
  });
314
314
  });
315
315
  }
316
316
  );
317
317
  };
318
- fs16.lchmodSync = function(path19, mode) {
319
- var fd = fs16.openSync(path19, constants4.O_WRONLY | constants4.O_SYMLINK, mode);
318
+ fs17.lchmodSync = function(path21, mode) {
319
+ var fd = fs17.openSync(path21, constants4.O_WRONLY | constants4.O_SYMLINK, mode);
320
320
  var threw = true;
321
321
  var ret;
322
322
  try {
323
- ret = fs16.fchmodSync(fd, mode);
323
+ ret = fs17.fchmodSync(fd, mode);
324
324
  threw = false;
325
325
  } finally {
326
326
  if (threw) {
327
327
  try {
328
- fs16.closeSync(fd);
328
+ fs17.closeSync(fd);
329
329
  } catch (er2) {
330
330
  }
331
331
  } else {
332
- fs16.closeSync(fd);
332
+ fs17.closeSync(fd);
333
333
  }
334
334
  }
335
335
  return ret;
336
336
  };
337
337
  }
338
- function patchLutimes(fs16) {
339
- if (constants4.hasOwnProperty("O_SYMLINK") && fs16.futimes) {
340
- fs16.lutimes = function(path19, at3, mt4, cb) {
341
- fs16.open(path19, constants4.O_SYMLINK, function(er2, fd) {
338
+ function patchLutimes(fs17) {
339
+ if (constants4.hasOwnProperty("O_SYMLINK") && fs17.futimes) {
340
+ fs17.lutimes = function(path21, at3, mt4, cb) {
341
+ fs17.open(path21, constants4.O_SYMLINK, function(er2, fd) {
342
342
  if (er2) {
343
343
  if (cb) cb(er2);
344
344
  return;
345
345
  }
346
- fs16.futimes(fd, at3, mt4, function(er3) {
347
- fs16.close(fd, function(er22) {
346
+ fs17.futimes(fd, at3, mt4, function(er3) {
347
+ fs17.close(fd, function(er22) {
348
348
  if (cb) cb(er3 || er22);
349
349
  });
350
350
  });
351
351
  });
352
352
  };
353
- fs16.lutimesSync = function(path19, at3, mt4) {
354
- var fd = fs16.openSync(path19, constants4.O_SYMLINK);
353
+ fs17.lutimesSync = function(path21, at3, mt4) {
354
+ var fd = fs17.openSync(path21, constants4.O_SYMLINK);
355
355
  var ret;
356
356
  var threw = true;
357
357
  try {
358
- ret = fs16.futimesSync(fd, at3, mt4);
358
+ ret = fs17.futimesSync(fd, at3, mt4);
359
359
  threw = false;
360
360
  } finally {
361
361
  if (threw) {
362
362
  try {
363
- fs16.closeSync(fd);
363
+ fs17.closeSync(fd);
364
364
  } catch (er2) {
365
365
  }
366
366
  } else {
367
- fs16.closeSync(fd);
367
+ fs17.closeSync(fd);
368
368
  }
369
369
  }
370
370
  return ret;
371
371
  };
372
- } else if (fs16.futimes) {
373
- fs16.lutimes = function(_a, _b, _c, cb) {
372
+ } else if (fs17.futimes) {
373
+ fs17.lutimes = function(_a, _b, _c, cb) {
374
374
  if (cb) process.nextTick(cb);
375
375
  };
376
- fs16.lutimesSync = function() {
376
+ fs17.lutimesSync = function() {
377
377
  };
378
378
  }
379
379
  }
380
380
  function chmodFix(orig) {
381
381
  if (!orig) return orig;
382
382
  return function(target, mode, cb) {
383
- return orig.call(fs15, target, mode, function(er2) {
383
+ return orig.call(fs16, target, mode, function(er2) {
384
384
  if (chownErOk(er2)) er2 = null;
385
385
  if (cb) cb.apply(this, arguments);
386
386
  });
@@ -390,7 +390,7 @@ var require_polyfills = __commonJS({
390
390
  if (!orig) return orig;
391
391
  return function(target, mode) {
392
392
  try {
393
- return orig.call(fs15, target, mode);
393
+ return orig.call(fs16, target, mode);
394
394
  } catch (er2) {
395
395
  if (!chownErOk(er2)) throw er2;
396
396
  }
@@ -399,7 +399,7 @@ var require_polyfills = __commonJS({
399
399
  function chownFix(orig) {
400
400
  if (!orig) return orig;
401
401
  return function(target, uid, gid, cb) {
402
- return orig.call(fs15, target, uid, gid, function(er2) {
402
+ return orig.call(fs16, target, uid, gid, function(er2) {
403
403
  if (chownErOk(er2)) er2 = null;
404
404
  if (cb) cb.apply(this, arguments);
405
405
  });
@@ -409,7 +409,7 @@ var require_polyfills = __commonJS({
409
409
  if (!orig) return orig;
410
410
  return function(target, uid, gid) {
411
411
  try {
412
- return orig.call(fs15, target, uid, gid);
412
+ return orig.call(fs16, target, uid, gid);
413
413
  } catch (er2) {
414
414
  if (!chownErOk(er2)) throw er2;
415
415
  }
@@ -429,13 +429,13 @@ var require_polyfills = __commonJS({
429
429
  }
430
430
  if (cb) cb.apply(this, arguments);
431
431
  }
432
- return options ? orig.call(fs15, target, options, callback) : orig.call(fs15, target, callback);
432
+ return options ? orig.call(fs16, target, options, callback) : orig.call(fs16, target, callback);
433
433
  };
434
434
  }
435
435
  function statFixSync(orig) {
436
436
  if (!orig) return orig;
437
437
  return function(target, options) {
438
- var stats = options ? orig.call(fs15, target, options) : orig.call(fs15, target);
438
+ var stats = options ? orig.call(fs16, target, options) : orig.call(fs16, target);
439
439
  if (stats) {
440
440
  if (stats.uid < 0) stats.uid += 4294967296;
441
441
  if (stats.gid < 0) stats.gid += 4294967296;
@@ -464,16 +464,16 @@ var require_legacy_streams = __commonJS({
464
464
  "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports$1, module) {
465
465
  var Stream = __require("stream").Stream;
466
466
  module.exports = legacy;
467
- function legacy(fs15) {
467
+ function legacy(fs16) {
468
468
  return {
469
469
  ReadStream,
470
470
  WriteStream
471
471
  };
472
- function ReadStream(path19, options) {
473
- if (!(this instanceof ReadStream)) return new ReadStream(path19, options);
472
+ function ReadStream(path21, options) {
473
+ if (!(this instanceof ReadStream)) return new ReadStream(path21, options);
474
474
  Stream.call(this);
475
475
  var self = this;
476
- this.path = path19;
476
+ this.path = path21;
477
477
  this.fd = null;
478
478
  this.readable = true;
479
479
  this.paused = false;
@@ -507,7 +507,7 @@ var require_legacy_streams = __commonJS({
507
507
  });
508
508
  return;
509
509
  }
510
- fs15.open(this.path, this.flags, this.mode, function(err, fd) {
510
+ fs16.open(this.path, this.flags, this.mode, function(err, fd) {
511
511
  if (err) {
512
512
  self.emit("error", err);
513
513
  self.readable = false;
@@ -518,10 +518,10 @@ var require_legacy_streams = __commonJS({
518
518
  self._read();
519
519
  });
520
520
  }
521
- function WriteStream(path19, options) {
522
- if (!(this instanceof WriteStream)) return new WriteStream(path19, options);
521
+ function WriteStream(path21, options) {
522
+ if (!(this instanceof WriteStream)) return new WriteStream(path21, options);
523
523
  Stream.call(this);
524
- this.path = path19;
524
+ this.path = path21;
525
525
  this.fd = null;
526
526
  this.writable = true;
527
527
  this.flags = "w";
@@ -546,7 +546,7 @@ var require_legacy_streams = __commonJS({
546
546
  this.busy = false;
547
547
  this._queue = [];
548
548
  if (this.fd === null) {
549
- this._open = fs15.open;
549
+ this._open = fs16.open;
550
550
  this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
551
551
  this.flush();
552
552
  }
@@ -580,7 +580,7 @@ var require_clone = __commonJS({
580
580
  // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
581
581
  var require_graceful_fs = __commonJS({
582
582
  "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports$1, module) {
583
- var fs15 = __require("fs");
583
+ var fs16 = __require("fs");
584
584
  var polyfills = require_polyfills();
585
585
  var legacy = require_legacy_streams();
586
586
  var clone = require_clone();
@@ -612,12 +612,12 @@ var require_graceful_fs = __commonJS({
612
612
  m2 = "GFS4: " + m2.split(/\n/).join("\nGFS4: ");
613
613
  console.error(m2);
614
614
  };
615
- if (!fs15[gracefulQueue]) {
615
+ if (!fs16[gracefulQueue]) {
616
616
  queue = global[gracefulQueue] || [];
617
- publishQueue(fs15, queue);
618
- fs15.close = (function(fs$close) {
617
+ publishQueue(fs16, queue);
618
+ fs16.close = (function(fs$close) {
619
619
  function close(fd, cb) {
620
- return fs$close.call(fs15, fd, function(err) {
620
+ return fs$close.call(fs16, fd, function(err) {
621
621
  if (!err) {
622
622
  resetQueue();
623
623
  }
@@ -629,48 +629,48 @@ var require_graceful_fs = __commonJS({
629
629
  value: fs$close
630
630
  });
631
631
  return close;
632
- })(fs15.close);
633
- fs15.closeSync = (function(fs$closeSync) {
632
+ })(fs16.close);
633
+ fs16.closeSync = (function(fs$closeSync) {
634
634
  function closeSync(fd) {
635
- fs$closeSync.apply(fs15, arguments);
635
+ fs$closeSync.apply(fs16, arguments);
636
636
  resetQueue();
637
637
  }
638
638
  Object.defineProperty(closeSync, previousSymbol, {
639
639
  value: fs$closeSync
640
640
  });
641
641
  return closeSync;
642
- })(fs15.closeSync);
642
+ })(fs16.closeSync);
643
643
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
644
644
  process.on("exit", function() {
645
- debug(fs15[gracefulQueue]);
646
- __require("assert").equal(fs15[gracefulQueue].length, 0);
645
+ debug(fs16[gracefulQueue]);
646
+ __require("assert").equal(fs16[gracefulQueue].length, 0);
647
647
  });
648
648
  }
649
649
  }
650
650
  var queue;
651
651
  if (!global[gracefulQueue]) {
652
- publishQueue(global, fs15[gracefulQueue]);
653
- }
654
- module.exports = patch(clone(fs15));
655
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs15.__patched) {
656
- module.exports = patch(fs15);
657
- fs15.__patched = true;
658
- }
659
- function patch(fs16) {
660
- polyfills(fs16);
661
- fs16.gracefulify = patch;
662
- fs16.createReadStream = createReadStream3;
663
- fs16.createWriteStream = createWriteStream2;
664
- var fs$readFile = fs16.readFile;
665
- fs16.readFile = readFile;
666
- function readFile(path19, options, cb) {
652
+ publishQueue(global, fs16[gracefulQueue]);
653
+ }
654
+ module.exports = patch(clone(fs16));
655
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs16.__patched) {
656
+ module.exports = patch(fs16);
657
+ fs16.__patched = true;
658
+ }
659
+ function patch(fs17) {
660
+ polyfills(fs17);
661
+ fs17.gracefulify = patch;
662
+ fs17.createReadStream = createReadStream3;
663
+ fs17.createWriteStream = createWriteStream2;
664
+ var fs$readFile = fs17.readFile;
665
+ fs17.readFile = readFile;
666
+ function readFile(path21, options, cb) {
667
667
  if (typeof options === "function")
668
668
  cb = options, options = null;
669
- return go$readFile(path19, options, cb);
670
- function go$readFile(path20, options2, cb2, startTime) {
671
- return fs$readFile(path20, options2, function(err) {
669
+ return go$readFile(path21, options, cb);
670
+ function go$readFile(path22, options2, cb2, startTime) {
671
+ return fs$readFile(path22, options2, function(err) {
672
672
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
673
- enqueue([go$readFile, [path20, options2, cb2], err, startTime || Date.now(), Date.now()]);
673
+ enqueue([go$readFile, [path22, options2, cb2], err, startTime || Date.now(), Date.now()]);
674
674
  else {
675
675
  if (typeof cb2 === "function")
676
676
  cb2.apply(this, arguments);
@@ -678,16 +678,16 @@ var require_graceful_fs = __commonJS({
678
678
  });
679
679
  }
680
680
  }
681
- var fs$writeFile = fs16.writeFile;
682
- fs16.writeFile = writeFile;
683
- function writeFile(path19, data, options, cb) {
681
+ var fs$writeFile = fs17.writeFile;
682
+ fs17.writeFile = writeFile;
683
+ function writeFile(path21, data, options, cb) {
684
684
  if (typeof options === "function")
685
685
  cb = options, options = null;
686
- return go$writeFile(path19, data, options, cb);
687
- function go$writeFile(path20, data2, options2, cb2, startTime) {
688
- return fs$writeFile(path20, data2, options2, function(err) {
686
+ return go$writeFile(path21, data, options, cb);
687
+ function go$writeFile(path22, data2, options2, cb2, startTime) {
688
+ return fs$writeFile(path22, data2, options2, function(err) {
689
689
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
690
- enqueue([go$writeFile, [path20, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
690
+ enqueue([go$writeFile, [path22, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
691
691
  else {
692
692
  if (typeof cb2 === "function")
693
693
  cb2.apply(this, arguments);
@@ -695,17 +695,17 @@ var require_graceful_fs = __commonJS({
695
695
  });
696
696
  }
697
697
  }
698
- var fs$appendFile = fs16.appendFile;
698
+ var fs$appendFile = fs17.appendFile;
699
699
  if (fs$appendFile)
700
- fs16.appendFile = appendFile;
701
- function appendFile(path19, data, options, cb) {
700
+ fs17.appendFile = appendFile;
701
+ function appendFile(path21, data, options, cb) {
702
702
  if (typeof options === "function")
703
703
  cb = options, options = null;
704
- return go$appendFile(path19, data, options, cb);
705
- function go$appendFile(path20, data2, options2, cb2, startTime) {
706
- return fs$appendFile(path20, data2, options2, function(err) {
704
+ return go$appendFile(path21, data, options, cb);
705
+ function go$appendFile(path22, data2, options2, cb2, startTime) {
706
+ return fs$appendFile(path22, data2, options2, function(err) {
707
707
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
708
- enqueue([go$appendFile, [path20, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
708
+ enqueue([go$appendFile, [path22, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
709
709
  else {
710
710
  if (typeof cb2 === "function")
711
711
  cb2.apply(this, arguments);
@@ -713,9 +713,9 @@ var require_graceful_fs = __commonJS({
713
713
  });
714
714
  }
715
715
  }
716
- var fs$copyFile = fs16.copyFile;
716
+ var fs$copyFile = fs17.copyFile;
717
717
  if (fs$copyFile)
718
- fs16.copyFile = copyFile;
718
+ fs17.copyFile = copyFile;
719
719
  function copyFile(src, dest, flags, cb) {
720
720
  if (typeof flags === "function") {
721
721
  cb = flags;
@@ -733,34 +733,34 @@ var require_graceful_fs = __commonJS({
733
733
  });
734
734
  }
735
735
  }
736
- var fs$readdir = fs16.readdir;
737
- fs16.readdir = readdir;
736
+ var fs$readdir = fs17.readdir;
737
+ fs17.readdir = readdir;
738
738
  var noReaddirOptionVersions = /^v[0-5]\./;
739
- function readdir(path19, options, cb) {
739
+ function readdir(path21, options, cb) {
740
740
  if (typeof options === "function")
741
741
  cb = options, options = null;
742
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path20, options2, cb2, startTime) {
743
- return fs$readdir(path20, fs$readdirCallback(
744
- path20,
742
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path22, options2, cb2, startTime) {
743
+ return fs$readdir(path22, fs$readdirCallback(
744
+ path22,
745
745
  options2,
746
746
  cb2,
747
747
  startTime
748
748
  ));
749
- } : function go$readdir2(path20, options2, cb2, startTime) {
750
- return fs$readdir(path20, options2, fs$readdirCallback(
751
- path20,
749
+ } : function go$readdir2(path22, options2, cb2, startTime) {
750
+ return fs$readdir(path22, options2, fs$readdirCallback(
751
+ path22,
752
752
  options2,
753
753
  cb2,
754
754
  startTime
755
755
  ));
756
756
  };
757
- return go$readdir(path19, options, cb);
758
- function fs$readdirCallback(path20, options2, cb2, startTime) {
757
+ return go$readdir(path21, options, cb);
758
+ function fs$readdirCallback(path22, options2, cb2, startTime) {
759
759
  return function(err, files) {
760
760
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
761
761
  enqueue([
762
762
  go$readdir,
763
- [path20, options2, cb2],
763
+ [path22, options2, cb2],
764
764
  err,
765
765
  startTime || Date.now(),
766
766
  Date.now()
@@ -775,21 +775,21 @@ var require_graceful_fs = __commonJS({
775
775
  }
776
776
  }
777
777
  if (process.version.substr(0, 4) === "v0.8") {
778
- var legStreams = legacy(fs16);
778
+ var legStreams = legacy(fs17);
779
779
  ReadStream = legStreams.ReadStream;
780
780
  WriteStream = legStreams.WriteStream;
781
781
  }
782
- var fs$ReadStream = fs16.ReadStream;
782
+ var fs$ReadStream = fs17.ReadStream;
783
783
  if (fs$ReadStream) {
784
784
  ReadStream.prototype = Object.create(fs$ReadStream.prototype);
785
785
  ReadStream.prototype.open = ReadStream$open;
786
786
  }
787
- var fs$WriteStream = fs16.WriteStream;
787
+ var fs$WriteStream = fs17.WriteStream;
788
788
  if (fs$WriteStream) {
789
789
  WriteStream.prototype = Object.create(fs$WriteStream.prototype);
790
790
  WriteStream.prototype.open = WriteStream$open;
791
791
  }
792
- Object.defineProperty(fs16, "ReadStream", {
792
+ Object.defineProperty(fs17, "ReadStream", {
793
793
  get: function() {
794
794
  return ReadStream;
795
795
  },
@@ -799,7 +799,7 @@ var require_graceful_fs = __commonJS({
799
799
  enumerable: true,
800
800
  configurable: true
801
801
  });
802
- Object.defineProperty(fs16, "WriteStream", {
802
+ Object.defineProperty(fs17, "WriteStream", {
803
803
  get: function() {
804
804
  return WriteStream;
805
805
  },
@@ -810,7 +810,7 @@ var require_graceful_fs = __commonJS({
810
810
  configurable: true
811
811
  });
812
812
  var FileReadStream = ReadStream;
813
- Object.defineProperty(fs16, "FileReadStream", {
813
+ Object.defineProperty(fs17, "FileReadStream", {
814
814
  get: function() {
815
815
  return FileReadStream;
816
816
  },
@@ -821,7 +821,7 @@ var require_graceful_fs = __commonJS({
821
821
  configurable: true
822
822
  });
823
823
  var FileWriteStream = WriteStream;
824
- Object.defineProperty(fs16, "FileWriteStream", {
824
+ Object.defineProperty(fs17, "FileWriteStream", {
825
825
  get: function() {
826
826
  return FileWriteStream;
827
827
  },
@@ -831,7 +831,7 @@ var require_graceful_fs = __commonJS({
831
831
  enumerable: true,
832
832
  configurable: true
833
833
  });
834
- function ReadStream(path19, options) {
834
+ function ReadStream(path21, options) {
835
835
  if (this instanceof ReadStream)
836
836
  return fs$ReadStream.apply(this, arguments), this;
837
837
  else
@@ -851,7 +851,7 @@ var require_graceful_fs = __commonJS({
851
851
  }
852
852
  });
853
853
  }
854
- function WriteStream(path19, options) {
854
+ function WriteStream(path21, options) {
855
855
  if (this instanceof WriteStream)
856
856
  return fs$WriteStream.apply(this, arguments), this;
857
857
  else
@@ -869,22 +869,22 @@ var require_graceful_fs = __commonJS({
869
869
  }
870
870
  });
871
871
  }
872
- function createReadStream3(path19, options) {
873
- return new fs16.ReadStream(path19, options);
872
+ function createReadStream3(path21, options) {
873
+ return new fs17.ReadStream(path21, options);
874
874
  }
875
- function createWriteStream2(path19, options) {
876
- return new fs16.WriteStream(path19, options);
875
+ function createWriteStream2(path21, options) {
876
+ return new fs17.WriteStream(path21, options);
877
877
  }
878
- var fs$open = fs16.open;
879
- fs16.open = open;
880
- function open(path19, flags, mode, cb) {
878
+ var fs$open = fs17.open;
879
+ fs17.open = open;
880
+ function open(path21, flags, mode, cb) {
881
881
  if (typeof mode === "function")
882
882
  cb = mode, mode = null;
883
- return go$open(path19, flags, mode, cb);
884
- function go$open(path20, flags2, mode2, cb2, startTime) {
885
- return fs$open(path20, flags2, mode2, function(err, fd) {
883
+ return go$open(path21, flags, mode, cb);
884
+ function go$open(path22, flags2, mode2, cb2, startTime) {
885
+ return fs$open(path22, flags2, mode2, function(err, fd) {
886
886
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
887
- enqueue([go$open, [path20, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
887
+ enqueue([go$open, [path22, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
888
888
  else {
889
889
  if (typeof cb2 === "function")
890
890
  cb2.apply(this, arguments);
@@ -892,20 +892,20 @@ var require_graceful_fs = __commonJS({
892
892
  });
893
893
  }
894
894
  }
895
- return fs16;
895
+ return fs17;
896
896
  }
897
897
  function enqueue(elem) {
898
898
  debug("ENQUEUE", elem[0].name, elem[1]);
899
- fs15[gracefulQueue].push(elem);
899
+ fs16[gracefulQueue].push(elem);
900
900
  retry();
901
901
  }
902
902
  var retryTimer;
903
903
  function resetQueue() {
904
904
  var now = Date.now();
905
- for (var i2 = 0; i2 < fs15[gracefulQueue].length; ++i2) {
906
- if (fs15[gracefulQueue][i2].length > 2) {
907
- fs15[gracefulQueue][i2][3] = now;
908
- fs15[gracefulQueue][i2][4] = now;
905
+ for (var i2 = 0; i2 < fs16[gracefulQueue].length; ++i2) {
906
+ if (fs16[gracefulQueue][i2].length > 2) {
907
+ fs16[gracefulQueue][i2][3] = now;
908
+ fs16[gracefulQueue][i2][4] = now;
909
909
  }
910
910
  }
911
911
  retry();
@@ -913,9 +913,9 @@ var require_graceful_fs = __commonJS({
913
913
  function retry() {
914
914
  clearTimeout(retryTimer);
915
915
  retryTimer = void 0;
916
- if (fs15[gracefulQueue].length === 0)
916
+ if (fs16[gracefulQueue].length === 0)
917
917
  return;
918
- var elem = fs15[gracefulQueue].shift();
918
+ var elem = fs16[gracefulQueue].shift();
919
919
  var fn2 = elem[0];
920
920
  var args = elem[1];
921
921
  var err = elem[2];
@@ -937,7 +937,7 @@ var require_graceful_fs = __commonJS({
937
937
  debug("RETRY", fn2.name, args);
938
938
  fn2.apply(null, args.concat([startTime]));
939
939
  } else {
940
- fs15[gracefulQueue].push(elem);
940
+ fs16[gracefulQueue].push(elem);
941
941
  }
942
942
  }
943
943
  if (retryTimer === void 0) {
@@ -951,7 +951,7 @@ var require_graceful_fs = __commonJS({
951
951
  var require_fs = __commonJS({
952
952
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/fs/index.js"(exports$1) {
953
953
  var u3 = require_universalify().fromCallback;
954
- var fs15 = require_graceful_fs();
954
+ var fs16 = require_graceful_fs();
955
955
  var api = [
956
956
  "access",
957
957
  "appendFile",
@@ -992,26 +992,26 @@ var require_fs = __commonJS({
992
992
  "utimes",
993
993
  "writeFile"
994
994
  ].filter((key) => {
995
- return typeof fs15[key] === "function";
995
+ return typeof fs16[key] === "function";
996
996
  });
997
- Object.assign(exports$1, fs15);
997
+ Object.assign(exports$1, fs16);
998
998
  api.forEach((method) => {
999
- exports$1[method] = u3(fs15[method]);
999
+ exports$1[method] = u3(fs16[method]);
1000
1000
  });
1001
1001
  exports$1.exists = function(filename, callback) {
1002
1002
  if (typeof callback === "function") {
1003
- return fs15.exists(filename, callback);
1003
+ return fs16.exists(filename, callback);
1004
1004
  }
1005
1005
  return new Promise((resolve) => {
1006
- return fs15.exists(filename, resolve);
1006
+ return fs16.exists(filename, resolve);
1007
1007
  });
1008
1008
  };
1009
1009
  exports$1.read = function(fd, buffer, offset, length, position, callback) {
1010
1010
  if (typeof callback === "function") {
1011
- return fs15.read(fd, buffer, offset, length, position, callback);
1011
+ return fs16.read(fd, buffer, offset, length, position, callback);
1012
1012
  }
1013
1013
  return new Promise((resolve, reject) => {
1014
- fs15.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
1014
+ fs16.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
1015
1015
  if (err) return reject(err);
1016
1016
  resolve({ bytesRead, buffer: buffer2 });
1017
1017
  });
@@ -1019,10 +1019,10 @@ var require_fs = __commonJS({
1019
1019
  };
1020
1020
  exports$1.write = function(fd, buffer, ...args) {
1021
1021
  if (typeof args[args.length - 1] === "function") {
1022
- return fs15.write(fd, buffer, ...args);
1022
+ return fs16.write(fd, buffer, ...args);
1023
1023
  }
1024
1024
  return new Promise((resolve, reject) => {
1025
- fs15.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
1025
+ fs16.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
1026
1026
  if (err) return reject(err);
1027
1027
  resolve({ bytesWritten, buffer: buffer2 });
1028
1028
  });
@@ -1030,10 +1030,10 @@ var require_fs = __commonJS({
1030
1030
  };
1031
1031
  exports$1.readv = function(fd, buffers, ...args) {
1032
1032
  if (typeof args[args.length - 1] === "function") {
1033
- return fs15.readv(fd, buffers, ...args);
1033
+ return fs16.readv(fd, buffers, ...args);
1034
1034
  }
1035
1035
  return new Promise((resolve, reject) => {
1036
- fs15.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
1036
+ fs16.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
1037
1037
  if (err) return reject(err);
1038
1038
  resolve({ bytesRead, buffers: buffers2 });
1039
1039
  });
@@ -1041,17 +1041,17 @@ var require_fs = __commonJS({
1041
1041
  };
1042
1042
  exports$1.writev = function(fd, buffers, ...args) {
1043
1043
  if (typeof args[args.length - 1] === "function") {
1044
- return fs15.writev(fd, buffers, ...args);
1044
+ return fs16.writev(fd, buffers, ...args);
1045
1045
  }
1046
1046
  return new Promise((resolve, reject) => {
1047
- fs15.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
1047
+ fs16.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
1048
1048
  if (err) return reject(err);
1049
1049
  resolve({ bytesWritten, buffers: buffers2 });
1050
1050
  });
1051
1051
  });
1052
1052
  };
1053
- if (typeof fs15.realpath.native === "function") {
1054
- exports$1.realpath.native = u3(fs15.realpath.native);
1053
+ if (typeof fs16.realpath.native === "function") {
1054
+ exports$1.realpath.native = u3(fs16.realpath.native);
1055
1055
  } else {
1056
1056
  process.emitWarning(
1057
1057
  "fs.realpath.native is not a function. Is fs being monkey-patched?",
@@ -1065,10 +1065,10 @@ var require_fs = __commonJS({
1065
1065
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/utils.js
1066
1066
  var require_utils2 = __commonJS({
1067
1067
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/utils.js"(exports$1, module) {
1068
- var path19 = __require("path");
1068
+ var path21 = __require("path");
1069
1069
  module.exports.checkPath = function checkPath(pth) {
1070
1070
  if (process.platform === "win32") {
1071
- const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path19.parse(pth).root, ""));
1071
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path21.parse(pth).root, ""));
1072
1072
  if (pathHasInvalidWinCharacters) {
1073
1073
  const error = new Error(`Path contains invalid characters: ${pth}`);
1074
1074
  error.code = "EINVAL";
@@ -1082,7 +1082,7 @@ var require_utils2 = __commonJS({
1082
1082
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/make-dir.js
1083
1083
  var require_make_dir = __commonJS({
1084
1084
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports$1, module) {
1085
- var fs15 = require_fs();
1085
+ var fs16 = require_fs();
1086
1086
  var { checkPath } = require_utils2();
1087
1087
  var getMode = (options) => {
1088
1088
  const defaults = { mode: 511 };
@@ -1091,14 +1091,14 @@ var require_make_dir = __commonJS({
1091
1091
  };
1092
1092
  module.exports.makeDir = async (dir, options) => {
1093
1093
  checkPath(dir);
1094
- return fs15.mkdir(dir, {
1094
+ return fs16.mkdir(dir, {
1095
1095
  mode: getMode(options),
1096
1096
  recursive: true
1097
1097
  });
1098
1098
  };
1099
1099
  module.exports.makeDirSync = (dir, options) => {
1100
1100
  checkPath(dir);
1101
- return fs15.mkdirSync(dir, {
1101
+ return fs16.mkdirSync(dir, {
1102
1102
  mode: getMode(options),
1103
1103
  recursive: true
1104
1104
  });
@@ -1128,13 +1128,13 @@ var require_mkdirs = __commonJS({
1128
1128
  var require_path_exists = __commonJS({
1129
1129
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/path-exists/index.js"(exports$1, module) {
1130
1130
  var u3 = require_universalify().fromPromise;
1131
- var fs15 = require_fs();
1132
- function pathExists(path19) {
1133
- return fs15.access(path19).then(() => true).catch(() => false);
1131
+ var fs16 = require_fs();
1132
+ function pathExists(path21) {
1133
+ return fs16.access(path21).then(() => true).catch(() => false);
1134
1134
  }
1135
1135
  module.exports = {
1136
1136
  pathExists: u3(pathExists),
1137
- pathExistsSync: fs15.existsSync
1137
+ pathExistsSync: fs16.existsSync
1138
1138
  };
1139
1139
  }
1140
1140
  });
@@ -1142,16 +1142,16 @@ var require_path_exists = __commonJS({
1142
1142
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/utimes.js
1143
1143
  var require_utimes = __commonJS({
1144
1144
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/utimes.js"(exports$1, module) {
1145
- var fs15 = require_fs();
1145
+ var fs16 = require_fs();
1146
1146
  var u3 = require_universalify().fromPromise;
1147
- async function utimesMillis(path19, atime, mtime) {
1148
- const fd = await fs15.open(path19, "r+");
1147
+ async function utimesMillis(path21, atime, mtime) {
1148
+ const fd = await fs16.open(path21, "r+");
1149
1149
  let closeErr = null;
1150
1150
  try {
1151
- await fs15.futimes(fd, atime, mtime);
1151
+ await fs16.futimes(fd, atime, mtime);
1152
1152
  } finally {
1153
1153
  try {
1154
- await fs15.close(fd);
1154
+ await fs16.close(fd);
1155
1155
  } catch (e) {
1156
1156
  closeErr = e;
1157
1157
  }
@@ -1160,10 +1160,10 @@ var require_utimes = __commonJS({
1160
1160
  throw closeErr;
1161
1161
  }
1162
1162
  }
1163
- function utimesMillisSync(path19, atime, mtime) {
1164
- const fd = fs15.openSync(path19, "r+");
1165
- fs15.futimesSync(fd, atime, mtime);
1166
- return fs15.closeSync(fd);
1163
+ function utimesMillisSync(path21, atime, mtime) {
1164
+ const fd = fs16.openSync(path21, "r+");
1165
+ fs16.futimesSync(fd, atime, mtime);
1166
+ return fs16.closeSync(fd);
1167
1167
  }
1168
1168
  module.exports = {
1169
1169
  utimesMillis: u3(utimesMillis),
@@ -1175,11 +1175,11 @@ var require_utimes = __commonJS({
1175
1175
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/stat.js
1176
1176
  var require_stat = __commonJS({
1177
1177
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/stat.js"(exports$1, module) {
1178
- var fs15 = require_fs();
1179
- var path19 = __require("path");
1178
+ var fs16 = require_fs();
1179
+ var path21 = __require("path");
1180
1180
  var u3 = require_universalify().fromPromise;
1181
1181
  function getStats(src, dest, opts) {
1182
- const statFunc = opts.dereference ? (file) => fs15.stat(file, { bigint: true }) : (file) => fs15.lstat(file, { bigint: true });
1182
+ const statFunc = opts.dereference ? (file) => fs16.stat(file, { bigint: true }) : (file) => fs16.lstat(file, { bigint: true });
1183
1183
  return Promise.all([
1184
1184
  statFunc(src),
1185
1185
  statFunc(dest).catch((err) => {
@@ -1190,7 +1190,7 @@ var require_stat = __commonJS({
1190
1190
  }
1191
1191
  function getStatsSync(src, dest, opts) {
1192
1192
  let destStat;
1193
- const statFunc = opts.dereference ? (file) => fs15.statSync(file, { bigint: true }) : (file) => fs15.lstatSync(file, { bigint: true });
1193
+ const statFunc = opts.dereference ? (file) => fs16.statSync(file, { bigint: true }) : (file) => fs16.lstatSync(file, { bigint: true });
1194
1194
  const srcStat = statFunc(src);
1195
1195
  try {
1196
1196
  destStat = statFunc(dest);
@@ -1204,8 +1204,8 @@ var require_stat = __commonJS({
1204
1204
  const { srcStat, destStat } = await getStats(src, dest, opts);
1205
1205
  if (destStat) {
1206
1206
  if (areIdentical(srcStat, destStat)) {
1207
- const srcBaseName = path19.basename(src);
1208
- const destBaseName = path19.basename(dest);
1207
+ const srcBaseName = path21.basename(src);
1208
+ const destBaseName = path21.basename(dest);
1209
1209
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1210
1210
  return { srcStat, destStat, isChangingCase: true };
1211
1211
  }
@@ -1227,8 +1227,8 @@ var require_stat = __commonJS({
1227
1227
  const { srcStat, destStat } = getStatsSync(src, dest, opts);
1228
1228
  if (destStat) {
1229
1229
  if (areIdentical(srcStat, destStat)) {
1230
- const srcBaseName = path19.basename(src);
1231
- const destBaseName = path19.basename(dest);
1230
+ const srcBaseName = path21.basename(src);
1231
+ const destBaseName = path21.basename(dest);
1232
1232
  if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
1233
1233
  return { srcStat, destStat, isChangingCase: true };
1234
1234
  }
@@ -1247,12 +1247,12 @@ var require_stat = __commonJS({
1247
1247
  return { srcStat, destStat };
1248
1248
  }
1249
1249
  async function checkParentPaths(src, srcStat, dest, funcName) {
1250
- const srcParent = path19.resolve(path19.dirname(src));
1251
- const destParent = path19.resolve(path19.dirname(dest));
1252
- if (destParent === srcParent || destParent === path19.parse(destParent).root) return;
1250
+ const srcParent = path21.resolve(path21.dirname(src));
1251
+ const destParent = path21.resolve(path21.dirname(dest));
1252
+ if (destParent === srcParent || destParent === path21.parse(destParent).root) return;
1253
1253
  let destStat;
1254
1254
  try {
1255
- destStat = await fs15.stat(destParent, { bigint: true });
1255
+ destStat = await fs16.stat(destParent, { bigint: true });
1256
1256
  } catch (err) {
1257
1257
  if (err.code === "ENOENT") return;
1258
1258
  throw err;
@@ -1263,12 +1263,12 @@ var require_stat = __commonJS({
1263
1263
  return checkParentPaths(src, srcStat, destParent, funcName);
1264
1264
  }
1265
1265
  function checkParentPathsSync(src, srcStat, dest, funcName) {
1266
- const srcParent = path19.resolve(path19.dirname(src));
1267
- const destParent = path19.resolve(path19.dirname(dest));
1268
- if (destParent === srcParent || destParent === path19.parse(destParent).root) return;
1266
+ const srcParent = path21.resolve(path21.dirname(src));
1267
+ const destParent = path21.resolve(path21.dirname(dest));
1268
+ if (destParent === srcParent || destParent === path21.parse(destParent).root) return;
1269
1269
  let destStat;
1270
1270
  try {
1271
- destStat = fs15.statSync(destParent, { bigint: true });
1271
+ destStat = fs16.statSync(destParent, { bigint: true });
1272
1272
  } catch (err) {
1273
1273
  if (err.code === "ENOENT") return;
1274
1274
  throw err;
@@ -1282,8 +1282,8 @@ var require_stat = __commonJS({
1282
1282
  return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
1283
1283
  }
1284
1284
  function isSrcSubdir(src, dest) {
1285
- const srcArr = path19.resolve(src).split(path19.sep).filter((i2) => i2);
1286
- const destArr = path19.resolve(dest).split(path19.sep).filter((i2) => i2);
1285
+ const srcArr = path21.resolve(src).split(path21.sep).filter((i2) => i2);
1286
+ const destArr = path21.resolve(dest).split(path21.sep).filter((i2) => i2);
1287
1287
  return srcArr.every((cur, i2) => destArr[i2] === cur);
1288
1288
  }
1289
1289
  function errMsg(src, dest, funcName) {
@@ -1333,8 +1333,8 @@ var require_async = __commonJS({
1333
1333
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy.js
1334
1334
  var require_copy = __commonJS({
1335
1335
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy.js"(exports$1, module) {
1336
- var fs15 = require_fs();
1337
- var path19 = __require("path");
1336
+ var fs16 = require_fs();
1337
+ var path21 = __require("path");
1338
1338
  var { mkdirs } = require_mkdirs();
1339
1339
  var { pathExists } = require_path_exists();
1340
1340
  var { utimesMillis } = require_utimes();
@@ -1357,7 +1357,7 @@ var require_copy = __commonJS({
1357
1357
  await stat.checkParentPaths(src, srcStat, dest, "copy");
1358
1358
  const include = await runFilter(src, dest, opts);
1359
1359
  if (!include) return;
1360
- const destParent = path19.dirname(dest);
1360
+ const destParent = path21.dirname(dest);
1361
1361
  const dirExists = await pathExists(destParent);
1362
1362
  if (!dirExists) {
1363
1363
  await mkdirs(destParent);
@@ -1369,7 +1369,7 @@ var require_copy = __commonJS({
1369
1369
  return opts.filter(src, dest);
1370
1370
  }
1371
1371
  async function getStatsAndPerformCopy(destStat, src, dest, opts) {
1372
- const statFn = opts.dereference ? fs15.stat : fs15.lstat;
1372
+ const statFn = opts.dereference ? fs16.stat : fs16.lstat;
1373
1373
  const srcStat = await statFn(src);
1374
1374
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
1375
1375
  if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -1381,7 +1381,7 @@ var require_copy = __commonJS({
1381
1381
  async function onFile(srcStat, destStat, src, dest, opts) {
1382
1382
  if (!destStat) return copyFile(srcStat, src, dest, opts);
1383
1383
  if (opts.overwrite) {
1384
- await fs15.unlink(dest);
1384
+ await fs16.unlink(dest);
1385
1385
  return copyFile(srcStat, src, dest, opts);
1386
1386
  }
1387
1387
  if (opts.errorOnExist) {
@@ -1389,29 +1389,29 @@ var require_copy = __commonJS({
1389
1389
  }
1390
1390
  }
1391
1391
  async function copyFile(srcStat, src, dest, opts) {
1392
- await fs15.copyFile(src, dest);
1392
+ await fs16.copyFile(src, dest);
1393
1393
  if (opts.preserveTimestamps) {
1394
1394
  if (fileIsNotWritable(srcStat.mode)) {
1395
1395
  await makeFileWritable(dest, srcStat.mode);
1396
1396
  }
1397
- const updatedSrcStat = await fs15.stat(src);
1397
+ const updatedSrcStat = await fs16.stat(src);
1398
1398
  await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1399
1399
  }
1400
- return fs15.chmod(dest, srcStat.mode);
1400
+ return fs16.chmod(dest, srcStat.mode);
1401
1401
  }
1402
1402
  function fileIsNotWritable(srcMode) {
1403
1403
  return (srcMode & 128) === 0;
1404
1404
  }
1405
1405
  function makeFileWritable(dest, srcMode) {
1406
- return fs15.chmod(dest, srcMode | 128);
1406
+ return fs16.chmod(dest, srcMode | 128);
1407
1407
  }
1408
1408
  async function onDir(srcStat, destStat, src, dest, opts) {
1409
1409
  if (!destStat) {
1410
- await fs15.mkdir(dest);
1410
+ await fs16.mkdir(dest);
1411
1411
  }
1412
- await asyncIteratorConcurrentProcess(await fs15.opendir(src), async (item) => {
1413
- const srcItem = path19.join(src, item.name);
1414
- const destItem = path19.join(dest, item.name);
1412
+ await asyncIteratorConcurrentProcess(await fs16.opendir(src), async (item) => {
1413
+ const srcItem = path21.join(src, item.name);
1414
+ const destItem = path21.join(dest, item.name);
1415
1415
  const include = await runFilter(srcItem, destItem, opts);
1416
1416
  if (include) {
1417
1417
  const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
@@ -1419,26 +1419,26 @@ var require_copy = __commonJS({
1419
1419
  }
1420
1420
  });
1421
1421
  if (!destStat) {
1422
- await fs15.chmod(dest, srcStat.mode);
1422
+ await fs16.chmod(dest, srcStat.mode);
1423
1423
  }
1424
1424
  }
1425
1425
  async function onLink(destStat, src, dest, opts) {
1426
- let resolvedSrc = await fs15.readlink(src);
1426
+ let resolvedSrc = await fs16.readlink(src);
1427
1427
  if (opts.dereference) {
1428
- resolvedSrc = path19.resolve(process.cwd(), resolvedSrc);
1428
+ resolvedSrc = path21.resolve(process.cwd(), resolvedSrc);
1429
1429
  }
1430
1430
  if (!destStat) {
1431
- return fs15.symlink(resolvedSrc, dest);
1431
+ return fs16.symlink(resolvedSrc, dest);
1432
1432
  }
1433
1433
  let resolvedDest = null;
1434
1434
  try {
1435
- resolvedDest = await fs15.readlink(dest);
1435
+ resolvedDest = await fs16.readlink(dest);
1436
1436
  } catch (e) {
1437
- if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs15.symlink(resolvedSrc, dest);
1437
+ if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs16.symlink(resolvedSrc, dest);
1438
1438
  throw e;
1439
1439
  }
1440
1440
  if (opts.dereference) {
1441
- resolvedDest = path19.resolve(process.cwd(), resolvedDest);
1441
+ resolvedDest = path21.resolve(process.cwd(), resolvedDest);
1442
1442
  }
1443
1443
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1444
1444
  throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
@@ -1446,8 +1446,8 @@ var require_copy = __commonJS({
1446
1446
  if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
1447
1447
  throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
1448
1448
  }
1449
- await fs15.unlink(dest);
1450
- return fs15.symlink(resolvedSrc, dest);
1449
+ await fs16.unlink(dest);
1450
+ return fs16.symlink(resolvedSrc, dest);
1451
1451
  }
1452
1452
  module.exports = copy;
1453
1453
  }
@@ -1456,8 +1456,8 @@ var require_copy = __commonJS({
1456
1456
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy-sync.js
1457
1457
  var require_copy_sync = __commonJS({
1458
1458
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy-sync.js"(exports$1, module) {
1459
- var fs15 = require_graceful_fs();
1460
- var path19 = __require("path");
1459
+ var fs16 = require_graceful_fs();
1460
+ var path21 = __require("path");
1461
1461
  var mkdirsSync = require_mkdirs().mkdirsSync;
1462
1462
  var utimesMillisSync = require_utimes().utimesMillisSync;
1463
1463
  var stat = require_stat();
@@ -1478,12 +1478,12 @@ var require_copy_sync = __commonJS({
1478
1478
  const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
1479
1479
  stat.checkParentPathsSync(src, srcStat, dest, "copy");
1480
1480
  if (opts.filter && !opts.filter(src, dest)) return;
1481
- const destParent = path19.dirname(dest);
1482
- if (!fs15.existsSync(destParent)) mkdirsSync(destParent);
1481
+ const destParent = path21.dirname(dest);
1482
+ if (!fs16.existsSync(destParent)) mkdirsSync(destParent);
1483
1483
  return getStats(destStat, src, dest, opts);
1484
1484
  }
1485
1485
  function getStats(destStat, src, dest, opts) {
1486
- const statSync2 = opts.dereference ? fs15.statSync : fs15.lstatSync;
1486
+ const statSync2 = opts.dereference ? fs16.statSync : fs16.lstatSync;
1487
1487
  const srcStat = statSync2(src);
1488
1488
  if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
1489
1489
  else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
@@ -1498,14 +1498,14 @@ var require_copy_sync = __commonJS({
1498
1498
  }
1499
1499
  function mayCopyFile(srcStat, src, dest, opts) {
1500
1500
  if (opts.overwrite) {
1501
- fs15.unlinkSync(dest);
1501
+ fs16.unlinkSync(dest);
1502
1502
  return copyFile(srcStat, src, dest, opts);
1503
1503
  } else if (opts.errorOnExist) {
1504
1504
  throw new Error(`'${dest}' already exists`);
1505
1505
  }
1506
1506
  }
1507
1507
  function copyFile(srcStat, src, dest, opts) {
1508
- fs15.copyFileSync(src, dest);
1508
+ fs16.copyFileSync(src, dest);
1509
1509
  if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
1510
1510
  return setDestMode(dest, srcStat.mode);
1511
1511
  }
@@ -1520,10 +1520,10 @@ var require_copy_sync = __commonJS({
1520
1520
  return setDestMode(dest, srcMode | 128);
1521
1521
  }
1522
1522
  function setDestMode(dest, srcMode) {
1523
- return fs15.chmodSync(dest, srcMode);
1523
+ return fs16.chmodSync(dest, srcMode);
1524
1524
  }
1525
1525
  function setDestTimestamps(src, dest) {
1526
- const updatedSrcStat = fs15.statSync(src);
1526
+ const updatedSrcStat = fs16.statSync(src);
1527
1527
  return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
1528
1528
  }
1529
1529
  function onDir(srcStat, destStat, src, dest, opts) {
@@ -1531,12 +1531,12 @@ var require_copy_sync = __commonJS({
1531
1531
  return copyDir(src, dest, opts);
1532
1532
  }
1533
1533
  function mkDirAndCopy(srcMode, src, dest, opts) {
1534
- fs15.mkdirSync(dest);
1534
+ fs16.mkdirSync(dest);
1535
1535
  copyDir(src, dest, opts);
1536
1536
  return setDestMode(dest, srcMode);
1537
1537
  }
1538
1538
  function copyDir(src, dest, opts) {
1539
- const dir = fs15.opendirSync(src);
1539
+ const dir = fs16.opendirSync(src);
1540
1540
  try {
1541
1541
  let dirent;
1542
1542
  while ((dirent = dir.readSync()) !== null) {
@@ -1547,29 +1547,29 @@ var require_copy_sync = __commonJS({
1547
1547
  }
1548
1548
  }
1549
1549
  function copyDirItem(item, src, dest, opts) {
1550
- const srcItem = path19.join(src, item);
1551
- const destItem = path19.join(dest, item);
1550
+ const srcItem = path21.join(src, item);
1551
+ const destItem = path21.join(dest, item);
1552
1552
  if (opts.filter && !opts.filter(srcItem, destItem)) return;
1553
1553
  const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
1554
1554
  return getStats(destStat, srcItem, destItem, opts);
1555
1555
  }
1556
1556
  function onLink(destStat, src, dest, opts) {
1557
- let resolvedSrc = fs15.readlinkSync(src);
1557
+ let resolvedSrc = fs16.readlinkSync(src);
1558
1558
  if (opts.dereference) {
1559
- resolvedSrc = path19.resolve(process.cwd(), resolvedSrc);
1559
+ resolvedSrc = path21.resolve(process.cwd(), resolvedSrc);
1560
1560
  }
1561
1561
  if (!destStat) {
1562
- return fs15.symlinkSync(resolvedSrc, dest);
1562
+ return fs16.symlinkSync(resolvedSrc, dest);
1563
1563
  } else {
1564
1564
  let resolvedDest;
1565
1565
  try {
1566
- resolvedDest = fs15.readlinkSync(dest);
1566
+ resolvedDest = fs16.readlinkSync(dest);
1567
1567
  } catch (err) {
1568
- if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs15.symlinkSync(resolvedSrc, dest);
1568
+ if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs16.symlinkSync(resolvedSrc, dest);
1569
1569
  throw err;
1570
1570
  }
1571
1571
  if (opts.dereference) {
1572
- resolvedDest = path19.resolve(process.cwd(), resolvedDest);
1572
+ resolvedDest = path21.resolve(process.cwd(), resolvedDest);
1573
1573
  }
1574
1574
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
1575
1575
  throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
@@ -1581,8 +1581,8 @@ var require_copy_sync = __commonJS({
1581
1581
  }
1582
1582
  }
1583
1583
  function copyLink(resolvedSrc, dest) {
1584
- fs15.unlinkSync(dest);
1585
- return fs15.symlinkSync(resolvedSrc, dest);
1584
+ fs16.unlinkSync(dest);
1585
+ return fs16.symlinkSync(resolvedSrc, dest);
1586
1586
  }
1587
1587
  module.exports = copySync;
1588
1588
  }
@@ -1602,13 +1602,13 @@ var require_copy2 = __commonJS({
1602
1602
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/remove/index.js
1603
1603
  var require_remove = __commonJS({
1604
1604
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/remove/index.js"(exports$1, module) {
1605
- var fs15 = require_graceful_fs();
1605
+ var fs16 = require_graceful_fs();
1606
1606
  var u3 = require_universalify().fromCallback;
1607
- function remove(path19, callback) {
1608
- fs15.rm(path19, { recursive: true, force: true }, callback);
1607
+ function remove(path21, callback) {
1608
+ fs16.rm(path21, { recursive: true, force: true }, callback);
1609
1609
  }
1610
- function removeSync(path19) {
1611
- fs15.rmSync(path19, { recursive: true, force: true });
1610
+ function removeSync(path21) {
1611
+ fs16.rmSync(path21, { recursive: true, force: true });
1612
1612
  }
1613
1613
  module.exports = {
1614
1614
  remove: u3(remove),
@@ -1621,28 +1621,28 @@ var require_remove = __commonJS({
1621
1621
  var require_empty = __commonJS({
1622
1622
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/empty/index.js"(exports$1, module) {
1623
1623
  var u3 = require_universalify().fromPromise;
1624
- var fs15 = require_fs();
1625
- var path19 = __require("path");
1624
+ var fs16 = require_fs();
1625
+ var path21 = __require("path");
1626
1626
  var mkdir = require_mkdirs();
1627
1627
  var remove = require_remove();
1628
1628
  var emptyDir = u3(async function emptyDir2(dir) {
1629
1629
  let items;
1630
1630
  try {
1631
- items = await fs15.readdir(dir);
1631
+ items = await fs16.readdir(dir);
1632
1632
  } catch {
1633
1633
  return mkdir.mkdirs(dir);
1634
1634
  }
1635
- return Promise.all(items.map((item) => remove.remove(path19.join(dir, item))));
1635
+ return Promise.all(items.map((item) => remove.remove(path21.join(dir, item))));
1636
1636
  });
1637
1637
  function emptyDirSync(dir) {
1638
1638
  let items;
1639
1639
  try {
1640
- items = fs15.readdirSync(dir);
1640
+ items = fs16.readdirSync(dir);
1641
1641
  } catch {
1642
1642
  return mkdir.mkdirsSync(dir);
1643
1643
  }
1644
1644
  items.forEach((item) => {
1645
- item = path19.join(dir, item);
1645
+ item = path21.join(dir, item);
1646
1646
  remove.removeSync(item);
1647
1647
  });
1648
1648
  }
@@ -1659,52 +1659,52 @@ var require_empty = __commonJS({
1659
1659
  var require_file = __commonJS({
1660
1660
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/file.js"(exports$1, module) {
1661
1661
  var u3 = require_universalify().fromPromise;
1662
- var path19 = __require("path");
1663
- var fs15 = require_fs();
1662
+ var path21 = __require("path");
1663
+ var fs16 = require_fs();
1664
1664
  var mkdir = require_mkdirs();
1665
1665
  async function createFile(file) {
1666
1666
  let stats;
1667
1667
  try {
1668
- stats = await fs15.stat(file);
1668
+ stats = await fs16.stat(file);
1669
1669
  } catch {
1670
1670
  }
1671
1671
  if (stats && stats.isFile()) return;
1672
- const dir = path19.dirname(file);
1672
+ const dir = path21.dirname(file);
1673
1673
  let dirStats = null;
1674
1674
  try {
1675
- dirStats = await fs15.stat(dir);
1675
+ dirStats = await fs16.stat(dir);
1676
1676
  } catch (err) {
1677
1677
  if (err.code === "ENOENT") {
1678
1678
  await mkdir.mkdirs(dir);
1679
- await fs15.writeFile(file, "");
1679
+ await fs16.writeFile(file, "");
1680
1680
  return;
1681
1681
  } else {
1682
1682
  throw err;
1683
1683
  }
1684
1684
  }
1685
1685
  if (dirStats.isDirectory()) {
1686
- await fs15.writeFile(file, "");
1686
+ await fs16.writeFile(file, "");
1687
1687
  } else {
1688
- await fs15.readdir(dir);
1688
+ await fs16.readdir(dir);
1689
1689
  }
1690
1690
  }
1691
1691
  function createFileSync(file) {
1692
1692
  let stats;
1693
1693
  try {
1694
- stats = fs15.statSync(file);
1694
+ stats = fs16.statSync(file);
1695
1695
  } catch {
1696
1696
  }
1697
1697
  if (stats && stats.isFile()) return;
1698
- const dir = path19.dirname(file);
1698
+ const dir = path21.dirname(file);
1699
1699
  try {
1700
- if (!fs15.statSync(dir).isDirectory()) {
1701
- fs15.readdirSync(dir);
1700
+ if (!fs16.statSync(dir).isDirectory()) {
1701
+ fs16.readdirSync(dir);
1702
1702
  }
1703
1703
  } catch (err) {
1704
1704
  if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
1705
1705
  else throw err;
1706
1706
  }
1707
- fs15.writeFileSync(file, "");
1707
+ fs16.writeFileSync(file, "");
1708
1708
  }
1709
1709
  module.exports = {
1710
1710
  createFile: u3(createFile),
@@ -1717,50 +1717,50 @@ var require_file = __commonJS({
1717
1717
  var require_link = __commonJS({
1718
1718
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/link.js"(exports$1, module) {
1719
1719
  var u3 = require_universalify().fromPromise;
1720
- var path19 = __require("path");
1721
- var fs15 = require_fs();
1720
+ var path21 = __require("path");
1721
+ var fs16 = require_fs();
1722
1722
  var mkdir = require_mkdirs();
1723
1723
  var { pathExists } = require_path_exists();
1724
1724
  var { areIdentical } = require_stat();
1725
1725
  async function createLink(srcpath, dstpath) {
1726
1726
  let dstStat;
1727
1727
  try {
1728
- dstStat = await fs15.lstat(dstpath);
1728
+ dstStat = await fs16.lstat(dstpath);
1729
1729
  } catch {
1730
1730
  }
1731
1731
  let srcStat;
1732
1732
  try {
1733
- srcStat = await fs15.lstat(srcpath);
1733
+ srcStat = await fs16.lstat(srcpath);
1734
1734
  } catch (err) {
1735
1735
  err.message = err.message.replace("lstat", "ensureLink");
1736
1736
  throw err;
1737
1737
  }
1738
1738
  if (dstStat && areIdentical(srcStat, dstStat)) return;
1739
- const dir = path19.dirname(dstpath);
1739
+ const dir = path21.dirname(dstpath);
1740
1740
  const dirExists = await pathExists(dir);
1741
1741
  if (!dirExists) {
1742
1742
  await mkdir.mkdirs(dir);
1743
1743
  }
1744
- await fs15.link(srcpath, dstpath);
1744
+ await fs16.link(srcpath, dstpath);
1745
1745
  }
1746
1746
  function createLinkSync(srcpath, dstpath) {
1747
1747
  let dstStat;
1748
1748
  try {
1749
- dstStat = fs15.lstatSync(dstpath);
1749
+ dstStat = fs16.lstatSync(dstpath);
1750
1750
  } catch {
1751
1751
  }
1752
1752
  try {
1753
- const srcStat = fs15.lstatSync(srcpath);
1753
+ const srcStat = fs16.lstatSync(srcpath);
1754
1754
  if (dstStat && areIdentical(srcStat, dstStat)) return;
1755
1755
  } catch (err) {
1756
1756
  err.message = err.message.replace("lstat", "ensureLink");
1757
1757
  throw err;
1758
1758
  }
1759
- const dir = path19.dirname(dstpath);
1760
- const dirExists = fs15.existsSync(dir);
1761
- if (dirExists) return fs15.linkSync(srcpath, dstpath);
1759
+ const dir = path21.dirname(dstpath);
1760
+ const dirExists = fs16.existsSync(dir);
1761
+ if (dirExists) return fs16.linkSync(srcpath, dstpath);
1762
1762
  mkdir.mkdirsSync(dir);
1763
- return fs15.linkSync(srcpath, dstpath);
1763
+ return fs16.linkSync(srcpath, dstpath);
1764
1764
  }
1765
1765
  module.exports = {
1766
1766
  createLink: u3(createLink),
@@ -1772,14 +1772,14 @@ var require_link = __commonJS({
1772
1772
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-paths.js
1773
1773
  var require_symlink_paths = __commonJS({
1774
1774
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports$1, module) {
1775
- var path19 = __require("path");
1776
- var fs15 = require_fs();
1775
+ var path21 = __require("path");
1776
+ var fs16 = require_fs();
1777
1777
  var { pathExists } = require_path_exists();
1778
1778
  var u3 = require_universalify().fromPromise;
1779
1779
  async function symlinkPaths(srcpath, dstpath) {
1780
- if (path19.isAbsolute(srcpath)) {
1780
+ if (path21.isAbsolute(srcpath)) {
1781
1781
  try {
1782
- await fs15.lstat(srcpath);
1782
+ await fs16.lstat(srcpath);
1783
1783
  } catch (err) {
1784
1784
  err.message = err.message.replace("lstat", "ensureSymlink");
1785
1785
  throw err;
@@ -1789,8 +1789,8 @@ var require_symlink_paths = __commonJS({
1789
1789
  toDst: srcpath
1790
1790
  };
1791
1791
  }
1792
- const dstdir = path19.dirname(dstpath);
1793
- const relativeToDst = path19.join(dstdir, srcpath);
1792
+ const dstdir = path21.dirname(dstpath);
1793
+ const relativeToDst = path21.join(dstdir, srcpath);
1794
1794
  const exists = await pathExists(relativeToDst);
1795
1795
  if (exists) {
1796
1796
  return {
@@ -1799,39 +1799,39 @@ var require_symlink_paths = __commonJS({
1799
1799
  };
1800
1800
  }
1801
1801
  try {
1802
- await fs15.lstat(srcpath);
1802
+ await fs16.lstat(srcpath);
1803
1803
  } catch (err) {
1804
1804
  err.message = err.message.replace("lstat", "ensureSymlink");
1805
1805
  throw err;
1806
1806
  }
1807
1807
  return {
1808
1808
  toCwd: srcpath,
1809
- toDst: path19.relative(dstdir, srcpath)
1809
+ toDst: path21.relative(dstdir, srcpath)
1810
1810
  };
1811
1811
  }
1812
1812
  function symlinkPathsSync(srcpath, dstpath) {
1813
- if (path19.isAbsolute(srcpath)) {
1814
- const exists2 = fs15.existsSync(srcpath);
1813
+ if (path21.isAbsolute(srcpath)) {
1814
+ const exists2 = fs16.existsSync(srcpath);
1815
1815
  if (!exists2) throw new Error("absolute srcpath does not exist");
1816
1816
  return {
1817
1817
  toCwd: srcpath,
1818
1818
  toDst: srcpath
1819
1819
  };
1820
1820
  }
1821
- const dstdir = path19.dirname(dstpath);
1822
- const relativeToDst = path19.join(dstdir, srcpath);
1823
- const exists = fs15.existsSync(relativeToDst);
1821
+ const dstdir = path21.dirname(dstpath);
1822
+ const relativeToDst = path21.join(dstdir, srcpath);
1823
+ const exists = fs16.existsSync(relativeToDst);
1824
1824
  if (exists) {
1825
1825
  return {
1826
1826
  toCwd: relativeToDst,
1827
1827
  toDst: srcpath
1828
1828
  };
1829
1829
  }
1830
- const srcExists = fs15.existsSync(srcpath);
1830
+ const srcExists = fs16.existsSync(srcpath);
1831
1831
  if (!srcExists) throw new Error("relative srcpath does not exist");
1832
1832
  return {
1833
1833
  toCwd: srcpath,
1834
- toDst: path19.relative(dstdir, srcpath)
1834
+ toDst: path21.relative(dstdir, srcpath)
1835
1835
  };
1836
1836
  }
1837
1837
  module.exports = {
@@ -1844,13 +1844,13 @@ var require_symlink_paths = __commonJS({
1844
1844
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-type.js
1845
1845
  var require_symlink_type = __commonJS({
1846
1846
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports$1, module) {
1847
- var fs15 = require_fs();
1847
+ var fs16 = require_fs();
1848
1848
  var u3 = require_universalify().fromPromise;
1849
1849
  async function symlinkType(srcpath, type) {
1850
1850
  if (type) return type;
1851
1851
  let stats;
1852
1852
  try {
1853
- stats = await fs15.lstat(srcpath);
1853
+ stats = await fs16.lstat(srcpath);
1854
1854
  } catch {
1855
1855
  return "file";
1856
1856
  }
@@ -1860,7 +1860,7 @@ var require_symlink_type = __commonJS({
1860
1860
  if (type) return type;
1861
1861
  let stats;
1862
1862
  try {
1863
- stats = fs15.lstatSync(srcpath);
1863
+ stats = fs16.lstatSync(srcpath);
1864
1864
  } catch {
1865
1865
  return "file";
1866
1866
  }
@@ -1877,8 +1877,8 @@ var require_symlink_type = __commonJS({
1877
1877
  var require_symlink = __commonJS({
1878
1878
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink.js"(exports$1, module) {
1879
1879
  var u3 = require_universalify().fromPromise;
1880
- var path19 = __require("path");
1881
- var fs15 = require_fs();
1880
+ var path21 = __require("path");
1881
+ var fs16 = require_fs();
1882
1882
  var { mkdirs, mkdirsSync } = require_mkdirs();
1883
1883
  var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
1884
1884
  var { symlinkType, symlinkTypeSync } = require_symlink_type();
@@ -1887,44 +1887,44 @@ var require_symlink = __commonJS({
1887
1887
  async function createSymlink(srcpath, dstpath, type) {
1888
1888
  let stats;
1889
1889
  try {
1890
- stats = await fs15.lstat(dstpath);
1890
+ stats = await fs16.lstat(dstpath);
1891
1891
  } catch {
1892
1892
  }
1893
1893
  if (stats && stats.isSymbolicLink()) {
1894
1894
  const [srcStat, dstStat] = await Promise.all([
1895
- fs15.stat(srcpath),
1896
- fs15.stat(dstpath)
1895
+ fs16.stat(srcpath),
1896
+ fs16.stat(dstpath)
1897
1897
  ]);
1898
1898
  if (areIdentical(srcStat, dstStat)) return;
1899
1899
  }
1900
1900
  const relative = await symlinkPaths(srcpath, dstpath);
1901
1901
  srcpath = relative.toDst;
1902
1902
  const toType = await symlinkType(relative.toCwd, type);
1903
- const dir = path19.dirname(dstpath);
1903
+ const dir = path21.dirname(dstpath);
1904
1904
  if (!await pathExists(dir)) {
1905
1905
  await mkdirs(dir);
1906
1906
  }
1907
- return fs15.symlink(srcpath, dstpath, toType);
1907
+ return fs16.symlink(srcpath, dstpath, toType);
1908
1908
  }
1909
1909
  function createSymlinkSync(srcpath, dstpath, type) {
1910
1910
  let stats;
1911
1911
  try {
1912
- stats = fs15.lstatSync(dstpath);
1912
+ stats = fs16.lstatSync(dstpath);
1913
1913
  } catch {
1914
1914
  }
1915
1915
  if (stats && stats.isSymbolicLink()) {
1916
- const srcStat = fs15.statSync(srcpath);
1917
- const dstStat = fs15.statSync(dstpath);
1916
+ const srcStat = fs16.statSync(srcpath);
1917
+ const dstStat = fs16.statSync(dstpath);
1918
1918
  if (areIdentical(srcStat, dstStat)) return;
1919
1919
  }
1920
1920
  const relative = symlinkPathsSync(srcpath, dstpath);
1921
1921
  srcpath = relative.toDst;
1922
1922
  type = symlinkTypeSync(relative.toCwd, type);
1923
- const dir = path19.dirname(dstpath);
1924
- const exists = fs15.existsSync(dir);
1925
- if (exists) return fs15.symlinkSync(srcpath, dstpath, type);
1923
+ const dir = path21.dirname(dstpath);
1924
+ const exists = fs16.existsSync(dir);
1925
+ if (exists) return fs16.symlinkSync(srcpath, dstpath, type);
1926
1926
  mkdirsSync(dir);
1927
- return fs15.symlinkSync(srcpath, dstpath, type);
1927
+ return fs16.symlinkSync(srcpath, dstpath, type);
1928
1928
  }
1929
1929
  module.exports = {
1930
1930
  createSymlink: u3(createSymlink),
@@ -1990,9 +1990,9 @@ var require_jsonfile = __commonJS({
1990
1990
  if (typeof options === "string") {
1991
1991
  options = { encoding: options };
1992
1992
  }
1993
- const fs15 = options.fs || _fs;
1993
+ const fs16 = options.fs || _fs;
1994
1994
  const shouldThrow = "throws" in options ? options.throws : true;
1995
- let data = await universalify.fromCallback(fs15.readFile)(file, options);
1995
+ let data = await universalify.fromCallback(fs16.readFile)(file, options);
1996
1996
  data = stripBom(data);
1997
1997
  let obj;
1998
1998
  try {
@@ -2012,10 +2012,10 @@ var require_jsonfile = __commonJS({
2012
2012
  if (typeof options === "string") {
2013
2013
  options = { encoding: options };
2014
2014
  }
2015
- const fs15 = options.fs || _fs;
2015
+ const fs16 = options.fs || _fs;
2016
2016
  const shouldThrow = "throws" in options ? options.throws : true;
2017
2017
  try {
2018
- let content = fs15.readFileSync(file, options);
2018
+ let content = fs16.readFileSync(file, options);
2019
2019
  content = stripBom(content);
2020
2020
  return JSON.parse(content, options.reviver);
2021
2021
  } catch (err) {
@@ -2028,15 +2028,15 @@ var require_jsonfile = __commonJS({
2028
2028
  }
2029
2029
  }
2030
2030
  async function _writeFile(file, obj, options = {}) {
2031
- const fs15 = options.fs || _fs;
2031
+ const fs16 = options.fs || _fs;
2032
2032
  const str = stringify(obj, options);
2033
- await universalify.fromCallback(fs15.writeFile)(file, str, options);
2033
+ await universalify.fromCallback(fs16.writeFile)(file, str, options);
2034
2034
  }
2035
2035
  var writeFile = universalify.fromPromise(_writeFile);
2036
2036
  function writeFileSync2(file, obj, options = {}) {
2037
- const fs15 = options.fs || _fs;
2037
+ const fs16 = options.fs || _fs;
2038
2038
  const str = stringify(obj, options);
2039
- return fs15.writeFileSync(file, str, options);
2039
+ return fs16.writeFileSync(file, str, options);
2040
2040
  }
2041
2041
  module.exports = {
2042
2042
  readFile,
@@ -2065,23 +2065,23 @@ var require_jsonfile2 = __commonJS({
2065
2065
  var require_output_file = __commonJS({
2066
2066
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/output-file/index.js"(exports$1, module) {
2067
2067
  var u3 = require_universalify().fromPromise;
2068
- var fs15 = require_fs();
2069
- var path19 = __require("path");
2068
+ var fs16 = require_fs();
2069
+ var path21 = __require("path");
2070
2070
  var mkdir = require_mkdirs();
2071
2071
  var pathExists = require_path_exists().pathExists;
2072
2072
  async function outputFile(file, data, encoding = "utf-8") {
2073
- const dir = path19.dirname(file);
2073
+ const dir = path21.dirname(file);
2074
2074
  if (!await pathExists(dir)) {
2075
2075
  await mkdir.mkdirs(dir);
2076
2076
  }
2077
- return fs15.writeFile(file, data, encoding);
2077
+ return fs16.writeFile(file, data, encoding);
2078
2078
  }
2079
2079
  function outputFileSync(file, ...args) {
2080
- const dir = path19.dirname(file);
2081
- if (!fs15.existsSync(dir)) {
2080
+ const dir = path21.dirname(file);
2081
+ if (!fs16.existsSync(dir)) {
2082
2082
  mkdir.mkdirsSync(dir);
2083
2083
  }
2084
- fs15.writeFileSync(file, ...args);
2084
+ fs16.writeFileSync(file, ...args);
2085
2085
  }
2086
2086
  module.exports = {
2087
2087
  outputFile: u3(outputFile),
@@ -2136,8 +2136,8 @@ var require_json = __commonJS({
2136
2136
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move.js
2137
2137
  var require_move = __commonJS({
2138
2138
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move.js"(exports$1, module) {
2139
- var fs15 = require_fs();
2140
- var path19 = __require("path");
2139
+ var fs16 = require_fs();
2140
+ var path21 = __require("path");
2141
2141
  var { copy } = require_copy2();
2142
2142
  var { remove } = require_remove();
2143
2143
  var { mkdirp } = require_mkdirs();
@@ -2147,8 +2147,8 @@ var require_move = __commonJS({
2147
2147
  const overwrite = opts.overwrite || opts.clobber || false;
2148
2148
  const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
2149
2149
  await stat.checkParentPaths(src, srcStat, dest, "move");
2150
- const destParent = path19.dirname(dest);
2151
- const parsedParentPath = path19.parse(destParent);
2150
+ const destParent = path21.dirname(dest);
2151
+ const parsedParentPath = path21.parse(destParent);
2152
2152
  if (parsedParentPath.root !== destParent) {
2153
2153
  await mkdirp(destParent);
2154
2154
  }
@@ -2163,7 +2163,7 @@ var require_move = __commonJS({
2163
2163
  }
2164
2164
  }
2165
2165
  try {
2166
- await fs15.rename(src, dest);
2166
+ await fs16.rename(src, dest);
2167
2167
  } catch (err) {
2168
2168
  if (err.code !== "EXDEV") {
2169
2169
  throw err;
@@ -2187,8 +2187,8 @@ var require_move = __commonJS({
2187
2187
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move-sync.js
2188
2188
  var require_move_sync = __commonJS({
2189
2189
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move-sync.js"(exports$1, module) {
2190
- var fs15 = require_graceful_fs();
2191
- var path19 = __require("path");
2190
+ var fs16 = require_graceful_fs();
2191
+ var path21 = __require("path");
2192
2192
  var copySync = require_copy2().copySync;
2193
2193
  var removeSync = require_remove().removeSync;
2194
2194
  var mkdirpSync = require_mkdirs().mkdirpSync;
@@ -2198,12 +2198,12 @@ var require_move_sync = __commonJS({
2198
2198
  const overwrite = opts.overwrite || opts.clobber || false;
2199
2199
  const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
2200
2200
  stat.checkParentPathsSync(src, srcStat, dest, "move");
2201
- if (!isParentRoot(dest)) mkdirpSync(path19.dirname(dest));
2201
+ if (!isParentRoot(dest)) mkdirpSync(path21.dirname(dest));
2202
2202
  return doRename(src, dest, overwrite, isChangingCase);
2203
2203
  }
2204
2204
  function isParentRoot(dest) {
2205
- const parent = path19.dirname(dest);
2206
- const parsedPath = path19.parse(parent);
2205
+ const parent = path21.dirname(dest);
2206
+ const parsedPath = path21.parse(parent);
2207
2207
  return parsedPath.root === parent;
2208
2208
  }
2209
2209
  function doRename(src, dest, overwrite, isChangingCase) {
@@ -2212,12 +2212,12 @@ var require_move_sync = __commonJS({
2212
2212
  removeSync(dest);
2213
2213
  return rename(src, dest, overwrite);
2214
2214
  }
2215
- if (fs15.existsSync(dest)) throw new Error("dest already exists.");
2215
+ if (fs16.existsSync(dest)) throw new Error("dest already exists.");
2216
2216
  return rename(src, dest, overwrite);
2217
2217
  }
2218
2218
  function rename(src, dest, overwrite) {
2219
2219
  try {
2220
- fs15.renameSync(src, dest);
2220
+ fs16.renameSync(src, dest);
2221
2221
  } catch (err) {
2222
2222
  if (err.code !== "EXDEV") throw err;
2223
2223
  return moveAcrossDevice(src, dest, overwrite);
@@ -2344,8 +2344,8 @@ var require_windows = __commonJS({
2344
2344
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports$1, module) {
2345
2345
  module.exports = isexe;
2346
2346
  isexe.sync = sync;
2347
- var fs15 = __require("fs");
2348
- function checkPathExt(path19, options) {
2347
+ var fs16 = __require("fs");
2348
+ function checkPathExt(path21, options) {
2349
2349
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
2350
2350
  if (!pathext) {
2351
2351
  return true;
@@ -2356,25 +2356,25 @@ var require_windows = __commonJS({
2356
2356
  }
2357
2357
  for (var i2 = 0; i2 < pathext.length; i2++) {
2358
2358
  var p2 = pathext[i2].toLowerCase();
2359
- if (p2 && path19.substr(-p2.length).toLowerCase() === p2) {
2359
+ if (p2 && path21.substr(-p2.length).toLowerCase() === p2) {
2360
2360
  return true;
2361
2361
  }
2362
2362
  }
2363
2363
  return false;
2364
2364
  }
2365
- function checkStat(stat, path19, options) {
2365
+ function checkStat(stat, path21, options) {
2366
2366
  if (!stat.isSymbolicLink() && !stat.isFile()) {
2367
2367
  return false;
2368
2368
  }
2369
- return checkPathExt(path19, options);
2369
+ return checkPathExt(path21, options);
2370
2370
  }
2371
- function isexe(path19, options, cb) {
2372
- fs15.stat(path19, function(er2, stat) {
2373
- cb(er2, er2 ? false : checkStat(stat, path19, options));
2371
+ function isexe(path21, options, cb) {
2372
+ fs16.stat(path21, function(er2, stat) {
2373
+ cb(er2, er2 ? false : checkStat(stat, path21, options));
2374
2374
  });
2375
2375
  }
2376
- function sync(path19, options) {
2377
- return checkStat(fs15.statSync(path19), path19, options);
2376
+ function sync(path21, options) {
2377
+ return checkStat(fs16.statSync(path21), path21, options);
2378
2378
  }
2379
2379
  }
2380
2380
  });
@@ -2384,14 +2384,14 @@ var require_mode = __commonJS({
2384
2384
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports$1, module) {
2385
2385
  module.exports = isexe;
2386
2386
  isexe.sync = sync;
2387
- var fs15 = __require("fs");
2388
- function isexe(path19, options, cb) {
2389
- fs15.stat(path19, function(er2, stat) {
2387
+ var fs16 = __require("fs");
2388
+ function isexe(path21, options, cb) {
2389
+ fs16.stat(path21, function(er2, stat) {
2390
2390
  cb(er2, er2 ? false : checkStat(stat, options));
2391
2391
  });
2392
2392
  }
2393
- function sync(path19, options) {
2394
- return checkStat(fs15.statSync(path19), options);
2393
+ function sync(path21, options) {
2394
+ return checkStat(fs16.statSync(path21), options);
2395
2395
  }
2396
2396
  function checkStat(stat, options) {
2397
2397
  return stat.isFile() && checkMode(stat, options);
@@ -2424,7 +2424,7 @@ var require_isexe = __commonJS({
2424
2424
  }
2425
2425
  module.exports = isexe;
2426
2426
  isexe.sync = sync;
2427
- function isexe(path19, options, cb) {
2427
+ function isexe(path21, options, cb) {
2428
2428
  if (typeof options === "function") {
2429
2429
  cb = options;
2430
2430
  options = {};
@@ -2434,7 +2434,7 @@ var require_isexe = __commonJS({
2434
2434
  throw new TypeError("callback not provided");
2435
2435
  }
2436
2436
  return new Promise(function(resolve, reject) {
2437
- isexe(path19, options || {}, function(er2, is2) {
2437
+ isexe(path21, options || {}, function(er2, is2) {
2438
2438
  if (er2) {
2439
2439
  reject(er2);
2440
2440
  } else {
@@ -2443,7 +2443,7 @@ var require_isexe = __commonJS({
2443
2443
  });
2444
2444
  });
2445
2445
  }
2446
- core(path19, options || {}, function(er2, is2) {
2446
+ core(path21, options || {}, function(er2, is2) {
2447
2447
  if (er2) {
2448
2448
  if (er2.code === "EACCES" || options && options.ignoreErrors) {
2449
2449
  er2 = null;
@@ -2453,9 +2453,9 @@ var require_isexe = __commonJS({
2453
2453
  cb(er2, is2);
2454
2454
  });
2455
2455
  }
2456
- function sync(path19, options) {
2456
+ function sync(path21, options) {
2457
2457
  try {
2458
- return core.sync(path19, options || {});
2458
+ return core.sync(path21, options || {});
2459
2459
  } catch (er2) {
2460
2460
  if (options && options.ignoreErrors || er2.code === "EACCES") {
2461
2461
  return false;
@@ -2471,7 +2471,7 @@ var require_isexe = __commonJS({
2471
2471
  var require_which = __commonJS({
2472
2472
  "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports$1, module) {
2473
2473
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
2474
- var path19 = __require("path");
2474
+ var path21 = __require("path");
2475
2475
  var COLON = isWindows ? ";" : ":";
2476
2476
  var isexe = require_isexe();
2477
2477
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -2509,7 +2509,7 @@ var require_which = __commonJS({
2509
2509
  return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
2510
2510
  const ppRaw = pathEnv[i2];
2511
2511
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
2512
- const pCmd = path19.join(pathPart, cmd);
2512
+ const pCmd = path21.join(pathPart, cmd);
2513
2513
  const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
2514
2514
  resolve(subStep(p2, i2, 0));
2515
2515
  });
@@ -2536,7 +2536,7 @@ var require_which = __commonJS({
2536
2536
  for (let i2 = 0; i2 < pathEnv.length; i2++) {
2537
2537
  const ppRaw = pathEnv[i2];
2538
2538
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
2539
- const pCmd = path19.join(pathPart, cmd);
2539
+ const pCmd = path21.join(pathPart, cmd);
2540
2540
  const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
2541
2541
  for (let j3 = 0; j3 < pathExt.length; j3++) {
2542
2542
  const cur = p2 + pathExt[j3];
@@ -2582,7 +2582,7 @@ var require_path_key = __commonJS({
2582
2582
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
2583
2583
  var require_resolveCommand = __commonJS({
2584
2584
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports$1, module) {
2585
- var path19 = __require("path");
2585
+ var path21 = __require("path");
2586
2586
  var which = require_which();
2587
2587
  var getPathKey = require_path_key();
2588
2588
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -2600,7 +2600,7 @@ var require_resolveCommand = __commonJS({
2600
2600
  try {
2601
2601
  resolved = which.sync(parsed.command, {
2602
2602
  path: env2[getPathKey({ env: env2 })],
2603
- pathExt: withoutPathExt ? path19.delimiter : void 0
2603
+ pathExt: withoutPathExt ? path21.delimiter : void 0
2604
2604
  });
2605
2605
  } catch (e) {
2606
2606
  } finally {
@@ -2609,7 +2609,7 @@ var require_resolveCommand = __commonJS({
2609
2609
  }
2610
2610
  }
2611
2611
  if (resolved) {
2612
- resolved = path19.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
2612
+ resolved = path21.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
2613
2613
  }
2614
2614
  return resolved;
2615
2615
  }
@@ -2660,8 +2660,8 @@ var require_shebang_command = __commonJS({
2660
2660
  if (!match) {
2661
2661
  return null;
2662
2662
  }
2663
- const [path19, argument] = match[0].replace(/#! ?/, "").split(" ");
2664
- const binary = path19.split("/").pop();
2663
+ const [path21, argument] = match[0].replace(/#! ?/, "").split(" ");
2664
+ const binary = path21.split("/").pop();
2665
2665
  if (binary === "env") {
2666
2666
  return argument;
2667
2667
  }
@@ -2673,16 +2673,16 @@ var require_shebang_command = __commonJS({
2673
2673
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
2674
2674
  var require_readShebang = __commonJS({
2675
2675
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports$1, module) {
2676
- var fs15 = __require("fs");
2676
+ var fs16 = __require("fs");
2677
2677
  var shebangCommand = require_shebang_command();
2678
2678
  function readShebang(command) {
2679
2679
  const size = 150;
2680
2680
  const buffer = Buffer.alloc(size);
2681
2681
  let fd;
2682
2682
  try {
2683
- fd = fs15.openSync(command, "r");
2684
- fs15.readSync(fd, buffer, 0, size, 0);
2685
- fs15.closeSync(fd);
2683
+ fd = fs16.openSync(command, "r");
2684
+ fs16.readSync(fd, buffer, 0, size, 0);
2685
+ fs16.closeSync(fd);
2686
2686
  } catch (e) {
2687
2687
  }
2688
2688
  return shebangCommand(buffer.toString());
@@ -2694,7 +2694,7 @@ var require_readShebang = __commonJS({
2694
2694
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
2695
2695
  var require_parse2 = __commonJS({
2696
2696
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports$1, module) {
2697
- var path19 = __require("path");
2697
+ var path21 = __require("path");
2698
2698
  var resolveCommand = require_resolveCommand();
2699
2699
  var escape2 = require_escape();
2700
2700
  var readShebang = require_readShebang();
@@ -2719,7 +2719,7 @@ var require_parse2 = __commonJS({
2719
2719
  const needsShell = !isExecutableRegExp.test(commandFile);
2720
2720
  if (parsed.options.forceShell || needsShell) {
2721
2721
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
2722
- parsed.command = path19.normalize(parsed.command);
2722
+ parsed.command = path21.normalize(parsed.command);
2723
2723
  parsed.command = escape2.command(parsed.command);
2724
2724
  parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
2725
2725
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -12905,12 +12905,12 @@ function createModulerModifier() {
12905
12905
  return frames;
12906
12906
  };
12907
12907
  }
12908
- function createGetModuleFromFilename(basePath = process.argv[1] ? path17.dirname(process.argv[1]) : process.cwd(), isWindows = "\\" === path17.sep) {
12908
+ function createGetModuleFromFilename(basePath = process.argv[1] ? path14.dirname(process.argv[1]) : process.cwd(), isWindows = "\\" === path14.sep) {
12909
12909
  const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
12910
12910
  return (filename) => {
12911
12911
  if (!filename) return;
12912
12912
  const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
12913
- let { dir, base: file, ext } = path17.posix.parse(normalizedFilename);
12913
+ let { dir, base: file, ext } = path14.posix.parse(normalizedFilename);
12914
12914
  if (".js" === ext || ".mjs" === ext || ".cjs" === ext) file = file.slice(0, -1 * ext.length);
12915
12915
  const decodedFile = decodeURIComponent(file);
12916
12916
  if (!dir) dir = ".";
@@ -13997,7 +13997,7 @@ var Temp = {
13997
13997
  }
13998
13998
  },
13999
13999
  truncate: (filePath) => {
14000
- const basename = path17__default.default.basename(filePath);
14000
+ const basename = path14__default.default.basename(filePath);
14001
14001
  if (basename.length <= LIMIT_BASENAME_LENGTH)
14002
14002
  return filePath;
14003
14003
  const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename);
@@ -14042,7 +14042,7 @@ function capture(event, properties) {
14042
14042
  }
14043
14043
 
14044
14044
  // src/create-nextly.ts
14045
- var import_fs_extra12 = __toESM(require_lib());
14045
+ var import_fs_extra13 = __toESM(require_lib());
14046
14046
  var import_picocolors3 = __toESM(require_picocolors2());
14047
14047
 
14048
14048
  // src/generators/admin.ts
@@ -14050,9 +14050,6 @@ var import_fs_extra = __toESM(require_lib());
14050
14050
  var ADMIN_PAGE_TEMPLATE = `"use client";
14051
14051
 
14052
14052
  import "@nextlyhq/admin/style.css";
14053
- import "@nextlyhq/plugin-form-builder/admin";
14054
- import "@nextlyhq/plugin-form-builder/styles/builder.css";
14055
- import "@nextlyhq/plugin-form-builder/styles/submissions-filter.css";
14056
14053
  import { RootLayout, QueryProvider, ErrorBoundary } from "@nextlyhq/admin";
14057
14054
 
14058
14055
  export default function AdminPage() {
@@ -14094,9 +14091,9 @@ export default function AdminLayout({
14094
14091
  `;
14095
14092
  }
14096
14093
  async function generateAdminPage(cwd, projectInfo) {
14097
- const adminDir = path17__default.default.join(cwd, projectInfo.appDir, "admin", "[[...params]]");
14098
- const pagePath = path17__default.default.join(adminDir, "page.tsx");
14099
- const layoutPath = path17__default.default.join(adminDir, "layout.tsx");
14094
+ const adminDir = path14__default.default.join(cwd, projectInfo.appDir, "admin", "[[...params]]");
14095
+ const pagePath = path14__default.default.join(adminDir, "page.tsx");
14096
+ const layoutPath = path14__default.default.join(adminDir, "layout.tsx");
14100
14097
  if (await import_fs_extra.default.pathExists(pagePath)) {
14101
14098
  throw new Error(
14102
14099
  "Admin page already exists at admin/[[...params]]/page.tsx"
@@ -14149,7 +14146,7 @@ ${singlesLine}
14149
14146
  return template;
14150
14147
  }
14151
14148
  async function generateConfig(cwd, projectType) {
14152
- const configPath = path17__default.default.join(cwd, "nextly.config.ts");
14149
+ const configPath = path14__default.default.join(cwd, "nextly.config.ts");
14153
14150
  if (await import_fs_extra2.default.pathExists(configPath)) {
14154
14151
  throw new Error(
14155
14152
  "nextly.config.ts already exists. Please remove it first or run in a fresh project."
@@ -14180,8 +14177,8 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000
14180
14177
  `;
14181
14178
  }
14182
14179
  async function generateEnv(cwd, database) {
14183
- const envPath = path17__default.default.join(cwd, ".env");
14184
- const envExamplePath = path17__default.default.join(cwd, ".env.example");
14180
+ const envPath = path14__default.default.join(cwd, ".env");
14181
+ const envExamplePath = path14__default.default.join(cwd, ".env.example");
14185
14182
  const envContent = getEnvTemplate(database);
14186
14183
  await import_fs_extra3.default.writeFile(envExamplePath, envContent, "utf-8");
14187
14184
  if (await import_fs_extra3.default.pathExists(envPath)) {
@@ -14245,25 +14242,25 @@ var HEALTH_ROUTE_TEMPLATE = `/**
14245
14242
  export { GET, HEAD } from "nextly/api/health";
14246
14243
  `;
14247
14244
  async function generateMediaRoutes(cwd, projectInfo) {
14248
- const apiDir = path17__default.default.join(cwd, projectInfo.appDir, "api");
14249
- const mediaDir = path17__default.default.join(apiDir, "media");
14245
+ const apiDir = path14__default.default.join(cwd, projectInfo.appDir, "api");
14246
+ const mediaDir = path14__default.default.join(apiDir, "media");
14250
14247
  if (await import_fs_extra4.default.pathExists(mediaDir)) {
14251
14248
  throw new Error(
14252
14249
  "Media API routes already exist at api/media. Please remove them first."
14253
14250
  );
14254
14251
  }
14255
- const mediaRoutePath = path17__default.default.join(apiDir, "media", "[[...path]]", "route.ts");
14252
+ const mediaRoutePath = path14__default.default.join(apiDir, "media", "[[...path]]", "route.ts");
14256
14253
  const configImportPath = getConfigImportPath(
14257
14254
  projectInfo.appDir.startsWith("src")
14258
14255
  );
14259
- await import_fs_extra4.default.ensureDir(path17__default.default.dirname(mediaRoutePath));
14256
+ await import_fs_extra4.default.ensureDir(path14__default.default.dirname(mediaRoutePath));
14260
14257
  await import_fs_extra4.default.writeFile(
14261
14258
  mediaRoutePath,
14262
14259
  MEDIA_CATCH_ALL_TEMPLATE(configImportPath),
14263
14260
  "utf-8"
14264
14261
  );
14265
- const healthRoutePath = path17__default.default.join(apiDir, "health", "route.ts");
14266
- await import_fs_extra4.default.ensureDir(path17__default.default.dirname(healthRoutePath));
14262
+ const healthRoutePath = path14__default.default.join(apiDir, "health", "route.ts");
14263
+ await import_fs_extra4.default.ensureDir(path14__default.default.dirname(healthRoutePath));
14267
14264
  await import_fs_extra4.default.writeFile(healthRoutePath, HEALTH_ROUTE_TEMPLATE, "utf-8");
14268
14265
  }
14269
14266
 
@@ -14288,7 +14285,7 @@ async function patchNextConfig(cwd) {
14288
14285
  const candidates = ["next.config.ts", "next.config.mjs", "next.config.js"];
14289
14286
  let configPath = null;
14290
14287
  for (const name of candidates) {
14291
- const full = path17__default.default.join(cwd, name);
14288
+ const full = path14__default.default.join(cwd, name);
14292
14289
  if (await import_fs_extra5.default.pathExists(full)) {
14293
14290
  configPath = full;
14294
14291
  break;
@@ -14341,7 +14338,7 @@ export const DELETE = handlers.DELETE;
14341
14338
  export const OPTIONS = handlers.OPTIONS;
14342
14339
  `;
14343
14340
  async function generateRoutes(cwd, projectInfo) {
14344
- const routePath = path17__default.default.join(
14341
+ const routePath = path14__default.default.join(
14345
14342
  cwd,
14346
14343
  projectInfo.appDir,
14347
14344
  "admin",
@@ -14354,7 +14351,7 @@ async function generateRoutes(cwd, projectInfo) {
14354
14351
  "API route already exists at admin/api/[[...params]]/route.ts"
14355
14352
  );
14356
14353
  }
14357
- await import_fs_extra6.default.ensureDir(path17__default.default.dirname(routePath));
14354
+ await import_fs_extra6.default.ensureDir(path14__default.default.dirname(routePath));
14358
14355
  await import_fs_extra6.default.writeFile(routePath, API_ROUTE_TEMPLATE, "utf-8");
14359
14356
  }
14360
14357
 
@@ -14362,13 +14359,13 @@ async function generateRoutes(cwd, projectInfo) {
14362
14359
  var import_fs_extra7 = __toESM(require_lib());
14363
14360
  async function generateTypesDirectory(cwd, projectInfo) {
14364
14361
  const baseDir = projectInfo.srcDir ? "src" : ".";
14365
- const typesDir = path17__default.default.join(cwd, baseDir, "types", "generated");
14362
+ const typesDir = path14__default.default.join(cwd, baseDir, "types", "generated");
14366
14363
  await import_fs_extra7.default.ensureDir(typesDir);
14367
- const gitkeepPath = path17__default.default.join(typesDir, ".gitkeep");
14364
+ const gitkeepPath = path14__default.default.join(typesDir, ".gitkeep");
14368
14365
  if (!await import_fs_extra7.default.pathExists(gitkeepPath)) {
14369
14366
  await import_fs_extra7.default.writeFile(gitkeepPath, "", "utf-8");
14370
14367
  }
14371
- const placeholderPath = path17__default.default.join(typesDir, "nextly-types.ts");
14368
+ const placeholderPath = path14__default.default.join(typesDir, "nextly-types.ts");
14372
14369
  if (!await import_fs_extra7.default.pathExists(placeholderPath)) {
14373
14370
  const placeholderContent = `/**
14374
14371
  * Nextly Generated Types
@@ -15179,12 +15176,12 @@ function toPath(urlOrPath) {
15179
15176
  function traversePathUp(startPath) {
15180
15177
  return {
15181
15178
  *[Symbol.iterator]() {
15182
- let currentPath = path17__default.default.resolve(toPath(startPath));
15179
+ let currentPath = path14__default.default.resolve(toPath(startPath));
15183
15180
  let previousPath;
15184
15181
  while (previousPath !== currentPath) {
15185
15182
  yield currentPath;
15186
15183
  previousPath = currentPath;
15187
- currentPath = path17__default.default.resolve(currentPath, "..");
15184
+ currentPath = path14__default.default.resolve(currentPath, "..");
15188
15185
  }
15189
15186
  }
15190
15187
  };
@@ -15198,27 +15195,27 @@ var npmRunPath = ({
15198
15195
  execPath: execPath2 = process4__default.default.execPath,
15199
15196
  addExecPath = true
15200
15197
  } = {}) => {
15201
- const cwdPath = path17__default.default.resolve(toPath(cwd));
15198
+ const cwdPath = path14__default.default.resolve(toPath(cwd));
15202
15199
  const result = [];
15203
- const pathParts = pathOption.split(path17__default.default.delimiter);
15200
+ const pathParts = pathOption.split(path14__default.default.delimiter);
15204
15201
  if (preferLocal) {
15205
15202
  applyPreferLocal(result, pathParts, cwdPath);
15206
15203
  }
15207
15204
  if (addExecPath) {
15208
15205
  applyExecPath(result, pathParts, execPath2, cwdPath);
15209
15206
  }
15210
- return pathOption === "" || pathOption === path17__default.default.delimiter ? `${result.join(path17__default.default.delimiter)}${pathOption}` : [...result, pathOption].join(path17__default.default.delimiter);
15207
+ return pathOption === "" || pathOption === path14__default.default.delimiter ? `${result.join(path14__default.default.delimiter)}${pathOption}` : [...result, pathOption].join(path14__default.default.delimiter);
15211
15208
  };
15212
15209
  var applyPreferLocal = (result, pathParts, cwdPath) => {
15213
15210
  for (const directory of traversePathUp(cwdPath)) {
15214
- const pathPart = path17__default.default.join(directory, "node_modules/.bin");
15211
+ const pathPart = path14__default.default.join(directory, "node_modules/.bin");
15215
15212
  if (!pathParts.includes(pathPart)) {
15216
15213
  result.push(pathPart);
15217
15214
  }
15218
15215
  }
15219
15216
  };
15220
15217
  var applyExecPath = (result, pathParts, execPath2, cwdPath) => {
15221
- const pathPart = path17__default.default.resolve(cwdPath, toPath(execPath2), "..");
15218
+ const pathPart = path14__default.default.resolve(cwdPath, toPath(execPath2), "..");
15222
15219
  if (!pathParts.includes(pathPart)) {
15223
15220
  result.push(pathPart);
15224
15221
  }
@@ -16351,7 +16348,7 @@ var handleNodeOption = (file, commandArguments, {
16351
16348
  throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
16352
16349
  }
16353
16350
  const normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The "nodePath" option');
16354
- const resolvedNodePath = path17__default.default.resolve(cwd, normalizedNodePath);
16351
+ const resolvedNodePath = path14__default.default.resolve(cwd, normalizedNodePath);
16355
16352
  const newOptions = {
16356
16353
  ...options,
16357
16354
  nodePath: resolvedNodePath,
@@ -16361,7 +16358,7 @@ var handleNodeOption = (file, commandArguments, {
16361
16358
  if (!shouldHandleNode) {
16362
16359
  return [file, commandArguments, newOptions];
16363
16360
  }
16364
- if (path17__default.default.basename(file, ".exe") === "node") {
16361
+ if (path14__default.default.basename(file, ".exe") === "node") {
16365
16362
  throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
16366
16363
  }
16367
16364
  return [
@@ -16447,7 +16444,7 @@ var ENCODING_ALIASES = {
16447
16444
  var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding);
16448
16445
  var normalizeCwd = (cwd = getDefaultCwd()) => {
16449
16446
  const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
16450
- return path17__default.default.resolve(cwdString);
16447
+ return path14__default.default.resolve(cwdString);
16451
16448
  };
16452
16449
  var getDefaultCwd = () => {
16453
16450
  try {
@@ -16494,7 +16491,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
16494
16491
  options.killSignal = normalizeKillSignal(options.killSignal);
16495
16492
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
16496
16493
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
16497
- if (process4__default.default.platform === "win32" && path17__default.default.basename(file, ".exe") === "cmd") {
16494
+ if (process4__default.default.platform === "win32" && path14__default.default.basename(file, ".exe") === "cmd") {
16498
16495
  commandArguments.unshift("/q");
16499
16496
  }
16500
16497
  return { file, commandArguments, options };
@@ -18601,13 +18598,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state: state2, verboseInfo, e
18601
18598
  }
18602
18599
  };
18603
18600
  var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
18604
- for (const { path: path19, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
18605
- const pathString = typeof path19 === "string" ? path19 : path19.toString();
18601
+ for (const { path: path21, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
18602
+ const pathString = typeof path21 === "string" ? path21 : path21.toString();
18606
18603
  if (append || outputFiles.has(pathString)) {
18607
- u2.appendFileSync(path19, serializedResult);
18604
+ u2.appendFileSync(path21, serializedResult);
18608
18605
  } else {
18609
18606
  outputFiles.add(pathString);
18610
- u2.writeFileSync(path19, serializedResult);
18607
+ u2.writeFileSync(path21, serializedResult);
18611
18608
  }
18612
18609
  }
18613
18610
  };
@@ -20903,102 +20900,415 @@ createExeca(mapNode);
20903
20900
  createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
20904
20901
  getIpcExport();
20905
20902
 
20906
- // src/installers/dependencies.ts
20907
- var INSTALL_COMMANDS = {
20908
- npm: ["npm", "install"],
20909
- yarn: ["yarn", "add"],
20910
- pnpm: ["pnpm", "add"],
20911
- bun: ["bun", "add"]
20903
+ // src/utils/template.ts
20904
+ var import_fs_extra8 = __toESM(require_lib());
20905
+ var PROJECT_TYPES_WITH_FORM_BUILDER = /* @__PURE__ */ new Set([
20906
+ "blog"
20907
+ ]);
20908
+ function projectUsesFormBuilder(projectType) {
20909
+ return PROJECT_TYPES_WITH_FORM_BUILDER.has(projectType);
20910
+ }
20911
+ var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
20912
+ ".ts",
20913
+ ".tsx",
20914
+ ".js",
20915
+ ".jsx",
20916
+ ".json",
20917
+ ".env",
20918
+ ".md",
20919
+ ".css",
20920
+ ".html",
20921
+ ".mjs",
20922
+ ".cjs"
20923
+ ]);
20924
+ var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
20925
+ function resolveTemplatePath(localTemplatePath) {
20926
+ const __dirname = path14__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
20927
+ const fromDist = path14__default.default.resolve(__dirname, "../templates");
20928
+ if (import_fs_extra8.default.existsSync(fromDist)) {
20929
+ return fromDist;
20930
+ }
20931
+ const fromSrc = path14__default.default.resolve(__dirname, "../../templates");
20932
+ if (import_fs_extra8.default.existsSync(fromSrc)) {
20933
+ return fromSrc;
20934
+ }
20935
+ throw new Error(
20936
+ "Could not find templates directory. Use --local-template to specify the templates path, or ensure templates are bundled."
20937
+ );
20938
+ }
20939
+ function buildPlaceholderMap(options) {
20940
+ const { database, databaseUrl } = options;
20941
+ return {
20942
+ "{{databaseDialect}}": database.type,
20943
+ "{{databaseUrl}}": databaseUrl || database.envExample
20944
+ };
20945
+ }
20946
+ async function replacePlaceholdersInFile(filePath, placeholders) {
20947
+ const ext = path14__default.default.extname(filePath).toLowerCase();
20948
+ const basename = path14__default.default.basename(filePath);
20949
+ const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
20950
+ if (!isTextFile) return;
20951
+ let content = await import_fs_extra8.default.readFile(filePath, "utf-8");
20952
+ let changed = false;
20953
+ for (const [placeholder, value] of Object.entries(placeholders)) {
20954
+ if (content.includes(placeholder)) {
20955
+ content = content.replaceAll(placeholder, value);
20956
+ changed = true;
20957
+ }
20958
+ }
20959
+ if (changed) {
20960
+ await import_fs_extra8.default.writeFile(filePath, content, "utf-8");
20961
+ }
20962
+ }
20963
+ async function replacePlaceholders(dir, placeholders) {
20964
+ const entries = await import_fs_extra8.default.readdir(dir, { withFileTypes: true });
20965
+ for (const entry of entries) {
20966
+ const fullPath = path14__default.default.join(dir, entry.name);
20967
+ if (entry.isDirectory()) {
20968
+ if (entry.name === "node_modules" || entry.name === ".git") continue;
20969
+ await replacePlaceholders(fullPath, placeholders);
20970
+ } else if (entry.isFile()) {
20971
+ await replacePlaceholdersInFile(fullPath, placeholders);
20972
+ }
20973
+ }
20974
+ }
20975
+ var PINNED_VERSIONS = {
20976
+ // Next.js ecosystem — resolved at runtime via fetchLatestVersion()
20977
+ // (see generatePackageJson)
20978
+ react: "^19.1.0",
20979
+ "react-dom": "^19.1.0",
20980
+ // Dev dependencies
20981
+ typescript: "^5",
20982
+ "@types/node": "^20",
20983
+ "@types/react": "^19",
20984
+ "@types/react-dom": "^19",
20985
+ "@tailwindcss/postcss": "^4",
20986
+ tailwindcss: "^4",
20987
+ eslint: "^9"
20912
20988
  };
20913
- var CORE_PACKAGES = [
20989
+ var RUNTIME_RESOLVED_PACKAGES = ["next", "eslint-config-next"];
20990
+ var NEXTLY_PACKAGES = [
20914
20991
  "nextly",
20915
20992
  "@nextlyhq/admin",
20916
20993
  "@nextlyhq/adapter-drizzle",
20917
- "@nextlyhq/ui",
20918
- "@tanstack/react-query"
20919
- ];
20920
- var ALL_ADAPTER_PACKAGES = [
20921
20994
  "@nextlyhq/adapter-postgres",
20922
20995
  "@nextlyhq/adapter-mysql",
20923
20996
  "@nextlyhq/adapter-sqlite"
20924
20997
  ];
20925
- var TEMPLATE_PLUGIN_PACKAGES = [
20926
- "@nextlyhq/plugin-form-builder"
20927
- ];
20928
- function getPackagesToInstall(database) {
20929
- return [...CORE_PACKAGES, database.adapter];
20998
+ var resolvedNextlyVersions = null;
20999
+ async function fetchLatestVersion(pkg) {
21000
+ try {
21001
+ const res = await fetch(
21002
+ `https://registry.npmjs.org/-/package/${encodeURIComponent(pkg)}/dist-tags`,
21003
+ { signal: AbortSignal.timeout(5e3) }
21004
+ );
21005
+ if (!res.ok) return "latest";
21006
+ const data = await res.json();
21007
+ return data.latest ? `^${data.latest}` : "latest";
21008
+ } catch {
21009
+ return "latest";
21010
+ }
20930
21011
  }
20931
- async function installDependencies(cwd, projectInfo, database, useYalc = false, isFreshProject = false) {
20932
- const pm = projectInfo.packageManager;
20933
- if (isFreshProject) {
20934
- if (useYalc) {
20935
- const yalcPackages = [
20936
- .../* @__PURE__ */ new Set([
20937
- "nextly",
20938
- "@nextlyhq/admin",
20939
- "@nextlyhq/ui",
20940
- "@nextlyhq/adapter-drizzle",
20941
- ...ALL_ADAPTER_PACKAGES,
20942
- ...TEMPLATE_PLUGIN_PACKAGES
20943
- ])
20944
- ];
20945
- await execa(pm, ["install"], { cwd });
20946
- for (const pkg of yalcPackages) {
20947
- await execa("yalc", ["add", pkg], { cwd });
20948
- }
20949
- await execa(pm, ["install"], { cwd });
20950
- } else {
20951
- await execa(pm, ["install"], { cwd });
20952
- }
20953
- } else {
20954
- const allPackages = getPackagesToInstall(database);
20955
- if (useYalc) {
20956
- const yalcPackages = [
20957
- .../* @__PURE__ */ new Set([
20958
- "nextly",
20959
- "@nextlyhq/admin",
20960
- "@nextlyhq/ui",
20961
- "@nextlyhq/adapter-drizzle",
20962
- ...ALL_ADAPTER_PACKAGES,
20963
- ...TEMPLATE_PLUGIN_PACKAGES
20964
- ])
20965
- ];
20966
- for (const pkg of yalcPackages) {
20967
- await execa("yalc", ["add", pkg], { cwd });
20968
- }
20969
- await execa(pm, ["install"], { cwd });
20970
- } else {
20971
- const [cmd, ...args] = INSTALL_COMMANDS[pm];
20972
- await execa(cmd, [...args, ...allPackages], { cwd });
21012
+ async function resolveNextlyVersions() {
21013
+ if (resolvedNextlyVersions) return resolvedNextlyVersions;
21014
+ const entries = await Promise.all(
21015
+ NEXTLY_PACKAGES.map(
21016
+ async (pkg) => [pkg, await fetchLatestVersion(pkg)]
21017
+ )
21018
+ );
21019
+ resolvedNextlyVersions = Object.fromEntries(entries);
21020
+ return resolvedNextlyVersions;
21021
+ }
21022
+ var resolvedRuntimeVersions = null;
21023
+ async function resolveRuntimeVersions() {
21024
+ if (resolvedRuntimeVersions) return resolvedRuntimeVersions;
21025
+ const FALLBACKS = {
21026
+ next: "^16.1.0",
21027
+ "eslint-config-next": "^16.1.0"
21028
+ };
21029
+ const entries = await Promise.all(
21030
+ RUNTIME_RESOLVED_PACKAGES.map(async (pkg) => {
21031
+ const version = await fetchLatestVersion(pkg);
21032
+ return [pkg, version === "latest" ? FALLBACKS[pkg] : version];
21033
+ })
21034
+ );
21035
+ resolvedRuntimeVersions = Object.fromEntries(entries);
21036
+ return resolvedRuntimeVersions;
21037
+ }
21038
+ async function generatePackageJson(projectName, database, useYalc = false, projectType = "blank") {
21039
+ const runtimeVersions = await resolveRuntimeVersions();
21040
+ const dependencies = {
21041
+ next: runtimeVersions.next,
21042
+ react: PINNED_VERSIONS.react,
21043
+ "react-dom": PINNED_VERSIONS["react-dom"]
21044
+ };
21045
+ dependencies["@tanstack/react-query"] = "^5.62.0";
21046
+ if (!useYalc) {
21047
+ const versions = await resolveNextlyVersions();
21048
+ dependencies["nextly"] = versions["nextly"];
21049
+ dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
21050
+ dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";
21051
+ dependencies["@nextlyhq/adapter-drizzle"] = versions["@nextlyhq/adapter-drizzle"];
21052
+ dependencies[database.adapter] = versions[database.adapter] || "latest";
21053
+ if (projectUsesFormBuilder(projectType)) {
21054
+ dependencies["@nextlyhq/plugin-form-builder"] = versions["@nextlyhq/plugin-form-builder"] || "latest";
20973
21055
  }
20974
21056
  }
21057
+ const devDependencies = {
21058
+ typescript: PINNED_VERSIONS.typescript,
21059
+ "@types/node": PINNED_VERSIONS["@types/node"],
21060
+ "@types/react": PINNED_VERSIONS["@types/react"],
21061
+ "@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
21062
+ "@tailwindcss/postcss": PINNED_VERSIONS["@tailwindcss/postcss"],
21063
+ tailwindcss: PINNED_VERSIONS.tailwindcss,
21064
+ eslint: PINNED_VERSIONS.eslint,
21065
+ "eslint-config-next": runtimeVersions["eslint-config-next"],
21066
+ // Pagefind powers /search in the blog template. Zero-config
21067
+ // static index generated at `next build` time. Templates that
21068
+ // don't ship a /search page simply won't invoke it.
21069
+ pagefind: "^1.1.0"
21070
+ };
21071
+ const pkg = {
21072
+ name: projectName,
21073
+ version: "0.1.0",
21074
+ private: true,
21075
+ scripts: {
21076
+ // F1 PR 4: dev now boots Nextly in single-process mode via `next dev`.
21077
+ // The lazy drizzle-kit/api import (PR 1) plus the in-process HMR
21078
+ // listener (PR 2) replaced the wrapper that previously owned the
21079
+ // terminal, schema prompts, and child supervision. `nextly dev` is
21080
+ // gone; the only supported dev command is the standard `next dev`.
21081
+ dev: "next dev --turbopack",
21082
+ // Build: migrate DB + compile Next.js + (if present) generate
21083
+ // the Pagefind search index. Templates without the search
21084
+ // script silently skip the last step.
21085
+ build: "nextly migrate && next build && (test -f scripts/build-search-index.mjs && node scripts/build-search-index.mjs || true)",
21086
+ "search:index": "node scripts/build-search-index.mjs",
21087
+ start: "next start",
21088
+ lint: "next lint",
21089
+ nextly: "nextly",
21090
+ // First-time setup: sync schema + seed system permissions. Demo
21091
+ // content is seeded separately from the admin UI (visit /welcome
21092
+ // after running `pnpm dev` and completing /admin/setup).
21093
+ "db:setup": "nextly db:sync",
21094
+ "db:migrate": "nextly migrate",
21095
+ "db:migrate:status": "nextly migrate:status",
21096
+ "db:migrate:fresh": "nextly migrate:fresh",
21097
+ "db:migrate:reset": "nextly migrate:reset",
21098
+ "types:generate": "nextly generate:types"
21099
+ },
21100
+ dependencies,
21101
+ devDependencies
21102
+ };
21103
+ return JSON.stringify(pkg, null, 2) + "\n";
20975
21104
  }
20976
-
20977
- // src/lib/download-template.ts
20978
- var import_fs_extra8 = __toESM(require_lib());
20979
- var kr = Object.defineProperty;
20980
- var vr = (s3, t2) => {
20981
- for (var e in t2) kr(s3, e, { get: t2[e], enumerable: true });
20982
- };
20983
- var Os = typeof process == "object" && process ? process : { stdout: null, stderr: null };
20984
- var Br = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof D3 || s3 instanceof Ns__default.default || Pr(s3) || zr(s3));
20985
- var Pr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.pipe == "function" && s3.pipe !== Ns__default.default.Writable.prototype.pipe;
20986
- var zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
20987
- var q3 = Symbol("EOF");
20988
- var j2 = Symbol("maybeEmitEnd");
20989
- var rt2 = Symbol("emittedEnd");
20990
- var Le2 = Symbol("emittingEnd");
20991
- var jt2 = Symbol("emittedError");
20992
- var Ne2 = Symbol("closed");
20993
- var Ts = Symbol("read");
20994
- var Ae2 = Symbol("flush");
20995
- var xs = Symbol("flushChunk");
20996
- var z3 = Symbol("encoding");
20997
- var Mt2 = Symbol("decoder");
20998
- var b = Symbol("flowing");
20999
- var Qt = Symbol("paused");
21000
- var Bt2 = Symbol("resume");
21001
- var _2 = Symbol("buffer");
21105
+ async function copyTemplate(options) {
21106
+ const {
21107
+ projectName,
21108
+ projectType,
21109
+ targetDir,
21110
+ database,
21111
+ databaseUrl,
21112
+ useYalc = false,
21113
+ approach,
21114
+ templateSource,
21115
+ allowExistingTarget = false
21116
+ } = options;
21117
+ if (!allowExistingTarget && targetDir !== process.cwd() && await import_fs_extra8.default.pathExists(targetDir)) {
21118
+ throw new Error(
21119
+ `Directory "${path14__default.default.basename(targetDir)}" already exists. Please choose a different name.`
21120
+ );
21121
+ }
21122
+ let baseDir;
21123
+ let typeDir;
21124
+ if (templateSource) {
21125
+ baseDir = templateSource.basePath;
21126
+ typeDir = templateSource.templatePath;
21127
+ } else {
21128
+ const templatesRoot = resolveTemplatePath();
21129
+ baseDir = path14__default.default.join(templatesRoot, "base");
21130
+ typeDir = path14__default.default.join(templatesRoot, projectType);
21131
+ }
21132
+ if (!await import_fs_extra8.default.pathExists(baseDir)) {
21133
+ throw new Error(
21134
+ `Base template not found at ${baseDir}. The package may be corrupted or the download failed.`
21135
+ );
21136
+ }
21137
+ if (!await import_fs_extra8.default.pathExists(typeDir)) {
21138
+ throw new Error(
21139
+ `Template "${projectType}" not found at ${typeDir}. Available templates: blank, blog.`
21140
+ );
21141
+ }
21142
+ await import_fs_extra8.default.copy(baseDir, targetDir, {
21143
+ filter: (_src) => {
21144
+ const basename = path14__default.default.basename(_src);
21145
+ return !SKIP_FILES.has(basename);
21146
+ }
21147
+ });
21148
+ const templateSrcDir = path14__default.default.join(typeDir, "src");
21149
+ if (await import_fs_extra8.default.pathExists(templateSrcDir)) {
21150
+ await import_fs_extra8.default.copy(templateSrcDir, path14__default.default.join(targetDir, "src"), {
21151
+ overwrite: true,
21152
+ filter: (_src) => {
21153
+ const basename = path14__default.default.basename(_src);
21154
+ return !SKIP_FILES.has(basename);
21155
+ }
21156
+ });
21157
+ }
21158
+ const templateRootConfig = path14__default.default.join(typeDir, "nextly.config.ts");
21159
+ if (await import_fs_extra8.default.pathExists(templateRootConfig)) {
21160
+ await import_fs_extra8.default.copy(
21161
+ templateRootConfig,
21162
+ path14__default.default.join(targetDir, "nextly.config.ts"),
21163
+ { overwrite: true }
21164
+ );
21165
+ }
21166
+ const configsDir = path14__default.default.join(typeDir, "configs");
21167
+ if (approach && await import_fs_extra8.default.pathExists(configsDir)) {
21168
+ const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
21169
+ const configSrc = path14__default.default.join(configsDir, configFileName);
21170
+ if (await import_fs_extra8.default.pathExists(configSrc)) {
21171
+ await import_fs_extra8.default.copy(configSrc, path14__default.default.join(targetDir, "nextly.config.ts"), {
21172
+ overwrite: true
21173
+ });
21174
+ }
21175
+ const sharedSrc = path14__default.default.join(configsDir, "shared.ts");
21176
+ if (await import_fs_extra8.default.pathExists(sharedSrc)) {
21177
+ await import_fs_extra8.default.copy(sharedSrc, path14__default.default.join(targetDir, "shared.ts"), {
21178
+ overwrite: true
21179
+ });
21180
+ }
21181
+ }
21182
+ const frontendPagePath = path14__default.default.join(
21183
+ targetDir,
21184
+ "src",
21185
+ "app",
21186
+ "(frontend)",
21187
+ "page.tsx"
21188
+ );
21189
+ const basePagePath = path14__default.default.join(targetDir, "src", "app", "page.tsx");
21190
+ if (await import_fs_extra8.default.pathExists(frontendPagePath) && await import_fs_extra8.default.pathExists(basePagePath)) {
21191
+ await import_fs_extra8.default.remove(basePagePath);
21192
+ }
21193
+ const packageJsonContent = await generatePackageJson(
21194
+ projectName,
21195
+ database,
21196
+ useYalc,
21197
+ projectType
21198
+ );
21199
+ await import_fs_extra8.default.writeFile(
21200
+ path14__default.default.join(targetDir, "package.json"),
21201
+ packageJsonContent,
21202
+ "utf-8"
21203
+ );
21204
+ if (database.type === "sqlite") {
21205
+ await import_fs_extra8.default.ensureDir(path14__default.default.join(targetDir, "data"));
21206
+ }
21207
+ const placeholders = buildPlaceholderMap({ database, databaseUrl });
21208
+ if (approach) {
21209
+ placeholders["{{approach}}"] = approach;
21210
+ }
21211
+ await replacePlaceholders(targetDir, placeholders);
21212
+ }
21213
+
21214
+ // src/installers/dependencies.ts
21215
+ var INSTALL_COMMANDS = {
21216
+ npm: ["npm", "install"],
21217
+ yarn: ["yarn", "add"],
21218
+ pnpm: ["pnpm", "add"],
21219
+ bun: ["bun", "add"]
21220
+ };
21221
+ var CORE_PACKAGES = [
21222
+ "nextly",
21223
+ "@nextlyhq/admin",
21224
+ "@nextlyhq/adapter-drizzle",
21225
+ "@nextlyhq/ui",
21226
+ "@tanstack/react-query"
21227
+ ];
21228
+ var ALL_ADAPTER_PACKAGES = [
21229
+ "@nextlyhq/adapter-postgres",
21230
+ "@nextlyhq/adapter-mysql",
21231
+ "@nextlyhq/adapter-sqlite"
21232
+ ];
21233
+ var TEMPLATE_PLUGIN_PACKAGES = ["@nextlyhq/plugin-form-builder"];
21234
+ function templatePluginPackages(projectType) {
21235
+ return projectType && projectUsesFormBuilder(projectType) ? TEMPLATE_PLUGIN_PACKAGES : [];
21236
+ }
21237
+ function getPackagesToInstall(database) {
21238
+ return [...CORE_PACKAGES, database.adapter];
21239
+ }
21240
+ async function installDependencies(cwd, projectInfo, database, useYalc = false, isFreshProject = false, projectType) {
21241
+ const pm = projectInfo.packageManager;
21242
+ const pluginPackages = templatePluginPackages(projectType);
21243
+ if (isFreshProject) {
21244
+ if (useYalc) {
21245
+ const yalcPackages = [
21246
+ .../* @__PURE__ */ new Set([
21247
+ "nextly",
21248
+ "@nextlyhq/admin",
21249
+ "@nextlyhq/ui",
21250
+ "@nextlyhq/adapter-drizzle",
21251
+ ...ALL_ADAPTER_PACKAGES,
21252
+ ...pluginPackages
21253
+ ])
21254
+ ];
21255
+ await execa(pm, ["install"], { cwd });
21256
+ for (const pkg of yalcPackages) {
21257
+ await execa("yalc", ["add", pkg], { cwd });
21258
+ }
21259
+ await execa(pm, ["install"], { cwd });
21260
+ } else {
21261
+ await execa(pm, ["install"], { cwd });
21262
+ }
21263
+ } else {
21264
+ const allPackages = getPackagesToInstall(database);
21265
+ if (useYalc) {
21266
+ const yalcPackages = [
21267
+ .../* @__PURE__ */ new Set([
21268
+ "nextly",
21269
+ "@nextlyhq/admin",
21270
+ "@nextlyhq/ui",
21271
+ "@nextlyhq/adapter-drizzle",
21272
+ ...ALL_ADAPTER_PACKAGES,
21273
+ ...pluginPackages
21274
+ ])
21275
+ ];
21276
+ for (const pkg of yalcPackages) {
21277
+ await execa("yalc", ["add", pkg], { cwd });
21278
+ }
21279
+ await execa(pm, ["install"], { cwd });
21280
+ } else {
21281
+ const [cmd, ...args] = INSTALL_COMMANDS[pm];
21282
+ await execa(cmd, [...args, ...allPackages], { cwd });
21283
+ }
21284
+ }
21285
+ }
21286
+
21287
+ // src/lib/download-template.ts
21288
+ var import_fs_extra9 = __toESM(require_lib());
21289
+ var kr = Object.defineProperty;
21290
+ var vr = (s3, t2) => {
21291
+ for (var e in t2) kr(s3, e, { get: t2[e], enumerable: true });
21292
+ };
21293
+ var Os = typeof process == "object" && process ? process : { stdout: null, stderr: null };
21294
+ var Br = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof D3 || s3 instanceof Ns__default.default || Pr(s3) || zr(s3));
21295
+ var Pr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.pipe == "function" && s3.pipe !== Ns__default.default.Writable.prototype.pipe;
21296
+ var zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
21297
+ var q3 = Symbol("EOF");
21298
+ var j2 = Symbol("maybeEmitEnd");
21299
+ var rt2 = Symbol("emittedEnd");
21300
+ var Le2 = Symbol("emittingEnd");
21301
+ var jt2 = Symbol("emittedError");
21302
+ var Ne2 = Symbol("closed");
21303
+ var Ts = Symbol("read");
21304
+ var Ae2 = Symbol("flush");
21305
+ var xs = Symbol("flushChunk");
21306
+ var z3 = Symbol("encoding");
21307
+ var Mt2 = Symbol("decoder");
21308
+ var b = Symbol("flowing");
21309
+ var Qt = Symbol("paused");
21310
+ var Bt2 = Symbol("resume");
21311
+ var _2 = Symbol("buffer");
21002
21312
  var A = Symbol("pipes");
21003
21313
  var g = Symbol("bufferLength");
21004
21314
  var yi = Symbol("bufferPush");
@@ -21868,12 +22178,12 @@ var F = class {
21868
22178
  }
21869
22179
  };
21870
22180
  var an = (s3, t2) => {
21871
- let i2 = s3, r = "", n2, o2 = path17.posix.parse(s3).root || ".";
22181
+ let i2 = s3, r = "", n2, o2 = path14.posix.parse(s3).root || ".";
21872
22182
  if (Buffer.byteLength(i2) < 100) n2 = [i2, r, false];
21873
22183
  else {
21874
- r = path17.posix.dirname(i2), i2 = path17.posix.basename(i2);
22184
+ r = path14.posix.dirname(i2), i2 = path14.posix.basename(i2);
21875
22185
  do
21876
- 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 = path17.posix.join(path17.posix.basename(r), i2), r = path17.posix.dirname(r));
22186
+ 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 = path14.posix.join(path14.posix.basename(r), i2), r = path14.posix.dirname(r));
21877
22187
  while (r !== o2 && n2 === void 0);
21878
22188
  n2 || (n2 = [s3.slice(0, 99), "", true]);
21879
22189
  }
@@ -21919,7 +22229,7 @@ var ct2 = class s {
21919
22229
  if (t2 === "") return Buffer.allocUnsafe(0);
21920
22230
  let e = Buffer.byteLength(t2), i2 = 512 * Math.ceil(1 + e / 512), r = Buffer.allocUnsafe(i2);
21921
22231
  for (let n2 = 0; n2 < 512; n2++) r[n2] = 0;
21922
- new F({ path: ("PaxHeader/" + path17.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");
22232
+ new F({ path: ("PaxHeader/" + path14.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");
21923
22233
  for (let n2 = e + 512; n2 < r.length; n2++) r[n2] = 0;
21924
22234
  return r;
21925
22235
  }
@@ -22281,11 +22591,11 @@ var Nn = (s3) => {
22281
22591
  };
22282
22592
  var Ki = (s3, t2) => {
22283
22593
  let e = new Map(t2.map((n2) => [mt3(n2), true])), i2 = s3.filter, r = (n2, o2 = "") => {
22284
- let h3 = o2 || path17.parse(n2).root || ".", a2;
22594
+ let h3 = o2 || path14.parse(n2).root || ".", a2;
22285
22595
  if (n2 === h3) a2 = false;
22286
22596
  else {
22287
22597
  let l = e.get(n2);
22288
- a2 = l !== void 0 ? l : r(path17.dirname(n2), h3);
22598
+ a2 = l !== void 0 ? l : r(path14.dirname(n2), h3);
22289
22599
  }
22290
22600
  return e.set(n2, a2), a2;
22291
22601
  };
@@ -22331,7 +22641,7 @@ var It3 = K2(An, Dn, (s3) => new st2(s3), (s3) => new st2(s3), (s3, t2) => {
22331
22641
  t2?.length && Ki(s3, t2), s3.noResume || Nn(s3);
22332
22642
  });
22333
22643
  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);
22334
- var { isAbsolute: Cn, parse: Ys } = path17.win32;
22644
+ var { isAbsolute: Cn, parse: Ys } = path14.win32;
22335
22645
  var ce2 = (s3) => {
22336
22646
  let t2 = "", e = Ys(s3);
22337
22647
  for (; Cn(s3) || e.root; ) {
@@ -22405,7 +22715,7 @@ var de2 = class extends D3 {
22405
22715
  let [o2, h3] = ce2(this.path);
22406
22716
  o2 && typeof h3 == "string" && (this.path = h3, r = o2);
22407
22717
  }
22408
- 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 || path17__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 });
22718
+ 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 || path14__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 });
22409
22719
  let n2 = this.statCache.get(this.absolute);
22410
22720
  n2 ? this[ei](n2) : this[Qi]();
22411
22721
  }
@@ -22464,7 +22774,7 @@ var de2 = class extends D3 {
22464
22774
  }
22465
22775
  [Qs](t2) {
22466
22776
  if (!this.stat) throw new Error("cannot create link entry without stat");
22467
- this.type = "Link", this.linkpath = f(path17__default.default.relative(this.cwd, t2)), this.stat.size = 0, this[fe2](), this.end();
22777
+ this.type = "Link", this.linkpath = f(path14__default.default.relative(this.cwd, t2)), this.stat.size = 0, this[fe2](), this.end();
22468
22778
  }
22469
22779
  [qs]() {
22470
22780
  if (!this.stat) throw new Error("cannot create file entry without stat");
@@ -22875,7 +23185,7 @@ var Et3 = class extends D3 {
22875
23185
  return t2 instanceof Yt ? this[er](t2) : this[hi](t2), this.flowing;
22876
23186
  }
22877
23187
  [er](t2) {
22878
- let e = f(path17__default.default.resolve(this.cwd, t2.path));
23188
+ let e = f(path14__default.default.resolve(this.cwd, t2.path));
22879
23189
  if (!this.filter(t2.path, t2)) t2.resume();
22880
23190
  else {
22881
23191
  let i2 = new di(t2.path, e);
@@ -22884,7 +23194,7 @@ var Et3 = class extends D3 {
22884
23194
  this[Ft3]();
22885
23195
  }
22886
23196
  [hi](t2) {
22887
- let e = f(path17__default.default.resolve(this.cwd, t2));
23197
+ let e = f(path14__default.default.resolve(this.cwd, t2));
22888
23198
  this[W3].push(new di(t2, e)), this[Ft3]();
22889
23199
  }
22890
23200
  [as](t2) {
@@ -23022,11 +23332,11 @@ var Hn = (s3, t2) => {
23022
23332
  };
23023
23333
  var or = (s3, t2) => {
23024
23334
  t2.forEach((e) => {
23025
- e.charAt(0) === "@" ? It3({ file: path17__default.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
23335
+ e.charAt(0) === "@" ? It3({ file: path14__default.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
23026
23336
  }), s3.end();
23027
23337
  };
23028
23338
  var hr = async (s3, t2) => {
23029
- for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path17__default.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => {
23339
+ for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path14__default.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => {
23030
23340
  s3.add(i2);
23031
23341
  } }) : s3.add(e);
23032
23342
  s3.end();
@@ -23051,7 +23361,7 @@ var Vn = 512 * 1024;
23051
23361
  var $n = pr | ur | dr | mr;
23052
23362
  var lr = !fr && typeof ar == "number" ? ar | ur | dr | mr : null;
23053
23363
  var cs = lr !== null ? () => lr : Kn ? (s3) => s3 < Vn ? $n : "w" : () => "w";
23054
- var fs9 = (s3, t2, e) => {
23364
+ var fs10 = (s3, t2, e) => {
23055
23365
  try {
23056
23366
  return u2__default.default.lchownSync(s3, t2, e);
23057
23367
  } catch (i2) {
@@ -23064,13 +23374,13 @@ var ui = (s3, t2, e, i2) => {
23064
23374
  });
23065
23375
  };
23066
23376
  var Xn = (s3, t2, e, i2, r) => {
23067
- if (t2.isDirectory()) ds(path17__default.default.resolve(s3, t2.name), e, i2, (n2) => {
23377
+ if (t2.isDirectory()) ds(path14__default.default.resolve(s3, t2.name), e, i2, (n2) => {
23068
23378
  if (n2) return r(n2);
23069
- let o2 = path17__default.default.resolve(s3, t2.name);
23379
+ let o2 = path14__default.default.resolve(s3, t2.name);
23070
23380
  ui(o2, e, i2, r);
23071
23381
  });
23072
23382
  else {
23073
- let n2 = path17__default.default.resolve(s3, t2.name);
23383
+ let n2 = path14__default.default.resolve(s3, t2.name);
23074
23384
  ui(n2, e, i2, r);
23075
23385
  }
23076
23386
  };
@@ -23091,7 +23401,7 @@ var ds = (s3, t2, e, i2) => {
23091
23401
  });
23092
23402
  };
23093
23403
  var qn = (s3, t2, e, i2) => {
23094
- t2.isDirectory() && us(path17__default.default.resolve(s3, t2.name), e, i2), fs9(path17__default.default.resolve(s3, t2.name), e, i2);
23404
+ t2.isDirectory() && us(path14__default.default.resolve(s3, t2.name), e, i2), fs10(path14__default.default.resolve(s3, t2.name), e, i2);
23095
23405
  };
23096
23406
  var us = (s3, t2, e) => {
23097
23407
  let i2;
@@ -23100,11 +23410,11 @@ var us = (s3, t2, e) => {
23100
23410
  } catch (r) {
23101
23411
  let n2 = r;
23102
23412
  if (n2?.code === "ENOENT") return;
23103
- if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return fs9(s3, t2, e);
23413
+ if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return fs10(s3, t2, e);
23104
23414
  throw n2;
23105
23415
  }
23106
23416
  for (let r of i2) qn(s3, r, t2, e);
23107
- return fs9(s3, t2, e);
23417
+ return fs10(s3, t2, e);
23108
23418
  };
23109
23419
  var we2 = class extends Error {
23110
23420
  path;
@@ -23141,12 +23451,12 @@ var Er = (s3, t2, e) => {
23141
23451
  };
23142
23452
  if (s3 === d) return Qn(s3, S2);
23143
23453
  if (l) return jn__default.default.mkdir(s3, { mode: r, recursive: true }).then((E) => S2(null, E ?? void 0), S2);
23144
- let N3 = f(path17__default.default.relative(d, s3)).split("/");
23454
+ let N3 = f(path14__default.default.relative(d, s3)).split("/");
23145
23455
  ms(d, N3, r, c3, d, void 0, S2);
23146
23456
  };
23147
23457
  var ms = (s3, t2, e, i2, r, n2, o2) => {
23148
23458
  if (t2.length === 0) return o2(null, n2);
23149
- let h3 = t2.shift(), a2 = f(path17__default.default.resolve(s3 + "/" + h3));
23459
+ let h3 = t2.shift(), a2 = f(path14__default.default.resolve(s3 + "/" + h3));
23150
23460
  u2__default.default.mkdir(a2, e, wr(a2, t2, e, i2, r, n2, o2));
23151
23461
  };
23152
23462
  var wr = (s3, t2, e, i2, r, n2, o2) => (h3) => {
@@ -23180,9 +23490,9 @@ var Sr = (s3, t2) => {
23180
23490
  };
23181
23491
  if (s3 === c3) return Jn(c3), d();
23182
23492
  if (a2) return d(u2__default.default.mkdirSync(s3, { mode: i2, recursive: true }) ?? void 0);
23183
- let T2 = f(path17__default.default.relative(c3, s3)).split("/"), N3;
23493
+ let T2 = f(path14__default.default.relative(c3, s3)).split("/"), N3;
23184
23494
  for (let E = T2.shift(), x3 = c3; E && (x3 += "/" + E); E = T2.shift()) {
23185
- x3 = f(path17__default.default.resolve(x3));
23495
+ x3 = f(path14__default.default.resolve(x3));
23186
23496
  try {
23187
23497
  u2__default.default.mkdirSync(x3, i2), N3 = N3 || x3;
23188
23498
  } catch {
@@ -23211,14 +23521,14 @@ var to = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
23211
23521
  var eo = to === "win32";
23212
23522
  var io = (s3) => s3.split("/").slice(0, -1).reduce((e, i2) => {
23213
23523
  let r = e.at(-1);
23214
- return r !== void 0 && (i2 = path17.join(r, i2)), e.push(i2 || "/"), e;
23524
+ return r !== void 0 && (i2 = path14.join(r, i2)), e.push(i2 || "/"), e;
23215
23525
  }, []);
23216
23526
  var Ei = class {
23217
23527
  #t = /* @__PURE__ */ new Map();
23218
23528
  #i = /* @__PURE__ */ new Map();
23219
23529
  #s = /* @__PURE__ */ new Set();
23220
23530
  reserve(t2, e) {
23221
- t2 = eo ? ["win32 parallelization disabled"] : t2.map((r) => mt3(path17.join(Rr(r))));
23531
+ t2 = eo ? ["win32 parallelization disabled"] : t2.map((r) => mt3(path14.join(Rr(r))));
23222
23532
  let i2 = new Set(t2.map((r) => io(r)).reduce((r, n2) => r.concat(n2)));
23223
23533
  this.#i.set(e, { dirs: i2, paths: t2 });
23224
23534
  for (let r of t2) {
@@ -23358,7 +23668,7 @@ var qt = class extends st2 {
23358
23668
  if (t2.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
23359
23669
  this.uid = t2.uid, this.gid = t2.gid, this.setOwner = true;
23360
23670
  } else this.uid = void 0, this.gid = void 0, this.setOwner = false;
23361
- 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(path17__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));
23671
+ 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(path14__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));
23362
23672
  }
23363
23673
  warn(t2, e, i2 = {}) {
23364
23674
  return (t2 === "TAR_BAD_ARCHIVE" || t2 === "TAR_ABORT") && (i2.recoverable = false), super.warn(t2, e, i2);
@@ -23372,7 +23682,7 @@ var qt = class extends st2 {
23372
23682
  let [n2, o2] = ce2(i2), h3 = o2.replaceAll(/\\/g, "/").split("/");
23373
23683
  if (h3.includes("..") || Oe2 && /^[a-z]:\.\.$/i.test(h3[0] ?? "")) {
23374
23684
  if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t2, [e]: i2 }), false;
23375
- let a2 = path17__default.default.posix.dirname(t2.path), l = path17__default.default.posix.normalize(path17__default.default.posix.join(a2, h3.join("/")));
23685
+ let a2 = path14__default.default.posix.dirname(t2.path), l = path14__default.default.posix.normalize(path14__default.default.posix.join(a2, h3.join("/")));
23376
23686
  if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t2, [e]: i2 }), false;
23377
23687
  }
23378
23688
  return n2 && (t2[e] = String(o2), this.warn("TAR_ENTRY_INFO", `stripping ${n2} from absolute ${e}`, { entry: t2, [e]: i2 })), true;
@@ -23390,12 +23700,12 @@ var qt = class extends st2 {
23390
23700
  }
23391
23701
  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;
23392
23702
  if (!this[Es](t2, "path") || !this[Es](t2, "linkpath")) return false;
23393
- if (t2.absolute = path17__default.default.isAbsolute(t2.path) ? f(path17__default.default.resolve(t2.path)) : f(path17__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;
23703
+ if (t2.absolute = path14__default.default.isAbsolute(t2.path) ? f(path14__default.default.resolve(t2.path)) : f(path14__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;
23394
23704
  if (t2.absolute === this.cwd && t2.type !== "Directory" && t2.type !== "GNUDumpDir") return false;
23395
23705
  if (this.win32) {
23396
- let { root: r } = path17__default.default.win32.parse(String(t2.absolute));
23706
+ let { root: r } = path14__default.default.win32.parse(String(t2.absolute));
23397
23707
  t2.absolute = r + Xi(String(t2.absolute).slice(r.length));
23398
- let { root: n2 } = path17__default.default.win32.parse(t2.path);
23708
+ let { root: n2 } = path14__default.default.win32.parse(t2.path);
23399
23709
  t2.path = n2 + Xi(t2.path.slice(n2.length));
23400
23710
  }
23401
23711
  return true;
@@ -23483,13 +23793,13 @@ var qt = class extends st2 {
23483
23793
  t2.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t2.type}`, { entry: t2 }), t2.resume();
23484
23794
  }
23485
23795
  [Tr](t2, e) {
23486
- let i2 = f(path17__default.default.relative(this.cwd, path17__default.default.resolve(path17__default.default.dirname(String(t2.absolute)), String(t2.linkpath)))).split("/");
23796
+ let i2 = f(path14__default.default.relative(this.cwd, path14__default.default.resolve(path14__default.default.dirname(String(t2.absolute)), String(t2.linkpath)))).split("/");
23487
23797
  this[ye2](t2, this.cwd, i2, () => this[Si](t2, String(t2.linkpath), "symlink", e), (r) => {
23488
23798
  this[O2](r, t2), e();
23489
23799
  });
23490
23800
  }
23491
23801
  [xr](t2, e) {
23492
- let i2 = f(path17__default.default.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
23802
+ let i2 = f(path14__default.default.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
23493
23803
  this[ye2](t2, this.cwd, r, () => this[Si](t2, i2, "link", e), (n2) => {
23494
23804
  this[O2](n2, t2), e();
23495
23805
  });
@@ -23497,10 +23807,10 @@ var qt = class extends st2 {
23497
23807
  [ye2](t2, e, i2, r, n2) {
23498
23808
  let o2 = i2.shift();
23499
23809
  if (this.preservePaths || o2 === void 0) return r();
23500
- let h3 = path17__default.default.resolve(e, o2);
23810
+ let h3 = path14__default.default.resolve(e, o2);
23501
23811
  u2__default.default.lstat(h3, (a2, l) => {
23502
23812
  if (a2) return r();
23503
- if (l?.isSymbolicLink()) return n2(new wt2(h3, path17__default.default.resolve(h3, i2.join("/"))));
23813
+ if (l?.isSymbolicLink()) return n2(new wt2(h3, path14__default.default.resolve(h3, i2.join("/"))));
23504
23814
  this[ye2](t2, h3, i2, r, n2);
23505
23815
  });
23506
23816
  }
@@ -23534,7 +23844,7 @@ var qt = class extends st2 {
23534
23844
  });
23535
23845
  }, n2 = () => {
23536
23846
  if (t2.absolute !== this.cwd) {
23537
- let h3 = f(path17__default.default.dirname(String(t2.absolute)));
23847
+ let h3 = f(path14__default.default.dirname(String(t2.absolute)));
23538
23848
  if (h3 !== this.cwd) return this[St2](h3, this.dmode, (a2) => {
23539
23849
  if (a2) {
23540
23850
  this[O2](a2, t2), i2();
@@ -23609,7 +23919,7 @@ var Te2 = class extends qt {
23609
23919
  this[ge2] = true;
23610
23920
  }
23611
23921
  if (t2.absolute !== this.cwd) {
23612
- let n2 = f(path17__default.default.dirname(String(t2.absolute)));
23922
+ let n2 = f(path14__default.default.dirname(String(t2.absolute)));
23613
23923
  if (n2 !== this.cwd) {
23614
23924
  let o2 = this[St2](n2, this.dmode);
23615
23925
  if (o2) return this[O2](o2, t2);
@@ -23709,10 +24019,10 @@ var Te2 = class extends qt {
23709
24019
  if (this.preservePaths || i2.length === 0) return r();
23710
24020
  let o2 = e;
23711
24021
  for (let h3 of i2) {
23712
- o2 = path17__default.default.resolve(o2, h3);
24022
+ o2 = path14__default.default.resolve(o2, h3);
23713
24023
  let [a2, l] = Se2(() => u2__default.default.lstatSync(o2));
23714
24024
  if (a2) return r();
23715
- if (l.isSymbolicLink()) return n2(new wt2(o2, path17__default.default.resolve(e, i2.join("/"))));
24025
+ if (l.isSymbolicLink()) return n2(new wt2(o2, path14__default.default.resolve(e, i2.join("/"))));
23716
24026
  }
23717
24027
  r();
23718
24028
  }
@@ -23816,11 +24126,11 @@ var mo = (s3, t2) => {
23816
24126
  };
23817
24127
  var po = (s3, t2) => {
23818
24128
  t2.forEach((e) => {
23819
- e.charAt(0) === "@" ? It3({ file: path17__default.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
24129
+ e.charAt(0) === "@" ? It3({ file: path14__default.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
23820
24130
  }), s3.end();
23821
24131
  };
23822
24132
  var Eo = async (s3, t2) => {
23823
- for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path17__default.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
24133
+ for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path14__default.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
23824
24134
  s3.end();
23825
24135
  };
23826
24136
  var vt3 = K2(fo, mo, () => {
@@ -23845,11 +24155,11 @@ var GITHUB_ORG = "nextlyhq";
23845
24155
  var GITHUB_REPO = "nextly";
23846
24156
  async function downloadTemplate(templateName, branch = "main") {
23847
24157
  const url = `https://codeload.github.com/${GITHUB_ORG}/${GITHUB_REPO}/tar.gz/${branch}`;
23848
- const tmpDir = path17__default.default.join(
24158
+ const tmpDir = path14__default.default.join(
23849
24159
  process.env.TMPDIR || "/tmp",
23850
24160
  `nextly-template-${Date.now()}`
23851
24161
  );
23852
- await import_fs_extra8.default.ensureDir(tmpDir);
24162
+ await import_fs_extra9.default.ensureDir(tmpDir);
23853
24163
  const repoPrefix = `${GITHUB_REPO}-${branch}`;
23854
24164
  const baseFilter = `${repoPrefix}/templates/base/`;
23855
24165
  const templateFilter = `${repoPrefix}/templates/${templateName}/`;
@@ -23878,7 +24188,7 @@ async function downloadTemplate(templateName, branch = "main") {
23878
24188
  })
23879
24189
  );
23880
24190
  } catch (error) {
23881
- await import_fs_extra8.default.remove(tmpDir).catch(() => {
24191
+ await import_fs_extra9.default.remove(tmpDir).catch(() => {
23882
24192
  });
23883
24193
  if (error instanceof Error && error.name === "TimeoutError") {
23884
24194
  throw new Error(
@@ -23887,17 +24197,17 @@ async function downloadTemplate(templateName, branch = "main") {
23887
24197
  }
23888
24198
  throw error;
23889
24199
  }
23890
- const basePath = path17__default.default.join(tmpDir, "templates", "base");
23891
- const templatePath = path17__default.default.join(tmpDir, "templates", templateName);
23892
- if (!await import_fs_extra8.default.pathExists(basePath)) {
23893
- await import_fs_extra8.default.remove(tmpDir).catch(() => {
24200
+ const basePath = path14__default.default.join(tmpDir, "templates", "base");
24201
+ const templatePath = path14__default.default.join(tmpDir, "templates", templateName);
24202
+ if (!await import_fs_extra9.default.pathExists(basePath)) {
24203
+ await import_fs_extra9.default.remove(tmpDir).catch(() => {
23894
24204
  });
23895
24205
  throw new Error(
23896
24206
  `Base template not found in downloaded archive. The branch "${branch}" may not contain templates.`
23897
24207
  );
23898
24208
  }
23899
- if (!await import_fs_extra8.default.pathExists(templatePath)) {
23900
- await import_fs_extra8.default.remove(tmpDir).catch(() => {
24209
+ if (!await import_fs_extra9.default.pathExists(templatePath)) {
24210
+ await import_fs_extra9.default.remove(tmpDir).catch(() => {
23901
24211
  });
23902
24212
  throw new Error(
23903
24213
  `Template "${templateName}" not found in downloaded archive. Available templates may differ on branch "${branch}".`
@@ -23906,14 +24216,14 @@ async function downloadTemplate(templateName, branch = "main") {
23906
24216
  return { basePath, templatePath };
23907
24217
  }
23908
24218
  async function resolveLocalTemplate(localPath, templateName) {
23909
- const basePath = path17__default.default.join(localPath, "base");
23910
- const templatePath = path17__default.default.join(localPath, templateName);
23911
- if (!await import_fs_extra8.default.pathExists(basePath)) {
24219
+ const basePath = path14__default.default.join(localPath, "base");
24220
+ const templatePath = path14__default.default.join(localPath, templateName);
24221
+ if (!await import_fs_extra9.default.pathExists(basePath)) {
23912
24222
  throw new Error(
23913
24223
  `Base template not found at ${basePath}. Check the --local-template path points to the templates/ directory.`
23914
24224
  );
23915
24225
  }
23916
- if (!await import_fs_extra8.default.pathExists(templatePath)) {
24226
+ if (!await import_fs_extra9.default.pathExists(templatePath)) {
23917
24227
  throw new Error(
23918
24228
  `Template "${templateName}" not found at ${templatePath}. Check the --local-template path points to the templates/ directory.`
23919
24229
  );
@@ -23930,8 +24240,8 @@ async function resolveTemplateSource(templateName, options = {}) {
23930
24240
  async function cleanupDownload(source) {
23931
24241
  const tmpBase = process.env.TMPDIR || "/tmp";
23932
24242
  if (source.basePath.startsWith(tmpBase)) {
23933
- const extractionRoot = path17__default.default.resolve(source.basePath, "../..");
23934
- await import_fs_extra8.default.remove(extractionRoot).catch(() => {
24243
+ const extractionRoot = path14__default.default.resolve(source.basePath, "../..");
24244
+ await import_fs_extra9.default.remove(extractionRoot).catch(() => {
23935
24245
  });
23936
24246
  }
23937
24247
  }
@@ -24033,14 +24343,37 @@ var DATABASE_LABELS = {
24033
24343
  hint: "Popular alternative for production"
24034
24344
  }
24035
24345
  };
24346
+ var import_fs_extra10 = __toESM(require_lib());
24347
+ function resolveProjectArg(directory) {
24348
+ const trimmed = directory?.trim();
24349
+ if (!trimmed) {
24350
+ return { projectName: void 0, installInCwd: false };
24351
+ }
24352
+ if (trimmed === "." || trimmed === "./") {
24353
+ return { projectName: void 0, installInCwd: true };
24354
+ }
24355
+ return { projectName: path14__default.default.basename(trimmed), installInCwd: false };
24356
+ }
24357
+ function validateProjectName(name) {
24358
+ if (!/^[a-z0-9][a-z0-9._-]*$/.test(name)) {
24359
+ return "Use lowercase letters, numbers, hyphens, dots, or underscores";
24360
+ }
24361
+ return void 0;
24362
+ }
24363
+ function validateProjectNamePromptInput(value) {
24364
+ const trimmed = (value ?? "").trim();
24365
+ if (trimmed === "") return void 0;
24366
+ if (trimmed === "." || trimmed === "./") return void 0;
24367
+ const candidate = trimmed.startsWith("./") ? trimmed.slice(2) : trimmed;
24368
+ return validateProjectName(path14__default.default.basename(candidate));
24369
+ }
24036
24370
 
24037
24371
  // src/prompts/project-name.ts
24038
- var import_fs_extra9 = __toESM(require_lib());
24039
24372
  async function isExistingNextProject(cwd) {
24040
- const packageJsonPath = path17__default.default.join(cwd, "package.json");
24041
- if (!await import_fs_extra9.default.pathExists(packageJsonPath)) return false;
24373
+ const packageJsonPath = path14__default.default.join(cwd, "package.json");
24374
+ if (!await import_fs_extra10.default.pathExists(packageJsonPath)) return false;
24042
24375
  try {
24043
- const packageJson = await import_fs_extra9.default.readJson(packageJsonPath);
24376
+ const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
24044
24377
  const deps = {
24045
24378
  ...packageJson.dependencies,
24046
24379
  ...packageJson.devDependencies
@@ -24050,6 +24383,42 @@ async function isExistingNextProject(cwd) {
24050
24383
  return false;
24051
24384
  }
24052
24385
  }
24386
+ var DEFAULT_PROJECT_NAME = "my-nextly-app";
24387
+ async function promptForProjectName() {
24388
+ const answer = await Zt({
24389
+ message: "What should your project be called?",
24390
+ // `initialValue` pre-fills the buffer so Enter accepts the default.
24391
+ // The previous version used `placeholder` alone, which returned an
24392
+ // empty string on Enter and silently fell through to a cwd install —
24393
+ // the root cause of the original bug. `placeholder` is omitted here
24394
+ // because clack only shows it when the buffer is empty, and the
24395
+ // initialValue keeps it populated.
24396
+ initialValue: DEFAULT_PROJECT_NAME,
24397
+ validate: validateProjectNamePromptInput
24398
+ });
24399
+ if (Ct(answer)) {
24400
+ return { kind: "cancelled" };
24401
+ }
24402
+ return { kind: "resolved", value: resolveProjectArg(answer) };
24403
+ }
24404
+ async function promptDirectoryConflict(targetLabel) {
24405
+ const choice = await Jt({
24406
+ message: `Target directory ${targetLabel} is not empty. How would you like to proceed?`,
24407
+ options: [
24408
+ { value: "cancel", label: "Cancel operation" },
24409
+ {
24410
+ value: "remove",
24411
+ label: "Remove existing files and continue"
24412
+ },
24413
+ {
24414
+ value: "ignore",
24415
+ label: "Ignore files and continue"
24416
+ }
24417
+ ]
24418
+ });
24419
+ if (Ct(choice)) return "cancel";
24420
+ return choice;
24421
+ }
24053
24422
 
24054
24423
  // src/prompts/template.ts
24055
24424
  var import_picocolors2 = __toESM(require_picocolors2());
@@ -24077,7 +24446,7 @@ function isValidTemplateSelection(value) {
24077
24446
  }
24078
24447
 
24079
24448
  // src/utils/detect.ts
24080
- var import_fs_extra10 = __toESM(require_lib());
24449
+ var import_fs_extra11 = __toESM(require_lib());
24081
24450
 
24082
24451
  // src/utils/detect-pm-from-user-agent.ts
24083
24452
  function detectPmFromUserAgent(userAgent) {
@@ -24093,19 +24462,19 @@ function detectPmFromUserAgent(userAgent) {
24093
24462
  async function detectPackageManager(cwd) {
24094
24463
  const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
24095
24464
  if (fromUa) return fromUa;
24096
- if (await import_fs_extra10.default.pathExists(path17__default.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
24097
- if (await import_fs_extra10.default.pathExists(path17__default.default.join(cwd, "yarn.lock"))) return "yarn";
24098
- if (await import_fs_extra10.default.pathExists(path17__default.default.join(cwd, "bun.lockb"))) return "bun";
24465
+ if (await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
24466
+ if (await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "yarn.lock"))) return "yarn";
24467
+ if (await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "bun.lockb"))) return "bun";
24099
24468
  return "npm";
24100
24469
  }
24101
24470
  async function detectProject(cwd) {
24102
- const packageJsonPath = path17__default.default.join(cwd, "package.json");
24103
- if (!await import_fs_extra10.default.pathExists(packageJsonPath)) {
24471
+ const packageJsonPath = path14__default.default.join(cwd, "package.json");
24472
+ if (!await import_fs_extra11.default.pathExists(packageJsonPath)) {
24104
24473
  throw new Error(
24105
24474
  "No package.json found. Please run this command in a Next.js project."
24106
24475
  );
24107
24476
  }
24108
- const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
24477
+ const packageJson = await import_fs_extra11.default.readJson(packageJsonPath);
24109
24478
  const deps = {
24110
24479
  ...packageJson.dependencies,
24111
24480
  ...packageJson.devDependencies
@@ -24117,11 +24486,11 @@ async function detectProject(cwd) {
24117
24486
  );
24118
24487
  }
24119
24488
  const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
24120
- const srcDir = await import_fs_extra10.default.pathExists(path17__default.default.join(cwd, "src"));
24121
- const appDirPaths = srcDir ? [path17__default.default.join(cwd, "src", "app")] : [path17__default.default.join(cwd, "app")];
24489
+ const srcDir = await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "src"));
24490
+ const appDirPaths = srcDir ? [path14__default.default.join(cwd, "src", "app")] : [path14__default.default.join(cwd, "app")];
24122
24491
  let isAppRouter = false;
24123
24492
  for (const appPath of appDirPaths) {
24124
- if (await import_fs_extra10.default.pathExists(appPath)) {
24493
+ if (await import_fs_extra11.default.pathExists(appPath)) {
24125
24494
  isAppRouter = true;
24126
24495
  break;
24127
24496
  }
@@ -24131,7 +24500,7 @@ async function detectProject(cwd) {
24131
24500
  "App Router not detected. Nextly requires Next.js App Router (app/ directory)."
24132
24501
  );
24133
24502
  }
24134
- const hasTypescript = await import_fs_extra10.default.pathExists(path17__default.default.join(cwd, "tsconfig.json"));
24503
+ const hasTypescript = await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "tsconfig.json"));
24135
24504
  const packageManager = await detectPackageManager(cwd);
24136
24505
  const appDir = srcDir ? "src/app" : "app";
24137
24506
  return {
@@ -24145,315 +24514,36 @@ async function detectProject(cwd) {
24145
24514
  };
24146
24515
  }
24147
24516
 
24148
- // src/utils/template.ts
24149
- var import_fs_extra11 = __toESM(require_lib());
24150
- var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
24151
- ".ts",
24152
- ".tsx",
24153
- ".js",
24154
- ".jsx",
24155
- ".json",
24156
- ".env",
24157
- ".md",
24158
- ".css",
24159
- ".html",
24160
- ".mjs",
24161
- ".cjs"
24162
- ]);
24163
- var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
24164
- function resolveTemplatePath(localTemplatePath) {
24165
- const __dirname = path17__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
24166
- const fromDist = path17__default.default.resolve(__dirname, "../templates");
24167
- if (import_fs_extra11.default.existsSync(fromDist)) {
24168
- return fromDist;
24169
- }
24170
- const fromSrc = path17__default.default.resolve(__dirname, "../../templates");
24171
- if (import_fs_extra11.default.existsSync(fromSrc)) {
24172
- return fromSrc;
24173
- }
24174
- throw new Error(
24175
- "Could not find templates directory. Use --local-template to specify the templates path, or ensure templates are bundled."
24176
- );
24177
- }
24178
- function buildPlaceholderMap(options) {
24179
- const { database, databaseUrl } = options;
24180
- return {
24181
- "{{databaseDialect}}": database.type,
24182
- "{{databaseUrl}}": databaseUrl || database.envExample
24183
- };
24184
- }
24185
- async function replacePlaceholdersInFile(filePath, placeholders) {
24186
- const ext = path17__default.default.extname(filePath).toLowerCase();
24187
- const basename = path17__default.default.basename(filePath);
24188
- const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
24189
- if (!isTextFile) return;
24190
- let content = await import_fs_extra11.default.readFile(filePath, "utf-8");
24191
- let changed = false;
24192
- for (const [placeholder, value] of Object.entries(placeholders)) {
24193
- if (content.includes(placeholder)) {
24194
- content = content.replaceAll(placeholder, value);
24195
- changed = true;
24196
- }
24197
- }
24198
- if (changed) {
24199
- await import_fs_extra11.default.writeFile(filePath, content, "utf-8");
24200
- }
24201
- }
24202
- async function replacePlaceholders(dir, placeholders) {
24203
- const entries = await import_fs_extra11.default.readdir(dir, { withFileTypes: true });
24204
- for (const entry of entries) {
24205
- const fullPath = path17__default.default.join(dir, entry.name);
24206
- if (entry.isDirectory()) {
24207
- if (entry.name === "node_modules" || entry.name === ".git") continue;
24208
- await replacePlaceholders(fullPath, placeholders);
24209
- } else if (entry.isFile()) {
24210
- await replacePlaceholdersInFile(fullPath, placeholders);
24211
- }
24212
- }
24213
- }
24214
- var PINNED_VERSIONS = {
24215
- // Next.js ecosystem — resolved at runtime via fetchLatestVersion()
24216
- // (see generatePackageJson)
24217
- react: "^19.1.0",
24218
- "react-dom": "^19.1.0",
24219
- // Dev dependencies
24220
- typescript: "^5",
24221
- "@types/node": "^20",
24222
- "@types/react": "^19",
24223
- "@types/react-dom": "^19",
24224
- "@tailwindcss/postcss": "^4",
24225
- tailwindcss: "^4",
24226
- eslint: "^9"
24227
- };
24228
- var RUNTIME_RESOLVED_PACKAGES = ["next", "eslint-config-next"];
24229
- var NEXTLY_PACKAGES = [
24230
- "nextly",
24231
- "@nextlyhq/admin",
24232
- "@nextlyhq/adapter-drizzle",
24233
- "@nextlyhq/adapter-postgres",
24234
- "@nextlyhq/adapter-mysql",
24235
- "@nextlyhq/adapter-sqlite"
24236
- ];
24237
- var resolvedNextlyVersions = null;
24238
- async function fetchLatestVersion(pkg) {
24239
- try {
24240
- const res = await fetch(
24241
- `https://registry.npmjs.org/-/package/${encodeURIComponent(pkg)}/dist-tags`,
24242
- { signal: AbortSignal.timeout(5e3) }
24243
- );
24244
- if (!res.ok) return "latest";
24245
- const data = await res.json();
24246
- return data.latest ? `^${data.latest}` : "latest";
24247
- } catch {
24248
- return "latest";
24249
- }
24250
- }
24251
- async function resolveNextlyVersions() {
24252
- if (resolvedNextlyVersions) return resolvedNextlyVersions;
24253
- const entries = await Promise.all(
24254
- NEXTLY_PACKAGES.map(
24255
- async (pkg) => [pkg, await fetchLatestVersion(pkg)]
24256
- )
24257
- );
24258
- resolvedNextlyVersions = Object.fromEntries(entries);
24259
- return resolvedNextlyVersions;
24260
- }
24261
- var resolvedRuntimeVersions = null;
24262
- async function resolveRuntimeVersions() {
24263
- if (resolvedRuntimeVersions) return resolvedRuntimeVersions;
24264
- const FALLBACKS = {
24265
- next: "^16.1.0",
24266
- "eslint-config-next": "^16.1.0"
24267
- };
24268
- const entries = await Promise.all(
24269
- RUNTIME_RESOLVED_PACKAGES.map(async (pkg) => {
24270
- const version = await fetchLatestVersion(pkg);
24271
- return [pkg, version === "latest" ? FALLBACKS[pkg] : version];
24272
- })
24273
- );
24274
- resolvedRuntimeVersions = Object.fromEntries(entries);
24275
- return resolvedRuntimeVersions;
24276
- }
24277
- async function generatePackageJson(projectName, database, useYalc = false) {
24278
- const runtimeVersions = await resolveRuntimeVersions();
24279
- const dependencies = {
24280
- next: runtimeVersions.next,
24281
- react: PINNED_VERSIONS.react,
24282
- "react-dom": PINNED_VERSIONS["react-dom"]
24283
- };
24284
- dependencies["@tanstack/react-query"] = "^5.62.0";
24285
- if (!useYalc) {
24286
- const versions = await resolveNextlyVersions();
24287
- dependencies["nextly"] = versions["nextly"];
24288
- dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
24289
- dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";
24290
- dependencies["@nextlyhq/adapter-drizzle"] = versions["@nextlyhq/adapter-drizzle"];
24291
- dependencies[database.adapter] = versions[database.adapter] || "latest";
24292
- dependencies["@nextlyhq/plugin-form-builder"] = versions["@nextlyhq/plugin-form-builder"] || "latest";
24293
- }
24294
- const devDependencies = {
24295
- typescript: PINNED_VERSIONS.typescript,
24296
- "@types/node": PINNED_VERSIONS["@types/node"],
24297
- "@types/react": PINNED_VERSIONS["@types/react"],
24298
- "@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
24299
- "@tailwindcss/postcss": PINNED_VERSIONS["@tailwindcss/postcss"],
24300
- tailwindcss: PINNED_VERSIONS.tailwindcss,
24301
- eslint: PINNED_VERSIONS.eslint,
24302
- "eslint-config-next": runtimeVersions["eslint-config-next"],
24303
- // Pagefind powers /search in the blog template. Zero-config
24304
- // static index generated at `next build` time. Templates that
24305
- // don't ship a /search page simply won't invoke it.
24306
- pagefind: "^1.1.0"
24307
- };
24308
- const pkg = {
24309
- name: projectName,
24310
- version: "0.1.0",
24311
- private: true,
24312
- scripts: {
24313
- // F1 PR 4: dev now boots Nextly in single-process mode via `next dev`.
24314
- // The lazy drizzle-kit/api import (PR 1) plus the in-process HMR
24315
- // listener (PR 2) replaced the wrapper that previously owned the
24316
- // terminal, schema prompts, and child supervision. `nextly dev` is
24317
- // gone; the only supported dev command is the standard `next dev`.
24318
- dev: "next dev --turbopack",
24319
- // Build: migrate DB + compile Next.js + (if present) generate
24320
- // the Pagefind search index. Templates without the search
24321
- // script silently skip the last step.
24322
- build: "nextly migrate && next build && (test -f scripts/build-search-index.mjs && node scripts/build-search-index.mjs || true)",
24323
- "search:index": "node scripts/build-search-index.mjs",
24324
- start: "next start",
24325
- lint: "next lint",
24326
- nextly: "nextly",
24327
- // First-time setup: sync schema + seed system permissions. Demo
24328
- // content is seeded separately from the admin UI (visit /welcome
24329
- // after running `pnpm dev` and completing /admin/setup).
24330
- "db:setup": "nextly db:sync",
24331
- "db:migrate": "nextly migrate",
24332
- "db:migrate:status": "nextly migrate:status",
24333
- "db:migrate:fresh": "nextly migrate:fresh",
24334
- "db:migrate:reset": "nextly migrate:reset",
24335
- "types:generate": "nextly generate:types"
24336
- },
24337
- dependencies,
24338
- devDependencies
24339
- };
24340
- return JSON.stringify(pkg, null, 2) + "\n";
24517
+ // src/utils/fs.ts
24518
+ var import_fs_extra12 = __toESM(require_lib());
24519
+ async function isDirectoryNotEmpty(dir) {
24520
+ if (!await import_fs_extra12.default.pathExists(dir)) return false;
24521
+ const entries = await import_fs_extra12.default.readdir(dir);
24522
+ return entries.some((entry) => entry !== ".git");
24341
24523
  }
24342
- async function copyTemplate(options) {
24343
- const {
24344
- projectName,
24345
- projectType,
24346
- targetDir,
24347
- database,
24348
- databaseUrl,
24349
- useYalc = false,
24350
- approach,
24351
- templateSource
24352
- } = options;
24353
- if (targetDir !== process.cwd() && await import_fs_extra11.default.pathExists(targetDir)) {
24354
- throw new Error(
24355
- `Directory "${path17__default.default.basename(targetDir)}" already exists. Please choose a different name.`
24356
- );
24524
+ async function emptyDirectory(dir) {
24525
+ if (!await import_fs_extra12.default.pathExists(dir)) return;
24526
+ for (const entry of await import_fs_extra12.default.readdir(dir)) {
24527
+ if (entry === ".git") continue;
24528
+ await import_fs_extra12.default.remove(path14__default.default.join(dir, entry));
24357
24529
  }
24358
- let baseDir;
24359
- let typeDir;
24360
- if (templateSource) {
24361
- baseDir = templateSource.basePath;
24362
- typeDir = templateSource.templatePath;
24363
- } else {
24364
- const templatesRoot = resolveTemplatePath();
24365
- baseDir = path17__default.default.join(templatesRoot, "base");
24366
- typeDir = path17__default.default.join(templatesRoot, projectType);
24367
- }
24368
- if (!await import_fs_extra11.default.pathExists(baseDir)) {
24369
- throw new Error(
24370
- `Base template not found at ${baseDir}. The package may be corrupted or the download failed.`
24371
- );
24372
- }
24373
- if (!await import_fs_extra11.default.pathExists(typeDir)) {
24374
- throw new Error(
24375
- `Template "${projectType}" not found at ${typeDir}. Available templates: blank, blog.`
24376
- );
24377
- }
24378
- await import_fs_extra11.default.copy(baseDir, targetDir, {
24379
- filter: (_src) => {
24380
- const basename = path17__default.default.basename(_src);
24381
- return !SKIP_FILES.has(basename);
24382
- }
24383
- });
24384
- const templateSrcDir = path17__default.default.join(typeDir, "src");
24385
- if (await import_fs_extra11.default.pathExists(templateSrcDir)) {
24386
- await import_fs_extra11.default.copy(templateSrcDir, path17__default.default.join(targetDir, "src"), {
24387
- overwrite: true,
24388
- filter: (_src) => {
24389
- const basename = path17__default.default.basename(_src);
24390
- return !SKIP_FILES.has(basename);
24391
- }
24392
- });
24393
- }
24394
- const templateRootConfig = path17__default.default.join(typeDir, "nextly.config.ts");
24395
- if (await import_fs_extra11.default.pathExists(templateRootConfig)) {
24396
- await import_fs_extra11.default.copy(
24397
- templateRootConfig,
24398
- path17__default.default.join(targetDir, "nextly.config.ts"),
24399
- { overwrite: true }
24400
- );
24401
- }
24402
- const configsDir = path17__default.default.join(typeDir, "configs");
24403
- if (approach && await import_fs_extra11.default.pathExists(configsDir)) {
24404
- const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
24405
- const configSrc = path17__default.default.join(configsDir, configFileName);
24406
- if (await import_fs_extra11.default.pathExists(configSrc)) {
24407
- await import_fs_extra11.default.copy(configSrc, path17__default.default.join(targetDir, "nextly.config.ts"), {
24408
- overwrite: true
24409
- });
24410
- }
24411
- const sharedSrc = path17__default.default.join(configsDir, "shared.ts");
24412
- if (await import_fs_extra11.default.pathExists(sharedSrc)) {
24413
- await import_fs_extra11.default.copy(sharedSrc, path17__default.default.join(targetDir, "shared.ts"), {
24414
- overwrite: true
24415
- });
24416
- }
24417
- }
24418
- const frontendPagePath = path17__default.default.join(
24419
- targetDir,
24420
- "src",
24421
- "app",
24422
- "(frontend)",
24423
- "page.tsx"
24424
- );
24425
- const basePagePath = path17__default.default.join(targetDir, "src", "app", "page.tsx");
24426
- if (await import_fs_extra11.default.pathExists(frontendPagePath) && await import_fs_extra11.default.pathExists(basePagePath)) {
24427
- await import_fs_extra11.default.remove(basePagePath);
24428
- }
24429
- const packageJsonContent = await generatePackageJson(
24430
- projectName,
24431
- database,
24432
- useYalc
24433
- );
24434
- await import_fs_extra11.default.writeFile(
24435
- path17__default.default.join(targetDir, "package.json"),
24436
- packageJsonContent,
24437
- "utf-8"
24438
- );
24439
- if (database.type === "sqlite") {
24440
- await import_fs_extra11.default.ensureDir(path17__default.default.join(targetDir, "data"));
24441
- }
24442
- const placeholders = buildPlaceholderMap({ database, databaseUrl });
24443
- if (approach) {
24444
- placeholders["{{approach}}"] = approach;
24445
- }
24446
- await replacePlaceholders(targetDir, placeholders);
24447
24530
  }
24448
24531
 
24449
24532
  // src/create-nextly.ts
24533
+ function cwdProjectName(cwd) {
24534
+ const basename = path14__default.default.basename(cwd);
24535
+ if (!/^[a-z0-9][a-z0-9._-]*$/.test(basename)) {
24536
+ return DEFAULT_PROJECT_NAME;
24537
+ }
24538
+ return basename;
24539
+ }
24450
24540
  async function createNextly(options = {}) {
24451
24541
  const {
24452
24542
  defaults = false,
24453
24543
  skipInstall = false,
24454
- useYalc = false,
24455
- installInCwd = false
24544
+ useYalc = false
24456
24545
  } = options;
24546
+ let installInCwd = options.installInCwd ?? false;
24457
24547
  let { cwd = process.cwd() } = options;
24458
24548
  let isFreshProject = false;
24459
24549
  let projectName;
@@ -24474,33 +24564,44 @@ async function createNextly(options = {}) {
24474
24564
  }
24475
24565
  }
24476
24566
  } else if (installInCwd) {
24477
- projectName = path17__default.default.basename(cwd);
24567
+ projectName = cwdProjectName(cwd);
24478
24568
  isFreshProject = true;
24479
24569
  } else {
24480
24570
  if (options.projectNameFromArg) {
24481
24571
  projectName = options.projectNameFromArg;
24482
24572
  } else if (!defaults) {
24483
- const name = await Zt({
24484
- message: "What should your project be called?",
24485
- placeholder: "my-nextly-app",
24486
- defaultValue: "my-nextly-app",
24487
- validate: (value) => {
24488
- if (!value || !value.trim()) return void 0;
24489
- if (!/^[a-z0-9][a-z0-9._-]*$/.test(value)) {
24490
- return "Use lowercase letters, numbers, hyphens, dots, or underscores";
24491
- }
24492
- }
24493
- });
24494
- if (Ct(name)) {
24573
+ const result = await promptForProjectName();
24574
+ if (result.kind === "cancelled") {
24495
24575
  Nt("Cancelled.");
24496
24576
  return;
24497
24577
  }
24498
- projectName = name;
24578
+ if (result.value.installInCwd) {
24579
+ installInCwd = true;
24580
+ projectName = cwdProjectName(cwd);
24581
+ } else {
24582
+ projectName = result.value.projectName ?? DEFAULT_PROJECT_NAME;
24583
+ }
24499
24584
  } else {
24500
- projectName = "my-nextly-app";
24585
+ projectName = DEFAULT_PROJECT_NAME;
24501
24586
  }
24502
24587
  isFreshProject = true;
24503
24588
  }
24589
+ let allowExistingTarget = false;
24590
+ if (isFreshProject && projectName) {
24591
+ const conflictTargetDir = installInCwd ? cwd : path14__default.default.join(cwd, projectName);
24592
+ if (await isDirectoryNotEmpty(conflictTargetDir)) {
24593
+ const targetLabel = installInCwd ? "the current directory" : `"${projectName}"`;
24594
+ const choice = await promptDirectoryConflict(targetLabel);
24595
+ if (choice === "cancel") {
24596
+ Nt("Cancelled. No changes were made.");
24597
+ return;
24598
+ }
24599
+ allowExistingTarget = true;
24600
+ if (choice === "remove") {
24601
+ await emptyDirectory(conflictTargetDir);
24602
+ }
24603
+ }
24604
+ }
24504
24605
  let projectType;
24505
24606
  if (options.projectType) {
24506
24607
  projectType = options.projectType;
@@ -24592,6 +24693,7 @@ async function createNextly(options = {}) {
24592
24693
  databaseUrl = url?.trim() || database.connectionUrl;
24593
24694
  }
24594
24695
  if (isFreshProject && projectName) {
24696
+ const targetDir = installInCwd ? cwd : path14__default.default.join(cwd, projectName);
24595
24697
  const s3 = be();
24596
24698
  let templateSource;
24597
24699
  try {
@@ -24606,47 +24708,29 @@ async function createNextly(options = {}) {
24606
24708
  } else {
24607
24709
  s3.start("Scaffolding project...");
24608
24710
  }
24609
- const targetDir = installInCwd ? cwd : path17__default.default.join(cwd, projectName);
24610
- if (installInCwd) {
24611
- const entries = await import_fs_extra12.default.readdir(cwd);
24612
- const nonHidden = entries.filter((e) => !e.startsWith("."));
24613
- if (nonHidden.length > 0) {
24614
- s3.stop("Directory not empty");
24615
- Nt(
24616
- "Directory is not empty. Remove existing files or use a project name to create a subdirectory."
24617
- );
24618
- return;
24619
- }
24620
- await copyTemplate({
24621
- projectName,
24622
- projectType,
24623
- targetDir: cwd,
24624
- database,
24625
- databaseUrl,
24626
- useYalc,
24627
- approach,
24628
- templateSource
24629
- });
24630
- } else {
24631
- await copyTemplate({
24632
- projectName,
24633
- projectType,
24634
- targetDir,
24635
- database,
24636
- databaseUrl,
24637
- useYalc,
24638
- approach,
24639
- templateSource
24640
- });
24641
- cwd = targetDir;
24642
- }
24711
+ await copyTemplate({
24712
+ projectName,
24713
+ projectType,
24714
+ targetDir,
24715
+ database,
24716
+ databaseUrl,
24717
+ useYalc,
24718
+ approach,
24719
+ templateSource,
24720
+ // Suppress copyTemplate's "directory already exists" guard when the
24721
+ // installer has already negotiated the conflict with the user
24722
+ // (either by emptying the dir or accepting an overlay). Without
24723
+ // this, the "ignore" path would still throw on the subdirectory
24724
+ // case where the target was non-empty.
24725
+ allowExistingTarget
24726
+ });
24727
+ if (!installInCwd) cwd = targetDir;
24643
24728
  s3.stop("Project scaffolded");
24644
24729
  } catch (error) {
24645
24730
  s3.stop("Scaffolding failed");
24646
- if (!installInCwd) {
24647
- const targetDir = path17__default.default.join(cwd, projectName);
24648
- if (await import_fs_extra12.default.pathExists(targetDir)) {
24649
- await import_fs_extra12.default.remove(targetDir);
24731
+ if (!installInCwd && !allowExistingTarget) {
24732
+ if (await import_fs_extra13.default.pathExists(targetDir)) {
24733
+ await import_fs_extra13.default.remove(targetDir);
24650
24734
  }
24651
24735
  }
24652
24736
  capture("scaffold_failed", {
@@ -24686,7 +24770,8 @@ async function createNextly(options = {}) {
24686
24770
  projectInfo,
24687
24771
  database,
24688
24772
  useYalc,
24689
- isFreshProject
24773
+ isFreshProject,
24774
+ projectType
24690
24775
  );
24691
24776
  s3.stop("Dependencies installed");
24692
24777
  capture("install_completed", {