create-nextly-app 0.0.2-alpha.3 → 0.0.2-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-AYJ2RKVJ.mjs → chunk-C5CWOU22.mjs} +1469 -1093
- package/dist/chunk-C5CWOU22.mjs.map +1 -0
- package/dist/cli.cjs +1497 -1123
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +24 -27
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +1462 -1084
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -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/templates/plugin/README.md +44 -0
- package/templates/plugin/dev/.env.example +8 -0
- package/templates/plugin/dev/instrumentation.ts +10 -0
- package/templates/plugin/dev/next.config.ts +30 -0
- package/templates/plugin/dev/nextly.config.ts +17 -0
- package/templates/plugin/dev/src/app/admin/[[...params]]/page.tsx +9 -0
- package/templates/plugin/dev/src/app/admin/api/[[...params]]/route.ts +19 -0
- package/templates/plugin/dev/src/app/layout.tsx +13 -0
- package/templates/plugin/dev/tsconfig.json +22 -0
- package/templates/plugin/eslint.config.mjs +8 -0
- package/templates/plugin/src/admin/SettingsPage.tsx +13 -0
- package/templates/plugin/src/admin/index.ts +21 -0
- package/templates/plugin/src/collections/example.ts +13 -0
- package/templates/plugin/src/index.ts +6 -0
- package/templates/plugin/src/plugin.test.ts +29 -0
- package/templates/plugin/src/plugin.ts +48 -0
- package/templates/plugin/src/types.ts +17 -0
- package/templates/plugin/template.json +14 -0
- package/templates/plugin/tsconfig.json +18 -0
- package/templates/plugin/tsup.config.ts +22 -0
- package/templates/plugin/vitest.config.ts +8 -0
- 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(" ");
|
|
@@ -11125,7 +11125,7 @@ var require_dist = __commonJS2({
|
|
|
11125
11125
|
}
|
|
11126
11126
|
});
|
|
11127
11127
|
var require_constants = __commonJS2({
|
|
11128
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11128
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/constants.js"(exports$1, module) {
|
|
11129
11129
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
11130
11130
|
var MAX_LENGTH = 256;
|
|
11131
11131
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
@@ -11154,14 +11154,14 @@ var require_constants = __commonJS2({
|
|
|
11154
11154
|
}
|
|
11155
11155
|
});
|
|
11156
11156
|
var require_debug = __commonJS2({
|
|
11157
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11157
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/debug.js"(exports$1, module) {
|
|
11158
11158
|
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
11159
11159
|
};
|
|
11160
11160
|
module.exports = debug;
|
|
11161
11161
|
}
|
|
11162
11162
|
});
|
|
11163
11163
|
var require_re = __commonJS2({
|
|
11164
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11164
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/re.js"(exports$1, module) {
|
|
11165
11165
|
var {
|
|
11166
11166
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
11167
11167
|
MAX_SAFE_BUILD_LENGTH,
|
|
@@ -11246,7 +11246,7 @@ var require_re = __commonJS2({
|
|
|
11246
11246
|
}
|
|
11247
11247
|
});
|
|
11248
11248
|
var require_parse_options = __commonJS2({
|
|
11249
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11249
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/parse-options.js"(exports$1, module) {
|
|
11250
11250
|
var looseOption = Object.freeze({ loose: true });
|
|
11251
11251
|
var emptyOpts = Object.freeze({});
|
|
11252
11252
|
var parseOptions = (options) => {
|
|
@@ -11262,9 +11262,12 @@ var require_parse_options = __commonJS2({
|
|
|
11262
11262
|
}
|
|
11263
11263
|
});
|
|
11264
11264
|
var require_identifiers = __commonJS2({
|
|
11265
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11265
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/identifiers.js"(exports$1, module) {
|
|
11266
11266
|
var numeric = /^[0-9]+$/;
|
|
11267
11267
|
var compareIdentifiers = (a2, b2) => {
|
|
11268
|
+
if (typeof a2 === "number" && typeof b2 === "number") {
|
|
11269
|
+
return a2 === b2 ? 0 : a2 < b2 ? -1 : 1;
|
|
11270
|
+
}
|
|
11268
11271
|
const anum = numeric.test(a2);
|
|
11269
11272
|
const bnum = numeric.test(b2);
|
|
11270
11273
|
if (anum && bnum) {
|
|
@@ -11281,7 +11284,7 @@ var require_identifiers = __commonJS2({
|
|
|
11281
11284
|
}
|
|
11282
11285
|
});
|
|
11283
11286
|
var require_semver = __commonJS2({
|
|
11284
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11287
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/semver.js"(exports$1, module) {
|
|
11285
11288
|
var debug = require_debug();
|
|
11286
11289
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
11287
11290
|
var { safeRe: re3, t: t2 } = require_re();
|
|
@@ -11368,7 +11371,25 @@ var require_semver = __commonJS2({
|
|
|
11368
11371
|
if (!(other instanceof _SemVer)) {
|
|
11369
11372
|
other = new _SemVer(other, this.options);
|
|
11370
11373
|
}
|
|
11371
|
-
|
|
11374
|
+
if (this.major < other.major) {
|
|
11375
|
+
return -1;
|
|
11376
|
+
}
|
|
11377
|
+
if (this.major > other.major) {
|
|
11378
|
+
return 1;
|
|
11379
|
+
}
|
|
11380
|
+
if (this.minor < other.minor) {
|
|
11381
|
+
return -1;
|
|
11382
|
+
}
|
|
11383
|
+
if (this.minor > other.minor) {
|
|
11384
|
+
return 1;
|
|
11385
|
+
}
|
|
11386
|
+
if (this.patch < other.patch) {
|
|
11387
|
+
return -1;
|
|
11388
|
+
}
|
|
11389
|
+
if (this.patch > other.patch) {
|
|
11390
|
+
return 1;
|
|
11391
|
+
}
|
|
11392
|
+
return 0;
|
|
11372
11393
|
}
|
|
11373
11394
|
comparePre(other) {
|
|
11374
11395
|
if (!(other instanceof _SemVer)) {
|
|
@@ -11539,7 +11560,7 @@ var require_semver = __commonJS2({
|
|
|
11539
11560
|
}
|
|
11540
11561
|
});
|
|
11541
11562
|
var require_parse = __commonJS2({
|
|
11542
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11563
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/parse.js"(exports$1, module) {
|
|
11543
11564
|
var SemVer = require_semver();
|
|
11544
11565
|
var parse = (version2, options, throwErrors = false) => {
|
|
11545
11566
|
if (version2 instanceof SemVer) {
|
|
@@ -11558,7 +11579,7 @@ var require_parse = __commonJS2({
|
|
|
11558
11579
|
}
|
|
11559
11580
|
});
|
|
11560
11581
|
var require_valid = __commonJS2({
|
|
11561
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11582
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/valid.js"(exports$1, module) {
|
|
11562
11583
|
var parse = require_parse();
|
|
11563
11584
|
var valid = (version2, options) => {
|
|
11564
11585
|
const v2 = parse(version2, options);
|
|
@@ -11568,7 +11589,7 @@ var require_valid = __commonJS2({
|
|
|
11568
11589
|
}
|
|
11569
11590
|
});
|
|
11570
11591
|
var require_clean = __commonJS2({
|
|
11571
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11592
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/clean.js"(exports$1, module) {
|
|
11572
11593
|
var parse = require_parse();
|
|
11573
11594
|
var clean = (version2, options) => {
|
|
11574
11595
|
const s3 = parse(version2.trim().replace(/^[=v]+/, ""), options);
|
|
@@ -11578,7 +11599,7 @@ var require_clean = __commonJS2({
|
|
|
11578
11599
|
}
|
|
11579
11600
|
});
|
|
11580
11601
|
var require_inc = __commonJS2({
|
|
11581
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11602
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/inc.js"(exports$1, module) {
|
|
11582
11603
|
var SemVer = require_semver();
|
|
11583
11604
|
var inc = (version2, release, options, identifier, identifierBase) => {
|
|
11584
11605
|
if (typeof options === "string") {
|
|
@@ -11599,7 +11620,7 @@ var require_inc = __commonJS2({
|
|
|
11599
11620
|
}
|
|
11600
11621
|
});
|
|
11601
11622
|
var require_diff = __commonJS2({
|
|
11602
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11623
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/diff.js"(exports$1, module) {
|
|
11603
11624
|
var parse = require_parse();
|
|
11604
11625
|
var diff = (version1, version2) => {
|
|
11605
11626
|
const v1 = parse(version1, null, true);
|
|
@@ -11640,28 +11661,28 @@ var require_diff = __commonJS2({
|
|
|
11640
11661
|
}
|
|
11641
11662
|
});
|
|
11642
11663
|
var require_major = __commonJS2({
|
|
11643
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11664
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/major.js"(exports$1, module) {
|
|
11644
11665
|
var SemVer = require_semver();
|
|
11645
11666
|
var major = (a2, loose) => new SemVer(a2, loose).major;
|
|
11646
11667
|
module.exports = major;
|
|
11647
11668
|
}
|
|
11648
11669
|
});
|
|
11649
11670
|
var require_minor = __commonJS2({
|
|
11650
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11671
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/minor.js"(exports$1, module) {
|
|
11651
11672
|
var SemVer = require_semver();
|
|
11652
11673
|
var minor = (a2, loose) => new SemVer(a2, loose).minor;
|
|
11653
11674
|
module.exports = minor;
|
|
11654
11675
|
}
|
|
11655
11676
|
});
|
|
11656
11677
|
var require_patch = __commonJS2({
|
|
11657
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11678
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/patch.js"(exports$1, module) {
|
|
11658
11679
|
var SemVer = require_semver();
|
|
11659
11680
|
var patch = (a2, loose) => new SemVer(a2, loose).patch;
|
|
11660
11681
|
module.exports = patch;
|
|
11661
11682
|
}
|
|
11662
11683
|
});
|
|
11663
11684
|
var require_prerelease = __commonJS2({
|
|
11664
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11685
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/prerelease.js"(exports$1, module) {
|
|
11665
11686
|
var parse = require_parse();
|
|
11666
11687
|
var prerelease = (version2, options) => {
|
|
11667
11688
|
const parsed = parse(version2, options);
|
|
@@ -11671,28 +11692,28 @@ var require_prerelease = __commonJS2({
|
|
|
11671
11692
|
}
|
|
11672
11693
|
});
|
|
11673
11694
|
var require_compare = __commonJS2({
|
|
11674
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11695
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare.js"(exports$1, module) {
|
|
11675
11696
|
var SemVer = require_semver();
|
|
11676
11697
|
var compare = (a2, b2, loose) => new SemVer(a2, loose).compare(new SemVer(b2, loose));
|
|
11677
11698
|
module.exports = compare;
|
|
11678
11699
|
}
|
|
11679
11700
|
});
|
|
11680
11701
|
var require_rcompare = __commonJS2({
|
|
11681
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11702
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rcompare.js"(exports$1, module) {
|
|
11682
11703
|
var compare = require_compare();
|
|
11683
11704
|
var rcompare = (a2, b2, loose) => compare(b2, a2, loose);
|
|
11684
11705
|
module.exports = rcompare;
|
|
11685
11706
|
}
|
|
11686
11707
|
});
|
|
11687
11708
|
var require_compare_loose = __commonJS2({
|
|
11688
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11709
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-loose.js"(exports$1, module) {
|
|
11689
11710
|
var compare = require_compare();
|
|
11690
11711
|
var compareLoose = (a2, b2) => compare(a2, b2, true);
|
|
11691
11712
|
module.exports = compareLoose;
|
|
11692
11713
|
}
|
|
11693
11714
|
});
|
|
11694
11715
|
var require_compare_build = __commonJS2({
|
|
11695
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11716
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-build.js"(exports$1, module) {
|
|
11696
11717
|
var SemVer = require_semver();
|
|
11697
11718
|
var compareBuild = (a2, b2, loose) => {
|
|
11698
11719
|
const versionA = new SemVer(a2, loose);
|
|
@@ -11703,63 +11724,63 @@ var require_compare_build = __commonJS2({
|
|
|
11703
11724
|
}
|
|
11704
11725
|
});
|
|
11705
11726
|
var require_sort = __commonJS2({
|
|
11706
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11727
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/sort.js"(exports$1, module) {
|
|
11707
11728
|
var compareBuild = require_compare_build();
|
|
11708
11729
|
var sort = (list, loose) => list.sort((a2, b2) => compareBuild(a2, b2, loose));
|
|
11709
11730
|
module.exports = sort;
|
|
11710
11731
|
}
|
|
11711
11732
|
});
|
|
11712
11733
|
var require_rsort = __commonJS2({
|
|
11713
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11734
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rsort.js"(exports$1, module) {
|
|
11714
11735
|
var compareBuild = require_compare_build();
|
|
11715
11736
|
var rsort = (list, loose) => list.sort((a2, b2) => compareBuild(b2, a2, loose));
|
|
11716
11737
|
module.exports = rsort;
|
|
11717
11738
|
}
|
|
11718
11739
|
});
|
|
11719
11740
|
var require_gt = __commonJS2({
|
|
11720
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11741
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gt.js"(exports$1, module) {
|
|
11721
11742
|
var compare = require_compare();
|
|
11722
11743
|
var gt4 = (a2, b2, loose) => compare(a2, b2, loose) > 0;
|
|
11723
11744
|
module.exports = gt4;
|
|
11724
11745
|
}
|
|
11725
11746
|
});
|
|
11726
11747
|
var require_lt = __commonJS2({
|
|
11727
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11748
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lt.js"(exports$1, module) {
|
|
11728
11749
|
var compare = require_compare();
|
|
11729
11750
|
var lt3 = (a2, b2, loose) => compare(a2, b2, loose) < 0;
|
|
11730
11751
|
module.exports = lt3;
|
|
11731
11752
|
}
|
|
11732
11753
|
});
|
|
11733
11754
|
var require_eq = __commonJS2({
|
|
11734
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11755
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/eq.js"(exports$1, module) {
|
|
11735
11756
|
var compare = require_compare();
|
|
11736
11757
|
var eq = (a2, b2, loose) => compare(a2, b2, loose) === 0;
|
|
11737
11758
|
module.exports = eq;
|
|
11738
11759
|
}
|
|
11739
11760
|
});
|
|
11740
11761
|
var require_neq = __commonJS2({
|
|
11741
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11762
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/neq.js"(exports$1, module) {
|
|
11742
11763
|
var compare = require_compare();
|
|
11743
11764
|
var neq = (a2, b2, loose) => compare(a2, b2, loose) !== 0;
|
|
11744
11765
|
module.exports = neq;
|
|
11745
11766
|
}
|
|
11746
11767
|
});
|
|
11747
11768
|
var require_gte = __commonJS2({
|
|
11748
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11769
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gte.js"(exports$1, module) {
|
|
11749
11770
|
var compare = require_compare();
|
|
11750
11771
|
var gte = (a2, b2, loose) => compare(a2, b2, loose) >= 0;
|
|
11751
11772
|
module.exports = gte;
|
|
11752
11773
|
}
|
|
11753
11774
|
});
|
|
11754
11775
|
var require_lte = __commonJS2({
|
|
11755
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11776
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lte.js"(exports$1, module) {
|
|
11756
11777
|
var compare = require_compare();
|
|
11757
11778
|
var lte = (a2, b2, loose) => compare(a2, b2, loose) <= 0;
|
|
11758
11779
|
module.exports = lte;
|
|
11759
11780
|
}
|
|
11760
11781
|
});
|
|
11761
11782
|
var require_cmp = __commonJS2({
|
|
11762
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11783
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/cmp.js"(exports$1, module) {
|
|
11763
11784
|
var eq = require_eq();
|
|
11764
11785
|
var neq = require_neq();
|
|
11765
11786
|
var gt4 = require_gt();
|
|
@@ -11806,7 +11827,7 @@ var require_cmp = __commonJS2({
|
|
|
11806
11827
|
}
|
|
11807
11828
|
});
|
|
11808
11829
|
var require_coerce = __commonJS2({
|
|
11809
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11830
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/coerce.js"(exports$1, module) {
|
|
11810
11831
|
var SemVer = require_semver();
|
|
11811
11832
|
var parse = require_parse();
|
|
11812
11833
|
var { safeRe: re3, t: t2 } = require_re();
|
|
@@ -11848,8 +11869,46 @@ var require_coerce = __commonJS2({
|
|
|
11848
11869
|
module.exports = coerce;
|
|
11849
11870
|
}
|
|
11850
11871
|
});
|
|
11872
|
+
var require_truncate = __commonJS2({
|
|
11873
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/truncate.js"(exports$1, module) {
|
|
11874
|
+
var parse = require_parse();
|
|
11875
|
+
var constants4 = require_constants();
|
|
11876
|
+
var SemVer = require_semver();
|
|
11877
|
+
var truncate = (version2, truncation, options) => {
|
|
11878
|
+
if (!constants4.RELEASE_TYPES.includes(truncation)) {
|
|
11879
|
+
return null;
|
|
11880
|
+
}
|
|
11881
|
+
const clonedVersion = cloneInputVersion(version2, options);
|
|
11882
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
11883
|
+
};
|
|
11884
|
+
var cloneInputVersion = (version2, options) => {
|
|
11885
|
+
const versionStringToParse = version2 instanceof SemVer ? version2.version : version2;
|
|
11886
|
+
return parse(versionStringToParse, options);
|
|
11887
|
+
};
|
|
11888
|
+
var doTruncation = (version2, truncation) => {
|
|
11889
|
+
if (isPrerelease(truncation)) {
|
|
11890
|
+
return version2.version;
|
|
11891
|
+
}
|
|
11892
|
+
version2.prerelease = [];
|
|
11893
|
+
switch (truncation) {
|
|
11894
|
+
case "major":
|
|
11895
|
+
version2.minor = 0;
|
|
11896
|
+
version2.patch = 0;
|
|
11897
|
+
break;
|
|
11898
|
+
case "minor":
|
|
11899
|
+
version2.patch = 0;
|
|
11900
|
+
break;
|
|
11901
|
+
}
|
|
11902
|
+
return version2.format();
|
|
11903
|
+
};
|
|
11904
|
+
var isPrerelease = (type) => {
|
|
11905
|
+
return type.startsWith("pre");
|
|
11906
|
+
};
|
|
11907
|
+
module.exports = truncate;
|
|
11908
|
+
}
|
|
11909
|
+
});
|
|
11851
11910
|
var require_lrucache = __commonJS2({
|
|
11852
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11911
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/lrucache.js"(exports$1, module) {
|
|
11853
11912
|
var LRUCache = class {
|
|
11854
11913
|
constructor() {
|
|
11855
11914
|
this.max = 1e3;
|
|
@@ -11884,7 +11943,7 @@ var require_lrucache = __commonJS2({
|
|
|
11884
11943
|
}
|
|
11885
11944
|
});
|
|
11886
11945
|
var require_range = __commonJS2({
|
|
11887
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11946
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/range.js"(exports$1, module) {
|
|
11888
11947
|
var SPACE_CHARACTERS = /\s+/g;
|
|
11889
11948
|
var Range = class _Range {
|
|
11890
11949
|
constructor(range, options) {
|
|
@@ -12054,6 +12113,7 @@ var require_range = __commonJS2({
|
|
|
12054
12113
|
return result;
|
|
12055
12114
|
};
|
|
12056
12115
|
var parseComparator = (comp, options) => {
|
|
12116
|
+
comp = comp.replace(re3[t2.BUILD], "");
|
|
12057
12117
|
debug("comp", comp, options);
|
|
12058
12118
|
comp = replaceCarets(comp, options);
|
|
12059
12119
|
debug("caret", comp);
|
|
@@ -12257,7 +12317,7 @@ var require_range = __commonJS2({
|
|
|
12257
12317
|
}
|
|
12258
12318
|
});
|
|
12259
12319
|
var require_comparator = __commonJS2({
|
|
12260
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12320
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/comparator.js"(exports$1, module) {
|
|
12261
12321
|
var ANY = Symbol("SemVer ANY");
|
|
12262
12322
|
var Comparator = class _Comparator {
|
|
12263
12323
|
static get ANY() {
|
|
@@ -12367,7 +12427,7 @@ var require_comparator = __commonJS2({
|
|
|
12367
12427
|
}
|
|
12368
12428
|
});
|
|
12369
12429
|
var require_satisfies = __commonJS2({
|
|
12370
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12430
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/satisfies.js"(exports$1, module) {
|
|
12371
12431
|
var Range = require_range();
|
|
12372
12432
|
var satisfies = (version2, range, options) => {
|
|
12373
12433
|
try {
|
|
@@ -12381,14 +12441,14 @@ var require_satisfies = __commonJS2({
|
|
|
12381
12441
|
}
|
|
12382
12442
|
});
|
|
12383
12443
|
var require_to_comparators = __commonJS2({
|
|
12384
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12444
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/to-comparators.js"(exports$1, module) {
|
|
12385
12445
|
var Range = require_range();
|
|
12386
12446
|
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c3) => c3.value).join(" ").trim().split(" "));
|
|
12387
12447
|
module.exports = toComparators;
|
|
12388
12448
|
}
|
|
12389
12449
|
});
|
|
12390
12450
|
var require_max_satisfying = __commonJS2({
|
|
12391
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12451
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/max-satisfying.js"(exports$1, module) {
|
|
12392
12452
|
var SemVer = require_semver();
|
|
12393
12453
|
var Range = require_range();
|
|
12394
12454
|
var maxSatisfying = (versions, range, options) => {
|
|
@@ -12414,7 +12474,7 @@ var require_max_satisfying = __commonJS2({
|
|
|
12414
12474
|
}
|
|
12415
12475
|
});
|
|
12416
12476
|
var require_min_satisfying = __commonJS2({
|
|
12417
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12477
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-satisfying.js"(exports$1, module) {
|
|
12418
12478
|
var SemVer = require_semver();
|
|
12419
12479
|
var Range = require_range();
|
|
12420
12480
|
var minSatisfying = (versions, range, options) => {
|
|
@@ -12440,7 +12500,7 @@ var require_min_satisfying = __commonJS2({
|
|
|
12440
12500
|
}
|
|
12441
12501
|
});
|
|
12442
12502
|
var require_min_version = __commonJS2({
|
|
12443
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12503
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-version.js"(exports$1, module) {
|
|
12444
12504
|
var SemVer = require_semver();
|
|
12445
12505
|
var Range = require_range();
|
|
12446
12506
|
var gt4 = require_gt();
|
|
@@ -12496,7 +12556,7 @@ var require_min_version = __commonJS2({
|
|
|
12496
12556
|
}
|
|
12497
12557
|
});
|
|
12498
12558
|
var require_valid2 = __commonJS2({
|
|
12499
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12559
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/valid.js"(exports$1, module) {
|
|
12500
12560
|
var Range = require_range();
|
|
12501
12561
|
var validRange = (range, options) => {
|
|
12502
12562
|
try {
|
|
@@ -12509,7 +12569,7 @@ var require_valid2 = __commonJS2({
|
|
|
12509
12569
|
}
|
|
12510
12570
|
});
|
|
12511
12571
|
var require_outside = __commonJS2({
|
|
12512
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12572
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/outside.js"(exports$1, module) {
|
|
12513
12573
|
var SemVer = require_semver();
|
|
12514
12574
|
var Comparator = require_comparator();
|
|
12515
12575
|
var { ANY } = Comparator;
|
|
@@ -12575,21 +12635,21 @@ var require_outside = __commonJS2({
|
|
|
12575
12635
|
}
|
|
12576
12636
|
});
|
|
12577
12637
|
var require_gtr = __commonJS2({
|
|
12578
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12638
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/gtr.js"(exports$1, module) {
|
|
12579
12639
|
var outside = require_outside();
|
|
12580
12640
|
var gtr = (version2, range, options) => outside(version2, range, ">", options);
|
|
12581
12641
|
module.exports = gtr;
|
|
12582
12642
|
}
|
|
12583
12643
|
});
|
|
12584
12644
|
var require_ltr = __commonJS2({
|
|
12585
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12645
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/ltr.js"(exports$1, module) {
|
|
12586
12646
|
var outside = require_outside();
|
|
12587
12647
|
var ltr = (version2, range, options) => outside(version2, range, "<", options);
|
|
12588
12648
|
module.exports = ltr;
|
|
12589
12649
|
}
|
|
12590
12650
|
});
|
|
12591
12651
|
var require_intersects = __commonJS2({
|
|
12592
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12652
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/intersects.js"(exports$1, module) {
|
|
12593
12653
|
var Range = require_range();
|
|
12594
12654
|
var intersects = (r1, r2, options) => {
|
|
12595
12655
|
r1 = new Range(r1, options);
|
|
@@ -12600,7 +12660,7 @@ var require_intersects = __commonJS2({
|
|
|
12600
12660
|
}
|
|
12601
12661
|
});
|
|
12602
12662
|
var require_simplify = __commonJS2({
|
|
12603
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12663
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/simplify.js"(exports$1, module) {
|
|
12604
12664
|
var satisfies = require_satisfies();
|
|
12605
12665
|
var compare = require_compare();
|
|
12606
12666
|
module.exports = (versions, range, options) => {
|
|
@@ -12647,7 +12707,7 @@ var require_simplify = __commonJS2({
|
|
|
12647
12707
|
}
|
|
12648
12708
|
});
|
|
12649
12709
|
var require_subset = __commonJS2({
|
|
12650
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12710
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/subset.js"(exports$1, module) {
|
|
12651
12711
|
var Range = require_range();
|
|
12652
12712
|
var Comparator = require_comparator();
|
|
12653
12713
|
var { ANY } = Comparator;
|
|
@@ -12806,7 +12866,7 @@ var require_subset = __commonJS2({
|
|
|
12806
12866
|
}
|
|
12807
12867
|
});
|
|
12808
12868
|
var require_semver2 = __commonJS2({
|
|
12809
|
-
"../../node_modules/.pnpm/semver@7.
|
|
12869
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/index.js"(exports$1, module) {
|
|
12810
12870
|
var internalRe = require_re();
|
|
12811
12871
|
var constants4 = require_constants();
|
|
12812
12872
|
var SemVer = require_semver();
|
|
@@ -12834,6 +12894,7 @@ var require_semver2 = __commonJS2({
|
|
|
12834
12894
|
var lte = require_lte();
|
|
12835
12895
|
var cmp = require_cmp();
|
|
12836
12896
|
var coerce = require_coerce();
|
|
12897
|
+
var truncate = require_truncate();
|
|
12837
12898
|
var Comparator = require_comparator();
|
|
12838
12899
|
var Range = require_range();
|
|
12839
12900
|
var satisfies = require_satisfies();
|
|
@@ -12872,6 +12933,7 @@ var require_semver2 = __commonJS2({
|
|
|
12872
12933
|
lte,
|
|
12873
12934
|
cmp,
|
|
12874
12935
|
coerce,
|
|
12936
|
+
truncate,
|
|
12875
12937
|
Comparator,
|
|
12876
12938
|
Range,
|
|
12877
12939
|
satisfies,
|
|
@@ -12905,12 +12967,12 @@ function createModulerModifier() {
|
|
|
12905
12967
|
return frames;
|
|
12906
12968
|
};
|
|
12907
12969
|
}
|
|
12908
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
12970
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? path14.dirname(process.argv[1]) : process.cwd(), isWindows = "\\" === path14.sep) {
|
|
12909
12971
|
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
12910
12972
|
return (filename) => {
|
|
12911
12973
|
if (!filename) return;
|
|
12912
12974
|
const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
|
|
12913
|
-
let { dir, base: file, ext } =
|
|
12975
|
+
let { dir, base: file, ext } = path14.posix.parse(normalizedFilename);
|
|
12914
12976
|
if (".js" === ext || ".mjs" === ext || ".cjs" === ext) file = file.slice(0, -1 * ext.length);
|
|
12915
12977
|
const decodedFile = decodeURIComponent(file);
|
|
12916
12978
|
if (!dir) dir = ".";
|
|
@@ -13997,7 +14059,7 @@ var Temp = {
|
|
|
13997
14059
|
}
|
|
13998
14060
|
},
|
|
13999
14061
|
truncate: (filePath) => {
|
|
14000
|
-
const basename =
|
|
14062
|
+
const basename = path14__default.default.basename(filePath);
|
|
14001
14063
|
if (basename.length <= LIMIT_BASENAME_LENGTH)
|
|
14002
14064
|
return filePath;
|
|
14003
14065
|
const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename);
|
|
@@ -14042,7 +14104,7 @@ function capture(event, properties) {
|
|
|
14042
14104
|
}
|
|
14043
14105
|
|
|
14044
14106
|
// src/create-nextly.ts
|
|
14045
|
-
var
|
|
14107
|
+
var import_fs_extra13 = __toESM(require_lib());
|
|
14046
14108
|
var import_picocolors3 = __toESM(require_picocolors2());
|
|
14047
14109
|
|
|
14048
14110
|
// src/generators/admin.ts
|
|
@@ -14050,9 +14112,6 @@ var import_fs_extra = __toESM(require_lib());
|
|
|
14050
14112
|
var ADMIN_PAGE_TEMPLATE = `"use client";
|
|
14051
14113
|
|
|
14052
14114
|
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
14115
|
import { RootLayout, QueryProvider, ErrorBoundary } from "@nextlyhq/admin";
|
|
14057
14116
|
|
|
14058
14117
|
export default function AdminPage() {
|
|
@@ -14094,9 +14153,9 @@ export default function AdminLayout({
|
|
|
14094
14153
|
`;
|
|
14095
14154
|
}
|
|
14096
14155
|
async function generateAdminPage(cwd, projectInfo) {
|
|
14097
|
-
const adminDir =
|
|
14098
|
-
const pagePath =
|
|
14099
|
-
const layoutPath =
|
|
14156
|
+
const adminDir = path14__default.default.join(cwd, projectInfo.appDir, "admin", "[[...params]]");
|
|
14157
|
+
const pagePath = path14__default.default.join(adminDir, "page.tsx");
|
|
14158
|
+
const layoutPath = path14__default.default.join(adminDir, "layout.tsx");
|
|
14100
14159
|
if (await import_fs_extra.default.pathExists(pagePath)) {
|
|
14101
14160
|
throw new Error(
|
|
14102
14161
|
"Admin page already exists at admin/[[...params]]/page.tsx"
|
|
@@ -14149,7 +14208,7 @@ ${singlesLine}
|
|
|
14149
14208
|
return template;
|
|
14150
14209
|
}
|
|
14151
14210
|
async function generateConfig(cwd, projectType) {
|
|
14152
|
-
const configPath =
|
|
14211
|
+
const configPath = path14__default.default.join(cwd, "nextly.config.ts");
|
|
14153
14212
|
if (await import_fs_extra2.default.pathExists(configPath)) {
|
|
14154
14213
|
throw new Error(
|
|
14155
14214
|
"nextly.config.ts already exists. Please remove it first or run in a fresh project."
|
|
@@ -14180,8 +14239,8 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000
|
|
|
14180
14239
|
`;
|
|
14181
14240
|
}
|
|
14182
14241
|
async function generateEnv(cwd, database) {
|
|
14183
|
-
const envPath =
|
|
14184
|
-
const envExamplePath =
|
|
14242
|
+
const envPath = path14__default.default.join(cwd, ".env");
|
|
14243
|
+
const envExamplePath = path14__default.default.join(cwd, ".env.example");
|
|
14185
14244
|
const envContent = getEnvTemplate(database);
|
|
14186
14245
|
await import_fs_extra3.default.writeFile(envExamplePath, envContent, "utf-8");
|
|
14187
14246
|
if (await import_fs_extra3.default.pathExists(envPath)) {
|
|
@@ -14245,50 +14304,70 @@ var HEALTH_ROUTE_TEMPLATE = `/**
|
|
|
14245
14304
|
export { GET, HEAD } from "nextly/api/health";
|
|
14246
14305
|
`;
|
|
14247
14306
|
async function generateMediaRoutes(cwd, projectInfo) {
|
|
14248
|
-
const apiDir =
|
|
14249
|
-
const mediaDir =
|
|
14307
|
+
const apiDir = path14__default.default.join(cwd, projectInfo.appDir, "api");
|
|
14308
|
+
const mediaDir = path14__default.default.join(apiDir, "media");
|
|
14250
14309
|
if (await import_fs_extra4.default.pathExists(mediaDir)) {
|
|
14251
14310
|
throw new Error(
|
|
14252
14311
|
"Media API routes already exist at api/media. Please remove them first."
|
|
14253
14312
|
);
|
|
14254
14313
|
}
|
|
14255
|
-
const mediaRoutePath =
|
|
14314
|
+
const mediaRoutePath = path14__default.default.join(apiDir, "media", "[[...path]]", "route.ts");
|
|
14256
14315
|
const configImportPath = getConfigImportPath(
|
|
14257
14316
|
projectInfo.appDir.startsWith("src")
|
|
14258
14317
|
);
|
|
14259
|
-
await import_fs_extra4.default.ensureDir(
|
|
14318
|
+
await import_fs_extra4.default.ensureDir(path14__default.default.dirname(mediaRoutePath));
|
|
14260
14319
|
await import_fs_extra4.default.writeFile(
|
|
14261
14320
|
mediaRoutePath,
|
|
14262
14321
|
MEDIA_CATCH_ALL_TEMPLATE(configImportPath),
|
|
14263
14322
|
"utf-8"
|
|
14264
14323
|
);
|
|
14265
|
-
const healthRoutePath =
|
|
14266
|
-
await import_fs_extra4.default.ensureDir(
|
|
14324
|
+
const healthRoutePath = path14__default.default.join(apiDir, "health", "route.ts");
|
|
14325
|
+
await import_fs_extra4.default.ensureDir(path14__default.default.dirname(healthRoutePath));
|
|
14267
14326
|
await import_fs_extra4.default.writeFile(healthRoutePath, HEALTH_ROUTE_TEMPLATE, "utf-8");
|
|
14268
14327
|
}
|
|
14269
14328
|
|
|
14270
14329
|
// src/generators/next-config.ts
|
|
14271
14330
|
var import_fs_extra5 = __toESM(require_lib());
|
|
14272
|
-
var
|
|
14331
|
+
var COMMON_SERVER_EXTERNAL_PACKAGES = [
|
|
14273
14332
|
"nextly",
|
|
14274
14333
|
"@nextlyhq/adapter-drizzle",
|
|
14275
|
-
"@nextlyhq/adapter-postgres",
|
|
14276
|
-
"@nextlyhq/adapter-mysql",
|
|
14277
|
-
"@nextlyhq/adapter-sqlite",
|
|
14278
14334
|
"drizzle-orm",
|
|
14279
14335
|
"drizzle-kit",
|
|
14280
|
-
"pg",
|
|
14281
|
-
"mysql2",
|
|
14282
|
-
"better-sqlite3",
|
|
14283
14336
|
"bcryptjs",
|
|
14284
14337
|
"sharp",
|
|
14285
14338
|
"esbuild"
|
|
14286
14339
|
];
|
|
14287
|
-
|
|
14340
|
+
var DATABASE_SERVER_EXTERNAL_PACKAGES = {
|
|
14341
|
+
postgresql: ["@nextlyhq/adapter-postgres", "pg"],
|
|
14342
|
+
mysql: ["@nextlyhq/adapter-mysql", "mysql2"],
|
|
14343
|
+
sqlite: ["@nextlyhq/adapter-sqlite", "better-sqlite3"]
|
|
14344
|
+
};
|
|
14345
|
+
function getServerExternalPackages(database) {
|
|
14346
|
+
return [
|
|
14347
|
+
...COMMON_SERVER_EXTERNAL_PACKAGES,
|
|
14348
|
+
...DATABASE_SERVER_EXTERNAL_PACKAGES[database.type]
|
|
14349
|
+
];
|
|
14350
|
+
}
|
|
14351
|
+
function buildNextConfigTemplate(database) {
|
|
14352
|
+
const packagesArray = JSON.stringify(
|
|
14353
|
+
getServerExternalPackages(database),
|
|
14354
|
+
null,
|
|
14355
|
+
2
|
|
14356
|
+
).replace(/\n/g, "\n ");
|
|
14357
|
+
return `import type { NextConfig } from "next";
|
|
14358
|
+
|
|
14359
|
+
const nextConfig: NextConfig = {
|
|
14360
|
+
serverExternalPackages: ${packagesArray},
|
|
14361
|
+
};
|
|
14362
|
+
|
|
14363
|
+
export default nextConfig;
|
|
14364
|
+
`;
|
|
14365
|
+
}
|
|
14366
|
+
async function patchNextConfig(cwd, database) {
|
|
14288
14367
|
const candidates = ["next.config.ts", "next.config.mjs", "next.config.js"];
|
|
14289
14368
|
let configPath = null;
|
|
14290
14369
|
for (const name of candidates) {
|
|
14291
|
-
const full =
|
|
14370
|
+
const full = path14__default.default.join(cwd, name);
|
|
14292
14371
|
if (await import_fs_extra5.default.pathExists(full)) {
|
|
14293
14372
|
configPath = full;
|
|
14294
14373
|
break;
|
|
@@ -14301,7 +14380,11 @@ async function patchNextConfig(cwd) {
|
|
|
14301
14380
|
if (content.includes("serverExternalPackages")) {
|
|
14302
14381
|
return;
|
|
14303
14382
|
}
|
|
14304
|
-
const packagesArray = JSON.stringify(
|
|
14383
|
+
const packagesArray = JSON.stringify(
|
|
14384
|
+
getServerExternalPackages(database),
|
|
14385
|
+
null,
|
|
14386
|
+
2
|
|
14387
|
+
).replace(/\n/g, "\n ");
|
|
14305
14388
|
const configObjectPattern = /(const\s+\w+\s*(?::\s*NextConfig\s*)?=\s*\{)/;
|
|
14306
14389
|
if (configObjectPattern.test(content)) {
|
|
14307
14390
|
const patched = content.replace(
|
|
@@ -14341,7 +14424,7 @@ export const DELETE = handlers.DELETE;
|
|
|
14341
14424
|
export const OPTIONS = handlers.OPTIONS;
|
|
14342
14425
|
`;
|
|
14343
14426
|
async function generateRoutes(cwd, projectInfo) {
|
|
14344
|
-
const routePath =
|
|
14427
|
+
const routePath = path14__default.default.join(
|
|
14345
14428
|
cwd,
|
|
14346
14429
|
projectInfo.appDir,
|
|
14347
14430
|
"admin",
|
|
@@ -14354,7 +14437,7 @@ async function generateRoutes(cwd, projectInfo) {
|
|
|
14354
14437
|
"API route already exists at admin/api/[[...params]]/route.ts"
|
|
14355
14438
|
);
|
|
14356
14439
|
}
|
|
14357
|
-
await import_fs_extra6.default.ensureDir(
|
|
14440
|
+
await import_fs_extra6.default.ensureDir(path14__default.default.dirname(routePath));
|
|
14358
14441
|
await import_fs_extra6.default.writeFile(routePath, API_ROUTE_TEMPLATE, "utf-8");
|
|
14359
14442
|
}
|
|
14360
14443
|
|
|
@@ -14362,13 +14445,13 @@ async function generateRoutes(cwd, projectInfo) {
|
|
|
14362
14445
|
var import_fs_extra7 = __toESM(require_lib());
|
|
14363
14446
|
async function generateTypesDirectory(cwd, projectInfo) {
|
|
14364
14447
|
const baseDir = projectInfo.srcDir ? "src" : ".";
|
|
14365
|
-
const typesDir =
|
|
14448
|
+
const typesDir = path14__default.default.join(cwd, baseDir, "types", "generated");
|
|
14366
14449
|
await import_fs_extra7.default.ensureDir(typesDir);
|
|
14367
|
-
const gitkeepPath =
|
|
14450
|
+
const gitkeepPath = path14__default.default.join(typesDir, ".gitkeep");
|
|
14368
14451
|
if (!await import_fs_extra7.default.pathExists(gitkeepPath)) {
|
|
14369
14452
|
await import_fs_extra7.default.writeFile(gitkeepPath, "", "utf-8");
|
|
14370
14453
|
}
|
|
14371
|
-
const placeholderPath =
|
|
14454
|
+
const placeholderPath = path14__default.default.join(typesDir, "nextly-types.ts");
|
|
14372
14455
|
if (!await import_fs_extra7.default.pathExists(placeholderPath)) {
|
|
14373
14456
|
const placeholderContent = `/**
|
|
14374
14457
|
* Nextly Generated Types
|
|
@@ -15179,12 +15262,12 @@ function toPath(urlOrPath) {
|
|
|
15179
15262
|
function traversePathUp(startPath) {
|
|
15180
15263
|
return {
|
|
15181
15264
|
*[Symbol.iterator]() {
|
|
15182
|
-
let currentPath =
|
|
15265
|
+
let currentPath = path14__default.default.resolve(toPath(startPath));
|
|
15183
15266
|
let previousPath;
|
|
15184
15267
|
while (previousPath !== currentPath) {
|
|
15185
15268
|
yield currentPath;
|
|
15186
15269
|
previousPath = currentPath;
|
|
15187
|
-
currentPath =
|
|
15270
|
+
currentPath = path14__default.default.resolve(currentPath, "..");
|
|
15188
15271
|
}
|
|
15189
15272
|
}
|
|
15190
15273
|
};
|
|
@@ -15198,27 +15281,27 @@ var npmRunPath = ({
|
|
|
15198
15281
|
execPath: execPath2 = process4__default.default.execPath,
|
|
15199
15282
|
addExecPath = true
|
|
15200
15283
|
} = {}) => {
|
|
15201
|
-
const cwdPath =
|
|
15284
|
+
const cwdPath = path14__default.default.resolve(toPath(cwd));
|
|
15202
15285
|
const result = [];
|
|
15203
|
-
const pathParts = pathOption.split(
|
|
15286
|
+
const pathParts = pathOption.split(path14__default.default.delimiter);
|
|
15204
15287
|
if (preferLocal) {
|
|
15205
15288
|
applyPreferLocal(result, pathParts, cwdPath);
|
|
15206
15289
|
}
|
|
15207
15290
|
if (addExecPath) {
|
|
15208
15291
|
applyExecPath(result, pathParts, execPath2, cwdPath);
|
|
15209
15292
|
}
|
|
15210
|
-
return pathOption === "" || pathOption ===
|
|
15293
|
+
return pathOption === "" || pathOption === path14__default.default.delimiter ? `${result.join(path14__default.default.delimiter)}${pathOption}` : [...result, pathOption].join(path14__default.default.delimiter);
|
|
15211
15294
|
};
|
|
15212
15295
|
var applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
15213
15296
|
for (const directory of traversePathUp(cwdPath)) {
|
|
15214
|
-
const pathPart =
|
|
15297
|
+
const pathPart = path14__default.default.join(directory, "node_modules/.bin");
|
|
15215
15298
|
if (!pathParts.includes(pathPart)) {
|
|
15216
15299
|
result.push(pathPart);
|
|
15217
15300
|
}
|
|
15218
15301
|
}
|
|
15219
15302
|
};
|
|
15220
15303
|
var applyExecPath = (result, pathParts, execPath2, cwdPath) => {
|
|
15221
|
-
const pathPart =
|
|
15304
|
+
const pathPart = path14__default.default.resolve(cwdPath, toPath(execPath2), "..");
|
|
15222
15305
|
if (!pathParts.includes(pathPart)) {
|
|
15223
15306
|
result.push(pathPart);
|
|
15224
15307
|
}
|
|
@@ -16351,7 +16434,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
16351
16434
|
throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
|
|
16352
16435
|
}
|
|
16353
16436
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The "nodePath" option');
|
|
16354
|
-
const resolvedNodePath =
|
|
16437
|
+
const resolvedNodePath = path14__default.default.resolve(cwd, normalizedNodePath);
|
|
16355
16438
|
const newOptions = {
|
|
16356
16439
|
...options,
|
|
16357
16440
|
nodePath: resolvedNodePath,
|
|
@@ -16361,7 +16444,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
16361
16444
|
if (!shouldHandleNode) {
|
|
16362
16445
|
return [file, commandArguments, newOptions];
|
|
16363
16446
|
}
|
|
16364
|
-
if (
|
|
16447
|
+
if (path14__default.default.basename(file, ".exe") === "node") {
|
|
16365
16448
|
throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
|
|
16366
16449
|
}
|
|
16367
16450
|
return [
|
|
@@ -16447,7 +16530,7 @@ var ENCODING_ALIASES = {
|
|
|
16447
16530
|
var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding);
|
|
16448
16531
|
var normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
16449
16532
|
const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
|
|
16450
|
-
return
|
|
16533
|
+
return path14__default.default.resolve(cwdString);
|
|
16451
16534
|
};
|
|
16452
16535
|
var getDefaultCwd = () => {
|
|
16453
16536
|
try {
|
|
@@ -16494,7 +16577,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
16494
16577
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
16495
16578
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
16496
16579
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
16497
|
-
if (process4__default.default.platform === "win32" &&
|
|
16580
|
+
if (process4__default.default.platform === "win32" && path14__default.default.basename(file, ".exe") === "cmd") {
|
|
16498
16581
|
commandArguments.unshift("/q");
|
|
16499
16582
|
}
|
|
16500
16583
|
return { file, commandArguments, options };
|
|
@@ -18601,13 +18684,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state: state2, verboseInfo, e
|
|
|
18601
18684
|
}
|
|
18602
18685
|
};
|
|
18603
18686
|
var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
18604
|
-
for (const { path:
|
|
18605
|
-
const pathString = typeof
|
|
18687
|
+
for (const { path: path21, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
|
|
18688
|
+
const pathString = typeof path21 === "string" ? path21 : path21.toString();
|
|
18606
18689
|
if (append || outputFiles.has(pathString)) {
|
|
18607
|
-
u2.appendFileSync(
|
|
18690
|
+
u2.appendFileSync(path21, serializedResult);
|
|
18608
18691
|
} else {
|
|
18609
18692
|
outputFiles.add(pathString);
|
|
18610
|
-
u2.writeFileSync(
|
|
18693
|
+
u2.writeFileSync(path21, serializedResult);
|
|
18611
18694
|
}
|
|
18612
18695
|
}
|
|
18613
18696
|
};
|
|
@@ -20903,108 +20986,582 @@ createExeca(mapNode);
|
|
|
20903
20986
|
createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
|
|
20904
20987
|
getIpcExport();
|
|
20905
20988
|
|
|
20906
|
-
// src/
|
|
20907
|
-
var
|
|
20908
|
-
|
|
20909
|
-
|
|
20910
|
-
|
|
20911
|
-
|
|
20989
|
+
// src/utils/template.ts
|
|
20990
|
+
var import_fs_extra8 = __toESM(require_lib());
|
|
20991
|
+
var PROJECT_TYPES_WITH_FORM_BUILDER = /* @__PURE__ */ new Set([
|
|
20992
|
+
"blog"
|
|
20993
|
+
]);
|
|
20994
|
+
function projectUsesFormBuilder(projectType) {
|
|
20995
|
+
return PROJECT_TYPES_WITH_FORM_BUILDER.has(projectType);
|
|
20996
|
+
}
|
|
20997
|
+
var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
20998
|
+
".ts",
|
|
20999
|
+
".tsx",
|
|
21000
|
+
".js",
|
|
21001
|
+
".jsx",
|
|
21002
|
+
".json",
|
|
21003
|
+
".env",
|
|
21004
|
+
".md",
|
|
21005
|
+
".css",
|
|
21006
|
+
".html",
|
|
21007
|
+
".mjs",
|
|
21008
|
+
".cjs"
|
|
21009
|
+
]);
|
|
21010
|
+
var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
|
|
21011
|
+
function resolveTemplatePath(localTemplatePath) {
|
|
21012
|
+
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))));
|
|
21013
|
+
const fromDist = path14__default.default.resolve(__dirname, "../templates");
|
|
21014
|
+
if (import_fs_extra8.default.existsSync(fromDist)) {
|
|
21015
|
+
return fromDist;
|
|
21016
|
+
}
|
|
21017
|
+
const fromSrc = path14__default.default.resolve(__dirname, "../../templates");
|
|
21018
|
+
if (import_fs_extra8.default.existsSync(fromSrc)) {
|
|
21019
|
+
return fromSrc;
|
|
21020
|
+
}
|
|
21021
|
+
throw new Error(
|
|
21022
|
+
"Could not find templates directory. Use --local-template to specify the templates path, or ensure templates are bundled."
|
|
21023
|
+
);
|
|
21024
|
+
}
|
|
21025
|
+
function buildPlaceholderMap(options) {
|
|
21026
|
+
const { database, databaseUrl, pluginName, nextlyRange } = options;
|
|
21027
|
+
const map = {};
|
|
21028
|
+
if (database) {
|
|
21029
|
+
map["{{databaseDialect}}"] = database.type;
|
|
21030
|
+
map["{{databaseUrl}}"] = databaseUrl || database.envExample;
|
|
21031
|
+
}
|
|
21032
|
+
if (pluginName) map["{{pluginName}}"] = pluginName;
|
|
21033
|
+
if (nextlyRange) map["{{nextlyRange}}"] = nextlyRange;
|
|
21034
|
+
return map;
|
|
21035
|
+
}
|
|
21036
|
+
async function replacePlaceholdersInFile(filePath, placeholders) {
|
|
21037
|
+
const ext = path14__default.default.extname(filePath).toLowerCase();
|
|
21038
|
+
const basename = path14__default.default.basename(filePath);
|
|
21039
|
+
const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
|
|
21040
|
+
if (!isTextFile) return;
|
|
21041
|
+
let content = await import_fs_extra8.default.readFile(filePath, "utf-8");
|
|
21042
|
+
let changed = false;
|
|
21043
|
+
for (const [placeholder, value] of Object.entries(placeholders)) {
|
|
21044
|
+
if (content.includes(placeholder)) {
|
|
21045
|
+
content = content.replaceAll(placeholder, value);
|
|
21046
|
+
changed = true;
|
|
21047
|
+
}
|
|
21048
|
+
}
|
|
21049
|
+
if (changed) {
|
|
21050
|
+
await import_fs_extra8.default.writeFile(filePath, content, "utf-8");
|
|
21051
|
+
}
|
|
21052
|
+
}
|
|
21053
|
+
async function replacePlaceholders(dir, placeholders) {
|
|
21054
|
+
const entries = await import_fs_extra8.default.readdir(dir, { withFileTypes: true });
|
|
21055
|
+
for (const entry of entries) {
|
|
21056
|
+
const fullPath = path14__default.default.join(dir, entry.name);
|
|
21057
|
+
if (entry.isDirectory()) {
|
|
21058
|
+
if (entry.name === "node_modules" || entry.name === ".git") continue;
|
|
21059
|
+
await replacePlaceholders(fullPath, placeholders);
|
|
21060
|
+
} else if (entry.isFile()) {
|
|
21061
|
+
await replacePlaceholdersInFile(fullPath, placeholders);
|
|
21062
|
+
}
|
|
21063
|
+
}
|
|
21064
|
+
}
|
|
21065
|
+
var PINNED_VERSIONS = {
|
|
21066
|
+
// Next.js ecosystem — resolved at runtime via fetchLatestVersion()
|
|
21067
|
+
// (see generatePackageJson)
|
|
21068
|
+
react: "^19.1.0",
|
|
21069
|
+
"react-dom": "^19.1.0",
|
|
21070
|
+
// Dev dependencies
|
|
21071
|
+
typescript: "^5",
|
|
21072
|
+
"@types/node": "^20",
|
|
21073
|
+
"@types/react": "^19",
|
|
21074
|
+
"@types/react-dom": "^19",
|
|
21075
|
+
"@tailwindcss/postcss": "^4",
|
|
21076
|
+
tailwindcss: "^4",
|
|
21077
|
+
eslint: "^9"
|
|
20912
21078
|
};
|
|
20913
|
-
var
|
|
21079
|
+
var RUNTIME_RESOLVED_PACKAGES = ["next", "eslint-config-next"];
|
|
21080
|
+
var NEXTLY_PACKAGES = [
|
|
20914
21081
|
"nextly",
|
|
20915
21082
|
"@nextlyhq/admin",
|
|
20916
|
-
"@nextlyhq/adapter-drizzle",
|
|
20917
21083
|
"@nextlyhq/ui",
|
|
20918
|
-
"@
|
|
20919
|
-
];
|
|
20920
|
-
var ALL_ADAPTER_PACKAGES = [
|
|
21084
|
+
"@nextlyhq/adapter-drizzle",
|
|
20921
21085
|
"@nextlyhq/adapter-postgres",
|
|
20922
21086
|
"@nextlyhq/adapter-mysql",
|
|
20923
|
-
"@nextlyhq/adapter-sqlite"
|
|
20924
|
-
|
|
20925
|
-
|
|
20926
|
-
"@nextlyhq/plugin-form-builder"
|
|
21087
|
+
"@nextlyhq/adapter-sqlite",
|
|
21088
|
+
"@nextlyhq/plugin-form-builder",
|
|
21089
|
+
"@nextlyhq/plugin-sdk"
|
|
20927
21090
|
];
|
|
20928
|
-
|
|
20929
|
-
|
|
21091
|
+
var resolvedNextlyVersions = null;
|
|
21092
|
+
async function fetchLatestVersion(pkg) {
|
|
21093
|
+
try {
|
|
21094
|
+
const res = await fetch(
|
|
21095
|
+
`https://registry.npmjs.org/-/package/${encodeURIComponent(pkg)}/dist-tags`,
|
|
21096
|
+
{ signal: AbortSignal.timeout(5e3) }
|
|
21097
|
+
);
|
|
21098
|
+
if (!res.ok) return "latest";
|
|
21099
|
+
const data = await res.json();
|
|
21100
|
+
return data.latest ? `^${data.latest}` : "latest";
|
|
21101
|
+
} catch {
|
|
21102
|
+
return "latest";
|
|
21103
|
+
}
|
|
20930
21104
|
}
|
|
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
|
-
|
|
21105
|
+
async function resolveNextlyVersions() {
|
|
21106
|
+
if (resolvedNextlyVersions) return resolvedNextlyVersions;
|
|
21107
|
+
const entries = await Promise.all(
|
|
21108
|
+
NEXTLY_PACKAGES.map(
|
|
21109
|
+
async (pkg) => [pkg, await fetchLatestVersion(pkg)]
|
|
21110
|
+
)
|
|
21111
|
+
);
|
|
21112
|
+
resolvedNextlyVersions = Object.fromEntries(entries);
|
|
21113
|
+
return resolvedNextlyVersions;
|
|
21114
|
+
}
|
|
21115
|
+
var resolvedRuntimeVersions = null;
|
|
21116
|
+
async function resolveRuntimeVersions() {
|
|
21117
|
+
if (resolvedRuntimeVersions) return resolvedRuntimeVersions;
|
|
21118
|
+
const FALLBACKS = {
|
|
21119
|
+
next: "^16.1.0",
|
|
21120
|
+
"eslint-config-next": "^16.1.0"
|
|
21121
|
+
};
|
|
21122
|
+
const entries = await Promise.all(
|
|
21123
|
+
RUNTIME_RESOLVED_PACKAGES.map(async (pkg) => {
|
|
21124
|
+
const version = await fetchLatestVersion(pkg);
|
|
21125
|
+
return [pkg, version === "latest" ? FALLBACKS[pkg] : version];
|
|
21126
|
+
})
|
|
21127
|
+
);
|
|
21128
|
+
resolvedRuntimeVersions = Object.fromEntries(entries);
|
|
21129
|
+
return resolvedRuntimeVersions;
|
|
21130
|
+
}
|
|
21131
|
+
async function generatePackageJson(projectName, database, useYalc = false, projectType = "blank") {
|
|
21132
|
+
if (projectType === "plugin") {
|
|
21133
|
+
return generatePluginPackageJson(projectName, useYalc);
|
|
21134
|
+
}
|
|
21135
|
+
const runtimeVersions = await resolveRuntimeVersions();
|
|
21136
|
+
const dependencies = {
|
|
21137
|
+
next: runtimeVersions.next,
|
|
21138
|
+
react: PINNED_VERSIONS.react,
|
|
21139
|
+
"react-dom": PINNED_VERSIONS["react-dom"]
|
|
21140
|
+
};
|
|
21141
|
+
dependencies["@tanstack/react-query"] = "^5.62.0";
|
|
21142
|
+
if (!useYalc) {
|
|
21143
|
+
const versions = await resolveNextlyVersions();
|
|
21144
|
+
dependencies["nextly"] = versions["nextly"];
|
|
21145
|
+
dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
|
|
21146
|
+
dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";
|
|
21147
|
+
dependencies["@nextlyhq/adapter-drizzle"] = versions["@nextlyhq/adapter-drizzle"];
|
|
21148
|
+
dependencies[database.adapter] = versions[database.adapter] || "latest";
|
|
21149
|
+
if (projectUsesFormBuilder(projectType)) {
|
|
21150
|
+
dependencies["@nextlyhq/plugin-form-builder"] = versions["@nextlyhq/plugin-form-builder"] || "latest";
|
|
20973
21151
|
}
|
|
20974
21152
|
}
|
|
20975
|
-
|
|
20976
|
-
|
|
20977
|
-
|
|
20978
|
-
|
|
20979
|
-
|
|
20980
|
-
|
|
20981
|
-
|
|
20982
|
-
|
|
20983
|
-
|
|
20984
|
-
|
|
20985
|
-
|
|
20986
|
-
|
|
20987
|
-
|
|
20988
|
-
|
|
20989
|
-
|
|
20990
|
-
|
|
20991
|
-
|
|
20992
|
-
|
|
20993
|
-
|
|
20994
|
-
|
|
20995
|
-
|
|
20996
|
-
|
|
20997
|
-
|
|
20998
|
-
|
|
20999
|
-
|
|
21000
|
-
|
|
21001
|
-
|
|
21002
|
-
|
|
21003
|
-
|
|
21004
|
-
|
|
21005
|
-
|
|
21006
|
-
|
|
21007
|
-
|
|
21153
|
+
const devDependencies = {
|
|
21154
|
+
typescript: PINNED_VERSIONS.typescript,
|
|
21155
|
+
"@types/node": PINNED_VERSIONS["@types/node"],
|
|
21156
|
+
"@types/react": PINNED_VERSIONS["@types/react"],
|
|
21157
|
+
"@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
|
|
21158
|
+
"@tailwindcss/postcss": PINNED_VERSIONS["@tailwindcss/postcss"],
|
|
21159
|
+
tailwindcss: PINNED_VERSIONS.tailwindcss,
|
|
21160
|
+
eslint: PINNED_VERSIONS.eslint,
|
|
21161
|
+
"eslint-config-next": runtimeVersions["eslint-config-next"],
|
|
21162
|
+
// Pagefind powers /search in the blog template. Zero-config
|
|
21163
|
+
// static index generated at `next build` time. Templates that
|
|
21164
|
+
// don't ship a /search page simply won't invoke it.
|
|
21165
|
+
pagefind: "^1.1.0"
|
|
21166
|
+
};
|
|
21167
|
+
const pkg = {
|
|
21168
|
+
name: projectName,
|
|
21169
|
+
version: "0.1.0",
|
|
21170
|
+
private: true,
|
|
21171
|
+
scripts: {
|
|
21172
|
+
// F1 PR 4: dev now boots Nextly in single-process mode via `next dev`.
|
|
21173
|
+
// The lazy drizzle-kit/api import (PR 1) plus the in-process HMR
|
|
21174
|
+
// listener (PR 2) replaced the wrapper that previously owned the
|
|
21175
|
+
// terminal, schema prompts, and child supervision. `nextly dev` is
|
|
21176
|
+
// gone; the only supported dev command is the standard `next dev`.
|
|
21177
|
+
dev: "next dev --turbopack",
|
|
21178
|
+
// Build: migrate DB + compile Next.js + (if present) generate
|
|
21179
|
+
// the Pagefind search index. Templates without the search
|
|
21180
|
+
// script silently skip the last step.
|
|
21181
|
+
build: "nextly migrate && next build && (test -f scripts/build-search-index.mjs && node scripts/build-search-index.mjs || true)",
|
|
21182
|
+
"search:index": "node scripts/build-search-index.mjs",
|
|
21183
|
+
start: "next start",
|
|
21184
|
+
lint: "next lint",
|
|
21185
|
+
nextly: "nextly",
|
|
21186
|
+
// First-time setup: sync schema + seed system permissions. Demo
|
|
21187
|
+
// content is seeded separately from the admin UI (visit /welcome
|
|
21188
|
+
// after running `pnpm dev` and completing /admin/setup).
|
|
21189
|
+
"db:setup": "nextly db:sync",
|
|
21190
|
+
"db:migrate": "nextly migrate",
|
|
21191
|
+
"db:migrate:status": "nextly migrate:status",
|
|
21192
|
+
"db:migrate:fresh": "nextly migrate:fresh",
|
|
21193
|
+
"db:migrate:reset": "nextly migrate:reset",
|
|
21194
|
+
"types:generate": "nextly generate:types"
|
|
21195
|
+
},
|
|
21196
|
+
dependencies,
|
|
21197
|
+
devDependencies
|
|
21198
|
+
};
|
|
21199
|
+
return JSON.stringify(pkg, null, 2) + "\n";
|
|
21200
|
+
}
|
|
21201
|
+
async function resolvePluginNextlyRange(useYalc) {
|
|
21202
|
+
if (useYalc) return ">=0.0.0";
|
|
21203
|
+
const versions = await resolveNextlyVersions();
|
|
21204
|
+
const v2 = versions["nextly"];
|
|
21205
|
+
return v2 && v2 !== "latest" ? v2 : ">=0.0.0";
|
|
21206
|
+
}
|
|
21207
|
+
async function generatePluginPackageJson(projectName, useYalc) {
|
|
21208
|
+
const versions = useYalc ? {} : await resolveNextlyVersions();
|
|
21209
|
+
const runtimeVersions = await resolveRuntimeVersions();
|
|
21210
|
+
const range = (pkg2) => versions[pkg2] ?? "latest";
|
|
21211
|
+
const peerDependencies = {
|
|
21212
|
+
nextly: range("nextly"),
|
|
21213
|
+
"@nextlyhq/admin": range("@nextlyhq/admin"),
|
|
21214
|
+
"@nextlyhq/plugin-sdk": range("@nextlyhq/plugin-sdk"),
|
|
21215
|
+
react: PINNED_VERSIONS.react,
|
|
21216
|
+
"react-dom": PINNED_VERSIONS["react-dom"]
|
|
21217
|
+
};
|
|
21218
|
+
const devDependencies = {
|
|
21219
|
+
nextly: range("nextly"),
|
|
21220
|
+
"@nextlyhq/admin": range("@nextlyhq/admin"),
|
|
21221
|
+
"@nextlyhq/ui": range("@nextlyhq/ui"),
|
|
21222
|
+
"@nextlyhq/plugin-sdk": range("@nextlyhq/plugin-sdk"),
|
|
21223
|
+
"@nextlyhq/adapter-drizzle": range("@nextlyhq/adapter-drizzle"),
|
|
21224
|
+
"@nextlyhq/adapter-sqlite": range("@nextlyhq/adapter-sqlite"),
|
|
21225
|
+
next: runtimeVersions.next,
|
|
21226
|
+
react: PINNED_VERSIONS.react,
|
|
21227
|
+
"react-dom": PINNED_VERSIONS["react-dom"],
|
|
21228
|
+
"better-sqlite3": "^12.0.0",
|
|
21229
|
+
"@types/node": PINNED_VERSIONS["@types/node"],
|
|
21230
|
+
"@types/react": PINNED_VERSIONS["@types/react"],
|
|
21231
|
+
"@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
|
|
21232
|
+
typescript: PINNED_VERSIONS.typescript,
|
|
21233
|
+
tsup: "^8.5.0",
|
|
21234
|
+
vitest: "^4.0.8",
|
|
21235
|
+
eslint: PINNED_VERSIONS.eslint,
|
|
21236
|
+
"@eslint/js": PINNED_VERSIONS.eslint,
|
|
21237
|
+
"typescript-eslint": "^8.0.0"
|
|
21238
|
+
};
|
|
21239
|
+
const pkg = {
|
|
21240
|
+
name: projectName,
|
|
21241
|
+
version: "0.1.0",
|
|
21242
|
+
description: "A Nextly plugin.",
|
|
21243
|
+
type: "module",
|
|
21244
|
+
main: "./dist/index.mjs",
|
|
21245
|
+
module: "./dist/index.mjs",
|
|
21246
|
+
types: "./dist/index.d.ts",
|
|
21247
|
+
exports: {
|
|
21248
|
+
".": {
|
|
21249
|
+
types: "./dist/index.d.ts",
|
|
21250
|
+
import: "./dist/index.mjs"
|
|
21251
|
+
},
|
|
21252
|
+
"./admin": {
|
|
21253
|
+
types: "./dist/admin/index.d.ts",
|
|
21254
|
+
import: "./dist/admin/index.mjs"
|
|
21255
|
+
}
|
|
21256
|
+
},
|
|
21257
|
+
// Only the built library ships. The dev/ playground is never published.
|
|
21258
|
+
files: ["dist"],
|
|
21259
|
+
keywords: ["nextly", "nextly-plugin"],
|
|
21260
|
+
scripts: {
|
|
21261
|
+
build: "tsup",
|
|
21262
|
+
// Runs the embedded playground (next dev with dev/ as the project root).
|
|
21263
|
+
dev: "next dev dev --turbopack",
|
|
21264
|
+
"check-types": "tsc --noEmit",
|
|
21265
|
+
lint: "eslint .",
|
|
21266
|
+
test: "vitest run",
|
|
21267
|
+
"types:generate": "nextly generate:types"
|
|
21268
|
+
},
|
|
21269
|
+
peerDependencies,
|
|
21270
|
+
devDependencies
|
|
21271
|
+
// Native build-script allowlist is NOT emitted here: pnpm 11 ignores the
|
|
21272
|
+
// package.json `pnpm` field. It lives in pnpm-workspace.yaml instead (written
|
|
21273
|
+
// by copyPluginTemplate via generatePnpmWorkspaceYaml).
|
|
21274
|
+
};
|
|
21275
|
+
return JSON.stringify(pkg, null, 2) + "\n";
|
|
21276
|
+
}
|
|
21277
|
+
var NATIVE_BUILD_DEPENDENCIES = [
|
|
21278
|
+
"better-sqlite3",
|
|
21279
|
+
"esbuild",
|
|
21280
|
+
"sharp",
|
|
21281
|
+
"unrs-resolver"
|
|
21282
|
+
];
|
|
21283
|
+
function generatePnpmWorkspaceYaml() {
|
|
21284
|
+
const allowBuilds = NATIVE_BUILD_DEPENDENCIES.map(
|
|
21285
|
+
(dep) => ` ${dep}: true`
|
|
21286
|
+
).join("\n");
|
|
21287
|
+
const onlyBuilt = NATIVE_BUILD_DEPENDENCIES.map((dep) => ` - ${dep}`).join(
|
|
21288
|
+
"\n"
|
|
21289
|
+
);
|
|
21290
|
+
return `# Allow native dependencies to run their build scripts. pnpm 10+ blocks
|
|
21291
|
+
# dependency build scripts by default; without this better-sqlite3 has no
|
|
21292
|
+
# compiled binding (sqlite apps crash at boot) and sharp/esbuild degrade.
|
|
21293
|
+
#
|
|
21294
|
+
# pnpm 11+ reads \`allowBuilds\`; pnpm 10.6+ reads \`onlyBuiltDependencies\`.
|
|
21295
|
+
# npm, yarn, and pnpm 9 ignore this file (they run build scripts by default).
|
|
21296
|
+
allowBuilds:
|
|
21297
|
+
${allowBuilds}
|
|
21298
|
+
onlyBuiltDependencies:
|
|
21299
|
+
${onlyBuilt}
|
|
21300
|
+
`;
|
|
21301
|
+
}
|
|
21302
|
+
async function copyTemplate(options) {
|
|
21303
|
+
const {
|
|
21304
|
+
projectName,
|
|
21305
|
+
projectType,
|
|
21306
|
+
targetDir,
|
|
21307
|
+
database,
|
|
21308
|
+
databaseUrl,
|
|
21309
|
+
useYalc = false,
|
|
21310
|
+
approach,
|
|
21311
|
+
templateSource,
|
|
21312
|
+
allowExistingTarget = false
|
|
21313
|
+
} = options;
|
|
21314
|
+
if (!allowExistingTarget && targetDir !== process.cwd() && await import_fs_extra8.default.pathExists(targetDir)) {
|
|
21315
|
+
throw new Error(
|
|
21316
|
+
`Directory "${path14__default.default.basename(targetDir)}" already exists. Please choose a different name.`
|
|
21317
|
+
);
|
|
21318
|
+
}
|
|
21319
|
+
let baseDir;
|
|
21320
|
+
let typeDir;
|
|
21321
|
+
if (templateSource) {
|
|
21322
|
+
baseDir = templateSource.basePath;
|
|
21323
|
+
typeDir = templateSource.templatePath;
|
|
21324
|
+
} else {
|
|
21325
|
+
const templatesRoot = resolveTemplatePath();
|
|
21326
|
+
baseDir = path14__default.default.join(templatesRoot, "base");
|
|
21327
|
+
typeDir = path14__default.default.join(templatesRoot, projectType);
|
|
21328
|
+
}
|
|
21329
|
+
if (projectType === "plugin") {
|
|
21330
|
+
await copyPluginTemplate({ projectName, typeDir, targetDir, useYalc });
|
|
21331
|
+
return;
|
|
21332
|
+
}
|
|
21333
|
+
if (!await import_fs_extra8.default.pathExists(baseDir)) {
|
|
21334
|
+
throw new Error(
|
|
21335
|
+
`Base template not found at ${baseDir}. The package may be corrupted or the download failed.`
|
|
21336
|
+
);
|
|
21337
|
+
}
|
|
21338
|
+
if (!await import_fs_extra8.default.pathExists(typeDir)) {
|
|
21339
|
+
throw new Error(
|
|
21340
|
+
`Template "${projectType}" not found at ${typeDir}. Available templates: blank, blog.`
|
|
21341
|
+
);
|
|
21342
|
+
}
|
|
21343
|
+
await import_fs_extra8.default.copy(baseDir, targetDir, {
|
|
21344
|
+
filter: (_src) => {
|
|
21345
|
+
const basename = path14__default.default.basename(_src);
|
|
21346
|
+
return !SKIP_FILES.has(basename);
|
|
21347
|
+
}
|
|
21348
|
+
});
|
|
21349
|
+
const templateSrcDir = path14__default.default.join(typeDir, "src");
|
|
21350
|
+
if (await import_fs_extra8.default.pathExists(templateSrcDir)) {
|
|
21351
|
+
await import_fs_extra8.default.copy(templateSrcDir, path14__default.default.join(targetDir, "src"), {
|
|
21352
|
+
overwrite: true,
|
|
21353
|
+
filter: (_src) => {
|
|
21354
|
+
const basename = path14__default.default.basename(_src);
|
|
21355
|
+
return !SKIP_FILES.has(basename);
|
|
21356
|
+
}
|
|
21357
|
+
});
|
|
21358
|
+
}
|
|
21359
|
+
const templateRootConfig = path14__default.default.join(typeDir, "nextly.config.ts");
|
|
21360
|
+
if (await import_fs_extra8.default.pathExists(templateRootConfig)) {
|
|
21361
|
+
await import_fs_extra8.default.copy(
|
|
21362
|
+
templateRootConfig,
|
|
21363
|
+
path14__default.default.join(targetDir, "nextly.config.ts"),
|
|
21364
|
+
{ overwrite: true }
|
|
21365
|
+
);
|
|
21366
|
+
}
|
|
21367
|
+
const configsDir = path14__default.default.join(typeDir, "configs");
|
|
21368
|
+
if (approach && await import_fs_extra8.default.pathExists(configsDir)) {
|
|
21369
|
+
const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
|
|
21370
|
+
const configSrc = path14__default.default.join(configsDir, configFileName);
|
|
21371
|
+
if (await import_fs_extra8.default.pathExists(configSrc)) {
|
|
21372
|
+
await import_fs_extra8.default.copy(configSrc, path14__default.default.join(targetDir, "nextly.config.ts"), {
|
|
21373
|
+
overwrite: true
|
|
21374
|
+
});
|
|
21375
|
+
}
|
|
21376
|
+
const sharedSrc = path14__default.default.join(configsDir, "shared.ts");
|
|
21377
|
+
if (await import_fs_extra8.default.pathExists(sharedSrc)) {
|
|
21378
|
+
await import_fs_extra8.default.copy(sharedSrc, path14__default.default.join(targetDir, "shared.ts"), {
|
|
21379
|
+
overwrite: true
|
|
21380
|
+
});
|
|
21381
|
+
}
|
|
21382
|
+
}
|
|
21383
|
+
const frontendPagePath = path14__default.default.join(
|
|
21384
|
+
targetDir,
|
|
21385
|
+
"src",
|
|
21386
|
+
"app",
|
|
21387
|
+
"(frontend)",
|
|
21388
|
+
"page.tsx"
|
|
21389
|
+
);
|
|
21390
|
+
const basePagePath = path14__default.default.join(targetDir, "src", "app", "page.tsx");
|
|
21391
|
+
if (await import_fs_extra8.default.pathExists(frontendPagePath) && await import_fs_extra8.default.pathExists(basePagePath)) {
|
|
21392
|
+
await import_fs_extra8.default.remove(basePagePath);
|
|
21393
|
+
}
|
|
21394
|
+
const packageJsonContent = await generatePackageJson(
|
|
21395
|
+
projectName,
|
|
21396
|
+
database,
|
|
21397
|
+
useYalc,
|
|
21398
|
+
projectType
|
|
21399
|
+
);
|
|
21400
|
+
await import_fs_extra8.default.writeFile(
|
|
21401
|
+
path14__default.default.join(targetDir, "package.json"),
|
|
21402
|
+
packageJsonContent,
|
|
21403
|
+
"utf-8"
|
|
21404
|
+
);
|
|
21405
|
+
await import_fs_extra8.default.writeFile(
|
|
21406
|
+
path14__default.default.join(targetDir, "pnpm-workspace.yaml"),
|
|
21407
|
+
generatePnpmWorkspaceYaml(),
|
|
21408
|
+
"utf-8"
|
|
21409
|
+
);
|
|
21410
|
+
if (database.type === "sqlite") {
|
|
21411
|
+
await import_fs_extra8.default.ensureDir(path14__default.default.join(targetDir, "data"));
|
|
21412
|
+
}
|
|
21413
|
+
await import_fs_extra8.default.writeFile(
|
|
21414
|
+
path14__default.default.join(targetDir, "next.config.ts"),
|
|
21415
|
+
buildNextConfigTemplate(database),
|
|
21416
|
+
"utf-8"
|
|
21417
|
+
);
|
|
21418
|
+
const placeholders = buildPlaceholderMap({ database, databaseUrl });
|
|
21419
|
+
if (approach) {
|
|
21420
|
+
placeholders["{{approach}}"] = approach;
|
|
21421
|
+
}
|
|
21422
|
+
await replacePlaceholders(targetDir, placeholders);
|
|
21423
|
+
}
|
|
21424
|
+
async function copyPluginTemplate(opts) {
|
|
21425
|
+
const { projectName, typeDir, targetDir, useYalc } = opts;
|
|
21426
|
+
if (!await import_fs_extra8.default.pathExists(typeDir)) {
|
|
21427
|
+
throw new Error(
|
|
21428
|
+
`Plugin template not found at ${typeDir}. The package may be corrupted or the download failed.`
|
|
21429
|
+
);
|
|
21430
|
+
}
|
|
21431
|
+
await import_fs_extra8.default.copy(typeDir, targetDir, {
|
|
21432
|
+
overwrite: true,
|
|
21433
|
+
filter: (src) => {
|
|
21434
|
+
const basename = path14__default.default.basename(src);
|
|
21435
|
+
return !SKIP_FILES.has(basename) && basename !== "template.json";
|
|
21436
|
+
}
|
|
21437
|
+
});
|
|
21438
|
+
const packageJsonContent = await generatePackageJson(
|
|
21439
|
+
projectName,
|
|
21440
|
+
{ },
|
|
21441
|
+
useYalc,
|
|
21442
|
+
"plugin"
|
|
21443
|
+
);
|
|
21444
|
+
await import_fs_extra8.default.writeFile(
|
|
21445
|
+
path14__default.default.join(targetDir, "package.json"),
|
|
21446
|
+
packageJsonContent,
|
|
21447
|
+
"utf-8"
|
|
21448
|
+
);
|
|
21449
|
+
await import_fs_extra8.default.writeFile(
|
|
21450
|
+
path14__default.default.join(targetDir, "pnpm-workspace.yaml"),
|
|
21451
|
+
generatePnpmWorkspaceYaml(),
|
|
21452
|
+
"utf-8"
|
|
21453
|
+
);
|
|
21454
|
+
const nextlyRange = await resolvePluginNextlyRange(useYalc);
|
|
21455
|
+
await replacePlaceholders(
|
|
21456
|
+
targetDir,
|
|
21457
|
+
buildPlaceholderMap({ pluginName: projectName, nextlyRange })
|
|
21458
|
+
);
|
|
21459
|
+
}
|
|
21460
|
+
|
|
21461
|
+
// src/installers/dependencies.ts
|
|
21462
|
+
var INSTALL_COMMANDS = {
|
|
21463
|
+
npm: ["npm", "install"],
|
|
21464
|
+
yarn: ["yarn", "add"],
|
|
21465
|
+
pnpm: ["pnpm", "add"],
|
|
21466
|
+
bun: ["bun", "add"]
|
|
21467
|
+
};
|
|
21468
|
+
var CORE_PACKAGES = [
|
|
21469
|
+
"nextly",
|
|
21470
|
+
"@nextlyhq/admin",
|
|
21471
|
+
"@nextlyhq/adapter-drizzle",
|
|
21472
|
+
"@nextlyhq/ui",
|
|
21473
|
+
"@tanstack/react-query"
|
|
21474
|
+
];
|
|
21475
|
+
var ALL_ADAPTER_PACKAGES = [
|
|
21476
|
+
"@nextlyhq/adapter-postgres",
|
|
21477
|
+
"@nextlyhq/adapter-mysql",
|
|
21478
|
+
"@nextlyhq/adapter-sqlite"
|
|
21479
|
+
];
|
|
21480
|
+
var TEMPLATE_PLUGIN_PACKAGES = ["@nextlyhq/plugin-form-builder"];
|
|
21481
|
+
function templatePluginPackages(projectType) {
|
|
21482
|
+
return projectType && projectUsesFormBuilder(projectType) ? TEMPLATE_PLUGIN_PACKAGES : [];
|
|
21483
|
+
}
|
|
21484
|
+
function getPackagesToInstall(database) {
|
|
21485
|
+
return [...CORE_PACKAGES, database.adapter];
|
|
21486
|
+
}
|
|
21487
|
+
async function installDependencies(cwd, projectInfo, database, useYalc = false, isFreshProject = false, projectType) {
|
|
21488
|
+
const pm = projectInfo.packageManager;
|
|
21489
|
+
const pluginPackages = templatePluginPackages(projectType);
|
|
21490
|
+
if (isFreshProject) {
|
|
21491
|
+
if (useYalc) {
|
|
21492
|
+
const yalcPackages = [
|
|
21493
|
+
.../* @__PURE__ */ new Set([
|
|
21494
|
+
"nextly",
|
|
21495
|
+
"@nextlyhq/admin",
|
|
21496
|
+
"@nextlyhq/ui",
|
|
21497
|
+
"@nextlyhq/adapter-drizzle",
|
|
21498
|
+
...ALL_ADAPTER_PACKAGES,
|
|
21499
|
+
...pluginPackages
|
|
21500
|
+
])
|
|
21501
|
+
];
|
|
21502
|
+
await execa(pm, ["install"], { cwd });
|
|
21503
|
+
for (const pkg of yalcPackages) {
|
|
21504
|
+
await execa("yalc", ["add", pkg], { cwd });
|
|
21505
|
+
}
|
|
21506
|
+
await execa(pm, ["install"], { cwd });
|
|
21507
|
+
} else {
|
|
21508
|
+
await execa(pm, ["install"], { cwd });
|
|
21509
|
+
}
|
|
21510
|
+
} else {
|
|
21511
|
+
const allPackages = getPackagesToInstall(database);
|
|
21512
|
+
if (useYalc) {
|
|
21513
|
+
const yalcPackages = [
|
|
21514
|
+
.../* @__PURE__ */ new Set([
|
|
21515
|
+
"nextly",
|
|
21516
|
+
"@nextlyhq/admin",
|
|
21517
|
+
"@nextlyhq/ui",
|
|
21518
|
+
"@nextlyhq/adapter-drizzle",
|
|
21519
|
+
...ALL_ADAPTER_PACKAGES,
|
|
21520
|
+
...pluginPackages
|
|
21521
|
+
])
|
|
21522
|
+
];
|
|
21523
|
+
for (const pkg of yalcPackages) {
|
|
21524
|
+
await execa("yalc", ["add", pkg], { cwd });
|
|
21525
|
+
}
|
|
21526
|
+
await execa(pm, ["install"], { cwd });
|
|
21527
|
+
} else {
|
|
21528
|
+
const [cmd, ...args] = INSTALL_COMMANDS[pm];
|
|
21529
|
+
await execa(cmd, [...args, ...allPackages], { cwd });
|
|
21530
|
+
}
|
|
21531
|
+
}
|
|
21532
|
+
}
|
|
21533
|
+
|
|
21534
|
+
// src/lib/download-template.ts
|
|
21535
|
+
var import_fs_extra9 = __toESM(require_lib());
|
|
21536
|
+
var kr = Object.defineProperty;
|
|
21537
|
+
var vr = (s3, t2) => {
|
|
21538
|
+
for (var e in t2) kr(s3, e, { get: t2[e], enumerable: true });
|
|
21539
|
+
};
|
|
21540
|
+
var Os = typeof process == "object" && process ? process : { stdout: null, stderr: null };
|
|
21541
|
+
var Br = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof D3 || s3 instanceof Ns__default.default || Pr(s3) || zr(s3));
|
|
21542
|
+
var Pr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.pipe == "function" && s3.pipe !== Ns__default.default.Writable.prototype.pipe;
|
|
21543
|
+
var zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof Kr.EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
|
|
21544
|
+
var q3 = Symbol("EOF");
|
|
21545
|
+
var j2 = Symbol("maybeEmitEnd");
|
|
21546
|
+
var rt2 = Symbol("emittedEnd");
|
|
21547
|
+
var Le2 = Symbol("emittingEnd");
|
|
21548
|
+
var jt2 = Symbol("emittedError");
|
|
21549
|
+
var Ne2 = Symbol("closed");
|
|
21550
|
+
var Ts = Symbol("read");
|
|
21551
|
+
var Ae2 = Symbol("flush");
|
|
21552
|
+
var xs = Symbol("flushChunk");
|
|
21553
|
+
var z3 = Symbol("encoding");
|
|
21554
|
+
var Mt2 = Symbol("decoder");
|
|
21555
|
+
var b = Symbol("flowing");
|
|
21556
|
+
var Qt = Symbol("paused");
|
|
21557
|
+
var Bt2 = Symbol("resume");
|
|
21558
|
+
var _2 = Symbol("buffer");
|
|
21559
|
+
var A = Symbol("pipes");
|
|
21560
|
+
var g = Symbol("bufferLength");
|
|
21561
|
+
var yi = Symbol("bufferPush");
|
|
21562
|
+
var De2 = Symbol("bufferShift");
|
|
21563
|
+
var L2 = Symbol("objectMode");
|
|
21564
|
+
var w = Symbol("destroyed");
|
|
21008
21565
|
var Ri = Symbol("error");
|
|
21009
21566
|
var bi = Symbol("emitData");
|
|
21010
21567
|
var Ls = Symbol("emitEnd");
|
|
@@ -21868,12 +22425,12 @@ var F = class {
|
|
|
21868
22425
|
}
|
|
21869
22426
|
};
|
|
21870
22427
|
var an = (s3, t2) => {
|
|
21871
|
-
let i2 = s3, r = "", n2, o2 =
|
|
22428
|
+
let i2 = s3, r = "", n2, o2 = path14.posix.parse(s3).root || ".";
|
|
21872
22429
|
if (Buffer.byteLength(i2) < 100) n2 = [i2, r, false];
|
|
21873
22430
|
else {
|
|
21874
|
-
r =
|
|
22431
|
+
r = path14.posix.dirname(i2), i2 = path14.posix.basename(i2);
|
|
21875
22432
|
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 =
|
|
22433
|
+
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
22434
|
while (r !== o2 && n2 === void 0);
|
|
21878
22435
|
n2 || (n2 = [s3.slice(0, 99), "", true]);
|
|
21879
22436
|
}
|
|
@@ -21919,7 +22476,7 @@ var ct2 = class s {
|
|
|
21919
22476
|
if (t2 === "") return Buffer.allocUnsafe(0);
|
|
21920
22477
|
let e = Buffer.byteLength(t2), i2 = 512 * Math.ceil(1 + e / 512), r = Buffer.allocUnsafe(i2);
|
|
21921
22478
|
for (let n2 = 0; n2 < 512; n2++) r[n2] = 0;
|
|
21922
|
-
new F({ path: ("PaxHeader/" +
|
|
22479
|
+
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
22480
|
for (let n2 = e + 512; n2 < r.length; n2++) r[n2] = 0;
|
|
21924
22481
|
return r;
|
|
21925
22482
|
}
|
|
@@ -22281,11 +22838,11 @@ var Nn = (s3) => {
|
|
|
22281
22838
|
};
|
|
22282
22839
|
var Ki = (s3, t2) => {
|
|
22283
22840
|
let e = new Map(t2.map((n2) => [mt3(n2), true])), i2 = s3.filter, r = (n2, o2 = "") => {
|
|
22284
|
-
let h3 = o2 ||
|
|
22841
|
+
let h3 = o2 || path14.parse(n2).root || ".", a2;
|
|
22285
22842
|
if (n2 === h3) a2 = false;
|
|
22286
22843
|
else {
|
|
22287
22844
|
let l = e.get(n2);
|
|
22288
|
-
a2 = l !== void 0 ? l : r(
|
|
22845
|
+
a2 = l !== void 0 ? l : r(path14.dirname(n2), h3);
|
|
22289
22846
|
}
|
|
22290
22847
|
return e.set(n2, a2), a2;
|
|
22291
22848
|
};
|
|
@@ -22331,7 +22888,7 @@ var It3 = K2(An, Dn, (s3) => new st2(s3), (s3) => new st2(s3), (s3, t2) => {
|
|
|
22331
22888
|
t2?.length && Ki(s3, t2), s3.noResume || Nn(s3);
|
|
22332
22889
|
});
|
|
22333
22890
|
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 } =
|
|
22891
|
+
var { isAbsolute: Cn, parse: Ys } = path14.win32;
|
|
22335
22892
|
var ce2 = (s3) => {
|
|
22336
22893
|
let t2 = "", e = Ys(s3);
|
|
22337
22894
|
for (; Cn(s3) || e.root; ) {
|
|
@@ -22405,7 +22962,7 @@ var de2 = class extends D3 {
|
|
|
22405
22962
|
let [o2, h3] = ce2(this.path);
|
|
22406
22963
|
o2 && typeof h3 == "string" && (this.path = h3, r = o2);
|
|
22407
22964
|
}
|
|
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 ||
|
|
22965
|
+
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
22966
|
let n2 = this.statCache.get(this.absolute);
|
|
22410
22967
|
n2 ? this[ei](n2) : this[Qi]();
|
|
22411
22968
|
}
|
|
@@ -22464,7 +23021,7 @@ var de2 = class extends D3 {
|
|
|
22464
23021
|
}
|
|
22465
23022
|
[Qs](t2) {
|
|
22466
23023
|
if (!this.stat) throw new Error("cannot create link entry without stat");
|
|
22467
|
-
this.type = "Link", this.linkpath = f(
|
|
23024
|
+
this.type = "Link", this.linkpath = f(path14__default.default.relative(this.cwd, t2)), this.stat.size = 0, this[fe2](), this.end();
|
|
22468
23025
|
}
|
|
22469
23026
|
[qs]() {
|
|
22470
23027
|
if (!this.stat) throw new Error("cannot create file entry without stat");
|
|
@@ -22875,7 +23432,7 @@ var Et3 = class extends D3 {
|
|
|
22875
23432
|
return t2 instanceof Yt ? this[er](t2) : this[hi](t2), this.flowing;
|
|
22876
23433
|
}
|
|
22877
23434
|
[er](t2) {
|
|
22878
|
-
let e = f(
|
|
23435
|
+
let e = f(path14__default.default.resolve(this.cwd, t2.path));
|
|
22879
23436
|
if (!this.filter(t2.path, t2)) t2.resume();
|
|
22880
23437
|
else {
|
|
22881
23438
|
let i2 = new di(t2.path, e);
|
|
@@ -22884,7 +23441,7 @@ var Et3 = class extends D3 {
|
|
|
22884
23441
|
this[Ft3]();
|
|
22885
23442
|
}
|
|
22886
23443
|
[hi](t2) {
|
|
22887
|
-
let e = f(
|
|
23444
|
+
let e = f(path14__default.default.resolve(this.cwd, t2));
|
|
22888
23445
|
this[W3].push(new di(t2, e)), this[Ft3]();
|
|
22889
23446
|
}
|
|
22890
23447
|
[as](t2) {
|
|
@@ -23022,11 +23579,11 @@ var Hn = (s3, t2) => {
|
|
|
23022
23579
|
};
|
|
23023
23580
|
var or = (s3, t2) => {
|
|
23024
23581
|
t2.forEach((e) => {
|
|
23025
|
-
e.charAt(0) === "@" ? It3({ file:
|
|
23582
|
+
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
23583
|
}), s3.end();
|
|
23027
23584
|
};
|
|
23028
23585
|
var hr = async (s3, t2) => {
|
|
23029
|
-
for (let e of t2) e.charAt(0) === "@" ? await It3({ file:
|
|
23586
|
+
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
23587
|
s3.add(i2);
|
|
23031
23588
|
} }) : s3.add(e);
|
|
23032
23589
|
s3.end();
|
|
@@ -23051,7 +23608,7 @@ var Vn = 512 * 1024;
|
|
|
23051
23608
|
var $n = pr | ur | dr | mr;
|
|
23052
23609
|
var lr = !fr && typeof ar == "number" ? ar | ur | dr | mr : null;
|
|
23053
23610
|
var cs = lr !== null ? () => lr : Kn ? (s3) => s3 < Vn ? $n : "w" : () => "w";
|
|
23054
|
-
var
|
|
23611
|
+
var fs10 = (s3, t2, e) => {
|
|
23055
23612
|
try {
|
|
23056
23613
|
return u2__default.default.lchownSync(s3, t2, e);
|
|
23057
23614
|
} catch (i2) {
|
|
@@ -23064,13 +23621,13 @@ var ui = (s3, t2, e, i2) => {
|
|
|
23064
23621
|
});
|
|
23065
23622
|
};
|
|
23066
23623
|
var Xn = (s3, t2, e, i2, r) => {
|
|
23067
|
-
if (t2.isDirectory()) ds(
|
|
23624
|
+
if (t2.isDirectory()) ds(path14__default.default.resolve(s3, t2.name), e, i2, (n2) => {
|
|
23068
23625
|
if (n2) return r(n2);
|
|
23069
|
-
let o2 =
|
|
23626
|
+
let o2 = path14__default.default.resolve(s3, t2.name);
|
|
23070
23627
|
ui(o2, e, i2, r);
|
|
23071
23628
|
});
|
|
23072
23629
|
else {
|
|
23073
|
-
let n2 =
|
|
23630
|
+
let n2 = path14__default.default.resolve(s3, t2.name);
|
|
23074
23631
|
ui(n2, e, i2, r);
|
|
23075
23632
|
}
|
|
23076
23633
|
};
|
|
@@ -23091,7 +23648,7 @@ var ds = (s3, t2, e, i2) => {
|
|
|
23091
23648
|
});
|
|
23092
23649
|
};
|
|
23093
23650
|
var qn = (s3, t2, e, i2) => {
|
|
23094
|
-
t2.isDirectory() && us(
|
|
23651
|
+
t2.isDirectory() && us(path14__default.default.resolve(s3, t2.name), e, i2), fs10(path14__default.default.resolve(s3, t2.name), e, i2);
|
|
23095
23652
|
};
|
|
23096
23653
|
var us = (s3, t2, e) => {
|
|
23097
23654
|
let i2;
|
|
@@ -23100,11 +23657,11 @@ var us = (s3, t2, e) => {
|
|
|
23100
23657
|
} catch (r) {
|
|
23101
23658
|
let n2 = r;
|
|
23102
23659
|
if (n2?.code === "ENOENT") return;
|
|
23103
|
-
if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return
|
|
23660
|
+
if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return fs10(s3, t2, e);
|
|
23104
23661
|
throw n2;
|
|
23105
23662
|
}
|
|
23106
23663
|
for (let r of i2) qn(s3, r, t2, e);
|
|
23107
|
-
return
|
|
23664
|
+
return fs10(s3, t2, e);
|
|
23108
23665
|
};
|
|
23109
23666
|
var we2 = class extends Error {
|
|
23110
23667
|
path;
|
|
@@ -23141,12 +23698,12 @@ var Er = (s3, t2, e) => {
|
|
|
23141
23698
|
};
|
|
23142
23699
|
if (s3 === d) return Qn(s3, S2);
|
|
23143
23700
|
if (l) return jn__default.default.mkdir(s3, { mode: r, recursive: true }).then((E) => S2(null, E ?? void 0), S2);
|
|
23144
|
-
let N3 = f(
|
|
23701
|
+
let N3 = f(path14__default.default.relative(d, s3)).split("/");
|
|
23145
23702
|
ms(d, N3, r, c3, d, void 0, S2);
|
|
23146
23703
|
};
|
|
23147
23704
|
var ms = (s3, t2, e, i2, r, n2, o2) => {
|
|
23148
23705
|
if (t2.length === 0) return o2(null, n2);
|
|
23149
|
-
let h3 = t2.shift(), a2 = f(
|
|
23706
|
+
let h3 = t2.shift(), a2 = f(path14__default.default.resolve(s3 + "/" + h3));
|
|
23150
23707
|
u2__default.default.mkdir(a2, e, wr(a2, t2, e, i2, r, n2, o2));
|
|
23151
23708
|
};
|
|
23152
23709
|
var wr = (s3, t2, e, i2, r, n2, o2) => (h3) => {
|
|
@@ -23180,9 +23737,9 @@ var Sr = (s3, t2) => {
|
|
|
23180
23737
|
};
|
|
23181
23738
|
if (s3 === c3) return Jn(c3), d();
|
|
23182
23739
|
if (a2) return d(u2__default.default.mkdirSync(s3, { mode: i2, recursive: true }) ?? void 0);
|
|
23183
|
-
let T2 = f(
|
|
23740
|
+
let T2 = f(path14__default.default.relative(c3, s3)).split("/"), N3;
|
|
23184
23741
|
for (let E = T2.shift(), x3 = c3; E && (x3 += "/" + E); E = T2.shift()) {
|
|
23185
|
-
x3 = f(
|
|
23742
|
+
x3 = f(path14__default.default.resolve(x3));
|
|
23186
23743
|
try {
|
|
23187
23744
|
u2__default.default.mkdirSync(x3, i2), N3 = N3 || x3;
|
|
23188
23745
|
} catch {
|
|
@@ -23211,14 +23768,14 @@ var to = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
|
23211
23768
|
var eo = to === "win32";
|
|
23212
23769
|
var io = (s3) => s3.split("/").slice(0, -1).reduce((e, i2) => {
|
|
23213
23770
|
let r = e.at(-1);
|
|
23214
|
-
return r !== void 0 && (i2 =
|
|
23771
|
+
return r !== void 0 && (i2 = path14.join(r, i2)), e.push(i2 || "/"), e;
|
|
23215
23772
|
}, []);
|
|
23216
23773
|
var Ei = class {
|
|
23217
23774
|
#t = /* @__PURE__ */ new Map();
|
|
23218
23775
|
#i = /* @__PURE__ */ new Map();
|
|
23219
23776
|
#s = /* @__PURE__ */ new Set();
|
|
23220
23777
|
reserve(t2, e) {
|
|
23221
|
-
t2 = eo ? ["win32 parallelization disabled"] : t2.map((r) => mt3(
|
|
23778
|
+
t2 = eo ? ["win32 parallelization disabled"] : t2.map((r) => mt3(path14.join(Rr(r))));
|
|
23222
23779
|
let i2 = new Set(t2.map((r) => io(r)).reduce((r, n2) => r.concat(n2)));
|
|
23223
23780
|
this.#i.set(e, { dirs: i2, paths: t2 });
|
|
23224
23781
|
for (let r of t2) {
|
|
@@ -23358,7 +23915,7 @@ var qt = class extends st2 {
|
|
|
23358
23915
|
if (t2.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
|
|
23359
23916
|
this.uid = t2.uid, this.gid = t2.gid, this.setOwner = true;
|
|
23360
23917
|
} 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(
|
|
23918
|
+
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
23919
|
}
|
|
23363
23920
|
warn(t2, e, i2 = {}) {
|
|
23364
23921
|
return (t2 === "TAR_BAD_ARCHIVE" || t2 === "TAR_ABORT") && (i2.recoverable = false), super.warn(t2, e, i2);
|
|
@@ -23372,7 +23929,7 @@ var qt = class extends st2 {
|
|
|
23372
23929
|
let [n2, o2] = ce2(i2), h3 = o2.replaceAll(/\\/g, "/").split("/");
|
|
23373
23930
|
if (h3.includes("..") || Oe2 && /^[a-z]:\.\.$/i.test(h3[0] ?? "")) {
|
|
23374
23931
|
if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t2, [e]: i2 }), false;
|
|
23375
|
-
let a2 =
|
|
23932
|
+
let a2 = path14__default.default.posix.dirname(t2.path), l = path14__default.default.posix.normalize(path14__default.default.posix.join(a2, h3.join("/")));
|
|
23376
23933
|
if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t2, [e]: i2 }), false;
|
|
23377
23934
|
}
|
|
23378
23935
|
return n2 && (t2[e] = String(o2), this.warn("TAR_ENTRY_INFO", `stripping ${n2} from absolute ${e}`, { entry: t2, [e]: i2 })), true;
|
|
@@ -23390,12 +23947,12 @@ var qt = class extends st2 {
|
|
|
23390
23947
|
}
|
|
23391
23948
|
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
23949
|
if (!this[Es](t2, "path") || !this[Es](t2, "linkpath")) return false;
|
|
23393
|
-
if (t2.absolute =
|
|
23950
|
+
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
23951
|
if (t2.absolute === this.cwd && t2.type !== "Directory" && t2.type !== "GNUDumpDir") return false;
|
|
23395
23952
|
if (this.win32) {
|
|
23396
|
-
let { root: r } =
|
|
23953
|
+
let { root: r } = path14__default.default.win32.parse(String(t2.absolute));
|
|
23397
23954
|
t2.absolute = r + Xi(String(t2.absolute).slice(r.length));
|
|
23398
|
-
let { root: n2 } =
|
|
23955
|
+
let { root: n2 } = path14__default.default.win32.parse(t2.path);
|
|
23399
23956
|
t2.path = n2 + Xi(t2.path.slice(n2.length));
|
|
23400
23957
|
}
|
|
23401
23958
|
return true;
|
|
@@ -23483,13 +24040,13 @@ var qt = class extends st2 {
|
|
|
23483
24040
|
t2.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t2.type}`, { entry: t2 }), t2.resume();
|
|
23484
24041
|
}
|
|
23485
24042
|
[Tr](t2, e) {
|
|
23486
|
-
let i2 = f(
|
|
24043
|
+
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
24044
|
this[ye2](t2, this.cwd, i2, () => this[Si](t2, String(t2.linkpath), "symlink", e), (r) => {
|
|
23488
24045
|
this[O2](r, t2), e();
|
|
23489
24046
|
});
|
|
23490
24047
|
}
|
|
23491
24048
|
[xr](t2, e) {
|
|
23492
|
-
let i2 = f(
|
|
24049
|
+
let i2 = f(path14__default.default.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
|
|
23493
24050
|
this[ye2](t2, this.cwd, r, () => this[Si](t2, i2, "link", e), (n2) => {
|
|
23494
24051
|
this[O2](n2, t2), e();
|
|
23495
24052
|
});
|
|
@@ -23497,10 +24054,10 @@ var qt = class extends st2 {
|
|
|
23497
24054
|
[ye2](t2, e, i2, r, n2) {
|
|
23498
24055
|
let o2 = i2.shift();
|
|
23499
24056
|
if (this.preservePaths || o2 === void 0) return r();
|
|
23500
|
-
let h3 =
|
|
24057
|
+
let h3 = path14__default.default.resolve(e, o2);
|
|
23501
24058
|
u2__default.default.lstat(h3, (a2, l) => {
|
|
23502
24059
|
if (a2) return r();
|
|
23503
|
-
if (l?.isSymbolicLink()) return n2(new wt2(h3,
|
|
24060
|
+
if (l?.isSymbolicLink()) return n2(new wt2(h3, path14__default.default.resolve(h3, i2.join("/"))));
|
|
23504
24061
|
this[ye2](t2, h3, i2, r, n2);
|
|
23505
24062
|
});
|
|
23506
24063
|
}
|
|
@@ -23534,7 +24091,7 @@ var qt = class extends st2 {
|
|
|
23534
24091
|
});
|
|
23535
24092
|
}, n2 = () => {
|
|
23536
24093
|
if (t2.absolute !== this.cwd) {
|
|
23537
|
-
let h3 = f(
|
|
24094
|
+
let h3 = f(path14__default.default.dirname(String(t2.absolute)));
|
|
23538
24095
|
if (h3 !== this.cwd) return this[St2](h3, this.dmode, (a2) => {
|
|
23539
24096
|
if (a2) {
|
|
23540
24097
|
this[O2](a2, t2), i2();
|
|
@@ -23609,7 +24166,7 @@ var Te2 = class extends qt {
|
|
|
23609
24166
|
this[ge2] = true;
|
|
23610
24167
|
}
|
|
23611
24168
|
if (t2.absolute !== this.cwd) {
|
|
23612
|
-
let n2 = f(
|
|
24169
|
+
let n2 = f(path14__default.default.dirname(String(t2.absolute)));
|
|
23613
24170
|
if (n2 !== this.cwd) {
|
|
23614
24171
|
let o2 = this[St2](n2, this.dmode);
|
|
23615
24172
|
if (o2) return this[O2](o2, t2);
|
|
@@ -23709,10 +24266,10 @@ var Te2 = class extends qt {
|
|
|
23709
24266
|
if (this.preservePaths || i2.length === 0) return r();
|
|
23710
24267
|
let o2 = e;
|
|
23711
24268
|
for (let h3 of i2) {
|
|
23712
|
-
o2 =
|
|
24269
|
+
o2 = path14__default.default.resolve(o2, h3);
|
|
23713
24270
|
let [a2, l] = Se2(() => u2__default.default.lstatSync(o2));
|
|
23714
24271
|
if (a2) return r();
|
|
23715
|
-
if (l.isSymbolicLink()) return n2(new wt2(o2,
|
|
24272
|
+
if (l.isSymbolicLink()) return n2(new wt2(o2, path14__default.default.resolve(e, i2.join("/"))));
|
|
23716
24273
|
}
|
|
23717
24274
|
r();
|
|
23718
24275
|
}
|
|
@@ -23816,11 +24373,11 @@ var mo = (s3, t2) => {
|
|
|
23816
24373
|
};
|
|
23817
24374
|
var po = (s3, t2) => {
|
|
23818
24375
|
t2.forEach((e) => {
|
|
23819
|
-
e.charAt(0) === "@" ? It3({ file:
|
|
24376
|
+
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
24377
|
}), s3.end();
|
|
23821
24378
|
};
|
|
23822
24379
|
var Eo = async (s3, t2) => {
|
|
23823
|
-
for (let e of t2) e.charAt(0) === "@" ? await It3({ file:
|
|
24380
|
+
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
24381
|
s3.end();
|
|
23825
24382
|
};
|
|
23826
24383
|
var vt3 = K2(fo, mo, () => {
|
|
@@ -23845,11 +24402,11 @@ var GITHUB_ORG = "nextlyhq";
|
|
|
23845
24402
|
var GITHUB_REPO = "nextly";
|
|
23846
24403
|
async function downloadTemplate(templateName, branch = "main") {
|
|
23847
24404
|
const url = `https://codeload.github.com/${GITHUB_ORG}/${GITHUB_REPO}/tar.gz/${branch}`;
|
|
23848
|
-
const tmpDir =
|
|
24405
|
+
const tmpDir = path14__default.default.join(
|
|
23849
24406
|
process.env.TMPDIR || "/tmp",
|
|
23850
24407
|
`nextly-template-${Date.now()}`
|
|
23851
24408
|
);
|
|
23852
|
-
await
|
|
24409
|
+
await import_fs_extra9.default.ensureDir(tmpDir);
|
|
23853
24410
|
const repoPrefix = `${GITHUB_REPO}-${branch}`;
|
|
23854
24411
|
const baseFilter = `${repoPrefix}/templates/base/`;
|
|
23855
24412
|
const templateFilter = `${repoPrefix}/templates/${templateName}/`;
|
|
@@ -23878,7 +24435,7 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
23878
24435
|
})
|
|
23879
24436
|
);
|
|
23880
24437
|
} catch (error) {
|
|
23881
|
-
await
|
|
24438
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
23882
24439
|
});
|
|
23883
24440
|
if (error instanceof Error && error.name === "TimeoutError") {
|
|
23884
24441
|
throw new Error(
|
|
@@ -23887,17 +24444,17 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
23887
24444
|
}
|
|
23888
24445
|
throw error;
|
|
23889
24446
|
}
|
|
23890
|
-
const basePath =
|
|
23891
|
-
const templatePath =
|
|
23892
|
-
if (!await
|
|
23893
|
-
await
|
|
24447
|
+
const basePath = path14__default.default.join(tmpDir, "templates", "base");
|
|
24448
|
+
const templatePath = path14__default.default.join(tmpDir, "templates", templateName);
|
|
24449
|
+
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
24450
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
23894
24451
|
});
|
|
23895
24452
|
throw new Error(
|
|
23896
24453
|
`Base template not found in downloaded archive. The branch "${branch}" may not contain templates.`
|
|
23897
24454
|
);
|
|
23898
24455
|
}
|
|
23899
|
-
if (!await
|
|
23900
|
-
await
|
|
24456
|
+
if (!await import_fs_extra9.default.pathExists(templatePath)) {
|
|
24457
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
23901
24458
|
});
|
|
23902
24459
|
throw new Error(
|
|
23903
24460
|
`Template "${templateName}" not found in downloaded archive. Available templates may differ on branch "${branch}".`
|
|
@@ -23906,14 +24463,14 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
23906
24463
|
return { basePath, templatePath };
|
|
23907
24464
|
}
|
|
23908
24465
|
async function resolveLocalTemplate(localPath, templateName) {
|
|
23909
|
-
const basePath =
|
|
23910
|
-
const templatePath =
|
|
23911
|
-
if (!await
|
|
24466
|
+
const basePath = path14__default.default.join(localPath, "base");
|
|
24467
|
+
const templatePath = path14__default.default.join(localPath, templateName);
|
|
24468
|
+
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
23912
24469
|
throw new Error(
|
|
23913
24470
|
`Base template not found at ${basePath}. Check the --local-template path points to the templates/ directory.`
|
|
23914
24471
|
);
|
|
23915
24472
|
}
|
|
23916
|
-
if (!await
|
|
24473
|
+
if (!await import_fs_extra9.default.pathExists(templatePath)) {
|
|
23917
24474
|
throw new Error(
|
|
23918
24475
|
`Template "${templateName}" not found at ${templatePath}. Check the --local-template path points to the templates/ directory.`
|
|
23919
24476
|
);
|
|
@@ -23930,8 +24487,8 @@ async function resolveTemplateSource(templateName, options = {}) {
|
|
|
23930
24487
|
async function cleanupDownload(source) {
|
|
23931
24488
|
const tmpBase = process.env.TMPDIR || "/tmp";
|
|
23932
24489
|
if (source.basePath.startsWith(tmpBase)) {
|
|
23933
|
-
const extractionRoot =
|
|
23934
|
-
await
|
|
24490
|
+
const extractionRoot = path14__default.default.resolve(source.basePath, "../..");
|
|
24491
|
+
await import_fs_extra9.default.remove(extractionRoot).catch(() => {
|
|
23935
24492
|
});
|
|
23936
24493
|
}
|
|
23937
24494
|
}
|
|
@@ -23965,6 +24522,22 @@ var AVAILABLE_TEMPLATES = [
|
|
|
23965
24522
|
hasFrontendPages: true,
|
|
23966
24523
|
recommendedDatabase: "any",
|
|
23967
24524
|
release: "alpha"
|
|
24525
|
+
},
|
|
24526
|
+
{
|
|
24527
|
+
name: "plugin",
|
|
24528
|
+
label: "Plugin",
|
|
24529
|
+
description: "Build a reusable Nextly plugin (publishable npm package)",
|
|
24530
|
+
hint: "Plugin package + embedded /dev playground; no schema approach",
|
|
24531
|
+
// Plugins don't ask code-first vs visual, ship no app frontend, and bring
|
|
24532
|
+
// their own collections — they are a publishable library, not an app.
|
|
24533
|
+
approaches: [],
|
|
24534
|
+
defaultApproach: null,
|
|
24535
|
+
collections: [],
|
|
24536
|
+
singles: [],
|
|
24537
|
+
hasDemoData: false,
|
|
24538
|
+
hasFrontendPages: false,
|
|
24539
|
+
recommendedDatabase: "sqlite",
|
|
24540
|
+
release: "alpha"
|
|
23968
24541
|
}
|
|
23969
24542
|
];
|
|
23970
24543
|
function getTemplate(name) {
|
|
@@ -24033,14 +24606,37 @@ var DATABASE_LABELS = {
|
|
|
24033
24606
|
hint: "Popular alternative for production"
|
|
24034
24607
|
}
|
|
24035
24608
|
};
|
|
24609
|
+
var import_fs_extra10 = __toESM(require_lib());
|
|
24610
|
+
function resolveProjectArg(directory) {
|
|
24611
|
+
const trimmed = directory?.trim();
|
|
24612
|
+
if (!trimmed) {
|
|
24613
|
+
return { projectName: void 0, installInCwd: false };
|
|
24614
|
+
}
|
|
24615
|
+
if (trimmed === "." || trimmed === "./") {
|
|
24616
|
+
return { projectName: void 0, installInCwd: true };
|
|
24617
|
+
}
|
|
24618
|
+
return { projectName: path14__default.default.basename(trimmed), installInCwd: false };
|
|
24619
|
+
}
|
|
24620
|
+
function validateProjectName(name) {
|
|
24621
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(name)) {
|
|
24622
|
+
return "Use lowercase letters, numbers, hyphens, dots, or underscores";
|
|
24623
|
+
}
|
|
24624
|
+
return void 0;
|
|
24625
|
+
}
|
|
24626
|
+
function validateProjectNamePromptInput(value) {
|
|
24627
|
+
const trimmed = (value ?? "").trim();
|
|
24628
|
+
if (trimmed === "") return void 0;
|
|
24629
|
+
if (trimmed === "." || trimmed === "./") return void 0;
|
|
24630
|
+
const candidate = trimmed.startsWith("./") ? trimmed.slice(2) : trimmed;
|
|
24631
|
+
return validateProjectName(path14__default.default.basename(candidate));
|
|
24632
|
+
}
|
|
24036
24633
|
|
|
24037
24634
|
// src/prompts/project-name.ts
|
|
24038
|
-
var import_fs_extra9 = __toESM(require_lib());
|
|
24039
24635
|
async function isExistingNextProject(cwd) {
|
|
24040
|
-
const packageJsonPath =
|
|
24041
|
-
if (!await
|
|
24636
|
+
const packageJsonPath = path14__default.default.join(cwd, "package.json");
|
|
24637
|
+
if (!await import_fs_extra10.default.pathExists(packageJsonPath)) return false;
|
|
24042
24638
|
try {
|
|
24043
|
-
const packageJson = await
|
|
24639
|
+
const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
|
|
24044
24640
|
const deps = {
|
|
24045
24641
|
...packageJson.dependencies,
|
|
24046
24642
|
...packageJson.devDependencies
|
|
@@ -24050,6 +24646,42 @@ async function isExistingNextProject(cwd) {
|
|
|
24050
24646
|
return false;
|
|
24051
24647
|
}
|
|
24052
24648
|
}
|
|
24649
|
+
var DEFAULT_PROJECT_NAME = "my-nextly-app";
|
|
24650
|
+
async function promptForProjectName() {
|
|
24651
|
+
const answer = await Zt({
|
|
24652
|
+
message: "What should your project be called?",
|
|
24653
|
+
// `initialValue` pre-fills the buffer so Enter accepts the default.
|
|
24654
|
+
// The previous version used `placeholder` alone, which returned an
|
|
24655
|
+
// empty string on Enter and silently fell through to a cwd install —
|
|
24656
|
+
// the root cause of the original bug. `placeholder` is omitted here
|
|
24657
|
+
// because clack only shows it when the buffer is empty, and the
|
|
24658
|
+
// initialValue keeps it populated.
|
|
24659
|
+
initialValue: DEFAULT_PROJECT_NAME,
|
|
24660
|
+
validate: validateProjectNamePromptInput
|
|
24661
|
+
});
|
|
24662
|
+
if (Ct(answer)) {
|
|
24663
|
+
return { kind: "cancelled" };
|
|
24664
|
+
}
|
|
24665
|
+
return { kind: "resolved", value: resolveProjectArg(answer) };
|
|
24666
|
+
}
|
|
24667
|
+
async function promptDirectoryConflict(targetLabel) {
|
|
24668
|
+
const choice = await Jt({
|
|
24669
|
+
message: `Target directory ${targetLabel} is not empty. How would you like to proceed?`,
|
|
24670
|
+
options: [
|
|
24671
|
+
{ value: "cancel", label: "Cancel operation" },
|
|
24672
|
+
{
|
|
24673
|
+
value: "remove",
|
|
24674
|
+
label: "Remove existing files and continue"
|
|
24675
|
+
},
|
|
24676
|
+
{
|
|
24677
|
+
value: "ignore",
|
|
24678
|
+
label: "Ignore files and continue"
|
|
24679
|
+
}
|
|
24680
|
+
]
|
|
24681
|
+
});
|
|
24682
|
+
if (Ct(choice)) return "cancel";
|
|
24683
|
+
return choice;
|
|
24684
|
+
}
|
|
24053
24685
|
|
|
24054
24686
|
// src/prompts/template.ts
|
|
24055
24687
|
var import_picocolors2 = __toESM(require_picocolors2());
|
|
@@ -24065,395 +24697,117 @@ function getTemplatePromptOptions() {
|
|
|
24065
24697
|
label: "Blog",
|
|
24066
24698
|
hint: "Posts, authors, categories, clean design"
|
|
24067
24699
|
},
|
|
24700
|
+
{
|
|
24701
|
+
value: "plugin",
|
|
24702
|
+
label: "Plugin",
|
|
24703
|
+
hint: "Build a reusable Nextly plugin + embedded /dev playground"
|
|
24704
|
+
},
|
|
24068
24705
|
{
|
|
24069
24706
|
value: "_coming_soon",
|
|
24070
24707
|
label: import_picocolors2.default.dim("More templates coming soon"),
|
|
24071
|
-
hint: "website, portfolio, e-commerce"
|
|
24072
|
-
}
|
|
24073
|
-
];
|
|
24074
|
-
}
|
|
24075
|
-
function isValidTemplateSelection(value) {
|
|
24076
|
-
return value !== "_coming_soon";
|
|
24077
|
-
}
|
|
24078
|
-
|
|
24079
|
-
// src/utils/detect.ts
|
|
24080
|
-
var import_fs_extra10 = __toESM(require_lib());
|
|
24081
|
-
|
|
24082
|
-
// src/utils/detect-pm-from-user-agent.ts
|
|
24083
|
-
function detectPmFromUserAgent(userAgent) {
|
|
24084
|
-
if (!userAgent) return null;
|
|
24085
|
-
if (userAgent.startsWith("pnpm/")) return "pnpm";
|
|
24086
|
-
if (userAgent.startsWith("yarn/")) return "yarn";
|
|
24087
|
-
if (userAgent.startsWith("bun/")) return "bun";
|
|
24088
|
-
if (userAgent.startsWith("npm/")) return "npm";
|
|
24089
|
-
return null;
|
|
24090
|
-
}
|
|
24091
|
-
|
|
24092
|
-
// src/utils/detect.ts
|
|
24093
|
-
async function detectPackageManager(cwd) {
|
|
24094
|
-
const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
|
|
24095
|
-
if (fromUa) return fromUa;
|
|
24096
|
-
if (await import_fs_extra10.default.pathExists(path17__default.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
24097
|
-
if (await import_fs_extra10.default.pathExists(path17__default.default.join(cwd, "yarn.lock"))) return "yarn";
|
|
24098
|
-
if (await import_fs_extra10.default.pathExists(path17__default.default.join(cwd, "bun.lockb"))) return "bun";
|
|
24099
|
-
return "npm";
|
|
24100
|
-
}
|
|
24101
|
-
async function detectProject(cwd) {
|
|
24102
|
-
const packageJsonPath = path17__default.default.join(cwd, "package.json");
|
|
24103
|
-
if (!await import_fs_extra10.default.pathExists(packageJsonPath)) {
|
|
24104
|
-
throw new Error(
|
|
24105
|
-
"No package.json found. Please run this command in a Next.js project."
|
|
24106
|
-
);
|
|
24107
|
-
}
|
|
24108
|
-
const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
|
|
24109
|
-
const deps = {
|
|
24110
|
-
...packageJson.dependencies,
|
|
24111
|
-
...packageJson.devDependencies
|
|
24112
|
-
};
|
|
24113
|
-
const isNextJs = "next" in deps;
|
|
24114
|
-
if (!isNextJs) {
|
|
24115
|
-
throw new Error(
|
|
24116
|
-
"Next.js not found in dependencies. Please run this in a Next.js project."
|
|
24117
|
-
);
|
|
24118
|
-
}
|
|
24119
|
-
const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
|
|
24120
|
-
const srcDir = await import_fs_extra10.default.pathExists(path17__default.default.join(cwd, "src"));
|
|
24121
|
-
const appDirPaths = srcDir ? [path17__default.default.join(cwd, "src", "app")] : [path17__default.default.join(cwd, "app")];
|
|
24122
|
-
let isAppRouter = false;
|
|
24123
|
-
for (const appPath of appDirPaths) {
|
|
24124
|
-
if (await import_fs_extra10.default.pathExists(appPath)) {
|
|
24125
|
-
isAppRouter = true;
|
|
24126
|
-
break;
|
|
24127
|
-
}
|
|
24128
|
-
}
|
|
24129
|
-
if (!isAppRouter) {
|
|
24130
|
-
throw new Error(
|
|
24131
|
-
"App Router not detected. Nextly requires Next.js App Router (app/ directory)."
|
|
24132
|
-
);
|
|
24133
|
-
}
|
|
24134
|
-
const hasTypescript = await import_fs_extra10.default.pathExists(path17__default.default.join(cwd, "tsconfig.json"));
|
|
24135
|
-
const packageManager = await detectPackageManager(cwd);
|
|
24136
|
-
const appDir = srcDir ? "src/app" : "app";
|
|
24137
|
-
return {
|
|
24138
|
-
isNextJs,
|
|
24139
|
-
isAppRouter,
|
|
24140
|
-
hasTypescript,
|
|
24141
|
-
packageManager,
|
|
24142
|
-
nextVersion,
|
|
24143
|
-
srcDir,
|
|
24144
|
-
appDir
|
|
24145
|
-
};
|
|
24146
|
-
}
|
|
24147
|
-
|
|
24148
|
-
// src/utils/template.ts
|
|
24149
|
-
var import_fs_extra11 = __toESM(require_lib());
|
|
24150
|
-
var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
24151
|
-
".ts",
|
|
24152
|
-
".tsx",
|
|
24153
|
-
".js",
|
|
24154
|
-
".jsx",
|
|
24155
|
-
".json",
|
|
24156
|
-
".env",
|
|
24157
|
-
".md",
|
|
24158
|
-
".css",
|
|
24159
|
-
".html",
|
|
24160
|
-
".mjs",
|
|
24161
|
-
".cjs"
|
|
24162
|
-
]);
|
|
24163
|
-
var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
|
|
24164
|
-
function resolveTemplatePath(localTemplatePath) {
|
|
24165
|
-
const __dirname = path17__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
24166
|
-
const fromDist = path17__default.default.resolve(__dirname, "../templates");
|
|
24167
|
-
if (import_fs_extra11.default.existsSync(fromDist)) {
|
|
24168
|
-
return fromDist;
|
|
24169
|
-
}
|
|
24170
|
-
const fromSrc = path17__default.default.resolve(__dirname, "../../templates");
|
|
24171
|
-
if (import_fs_extra11.default.existsSync(fromSrc)) {
|
|
24172
|
-
return fromSrc;
|
|
24173
|
-
}
|
|
24174
|
-
throw new Error(
|
|
24175
|
-
"Could not find templates directory. Use --local-template to specify the templates path, or ensure templates are bundled."
|
|
24176
|
-
);
|
|
24177
|
-
}
|
|
24178
|
-
function buildPlaceholderMap(options) {
|
|
24179
|
-
const { database, databaseUrl } = options;
|
|
24180
|
-
return {
|
|
24181
|
-
"{{databaseDialect}}": database.type,
|
|
24182
|
-
"{{databaseUrl}}": databaseUrl || database.envExample
|
|
24183
|
-
};
|
|
24184
|
-
}
|
|
24185
|
-
async function replacePlaceholdersInFile(filePath, placeholders) {
|
|
24186
|
-
const ext = path17__default.default.extname(filePath).toLowerCase();
|
|
24187
|
-
const basename = path17__default.default.basename(filePath);
|
|
24188
|
-
const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
|
|
24189
|
-
if (!isTextFile) return;
|
|
24190
|
-
let content = await import_fs_extra11.default.readFile(filePath, "utf-8");
|
|
24191
|
-
let changed = false;
|
|
24192
|
-
for (const [placeholder, value] of Object.entries(placeholders)) {
|
|
24193
|
-
if (content.includes(placeholder)) {
|
|
24194
|
-
content = content.replaceAll(placeholder, value);
|
|
24195
|
-
changed = true;
|
|
24196
|
-
}
|
|
24197
|
-
}
|
|
24198
|
-
if (changed) {
|
|
24199
|
-
await import_fs_extra11.default.writeFile(filePath, content, "utf-8");
|
|
24200
|
-
}
|
|
24201
|
-
}
|
|
24202
|
-
async function replacePlaceholders(dir, placeholders) {
|
|
24203
|
-
const entries = await import_fs_extra11.default.readdir(dir, { withFileTypes: true });
|
|
24204
|
-
for (const entry of entries) {
|
|
24205
|
-
const fullPath = path17__default.default.join(dir, entry.name);
|
|
24206
|
-
if (entry.isDirectory()) {
|
|
24207
|
-
if (entry.name === "node_modules" || entry.name === ".git") continue;
|
|
24208
|
-
await replacePlaceholders(fullPath, placeholders);
|
|
24209
|
-
} else if (entry.isFile()) {
|
|
24210
|
-
await replacePlaceholdersInFile(fullPath, placeholders);
|
|
24211
|
-
}
|
|
24212
|
-
}
|
|
24213
|
-
}
|
|
24214
|
-
var PINNED_VERSIONS = {
|
|
24215
|
-
// Next.js ecosystem — resolved at runtime via fetchLatestVersion()
|
|
24216
|
-
// (see generatePackageJson)
|
|
24217
|
-
react: "^19.1.0",
|
|
24218
|
-
"react-dom": "^19.1.0",
|
|
24219
|
-
// Dev dependencies
|
|
24220
|
-
typescript: "^5",
|
|
24221
|
-
"@types/node": "^20",
|
|
24222
|
-
"@types/react": "^19",
|
|
24223
|
-
"@types/react-dom": "^19",
|
|
24224
|
-
"@tailwindcss/postcss": "^4",
|
|
24225
|
-
tailwindcss: "^4",
|
|
24226
|
-
eslint: "^9"
|
|
24227
|
-
};
|
|
24228
|
-
var RUNTIME_RESOLVED_PACKAGES = ["next", "eslint-config-next"];
|
|
24229
|
-
var NEXTLY_PACKAGES = [
|
|
24230
|
-
"nextly",
|
|
24231
|
-
"@nextlyhq/admin",
|
|
24232
|
-
"@nextlyhq/adapter-drizzle",
|
|
24233
|
-
"@nextlyhq/adapter-postgres",
|
|
24234
|
-
"@nextlyhq/adapter-mysql",
|
|
24235
|
-
"@nextlyhq/adapter-sqlite"
|
|
24236
|
-
];
|
|
24237
|
-
var resolvedNextlyVersions = null;
|
|
24238
|
-
async function fetchLatestVersion(pkg) {
|
|
24239
|
-
try {
|
|
24240
|
-
const res = await fetch(
|
|
24241
|
-
`https://registry.npmjs.org/-/package/${encodeURIComponent(pkg)}/dist-tags`,
|
|
24242
|
-
{ signal: AbortSignal.timeout(5e3) }
|
|
24243
|
-
);
|
|
24244
|
-
if (!res.ok) return "latest";
|
|
24245
|
-
const data = await res.json();
|
|
24246
|
-
return data.latest ? `^${data.latest}` : "latest";
|
|
24247
|
-
} catch {
|
|
24248
|
-
return "latest";
|
|
24249
|
-
}
|
|
24708
|
+
hint: "website, portfolio, e-commerce"
|
|
24709
|
+
}
|
|
24710
|
+
];
|
|
24250
24711
|
}
|
|
24251
|
-
|
|
24252
|
-
|
|
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;
|
|
24712
|
+
function isValidTemplateSelection(value) {
|
|
24713
|
+
return value !== "_coming_soon";
|
|
24260
24714
|
}
|
|
24261
|
-
|
|
24262
|
-
|
|
24263
|
-
|
|
24264
|
-
|
|
24265
|
-
|
|
24266
|
-
|
|
24267
|
-
|
|
24268
|
-
|
|
24269
|
-
|
|
24270
|
-
|
|
24271
|
-
|
|
24272
|
-
|
|
24273
|
-
);
|
|
24274
|
-
resolvedRuntimeVersions = Object.fromEntries(entries);
|
|
24275
|
-
return resolvedRuntimeVersions;
|
|
24715
|
+
|
|
24716
|
+
// src/utils/detect.ts
|
|
24717
|
+
var import_fs_extra11 = __toESM(require_lib());
|
|
24718
|
+
|
|
24719
|
+
// src/utils/detect-pm-from-user-agent.ts
|
|
24720
|
+
function detectPmFromUserAgent(userAgent) {
|
|
24721
|
+
if (!userAgent) return null;
|
|
24722
|
+
if (userAgent.startsWith("pnpm/")) return "pnpm";
|
|
24723
|
+
if (userAgent.startsWith("yarn/")) return "yarn";
|
|
24724
|
+
if (userAgent.startsWith("bun/")) return "bun";
|
|
24725
|
+
if (userAgent.startsWith("npm/")) return "npm";
|
|
24726
|
+
return null;
|
|
24276
24727
|
}
|
|
24277
|
-
|
|
24278
|
-
|
|
24279
|
-
|
|
24280
|
-
|
|
24281
|
-
|
|
24282
|
-
|
|
24283
|
-
|
|
24284
|
-
|
|
24285
|
-
|
|
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";
|
|
24728
|
+
|
|
24729
|
+
// src/utils/detect.ts
|
|
24730
|
+
async function detectPackageManager(cwd) {
|
|
24731
|
+
const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
|
|
24732
|
+
if (fromUa) return fromUa;
|
|
24733
|
+
if (await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
24734
|
+
if (await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "yarn.lock"))) return "yarn";
|
|
24735
|
+
if (await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "bun.lockb"))) return "bun";
|
|
24736
|
+
return "npm";
|
|
24341
24737
|
}
|
|
24342
|
-
async function
|
|
24343
|
-
const
|
|
24344
|
-
|
|
24345
|
-
projectType,
|
|
24346
|
-
targetDir,
|
|
24347
|
-
database,
|
|
24348
|
-
databaseUrl,
|
|
24349
|
-
useYalc = false,
|
|
24350
|
-
approach,
|
|
24351
|
-
templateSource
|
|
24352
|
-
} = options;
|
|
24353
|
-
if (targetDir !== process.cwd() && await import_fs_extra11.default.pathExists(targetDir)) {
|
|
24354
|
-
throw new Error(
|
|
24355
|
-
`Directory "${path17__default.default.basename(targetDir)}" already exists. Please choose a different name.`
|
|
24356
|
-
);
|
|
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)) {
|
|
24738
|
+
async function detectProject(cwd) {
|
|
24739
|
+
const packageJsonPath = path14__default.default.join(cwd, "package.json");
|
|
24740
|
+
if (!await import_fs_extra11.default.pathExists(packageJsonPath)) {
|
|
24369
24741
|
throw new Error(
|
|
24370
|
-
|
|
24742
|
+
"No package.json found. Please run this command in a Next.js project."
|
|
24371
24743
|
);
|
|
24372
24744
|
}
|
|
24373
|
-
|
|
24745
|
+
const packageJson = await import_fs_extra11.default.readJson(packageJsonPath);
|
|
24746
|
+
const deps = {
|
|
24747
|
+
...packageJson.dependencies,
|
|
24748
|
+
...packageJson.devDependencies
|
|
24749
|
+
};
|
|
24750
|
+
const isNextJs = "next" in deps;
|
|
24751
|
+
if (!isNextJs) {
|
|
24374
24752
|
throw new Error(
|
|
24375
|
-
|
|
24753
|
+
"Next.js not found in dependencies. Please run this in a Next.js project."
|
|
24376
24754
|
);
|
|
24377
24755
|
}
|
|
24378
|
-
|
|
24379
|
-
|
|
24380
|
-
|
|
24381
|
-
|
|
24756
|
+
const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
|
|
24757
|
+
const srcDir = await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "src"));
|
|
24758
|
+
const appDirPaths = srcDir ? [path14__default.default.join(cwd, "src", "app")] : [path14__default.default.join(cwd, "app")];
|
|
24759
|
+
let isAppRouter = false;
|
|
24760
|
+
for (const appPath of appDirPaths) {
|
|
24761
|
+
if (await import_fs_extra11.default.pathExists(appPath)) {
|
|
24762
|
+
isAppRouter = true;
|
|
24763
|
+
break;
|
|
24382
24764
|
}
|
|
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
24765
|
}
|
|
24394
|
-
|
|
24395
|
-
|
|
24396
|
-
|
|
24397
|
-
templateRootConfig,
|
|
24398
|
-
path17__default.default.join(targetDir, "nextly.config.ts"),
|
|
24399
|
-
{ overwrite: true }
|
|
24766
|
+
if (!isAppRouter) {
|
|
24767
|
+
throw new Error(
|
|
24768
|
+
"App Router not detected. Nextly requires Next.js App Router (app/ directory)."
|
|
24400
24769
|
);
|
|
24401
24770
|
}
|
|
24402
|
-
const
|
|
24403
|
-
|
|
24404
|
-
|
|
24405
|
-
|
|
24406
|
-
|
|
24407
|
-
|
|
24408
|
-
|
|
24409
|
-
|
|
24410
|
-
|
|
24411
|
-
|
|
24412
|
-
|
|
24413
|
-
|
|
24414
|
-
|
|
24415
|
-
|
|
24416
|
-
|
|
24417
|
-
|
|
24418
|
-
|
|
24419
|
-
|
|
24420
|
-
|
|
24421
|
-
|
|
24422
|
-
|
|
24423
|
-
|
|
24424
|
-
);
|
|
24425
|
-
const
|
|
24426
|
-
|
|
24427
|
-
await
|
|
24428
|
-
}
|
|
24429
|
-
const packageJsonContent = await generatePackageJson(
|
|
24430
|
-
projectName,
|
|
24431
|
-
database,
|
|
24432
|
-
useYalc
|
|
24433
|
-
);
|
|
24434
|
-
await import_fs_extra11.default.writeFile(
|
|
24435
|
-
path17__default.default.join(targetDir, "package.json"),
|
|
24436
|
-
packageJsonContent,
|
|
24437
|
-
"utf-8"
|
|
24438
|
-
);
|
|
24439
|
-
if (database.type === "sqlite") {
|
|
24440
|
-
await import_fs_extra11.default.ensureDir(path17__default.default.join(targetDir, "data"));
|
|
24441
|
-
}
|
|
24442
|
-
const placeholders = buildPlaceholderMap({ database, databaseUrl });
|
|
24443
|
-
if (approach) {
|
|
24444
|
-
placeholders["{{approach}}"] = approach;
|
|
24771
|
+
const hasTypescript = await import_fs_extra11.default.pathExists(path14__default.default.join(cwd, "tsconfig.json"));
|
|
24772
|
+
const packageManager = await detectPackageManager(cwd);
|
|
24773
|
+
const appDir = srcDir ? "src/app" : "app";
|
|
24774
|
+
return {
|
|
24775
|
+
isNextJs,
|
|
24776
|
+
isAppRouter,
|
|
24777
|
+
hasTypescript,
|
|
24778
|
+
packageManager,
|
|
24779
|
+
nextVersion,
|
|
24780
|
+
srcDir,
|
|
24781
|
+
appDir
|
|
24782
|
+
};
|
|
24783
|
+
}
|
|
24784
|
+
|
|
24785
|
+
// src/utils/fs.ts
|
|
24786
|
+
var import_fs_extra12 = __toESM(require_lib());
|
|
24787
|
+
async function isDirectoryNotEmpty(dir) {
|
|
24788
|
+
if (!await import_fs_extra12.default.pathExists(dir)) return false;
|
|
24789
|
+
const entries = await import_fs_extra12.default.readdir(dir);
|
|
24790
|
+
return entries.some((entry) => entry !== ".git");
|
|
24791
|
+
}
|
|
24792
|
+
async function emptyDirectory(dir) {
|
|
24793
|
+
if (!await import_fs_extra12.default.pathExists(dir)) return;
|
|
24794
|
+
for (const entry of await import_fs_extra12.default.readdir(dir)) {
|
|
24795
|
+
if (entry === ".git") continue;
|
|
24796
|
+
await import_fs_extra12.default.remove(path14__default.default.join(dir, entry));
|
|
24445
24797
|
}
|
|
24446
|
-
await replacePlaceholders(targetDir, placeholders);
|
|
24447
24798
|
}
|
|
24448
24799
|
|
|
24449
24800
|
// src/create-nextly.ts
|
|
24801
|
+
function cwdProjectName(cwd) {
|
|
24802
|
+
const basename = path14__default.default.basename(cwd);
|
|
24803
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(basename)) {
|
|
24804
|
+
return DEFAULT_PROJECT_NAME;
|
|
24805
|
+
}
|
|
24806
|
+
return basename;
|
|
24807
|
+
}
|
|
24450
24808
|
async function createNextly(options = {}) {
|
|
24451
|
-
const {
|
|
24452
|
-
|
|
24453
|
-
skipInstall = false,
|
|
24454
|
-
useYalc = false,
|
|
24455
|
-
installInCwd = false
|
|
24456
|
-
} = options;
|
|
24809
|
+
const { defaults = false, skipInstall = false, useYalc = false } = options;
|
|
24810
|
+
let installInCwd = options.installInCwd ?? false;
|
|
24457
24811
|
let { cwd = process.cwd() } = options;
|
|
24458
24812
|
let isFreshProject = false;
|
|
24459
24813
|
let projectName;
|
|
@@ -24474,37 +24828,48 @@ async function createNextly(options = {}) {
|
|
|
24474
24828
|
}
|
|
24475
24829
|
}
|
|
24476
24830
|
} else if (installInCwd) {
|
|
24477
|
-
projectName =
|
|
24831
|
+
projectName = cwdProjectName(cwd);
|
|
24478
24832
|
isFreshProject = true;
|
|
24479
24833
|
} else {
|
|
24480
24834
|
if (options.projectNameFromArg) {
|
|
24481
24835
|
projectName = options.projectNameFromArg;
|
|
24482
24836
|
} 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)) {
|
|
24837
|
+
const result = await promptForProjectName();
|
|
24838
|
+
if (result.kind === "cancelled") {
|
|
24495
24839
|
Nt("Cancelled.");
|
|
24496
24840
|
return;
|
|
24497
24841
|
}
|
|
24498
|
-
|
|
24842
|
+
if (result.value.installInCwd) {
|
|
24843
|
+
installInCwd = true;
|
|
24844
|
+
projectName = cwdProjectName(cwd);
|
|
24845
|
+
} else {
|
|
24846
|
+
projectName = result.value.projectName ?? DEFAULT_PROJECT_NAME;
|
|
24847
|
+
}
|
|
24499
24848
|
} else {
|
|
24500
|
-
projectName =
|
|
24849
|
+
projectName = DEFAULT_PROJECT_NAME;
|
|
24501
24850
|
}
|
|
24502
24851
|
isFreshProject = true;
|
|
24503
24852
|
}
|
|
24853
|
+
let allowExistingTarget = false;
|
|
24854
|
+
if (isFreshProject && projectName) {
|
|
24855
|
+
const conflictTargetDir = installInCwd ? cwd : path14__default.default.join(cwd, projectName);
|
|
24856
|
+
if (await isDirectoryNotEmpty(conflictTargetDir)) {
|
|
24857
|
+
const targetLabel = installInCwd ? "the current directory" : `"${projectName}"`;
|
|
24858
|
+
const choice = await promptDirectoryConflict(targetLabel);
|
|
24859
|
+
if (choice === "cancel") {
|
|
24860
|
+
Nt("Cancelled. No changes were made.");
|
|
24861
|
+
return;
|
|
24862
|
+
}
|
|
24863
|
+
allowExistingTarget = true;
|
|
24864
|
+
if (choice === "remove") {
|
|
24865
|
+
await emptyDirectory(conflictTargetDir);
|
|
24866
|
+
}
|
|
24867
|
+
}
|
|
24868
|
+
}
|
|
24504
24869
|
let projectType;
|
|
24505
24870
|
if (options.projectType) {
|
|
24506
24871
|
projectType = options.projectType;
|
|
24507
|
-
} else if (defaults) {
|
|
24872
|
+
} else if (defaults || existingProject) {
|
|
24508
24873
|
projectType = "blank";
|
|
24509
24874
|
} else {
|
|
24510
24875
|
const template = await Jt({
|
|
@@ -24592,6 +24957,7 @@ async function createNextly(options = {}) {
|
|
|
24592
24957
|
databaseUrl = url?.trim() || database.connectionUrl;
|
|
24593
24958
|
}
|
|
24594
24959
|
if (isFreshProject && projectName) {
|
|
24960
|
+
const targetDir = installInCwd ? cwd : path14__default.default.join(cwd, projectName);
|
|
24595
24961
|
const s3 = be();
|
|
24596
24962
|
let templateSource;
|
|
24597
24963
|
try {
|
|
@@ -24606,47 +24972,29 @@ async function createNextly(options = {}) {
|
|
|
24606
24972
|
} else {
|
|
24607
24973
|
s3.start("Scaffolding project...");
|
|
24608
24974
|
}
|
|
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
|
-
}
|
|
24975
|
+
await copyTemplate({
|
|
24976
|
+
projectName,
|
|
24977
|
+
projectType,
|
|
24978
|
+
targetDir,
|
|
24979
|
+
database,
|
|
24980
|
+
databaseUrl,
|
|
24981
|
+
useYalc,
|
|
24982
|
+
approach,
|
|
24983
|
+
templateSource,
|
|
24984
|
+
// Suppress copyTemplate's "directory already exists" guard when the
|
|
24985
|
+
// installer has already negotiated the conflict with the user
|
|
24986
|
+
// (either by emptying the dir or accepting an overlay). Without
|
|
24987
|
+
// this, the "ignore" path would still throw on the subdirectory
|
|
24988
|
+
// case where the target was non-empty.
|
|
24989
|
+
allowExistingTarget
|
|
24990
|
+
});
|
|
24991
|
+
if (!installInCwd) cwd = targetDir;
|
|
24643
24992
|
s3.stop("Project scaffolded");
|
|
24644
24993
|
} catch (error) {
|
|
24645
24994
|
s3.stop("Scaffolding failed");
|
|
24646
|
-
if (!installInCwd) {
|
|
24647
|
-
|
|
24648
|
-
|
|
24649
|
-
await import_fs_extra12.default.remove(targetDir);
|
|
24995
|
+
if (!installInCwd && !allowExistingTarget) {
|
|
24996
|
+
if (await import_fs_extra13.default.pathExists(targetDir)) {
|
|
24997
|
+
await import_fs_extra13.default.remove(targetDir);
|
|
24650
24998
|
}
|
|
24651
24999
|
}
|
|
24652
25000
|
capture("scaffold_failed", {
|
|
@@ -24686,7 +25034,8 @@ async function createNextly(options = {}) {
|
|
|
24686
25034
|
projectInfo,
|
|
24687
25035
|
database,
|
|
24688
25036
|
useYalc,
|
|
24689
|
-
isFreshProject
|
|
25037
|
+
isFreshProject,
|
|
25038
|
+
projectType
|
|
24690
25039
|
);
|
|
24691
25040
|
s3.stop("Dependencies installed");
|
|
24692
25041
|
capture("install_completed", {
|
|
@@ -24711,10 +25060,12 @@ async function createNextly(options = {}) {
|
|
|
24711
25060
|
await generateAdminPage(cwd, projectInfo);
|
|
24712
25061
|
await generateMediaRoutes(cwd, projectInfo);
|
|
24713
25062
|
await generateTypesDirectory(cwd, projectInfo);
|
|
24714
|
-
await patchNextConfig(cwd);
|
|
25063
|
+
await patchNextConfig(cwd, database);
|
|
25064
|
+
}
|
|
25065
|
+
if (projectType !== "plugin") {
|
|
25066
|
+
const envDatabase = databaseUrl ? { ...database, connectionUrl: databaseUrl, envExample: databaseUrl } : database;
|
|
25067
|
+
await generateEnv(cwd, envDatabase);
|
|
24715
25068
|
}
|
|
24716
|
-
const envDatabase = databaseUrl ? { ...database, connectionUrl: databaseUrl, envExample: databaseUrl } : database;
|
|
24717
|
-
await generateEnv(cwd, envDatabase);
|
|
24718
25069
|
s3.stop("Environment configured");
|
|
24719
25070
|
} catch (error) {
|
|
24720
25071
|
s3.stop("Failed to generate configuration");
|
|
@@ -24730,31 +25081,58 @@ async function createNextly(options = {}) {
|
|
|
24730
25081
|
if (isFreshProject && projectName && !installInCwd) {
|
|
24731
25082
|
lines.push(` ${import_picocolors3.default.bold("cd")} ${projectName}`);
|
|
24732
25083
|
}
|
|
24733
|
-
|
|
24734
|
-
|
|
24735
|
-
|
|
25084
|
+
if (projectType === "plugin") {
|
|
25085
|
+
lines.push(` ${import_picocolors3.default.bold(devCommand)}`);
|
|
25086
|
+
lines.push(
|
|
25087
|
+
` ${import_picocolors3.default.dim("\u2192 runs the embedded /dev playground (SQLite, hot-reload)")}`
|
|
25088
|
+
);
|
|
25089
|
+
lines.push("");
|
|
25090
|
+
lines.push(
|
|
25091
|
+
` Open ${import_picocolors3.default.cyan("http://localhost:3000/admin")} \u2014 your plugin is registered.`
|
|
25092
|
+
);
|
|
25093
|
+
lines.push(
|
|
25094
|
+
` Edit your plugin in ${import_picocolors3.default.dim("src/")}; the ${import_picocolors3.default.dim("dev/")} app is never published.`
|
|
25095
|
+
);
|
|
25096
|
+
lines.push("");
|
|
25097
|
+
lines.push(
|
|
25098
|
+
` ${import_picocolors3.default.bold(`${pm} test`)} runs the in-memory integration harness.`
|
|
25099
|
+
);
|
|
24736
25100
|
lines.push(
|
|
24737
|
-
`
|
|
25101
|
+
` ${import_picocolors3.default.bold(`${pm} run build`)}, then ${import_picocolors3.default.bold("npm publish")} to ship.`
|
|
25102
|
+
);
|
|
25103
|
+
lines.push("");
|
|
25104
|
+
lines.push(
|
|
25105
|
+
` Use it in an app: add ${import_picocolors3.default.dim("myPlugin()")} to ${import_picocolors3.default.dim("plugins")} in nextly.config.ts.`
|
|
24738
25106
|
);
|
|
24739
25107
|
} else {
|
|
25108
|
+
lines.push(` ${import_picocolors3.default.bold(devCommand)}`);
|
|
25109
|
+
lines.push("");
|
|
25110
|
+
if (databaseType === "sqlite") {
|
|
25111
|
+
lines.push(
|
|
25112
|
+
` Your database (SQLite) is stored at ${import_picocolors3.default.dim("./data/nextly.db")}`
|
|
25113
|
+
);
|
|
25114
|
+
} else {
|
|
25115
|
+
lines.push(
|
|
25116
|
+
` Make sure your ${DATABASE_LABELS[databaseType].label} server is running before starting.`
|
|
25117
|
+
);
|
|
25118
|
+
}
|
|
24740
25119
|
lines.push(
|
|
24741
|
-
`
|
|
25120
|
+
` ${import_picocolors3.default.bold(devCommand)} will create system tables on first run.`
|
|
24742
25121
|
);
|
|
25122
|
+
if (projectType === "blog") {
|
|
25123
|
+
lines.push(
|
|
25124
|
+
` Visit ${import_picocolors3.default.cyan("http://localhost:3000")} to see your blog.`
|
|
25125
|
+
);
|
|
25126
|
+
}
|
|
25127
|
+
lines.push(
|
|
25128
|
+
` Visit ${import_picocolors3.default.cyan("http://localhost:3000/admin/setup")} to create your admin account.`
|
|
25129
|
+
);
|
|
25130
|
+
lines.push("");
|
|
25131
|
+
lines.push(
|
|
25132
|
+
` Storage: Using local disk ${import_picocolors3.default.dim("(./public/uploads)")} by default.`
|
|
25133
|
+
);
|
|
25134
|
+
lines.push(" See docs to configure S3, Vercel Blob, or other providers.");
|
|
24743
25135
|
}
|
|
24744
|
-
lines.push(
|
|
24745
|
-
` ${import_picocolors3.default.bold(devCommand)} will create system tables on first run.`
|
|
24746
|
-
);
|
|
24747
|
-
if (projectType === "blog") {
|
|
24748
|
-
lines.push(` Visit ${import_picocolors3.default.cyan("http://localhost:3000")} to see your blog.`);
|
|
24749
|
-
}
|
|
24750
|
-
lines.push(
|
|
24751
|
-
` Visit ${import_picocolors3.default.cyan("http://localhost:3000/admin/setup")} to create your admin account.`
|
|
24752
|
-
);
|
|
24753
|
-
lines.push("");
|
|
24754
|
-
lines.push(
|
|
24755
|
-
` Storage: Using local disk ${import_picocolors3.default.dim("(./public/uploads)")} by default.`
|
|
24756
|
-
);
|
|
24757
|
-
lines.push(" See docs to configure S3, Vercel Blob, or other providers.");
|
|
24758
25136
|
Vt2(lines.join("\n"), "Next steps");
|
|
24759
25137
|
Gt(`Docs: ${import_picocolors3.default.cyan("https://nextlyhq.com/docs")}`);
|
|
24760
25138
|
}
|