create-nextly-app 0.0.2-alpha.2 → 0.0.2-alpha.20
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/{chunk-AYJ2RKVJ.mjs → chunk-6HFD2Q2U.mjs} +1021 -904
- package/dist/chunk-6HFD2Q2U.mjs.map +1 -0
- package/dist/cli.cjs +1040 -925
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +24 -27
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +1058 -939
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/templates/base/next.config.ts +11 -17
- package/templates/base/src/app/admin/[[...params]]/page.tsx +0 -9
- package/dist/chunk-AYJ2RKVJ.mjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var module$1 = require('module');
|
|
4
|
-
var
|
|
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
|
|
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(
|
|
200
|
+
function patch(fs16) {
|
|
201
201
|
if (constants4.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
202
|
-
patchLchmod(
|
|
203
|
-
}
|
|
204
|
-
if (!
|
|
205
|
-
patchLutimes(
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (
|
|
226
|
-
|
|
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
|
-
|
|
229
|
+
fs16.lchmodSync = function() {
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
-
if (
|
|
233
|
-
|
|
232
|
+
if (fs16.chown && !fs16.lchown) {
|
|
233
|
+
fs16.lchown = function(path21, uid, gid, cb) {
|
|
234
234
|
if (cb) process.nextTick(cb);
|
|
235
235
|
};
|
|
236
|
-
|
|
236
|
+
fs16.lchownSync = function() {
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
239
|
if (platform3 === "win32") {
|
|
240
|
-
|
|
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
|
-
|
|
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
|
-
})(
|
|
263
|
+
})(fs16.rename);
|
|
264
264
|
}
|
|
265
|
-
|
|
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(
|
|
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(
|
|
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
|
-
})(
|
|
283
|
-
|
|
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(
|
|
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
|
-
})(
|
|
299
|
-
function patchLchmod(
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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
|
-
|
|
311
|
-
|
|
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
|
-
|
|
319
|
-
var fd =
|
|
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 =
|
|
323
|
+
ret = fs17.fchmodSync(fd, mode);
|
|
324
324
|
threw = false;
|
|
325
325
|
} finally {
|
|
326
326
|
if (threw) {
|
|
327
327
|
try {
|
|
328
|
-
|
|
328
|
+
fs17.closeSync(fd);
|
|
329
329
|
} catch (er2) {
|
|
330
330
|
}
|
|
331
331
|
} else {
|
|
332
|
-
|
|
332
|
+
fs17.closeSync(fd);
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
return ret;
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
|
-
function patchLutimes(
|
|
339
|
-
if (constants4.hasOwnProperty("O_SYMLINK") &&
|
|
340
|
-
|
|
341
|
-
|
|
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
|
-
|
|
347
|
-
|
|
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
|
-
|
|
354
|
-
var fd =
|
|
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 =
|
|
358
|
+
ret = fs17.futimesSync(fd, at3, mt4);
|
|
359
359
|
threw = false;
|
|
360
360
|
} finally {
|
|
361
361
|
if (threw) {
|
|
362
362
|
try {
|
|
363
|
-
|
|
363
|
+
fs17.closeSync(fd);
|
|
364
364
|
} catch (er2) {
|
|
365
365
|
}
|
|
366
366
|
} else {
|
|
367
|
-
|
|
367
|
+
fs17.closeSync(fd);
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
return ret;
|
|
371
371
|
};
|
|
372
|
-
} else if (
|
|
373
|
-
|
|
372
|
+
} else if (fs17.futimes) {
|
|
373
|
+
fs17.lutimes = function(_a, _b, _c, cb) {
|
|
374
374
|
if (cb) process.nextTick(cb);
|
|
375
375
|
};
|
|
376
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
467
|
+
function legacy(fs16) {
|
|
468
468
|
return {
|
|
469
469
|
ReadStream,
|
|
470
470
|
WriteStream
|
|
471
471
|
};
|
|
472
|
-
function ReadStream(
|
|
473
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
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 =
|
|
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
|
-
|
|
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(
|
|
522
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
521
|
+
function WriteStream(path21, options) {
|
|
522
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path21, options);
|
|
523
523
|
Stream.call(this);
|
|
524
|
-
this.path =
|
|
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 =
|
|
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
|
|
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 (!
|
|
615
|
+
if (!fs16[gracefulQueue]) {
|
|
616
616
|
queue = global[gracefulQueue] || [];
|
|
617
|
-
publishQueue(
|
|
618
|
-
|
|
617
|
+
publishQueue(fs16, queue);
|
|
618
|
+
fs16.close = (function(fs$close) {
|
|
619
619
|
function close(fd, cb) {
|
|
620
|
-
return fs$close.call(
|
|
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
|
-
})(
|
|
633
|
-
|
|
632
|
+
})(fs16.close);
|
|
633
|
+
fs16.closeSync = (function(fs$closeSync) {
|
|
634
634
|
function closeSync(fd) {
|
|
635
|
-
fs$closeSync.apply(
|
|
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
|
-
})(
|
|
642
|
+
})(fs16.closeSync);
|
|
643
643
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
644
644
|
process.on("exit", function() {
|
|
645
|
-
debug(
|
|
646
|
-
__require("assert").equal(
|
|
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,
|
|
653
|
-
}
|
|
654
|
-
module.exports = patch(clone(
|
|
655
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
656
|
-
module.exports = patch(
|
|
657
|
-
|
|
658
|
-
}
|
|
659
|
-
function patch(
|
|
660
|
-
polyfills(
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
var fs$readFile =
|
|
665
|
-
|
|
666
|
-
function readFile(
|
|
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(
|
|
670
|
-
function go$readFile(
|
|
671
|
-
return fs$readFile(
|
|
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, [
|
|
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 =
|
|
682
|
-
|
|
683
|
-
function writeFile(
|
|
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(
|
|
687
|
-
function go$writeFile(
|
|
688
|
-
return fs$writeFile(
|
|
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, [
|
|
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 =
|
|
698
|
+
var fs$appendFile = fs17.appendFile;
|
|
699
699
|
if (fs$appendFile)
|
|
700
|
-
|
|
701
|
-
function appendFile(
|
|
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(
|
|
705
|
-
function go$appendFile(
|
|
706
|
-
return fs$appendFile(
|
|
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, [
|
|
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 =
|
|
716
|
+
var fs$copyFile = fs17.copyFile;
|
|
717
717
|
if (fs$copyFile)
|
|
718
|
-
|
|
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 =
|
|
737
|
-
|
|
736
|
+
var fs$readdir = fs17.readdir;
|
|
737
|
+
fs17.readdir = readdir;
|
|
738
738
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
739
|
-
function readdir(
|
|
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(
|
|
743
|
-
return fs$readdir(
|
|
744
|
-
|
|
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(
|
|
750
|
-
return fs$readdir(
|
|
751
|
-
|
|
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(
|
|
758
|
-
function fs$readdirCallback(
|
|
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
|
-
[
|
|
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(
|
|
778
|
+
var legStreams = legacy(fs17);
|
|
779
779
|
ReadStream = legStreams.ReadStream;
|
|
780
780
|
WriteStream = legStreams.WriteStream;
|
|
781
781
|
}
|
|
782
|
-
var fs$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 =
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
873
|
-
return new
|
|
872
|
+
function createReadStream3(path21, options) {
|
|
873
|
+
return new fs17.ReadStream(path21, options);
|
|
874
874
|
}
|
|
875
|
-
function createWriteStream2(
|
|
876
|
-
return new
|
|
875
|
+
function createWriteStream2(path21, options) {
|
|
876
|
+
return new fs17.WriteStream(path21, options);
|
|
877
877
|
}
|
|
878
|
-
var fs$open =
|
|
879
|
-
|
|
880
|
-
function open(
|
|
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(
|
|
884
|
-
function go$open(
|
|
885
|
-
return fs$open(
|
|
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, [
|
|
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
|
|
895
|
+
return fs17;
|
|
896
896
|
}
|
|
897
897
|
function enqueue(elem) {
|
|
898
898
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
899
|
-
|
|
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 <
|
|
906
|
-
if (
|
|
907
|
-
|
|
908
|
-
|
|
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 (
|
|
916
|
+
if (fs16[gracefulQueue].length === 0)
|
|
917
917
|
return;
|
|
918
|
-
var elem =
|
|
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
|
-
|
|
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
|
|
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
|
|
995
|
+
return typeof fs16[key] === "function";
|
|
996
996
|
});
|
|
997
|
-
Object.assign(exports$1,
|
|
997
|
+
Object.assign(exports$1, fs16);
|
|
998
998
|
api.forEach((method) => {
|
|
999
|
-
exports$1[method] = u3(
|
|
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
|
|
1003
|
+
return fs16.exists(filename, callback);
|
|
1004
1004
|
}
|
|
1005
1005
|
return new Promise((resolve) => {
|
|
1006
|
-
return
|
|
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
|
|
1011
|
+
return fs16.read(fd, buffer, offset, length, position, callback);
|
|
1012
1012
|
}
|
|
1013
1013
|
return new Promise((resolve, reject) => {
|
|
1014
|
-
|
|
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
|
|
1022
|
+
return fs16.write(fd, buffer, ...args);
|
|
1023
1023
|
}
|
|
1024
1024
|
return new Promise((resolve, reject) => {
|
|
1025
|
-
|
|
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
|
|
1033
|
+
return fs16.readv(fd, buffers, ...args);
|
|
1034
1034
|
}
|
|
1035
1035
|
return new Promise((resolve, reject) => {
|
|
1036
|
-
|
|
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
|
|
1044
|
+
return fs16.writev(fd, buffers, ...args);
|
|
1045
1045
|
}
|
|
1046
1046
|
return new Promise((resolve, reject) => {
|
|
1047
|
-
|
|
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
|
|
1054
|
-
exports$1.realpath.native = u3(
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1132
|
-
function pathExists(
|
|
1133
|
-
return
|
|
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:
|
|
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
|
|
1145
|
+
var fs16 = require_fs();
|
|
1146
1146
|
var u3 = require_universalify().fromPromise;
|
|
1147
|
-
async function utimesMillis(
|
|
1148
|
-
const fd = await
|
|
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
|
|
1151
|
+
await fs16.futimes(fd, atime, mtime);
|
|
1152
1152
|
} finally {
|
|
1153
1153
|
try {
|
|
1154
|
-
await
|
|
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(
|
|
1164
|
-
const fd =
|
|
1165
|
-
|
|
1166
|
-
return
|
|
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
|
|
1179
|
-
var
|
|
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) =>
|
|
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) =>
|
|
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 =
|
|
1208
|
-
const destBaseName =
|
|
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 =
|
|
1231
|
-
const destBaseName =
|
|
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 =
|
|
1251
|
-
const destParent =
|
|
1252
|
-
if (destParent === srcParent || destParent ===
|
|
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
|
|
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 =
|
|
1267
|
-
const destParent =
|
|
1268
|
-
if (destParent === srcParent || destParent ===
|
|
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 =
|
|
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 =
|
|
1286
|
-
const destArr =
|
|
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
|
|
1337
|
-
var
|
|
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 =
|
|
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 ?
|
|
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
|
|
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
|
|
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
|
|
1397
|
+
const updatedSrcStat = await fs16.stat(src);
|
|
1398
1398
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1399
1399
|
}
|
|
1400
|
-
return
|
|
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
|
|
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
|
|
1410
|
+
await fs16.mkdir(dest);
|
|
1411
1411
|
}
|
|
1412
|
-
await asyncIteratorConcurrentProcess(await
|
|
1413
|
-
const srcItem =
|
|
1414
|
-
const destItem =
|
|
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
|
|
1422
|
+
await fs16.chmod(dest, srcStat.mode);
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
1425
|
async function onLink(destStat, src, dest, opts) {
|
|
1426
|
-
let resolvedSrc = await
|
|
1426
|
+
let resolvedSrc = await fs16.readlink(src);
|
|
1427
1427
|
if (opts.dereference) {
|
|
1428
|
-
resolvedSrc =
|
|
1428
|
+
resolvedSrc = path21.resolve(process.cwd(), resolvedSrc);
|
|
1429
1429
|
}
|
|
1430
1430
|
if (!destStat) {
|
|
1431
|
-
return
|
|
1431
|
+
return fs16.symlink(resolvedSrc, dest);
|
|
1432
1432
|
}
|
|
1433
1433
|
let resolvedDest = null;
|
|
1434
1434
|
try {
|
|
1435
|
-
resolvedDest = await
|
|
1435
|
+
resolvedDest = await fs16.readlink(dest);
|
|
1436
1436
|
} catch (e) {
|
|
1437
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
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 =
|
|
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
|
|
1450
|
-
return
|
|
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
|
|
1460
|
-
var
|
|
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 =
|
|
1482
|
-
if (!
|
|
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 ?
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
1523
|
+
return fs16.chmodSync(dest, srcMode);
|
|
1524
1524
|
}
|
|
1525
1525
|
function setDestTimestamps(src, dest) {
|
|
1526
|
-
const updatedSrcStat =
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
1551
|
-
const destItem =
|
|
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 =
|
|
1557
|
+
let resolvedSrc = fs16.readlinkSync(src);
|
|
1558
1558
|
if (opts.dereference) {
|
|
1559
|
-
resolvedSrc =
|
|
1559
|
+
resolvedSrc = path21.resolve(process.cwd(), resolvedSrc);
|
|
1560
1560
|
}
|
|
1561
1561
|
if (!destStat) {
|
|
1562
|
-
return
|
|
1562
|
+
return fs16.symlinkSync(resolvedSrc, dest);
|
|
1563
1563
|
} else {
|
|
1564
1564
|
let resolvedDest;
|
|
1565
1565
|
try {
|
|
1566
|
-
resolvedDest =
|
|
1566
|
+
resolvedDest = fs16.readlinkSync(dest);
|
|
1567
1567
|
} catch (err) {
|
|
1568
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
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 =
|
|
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
|
-
|
|
1585
|
-
return
|
|
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
|
|
1605
|
+
var fs16 = require_graceful_fs();
|
|
1606
1606
|
var u3 = require_universalify().fromCallback;
|
|
1607
|
-
function remove(
|
|
1608
|
-
|
|
1607
|
+
function remove(path21, callback) {
|
|
1608
|
+
fs16.rm(path21, { recursive: true, force: true }, callback);
|
|
1609
1609
|
}
|
|
1610
|
-
function removeSync(
|
|
1611
|
-
|
|
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
|
|
1625
|
-
var
|
|
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
|
|
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(
|
|
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 =
|
|
1640
|
+
items = fs16.readdirSync(dir);
|
|
1641
1641
|
} catch {
|
|
1642
1642
|
return mkdir.mkdirsSync(dir);
|
|
1643
1643
|
}
|
|
1644
1644
|
items.forEach((item) => {
|
|
1645
|
-
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
|
|
1663
|
-
var
|
|
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
|
|
1668
|
+
stats = await fs16.stat(file);
|
|
1669
1669
|
} catch {
|
|
1670
1670
|
}
|
|
1671
1671
|
if (stats && stats.isFile()) return;
|
|
1672
|
-
const dir =
|
|
1672
|
+
const dir = path21.dirname(file);
|
|
1673
1673
|
let dirStats = null;
|
|
1674
1674
|
try {
|
|
1675
|
-
dirStats = await
|
|
1675
|
+
dirStats = await fs16.stat(dir);
|
|
1676
1676
|
} catch (err) {
|
|
1677
1677
|
if (err.code === "ENOENT") {
|
|
1678
1678
|
await mkdir.mkdirs(dir);
|
|
1679
|
-
await
|
|
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
|
|
1686
|
+
await fs16.writeFile(file, "");
|
|
1687
1687
|
} else {
|
|
1688
|
-
await
|
|
1688
|
+
await fs16.readdir(dir);
|
|
1689
1689
|
}
|
|
1690
1690
|
}
|
|
1691
1691
|
function createFileSync(file) {
|
|
1692
1692
|
let stats;
|
|
1693
1693
|
try {
|
|
1694
|
-
stats =
|
|
1694
|
+
stats = fs16.statSync(file);
|
|
1695
1695
|
} catch {
|
|
1696
1696
|
}
|
|
1697
1697
|
if (stats && stats.isFile()) return;
|
|
1698
|
-
const dir =
|
|
1698
|
+
const dir = path21.dirname(file);
|
|
1699
1699
|
try {
|
|
1700
|
-
if (!
|
|
1701
|
-
|
|
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
|
-
|
|
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
|
|
1721
|
-
var
|
|
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
|
|
1728
|
+
dstStat = await fs16.lstat(dstpath);
|
|
1729
1729
|
} catch {
|
|
1730
1730
|
}
|
|
1731
1731
|
let srcStat;
|
|
1732
1732
|
try {
|
|
1733
|
-
srcStat = await
|
|
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 =
|
|
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
|
|
1744
|
+
await fs16.link(srcpath, dstpath);
|
|
1745
1745
|
}
|
|
1746
1746
|
function createLinkSync(srcpath, dstpath) {
|
|
1747
1747
|
let dstStat;
|
|
1748
1748
|
try {
|
|
1749
|
-
dstStat =
|
|
1749
|
+
dstStat = fs16.lstatSync(dstpath);
|
|
1750
1750
|
} catch {
|
|
1751
1751
|
}
|
|
1752
1752
|
try {
|
|
1753
|
-
const srcStat =
|
|
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 =
|
|
1760
|
-
const dirExists =
|
|
1761
|
-
if (dirExists) return
|
|
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
|
|
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
|
|
1776
|
-
var
|
|
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 (
|
|
1780
|
+
if (path21.isAbsolute(srcpath)) {
|
|
1781
1781
|
try {
|
|
1782
|
-
await
|
|
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 =
|
|
1793
|
-
const relativeToDst =
|
|
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
|
|
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:
|
|
1809
|
+
toDst: path21.relative(dstdir, srcpath)
|
|
1810
1810
|
};
|
|
1811
1811
|
}
|
|
1812
1812
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
1813
|
-
if (
|
|
1814
|
-
const exists2 =
|
|
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 =
|
|
1822
|
-
const relativeToDst =
|
|
1823
|
-
const exists =
|
|
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 =
|
|
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:
|
|
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
|
|
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
|
|
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 =
|
|
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
|
|
1881
|
-
var
|
|
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
|
|
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
|
-
|
|
1896
|
-
|
|
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 =
|
|
1903
|
+
const dir = path21.dirname(dstpath);
|
|
1904
1904
|
if (!await pathExists(dir)) {
|
|
1905
1905
|
await mkdirs(dir);
|
|
1906
1906
|
}
|
|
1907
|
-
return
|
|
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 =
|
|
1912
|
+
stats = fs16.lstatSync(dstpath);
|
|
1913
1913
|
} catch {
|
|
1914
1914
|
}
|
|
1915
1915
|
if (stats && stats.isSymbolicLink()) {
|
|
1916
|
-
const srcStat =
|
|
1917
|
-
const dstStat =
|
|
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 =
|
|
1924
|
-
const exists =
|
|
1925
|
-
if (exists) return
|
|
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
|
|
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
|
|
1993
|
+
const fs16 = options.fs || _fs;
|
|
1994
1994
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
1995
|
-
let data = await universalify.fromCallback(
|
|
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
|
|
2015
|
+
const fs16 = options.fs || _fs;
|
|
2016
2016
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
2017
2017
|
try {
|
|
2018
|
-
let content =
|
|
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
|
|
2031
|
+
const fs16 = options.fs || _fs;
|
|
2032
2032
|
const str = stringify(obj, options);
|
|
2033
|
-
await universalify.fromCallback(
|
|
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
|
|
2037
|
+
const fs16 = options.fs || _fs;
|
|
2038
2038
|
const str = stringify(obj, options);
|
|
2039
|
-
return
|
|
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
|
|
2069
|
-
var
|
|
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 =
|
|
2073
|
+
const dir = path21.dirname(file);
|
|
2074
2074
|
if (!await pathExists(dir)) {
|
|
2075
2075
|
await mkdir.mkdirs(dir);
|
|
2076
2076
|
}
|
|
2077
|
-
return
|
|
2077
|
+
return fs16.writeFile(file, data, encoding);
|
|
2078
2078
|
}
|
|
2079
2079
|
function outputFileSync(file, ...args) {
|
|
2080
|
-
const dir =
|
|
2081
|
-
if (!
|
|
2080
|
+
const dir = path21.dirname(file);
|
|
2081
|
+
if (!fs16.existsSync(dir)) {
|
|
2082
2082
|
mkdir.mkdirsSync(dir);
|
|
2083
2083
|
}
|
|
2084
|
-
|
|
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
|
|
2140
|
-
var
|
|
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 =
|
|
2151
|
-
const parsedParentPath =
|
|
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
|
|
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
|
|
2191
|
-
var
|
|
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(
|
|
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 =
|
|
2206
|
-
const parsedPath =
|
|
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 (
|
|
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
|
-
|
|
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
|
|
2348
|
-
function checkPathExt(
|
|
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 &&
|
|
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,
|
|
2365
|
+
function checkStat(stat, path21, options) {
|
|
2366
2366
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
2367
2367
|
return false;
|
|
2368
2368
|
}
|
|
2369
|
-
return checkPathExt(
|
|
2369
|
+
return checkPathExt(path21, options);
|
|
2370
2370
|
}
|
|
2371
|
-
function isexe(
|
|
2372
|
-
|
|
2373
|
-
cb(er2, er2 ? false : checkStat(stat,
|
|
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(
|
|
2377
|
-
return checkStat(
|
|
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
|
|
2388
|
-
function isexe(
|
|
2389
|
-
|
|
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(
|
|
2394
|
-
return checkStat(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
2456
|
+
function sync(path21, options) {
|
|
2457
2457
|
try {
|
|
2458
|
-
return core.sync(
|
|
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
|
|
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 =
|
|
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 =
|
|
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
|
|
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 ?
|
|
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 =
|
|
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 [
|
|
2664
|
-
const binary =
|
|
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
|
|
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 =
|
|
2684
|
-
|
|
2685
|
-
|
|
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
|
|
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 =
|
|
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] ?
|
|
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 } =
|
|
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 =
|
|
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
|
|
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 =
|
|
14098
|
-
const pagePath =
|
|
14099
|
-
const layoutPath =
|
|
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 =
|
|
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 =
|
|
14184
|
-
const envExamplePath =
|
|
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,50 +14242,70 @@ 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 =
|
|
14249
|
-
const mediaDir =
|
|
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 =
|
|
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(
|
|
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 =
|
|
14266
|
-
await import_fs_extra4.default.ensureDir(
|
|
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
|
|
|
14270
14267
|
// src/generators/next-config.ts
|
|
14271
14268
|
var import_fs_extra5 = __toESM(require_lib());
|
|
14272
|
-
var
|
|
14269
|
+
var COMMON_SERVER_EXTERNAL_PACKAGES = [
|
|
14273
14270
|
"nextly",
|
|
14274
14271
|
"@nextlyhq/adapter-drizzle",
|
|
14275
|
-
"@nextlyhq/adapter-postgres",
|
|
14276
|
-
"@nextlyhq/adapter-mysql",
|
|
14277
|
-
"@nextlyhq/adapter-sqlite",
|
|
14278
14272
|
"drizzle-orm",
|
|
14279
14273
|
"drizzle-kit",
|
|
14280
|
-
"pg",
|
|
14281
|
-
"mysql2",
|
|
14282
|
-
"better-sqlite3",
|
|
14283
14274
|
"bcryptjs",
|
|
14284
14275
|
"sharp",
|
|
14285
14276
|
"esbuild"
|
|
14286
14277
|
];
|
|
14287
|
-
|
|
14278
|
+
var DATABASE_SERVER_EXTERNAL_PACKAGES = {
|
|
14279
|
+
postgresql: ["@nextlyhq/adapter-postgres", "pg"],
|
|
14280
|
+
mysql: ["@nextlyhq/adapter-mysql", "mysql2"],
|
|
14281
|
+
sqlite: ["@nextlyhq/adapter-sqlite", "better-sqlite3"]
|
|
14282
|
+
};
|
|
14283
|
+
function getServerExternalPackages(database) {
|
|
14284
|
+
return [
|
|
14285
|
+
...COMMON_SERVER_EXTERNAL_PACKAGES,
|
|
14286
|
+
...DATABASE_SERVER_EXTERNAL_PACKAGES[database.type]
|
|
14287
|
+
];
|
|
14288
|
+
}
|
|
14289
|
+
function buildNextConfigTemplate(database) {
|
|
14290
|
+
const packagesArray = JSON.stringify(
|
|
14291
|
+
getServerExternalPackages(database),
|
|
14292
|
+
null,
|
|
14293
|
+
2
|
|
14294
|
+
).replace(/\n/g, "\n ");
|
|
14295
|
+
return `import type { NextConfig } from "next";
|
|
14296
|
+
|
|
14297
|
+
const nextConfig: NextConfig = {
|
|
14298
|
+
serverExternalPackages: ${packagesArray},
|
|
14299
|
+
};
|
|
14300
|
+
|
|
14301
|
+
export default nextConfig;
|
|
14302
|
+
`;
|
|
14303
|
+
}
|
|
14304
|
+
async function patchNextConfig(cwd, database) {
|
|
14288
14305
|
const candidates = ["next.config.ts", "next.config.mjs", "next.config.js"];
|
|
14289
14306
|
let configPath = null;
|
|
14290
14307
|
for (const name of candidates) {
|
|
14291
|
-
const full =
|
|
14308
|
+
const full = path14__default.default.join(cwd, name);
|
|
14292
14309
|
if (await import_fs_extra5.default.pathExists(full)) {
|
|
14293
14310
|
configPath = full;
|
|
14294
14311
|
break;
|
|
@@ -14301,7 +14318,11 @@ async function patchNextConfig(cwd) {
|
|
|
14301
14318
|
if (content.includes("serverExternalPackages")) {
|
|
14302
14319
|
return;
|
|
14303
14320
|
}
|
|
14304
|
-
const packagesArray = JSON.stringify(
|
|
14321
|
+
const packagesArray = JSON.stringify(
|
|
14322
|
+
getServerExternalPackages(database),
|
|
14323
|
+
null,
|
|
14324
|
+
2
|
|
14325
|
+
).replace(/\n/g, "\n ");
|
|
14305
14326
|
const configObjectPattern = /(const\s+\w+\s*(?::\s*NextConfig\s*)?=\s*\{)/;
|
|
14306
14327
|
if (configObjectPattern.test(content)) {
|
|
14307
14328
|
const patched = content.replace(
|
|
@@ -14341,7 +14362,7 @@ export const DELETE = handlers.DELETE;
|
|
|
14341
14362
|
export const OPTIONS = handlers.OPTIONS;
|
|
14342
14363
|
`;
|
|
14343
14364
|
async function generateRoutes(cwd, projectInfo) {
|
|
14344
|
-
const routePath =
|
|
14365
|
+
const routePath = path14__default.default.join(
|
|
14345
14366
|
cwd,
|
|
14346
14367
|
projectInfo.appDir,
|
|
14347
14368
|
"admin",
|
|
@@ -14354,7 +14375,7 @@ async function generateRoutes(cwd, projectInfo) {
|
|
|
14354
14375
|
"API route already exists at admin/api/[[...params]]/route.ts"
|
|
14355
14376
|
);
|
|
14356
14377
|
}
|
|
14357
|
-
await import_fs_extra6.default.ensureDir(
|
|
14378
|
+
await import_fs_extra6.default.ensureDir(path14__default.default.dirname(routePath));
|
|
14358
14379
|
await import_fs_extra6.default.writeFile(routePath, API_ROUTE_TEMPLATE, "utf-8");
|
|
14359
14380
|
}
|
|
14360
14381
|
|
|
@@ -14362,13 +14383,13 @@ async function generateRoutes(cwd, projectInfo) {
|
|
|
14362
14383
|
var import_fs_extra7 = __toESM(require_lib());
|
|
14363
14384
|
async function generateTypesDirectory(cwd, projectInfo) {
|
|
14364
14385
|
const baseDir = projectInfo.srcDir ? "src" : ".";
|
|
14365
|
-
const typesDir =
|
|
14386
|
+
const typesDir = path14__default.default.join(cwd, baseDir, "types", "generated");
|
|
14366
14387
|
await import_fs_extra7.default.ensureDir(typesDir);
|
|
14367
|
-
const gitkeepPath =
|
|
14388
|
+
const gitkeepPath = path14__default.default.join(typesDir, ".gitkeep");
|
|
14368
14389
|
if (!await import_fs_extra7.default.pathExists(gitkeepPath)) {
|
|
14369
14390
|
await import_fs_extra7.default.writeFile(gitkeepPath, "", "utf-8");
|
|
14370
14391
|
}
|
|
14371
|
-
const placeholderPath =
|
|
14392
|
+
const placeholderPath = path14__default.default.join(typesDir, "nextly-types.ts");
|
|
14372
14393
|
if (!await import_fs_extra7.default.pathExists(placeholderPath)) {
|
|
14373
14394
|
const placeholderContent = `/**
|
|
14374
14395
|
* Nextly Generated Types
|
|
@@ -15179,12 +15200,12 @@ function toPath(urlOrPath) {
|
|
|
15179
15200
|
function traversePathUp(startPath) {
|
|
15180
15201
|
return {
|
|
15181
15202
|
*[Symbol.iterator]() {
|
|
15182
|
-
let currentPath =
|
|
15203
|
+
let currentPath = path14__default.default.resolve(toPath(startPath));
|
|
15183
15204
|
let previousPath;
|
|
15184
15205
|
while (previousPath !== currentPath) {
|
|
15185
15206
|
yield currentPath;
|
|
15186
15207
|
previousPath = currentPath;
|
|
15187
|
-
currentPath =
|
|
15208
|
+
currentPath = path14__default.default.resolve(currentPath, "..");
|
|
15188
15209
|
}
|
|
15189
15210
|
}
|
|
15190
15211
|
};
|
|
@@ -15198,27 +15219,27 @@ var npmRunPath = ({
|
|
|
15198
15219
|
execPath: execPath2 = process4__default.default.execPath,
|
|
15199
15220
|
addExecPath = true
|
|
15200
15221
|
} = {}) => {
|
|
15201
|
-
const cwdPath =
|
|
15222
|
+
const cwdPath = path14__default.default.resolve(toPath(cwd));
|
|
15202
15223
|
const result = [];
|
|
15203
|
-
const pathParts = pathOption.split(
|
|
15224
|
+
const pathParts = pathOption.split(path14__default.default.delimiter);
|
|
15204
15225
|
if (preferLocal) {
|
|
15205
15226
|
applyPreferLocal(result, pathParts, cwdPath);
|
|
15206
15227
|
}
|
|
15207
15228
|
if (addExecPath) {
|
|
15208
15229
|
applyExecPath(result, pathParts, execPath2, cwdPath);
|
|
15209
15230
|
}
|
|
15210
|
-
return pathOption === "" || pathOption ===
|
|
15231
|
+
return pathOption === "" || pathOption === path14__default.default.delimiter ? `${result.join(path14__default.default.delimiter)}${pathOption}` : [...result, pathOption].join(path14__default.default.delimiter);
|
|
15211
15232
|
};
|
|
15212
15233
|
var applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
15213
15234
|
for (const directory of traversePathUp(cwdPath)) {
|
|
15214
|
-
const pathPart =
|
|
15235
|
+
const pathPart = path14__default.default.join(directory, "node_modules/.bin");
|
|
15215
15236
|
if (!pathParts.includes(pathPart)) {
|
|
15216
15237
|
result.push(pathPart);
|
|
15217
15238
|
}
|
|
15218
15239
|
}
|
|
15219
15240
|
};
|
|
15220
15241
|
var applyExecPath = (result, pathParts, execPath2, cwdPath) => {
|
|
15221
|
-
const pathPart =
|
|
15242
|
+
const pathPart = path14__default.default.resolve(cwdPath, toPath(execPath2), "..");
|
|
15222
15243
|
if (!pathParts.includes(pathPart)) {
|
|
15223
15244
|
result.push(pathPart);
|
|
15224
15245
|
}
|
|
@@ -16351,7 +16372,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
16351
16372
|
throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
|
|
16352
16373
|
}
|
|
16353
16374
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The "nodePath" option');
|
|
16354
|
-
const resolvedNodePath =
|
|
16375
|
+
const resolvedNodePath = path14__default.default.resolve(cwd, normalizedNodePath);
|
|
16355
16376
|
const newOptions = {
|
|
16356
16377
|
...options,
|
|
16357
16378
|
nodePath: resolvedNodePath,
|
|
@@ -16361,7 +16382,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
16361
16382
|
if (!shouldHandleNode) {
|
|
16362
16383
|
return [file, commandArguments, newOptions];
|
|
16363
16384
|
}
|
|
16364
|
-
if (
|
|
16385
|
+
if (path14__default.default.basename(file, ".exe") === "node") {
|
|
16365
16386
|
throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
|
|
16366
16387
|
}
|
|
16367
16388
|
return [
|
|
@@ -16447,7 +16468,7 @@ var ENCODING_ALIASES = {
|
|
|
16447
16468
|
var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding);
|
|
16448
16469
|
var normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
16449
16470
|
const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
|
|
16450
|
-
return
|
|
16471
|
+
return path14__default.default.resolve(cwdString);
|
|
16451
16472
|
};
|
|
16452
16473
|
var getDefaultCwd = () => {
|
|
16453
16474
|
try {
|
|
@@ -16494,7 +16515,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
16494
16515
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
16495
16516
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
16496
16517
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
16497
|
-
if (process4__default.default.platform === "win32" &&
|
|
16518
|
+
if (process4__default.default.platform === "win32" && path14__default.default.basename(file, ".exe") === "cmd") {
|
|
16498
16519
|
commandArguments.unshift("/q");
|
|
16499
16520
|
}
|
|
16500
16521
|
return { file, commandArguments, options };
|
|
@@ -18601,13 +18622,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state: state2, verboseInfo, e
|
|
|
18601
18622
|
}
|
|
18602
18623
|
};
|
|
18603
18624
|
var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
18604
|
-
for (const { path:
|
|
18605
|
-
const pathString = typeof
|
|
18625
|
+
for (const { path: path21, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
|
|
18626
|
+
const pathString = typeof path21 === "string" ? path21 : path21.toString();
|
|
18606
18627
|
if (append || outputFiles.has(pathString)) {
|
|
18607
|
-
u2.appendFileSync(
|
|
18628
|
+
u2.appendFileSync(path21, serializedResult);
|
|
18608
18629
|
} else {
|
|
18609
18630
|
outputFiles.add(pathString);
|
|
18610
|
-
u2.writeFileSync(
|
|
18631
|
+
u2.writeFileSync(path21, serializedResult);
|
|
18611
18632
|
}
|
|
18612
18633
|
}
|
|
18613
18634
|
};
|
|
@@ -20903,85 +20924,412 @@ createExeca(mapNode);
|
|
|
20903
20924
|
createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
|
|
20904
20925
|
getIpcExport();
|
|
20905
20926
|
|
|
20906
|
-
// src/
|
|
20907
|
-
var
|
|
20908
|
-
|
|
20909
|
-
|
|
20910
|
-
|
|
20911
|
-
|
|
20927
|
+
// src/utils/template.ts
|
|
20928
|
+
var import_fs_extra8 = __toESM(require_lib());
|
|
20929
|
+
var PROJECT_TYPES_WITH_FORM_BUILDER = /* @__PURE__ */ new Set([
|
|
20930
|
+
"blog"
|
|
20931
|
+
]);
|
|
20932
|
+
function projectUsesFormBuilder(projectType) {
|
|
20933
|
+
return PROJECT_TYPES_WITH_FORM_BUILDER.has(projectType);
|
|
20934
|
+
}
|
|
20935
|
+
var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
20936
|
+
".ts",
|
|
20937
|
+
".tsx",
|
|
20938
|
+
".js",
|
|
20939
|
+
".jsx",
|
|
20940
|
+
".json",
|
|
20941
|
+
".env",
|
|
20942
|
+
".md",
|
|
20943
|
+
".css",
|
|
20944
|
+
".html",
|
|
20945
|
+
".mjs",
|
|
20946
|
+
".cjs"
|
|
20947
|
+
]);
|
|
20948
|
+
var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
|
|
20949
|
+
function resolveTemplatePath(localTemplatePath) {
|
|
20950
|
+
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))));
|
|
20951
|
+
const fromDist = path14__default.default.resolve(__dirname, "../templates");
|
|
20952
|
+
if (import_fs_extra8.default.existsSync(fromDist)) {
|
|
20953
|
+
return fromDist;
|
|
20954
|
+
}
|
|
20955
|
+
const fromSrc = path14__default.default.resolve(__dirname, "../../templates");
|
|
20956
|
+
if (import_fs_extra8.default.existsSync(fromSrc)) {
|
|
20957
|
+
return fromSrc;
|
|
20958
|
+
}
|
|
20959
|
+
throw new Error(
|
|
20960
|
+
"Could not find templates directory. Use --local-template to specify the templates path, or ensure templates are bundled."
|
|
20961
|
+
);
|
|
20962
|
+
}
|
|
20963
|
+
function buildPlaceholderMap(options) {
|
|
20964
|
+
const { database, databaseUrl } = options;
|
|
20965
|
+
return {
|
|
20966
|
+
"{{databaseDialect}}": database.type,
|
|
20967
|
+
"{{databaseUrl}}": databaseUrl || database.envExample
|
|
20968
|
+
};
|
|
20969
|
+
}
|
|
20970
|
+
async function replacePlaceholdersInFile(filePath, placeholders) {
|
|
20971
|
+
const ext = path14__default.default.extname(filePath).toLowerCase();
|
|
20972
|
+
const basename = path14__default.default.basename(filePath);
|
|
20973
|
+
const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
|
|
20974
|
+
if (!isTextFile) return;
|
|
20975
|
+
let content = await import_fs_extra8.default.readFile(filePath, "utf-8");
|
|
20976
|
+
let changed = false;
|
|
20977
|
+
for (const [placeholder, value] of Object.entries(placeholders)) {
|
|
20978
|
+
if (content.includes(placeholder)) {
|
|
20979
|
+
content = content.replaceAll(placeholder, value);
|
|
20980
|
+
changed = true;
|
|
20981
|
+
}
|
|
20982
|
+
}
|
|
20983
|
+
if (changed) {
|
|
20984
|
+
await import_fs_extra8.default.writeFile(filePath, content, "utf-8");
|
|
20985
|
+
}
|
|
20986
|
+
}
|
|
20987
|
+
async function replacePlaceholders(dir, placeholders) {
|
|
20988
|
+
const entries = await import_fs_extra8.default.readdir(dir, { withFileTypes: true });
|
|
20989
|
+
for (const entry of entries) {
|
|
20990
|
+
const fullPath = path14__default.default.join(dir, entry.name);
|
|
20991
|
+
if (entry.isDirectory()) {
|
|
20992
|
+
if (entry.name === "node_modules" || entry.name === ".git") continue;
|
|
20993
|
+
await replacePlaceholders(fullPath, placeholders);
|
|
20994
|
+
} else if (entry.isFile()) {
|
|
20995
|
+
await replacePlaceholdersInFile(fullPath, placeholders);
|
|
20996
|
+
}
|
|
20997
|
+
}
|
|
20998
|
+
}
|
|
20999
|
+
var PINNED_VERSIONS = {
|
|
21000
|
+
// Next.js ecosystem — resolved at runtime via fetchLatestVersion()
|
|
21001
|
+
// (see generatePackageJson)
|
|
21002
|
+
react: "^19.1.0",
|
|
21003
|
+
"react-dom": "^19.1.0",
|
|
21004
|
+
// Dev dependencies
|
|
21005
|
+
typescript: "^5",
|
|
21006
|
+
"@types/node": "^20",
|
|
21007
|
+
"@types/react": "^19",
|
|
21008
|
+
"@types/react-dom": "^19",
|
|
21009
|
+
"@tailwindcss/postcss": "^4",
|
|
21010
|
+
tailwindcss: "^4",
|
|
21011
|
+
eslint: "^9"
|
|
20912
21012
|
};
|
|
20913
|
-
var
|
|
21013
|
+
var RUNTIME_RESOLVED_PACKAGES = ["next", "eslint-config-next"];
|
|
21014
|
+
var NEXTLY_PACKAGES = [
|
|
20914
21015
|
"nextly",
|
|
20915
21016
|
"@nextlyhq/admin",
|
|
20916
|
-
"@nextlyhq/adapter-drizzle",
|
|
20917
21017
|
"@nextlyhq/ui",
|
|
20918
|
-
"@
|
|
20919
|
-
];
|
|
20920
|
-
var ALL_ADAPTER_PACKAGES = [
|
|
21018
|
+
"@nextlyhq/adapter-drizzle",
|
|
20921
21019
|
"@nextlyhq/adapter-postgres",
|
|
20922
21020
|
"@nextlyhq/adapter-mysql",
|
|
20923
|
-
"@nextlyhq/adapter-sqlite"
|
|
20924
|
-
];
|
|
20925
|
-
var TEMPLATE_PLUGIN_PACKAGES = [
|
|
21021
|
+
"@nextlyhq/adapter-sqlite",
|
|
20926
21022
|
"@nextlyhq/plugin-form-builder"
|
|
20927
21023
|
];
|
|
20928
|
-
|
|
20929
|
-
|
|
21024
|
+
var resolvedNextlyVersions = null;
|
|
21025
|
+
async function fetchLatestVersion(pkg) {
|
|
21026
|
+
try {
|
|
21027
|
+
const res = await fetch(
|
|
21028
|
+
`https://registry.npmjs.org/-/package/${encodeURIComponent(pkg)}/dist-tags`,
|
|
21029
|
+
{ signal: AbortSignal.timeout(5e3) }
|
|
21030
|
+
);
|
|
21031
|
+
if (!res.ok) return "latest";
|
|
21032
|
+
const data = await res.json();
|
|
21033
|
+
return data.latest ? `^${data.latest}` : "latest";
|
|
21034
|
+
} catch {
|
|
21035
|
+
return "latest";
|
|
21036
|
+
}
|
|
20930
21037
|
}
|
|
20931
|
-
async function
|
|
20932
|
-
|
|
20933
|
-
|
|
20934
|
-
|
|
20935
|
-
|
|
20936
|
-
|
|
20937
|
-
|
|
20938
|
-
|
|
20939
|
-
|
|
20940
|
-
|
|
20941
|
-
|
|
20942
|
-
|
|
20943
|
-
|
|
20944
|
-
|
|
20945
|
-
|
|
20946
|
-
|
|
20947
|
-
|
|
20948
|
-
|
|
20949
|
-
|
|
20950
|
-
|
|
20951
|
-
|
|
20952
|
-
}
|
|
20953
|
-
|
|
20954
|
-
|
|
20955
|
-
|
|
20956
|
-
|
|
20957
|
-
|
|
20958
|
-
|
|
20959
|
-
|
|
20960
|
-
|
|
20961
|
-
|
|
20962
|
-
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
-
|
|
20970
|
-
|
|
20971
|
-
|
|
20972
|
-
|
|
21038
|
+
async function resolveNextlyVersions() {
|
|
21039
|
+
if (resolvedNextlyVersions) return resolvedNextlyVersions;
|
|
21040
|
+
const entries = await Promise.all(
|
|
21041
|
+
NEXTLY_PACKAGES.map(
|
|
21042
|
+
async (pkg) => [pkg, await fetchLatestVersion(pkg)]
|
|
21043
|
+
)
|
|
21044
|
+
);
|
|
21045
|
+
resolvedNextlyVersions = Object.fromEntries(entries);
|
|
21046
|
+
return resolvedNextlyVersions;
|
|
21047
|
+
}
|
|
21048
|
+
var resolvedRuntimeVersions = null;
|
|
21049
|
+
async function resolveRuntimeVersions() {
|
|
21050
|
+
if (resolvedRuntimeVersions) return resolvedRuntimeVersions;
|
|
21051
|
+
const FALLBACKS = {
|
|
21052
|
+
next: "^16.1.0",
|
|
21053
|
+
"eslint-config-next": "^16.1.0"
|
|
21054
|
+
};
|
|
21055
|
+
const entries = await Promise.all(
|
|
21056
|
+
RUNTIME_RESOLVED_PACKAGES.map(async (pkg) => {
|
|
21057
|
+
const version = await fetchLatestVersion(pkg);
|
|
21058
|
+
return [pkg, version === "latest" ? FALLBACKS[pkg] : version];
|
|
21059
|
+
})
|
|
21060
|
+
);
|
|
21061
|
+
resolvedRuntimeVersions = Object.fromEntries(entries);
|
|
21062
|
+
return resolvedRuntimeVersions;
|
|
21063
|
+
}
|
|
21064
|
+
async function generatePackageJson(projectName, database, useYalc = false, projectType = "blank") {
|
|
21065
|
+
const runtimeVersions = await resolveRuntimeVersions();
|
|
21066
|
+
const dependencies = {
|
|
21067
|
+
next: runtimeVersions.next,
|
|
21068
|
+
react: PINNED_VERSIONS.react,
|
|
21069
|
+
"react-dom": PINNED_VERSIONS["react-dom"]
|
|
21070
|
+
};
|
|
21071
|
+
dependencies["@tanstack/react-query"] = "^5.62.0";
|
|
21072
|
+
if (!useYalc) {
|
|
21073
|
+
const versions = await resolveNextlyVersions();
|
|
21074
|
+
dependencies["nextly"] = versions["nextly"];
|
|
21075
|
+
dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
|
|
21076
|
+
dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";
|
|
21077
|
+
dependencies["@nextlyhq/adapter-drizzle"] = versions["@nextlyhq/adapter-drizzle"];
|
|
21078
|
+
dependencies[database.adapter] = versions[database.adapter] || "latest";
|
|
21079
|
+
if (projectUsesFormBuilder(projectType)) {
|
|
21080
|
+
dependencies["@nextlyhq/plugin-form-builder"] = versions["@nextlyhq/plugin-form-builder"] || "latest";
|
|
20973
21081
|
}
|
|
20974
21082
|
}
|
|
21083
|
+
const devDependencies = {
|
|
21084
|
+
typescript: PINNED_VERSIONS.typescript,
|
|
21085
|
+
"@types/node": PINNED_VERSIONS["@types/node"],
|
|
21086
|
+
"@types/react": PINNED_VERSIONS["@types/react"],
|
|
21087
|
+
"@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
|
|
21088
|
+
"@tailwindcss/postcss": PINNED_VERSIONS["@tailwindcss/postcss"],
|
|
21089
|
+
tailwindcss: PINNED_VERSIONS.tailwindcss,
|
|
21090
|
+
eslint: PINNED_VERSIONS.eslint,
|
|
21091
|
+
"eslint-config-next": runtimeVersions["eslint-config-next"],
|
|
21092
|
+
// Pagefind powers /search in the blog template. Zero-config
|
|
21093
|
+
// static index generated at `next build` time. Templates that
|
|
21094
|
+
// don't ship a /search page simply won't invoke it.
|
|
21095
|
+
pagefind: "^1.1.0"
|
|
21096
|
+
};
|
|
21097
|
+
const onlyBuiltDependencies = ["sharp", "esbuild", "unrs-resolver"];
|
|
21098
|
+
if (database.type === "sqlite") {
|
|
21099
|
+
onlyBuiltDependencies.push("better-sqlite3");
|
|
21100
|
+
}
|
|
21101
|
+
const pkg = {
|
|
21102
|
+
name: projectName,
|
|
21103
|
+
version: "0.1.0",
|
|
21104
|
+
private: true,
|
|
21105
|
+
scripts: {
|
|
21106
|
+
// F1 PR 4: dev now boots Nextly in single-process mode via `next dev`.
|
|
21107
|
+
// The lazy drizzle-kit/api import (PR 1) plus the in-process HMR
|
|
21108
|
+
// listener (PR 2) replaced the wrapper that previously owned the
|
|
21109
|
+
// terminal, schema prompts, and child supervision. `nextly dev` is
|
|
21110
|
+
// gone; the only supported dev command is the standard `next dev`.
|
|
21111
|
+
dev: "next dev --turbopack",
|
|
21112
|
+
// Build: migrate DB + compile Next.js + (if present) generate
|
|
21113
|
+
// the Pagefind search index. Templates without the search
|
|
21114
|
+
// script silently skip the last step.
|
|
21115
|
+
build: "nextly migrate && next build && (test -f scripts/build-search-index.mjs && node scripts/build-search-index.mjs || true)",
|
|
21116
|
+
"search:index": "node scripts/build-search-index.mjs",
|
|
21117
|
+
start: "next start",
|
|
21118
|
+
lint: "next lint",
|
|
21119
|
+
nextly: "nextly",
|
|
21120
|
+
// First-time setup: sync schema + seed system permissions. Demo
|
|
21121
|
+
// content is seeded separately from the admin UI (visit /welcome
|
|
21122
|
+
// after running `pnpm dev` and completing /admin/setup).
|
|
21123
|
+
"db:setup": "nextly db:sync",
|
|
21124
|
+
"db:migrate": "nextly migrate",
|
|
21125
|
+
"db:migrate:status": "nextly migrate:status",
|
|
21126
|
+
"db:migrate:fresh": "nextly migrate:fresh",
|
|
21127
|
+
"db:migrate:reset": "nextly migrate:reset",
|
|
21128
|
+
"types:generate": "nextly generate:types"
|
|
21129
|
+
},
|
|
21130
|
+
dependencies,
|
|
21131
|
+
devDependencies,
|
|
21132
|
+
pnpm: {
|
|
21133
|
+
onlyBuiltDependencies
|
|
21134
|
+
}
|
|
21135
|
+
};
|
|
21136
|
+
return JSON.stringify(pkg, null, 2) + "\n";
|
|
20975
21137
|
}
|
|
20976
|
-
|
|
20977
|
-
|
|
20978
|
-
|
|
20979
|
-
|
|
20980
|
-
|
|
20981
|
-
|
|
20982
|
-
|
|
20983
|
-
|
|
20984
|
-
|
|
21138
|
+
async function copyTemplate(options) {
|
|
21139
|
+
const {
|
|
21140
|
+
projectName,
|
|
21141
|
+
projectType,
|
|
21142
|
+
targetDir,
|
|
21143
|
+
database,
|
|
21144
|
+
databaseUrl,
|
|
21145
|
+
useYalc = false,
|
|
21146
|
+
approach,
|
|
21147
|
+
templateSource,
|
|
21148
|
+
allowExistingTarget = false
|
|
21149
|
+
} = options;
|
|
21150
|
+
if (!allowExistingTarget && targetDir !== process.cwd() && await import_fs_extra8.default.pathExists(targetDir)) {
|
|
21151
|
+
throw new Error(
|
|
21152
|
+
`Directory "${path14__default.default.basename(targetDir)}" already exists. Please choose a different name.`
|
|
21153
|
+
);
|
|
21154
|
+
}
|
|
21155
|
+
let baseDir;
|
|
21156
|
+
let typeDir;
|
|
21157
|
+
if (templateSource) {
|
|
21158
|
+
baseDir = templateSource.basePath;
|
|
21159
|
+
typeDir = templateSource.templatePath;
|
|
21160
|
+
} else {
|
|
21161
|
+
const templatesRoot = resolveTemplatePath();
|
|
21162
|
+
baseDir = path14__default.default.join(templatesRoot, "base");
|
|
21163
|
+
typeDir = path14__default.default.join(templatesRoot, projectType);
|
|
21164
|
+
}
|
|
21165
|
+
if (!await import_fs_extra8.default.pathExists(baseDir)) {
|
|
21166
|
+
throw new Error(
|
|
21167
|
+
`Base template not found at ${baseDir}. The package may be corrupted or the download failed.`
|
|
21168
|
+
);
|
|
21169
|
+
}
|
|
21170
|
+
if (!await import_fs_extra8.default.pathExists(typeDir)) {
|
|
21171
|
+
throw new Error(
|
|
21172
|
+
`Template "${projectType}" not found at ${typeDir}. Available templates: blank, blog.`
|
|
21173
|
+
);
|
|
21174
|
+
}
|
|
21175
|
+
await import_fs_extra8.default.copy(baseDir, targetDir, {
|
|
21176
|
+
filter: (_src) => {
|
|
21177
|
+
const basename = path14__default.default.basename(_src);
|
|
21178
|
+
return !SKIP_FILES.has(basename);
|
|
21179
|
+
}
|
|
21180
|
+
});
|
|
21181
|
+
const templateSrcDir = path14__default.default.join(typeDir, "src");
|
|
21182
|
+
if (await import_fs_extra8.default.pathExists(templateSrcDir)) {
|
|
21183
|
+
await import_fs_extra8.default.copy(templateSrcDir, path14__default.default.join(targetDir, "src"), {
|
|
21184
|
+
overwrite: true,
|
|
21185
|
+
filter: (_src) => {
|
|
21186
|
+
const basename = path14__default.default.basename(_src);
|
|
21187
|
+
return !SKIP_FILES.has(basename);
|
|
21188
|
+
}
|
|
21189
|
+
});
|
|
21190
|
+
}
|
|
21191
|
+
const templateRootConfig = path14__default.default.join(typeDir, "nextly.config.ts");
|
|
21192
|
+
if (await import_fs_extra8.default.pathExists(templateRootConfig)) {
|
|
21193
|
+
await import_fs_extra8.default.copy(
|
|
21194
|
+
templateRootConfig,
|
|
21195
|
+
path14__default.default.join(targetDir, "nextly.config.ts"),
|
|
21196
|
+
{ overwrite: true }
|
|
21197
|
+
);
|
|
21198
|
+
}
|
|
21199
|
+
const configsDir = path14__default.default.join(typeDir, "configs");
|
|
21200
|
+
if (approach && await import_fs_extra8.default.pathExists(configsDir)) {
|
|
21201
|
+
const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
|
|
21202
|
+
const configSrc = path14__default.default.join(configsDir, configFileName);
|
|
21203
|
+
if (await import_fs_extra8.default.pathExists(configSrc)) {
|
|
21204
|
+
await import_fs_extra8.default.copy(configSrc, path14__default.default.join(targetDir, "nextly.config.ts"), {
|
|
21205
|
+
overwrite: true
|
|
21206
|
+
});
|
|
21207
|
+
}
|
|
21208
|
+
const sharedSrc = path14__default.default.join(configsDir, "shared.ts");
|
|
21209
|
+
if (await import_fs_extra8.default.pathExists(sharedSrc)) {
|
|
21210
|
+
await import_fs_extra8.default.copy(sharedSrc, path14__default.default.join(targetDir, "shared.ts"), {
|
|
21211
|
+
overwrite: true
|
|
21212
|
+
});
|
|
21213
|
+
}
|
|
21214
|
+
}
|
|
21215
|
+
const frontendPagePath = path14__default.default.join(
|
|
21216
|
+
targetDir,
|
|
21217
|
+
"src",
|
|
21218
|
+
"app",
|
|
21219
|
+
"(frontend)",
|
|
21220
|
+
"page.tsx"
|
|
21221
|
+
);
|
|
21222
|
+
const basePagePath = path14__default.default.join(targetDir, "src", "app", "page.tsx");
|
|
21223
|
+
if (await import_fs_extra8.default.pathExists(frontendPagePath) && await import_fs_extra8.default.pathExists(basePagePath)) {
|
|
21224
|
+
await import_fs_extra8.default.remove(basePagePath);
|
|
21225
|
+
}
|
|
21226
|
+
const packageJsonContent = await generatePackageJson(
|
|
21227
|
+
projectName,
|
|
21228
|
+
database,
|
|
21229
|
+
useYalc,
|
|
21230
|
+
projectType
|
|
21231
|
+
);
|
|
21232
|
+
await import_fs_extra8.default.writeFile(
|
|
21233
|
+
path14__default.default.join(targetDir, "package.json"),
|
|
21234
|
+
packageJsonContent,
|
|
21235
|
+
"utf-8"
|
|
21236
|
+
);
|
|
21237
|
+
if (database.type === "sqlite") {
|
|
21238
|
+
await import_fs_extra8.default.ensureDir(path14__default.default.join(targetDir, "data"));
|
|
21239
|
+
}
|
|
21240
|
+
await import_fs_extra8.default.writeFile(
|
|
21241
|
+
path14__default.default.join(targetDir, "next.config.ts"),
|
|
21242
|
+
buildNextConfigTemplate(database),
|
|
21243
|
+
"utf-8"
|
|
21244
|
+
);
|
|
21245
|
+
const placeholders = buildPlaceholderMap({ database, databaseUrl });
|
|
21246
|
+
if (approach) {
|
|
21247
|
+
placeholders["{{approach}}"] = approach;
|
|
21248
|
+
}
|
|
21249
|
+
await replacePlaceholders(targetDir, placeholders);
|
|
21250
|
+
}
|
|
21251
|
+
|
|
21252
|
+
// src/installers/dependencies.ts
|
|
21253
|
+
var INSTALL_COMMANDS = {
|
|
21254
|
+
npm: ["npm", "install"],
|
|
21255
|
+
yarn: ["yarn", "add"],
|
|
21256
|
+
pnpm: ["pnpm", "add"],
|
|
21257
|
+
bun: ["bun", "add"]
|
|
21258
|
+
};
|
|
21259
|
+
var CORE_PACKAGES = [
|
|
21260
|
+
"nextly",
|
|
21261
|
+
"@nextlyhq/admin",
|
|
21262
|
+
"@nextlyhq/adapter-drizzle",
|
|
21263
|
+
"@nextlyhq/ui",
|
|
21264
|
+
"@tanstack/react-query"
|
|
21265
|
+
];
|
|
21266
|
+
var ALL_ADAPTER_PACKAGES = [
|
|
21267
|
+
"@nextlyhq/adapter-postgres",
|
|
21268
|
+
"@nextlyhq/adapter-mysql",
|
|
21269
|
+
"@nextlyhq/adapter-sqlite"
|
|
21270
|
+
];
|
|
21271
|
+
var TEMPLATE_PLUGIN_PACKAGES = ["@nextlyhq/plugin-form-builder"];
|
|
21272
|
+
function templatePluginPackages(projectType) {
|
|
21273
|
+
return projectType && projectUsesFormBuilder(projectType) ? TEMPLATE_PLUGIN_PACKAGES : [];
|
|
21274
|
+
}
|
|
21275
|
+
function getPackagesToInstall(database) {
|
|
21276
|
+
return [...CORE_PACKAGES, database.adapter];
|
|
21277
|
+
}
|
|
21278
|
+
async function installDependencies(cwd, projectInfo, database, useYalc = false, isFreshProject = false, projectType) {
|
|
21279
|
+
const pm = projectInfo.packageManager;
|
|
21280
|
+
const pluginPackages = templatePluginPackages(projectType);
|
|
21281
|
+
if (isFreshProject) {
|
|
21282
|
+
if (useYalc) {
|
|
21283
|
+
const yalcPackages = [
|
|
21284
|
+
.../* @__PURE__ */ new Set([
|
|
21285
|
+
"nextly",
|
|
21286
|
+
"@nextlyhq/admin",
|
|
21287
|
+
"@nextlyhq/ui",
|
|
21288
|
+
"@nextlyhq/adapter-drizzle",
|
|
21289
|
+
...ALL_ADAPTER_PACKAGES,
|
|
21290
|
+
...pluginPackages
|
|
21291
|
+
])
|
|
21292
|
+
];
|
|
21293
|
+
await execa(pm, ["install"], { cwd });
|
|
21294
|
+
for (const pkg of yalcPackages) {
|
|
21295
|
+
await execa("yalc", ["add", pkg], { cwd });
|
|
21296
|
+
}
|
|
21297
|
+
await execa(pm, ["install"], { cwd });
|
|
21298
|
+
} else {
|
|
21299
|
+
await execa(pm, ["install"], { cwd });
|
|
21300
|
+
}
|
|
21301
|
+
} else {
|
|
21302
|
+
const allPackages = getPackagesToInstall(database);
|
|
21303
|
+
if (useYalc) {
|
|
21304
|
+
const yalcPackages = [
|
|
21305
|
+
.../* @__PURE__ */ new Set([
|
|
21306
|
+
"nextly",
|
|
21307
|
+
"@nextlyhq/admin",
|
|
21308
|
+
"@nextlyhq/ui",
|
|
21309
|
+
"@nextlyhq/adapter-drizzle",
|
|
21310
|
+
...ALL_ADAPTER_PACKAGES,
|
|
21311
|
+
...pluginPackages
|
|
21312
|
+
])
|
|
21313
|
+
];
|
|
21314
|
+
for (const pkg of yalcPackages) {
|
|
21315
|
+
await execa("yalc", ["add", pkg], { cwd });
|
|
21316
|
+
}
|
|
21317
|
+
await execa(pm, ["install"], { cwd });
|
|
21318
|
+
} else {
|
|
21319
|
+
const [cmd, ...args] = INSTALL_COMMANDS[pm];
|
|
21320
|
+
await execa(cmd, [...args, ...allPackages], { cwd });
|
|
21321
|
+
}
|
|
21322
|
+
}
|
|
21323
|
+
}
|
|
21324
|
+
|
|
21325
|
+
// src/lib/download-template.ts
|
|
21326
|
+
var import_fs_extra9 = __toESM(require_lib());
|
|
21327
|
+
var kr = Object.defineProperty;
|
|
21328
|
+
var vr = (s3, t2) => {
|
|
21329
|
+
for (var e in t2) kr(s3, e, { get: t2[e], enumerable: true });
|
|
21330
|
+
};
|
|
21331
|
+
var Os = typeof process == "object" && process ? process : { stdout: null, stderr: null };
|
|
21332
|
+
var Br = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof D3 || s3 instanceof Ns__default.default || Pr(s3) || zr(s3));
|
|
20985
21333
|
var Pr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.pipe == "function" && s3.pipe !== Ns__default.default.Writable.prototype.pipe;
|
|
20986
21334
|
var zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
|
|
20987
21335
|
var q3 = Symbol("EOF");
|
|
@@ -21868,12 +22216,12 @@ var F = class {
|
|
|
21868
22216
|
}
|
|
21869
22217
|
};
|
|
21870
22218
|
var an = (s3, t2) => {
|
|
21871
|
-
let i2 = s3, r = "", n2, o2 =
|
|
22219
|
+
let i2 = s3, r = "", n2, o2 = path14.posix.parse(s3).root || ".";
|
|
21872
22220
|
if (Buffer.byteLength(i2) < 100) n2 = [i2, r, false];
|
|
21873
22221
|
else {
|
|
21874
|
-
r =
|
|
22222
|
+
r = path14.posix.dirname(i2), i2 = path14.posix.basename(i2);
|
|
21875
22223
|
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 =
|
|
22224
|
+
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
22225
|
while (r !== o2 && n2 === void 0);
|
|
21878
22226
|
n2 || (n2 = [s3.slice(0, 99), "", true]);
|
|
21879
22227
|
}
|
|
@@ -21919,7 +22267,7 @@ var ct2 = class s {
|
|
|
21919
22267
|
if (t2 === "") return Buffer.allocUnsafe(0);
|
|
21920
22268
|
let e = Buffer.byteLength(t2), i2 = 512 * Math.ceil(1 + e / 512), r = Buffer.allocUnsafe(i2);
|
|
21921
22269
|
for (let n2 = 0; n2 < 512; n2++) r[n2] = 0;
|
|
21922
|
-
new F({ path: ("PaxHeader/" +
|
|
22270
|
+
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
22271
|
for (let n2 = e + 512; n2 < r.length; n2++) r[n2] = 0;
|
|
21924
22272
|
return r;
|
|
21925
22273
|
}
|
|
@@ -22281,11 +22629,11 @@ var Nn = (s3) => {
|
|
|
22281
22629
|
};
|
|
22282
22630
|
var Ki = (s3, t2) => {
|
|
22283
22631
|
let e = new Map(t2.map((n2) => [mt3(n2), true])), i2 = s3.filter, r = (n2, o2 = "") => {
|
|
22284
|
-
let h3 = o2 ||
|
|
22632
|
+
let h3 = o2 || path14.parse(n2).root || ".", a2;
|
|
22285
22633
|
if (n2 === h3) a2 = false;
|
|
22286
22634
|
else {
|
|
22287
22635
|
let l = e.get(n2);
|
|
22288
|
-
a2 = l !== void 0 ? l : r(
|
|
22636
|
+
a2 = l !== void 0 ? l : r(path14.dirname(n2), h3);
|
|
22289
22637
|
}
|
|
22290
22638
|
return e.set(n2, a2), a2;
|
|
22291
22639
|
};
|
|
@@ -22331,7 +22679,7 @@ var It3 = K2(An, Dn, (s3) => new st2(s3), (s3) => new st2(s3), (s3, t2) => {
|
|
|
22331
22679
|
t2?.length && Ki(s3, t2), s3.noResume || Nn(s3);
|
|
22332
22680
|
});
|
|
22333
22681
|
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 } =
|
|
22682
|
+
var { isAbsolute: Cn, parse: Ys } = path14.win32;
|
|
22335
22683
|
var ce2 = (s3) => {
|
|
22336
22684
|
let t2 = "", e = Ys(s3);
|
|
22337
22685
|
for (; Cn(s3) || e.root; ) {
|
|
@@ -22405,7 +22753,7 @@ var de2 = class extends D3 {
|
|
|
22405
22753
|
let [o2, h3] = ce2(this.path);
|
|
22406
22754
|
o2 && typeof h3 == "string" && (this.path = h3, r = o2);
|
|
22407
22755
|
}
|
|
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 ||
|
|
22756
|
+
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
22757
|
let n2 = this.statCache.get(this.absolute);
|
|
22410
22758
|
n2 ? this[ei](n2) : this[Qi]();
|
|
22411
22759
|
}
|
|
@@ -22464,7 +22812,7 @@ var de2 = class extends D3 {
|
|
|
22464
22812
|
}
|
|
22465
22813
|
[Qs](t2) {
|
|
22466
22814
|
if (!this.stat) throw new Error("cannot create link entry without stat");
|
|
22467
|
-
this.type = "Link", this.linkpath = f(
|
|
22815
|
+
this.type = "Link", this.linkpath = f(path14__default.default.relative(this.cwd, t2)), this.stat.size = 0, this[fe2](), this.end();
|
|
22468
22816
|
}
|
|
22469
22817
|
[qs]() {
|
|
22470
22818
|
if (!this.stat) throw new Error("cannot create file entry without stat");
|
|
@@ -22875,7 +23223,7 @@ var Et3 = class extends D3 {
|
|
|
22875
23223
|
return t2 instanceof Yt ? this[er](t2) : this[hi](t2), this.flowing;
|
|
22876
23224
|
}
|
|
22877
23225
|
[er](t2) {
|
|
22878
|
-
let e = f(
|
|
23226
|
+
let e = f(path14__default.default.resolve(this.cwd, t2.path));
|
|
22879
23227
|
if (!this.filter(t2.path, t2)) t2.resume();
|
|
22880
23228
|
else {
|
|
22881
23229
|
let i2 = new di(t2.path, e);
|
|
@@ -22884,7 +23232,7 @@ var Et3 = class extends D3 {
|
|
|
22884
23232
|
this[Ft3]();
|
|
22885
23233
|
}
|
|
22886
23234
|
[hi](t2) {
|
|
22887
|
-
let e = f(
|
|
23235
|
+
let e = f(path14__default.default.resolve(this.cwd, t2));
|
|
22888
23236
|
this[W3].push(new di(t2, e)), this[Ft3]();
|
|
22889
23237
|
}
|
|
22890
23238
|
[as](t2) {
|
|
@@ -23022,11 +23370,11 @@ var Hn = (s3, t2) => {
|
|
|
23022
23370
|
};
|
|
23023
23371
|
var or = (s3, t2) => {
|
|
23024
23372
|
t2.forEach((e) => {
|
|
23025
|
-
e.charAt(0) === "@" ? It3({ file:
|
|
23373
|
+
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
23374
|
}), s3.end();
|
|
23027
23375
|
};
|
|
23028
23376
|
var hr = async (s3, t2) => {
|
|
23029
|
-
for (let e of t2) e.charAt(0) === "@" ? await It3({ file:
|
|
23377
|
+
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
23378
|
s3.add(i2);
|
|
23031
23379
|
} }) : s3.add(e);
|
|
23032
23380
|
s3.end();
|
|
@@ -23051,7 +23399,7 @@ var Vn = 512 * 1024;
|
|
|
23051
23399
|
var $n = pr | ur | dr | mr;
|
|
23052
23400
|
var lr = !fr && typeof ar == "number" ? ar | ur | dr | mr : null;
|
|
23053
23401
|
var cs = lr !== null ? () => lr : Kn ? (s3) => s3 < Vn ? $n : "w" : () => "w";
|
|
23054
|
-
var
|
|
23402
|
+
var fs10 = (s3, t2, e) => {
|
|
23055
23403
|
try {
|
|
23056
23404
|
return u2__default.default.lchownSync(s3, t2, e);
|
|
23057
23405
|
} catch (i2) {
|
|
@@ -23064,13 +23412,13 @@ var ui = (s3, t2, e, i2) => {
|
|
|
23064
23412
|
});
|
|
23065
23413
|
};
|
|
23066
23414
|
var Xn = (s3, t2, e, i2, r) => {
|
|
23067
|
-
if (t2.isDirectory()) ds(
|
|
23415
|
+
if (t2.isDirectory()) ds(path14__default.default.resolve(s3, t2.name), e, i2, (n2) => {
|
|
23068
23416
|
if (n2) return r(n2);
|
|
23069
|
-
let o2 =
|
|
23417
|
+
let o2 = path14__default.default.resolve(s3, t2.name);
|
|
23070
23418
|
ui(o2, e, i2, r);
|
|
23071
23419
|
});
|
|
23072
23420
|
else {
|
|
23073
|
-
let n2 =
|
|
23421
|
+
let n2 = path14__default.default.resolve(s3, t2.name);
|
|
23074
23422
|
ui(n2, e, i2, r);
|
|
23075
23423
|
}
|
|
23076
23424
|
};
|
|
@@ -23091,7 +23439,7 @@ var ds = (s3, t2, e, i2) => {
|
|
|
23091
23439
|
});
|
|
23092
23440
|
};
|
|
23093
23441
|
var qn = (s3, t2, e, i2) => {
|
|
23094
|
-
t2.isDirectory() && us(
|
|
23442
|
+
t2.isDirectory() && us(path14__default.default.resolve(s3, t2.name), e, i2), fs10(path14__default.default.resolve(s3, t2.name), e, i2);
|
|
23095
23443
|
};
|
|
23096
23444
|
var us = (s3, t2, e) => {
|
|
23097
23445
|
let i2;
|
|
@@ -23100,11 +23448,11 @@ var us = (s3, t2, e) => {
|
|
|
23100
23448
|
} catch (r) {
|
|
23101
23449
|
let n2 = r;
|
|
23102
23450
|
if (n2?.code === "ENOENT") return;
|
|
23103
|
-
if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return
|
|
23451
|
+
if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return fs10(s3, t2, e);
|
|
23104
23452
|
throw n2;
|
|
23105
23453
|
}
|
|
23106
23454
|
for (let r of i2) qn(s3, r, t2, e);
|
|
23107
|
-
return
|
|
23455
|
+
return fs10(s3, t2, e);
|
|
23108
23456
|
};
|
|
23109
23457
|
var we2 = class extends Error {
|
|
23110
23458
|
path;
|
|
@@ -23141,12 +23489,12 @@ var Er = (s3, t2, e) => {
|
|
|
23141
23489
|
};
|
|
23142
23490
|
if (s3 === d) return Qn(s3, S2);
|
|
23143
23491
|
if (l) return jn__default.default.mkdir(s3, { mode: r, recursive: true }).then((E) => S2(null, E ?? void 0), S2);
|
|
23144
|
-
let N3 = f(
|
|
23492
|
+
let N3 = f(path14__default.default.relative(d, s3)).split("/");
|
|
23145
23493
|
ms(d, N3, r, c3, d, void 0, S2);
|
|
23146
23494
|
};
|
|
23147
23495
|
var ms = (s3, t2, e, i2, r, n2, o2) => {
|
|
23148
23496
|
if (t2.length === 0) return o2(null, n2);
|
|
23149
|
-
let h3 = t2.shift(), a2 = f(
|
|
23497
|
+
let h3 = t2.shift(), a2 = f(path14__default.default.resolve(s3 + "/" + h3));
|
|
23150
23498
|
u2__default.default.mkdir(a2, e, wr(a2, t2, e, i2, r, n2, o2));
|
|
23151
23499
|
};
|
|
23152
23500
|
var wr = (s3, t2, e, i2, r, n2, o2) => (h3) => {
|
|
@@ -23180,9 +23528,9 @@ var Sr = (s3, t2) => {
|
|
|
23180
23528
|
};
|
|
23181
23529
|
if (s3 === c3) return Jn(c3), d();
|
|
23182
23530
|
if (a2) return d(u2__default.default.mkdirSync(s3, { mode: i2, recursive: true }) ?? void 0);
|
|
23183
|
-
let T2 = f(
|
|
23531
|
+
let T2 = f(path14__default.default.relative(c3, s3)).split("/"), N3;
|
|
23184
23532
|
for (let E = T2.shift(), x3 = c3; E && (x3 += "/" + E); E = T2.shift()) {
|
|
23185
|
-
x3 = f(
|
|
23533
|
+
x3 = f(path14__default.default.resolve(x3));
|
|
23186
23534
|
try {
|
|
23187
23535
|
u2__default.default.mkdirSync(x3, i2), N3 = N3 || x3;
|
|
23188
23536
|
} catch {
|
|
@@ -23211,14 +23559,14 @@ var to = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
|
23211
23559
|
var eo = to === "win32";
|
|
23212
23560
|
var io = (s3) => s3.split("/").slice(0, -1).reduce((e, i2) => {
|
|
23213
23561
|
let r = e.at(-1);
|
|
23214
|
-
return r !== void 0 && (i2 =
|
|
23562
|
+
return r !== void 0 && (i2 = path14.join(r, i2)), e.push(i2 || "/"), e;
|
|
23215
23563
|
}, []);
|
|
23216
23564
|
var Ei = class {
|
|
23217
23565
|
#t = /* @__PURE__ */ new Map();
|
|
23218
23566
|
#i = /* @__PURE__ */ new Map();
|
|
23219
23567
|
#s = /* @__PURE__ */ new Set();
|
|
23220
23568
|
reserve(t2, e) {
|
|
23221
|
-
t2 = eo ? ["win32 parallelization disabled"] : t2.map((r) => mt3(
|
|
23569
|
+
t2 = eo ? ["win32 parallelization disabled"] : t2.map((r) => mt3(path14.join(Rr(r))));
|
|
23222
23570
|
let i2 = new Set(t2.map((r) => io(r)).reduce((r, n2) => r.concat(n2)));
|
|
23223
23571
|
this.#i.set(e, { dirs: i2, paths: t2 });
|
|
23224
23572
|
for (let r of t2) {
|
|
@@ -23358,7 +23706,7 @@ var qt = class extends st2 {
|
|
|
23358
23706
|
if (t2.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
|
|
23359
23707
|
this.uid = t2.uid, this.gid = t2.gid, this.setOwner = true;
|
|
23360
23708
|
} 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(
|
|
23709
|
+
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
23710
|
}
|
|
23363
23711
|
warn(t2, e, i2 = {}) {
|
|
23364
23712
|
return (t2 === "TAR_BAD_ARCHIVE" || t2 === "TAR_ABORT") && (i2.recoverable = false), super.warn(t2, e, i2);
|
|
@@ -23372,7 +23720,7 @@ var qt = class extends st2 {
|
|
|
23372
23720
|
let [n2, o2] = ce2(i2), h3 = o2.replaceAll(/\\/g, "/").split("/");
|
|
23373
23721
|
if (h3.includes("..") || Oe2 && /^[a-z]:\.\.$/i.test(h3[0] ?? "")) {
|
|
23374
23722
|
if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t2, [e]: i2 }), false;
|
|
23375
|
-
let a2 =
|
|
23723
|
+
let a2 = path14__default.default.posix.dirname(t2.path), l = path14__default.default.posix.normalize(path14__default.default.posix.join(a2, h3.join("/")));
|
|
23376
23724
|
if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t2, [e]: i2 }), false;
|
|
23377
23725
|
}
|
|
23378
23726
|
return n2 && (t2[e] = String(o2), this.warn("TAR_ENTRY_INFO", `stripping ${n2} from absolute ${e}`, { entry: t2, [e]: i2 })), true;
|
|
@@ -23390,12 +23738,12 @@ var qt = class extends st2 {
|
|
|
23390
23738
|
}
|
|
23391
23739
|
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
23740
|
if (!this[Es](t2, "path") || !this[Es](t2, "linkpath")) return false;
|
|
23393
|
-
if (t2.absolute =
|
|
23741
|
+
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
23742
|
if (t2.absolute === this.cwd && t2.type !== "Directory" && t2.type !== "GNUDumpDir") return false;
|
|
23395
23743
|
if (this.win32) {
|
|
23396
|
-
let { root: r } =
|
|
23744
|
+
let { root: r } = path14__default.default.win32.parse(String(t2.absolute));
|
|
23397
23745
|
t2.absolute = r + Xi(String(t2.absolute).slice(r.length));
|
|
23398
|
-
let { root: n2 } =
|
|
23746
|
+
let { root: n2 } = path14__default.default.win32.parse(t2.path);
|
|
23399
23747
|
t2.path = n2 + Xi(t2.path.slice(n2.length));
|
|
23400
23748
|
}
|
|
23401
23749
|
return true;
|
|
@@ -23483,13 +23831,13 @@ var qt = class extends st2 {
|
|
|
23483
23831
|
t2.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t2.type}`, { entry: t2 }), t2.resume();
|
|
23484
23832
|
}
|
|
23485
23833
|
[Tr](t2, e) {
|
|
23486
|
-
let i2 = f(
|
|
23834
|
+
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
23835
|
this[ye2](t2, this.cwd, i2, () => this[Si](t2, String(t2.linkpath), "symlink", e), (r) => {
|
|
23488
23836
|
this[O2](r, t2), e();
|
|
23489
23837
|
});
|
|
23490
23838
|
}
|
|
23491
23839
|
[xr](t2, e) {
|
|
23492
|
-
let i2 = f(
|
|
23840
|
+
let i2 = f(path14__default.default.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
|
|
23493
23841
|
this[ye2](t2, this.cwd, r, () => this[Si](t2, i2, "link", e), (n2) => {
|
|
23494
23842
|
this[O2](n2, t2), e();
|
|
23495
23843
|
});
|
|
@@ -23497,10 +23845,10 @@ var qt = class extends st2 {
|
|
|
23497
23845
|
[ye2](t2, e, i2, r, n2) {
|
|
23498
23846
|
let o2 = i2.shift();
|
|
23499
23847
|
if (this.preservePaths || o2 === void 0) return r();
|
|
23500
|
-
let h3 =
|
|
23848
|
+
let h3 = path14__default.default.resolve(e, o2);
|
|
23501
23849
|
u2__default.default.lstat(h3, (a2, l) => {
|
|
23502
23850
|
if (a2) return r();
|
|
23503
|
-
if (l?.isSymbolicLink()) return n2(new wt2(h3,
|
|
23851
|
+
if (l?.isSymbolicLink()) return n2(new wt2(h3, path14__default.default.resolve(h3, i2.join("/"))));
|
|
23504
23852
|
this[ye2](t2, h3, i2, r, n2);
|
|
23505
23853
|
});
|
|
23506
23854
|
}
|
|
@@ -23534,7 +23882,7 @@ var qt = class extends st2 {
|
|
|
23534
23882
|
});
|
|
23535
23883
|
}, n2 = () => {
|
|
23536
23884
|
if (t2.absolute !== this.cwd) {
|
|
23537
|
-
let h3 = f(
|
|
23885
|
+
let h3 = f(path14__default.default.dirname(String(t2.absolute)));
|
|
23538
23886
|
if (h3 !== this.cwd) return this[St2](h3, this.dmode, (a2) => {
|
|
23539
23887
|
if (a2) {
|
|
23540
23888
|
this[O2](a2, t2), i2();
|
|
@@ -23609,7 +23957,7 @@ var Te2 = class extends qt {
|
|
|
23609
23957
|
this[ge2] = true;
|
|
23610
23958
|
}
|
|
23611
23959
|
if (t2.absolute !== this.cwd) {
|
|
23612
|
-
let n2 = f(
|
|
23960
|
+
let n2 = f(path14__default.default.dirname(String(t2.absolute)));
|
|
23613
23961
|
if (n2 !== this.cwd) {
|
|
23614
23962
|
let o2 = this[St2](n2, this.dmode);
|
|
23615
23963
|
if (o2) return this[O2](o2, t2);
|
|
@@ -23709,10 +24057,10 @@ var Te2 = class extends qt {
|
|
|
23709
24057
|
if (this.preservePaths || i2.length === 0) return r();
|
|
23710
24058
|
let o2 = e;
|
|
23711
24059
|
for (let h3 of i2) {
|
|
23712
|
-
o2 =
|
|
24060
|
+
o2 = path14__default.default.resolve(o2, h3);
|
|
23713
24061
|
let [a2, l] = Se2(() => u2__default.default.lstatSync(o2));
|
|
23714
24062
|
if (a2) return r();
|
|
23715
|
-
if (l.isSymbolicLink()) return n2(new wt2(o2,
|
|
24063
|
+
if (l.isSymbolicLink()) return n2(new wt2(o2, path14__default.default.resolve(e, i2.join("/"))));
|
|
23716
24064
|
}
|
|
23717
24065
|
r();
|
|
23718
24066
|
}
|
|
@@ -23816,11 +24164,11 @@ var mo = (s3, t2) => {
|
|
|
23816
24164
|
};
|
|
23817
24165
|
var po = (s3, t2) => {
|
|
23818
24166
|
t2.forEach((e) => {
|
|
23819
|
-
e.charAt(0) === "@" ? It3({ file:
|
|
24167
|
+
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
24168
|
}), s3.end();
|
|
23821
24169
|
};
|
|
23822
24170
|
var Eo = async (s3, t2) => {
|
|
23823
|
-
for (let e of t2) e.charAt(0) === "@" ? await It3({ file:
|
|
24171
|
+
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
24172
|
s3.end();
|
|
23825
24173
|
};
|
|
23826
24174
|
var vt3 = K2(fo, mo, () => {
|
|
@@ -23845,11 +24193,11 @@ var GITHUB_ORG = "nextlyhq";
|
|
|
23845
24193
|
var GITHUB_REPO = "nextly";
|
|
23846
24194
|
async function downloadTemplate(templateName, branch = "main") {
|
|
23847
24195
|
const url = `https://codeload.github.com/${GITHUB_ORG}/${GITHUB_REPO}/tar.gz/${branch}`;
|
|
23848
|
-
const tmpDir =
|
|
24196
|
+
const tmpDir = path14__default.default.join(
|
|
23849
24197
|
process.env.TMPDIR || "/tmp",
|
|
23850
24198
|
`nextly-template-${Date.now()}`
|
|
23851
24199
|
);
|
|
23852
|
-
await
|
|
24200
|
+
await import_fs_extra9.default.ensureDir(tmpDir);
|
|
23853
24201
|
const repoPrefix = `${GITHUB_REPO}-${branch}`;
|
|
23854
24202
|
const baseFilter = `${repoPrefix}/templates/base/`;
|
|
23855
24203
|
const templateFilter = `${repoPrefix}/templates/${templateName}/`;
|
|
@@ -23878,7 +24226,7 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
23878
24226
|
})
|
|
23879
24227
|
);
|
|
23880
24228
|
} catch (error) {
|
|
23881
|
-
await
|
|
24229
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
23882
24230
|
});
|
|
23883
24231
|
if (error instanceof Error && error.name === "TimeoutError") {
|
|
23884
24232
|
throw new Error(
|
|
@@ -23887,17 +24235,17 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
23887
24235
|
}
|
|
23888
24236
|
throw error;
|
|
23889
24237
|
}
|
|
23890
|
-
const basePath =
|
|
23891
|
-
const templatePath =
|
|
23892
|
-
if (!await
|
|
23893
|
-
await
|
|
24238
|
+
const basePath = path14__default.default.join(tmpDir, "templates", "base");
|
|
24239
|
+
const templatePath = path14__default.default.join(tmpDir, "templates", templateName);
|
|
24240
|
+
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
24241
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
23894
24242
|
});
|
|
23895
24243
|
throw new Error(
|
|
23896
24244
|
`Base template not found in downloaded archive. The branch "${branch}" may not contain templates.`
|
|
23897
24245
|
);
|
|
23898
24246
|
}
|
|
23899
|
-
if (!await
|
|
23900
|
-
await
|
|
24247
|
+
if (!await import_fs_extra9.default.pathExists(templatePath)) {
|
|
24248
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
23901
24249
|
});
|
|
23902
24250
|
throw new Error(
|
|
23903
24251
|
`Template "${templateName}" not found in downloaded archive. Available templates may differ on branch "${branch}".`
|
|
@@ -23906,14 +24254,14 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
23906
24254
|
return { basePath, templatePath };
|
|
23907
24255
|
}
|
|
23908
24256
|
async function resolveLocalTemplate(localPath, templateName) {
|
|
23909
|
-
const basePath =
|
|
23910
|
-
const templatePath =
|
|
23911
|
-
if (!await
|
|
24257
|
+
const basePath = path14__default.default.join(localPath, "base");
|
|
24258
|
+
const templatePath = path14__default.default.join(localPath, templateName);
|
|
24259
|
+
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
23912
24260
|
throw new Error(
|
|
23913
24261
|
`Base template not found at ${basePath}. Check the --local-template path points to the templates/ directory.`
|
|
23914
24262
|
);
|
|
23915
24263
|
}
|
|
23916
|
-
if (!await
|
|
24264
|
+
if (!await import_fs_extra9.default.pathExists(templatePath)) {
|
|
23917
24265
|
throw new Error(
|
|
23918
24266
|
`Template "${templateName}" not found at ${templatePath}. Check the --local-template path points to the templates/ directory.`
|
|
23919
24267
|
);
|
|
@@ -23930,8 +24278,8 @@ async function resolveTemplateSource(templateName, options = {}) {
|
|
|
23930
24278
|
async function cleanupDownload(source) {
|
|
23931
24279
|
const tmpBase = process.env.TMPDIR || "/tmp";
|
|
23932
24280
|
if (source.basePath.startsWith(tmpBase)) {
|
|
23933
|
-
const extractionRoot =
|
|
23934
|
-
await
|
|
24281
|
+
const extractionRoot = path14__default.default.resolve(source.basePath, "../..");
|
|
24282
|
+
await import_fs_extra9.default.remove(extractionRoot).catch(() => {
|
|
23935
24283
|
});
|
|
23936
24284
|
}
|
|
23937
24285
|
}
|
|
@@ -24033,14 +24381,37 @@ var DATABASE_LABELS = {
|
|
|
24033
24381
|
hint: "Popular alternative for production"
|
|
24034
24382
|
}
|
|
24035
24383
|
};
|
|
24384
|
+
var import_fs_extra10 = __toESM(require_lib());
|
|
24385
|
+
function resolveProjectArg(directory) {
|
|
24386
|
+
const trimmed = directory?.trim();
|
|
24387
|
+
if (!trimmed) {
|
|
24388
|
+
return { projectName: void 0, installInCwd: false };
|
|
24389
|
+
}
|
|
24390
|
+
if (trimmed === "." || trimmed === "./") {
|
|
24391
|
+
return { projectName: void 0, installInCwd: true };
|
|
24392
|
+
}
|
|
24393
|
+
return { projectName: path14__default.default.basename(trimmed), installInCwd: false };
|
|
24394
|
+
}
|
|
24395
|
+
function validateProjectName(name) {
|
|
24396
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(name)) {
|
|
24397
|
+
return "Use lowercase letters, numbers, hyphens, dots, or underscores";
|
|
24398
|
+
}
|
|
24399
|
+
return void 0;
|
|
24400
|
+
}
|
|
24401
|
+
function validateProjectNamePromptInput(value) {
|
|
24402
|
+
const trimmed = (value ?? "").trim();
|
|
24403
|
+
if (trimmed === "") return void 0;
|
|
24404
|
+
if (trimmed === "." || trimmed === "./") return void 0;
|
|
24405
|
+
const candidate = trimmed.startsWith("./") ? trimmed.slice(2) : trimmed;
|
|
24406
|
+
return validateProjectName(path14__default.default.basename(candidate));
|
|
24407
|
+
}
|
|
24036
24408
|
|
|
24037
24409
|
// src/prompts/project-name.ts
|
|
24038
|
-
var import_fs_extra9 = __toESM(require_lib());
|
|
24039
24410
|
async function isExistingNextProject(cwd) {
|
|
24040
|
-
const packageJsonPath =
|
|
24041
|
-
if (!await
|
|
24411
|
+
const packageJsonPath = path14__default.default.join(cwd, "package.json");
|
|
24412
|
+
if (!await import_fs_extra10.default.pathExists(packageJsonPath)) return false;
|
|
24042
24413
|
try {
|
|
24043
|
-
const packageJson = await
|
|
24414
|
+
const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
|
|
24044
24415
|
const deps = {
|
|
24045
24416
|
...packageJson.dependencies,
|
|
24046
24417
|
...packageJson.devDependencies
|
|
@@ -24050,6 +24421,42 @@ async function isExistingNextProject(cwd) {
|
|
|
24050
24421
|
return false;
|
|
24051
24422
|
}
|
|
24052
24423
|
}
|
|
24424
|
+
var DEFAULT_PROJECT_NAME = "my-nextly-app";
|
|
24425
|
+
async function promptForProjectName() {
|
|
24426
|
+
const answer = await Zt({
|
|
24427
|
+
message: "What should your project be called?",
|
|
24428
|
+
// `initialValue` pre-fills the buffer so Enter accepts the default.
|
|
24429
|
+
// The previous version used `placeholder` alone, which returned an
|
|
24430
|
+
// empty string on Enter and silently fell through to a cwd install —
|
|
24431
|
+
// the root cause of the original bug. `placeholder` is omitted here
|
|
24432
|
+
// because clack only shows it when the buffer is empty, and the
|
|
24433
|
+
// initialValue keeps it populated.
|
|
24434
|
+
initialValue: DEFAULT_PROJECT_NAME,
|
|
24435
|
+
validate: validateProjectNamePromptInput
|
|
24436
|
+
});
|
|
24437
|
+
if (Ct(answer)) {
|
|
24438
|
+
return { kind: "cancelled" };
|
|
24439
|
+
}
|
|
24440
|
+
return { kind: "resolved", value: resolveProjectArg(answer) };
|
|
24441
|
+
}
|
|
24442
|
+
async function promptDirectoryConflict(targetLabel) {
|
|
24443
|
+
const choice = await Jt({
|
|
24444
|
+
message: `Target directory ${targetLabel} is not empty. How would you like to proceed?`,
|
|
24445
|
+
options: [
|
|
24446
|
+
{ value: "cancel", label: "Cancel operation" },
|
|
24447
|
+
{
|
|
24448
|
+
value: "remove",
|
|
24449
|
+
label: "Remove existing files and continue"
|
|
24450
|
+
},
|
|
24451
|
+
{
|
|
24452
|
+
value: "ignore",
|
|
24453
|
+
label: "Ignore files and continue"
|
|
24454
|
+
}
|
|
24455
|
+
]
|
|
24456
|
+
});
|
|
24457
|
+
if (Ct(choice)) return "cancel";
|
|
24458
|
+
return choice;
|
|
24459
|
+
}
|
|
24053
24460
|
|
|
24054
24461
|
// src/prompts/template.ts
|
|
24055
24462
|
var import_picocolors2 = __toESM(require_picocolors2());
|
|
@@ -24077,7 +24484,7 @@ function isValidTemplateSelection(value) {
|
|
|
24077
24484
|
}
|
|
24078
24485
|
|
|
24079
24486
|
// src/utils/detect.ts
|
|
24080
|
-
var
|
|
24487
|
+
var import_fs_extra11 = __toESM(require_lib());
|
|
24081
24488
|
|
|
24082
24489
|
// src/utils/detect-pm-from-user-agent.ts
|
|
24083
24490
|
function detectPmFromUserAgent(userAgent) {
|
|
@@ -24093,19 +24500,19 @@ function detectPmFromUserAgent(userAgent) {
|
|
|
24093
24500
|
async function detectPackageManager(cwd) {
|
|
24094
24501
|
const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
|
|
24095
24502
|
if (fromUa) return fromUa;
|
|
24096
|
-
if (await
|
|
24097
|
-
if (await
|
|
24098
|
-
if (await
|
|
24503
|
+
if (await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
24504
|
+
if (await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "yarn.lock"))) return "yarn";
|
|
24505
|
+
if (await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "bun.lockb"))) return "bun";
|
|
24099
24506
|
return "npm";
|
|
24100
24507
|
}
|
|
24101
24508
|
async function detectProject(cwd) {
|
|
24102
|
-
const packageJsonPath =
|
|
24103
|
-
if (!await
|
|
24509
|
+
const packageJsonPath = path14__default.default.join(cwd, "package.json");
|
|
24510
|
+
if (!await import_fs_extra11.default.pathExists(packageJsonPath)) {
|
|
24104
24511
|
throw new Error(
|
|
24105
24512
|
"No package.json found. Please run this command in a Next.js project."
|
|
24106
24513
|
);
|
|
24107
24514
|
}
|
|
24108
|
-
const packageJson = await
|
|
24515
|
+
const packageJson = await import_fs_extra11.default.readJson(packageJsonPath);
|
|
24109
24516
|
const deps = {
|
|
24110
24517
|
...packageJson.dependencies,
|
|
24111
24518
|
...packageJson.devDependencies
|
|
@@ -24117,11 +24524,11 @@ async function detectProject(cwd) {
|
|
|
24117
24524
|
);
|
|
24118
24525
|
}
|
|
24119
24526
|
const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
|
|
24120
|
-
const srcDir = await
|
|
24121
|
-
const appDirPaths = srcDir ? [
|
|
24527
|
+
const srcDir = await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "src"));
|
|
24528
|
+
const appDirPaths = srcDir ? [path14__default.default.join(cwd, "src", "app")] : [path14__default.default.join(cwd, "app")];
|
|
24122
24529
|
let isAppRouter = false;
|
|
24123
24530
|
for (const appPath of appDirPaths) {
|
|
24124
|
-
if (await
|
|
24531
|
+
if (await import_fs_extra11.default.pathExists(appPath)) {
|
|
24125
24532
|
isAppRouter = true;
|
|
24126
24533
|
break;
|
|
24127
24534
|
}
|
|
@@ -24131,7 +24538,7 @@ async function detectProject(cwd) {
|
|
|
24131
24538
|
"App Router not detected. Nextly requires Next.js App Router (app/ directory)."
|
|
24132
24539
|
);
|
|
24133
24540
|
}
|
|
24134
|
-
const hasTypescript = await
|
|
24541
|
+
const hasTypescript = await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "tsconfig.json"));
|
|
24135
24542
|
const packageManager = await detectPackageManager(cwd);
|
|
24136
24543
|
const appDir = srcDir ? "src/app" : "app";
|
|
24137
24544
|
return {
|
|
@@ -24145,315 +24552,32 @@ async function detectProject(cwd) {
|
|
|
24145
24552
|
};
|
|
24146
24553
|
}
|
|
24147
24554
|
|
|
24148
|
-
// src/utils/
|
|
24149
|
-
var
|
|
24150
|
-
|
|
24151
|
-
|
|
24152
|
-
|
|
24153
|
-
".
|
|
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";
|
|
24555
|
+
// src/utils/fs.ts
|
|
24556
|
+
var import_fs_extra12 = __toESM(require_lib());
|
|
24557
|
+
async function isDirectoryNotEmpty(dir) {
|
|
24558
|
+
if (!await import_fs_extra12.default.pathExists(dir)) return false;
|
|
24559
|
+
const entries = await import_fs_extra12.default.readdir(dir);
|
|
24560
|
+
return entries.some((entry) => entry !== ".git");
|
|
24341
24561
|
}
|
|
24342
|
-
async function
|
|
24343
|
-
|
|
24344
|
-
|
|
24345
|
-
|
|
24346
|
-
|
|
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
|
-
);
|
|
24357
|
-
}
|
|
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);
|
|
24562
|
+
async function emptyDirectory(dir) {
|
|
24563
|
+
if (!await import_fs_extra12.default.pathExists(dir)) return;
|
|
24564
|
+
for (const entry of await import_fs_extra12.default.readdir(dir)) {
|
|
24565
|
+
if (entry === ".git") continue;
|
|
24566
|
+
await import_fs_extra12.default.remove(path14__default.default.join(dir, entry));
|
|
24428
24567
|
}
|
|
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
24568
|
}
|
|
24448
24569
|
|
|
24449
24570
|
// src/create-nextly.ts
|
|
24571
|
+
function cwdProjectName(cwd) {
|
|
24572
|
+
const basename = path14__default.default.basename(cwd);
|
|
24573
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(basename)) {
|
|
24574
|
+
return DEFAULT_PROJECT_NAME;
|
|
24575
|
+
}
|
|
24576
|
+
return basename;
|
|
24577
|
+
}
|
|
24450
24578
|
async function createNextly(options = {}) {
|
|
24451
|
-
const {
|
|
24452
|
-
|
|
24453
|
-
skipInstall = false,
|
|
24454
|
-
useYalc = false,
|
|
24455
|
-
installInCwd = false
|
|
24456
|
-
} = options;
|
|
24579
|
+
const { defaults = false, skipInstall = false, useYalc = false } = options;
|
|
24580
|
+
let installInCwd = options.installInCwd ?? false;
|
|
24457
24581
|
let { cwd = process.cwd() } = options;
|
|
24458
24582
|
let isFreshProject = false;
|
|
24459
24583
|
let projectName;
|
|
@@ -24474,37 +24598,48 @@ async function createNextly(options = {}) {
|
|
|
24474
24598
|
}
|
|
24475
24599
|
}
|
|
24476
24600
|
} else if (installInCwd) {
|
|
24477
|
-
projectName =
|
|
24601
|
+
projectName = cwdProjectName(cwd);
|
|
24478
24602
|
isFreshProject = true;
|
|
24479
24603
|
} else {
|
|
24480
24604
|
if (options.projectNameFromArg) {
|
|
24481
24605
|
projectName = options.projectNameFromArg;
|
|
24482
24606
|
} else if (!defaults) {
|
|
24483
|
-
const
|
|
24484
|
-
|
|
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)) {
|
|
24607
|
+
const result = await promptForProjectName();
|
|
24608
|
+
if (result.kind === "cancelled") {
|
|
24495
24609
|
Nt("Cancelled.");
|
|
24496
24610
|
return;
|
|
24497
24611
|
}
|
|
24498
|
-
|
|
24612
|
+
if (result.value.installInCwd) {
|
|
24613
|
+
installInCwd = true;
|
|
24614
|
+
projectName = cwdProjectName(cwd);
|
|
24615
|
+
} else {
|
|
24616
|
+
projectName = result.value.projectName ?? DEFAULT_PROJECT_NAME;
|
|
24617
|
+
}
|
|
24499
24618
|
} else {
|
|
24500
|
-
projectName =
|
|
24619
|
+
projectName = DEFAULT_PROJECT_NAME;
|
|
24501
24620
|
}
|
|
24502
24621
|
isFreshProject = true;
|
|
24503
24622
|
}
|
|
24623
|
+
let allowExistingTarget = false;
|
|
24624
|
+
if (isFreshProject && projectName) {
|
|
24625
|
+
const conflictTargetDir = installInCwd ? cwd : path14__default.default.join(cwd, projectName);
|
|
24626
|
+
if (await isDirectoryNotEmpty(conflictTargetDir)) {
|
|
24627
|
+
const targetLabel = installInCwd ? "the current directory" : `"${projectName}"`;
|
|
24628
|
+
const choice = await promptDirectoryConflict(targetLabel);
|
|
24629
|
+
if (choice === "cancel") {
|
|
24630
|
+
Nt("Cancelled. No changes were made.");
|
|
24631
|
+
return;
|
|
24632
|
+
}
|
|
24633
|
+
allowExistingTarget = true;
|
|
24634
|
+
if (choice === "remove") {
|
|
24635
|
+
await emptyDirectory(conflictTargetDir);
|
|
24636
|
+
}
|
|
24637
|
+
}
|
|
24638
|
+
}
|
|
24504
24639
|
let projectType;
|
|
24505
24640
|
if (options.projectType) {
|
|
24506
24641
|
projectType = options.projectType;
|
|
24507
|
-
} else if (defaults) {
|
|
24642
|
+
} else if (defaults || existingProject) {
|
|
24508
24643
|
projectType = "blank";
|
|
24509
24644
|
} else {
|
|
24510
24645
|
const template = await Jt({
|
|
@@ -24592,6 +24727,7 @@ async function createNextly(options = {}) {
|
|
|
24592
24727
|
databaseUrl = url?.trim() || database.connectionUrl;
|
|
24593
24728
|
}
|
|
24594
24729
|
if (isFreshProject && projectName) {
|
|
24730
|
+
const targetDir = installInCwd ? cwd : path14__default.default.join(cwd, projectName);
|
|
24595
24731
|
const s3 = be();
|
|
24596
24732
|
let templateSource;
|
|
24597
24733
|
try {
|
|
@@ -24606,47 +24742,29 @@ async function createNextly(options = {}) {
|
|
|
24606
24742
|
} else {
|
|
24607
24743
|
s3.start("Scaffolding project...");
|
|
24608
24744
|
}
|
|
24609
|
-
|
|
24610
|
-
|
|
24611
|
-
|
|
24612
|
-
|
|
24613
|
-
|
|
24614
|
-
|
|
24615
|
-
|
|
24616
|
-
|
|
24617
|
-
|
|
24618
|
-
|
|
24619
|
-
|
|
24620
|
-
|
|
24621
|
-
|
|
24622
|
-
|
|
24623
|
-
|
|
24624
|
-
|
|
24625
|
-
|
|
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
|
-
}
|
|
24745
|
+
await copyTemplate({
|
|
24746
|
+
projectName,
|
|
24747
|
+
projectType,
|
|
24748
|
+
targetDir,
|
|
24749
|
+
database,
|
|
24750
|
+
databaseUrl,
|
|
24751
|
+
useYalc,
|
|
24752
|
+
approach,
|
|
24753
|
+
templateSource,
|
|
24754
|
+
// Suppress copyTemplate's "directory already exists" guard when the
|
|
24755
|
+
// installer has already negotiated the conflict with the user
|
|
24756
|
+
// (either by emptying the dir or accepting an overlay). Without
|
|
24757
|
+
// this, the "ignore" path would still throw on the subdirectory
|
|
24758
|
+
// case where the target was non-empty.
|
|
24759
|
+
allowExistingTarget
|
|
24760
|
+
});
|
|
24761
|
+
if (!installInCwd) cwd = targetDir;
|
|
24643
24762
|
s3.stop("Project scaffolded");
|
|
24644
24763
|
} catch (error) {
|
|
24645
24764
|
s3.stop("Scaffolding failed");
|
|
24646
|
-
if (!installInCwd) {
|
|
24647
|
-
|
|
24648
|
-
|
|
24649
|
-
await import_fs_extra12.default.remove(targetDir);
|
|
24765
|
+
if (!installInCwd && !allowExistingTarget) {
|
|
24766
|
+
if (await import_fs_extra13.default.pathExists(targetDir)) {
|
|
24767
|
+
await import_fs_extra13.default.remove(targetDir);
|
|
24650
24768
|
}
|
|
24651
24769
|
}
|
|
24652
24770
|
capture("scaffold_failed", {
|
|
@@ -24686,7 +24804,8 @@ async function createNextly(options = {}) {
|
|
|
24686
24804
|
projectInfo,
|
|
24687
24805
|
database,
|
|
24688
24806
|
useYalc,
|
|
24689
|
-
isFreshProject
|
|
24807
|
+
isFreshProject,
|
|
24808
|
+
projectType
|
|
24690
24809
|
);
|
|
24691
24810
|
s3.stop("Dependencies installed");
|
|
24692
24811
|
capture("install_completed", {
|
|
@@ -24711,7 +24830,7 @@ async function createNextly(options = {}) {
|
|
|
24711
24830
|
await generateAdminPage(cwd, projectInfo);
|
|
24712
24831
|
await generateMediaRoutes(cwd, projectInfo);
|
|
24713
24832
|
await generateTypesDirectory(cwd, projectInfo);
|
|
24714
|
-
await patchNextConfig(cwd);
|
|
24833
|
+
await patchNextConfig(cwd, database);
|
|
24715
24834
|
}
|
|
24716
24835
|
const envDatabase = databaseUrl ? { ...database, connectionUrl: databaseUrl, envExample: databaseUrl } : database;
|
|
24717
24836
|
await generateEnv(cwd, envDatabase);
|