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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
|
-
import
|
|
2
|
+
import path15, { win32, posix, dirname, sep, basename, parse, join } from 'path';
|
|
3
3
|
import fs, { createReadStream, appendFileSync, writeFileSync as writeFileSync$1, statSync, readFileSync, createWriteStream, existsSync } from 'fs';
|
|
4
4
|
import * as k from 'readline';
|
|
5
5
|
import k__default, { createInterface } from 'readline';
|
|
@@ -164,54 +164,54 @@ var require_polyfills = __commonJS({
|
|
|
164
164
|
}
|
|
165
165
|
var chdir;
|
|
166
166
|
module.exports = patch;
|
|
167
|
-
function patch(
|
|
167
|
+
function patch(fs16) {
|
|
168
168
|
if (constants4.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
169
|
-
patchLchmod(
|
|
170
|
-
}
|
|
171
|
-
if (!
|
|
172
|
-
patchLutimes(
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
if (
|
|
193
|
-
|
|
169
|
+
patchLchmod(fs16);
|
|
170
|
+
}
|
|
171
|
+
if (!fs16.lutimes) {
|
|
172
|
+
patchLutimes(fs16);
|
|
173
|
+
}
|
|
174
|
+
fs16.chown = chownFix(fs16.chown);
|
|
175
|
+
fs16.fchown = chownFix(fs16.fchown);
|
|
176
|
+
fs16.lchown = chownFix(fs16.lchown);
|
|
177
|
+
fs16.chmod = chmodFix(fs16.chmod);
|
|
178
|
+
fs16.fchmod = chmodFix(fs16.fchmod);
|
|
179
|
+
fs16.lchmod = chmodFix(fs16.lchmod);
|
|
180
|
+
fs16.chownSync = chownFixSync(fs16.chownSync);
|
|
181
|
+
fs16.fchownSync = chownFixSync(fs16.fchownSync);
|
|
182
|
+
fs16.lchownSync = chownFixSync(fs16.lchownSync);
|
|
183
|
+
fs16.chmodSync = chmodFixSync(fs16.chmodSync);
|
|
184
|
+
fs16.fchmodSync = chmodFixSync(fs16.fchmodSync);
|
|
185
|
+
fs16.lchmodSync = chmodFixSync(fs16.lchmodSync);
|
|
186
|
+
fs16.stat = statFix(fs16.stat);
|
|
187
|
+
fs16.fstat = statFix(fs16.fstat);
|
|
188
|
+
fs16.lstat = statFix(fs16.lstat);
|
|
189
|
+
fs16.statSync = statFixSync(fs16.statSync);
|
|
190
|
+
fs16.fstatSync = statFixSync(fs16.fstatSync);
|
|
191
|
+
fs16.lstatSync = statFixSync(fs16.lstatSync);
|
|
192
|
+
if (fs16.chmod && !fs16.lchmod) {
|
|
193
|
+
fs16.lchmod = function(path21, mode, cb) {
|
|
194
194
|
if (cb) process.nextTick(cb);
|
|
195
195
|
};
|
|
196
|
-
|
|
196
|
+
fs16.lchmodSync = function() {
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
if (
|
|
200
|
-
|
|
199
|
+
if (fs16.chown && !fs16.lchown) {
|
|
200
|
+
fs16.lchown = function(path21, uid, gid, cb) {
|
|
201
201
|
if (cb) process.nextTick(cb);
|
|
202
202
|
};
|
|
203
|
-
|
|
203
|
+
fs16.lchownSync = function() {
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
206
|
if (platform3 === "win32") {
|
|
207
|
-
|
|
207
|
+
fs16.rename = typeof fs16.rename !== "function" ? fs16.rename : (function(fs$rename) {
|
|
208
208
|
function rename(from, to2, cb) {
|
|
209
209
|
var start = Date.now();
|
|
210
210
|
var backoff = 0;
|
|
211
211
|
fs$rename(from, to2, function CB(er2) {
|
|
212
212
|
if (er2 && (er2.code === "EACCES" || er2.code === "EPERM" || er2.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
213
213
|
setTimeout(function() {
|
|
214
|
-
|
|
214
|
+
fs16.stat(to2, function(stater, st3) {
|
|
215
215
|
if (stater && stater.code === "ENOENT")
|
|
216
216
|
fs$rename(from, to2, CB);
|
|
217
217
|
else
|
|
@@ -227,9 +227,9 @@ var require_polyfills = __commonJS({
|
|
|
227
227
|
}
|
|
228
228
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
229
229
|
return rename;
|
|
230
|
-
})(
|
|
230
|
+
})(fs16.rename);
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
fs16.read = typeof fs16.read !== "function" ? fs16.read : (function(fs$read) {
|
|
233
233
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
234
234
|
var callback;
|
|
235
235
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -237,22 +237,22 @@ var require_polyfills = __commonJS({
|
|
|
237
237
|
callback = function(er2, _3, __) {
|
|
238
238
|
if (er2 && er2.code === "EAGAIN" && eagCounter < 10) {
|
|
239
239
|
eagCounter++;
|
|
240
|
-
return fs$read.call(
|
|
240
|
+
return fs$read.call(fs16, fd, buffer, offset, length, position, callback);
|
|
241
241
|
}
|
|
242
242
|
callback_.apply(this, arguments);
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
|
-
return fs$read.call(
|
|
245
|
+
return fs$read.call(fs16, fd, buffer, offset, length, position, callback);
|
|
246
246
|
}
|
|
247
247
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
248
248
|
return read;
|
|
249
|
-
})(
|
|
250
|
-
|
|
249
|
+
})(fs16.read);
|
|
250
|
+
fs16.readSync = typeof fs16.readSync !== "function" ? fs16.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
251
251
|
return function(fd, buffer, offset, length, position) {
|
|
252
252
|
var eagCounter = 0;
|
|
253
253
|
while (true) {
|
|
254
254
|
try {
|
|
255
|
-
return fs$readSync.call(
|
|
255
|
+
return fs$readSync.call(fs16, fd, buffer, offset, length, position);
|
|
256
256
|
} catch (er2) {
|
|
257
257
|
if (er2.code === "EAGAIN" && eagCounter < 10) {
|
|
258
258
|
eagCounter++;
|
|
@@ -262,11 +262,11 @@ var require_polyfills = __commonJS({
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
|
-
})(
|
|
266
|
-
function patchLchmod(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
265
|
+
})(fs16.readSync);
|
|
266
|
+
function patchLchmod(fs17) {
|
|
267
|
+
fs17.lchmod = function(path21, mode, callback) {
|
|
268
|
+
fs17.open(
|
|
269
|
+
path21,
|
|
270
270
|
constants4.O_WRONLY | constants4.O_SYMLINK,
|
|
271
271
|
mode,
|
|
272
272
|
function(err, fd) {
|
|
@@ -274,80 +274,80 @@ var require_polyfills = __commonJS({
|
|
|
274
274
|
if (callback) callback(err);
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
277
|
-
|
|
278
|
-
|
|
277
|
+
fs17.fchmod(fd, mode, function(err2) {
|
|
278
|
+
fs17.close(fd, function(err22) {
|
|
279
279
|
if (callback) callback(err2 || err22);
|
|
280
280
|
});
|
|
281
281
|
});
|
|
282
282
|
}
|
|
283
283
|
);
|
|
284
284
|
};
|
|
285
|
-
|
|
286
|
-
var fd =
|
|
285
|
+
fs17.lchmodSync = function(path21, mode) {
|
|
286
|
+
var fd = fs17.openSync(path21, constants4.O_WRONLY | constants4.O_SYMLINK, mode);
|
|
287
287
|
var threw = true;
|
|
288
288
|
var ret;
|
|
289
289
|
try {
|
|
290
|
-
ret =
|
|
290
|
+
ret = fs17.fchmodSync(fd, mode);
|
|
291
291
|
threw = false;
|
|
292
292
|
} finally {
|
|
293
293
|
if (threw) {
|
|
294
294
|
try {
|
|
295
|
-
|
|
295
|
+
fs17.closeSync(fd);
|
|
296
296
|
} catch (er2) {
|
|
297
297
|
}
|
|
298
298
|
} else {
|
|
299
|
-
|
|
299
|
+
fs17.closeSync(fd);
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
return ret;
|
|
303
303
|
};
|
|
304
304
|
}
|
|
305
|
-
function patchLutimes(
|
|
306
|
-
if (constants4.hasOwnProperty("O_SYMLINK") &&
|
|
307
|
-
|
|
308
|
-
|
|
305
|
+
function patchLutimes(fs17) {
|
|
306
|
+
if (constants4.hasOwnProperty("O_SYMLINK") && fs17.futimes) {
|
|
307
|
+
fs17.lutimes = function(path21, at3, mt4, cb) {
|
|
308
|
+
fs17.open(path21, constants4.O_SYMLINK, function(er2, fd) {
|
|
309
309
|
if (er2) {
|
|
310
310
|
if (cb) cb(er2);
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
fs17.futimes(fd, at3, mt4, function(er3) {
|
|
314
|
+
fs17.close(fd, function(er22) {
|
|
315
315
|
if (cb) cb(er3 || er22);
|
|
316
316
|
});
|
|
317
317
|
});
|
|
318
318
|
});
|
|
319
319
|
};
|
|
320
|
-
|
|
321
|
-
var fd =
|
|
320
|
+
fs17.lutimesSync = function(path21, at3, mt4) {
|
|
321
|
+
var fd = fs17.openSync(path21, constants4.O_SYMLINK);
|
|
322
322
|
var ret;
|
|
323
323
|
var threw = true;
|
|
324
324
|
try {
|
|
325
|
-
ret =
|
|
325
|
+
ret = fs17.futimesSync(fd, at3, mt4);
|
|
326
326
|
threw = false;
|
|
327
327
|
} finally {
|
|
328
328
|
if (threw) {
|
|
329
329
|
try {
|
|
330
|
-
|
|
330
|
+
fs17.closeSync(fd);
|
|
331
331
|
} catch (er2) {
|
|
332
332
|
}
|
|
333
333
|
} else {
|
|
334
|
-
|
|
334
|
+
fs17.closeSync(fd);
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
return ret;
|
|
338
338
|
};
|
|
339
|
-
} else if (
|
|
340
|
-
|
|
339
|
+
} else if (fs17.futimes) {
|
|
340
|
+
fs17.lutimes = function(_a, _b, _c, cb) {
|
|
341
341
|
if (cb) process.nextTick(cb);
|
|
342
342
|
};
|
|
343
|
-
|
|
343
|
+
fs17.lutimesSync = function() {
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
function chmodFix(orig) {
|
|
348
348
|
if (!orig) return orig;
|
|
349
349
|
return function(target, mode, cb) {
|
|
350
|
-
return orig.call(
|
|
350
|
+
return orig.call(fs16, target, mode, function(er2) {
|
|
351
351
|
if (chownErOk(er2)) er2 = null;
|
|
352
352
|
if (cb) cb.apply(this, arguments);
|
|
353
353
|
});
|
|
@@ -357,7 +357,7 @@ var require_polyfills = __commonJS({
|
|
|
357
357
|
if (!orig) return orig;
|
|
358
358
|
return function(target, mode) {
|
|
359
359
|
try {
|
|
360
|
-
return orig.call(
|
|
360
|
+
return orig.call(fs16, target, mode);
|
|
361
361
|
} catch (er2) {
|
|
362
362
|
if (!chownErOk(er2)) throw er2;
|
|
363
363
|
}
|
|
@@ -366,7 +366,7 @@ var require_polyfills = __commonJS({
|
|
|
366
366
|
function chownFix(orig) {
|
|
367
367
|
if (!orig) return orig;
|
|
368
368
|
return function(target, uid, gid, cb) {
|
|
369
|
-
return orig.call(
|
|
369
|
+
return orig.call(fs16, target, uid, gid, function(er2) {
|
|
370
370
|
if (chownErOk(er2)) er2 = null;
|
|
371
371
|
if (cb) cb.apply(this, arguments);
|
|
372
372
|
});
|
|
@@ -376,7 +376,7 @@ var require_polyfills = __commonJS({
|
|
|
376
376
|
if (!orig) return orig;
|
|
377
377
|
return function(target, uid, gid) {
|
|
378
378
|
try {
|
|
379
|
-
return orig.call(
|
|
379
|
+
return orig.call(fs16, target, uid, gid);
|
|
380
380
|
} catch (er2) {
|
|
381
381
|
if (!chownErOk(er2)) throw er2;
|
|
382
382
|
}
|
|
@@ -396,13 +396,13 @@ var require_polyfills = __commonJS({
|
|
|
396
396
|
}
|
|
397
397
|
if (cb) cb.apply(this, arguments);
|
|
398
398
|
}
|
|
399
|
-
return options ? orig.call(
|
|
399
|
+
return options ? orig.call(fs16, target, options, callback) : orig.call(fs16, target, callback);
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
402
|
function statFixSync(orig) {
|
|
403
403
|
if (!orig) return orig;
|
|
404
404
|
return function(target, options) {
|
|
405
|
-
var stats = options ? orig.call(
|
|
405
|
+
var stats = options ? orig.call(fs16, target, options) : orig.call(fs16, target);
|
|
406
406
|
if (stats) {
|
|
407
407
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
408
408
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -431,16 +431,16 @@ var require_legacy_streams = __commonJS({
|
|
|
431
431
|
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports$1, module) {
|
|
432
432
|
var Stream = __require("stream").Stream;
|
|
433
433
|
module.exports = legacy;
|
|
434
|
-
function legacy(
|
|
434
|
+
function legacy(fs16) {
|
|
435
435
|
return {
|
|
436
436
|
ReadStream,
|
|
437
437
|
WriteStream
|
|
438
438
|
};
|
|
439
|
-
function ReadStream(
|
|
440
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
439
|
+
function ReadStream(path21, options) {
|
|
440
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path21, options);
|
|
441
441
|
Stream.call(this);
|
|
442
442
|
var self = this;
|
|
443
|
-
this.path =
|
|
443
|
+
this.path = path21;
|
|
444
444
|
this.fd = null;
|
|
445
445
|
this.readable = true;
|
|
446
446
|
this.paused = false;
|
|
@@ -474,7 +474,7 @@ var require_legacy_streams = __commonJS({
|
|
|
474
474
|
});
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
477
|
-
|
|
477
|
+
fs16.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
478
478
|
if (err) {
|
|
479
479
|
self.emit("error", err);
|
|
480
480
|
self.readable = false;
|
|
@@ -485,10 +485,10 @@ var require_legacy_streams = __commonJS({
|
|
|
485
485
|
self._read();
|
|
486
486
|
});
|
|
487
487
|
}
|
|
488
|
-
function WriteStream(
|
|
489
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
488
|
+
function WriteStream(path21, options) {
|
|
489
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path21, options);
|
|
490
490
|
Stream.call(this);
|
|
491
|
-
this.path =
|
|
491
|
+
this.path = path21;
|
|
492
492
|
this.fd = null;
|
|
493
493
|
this.writable = true;
|
|
494
494
|
this.flags = "w";
|
|
@@ -513,7 +513,7 @@ var require_legacy_streams = __commonJS({
|
|
|
513
513
|
this.busy = false;
|
|
514
514
|
this._queue = [];
|
|
515
515
|
if (this.fd === null) {
|
|
516
|
-
this._open =
|
|
516
|
+
this._open = fs16.open;
|
|
517
517
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
518
518
|
this.flush();
|
|
519
519
|
}
|
|
@@ -547,7 +547,7 @@ var require_clone = __commonJS({
|
|
|
547
547
|
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
548
548
|
var require_graceful_fs = __commonJS({
|
|
549
549
|
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports$1, module) {
|
|
550
|
-
var
|
|
550
|
+
var fs16 = __require("fs");
|
|
551
551
|
var polyfills = require_polyfills();
|
|
552
552
|
var legacy = require_legacy_streams();
|
|
553
553
|
var clone = require_clone();
|
|
@@ -579,12 +579,12 @@ var require_graceful_fs = __commonJS({
|
|
|
579
579
|
m2 = "GFS4: " + m2.split(/\n/).join("\nGFS4: ");
|
|
580
580
|
console.error(m2);
|
|
581
581
|
};
|
|
582
|
-
if (!
|
|
582
|
+
if (!fs16[gracefulQueue]) {
|
|
583
583
|
queue = global[gracefulQueue] || [];
|
|
584
|
-
publishQueue(
|
|
585
|
-
|
|
584
|
+
publishQueue(fs16, queue);
|
|
585
|
+
fs16.close = (function(fs$close) {
|
|
586
586
|
function close(fd, cb) {
|
|
587
|
-
return fs$close.call(
|
|
587
|
+
return fs$close.call(fs16, fd, function(err) {
|
|
588
588
|
if (!err) {
|
|
589
589
|
resetQueue();
|
|
590
590
|
}
|
|
@@ -596,48 +596,48 @@ var require_graceful_fs = __commonJS({
|
|
|
596
596
|
value: fs$close
|
|
597
597
|
});
|
|
598
598
|
return close;
|
|
599
|
-
})(
|
|
600
|
-
|
|
599
|
+
})(fs16.close);
|
|
600
|
+
fs16.closeSync = (function(fs$closeSync) {
|
|
601
601
|
function closeSync(fd) {
|
|
602
|
-
fs$closeSync.apply(
|
|
602
|
+
fs$closeSync.apply(fs16, arguments);
|
|
603
603
|
resetQueue();
|
|
604
604
|
}
|
|
605
605
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
606
606
|
value: fs$closeSync
|
|
607
607
|
});
|
|
608
608
|
return closeSync;
|
|
609
|
-
})(
|
|
609
|
+
})(fs16.closeSync);
|
|
610
610
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
611
611
|
process.on("exit", function() {
|
|
612
|
-
debug(
|
|
613
|
-
__require("assert").equal(
|
|
612
|
+
debug(fs16[gracefulQueue]);
|
|
613
|
+
__require("assert").equal(fs16[gracefulQueue].length, 0);
|
|
614
614
|
});
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
617
|
var queue;
|
|
618
618
|
if (!global[gracefulQueue]) {
|
|
619
|
-
publishQueue(global,
|
|
620
|
-
}
|
|
621
|
-
module.exports = patch(clone(
|
|
622
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
623
|
-
module.exports = patch(
|
|
624
|
-
|
|
625
|
-
}
|
|
626
|
-
function patch(
|
|
627
|
-
polyfills(
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
var fs$readFile =
|
|
632
|
-
|
|
633
|
-
function readFile(
|
|
619
|
+
publishQueue(global, fs16[gracefulQueue]);
|
|
620
|
+
}
|
|
621
|
+
module.exports = patch(clone(fs16));
|
|
622
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs16.__patched) {
|
|
623
|
+
module.exports = patch(fs16);
|
|
624
|
+
fs16.__patched = true;
|
|
625
|
+
}
|
|
626
|
+
function patch(fs17) {
|
|
627
|
+
polyfills(fs17);
|
|
628
|
+
fs17.gracefulify = patch;
|
|
629
|
+
fs17.createReadStream = createReadStream3;
|
|
630
|
+
fs17.createWriteStream = createWriteStream2;
|
|
631
|
+
var fs$readFile = fs17.readFile;
|
|
632
|
+
fs17.readFile = readFile;
|
|
633
|
+
function readFile(path21, options, cb) {
|
|
634
634
|
if (typeof options === "function")
|
|
635
635
|
cb = options, options = null;
|
|
636
|
-
return go$readFile(
|
|
637
|
-
function go$readFile(
|
|
638
|
-
return fs$readFile(
|
|
636
|
+
return go$readFile(path21, options, cb);
|
|
637
|
+
function go$readFile(path22, options2, cb2, startTime) {
|
|
638
|
+
return fs$readFile(path22, options2, function(err) {
|
|
639
639
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
640
|
-
enqueue([go$readFile, [
|
|
640
|
+
enqueue([go$readFile, [path22, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
641
641
|
else {
|
|
642
642
|
if (typeof cb2 === "function")
|
|
643
643
|
cb2.apply(this, arguments);
|
|
@@ -645,16 +645,16 @@ var require_graceful_fs = __commonJS({
|
|
|
645
645
|
});
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
|
-
var fs$writeFile =
|
|
649
|
-
|
|
650
|
-
function writeFile(
|
|
648
|
+
var fs$writeFile = fs17.writeFile;
|
|
649
|
+
fs17.writeFile = writeFile;
|
|
650
|
+
function writeFile(path21, data, options, cb) {
|
|
651
651
|
if (typeof options === "function")
|
|
652
652
|
cb = options, options = null;
|
|
653
|
-
return go$writeFile(
|
|
654
|
-
function go$writeFile(
|
|
655
|
-
return fs$writeFile(
|
|
653
|
+
return go$writeFile(path21, data, options, cb);
|
|
654
|
+
function go$writeFile(path22, data2, options2, cb2, startTime) {
|
|
655
|
+
return fs$writeFile(path22, data2, options2, function(err) {
|
|
656
656
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
657
|
-
enqueue([go$writeFile, [
|
|
657
|
+
enqueue([go$writeFile, [path22, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
658
658
|
else {
|
|
659
659
|
if (typeof cb2 === "function")
|
|
660
660
|
cb2.apply(this, arguments);
|
|
@@ -662,17 +662,17 @@ var require_graceful_fs = __commonJS({
|
|
|
662
662
|
});
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
var fs$appendFile =
|
|
665
|
+
var fs$appendFile = fs17.appendFile;
|
|
666
666
|
if (fs$appendFile)
|
|
667
|
-
|
|
668
|
-
function appendFile(
|
|
667
|
+
fs17.appendFile = appendFile;
|
|
668
|
+
function appendFile(path21, data, options, cb) {
|
|
669
669
|
if (typeof options === "function")
|
|
670
670
|
cb = options, options = null;
|
|
671
|
-
return go$appendFile(
|
|
672
|
-
function go$appendFile(
|
|
673
|
-
return fs$appendFile(
|
|
671
|
+
return go$appendFile(path21, data, options, cb);
|
|
672
|
+
function go$appendFile(path22, data2, options2, cb2, startTime) {
|
|
673
|
+
return fs$appendFile(path22, data2, options2, function(err) {
|
|
674
674
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
675
|
-
enqueue([go$appendFile, [
|
|
675
|
+
enqueue([go$appendFile, [path22, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
676
676
|
else {
|
|
677
677
|
if (typeof cb2 === "function")
|
|
678
678
|
cb2.apply(this, arguments);
|
|
@@ -680,9 +680,9 @@ var require_graceful_fs = __commonJS({
|
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
|
-
var fs$copyFile =
|
|
683
|
+
var fs$copyFile = fs17.copyFile;
|
|
684
684
|
if (fs$copyFile)
|
|
685
|
-
|
|
685
|
+
fs17.copyFile = copyFile;
|
|
686
686
|
function copyFile(src, dest, flags, cb) {
|
|
687
687
|
if (typeof flags === "function") {
|
|
688
688
|
cb = flags;
|
|
@@ -700,34 +700,34 @@ var require_graceful_fs = __commonJS({
|
|
|
700
700
|
});
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
|
-
var fs$readdir =
|
|
704
|
-
|
|
703
|
+
var fs$readdir = fs17.readdir;
|
|
704
|
+
fs17.readdir = readdir;
|
|
705
705
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
706
|
-
function readdir(
|
|
706
|
+
function readdir(path21, options, cb) {
|
|
707
707
|
if (typeof options === "function")
|
|
708
708
|
cb = options, options = null;
|
|
709
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
710
|
-
return fs$readdir(
|
|
711
|
-
|
|
709
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path22, options2, cb2, startTime) {
|
|
710
|
+
return fs$readdir(path22, fs$readdirCallback(
|
|
711
|
+
path22,
|
|
712
712
|
options2,
|
|
713
713
|
cb2,
|
|
714
714
|
startTime
|
|
715
715
|
));
|
|
716
|
-
} : function go$readdir2(
|
|
717
|
-
return fs$readdir(
|
|
718
|
-
|
|
716
|
+
} : function go$readdir2(path22, options2, cb2, startTime) {
|
|
717
|
+
return fs$readdir(path22, options2, fs$readdirCallback(
|
|
718
|
+
path22,
|
|
719
719
|
options2,
|
|
720
720
|
cb2,
|
|
721
721
|
startTime
|
|
722
722
|
));
|
|
723
723
|
};
|
|
724
|
-
return go$readdir(
|
|
725
|
-
function fs$readdirCallback(
|
|
724
|
+
return go$readdir(path21, options, cb);
|
|
725
|
+
function fs$readdirCallback(path22, options2, cb2, startTime) {
|
|
726
726
|
return function(err, files) {
|
|
727
727
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
728
728
|
enqueue([
|
|
729
729
|
go$readdir,
|
|
730
|
-
[
|
|
730
|
+
[path22, options2, cb2],
|
|
731
731
|
err,
|
|
732
732
|
startTime || Date.now(),
|
|
733
733
|
Date.now()
|
|
@@ -742,21 +742,21 @@ var require_graceful_fs = __commonJS({
|
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
744
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
745
|
-
var legStreams = legacy(
|
|
745
|
+
var legStreams = legacy(fs17);
|
|
746
746
|
ReadStream = legStreams.ReadStream;
|
|
747
747
|
WriteStream = legStreams.WriteStream;
|
|
748
748
|
}
|
|
749
|
-
var fs$ReadStream =
|
|
749
|
+
var fs$ReadStream = fs17.ReadStream;
|
|
750
750
|
if (fs$ReadStream) {
|
|
751
751
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
752
752
|
ReadStream.prototype.open = ReadStream$open;
|
|
753
753
|
}
|
|
754
|
-
var fs$WriteStream =
|
|
754
|
+
var fs$WriteStream = fs17.WriteStream;
|
|
755
755
|
if (fs$WriteStream) {
|
|
756
756
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
757
757
|
WriteStream.prototype.open = WriteStream$open;
|
|
758
758
|
}
|
|
759
|
-
Object.defineProperty(
|
|
759
|
+
Object.defineProperty(fs17, "ReadStream", {
|
|
760
760
|
get: function() {
|
|
761
761
|
return ReadStream;
|
|
762
762
|
},
|
|
@@ -766,7 +766,7 @@ var require_graceful_fs = __commonJS({
|
|
|
766
766
|
enumerable: true,
|
|
767
767
|
configurable: true
|
|
768
768
|
});
|
|
769
|
-
Object.defineProperty(
|
|
769
|
+
Object.defineProperty(fs17, "WriteStream", {
|
|
770
770
|
get: function() {
|
|
771
771
|
return WriteStream;
|
|
772
772
|
},
|
|
@@ -777,7 +777,7 @@ var require_graceful_fs = __commonJS({
|
|
|
777
777
|
configurable: true
|
|
778
778
|
});
|
|
779
779
|
var FileReadStream = ReadStream;
|
|
780
|
-
Object.defineProperty(
|
|
780
|
+
Object.defineProperty(fs17, "FileReadStream", {
|
|
781
781
|
get: function() {
|
|
782
782
|
return FileReadStream;
|
|
783
783
|
},
|
|
@@ -788,7 +788,7 @@ var require_graceful_fs = __commonJS({
|
|
|
788
788
|
configurable: true
|
|
789
789
|
});
|
|
790
790
|
var FileWriteStream = WriteStream;
|
|
791
|
-
Object.defineProperty(
|
|
791
|
+
Object.defineProperty(fs17, "FileWriteStream", {
|
|
792
792
|
get: function() {
|
|
793
793
|
return FileWriteStream;
|
|
794
794
|
},
|
|
@@ -798,7 +798,7 @@ var require_graceful_fs = __commonJS({
|
|
|
798
798
|
enumerable: true,
|
|
799
799
|
configurable: true
|
|
800
800
|
});
|
|
801
|
-
function ReadStream(
|
|
801
|
+
function ReadStream(path21, options) {
|
|
802
802
|
if (this instanceof ReadStream)
|
|
803
803
|
return fs$ReadStream.apply(this, arguments), this;
|
|
804
804
|
else
|
|
@@ -818,7 +818,7 @@ var require_graceful_fs = __commonJS({
|
|
|
818
818
|
}
|
|
819
819
|
});
|
|
820
820
|
}
|
|
821
|
-
function WriteStream(
|
|
821
|
+
function WriteStream(path21, options) {
|
|
822
822
|
if (this instanceof WriteStream)
|
|
823
823
|
return fs$WriteStream.apply(this, arguments), this;
|
|
824
824
|
else
|
|
@@ -836,22 +836,22 @@ var require_graceful_fs = __commonJS({
|
|
|
836
836
|
}
|
|
837
837
|
});
|
|
838
838
|
}
|
|
839
|
-
function createReadStream3(
|
|
840
|
-
return new
|
|
839
|
+
function createReadStream3(path21, options) {
|
|
840
|
+
return new fs17.ReadStream(path21, options);
|
|
841
841
|
}
|
|
842
|
-
function createWriteStream2(
|
|
843
|
-
return new
|
|
842
|
+
function createWriteStream2(path21, options) {
|
|
843
|
+
return new fs17.WriteStream(path21, options);
|
|
844
844
|
}
|
|
845
|
-
var fs$open =
|
|
846
|
-
|
|
847
|
-
function open(
|
|
845
|
+
var fs$open = fs17.open;
|
|
846
|
+
fs17.open = open;
|
|
847
|
+
function open(path21, flags, mode, cb) {
|
|
848
848
|
if (typeof mode === "function")
|
|
849
849
|
cb = mode, mode = null;
|
|
850
|
-
return go$open(
|
|
851
|
-
function go$open(
|
|
852
|
-
return fs$open(
|
|
850
|
+
return go$open(path21, flags, mode, cb);
|
|
851
|
+
function go$open(path22, flags2, mode2, cb2, startTime) {
|
|
852
|
+
return fs$open(path22, flags2, mode2, function(err, fd) {
|
|
853
853
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
854
|
-
enqueue([go$open, [
|
|
854
|
+
enqueue([go$open, [path22, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
855
855
|
else {
|
|
856
856
|
if (typeof cb2 === "function")
|
|
857
857
|
cb2.apply(this, arguments);
|
|
@@ -859,20 +859,20 @@ var require_graceful_fs = __commonJS({
|
|
|
859
859
|
});
|
|
860
860
|
}
|
|
861
861
|
}
|
|
862
|
-
return
|
|
862
|
+
return fs17;
|
|
863
863
|
}
|
|
864
864
|
function enqueue(elem) {
|
|
865
865
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
866
|
-
|
|
866
|
+
fs16[gracefulQueue].push(elem);
|
|
867
867
|
retry();
|
|
868
868
|
}
|
|
869
869
|
var retryTimer;
|
|
870
870
|
function resetQueue() {
|
|
871
871
|
var now = Date.now();
|
|
872
|
-
for (var i2 = 0; i2 <
|
|
873
|
-
if (
|
|
874
|
-
|
|
875
|
-
|
|
872
|
+
for (var i2 = 0; i2 < fs16[gracefulQueue].length; ++i2) {
|
|
873
|
+
if (fs16[gracefulQueue][i2].length > 2) {
|
|
874
|
+
fs16[gracefulQueue][i2][3] = now;
|
|
875
|
+
fs16[gracefulQueue][i2][4] = now;
|
|
876
876
|
}
|
|
877
877
|
}
|
|
878
878
|
retry();
|
|
@@ -880,9 +880,9 @@ var require_graceful_fs = __commonJS({
|
|
|
880
880
|
function retry() {
|
|
881
881
|
clearTimeout(retryTimer);
|
|
882
882
|
retryTimer = void 0;
|
|
883
|
-
if (
|
|
883
|
+
if (fs16[gracefulQueue].length === 0)
|
|
884
884
|
return;
|
|
885
|
-
var elem =
|
|
885
|
+
var elem = fs16[gracefulQueue].shift();
|
|
886
886
|
var fn2 = elem[0];
|
|
887
887
|
var args = elem[1];
|
|
888
888
|
var err = elem[2];
|
|
@@ -904,7 +904,7 @@ var require_graceful_fs = __commonJS({
|
|
|
904
904
|
debug("RETRY", fn2.name, args);
|
|
905
905
|
fn2.apply(null, args.concat([startTime]));
|
|
906
906
|
} else {
|
|
907
|
-
|
|
907
|
+
fs16[gracefulQueue].push(elem);
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
910
|
if (retryTimer === void 0) {
|
|
@@ -918,7 +918,7 @@ var require_graceful_fs = __commonJS({
|
|
|
918
918
|
var require_fs = __commonJS({
|
|
919
919
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/fs/index.js"(exports$1) {
|
|
920
920
|
var u3 = require_universalify().fromCallback;
|
|
921
|
-
var
|
|
921
|
+
var fs16 = require_graceful_fs();
|
|
922
922
|
var api = [
|
|
923
923
|
"access",
|
|
924
924
|
"appendFile",
|
|
@@ -959,26 +959,26 @@ var require_fs = __commonJS({
|
|
|
959
959
|
"utimes",
|
|
960
960
|
"writeFile"
|
|
961
961
|
].filter((key) => {
|
|
962
|
-
return typeof
|
|
962
|
+
return typeof fs16[key] === "function";
|
|
963
963
|
});
|
|
964
|
-
Object.assign(exports$1,
|
|
964
|
+
Object.assign(exports$1, fs16);
|
|
965
965
|
api.forEach((method) => {
|
|
966
|
-
exports$1[method] = u3(
|
|
966
|
+
exports$1[method] = u3(fs16[method]);
|
|
967
967
|
});
|
|
968
968
|
exports$1.exists = function(filename, callback) {
|
|
969
969
|
if (typeof callback === "function") {
|
|
970
|
-
return
|
|
970
|
+
return fs16.exists(filename, callback);
|
|
971
971
|
}
|
|
972
972
|
return new Promise((resolve) => {
|
|
973
|
-
return
|
|
973
|
+
return fs16.exists(filename, resolve);
|
|
974
974
|
});
|
|
975
975
|
};
|
|
976
976
|
exports$1.read = function(fd, buffer, offset, length, position, callback) {
|
|
977
977
|
if (typeof callback === "function") {
|
|
978
|
-
return
|
|
978
|
+
return fs16.read(fd, buffer, offset, length, position, callback);
|
|
979
979
|
}
|
|
980
980
|
return new Promise((resolve, reject) => {
|
|
981
|
-
|
|
981
|
+
fs16.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
982
982
|
if (err) return reject(err);
|
|
983
983
|
resolve({ bytesRead, buffer: buffer2 });
|
|
984
984
|
});
|
|
@@ -986,10 +986,10 @@ var require_fs = __commonJS({
|
|
|
986
986
|
};
|
|
987
987
|
exports$1.write = function(fd, buffer, ...args) {
|
|
988
988
|
if (typeof args[args.length - 1] === "function") {
|
|
989
|
-
return
|
|
989
|
+
return fs16.write(fd, buffer, ...args);
|
|
990
990
|
}
|
|
991
991
|
return new Promise((resolve, reject) => {
|
|
992
|
-
|
|
992
|
+
fs16.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
993
993
|
if (err) return reject(err);
|
|
994
994
|
resolve({ bytesWritten, buffer: buffer2 });
|
|
995
995
|
});
|
|
@@ -997,10 +997,10 @@ var require_fs = __commonJS({
|
|
|
997
997
|
};
|
|
998
998
|
exports$1.readv = function(fd, buffers, ...args) {
|
|
999
999
|
if (typeof args[args.length - 1] === "function") {
|
|
1000
|
-
return
|
|
1000
|
+
return fs16.readv(fd, buffers, ...args);
|
|
1001
1001
|
}
|
|
1002
1002
|
return new Promise((resolve, reject) => {
|
|
1003
|
-
|
|
1003
|
+
fs16.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
1004
1004
|
if (err) return reject(err);
|
|
1005
1005
|
resolve({ bytesRead, buffers: buffers2 });
|
|
1006
1006
|
});
|
|
@@ -1008,17 +1008,17 @@ var require_fs = __commonJS({
|
|
|
1008
1008
|
};
|
|
1009
1009
|
exports$1.writev = function(fd, buffers, ...args) {
|
|
1010
1010
|
if (typeof args[args.length - 1] === "function") {
|
|
1011
|
-
return
|
|
1011
|
+
return fs16.writev(fd, buffers, ...args);
|
|
1012
1012
|
}
|
|
1013
1013
|
return new Promise((resolve, reject) => {
|
|
1014
|
-
|
|
1014
|
+
fs16.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
1015
1015
|
if (err) return reject(err);
|
|
1016
1016
|
resolve({ bytesWritten, buffers: buffers2 });
|
|
1017
1017
|
});
|
|
1018
1018
|
});
|
|
1019
1019
|
};
|
|
1020
|
-
if (typeof
|
|
1021
|
-
exports$1.realpath.native = u3(
|
|
1020
|
+
if (typeof fs16.realpath.native === "function") {
|
|
1021
|
+
exports$1.realpath.native = u3(fs16.realpath.native);
|
|
1022
1022
|
} else {
|
|
1023
1023
|
process.emitWarning(
|
|
1024
1024
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
@@ -1032,10 +1032,10 @@ var require_fs = __commonJS({
|
|
|
1032
1032
|
// ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/utils.js
|
|
1033
1033
|
var require_utils2 = __commonJS({
|
|
1034
1034
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/utils.js"(exports$1, module) {
|
|
1035
|
-
var
|
|
1035
|
+
var path21 = __require("path");
|
|
1036
1036
|
module.exports.checkPath = function checkPath(pth) {
|
|
1037
1037
|
if (process.platform === "win32") {
|
|
1038
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
1038
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path21.parse(pth).root, ""));
|
|
1039
1039
|
if (pathHasInvalidWinCharacters) {
|
|
1040
1040
|
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
1041
1041
|
error.code = "EINVAL";
|
|
@@ -1049,7 +1049,7 @@ var require_utils2 = __commonJS({
|
|
|
1049
1049
|
// ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/make-dir.js
|
|
1050
1050
|
var require_make_dir = __commonJS({
|
|
1051
1051
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports$1, module) {
|
|
1052
|
-
var
|
|
1052
|
+
var fs16 = require_fs();
|
|
1053
1053
|
var { checkPath } = require_utils2();
|
|
1054
1054
|
var getMode = (options) => {
|
|
1055
1055
|
const defaults = { mode: 511 };
|
|
@@ -1058,14 +1058,14 @@ var require_make_dir = __commonJS({
|
|
|
1058
1058
|
};
|
|
1059
1059
|
module.exports.makeDir = async (dir, options) => {
|
|
1060
1060
|
checkPath(dir);
|
|
1061
|
-
return
|
|
1061
|
+
return fs16.mkdir(dir, {
|
|
1062
1062
|
mode: getMode(options),
|
|
1063
1063
|
recursive: true
|
|
1064
1064
|
});
|
|
1065
1065
|
};
|
|
1066
1066
|
module.exports.makeDirSync = (dir, options) => {
|
|
1067
1067
|
checkPath(dir);
|
|
1068
|
-
return
|
|
1068
|
+
return fs16.mkdirSync(dir, {
|
|
1069
1069
|
mode: getMode(options),
|
|
1070
1070
|
recursive: true
|
|
1071
1071
|
});
|
|
@@ -1095,13 +1095,13 @@ var require_mkdirs = __commonJS({
|
|
|
1095
1095
|
var require_path_exists = __commonJS({
|
|
1096
1096
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/path-exists/index.js"(exports$1, module) {
|
|
1097
1097
|
var u3 = require_universalify().fromPromise;
|
|
1098
|
-
var
|
|
1099
|
-
function pathExists(
|
|
1100
|
-
return
|
|
1098
|
+
var fs16 = require_fs();
|
|
1099
|
+
function pathExists(path21) {
|
|
1100
|
+
return fs16.access(path21).then(() => true).catch(() => false);
|
|
1101
1101
|
}
|
|
1102
1102
|
module.exports = {
|
|
1103
1103
|
pathExists: u3(pathExists),
|
|
1104
|
-
pathExistsSync:
|
|
1104
|
+
pathExistsSync: fs16.existsSync
|
|
1105
1105
|
};
|
|
1106
1106
|
}
|
|
1107
1107
|
});
|
|
@@ -1109,16 +1109,16 @@ var require_path_exists = __commonJS({
|
|
|
1109
1109
|
// ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/utimes.js
|
|
1110
1110
|
var require_utimes = __commonJS({
|
|
1111
1111
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/utimes.js"(exports$1, module) {
|
|
1112
|
-
var
|
|
1112
|
+
var fs16 = require_fs();
|
|
1113
1113
|
var u3 = require_universalify().fromPromise;
|
|
1114
|
-
async function utimesMillis(
|
|
1115
|
-
const fd = await
|
|
1114
|
+
async function utimesMillis(path21, atime, mtime) {
|
|
1115
|
+
const fd = await fs16.open(path21, "r+");
|
|
1116
1116
|
let closeErr = null;
|
|
1117
1117
|
try {
|
|
1118
|
-
await
|
|
1118
|
+
await fs16.futimes(fd, atime, mtime);
|
|
1119
1119
|
} finally {
|
|
1120
1120
|
try {
|
|
1121
|
-
await
|
|
1121
|
+
await fs16.close(fd);
|
|
1122
1122
|
} catch (e) {
|
|
1123
1123
|
closeErr = e;
|
|
1124
1124
|
}
|
|
@@ -1127,10 +1127,10 @@ var require_utimes = __commonJS({
|
|
|
1127
1127
|
throw closeErr;
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
|
-
function utimesMillisSync(
|
|
1131
|
-
const fd =
|
|
1132
|
-
|
|
1133
|
-
return
|
|
1130
|
+
function utimesMillisSync(path21, atime, mtime) {
|
|
1131
|
+
const fd = fs16.openSync(path21, "r+");
|
|
1132
|
+
fs16.futimesSync(fd, atime, mtime);
|
|
1133
|
+
return fs16.closeSync(fd);
|
|
1134
1134
|
}
|
|
1135
1135
|
module.exports = {
|
|
1136
1136
|
utimesMillis: u3(utimesMillis),
|
|
@@ -1142,11 +1142,11 @@ var require_utimes = __commonJS({
|
|
|
1142
1142
|
// ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/stat.js
|
|
1143
1143
|
var require_stat = __commonJS({
|
|
1144
1144
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/stat.js"(exports$1, module) {
|
|
1145
|
-
var
|
|
1146
|
-
var
|
|
1145
|
+
var fs16 = require_fs();
|
|
1146
|
+
var path21 = __require("path");
|
|
1147
1147
|
var u3 = require_universalify().fromPromise;
|
|
1148
1148
|
function getStats(src, dest, opts) {
|
|
1149
|
-
const statFunc = opts.dereference ? (file) =>
|
|
1149
|
+
const statFunc = opts.dereference ? (file) => fs16.stat(file, { bigint: true }) : (file) => fs16.lstat(file, { bigint: true });
|
|
1150
1150
|
return Promise.all([
|
|
1151
1151
|
statFunc(src),
|
|
1152
1152
|
statFunc(dest).catch((err) => {
|
|
@@ -1157,7 +1157,7 @@ var require_stat = __commonJS({
|
|
|
1157
1157
|
}
|
|
1158
1158
|
function getStatsSync(src, dest, opts) {
|
|
1159
1159
|
let destStat;
|
|
1160
|
-
const statFunc = opts.dereference ? (file) =>
|
|
1160
|
+
const statFunc = opts.dereference ? (file) => fs16.statSync(file, { bigint: true }) : (file) => fs16.lstatSync(file, { bigint: true });
|
|
1161
1161
|
const srcStat = statFunc(src);
|
|
1162
1162
|
try {
|
|
1163
1163
|
destStat = statFunc(dest);
|
|
@@ -1171,8 +1171,8 @@ var require_stat = __commonJS({
|
|
|
1171
1171
|
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
1172
1172
|
if (destStat) {
|
|
1173
1173
|
if (areIdentical(srcStat, destStat)) {
|
|
1174
|
-
const srcBaseName =
|
|
1175
|
-
const destBaseName =
|
|
1174
|
+
const srcBaseName = path21.basename(src);
|
|
1175
|
+
const destBaseName = path21.basename(dest);
|
|
1176
1176
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1177
1177
|
return { srcStat, destStat, isChangingCase: true };
|
|
1178
1178
|
}
|
|
@@ -1194,8 +1194,8 @@ var require_stat = __commonJS({
|
|
|
1194
1194
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
1195
1195
|
if (destStat) {
|
|
1196
1196
|
if (areIdentical(srcStat, destStat)) {
|
|
1197
|
-
const srcBaseName =
|
|
1198
|
-
const destBaseName =
|
|
1197
|
+
const srcBaseName = path21.basename(src);
|
|
1198
|
+
const destBaseName = path21.basename(dest);
|
|
1199
1199
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1200
1200
|
return { srcStat, destStat, isChangingCase: true };
|
|
1201
1201
|
}
|
|
@@ -1214,12 +1214,12 @@ var require_stat = __commonJS({
|
|
|
1214
1214
|
return { srcStat, destStat };
|
|
1215
1215
|
}
|
|
1216
1216
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
1217
|
-
const srcParent =
|
|
1218
|
-
const destParent =
|
|
1219
|
-
if (destParent === srcParent || destParent ===
|
|
1217
|
+
const srcParent = path21.resolve(path21.dirname(src));
|
|
1218
|
+
const destParent = path21.resolve(path21.dirname(dest));
|
|
1219
|
+
if (destParent === srcParent || destParent === path21.parse(destParent).root) return;
|
|
1220
1220
|
let destStat;
|
|
1221
1221
|
try {
|
|
1222
|
-
destStat = await
|
|
1222
|
+
destStat = await fs16.stat(destParent, { bigint: true });
|
|
1223
1223
|
} catch (err) {
|
|
1224
1224
|
if (err.code === "ENOENT") return;
|
|
1225
1225
|
throw err;
|
|
@@ -1230,12 +1230,12 @@ var require_stat = __commonJS({
|
|
|
1230
1230
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
1231
1231
|
}
|
|
1232
1232
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
1233
|
-
const srcParent =
|
|
1234
|
-
const destParent =
|
|
1235
|
-
if (destParent === srcParent || destParent ===
|
|
1233
|
+
const srcParent = path21.resolve(path21.dirname(src));
|
|
1234
|
+
const destParent = path21.resolve(path21.dirname(dest));
|
|
1235
|
+
if (destParent === srcParent || destParent === path21.parse(destParent).root) return;
|
|
1236
1236
|
let destStat;
|
|
1237
1237
|
try {
|
|
1238
|
-
destStat =
|
|
1238
|
+
destStat = fs16.statSync(destParent, { bigint: true });
|
|
1239
1239
|
} catch (err) {
|
|
1240
1240
|
if (err.code === "ENOENT") return;
|
|
1241
1241
|
throw err;
|
|
@@ -1249,8 +1249,8 @@ var require_stat = __commonJS({
|
|
|
1249
1249
|
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
1250
1250
|
}
|
|
1251
1251
|
function isSrcSubdir(src, dest) {
|
|
1252
|
-
const srcArr =
|
|
1253
|
-
const destArr =
|
|
1252
|
+
const srcArr = path21.resolve(src).split(path21.sep).filter((i2) => i2);
|
|
1253
|
+
const destArr = path21.resolve(dest).split(path21.sep).filter((i2) => i2);
|
|
1254
1254
|
return srcArr.every((cur, i2) => destArr[i2] === cur);
|
|
1255
1255
|
}
|
|
1256
1256
|
function errMsg(src, dest, funcName) {
|
|
@@ -1300,8 +1300,8 @@ var require_async = __commonJS({
|
|
|
1300
1300
|
// ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy.js
|
|
1301
1301
|
var require_copy = __commonJS({
|
|
1302
1302
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy.js"(exports$1, module) {
|
|
1303
|
-
var
|
|
1304
|
-
var
|
|
1303
|
+
var fs16 = require_fs();
|
|
1304
|
+
var path21 = __require("path");
|
|
1305
1305
|
var { mkdirs } = require_mkdirs();
|
|
1306
1306
|
var { pathExists } = require_path_exists();
|
|
1307
1307
|
var { utimesMillis } = require_utimes();
|
|
@@ -1324,7 +1324,7 @@ var require_copy = __commonJS({
|
|
|
1324
1324
|
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
1325
1325
|
const include = await runFilter(src, dest, opts);
|
|
1326
1326
|
if (!include) return;
|
|
1327
|
-
const destParent =
|
|
1327
|
+
const destParent = path21.dirname(dest);
|
|
1328
1328
|
const dirExists = await pathExists(destParent);
|
|
1329
1329
|
if (!dirExists) {
|
|
1330
1330
|
await mkdirs(destParent);
|
|
@@ -1336,7 +1336,7 @@ var require_copy = __commonJS({
|
|
|
1336
1336
|
return opts.filter(src, dest);
|
|
1337
1337
|
}
|
|
1338
1338
|
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
1339
|
-
const statFn = opts.dereference ?
|
|
1339
|
+
const statFn = opts.dereference ? fs16.stat : fs16.lstat;
|
|
1340
1340
|
const srcStat = await statFn(src);
|
|
1341
1341
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
1342
1342
|
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -1348,7 +1348,7 @@ var require_copy = __commonJS({
|
|
|
1348
1348
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
1349
1349
|
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
1350
1350
|
if (opts.overwrite) {
|
|
1351
|
-
await
|
|
1351
|
+
await fs16.unlink(dest);
|
|
1352
1352
|
return copyFile(srcStat, src, dest, opts);
|
|
1353
1353
|
}
|
|
1354
1354
|
if (opts.errorOnExist) {
|
|
@@ -1356,29 +1356,29 @@ var require_copy = __commonJS({
|
|
|
1356
1356
|
}
|
|
1357
1357
|
}
|
|
1358
1358
|
async function copyFile(srcStat, src, dest, opts) {
|
|
1359
|
-
await
|
|
1359
|
+
await fs16.copyFile(src, dest);
|
|
1360
1360
|
if (opts.preserveTimestamps) {
|
|
1361
1361
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
1362
1362
|
await makeFileWritable(dest, srcStat.mode);
|
|
1363
1363
|
}
|
|
1364
|
-
const updatedSrcStat = await
|
|
1364
|
+
const updatedSrcStat = await fs16.stat(src);
|
|
1365
1365
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1366
1366
|
}
|
|
1367
|
-
return
|
|
1367
|
+
return fs16.chmod(dest, srcStat.mode);
|
|
1368
1368
|
}
|
|
1369
1369
|
function fileIsNotWritable(srcMode) {
|
|
1370
1370
|
return (srcMode & 128) === 0;
|
|
1371
1371
|
}
|
|
1372
1372
|
function makeFileWritable(dest, srcMode) {
|
|
1373
|
-
return
|
|
1373
|
+
return fs16.chmod(dest, srcMode | 128);
|
|
1374
1374
|
}
|
|
1375
1375
|
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
1376
1376
|
if (!destStat) {
|
|
1377
|
-
await
|
|
1377
|
+
await fs16.mkdir(dest);
|
|
1378
1378
|
}
|
|
1379
|
-
await asyncIteratorConcurrentProcess(await
|
|
1380
|
-
const srcItem =
|
|
1381
|
-
const destItem =
|
|
1379
|
+
await asyncIteratorConcurrentProcess(await fs16.opendir(src), async (item) => {
|
|
1380
|
+
const srcItem = path21.join(src, item.name);
|
|
1381
|
+
const destItem = path21.join(dest, item.name);
|
|
1382
1382
|
const include = await runFilter(srcItem, destItem, opts);
|
|
1383
1383
|
if (include) {
|
|
1384
1384
|
const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
@@ -1386,26 +1386,26 @@ var require_copy = __commonJS({
|
|
|
1386
1386
|
}
|
|
1387
1387
|
});
|
|
1388
1388
|
if (!destStat) {
|
|
1389
|
-
await
|
|
1389
|
+
await fs16.chmod(dest, srcStat.mode);
|
|
1390
1390
|
}
|
|
1391
1391
|
}
|
|
1392
1392
|
async function onLink(destStat, src, dest, opts) {
|
|
1393
|
-
let resolvedSrc = await
|
|
1393
|
+
let resolvedSrc = await fs16.readlink(src);
|
|
1394
1394
|
if (opts.dereference) {
|
|
1395
|
-
resolvedSrc =
|
|
1395
|
+
resolvedSrc = path21.resolve(process.cwd(), resolvedSrc);
|
|
1396
1396
|
}
|
|
1397
1397
|
if (!destStat) {
|
|
1398
|
-
return
|
|
1398
|
+
return fs16.symlink(resolvedSrc, dest);
|
|
1399
1399
|
}
|
|
1400
1400
|
let resolvedDest = null;
|
|
1401
1401
|
try {
|
|
1402
|
-
resolvedDest = await
|
|
1402
|
+
resolvedDest = await fs16.readlink(dest);
|
|
1403
1403
|
} catch (e) {
|
|
1404
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
1404
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs16.symlink(resolvedSrc, dest);
|
|
1405
1405
|
throw e;
|
|
1406
1406
|
}
|
|
1407
1407
|
if (opts.dereference) {
|
|
1408
|
-
resolvedDest =
|
|
1408
|
+
resolvedDest = path21.resolve(process.cwd(), resolvedDest);
|
|
1409
1409
|
}
|
|
1410
1410
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1411
1411
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -1413,8 +1413,8 @@ var require_copy = __commonJS({
|
|
|
1413
1413
|
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
1414
1414
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1415
1415
|
}
|
|
1416
|
-
await
|
|
1417
|
-
return
|
|
1416
|
+
await fs16.unlink(dest);
|
|
1417
|
+
return fs16.symlink(resolvedSrc, dest);
|
|
1418
1418
|
}
|
|
1419
1419
|
module.exports = copy;
|
|
1420
1420
|
}
|
|
@@ -1423,8 +1423,8 @@ var require_copy = __commonJS({
|
|
|
1423
1423
|
// ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy-sync.js
|
|
1424
1424
|
var require_copy_sync = __commonJS({
|
|
1425
1425
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/copy/copy-sync.js"(exports$1, module) {
|
|
1426
|
-
var
|
|
1427
|
-
var
|
|
1426
|
+
var fs16 = require_graceful_fs();
|
|
1427
|
+
var path21 = __require("path");
|
|
1428
1428
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
1429
1429
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
1430
1430
|
var stat = require_stat();
|
|
@@ -1445,12 +1445,12 @@ var require_copy_sync = __commonJS({
|
|
|
1445
1445
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
1446
1446
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
1447
1447
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
1448
|
-
const destParent =
|
|
1449
|
-
if (!
|
|
1448
|
+
const destParent = path21.dirname(dest);
|
|
1449
|
+
if (!fs16.existsSync(destParent)) mkdirsSync(destParent);
|
|
1450
1450
|
return getStats(destStat, src, dest, opts);
|
|
1451
1451
|
}
|
|
1452
1452
|
function getStats(destStat, src, dest, opts) {
|
|
1453
|
-
const statSync2 = opts.dereference ?
|
|
1453
|
+
const statSync2 = opts.dereference ? fs16.statSync : fs16.lstatSync;
|
|
1454
1454
|
const srcStat = statSync2(src);
|
|
1455
1455
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
1456
1456
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -1465,14 +1465,14 @@ var require_copy_sync = __commonJS({
|
|
|
1465
1465
|
}
|
|
1466
1466
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
1467
1467
|
if (opts.overwrite) {
|
|
1468
|
-
|
|
1468
|
+
fs16.unlinkSync(dest);
|
|
1469
1469
|
return copyFile(srcStat, src, dest, opts);
|
|
1470
1470
|
} else if (opts.errorOnExist) {
|
|
1471
1471
|
throw new Error(`'${dest}' already exists`);
|
|
1472
1472
|
}
|
|
1473
1473
|
}
|
|
1474
1474
|
function copyFile(srcStat, src, dest, opts) {
|
|
1475
|
-
|
|
1475
|
+
fs16.copyFileSync(src, dest);
|
|
1476
1476
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
1477
1477
|
return setDestMode(dest, srcStat.mode);
|
|
1478
1478
|
}
|
|
@@ -1487,10 +1487,10 @@ var require_copy_sync = __commonJS({
|
|
|
1487
1487
|
return setDestMode(dest, srcMode | 128);
|
|
1488
1488
|
}
|
|
1489
1489
|
function setDestMode(dest, srcMode) {
|
|
1490
|
-
return
|
|
1490
|
+
return fs16.chmodSync(dest, srcMode);
|
|
1491
1491
|
}
|
|
1492
1492
|
function setDestTimestamps(src, dest) {
|
|
1493
|
-
const updatedSrcStat =
|
|
1493
|
+
const updatedSrcStat = fs16.statSync(src);
|
|
1494
1494
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1495
1495
|
}
|
|
1496
1496
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -1498,12 +1498,12 @@ var require_copy_sync = __commonJS({
|
|
|
1498
1498
|
return copyDir(src, dest, opts);
|
|
1499
1499
|
}
|
|
1500
1500
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
1501
|
-
|
|
1501
|
+
fs16.mkdirSync(dest);
|
|
1502
1502
|
copyDir(src, dest, opts);
|
|
1503
1503
|
return setDestMode(dest, srcMode);
|
|
1504
1504
|
}
|
|
1505
1505
|
function copyDir(src, dest, opts) {
|
|
1506
|
-
const dir =
|
|
1506
|
+
const dir = fs16.opendirSync(src);
|
|
1507
1507
|
try {
|
|
1508
1508
|
let dirent;
|
|
1509
1509
|
while ((dirent = dir.readSync()) !== null) {
|
|
@@ -1514,29 +1514,29 @@ var require_copy_sync = __commonJS({
|
|
|
1514
1514
|
}
|
|
1515
1515
|
}
|
|
1516
1516
|
function copyDirItem(item, src, dest, opts) {
|
|
1517
|
-
const srcItem =
|
|
1518
|
-
const destItem =
|
|
1517
|
+
const srcItem = path21.join(src, item);
|
|
1518
|
+
const destItem = path21.join(dest, item);
|
|
1519
1519
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
1520
1520
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
1521
1521
|
return getStats(destStat, srcItem, destItem, opts);
|
|
1522
1522
|
}
|
|
1523
1523
|
function onLink(destStat, src, dest, opts) {
|
|
1524
|
-
let resolvedSrc =
|
|
1524
|
+
let resolvedSrc = fs16.readlinkSync(src);
|
|
1525
1525
|
if (opts.dereference) {
|
|
1526
|
-
resolvedSrc =
|
|
1526
|
+
resolvedSrc = path21.resolve(process.cwd(), resolvedSrc);
|
|
1527
1527
|
}
|
|
1528
1528
|
if (!destStat) {
|
|
1529
|
-
return
|
|
1529
|
+
return fs16.symlinkSync(resolvedSrc, dest);
|
|
1530
1530
|
} else {
|
|
1531
1531
|
let resolvedDest;
|
|
1532
1532
|
try {
|
|
1533
|
-
resolvedDest =
|
|
1533
|
+
resolvedDest = fs16.readlinkSync(dest);
|
|
1534
1534
|
} catch (err) {
|
|
1535
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
1535
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs16.symlinkSync(resolvedSrc, dest);
|
|
1536
1536
|
throw err;
|
|
1537
1537
|
}
|
|
1538
1538
|
if (opts.dereference) {
|
|
1539
|
-
resolvedDest =
|
|
1539
|
+
resolvedDest = path21.resolve(process.cwd(), resolvedDest);
|
|
1540
1540
|
}
|
|
1541
1541
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1542
1542
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -1548,8 +1548,8 @@ var require_copy_sync = __commonJS({
|
|
|
1548
1548
|
}
|
|
1549
1549
|
}
|
|
1550
1550
|
function copyLink(resolvedSrc, dest) {
|
|
1551
|
-
|
|
1552
|
-
return
|
|
1551
|
+
fs16.unlinkSync(dest);
|
|
1552
|
+
return fs16.symlinkSync(resolvedSrc, dest);
|
|
1553
1553
|
}
|
|
1554
1554
|
module.exports = copySync;
|
|
1555
1555
|
}
|
|
@@ -1569,13 +1569,13 @@ var require_copy2 = __commonJS({
|
|
|
1569
1569
|
// ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/remove/index.js
|
|
1570
1570
|
var require_remove = __commonJS({
|
|
1571
1571
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/remove/index.js"(exports$1, module) {
|
|
1572
|
-
var
|
|
1572
|
+
var fs16 = require_graceful_fs();
|
|
1573
1573
|
var u3 = require_universalify().fromCallback;
|
|
1574
|
-
function remove(
|
|
1575
|
-
|
|
1574
|
+
function remove(path21, callback) {
|
|
1575
|
+
fs16.rm(path21, { recursive: true, force: true }, callback);
|
|
1576
1576
|
}
|
|
1577
|
-
function removeSync(
|
|
1578
|
-
|
|
1577
|
+
function removeSync(path21) {
|
|
1578
|
+
fs16.rmSync(path21, { recursive: true, force: true });
|
|
1579
1579
|
}
|
|
1580
1580
|
module.exports = {
|
|
1581
1581
|
remove: u3(remove),
|
|
@@ -1588,28 +1588,28 @@ var require_remove = __commonJS({
|
|
|
1588
1588
|
var require_empty = __commonJS({
|
|
1589
1589
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/empty/index.js"(exports$1, module) {
|
|
1590
1590
|
var u3 = require_universalify().fromPromise;
|
|
1591
|
-
var
|
|
1592
|
-
var
|
|
1591
|
+
var fs16 = require_fs();
|
|
1592
|
+
var path21 = __require("path");
|
|
1593
1593
|
var mkdir = require_mkdirs();
|
|
1594
1594
|
var remove = require_remove();
|
|
1595
1595
|
var emptyDir = u3(async function emptyDir2(dir) {
|
|
1596
1596
|
let items;
|
|
1597
1597
|
try {
|
|
1598
|
-
items = await
|
|
1598
|
+
items = await fs16.readdir(dir);
|
|
1599
1599
|
} catch {
|
|
1600
1600
|
return mkdir.mkdirs(dir);
|
|
1601
1601
|
}
|
|
1602
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
1602
|
+
return Promise.all(items.map((item) => remove.remove(path21.join(dir, item))));
|
|
1603
1603
|
});
|
|
1604
1604
|
function emptyDirSync(dir) {
|
|
1605
1605
|
let items;
|
|
1606
1606
|
try {
|
|
1607
|
-
items =
|
|
1607
|
+
items = fs16.readdirSync(dir);
|
|
1608
1608
|
} catch {
|
|
1609
1609
|
return mkdir.mkdirsSync(dir);
|
|
1610
1610
|
}
|
|
1611
1611
|
items.forEach((item) => {
|
|
1612
|
-
item =
|
|
1612
|
+
item = path21.join(dir, item);
|
|
1613
1613
|
remove.removeSync(item);
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
@@ -1626,52 +1626,52 @@ var require_empty = __commonJS({
|
|
|
1626
1626
|
var require_file = __commonJS({
|
|
1627
1627
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/file.js"(exports$1, module) {
|
|
1628
1628
|
var u3 = require_universalify().fromPromise;
|
|
1629
|
-
var
|
|
1630
|
-
var
|
|
1629
|
+
var path21 = __require("path");
|
|
1630
|
+
var fs16 = require_fs();
|
|
1631
1631
|
var mkdir = require_mkdirs();
|
|
1632
1632
|
async function createFile(file) {
|
|
1633
1633
|
let stats;
|
|
1634
1634
|
try {
|
|
1635
|
-
stats = await
|
|
1635
|
+
stats = await fs16.stat(file);
|
|
1636
1636
|
} catch {
|
|
1637
1637
|
}
|
|
1638
1638
|
if (stats && stats.isFile()) return;
|
|
1639
|
-
const dir =
|
|
1639
|
+
const dir = path21.dirname(file);
|
|
1640
1640
|
let dirStats = null;
|
|
1641
1641
|
try {
|
|
1642
|
-
dirStats = await
|
|
1642
|
+
dirStats = await fs16.stat(dir);
|
|
1643
1643
|
} catch (err) {
|
|
1644
1644
|
if (err.code === "ENOENT") {
|
|
1645
1645
|
await mkdir.mkdirs(dir);
|
|
1646
|
-
await
|
|
1646
|
+
await fs16.writeFile(file, "");
|
|
1647
1647
|
return;
|
|
1648
1648
|
} else {
|
|
1649
1649
|
throw err;
|
|
1650
1650
|
}
|
|
1651
1651
|
}
|
|
1652
1652
|
if (dirStats.isDirectory()) {
|
|
1653
|
-
await
|
|
1653
|
+
await fs16.writeFile(file, "");
|
|
1654
1654
|
} else {
|
|
1655
|
-
await
|
|
1655
|
+
await fs16.readdir(dir);
|
|
1656
1656
|
}
|
|
1657
1657
|
}
|
|
1658
1658
|
function createFileSync(file) {
|
|
1659
1659
|
let stats;
|
|
1660
1660
|
try {
|
|
1661
|
-
stats =
|
|
1661
|
+
stats = fs16.statSync(file);
|
|
1662
1662
|
} catch {
|
|
1663
1663
|
}
|
|
1664
1664
|
if (stats && stats.isFile()) return;
|
|
1665
|
-
const dir =
|
|
1665
|
+
const dir = path21.dirname(file);
|
|
1666
1666
|
try {
|
|
1667
|
-
if (!
|
|
1668
|
-
|
|
1667
|
+
if (!fs16.statSync(dir).isDirectory()) {
|
|
1668
|
+
fs16.readdirSync(dir);
|
|
1669
1669
|
}
|
|
1670
1670
|
} catch (err) {
|
|
1671
1671
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
1672
1672
|
else throw err;
|
|
1673
1673
|
}
|
|
1674
|
-
|
|
1674
|
+
fs16.writeFileSync(file, "");
|
|
1675
1675
|
}
|
|
1676
1676
|
module.exports = {
|
|
1677
1677
|
createFile: u3(createFile),
|
|
@@ -1684,50 +1684,50 @@ var require_file = __commonJS({
|
|
|
1684
1684
|
var require_link = __commonJS({
|
|
1685
1685
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/link.js"(exports$1, module) {
|
|
1686
1686
|
var u3 = require_universalify().fromPromise;
|
|
1687
|
-
var
|
|
1688
|
-
var
|
|
1687
|
+
var path21 = __require("path");
|
|
1688
|
+
var fs16 = require_fs();
|
|
1689
1689
|
var mkdir = require_mkdirs();
|
|
1690
1690
|
var { pathExists } = require_path_exists();
|
|
1691
1691
|
var { areIdentical } = require_stat();
|
|
1692
1692
|
async function createLink(srcpath, dstpath) {
|
|
1693
1693
|
let dstStat;
|
|
1694
1694
|
try {
|
|
1695
|
-
dstStat = await
|
|
1695
|
+
dstStat = await fs16.lstat(dstpath);
|
|
1696
1696
|
} catch {
|
|
1697
1697
|
}
|
|
1698
1698
|
let srcStat;
|
|
1699
1699
|
try {
|
|
1700
|
-
srcStat = await
|
|
1700
|
+
srcStat = await fs16.lstat(srcpath);
|
|
1701
1701
|
} catch (err) {
|
|
1702
1702
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
1703
1703
|
throw err;
|
|
1704
1704
|
}
|
|
1705
1705
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1706
|
-
const dir =
|
|
1706
|
+
const dir = path21.dirname(dstpath);
|
|
1707
1707
|
const dirExists = await pathExists(dir);
|
|
1708
1708
|
if (!dirExists) {
|
|
1709
1709
|
await mkdir.mkdirs(dir);
|
|
1710
1710
|
}
|
|
1711
|
-
await
|
|
1711
|
+
await fs16.link(srcpath, dstpath);
|
|
1712
1712
|
}
|
|
1713
1713
|
function createLinkSync(srcpath, dstpath) {
|
|
1714
1714
|
let dstStat;
|
|
1715
1715
|
try {
|
|
1716
|
-
dstStat =
|
|
1716
|
+
dstStat = fs16.lstatSync(dstpath);
|
|
1717
1717
|
} catch {
|
|
1718
1718
|
}
|
|
1719
1719
|
try {
|
|
1720
|
-
const srcStat =
|
|
1720
|
+
const srcStat = fs16.lstatSync(srcpath);
|
|
1721
1721
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1722
1722
|
} catch (err) {
|
|
1723
1723
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
1724
1724
|
throw err;
|
|
1725
1725
|
}
|
|
1726
|
-
const dir =
|
|
1727
|
-
const dirExists =
|
|
1728
|
-
if (dirExists) return
|
|
1726
|
+
const dir = path21.dirname(dstpath);
|
|
1727
|
+
const dirExists = fs16.existsSync(dir);
|
|
1728
|
+
if (dirExists) return fs16.linkSync(srcpath, dstpath);
|
|
1729
1729
|
mkdir.mkdirsSync(dir);
|
|
1730
|
-
return
|
|
1730
|
+
return fs16.linkSync(srcpath, dstpath);
|
|
1731
1731
|
}
|
|
1732
1732
|
module.exports = {
|
|
1733
1733
|
createLink: u3(createLink),
|
|
@@ -1739,14 +1739,14 @@ var require_link = __commonJS({
|
|
|
1739
1739
|
// ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-paths.js
|
|
1740
1740
|
var require_symlink_paths = __commonJS({
|
|
1741
1741
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports$1, module) {
|
|
1742
|
-
var
|
|
1743
|
-
var
|
|
1742
|
+
var path21 = __require("path");
|
|
1743
|
+
var fs16 = require_fs();
|
|
1744
1744
|
var { pathExists } = require_path_exists();
|
|
1745
1745
|
var u3 = require_universalify().fromPromise;
|
|
1746
1746
|
async function symlinkPaths(srcpath, dstpath) {
|
|
1747
|
-
if (
|
|
1747
|
+
if (path21.isAbsolute(srcpath)) {
|
|
1748
1748
|
try {
|
|
1749
|
-
await
|
|
1749
|
+
await fs16.lstat(srcpath);
|
|
1750
1750
|
} catch (err) {
|
|
1751
1751
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1752
1752
|
throw err;
|
|
@@ -1756,8 +1756,8 @@ var require_symlink_paths = __commonJS({
|
|
|
1756
1756
|
toDst: srcpath
|
|
1757
1757
|
};
|
|
1758
1758
|
}
|
|
1759
|
-
const dstdir =
|
|
1760
|
-
const relativeToDst =
|
|
1759
|
+
const dstdir = path21.dirname(dstpath);
|
|
1760
|
+
const relativeToDst = path21.join(dstdir, srcpath);
|
|
1761
1761
|
const exists = await pathExists(relativeToDst);
|
|
1762
1762
|
if (exists) {
|
|
1763
1763
|
return {
|
|
@@ -1766,39 +1766,39 @@ var require_symlink_paths = __commonJS({
|
|
|
1766
1766
|
};
|
|
1767
1767
|
}
|
|
1768
1768
|
try {
|
|
1769
|
-
await
|
|
1769
|
+
await fs16.lstat(srcpath);
|
|
1770
1770
|
} catch (err) {
|
|
1771
1771
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1772
1772
|
throw err;
|
|
1773
1773
|
}
|
|
1774
1774
|
return {
|
|
1775
1775
|
toCwd: srcpath,
|
|
1776
|
-
toDst:
|
|
1776
|
+
toDst: path21.relative(dstdir, srcpath)
|
|
1777
1777
|
};
|
|
1778
1778
|
}
|
|
1779
1779
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
1780
|
-
if (
|
|
1781
|
-
const exists2 =
|
|
1780
|
+
if (path21.isAbsolute(srcpath)) {
|
|
1781
|
+
const exists2 = fs16.existsSync(srcpath);
|
|
1782
1782
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
1783
1783
|
return {
|
|
1784
1784
|
toCwd: srcpath,
|
|
1785
1785
|
toDst: srcpath
|
|
1786
1786
|
};
|
|
1787
1787
|
}
|
|
1788
|
-
const dstdir =
|
|
1789
|
-
const relativeToDst =
|
|
1790
|
-
const exists =
|
|
1788
|
+
const dstdir = path21.dirname(dstpath);
|
|
1789
|
+
const relativeToDst = path21.join(dstdir, srcpath);
|
|
1790
|
+
const exists = fs16.existsSync(relativeToDst);
|
|
1791
1791
|
if (exists) {
|
|
1792
1792
|
return {
|
|
1793
1793
|
toCwd: relativeToDst,
|
|
1794
1794
|
toDst: srcpath
|
|
1795
1795
|
};
|
|
1796
1796
|
}
|
|
1797
|
-
const srcExists =
|
|
1797
|
+
const srcExists = fs16.existsSync(srcpath);
|
|
1798
1798
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
1799
1799
|
return {
|
|
1800
1800
|
toCwd: srcpath,
|
|
1801
|
-
toDst:
|
|
1801
|
+
toDst: path21.relative(dstdir, srcpath)
|
|
1802
1802
|
};
|
|
1803
1803
|
}
|
|
1804
1804
|
module.exports = {
|
|
@@ -1811,13 +1811,13 @@ var require_symlink_paths = __commonJS({
|
|
|
1811
1811
|
// ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-type.js
|
|
1812
1812
|
var require_symlink_type = __commonJS({
|
|
1813
1813
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports$1, module) {
|
|
1814
|
-
var
|
|
1814
|
+
var fs16 = require_fs();
|
|
1815
1815
|
var u3 = require_universalify().fromPromise;
|
|
1816
1816
|
async function symlinkType(srcpath, type) {
|
|
1817
1817
|
if (type) return type;
|
|
1818
1818
|
let stats;
|
|
1819
1819
|
try {
|
|
1820
|
-
stats = await
|
|
1820
|
+
stats = await fs16.lstat(srcpath);
|
|
1821
1821
|
} catch {
|
|
1822
1822
|
return "file";
|
|
1823
1823
|
}
|
|
@@ -1827,7 +1827,7 @@ var require_symlink_type = __commonJS({
|
|
|
1827
1827
|
if (type) return type;
|
|
1828
1828
|
let stats;
|
|
1829
1829
|
try {
|
|
1830
|
-
stats =
|
|
1830
|
+
stats = fs16.lstatSync(srcpath);
|
|
1831
1831
|
} catch {
|
|
1832
1832
|
return "file";
|
|
1833
1833
|
}
|
|
@@ -1844,8 +1844,8 @@ var require_symlink_type = __commonJS({
|
|
|
1844
1844
|
var require_symlink = __commonJS({
|
|
1845
1845
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/ensure/symlink.js"(exports$1, module) {
|
|
1846
1846
|
var u3 = require_universalify().fromPromise;
|
|
1847
|
-
var
|
|
1848
|
-
var
|
|
1847
|
+
var path21 = __require("path");
|
|
1848
|
+
var fs16 = require_fs();
|
|
1849
1849
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
1850
1850
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
1851
1851
|
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
@@ -1854,44 +1854,44 @@ var require_symlink = __commonJS({
|
|
|
1854
1854
|
async function createSymlink(srcpath, dstpath, type) {
|
|
1855
1855
|
let stats;
|
|
1856
1856
|
try {
|
|
1857
|
-
stats = await
|
|
1857
|
+
stats = await fs16.lstat(dstpath);
|
|
1858
1858
|
} catch {
|
|
1859
1859
|
}
|
|
1860
1860
|
if (stats && stats.isSymbolicLink()) {
|
|
1861
1861
|
const [srcStat, dstStat] = await Promise.all([
|
|
1862
|
-
|
|
1863
|
-
|
|
1862
|
+
fs16.stat(srcpath),
|
|
1863
|
+
fs16.stat(dstpath)
|
|
1864
1864
|
]);
|
|
1865
1865
|
if (areIdentical(srcStat, dstStat)) return;
|
|
1866
1866
|
}
|
|
1867
1867
|
const relative = await symlinkPaths(srcpath, dstpath);
|
|
1868
1868
|
srcpath = relative.toDst;
|
|
1869
1869
|
const toType = await symlinkType(relative.toCwd, type);
|
|
1870
|
-
const dir =
|
|
1870
|
+
const dir = path21.dirname(dstpath);
|
|
1871
1871
|
if (!await pathExists(dir)) {
|
|
1872
1872
|
await mkdirs(dir);
|
|
1873
1873
|
}
|
|
1874
|
-
return
|
|
1874
|
+
return fs16.symlink(srcpath, dstpath, toType);
|
|
1875
1875
|
}
|
|
1876
1876
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
1877
1877
|
let stats;
|
|
1878
1878
|
try {
|
|
1879
|
-
stats =
|
|
1879
|
+
stats = fs16.lstatSync(dstpath);
|
|
1880
1880
|
} catch {
|
|
1881
1881
|
}
|
|
1882
1882
|
if (stats && stats.isSymbolicLink()) {
|
|
1883
|
-
const srcStat =
|
|
1884
|
-
const dstStat =
|
|
1883
|
+
const srcStat = fs16.statSync(srcpath);
|
|
1884
|
+
const dstStat = fs16.statSync(dstpath);
|
|
1885
1885
|
if (areIdentical(srcStat, dstStat)) return;
|
|
1886
1886
|
}
|
|
1887
1887
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
1888
1888
|
srcpath = relative.toDst;
|
|
1889
1889
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
1890
|
-
const dir =
|
|
1891
|
-
const exists =
|
|
1892
|
-
if (exists) return
|
|
1890
|
+
const dir = path21.dirname(dstpath);
|
|
1891
|
+
const exists = fs16.existsSync(dir);
|
|
1892
|
+
if (exists) return fs16.symlinkSync(srcpath, dstpath, type);
|
|
1893
1893
|
mkdirsSync(dir);
|
|
1894
|
-
return
|
|
1894
|
+
return fs16.symlinkSync(srcpath, dstpath, type);
|
|
1895
1895
|
}
|
|
1896
1896
|
module.exports = {
|
|
1897
1897
|
createSymlink: u3(createSymlink),
|
|
@@ -1957,9 +1957,9 @@ var require_jsonfile = __commonJS({
|
|
|
1957
1957
|
if (typeof options === "string") {
|
|
1958
1958
|
options = { encoding: options };
|
|
1959
1959
|
}
|
|
1960
|
-
const
|
|
1960
|
+
const fs16 = options.fs || _fs;
|
|
1961
1961
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
1962
|
-
let data = await universalify.fromCallback(
|
|
1962
|
+
let data = await universalify.fromCallback(fs16.readFile)(file, options);
|
|
1963
1963
|
data = stripBom(data);
|
|
1964
1964
|
let obj;
|
|
1965
1965
|
try {
|
|
@@ -1979,10 +1979,10 @@ var require_jsonfile = __commonJS({
|
|
|
1979
1979
|
if (typeof options === "string") {
|
|
1980
1980
|
options = { encoding: options };
|
|
1981
1981
|
}
|
|
1982
|
-
const
|
|
1982
|
+
const fs16 = options.fs || _fs;
|
|
1983
1983
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
1984
1984
|
try {
|
|
1985
|
-
let content =
|
|
1985
|
+
let content = fs16.readFileSync(file, options);
|
|
1986
1986
|
content = stripBom(content);
|
|
1987
1987
|
return JSON.parse(content, options.reviver);
|
|
1988
1988
|
} catch (err) {
|
|
@@ -1995,15 +1995,15 @@ var require_jsonfile = __commonJS({
|
|
|
1995
1995
|
}
|
|
1996
1996
|
}
|
|
1997
1997
|
async function _writeFile(file, obj, options = {}) {
|
|
1998
|
-
const
|
|
1998
|
+
const fs16 = options.fs || _fs;
|
|
1999
1999
|
const str = stringify(obj, options);
|
|
2000
|
-
await universalify.fromCallback(
|
|
2000
|
+
await universalify.fromCallback(fs16.writeFile)(file, str, options);
|
|
2001
2001
|
}
|
|
2002
2002
|
var writeFile = universalify.fromPromise(_writeFile);
|
|
2003
2003
|
function writeFileSync3(file, obj, options = {}) {
|
|
2004
|
-
const
|
|
2004
|
+
const fs16 = options.fs || _fs;
|
|
2005
2005
|
const str = stringify(obj, options);
|
|
2006
|
-
return
|
|
2006
|
+
return fs16.writeFileSync(file, str, options);
|
|
2007
2007
|
}
|
|
2008
2008
|
module.exports = {
|
|
2009
2009
|
readFile,
|
|
@@ -2032,23 +2032,23 @@ var require_jsonfile2 = __commonJS({
|
|
|
2032
2032
|
var require_output_file = __commonJS({
|
|
2033
2033
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/output-file/index.js"(exports$1, module) {
|
|
2034
2034
|
var u3 = require_universalify().fromPromise;
|
|
2035
|
-
var
|
|
2036
|
-
var
|
|
2035
|
+
var fs16 = require_fs();
|
|
2036
|
+
var path21 = __require("path");
|
|
2037
2037
|
var mkdir = require_mkdirs();
|
|
2038
2038
|
var pathExists = require_path_exists().pathExists;
|
|
2039
2039
|
async function outputFile(file, data, encoding = "utf-8") {
|
|
2040
|
-
const dir =
|
|
2040
|
+
const dir = path21.dirname(file);
|
|
2041
2041
|
if (!await pathExists(dir)) {
|
|
2042
2042
|
await mkdir.mkdirs(dir);
|
|
2043
2043
|
}
|
|
2044
|
-
return
|
|
2044
|
+
return fs16.writeFile(file, data, encoding);
|
|
2045
2045
|
}
|
|
2046
2046
|
function outputFileSync(file, ...args) {
|
|
2047
|
-
const dir =
|
|
2048
|
-
if (!
|
|
2047
|
+
const dir = path21.dirname(file);
|
|
2048
|
+
if (!fs16.existsSync(dir)) {
|
|
2049
2049
|
mkdir.mkdirsSync(dir);
|
|
2050
2050
|
}
|
|
2051
|
-
|
|
2051
|
+
fs16.writeFileSync(file, ...args);
|
|
2052
2052
|
}
|
|
2053
2053
|
module.exports = {
|
|
2054
2054
|
outputFile: u3(outputFile),
|
|
@@ -2103,8 +2103,8 @@ var require_json = __commonJS({
|
|
|
2103
2103
|
// ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move.js
|
|
2104
2104
|
var require_move = __commonJS({
|
|
2105
2105
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move.js"(exports$1, module) {
|
|
2106
|
-
var
|
|
2107
|
-
var
|
|
2106
|
+
var fs16 = require_fs();
|
|
2107
|
+
var path21 = __require("path");
|
|
2108
2108
|
var { copy } = require_copy2();
|
|
2109
2109
|
var { remove } = require_remove();
|
|
2110
2110
|
var { mkdirp } = require_mkdirs();
|
|
@@ -2114,8 +2114,8 @@ var require_move = __commonJS({
|
|
|
2114
2114
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2115
2115
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
2116
2116
|
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
2117
|
-
const destParent =
|
|
2118
|
-
const parsedParentPath =
|
|
2117
|
+
const destParent = path21.dirname(dest);
|
|
2118
|
+
const parsedParentPath = path21.parse(destParent);
|
|
2119
2119
|
if (parsedParentPath.root !== destParent) {
|
|
2120
2120
|
await mkdirp(destParent);
|
|
2121
2121
|
}
|
|
@@ -2130,7 +2130,7 @@ var require_move = __commonJS({
|
|
|
2130
2130
|
}
|
|
2131
2131
|
}
|
|
2132
2132
|
try {
|
|
2133
|
-
await
|
|
2133
|
+
await fs16.rename(src, dest);
|
|
2134
2134
|
} catch (err) {
|
|
2135
2135
|
if (err.code !== "EXDEV") {
|
|
2136
2136
|
throw err;
|
|
@@ -2154,8 +2154,8 @@ var require_move = __commonJS({
|
|
|
2154
2154
|
// ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move-sync.js
|
|
2155
2155
|
var require_move_sync = __commonJS({
|
|
2156
2156
|
"../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/move/move-sync.js"(exports$1, module) {
|
|
2157
|
-
var
|
|
2158
|
-
var
|
|
2157
|
+
var fs16 = require_graceful_fs();
|
|
2158
|
+
var path21 = __require("path");
|
|
2159
2159
|
var copySync = require_copy2().copySync;
|
|
2160
2160
|
var removeSync = require_remove().removeSync;
|
|
2161
2161
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -2165,12 +2165,12 @@ var require_move_sync = __commonJS({
|
|
|
2165
2165
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2166
2166
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
2167
2167
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
2168
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
2168
|
+
if (!isParentRoot(dest)) mkdirpSync(path21.dirname(dest));
|
|
2169
2169
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
2170
2170
|
}
|
|
2171
2171
|
function isParentRoot(dest) {
|
|
2172
|
-
const parent =
|
|
2173
|
-
const parsedPath =
|
|
2172
|
+
const parent = path21.dirname(dest);
|
|
2173
|
+
const parsedPath = path21.parse(parent);
|
|
2174
2174
|
return parsedPath.root === parent;
|
|
2175
2175
|
}
|
|
2176
2176
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -2179,12 +2179,12 @@ var require_move_sync = __commonJS({
|
|
|
2179
2179
|
removeSync(dest);
|
|
2180
2180
|
return rename(src, dest, overwrite);
|
|
2181
2181
|
}
|
|
2182
|
-
if (
|
|
2182
|
+
if (fs16.existsSync(dest)) throw new Error("dest already exists.");
|
|
2183
2183
|
return rename(src, dest, overwrite);
|
|
2184
2184
|
}
|
|
2185
2185
|
function rename(src, dest, overwrite) {
|
|
2186
2186
|
try {
|
|
2187
|
-
|
|
2187
|
+
fs16.renameSync(src, dest);
|
|
2188
2188
|
} catch (err) {
|
|
2189
2189
|
if (err.code !== "EXDEV") throw err;
|
|
2190
2190
|
return moveAcrossDevice(src, dest, overwrite);
|
|
@@ -2311,8 +2311,8 @@ var require_windows = __commonJS({
|
|
|
2311
2311
|
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports$1, module) {
|
|
2312
2312
|
module.exports = isexe;
|
|
2313
2313
|
isexe.sync = sync;
|
|
2314
|
-
var
|
|
2315
|
-
function checkPathExt(
|
|
2314
|
+
var fs16 = __require("fs");
|
|
2315
|
+
function checkPathExt(path21, options) {
|
|
2316
2316
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
2317
2317
|
if (!pathext) {
|
|
2318
2318
|
return true;
|
|
@@ -2323,25 +2323,25 @@ var require_windows = __commonJS({
|
|
|
2323
2323
|
}
|
|
2324
2324
|
for (var i2 = 0; i2 < pathext.length; i2++) {
|
|
2325
2325
|
var p2 = pathext[i2].toLowerCase();
|
|
2326
|
-
if (p2 &&
|
|
2326
|
+
if (p2 && path21.substr(-p2.length).toLowerCase() === p2) {
|
|
2327
2327
|
return true;
|
|
2328
2328
|
}
|
|
2329
2329
|
}
|
|
2330
2330
|
return false;
|
|
2331
2331
|
}
|
|
2332
|
-
function checkStat(stat,
|
|
2332
|
+
function checkStat(stat, path21, options) {
|
|
2333
2333
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
2334
2334
|
return false;
|
|
2335
2335
|
}
|
|
2336
|
-
return checkPathExt(
|
|
2336
|
+
return checkPathExt(path21, options);
|
|
2337
2337
|
}
|
|
2338
|
-
function isexe(
|
|
2339
|
-
|
|
2340
|
-
cb(er2, er2 ? false : checkStat(stat,
|
|
2338
|
+
function isexe(path21, options, cb) {
|
|
2339
|
+
fs16.stat(path21, function(er2, stat) {
|
|
2340
|
+
cb(er2, er2 ? false : checkStat(stat, path21, options));
|
|
2341
2341
|
});
|
|
2342
2342
|
}
|
|
2343
|
-
function sync(
|
|
2344
|
-
return checkStat(
|
|
2343
|
+
function sync(path21, options) {
|
|
2344
|
+
return checkStat(fs16.statSync(path21), path21, options);
|
|
2345
2345
|
}
|
|
2346
2346
|
}
|
|
2347
2347
|
});
|
|
@@ -2351,14 +2351,14 @@ var require_mode = __commonJS({
|
|
|
2351
2351
|
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports$1, module) {
|
|
2352
2352
|
module.exports = isexe;
|
|
2353
2353
|
isexe.sync = sync;
|
|
2354
|
-
var
|
|
2355
|
-
function isexe(
|
|
2356
|
-
|
|
2354
|
+
var fs16 = __require("fs");
|
|
2355
|
+
function isexe(path21, options, cb) {
|
|
2356
|
+
fs16.stat(path21, function(er2, stat) {
|
|
2357
2357
|
cb(er2, er2 ? false : checkStat(stat, options));
|
|
2358
2358
|
});
|
|
2359
2359
|
}
|
|
2360
|
-
function sync(
|
|
2361
|
-
return checkStat(
|
|
2360
|
+
function sync(path21, options) {
|
|
2361
|
+
return checkStat(fs16.statSync(path21), options);
|
|
2362
2362
|
}
|
|
2363
2363
|
function checkStat(stat, options) {
|
|
2364
2364
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -2391,7 +2391,7 @@ var require_isexe = __commonJS({
|
|
|
2391
2391
|
}
|
|
2392
2392
|
module.exports = isexe;
|
|
2393
2393
|
isexe.sync = sync;
|
|
2394
|
-
function isexe(
|
|
2394
|
+
function isexe(path21, options, cb) {
|
|
2395
2395
|
if (typeof options === "function") {
|
|
2396
2396
|
cb = options;
|
|
2397
2397
|
options = {};
|
|
@@ -2401,7 +2401,7 @@ var require_isexe = __commonJS({
|
|
|
2401
2401
|
throw new TypeError("callback not provided");
|
|
2402
2402
|
}
|
|
2403
2403
|
return new Promise(function(resolve, reject) {
|
|
2404
|
-
isexe(
|
|
2404
|
+
isexe(path21, options || {}, function(er2, is2) {
|
|
2405
2405
|
if (er2) {
|
|
2406
2406
|
reject(er2);
|
|
2407
2407
|
} else {
|
|
@@ -2410,7 +2410,7 @@ var require_isexe = __commonJS({
|
|
|
2410
2410
|
});
|
|
2411
2411
|
});
|
|
2412
2412
|
}
|
|
2413
|
-
core(
|
|
2413
|
+
core(path21, options || {}, function(er2, is2) {
|
|
2414
2414
|
if (er2) {
|
|
2415
2415
|
if (er2.code === "EACCES" || options && options.ignoreErrors) {
|
|
2416
2416
|
er2 = null;
|
|
@@ -2420,9 +2420,9 @@ var require_isexe = __commonJS({
|
|
|
2420
2420
|
cb(er2, is2);
|
|
2421
2421
|
});
|
|
2422
2422
|
}
|
|
2423
|
-
function sync(
|
|
2423
|
+
function sync(path21, options) {
|
|
2424
2424
|
try {
|
|
2425
|
-
return core.sync(
|
|
2425
|
+
return core.sync(path21, options || {});
|
|
2426
2426
|
} catch (er2) {
|
|
2427
2427
|
if (options && options.ignoreErrors || er2.code === "EACCES") {
|
|
2428
2428
|
return false;
|
|
@@ -2438,7 +2438,7 @@ var require_isexe = __commonJS({
|
|
|
2438
2438
|
var require_which = __commonJS({
|
|
2439
2439
|
"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports$1, module) {
|
|
2440
2440
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
2441
|
-
var
|
|
2441
|
+
var path21 = __require("path");
|
|
2442
2442
|
var COLON = isWindows ? ";" : ":";
|
|
2443
2443
|
var isexe = require_isexe();
|
|
2444
2444
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -2476,7 +2476,7 @@ var require_which = __commonJS({
|
|
|
2476
2476
|
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
2477
2477
|
const ppRaw = pathEnv[i2];
|
|
2478
2478
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2479
|
-
const pCmd =
|
|
2479
|
+
const pCmd = path21.join(pathPart, cmd);
|
|
2480
2480
|
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2481
2481
|
resolve(subStep(p2, i2, 0));
|
|
2482
2482
|
});
|
|
@@ -2503,7 +2503,7 @@ var require_which = __commonJS({
|
|
|
2503
2503
|
for (let i2 = 0; i2 < pathEnv.length; i2++) {
|
|
2504
2504
|
const ppRaw = pathEnv[i2];
|
|
2505
2505
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2506
|
-
const pCmd =
|
|
2506
|
+
const pCmd = path21.join(pathPart, cmd);
|
|
2507
2507
|
const p2 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2508
2508
|
for (let j3 = 0; j3 < pathExt.length; j3++) {
|
|
2509
2509
|
const cur = p2 + pathExt[j3];
|
|
@@ -2549,7 +2549,7 @@ var require_path_key = __commonJS({
|
|
|
2549
2549
|
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
2550
2550
|
var require_resolveCommand = __commonJS({
|
|
2551
2551
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports$1, module) {
|
|
2552
|
-
var
|
|
2552
|
+
var path21 = __require("path");
|
|
2553
2553
|
var which = require_which();
|
|
2554
2554
|
var getPathKey = require_path_key();
|
|
2555
2555
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -2567,7 +2567,7 @@ var require_resolveCommand = __commonJS({
|
|
|
2567
2567
|
try {
|
|
2568
2568
|
resolved = which.sync(parsed.command, {
|
|
2569
2569
|
path: env2[getPathKey({ env: env2 })],
|
|
2570
|
-
pathExt: withoutPathExt ?
|
|
2570
|
+
pathExt: withoutPathExt ? path21.delimiter : void 0
|
|
2571
2571
|
});
|
|
2572
2572
|
} catch (e) {
|
|
2573
2573
|
} finally {
|
|
@@ -2576,7 +2576,7 @@ var require_resolveCommand = __commonJS({
|
|
|
2576
2576
|
}
|
|
2577
2577
|
}
|
|
2578
2578
|
if (resolved) {
|
|
2579
|
-
resolved =
|
|
2579
|
+
resolved = path21.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
2580
2580
|
}
|
|
2581
2581
|
return resolved;
|
|
2582
2582
|
}
|
|
@@ -2627,8 +2627,8 @@ var require_shebang_command = __commonJS({
|
|
|
2627
2627
|
if (!match) {
|
|
2628
2628
|
return null;
|
|
2629
2629
|
}
|
|
2630
|
-
const [
|
|
2631
|
-
const binary =
|
|
2630
|
+
const [path21, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
2631
|
+
const binary = path21.split("/").pop();
|
|
2632
2632
|
if (binary === "env") {
|
|
2633
2633
|
return argument;
|
|
2634
2634
|
}
|
|
@@ -2640,16 +2640,16 @@ var require_shebang_command = __commonJS({
|
|
|
2640
2640
|
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
|
|
2641
2641
|
var require_readShebang = __commonJS({
|
|
2642
2642
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports$1, module) {
|
|
2643
|
-
var
|
|
2643
|
+
var fs16 = __require("fs");
|
|
2644
2644
|
var shebangCommand = require_shebang_command();
|
|
2645
2645
|
function readShebang(command) {
|
|
2646
2646
|
const size = 150;
|
|
2647
2647
|
const buffer = Buffer.alloc(size);
|
|
2648
2648
|
let fd;
|
|
2649
2649
|
try {
|
|
2650
|
-
fd =
|
|
2651
|
-
|
|
2652
|
-
|
|
2650
|
+
fd = fs16.openSync(command, "r");
|
|
2651
|
+
fs16.readSync(fd, buffer, 0, size, 0);
|
|
2652
|
+
fs16.closeSync(fd);
|
|
2653
2653
|
} catch (e) {
|
|
2654
2654
|
}
|
|
2655
2655
|
return shebangCommand(buffer.toString());
|
|
@@ -2661,7 +2661,7 @@ var require_readShebang = __commonJS({
|
|
|
2661
2661
|
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
|
|
2662
2662
|
var require_parse2 = __commonJS({
|
|
2663
2663
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports$1, module) {
|
|
2664
|
-
var
|
|
2664
|
+
var path21 = __require("path");
|
|
2665
2665
|
var resolveCommand = require_resolveCommand();
|
|
2666
2666
|
var escape2 = require_escape();
|
|
2667
2667
|
var readShebang = require_readShebang();
|
|
@@ -2686,7 +2686,7 @@ var require_parse2 = __commonJS({
|
|
|
2686
2686
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
2687
2687
|
if (parsed.options.forceShell || needsShell) {
|
|
2688
2688
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
2689
|
-
parsed.command =
|
|
2689
|
+
parsed.command = path21.normalize(parsed.command);
|
|
2690
2690
|
parsed.command = escape2.command(parsed.command);
|
|
2691
2691
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
2692
2692
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -10212,7 +10212,7 @@ var require_dist = __commonJS2({
|
|
|
10212
10212
|
}
|
|
10213
10213
|
});
|
|
10214
10214
|
var require_constants = __commonJS2({
|
|
10215
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10215
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/constants.js"(exports$1, module) {
|
|
10216
10216
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
10217
10217
|
var MAX_LENGTH = 256;
|
|
10218
10218
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
@@ -10241,14 +10241,14 @@ var require_constants = __commonJS2({
|
|
|
10241
10241
|
}
|
|
10242
10242
|
});
|
|
10243
10243
|
var require_debug = __commonJS2({
|
|
10244
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10244
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/debug.js"(exports$1, module) {
|
|
10245
10245
|
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
10246
10246
|
};
|
|
10247
10247
|
module.exports = debug;
|
|
10248
10248
|
}
|
|
10249
10249
|
});
|
|
10250
10250
|
var require_re = __commonJS2({
|
|
10251
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10251
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/re.js"(exports$1, module) {
|
|
10252
10252
|
var {
|
|
10253
10253
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
10254
10254
|
MAX_SAFE_BUILD_LENGTH,
|
|
@@ -10333,7 +10333,7 @@ var require_re = __commonJS2({
|
|
|
10333
10333
|
}
|
|
10334
10334
|
});
|
|
10335
10335
|
var require_parse_options = __commonJS2({
|
|
10336
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10336
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/parse-options.js"(exports$1, module) {
|
|
10337
10337
|
var looseOption = Object.freeze({ loose: true });
|
|
10338
10338
|
var emptyOpts = Object.freeze({});
|
|
10339
10339
|
var parseOptions = (options) => {
|
|
@@ -10349,9 +10349,12 @@ var require_parse_options = __commonJS2({
|
|
|
10349
10349
|
}
|
|
10350
10350
|
});
|
|
10351
10351
|
var require_identifiers = __commonJS2({
|
|
10352
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10352
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/identifiers.js"(exports$1, module) {
|
|
10353
10353
|
var numeric = /^[0-9]+$/;
|
|
10354
10354
|
var compareIdentifiers = (a2, b2) => {
|
|
10355
|
+
if (typeof a2 === "number" && typeof b2 === "number") {
|
|
10356
|
+
return a2 === b2 ? 0 : a2 < b2 ? -1 : 1;
|
|
10357
|
+
}
|
|
10355
10358
|
const anum = numeric.test(a2);
|
|
10356
10359
|
const bnum = numeric.test(b2);
|
|
10357
10360
|
if (anum && bnum) {
|
|
@@ -10368,7 +10371,7 @@ var require_identifiers = __commonJS2({
|
|
|
10368
10371
|
}
|
|
10369
10372
|
});
|
|
10370
10373
|
var require_semver = __commonJS2({
|
|
10371
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10374
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/semver.js"(exports$1, module) {
|
|
10372
10375
|
var debug = require_debug();
|
|
10373
10376
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
10374
10377
|
var { safeRe: re3, t: t2 } = require_re();
|
|
@@ -10455,7 +10458,25 @@ var require_semver = __commonJS2({
|
|
|
10455
10458
|
if (!(other instanceof _SemVer)) {
|
|
10456
10459
|
other = new _SemVer(other, this.options);
|
|
10457
10460
|
}
|
|
10458
|
-
|
|
10461
|
+
if (this.major < other.major) {
|
|
10462
|
+
return -1;
|
|
10463
|
+
}
|
|
10464
|
+
if (this.major > other.major) {
|
|
10465
|
+
return 1;
|
|
10466
|
+
}
|
|
10467
|
+
if (this.minor < other.minor) {
|
|
10468
|
+
return -1;
|
|
10469
|
+
}
|
|
10470
|
+
if (this.minor > other.minor) {
|
|
10471
|
+
return 1;
|
|
10472
|
+
}
|
|
10473
|
+
if (this.patch < other.patch) {
|
|
10474
|
+
return -1;
|
|
10475
|
+
}
|
|
10476
|
+
if (this.patch > other.patch) {
|
|
10477
|
+
return 1;
|
|
10478
|
+
}
|
|
10479
|
+
return 0;
|
|
10459
10480
|
}
|
|
10460
10481
|
comparePre(other) {
|
|
10461
10482
|
if (!(other instanceof _SemVer)) {
|
|
@@ -10626,7 +10647,7 @@ var require_semver = __commonJS2({
|
|
|
10626
10647
|
}
|
|
10627
10648
|
});
|
|
10628
10649
|
var require_parse = __commonJS2({
|
|
10629
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10650
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/parse.js"(exports$1, module) {
|
|
10630
10651
|
var SemVer = require_semver();
|
|
10631
10652
|
var parse = (version2, options, throwErrors = false) => {
|
|
10632
10653
|
if (version2 instanceof SemVer) {
|
|
@@ -10645,7 +10666,7 @@ var require_parse = __commonJS2({
|
|
|
10645
10666
|
}
|
|
10646
10667
|
});
|
|
10647
10668
|
var require_valid = __commonJS2({
|
|
10648
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10669
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/valid.js"(exports$1, module) {
|
|
10649
10670
|
var parse = require_parse();
|
|
10650
10671
|
var valid = (version2, options) => {
|
|
10651
10672
|
const v2 = parse(version2, options);
|
|
@@ -10655,7 +10676,7 @@ var require_valid = __commonJS2({
|
|
|
10655
10676
|
}
|
|
10656
10677
|
});
|
|
10657
10678
|
var require_clean = __commonJS2({
|
|
10658
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10679
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/clean.js"(exports$1, module) {
|
|
10659
10680
|
var parse = require_parse();
|
|
10660
10681
|
var clean = (version2, options) => {
|
|
10661
10682
|
const s3 = parse(version2.trim().replace(/^[=v]+/, ""), options);
|
|
@@ -10665,7 +10686,7 @@ var require_clean = __commonJS2({
|
|
|
10665
10686
|
}
|
|
10666
10687
|
});
|
|
10667
10688
|
var require_inc = __commonJS2({
|
|
10668
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10689
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/inc.js"(exports$1, module) {
|
|
10669
10690
|
var SemVer = require_semver();
|
|
10670
10691
|
var inc = (version2, release, options, identifier, identifierBase) => {
|
|
10671
10692
|
if (typeof options === "string") {
|
|
@@ -10686,7 +10707,7 @@ var require_inc = __commonJS2({
|
|
|
10686
10707
|
}
|
|
10687
10708
|
});
|
|
10688
10709
|
var require_diff = __commonJS2({
|
|
10689
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10710
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/diff.js"(exports$1, module) {
|
|
10690
10711
|
var parse = require_parse();
|
|
10691
10712
|
var diff = (version1, version2) => {
|
|
10692
10713
|
const v1 = parse(version1, null, true);
|
|
@@ -10727,28 +10748,28 @@ var require_diff = __commonJS2({
|
|
|
10727
10748
|
}
|
|
10728
10749
|
});
|
|
10729
10750
|
var require_major = __commonJS2({
|
|
10730
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10751
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/major.js"(exports$1, module) {
|
|
10731
10752
|
var SemVer = require_semver();
|
|
10732
10753
|
var major = (a2, loose) => new SemVer(a2, loose).major;
|
|
10733
10754
|
module.exports = major;
|
|
10734
10755
|
}
|
|
10735
10756
|
});
|
|
10736
10757
|
var require_minor = __commonJS2({
|
|
10737
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10758
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/minor.js"(exports$1, module) {
|
|
10738
10759
|
var SemVer = require_semver();
|
|
10739
10760
|
var minor = (a2, loose) => new SemVer(a2, loose).minor;
|
|
10740
10761
|
module.exports = minor;
|
|
10741
10762
|
}
|
|
10742
10763
|
});
|
|
10743
10764
|
var require_patch = __commonJS2({
|
|
10744
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10765
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/patch.js"(exports$1, module) {
|
|
10745
10766
|
var SemVer = require_semver();
|
|
10746
10767
|
var patch = (a2, loose) => new SemVer(a2, loose).patch;
|
|
10747
10768
|
module.exports = patch;
|
|
10748
10769
|
}
|
|
10749
10770
|
});
|
|
10750
10771
|
var require_prerelease = __commonJS2({
|
|
10751
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10772
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/prerelease.js"(exports$1, module) {
|
|
10752
10773
|
var parse = require_parse();
|
|
10753
10774
|
var prerelease = (version2, options) => {
|
|
10754
10775
|
const parsed = parse(version2, options);
|
|
@@ -10758,28 +10779,28 @@ var require_prerelease = __commonJS2({
|
|
|
10758
10779
|
}
|
|
10759
10780
|
});
|
|
10760
10781
|
var require_compare = __commonJS2({
|
|
10761
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10782
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare.js"(exports$1, module) {
|
|
10762
10783
|
var SemVer = require_semver();
|
|
10763
10784
|
var compare = (a2, b2, loose) => new SemVer(a2, loose).compare(new SemVer(b2, loose));
|
|
10764
10785
|
module.exports = compare;
|
|
10765
10786
|
}
|
|
10766
10787
|
});
|
|
10767
10788
|
var require_rcompare = __commonJS2({
|
|
10768
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10789
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rcompare.js"(exports$1, module) {
|
|
10769
10790
|
var compare = require_compare();
|
|
10770
10791
|
var rcompare = (a2, b2, loose) => compare(b2, a2, loose);
|
|
10771
10792
|
module.exports = rcompare;
|
|
10772
10793
|
}
|
|
10773
10794
|
});
|
|
10774
10795
|
var require_compare_loose = __commonJS2({
|
|
10775
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10796
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-loose.js"(exports$1, module) {
|
|
10776
10797
|
var compare = require_compare();
|
|
10777
10798
|
var compareLoose = (a2, b2) => compare(a2, b2, true);
|
|
10778
10799
|
module.exports = compareLoose;
|
|
10779
10800
|
}
|
|
10780
10801
|
});
|
|
10781
10802
|
var require_compare_build = __commonJS2({
|
|
10782
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10803
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-build.js"(exports$1, module) {
|
|
10783
10804
|
var SemVer = require_semver();
|
|
10784
10805
|
var compareBuild = (a2, b2, loose) => {
|
|
10785
10806
|
const versionA = new SemVer(a2, loose);
|
|
@@ -10790,63 +10811,63 @@ var require_compare_build = __commonJS2({
|
|
|
10790
10811
|
}
|
|
10791
10812
|
});
|
|
10792
10813
|
var require_sort = __commonJS2({
|
|
10793
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10814
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/sort.js"(exports$1, module) {
|
|
10794
10815
|
var compareBuild = require_compare_build();
|
|
10795
10816
|
var sort = (list, loose) => list.sort((a2, b2) => compareBuild(a2, b2, loose));
|
|
10796
10817
|
module.exports = sort;
|
|
10797
10818
|
}
|
|
10798
10819
|
});
|
|
10799
10820
|
var require_rsort = __commonJS2({
|
|
10800
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10821
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rsort.js"(exports$1, module) {
|
|
10801
10822
|
var compareBuild = require_compare_build();
|
|
10802
10823
|
var rsort = (list, loose) => list.sort((a2, b2) => compareBuild(b2, a2, loose));
|
|
10803
10824
|
module.exports = rsort;
|
|
10804
10825
|
}
|
|
10805
10826
|
});
|
|
10806
10827
|
var require_gt = __commonJS2({
|
|
10807
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10828
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gt.js"(exports$1, module) {
|
|
10808
10829
|
var compare = require_compare();
|
|
10809
10830
|
var gt4 = (a2, b2, loose) => compare(a2, b2, loose) > 0;
|
|
10810
10831
|
module.exports = gt4;
|
|
10811
10832
|
}
|
|
10812
10833
|
});
|
|
10813
10834
|
var require_lt = __commonJS2({
|
|
10814
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10835
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lt.js"(exports$1, module) {
|
|
10815
10836
|
var compare = require_compare();
|
|
10816
10837
|
var lt3 = (a2, b2, loose) => compare(a2, b2, loose) < 0;
|
|
10817
10838
|
module.exports = lt3;
|
|
10818
10839
|
}
|
|
10819
10840
|
});
|
|
10820
10841
|
var require_eq = __commonJS2({
|
|
10821
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10842
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/eq.js"(exports$1, module) {
|
|
10822
10843
|
var compare = require_compare();
|
|
10823
10844
|
var eq = (a2, b2, loose) => compare(a2, b2, loose) === 0;
|
|
10824
10845
|
module.exports = eq;
|
|
10825
10846
|
}
|
|
10826
10847
|
});
|
|
10827
10848
|
var require_neq = __commonJS2({
|
|
10828
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10849
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/neq.js"(exports$1, module) {
|
|
10829
10850
|
var compare = require_compare();
|
|
10830
10851
|
var neq = (a2, b2, loose) => compare(a2, b2, loose) !== 0;
|
|
10831
10852
|
module.exports = neq;
|
|
10832
10853
|
}
|
|
10833
10854
|
});
|
|
10834
10855
|
var require_gte = __commonJS2({
|
|
10835
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10856
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gte.js"(exports$1, module) {
|
|
10836
10857
|
var compare = require_compare();
|
|
10837
10858
|
var gte = (a2, b2, loose) => compare(a2, b2, loose) >= 0;
|
|
10838
10859
|
module.exports = gte;
|
|
10839
10860
|
}
|
|
10840
10861
|
});
|
|
10841
10862
|
var require_lte = __commonJS2({
|
|
10842
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10863
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lte.js"(exports$1, module) {
|
|
10843
10864
|
var compare = require_compare();
|
|
10844
10865
|
var lte = (a2, b2, loose) => compare(a2, b2, loose) <= 0;
|
|
10845
10866
|
module.exports = lte;
|
|
10846
10867
|
}
|
|
10847
10868
|
});
|
|
10848
10869
|
var require_cmp = __commonJS2({
|
|
10849
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10870
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/cmp.js"(exports$1, module) {
|
|
10850
10871
|
var eq = require_eq();
|
|
10851
10872
|
var neq = require_neq();
|
|
10852
10873
|
var gt4 = require_gt();
|
|
@@ -10893,7 +10914,7 @@ var require_cmp = __commonJS2({
|
|
|
10893
10914
|
}
|
|
10894
10915
|
});
|
|
10895
10916
|
var require_coerce = __commonJS2({
|
|
10896
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10917
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/coerce.js"(exports$1, module) {
|
|
10897
10918
|
var SemVer = require_semver();
|
|
10898
10919
|
var parse = require_parse();
|
|
10899
10920
|
var { safeRe: re3, t: t2 } = require_re();
|
|
@@ -10935,8 +10956,46 @@ var require_coerce = __commonJS2({
|
|
|
10935
10956
|
module.exports = coerce;
|
|
10936
10957
|
}
|
|
10937
10958
|
});
|
|
10959
|
+
var require_truncate = __commonJS2({
|
|
10960
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/truncate.js"(exports$1, module) {
|
|
10961
|
+
var parse = require_parse();
|
|
10962
|
+
var constants4 = require_constants();
|
|
10963
|
+
var SemVer = require_semver();
|
|
10964
|
+
var truncate = (version2, truncation, options) => {
|
|
10965
|
+
if (!constants4.RELEASE_TYPES.includes(truncation)) {
|
|
10966
|
+
return null;
|
|
10967
|
+
}
|
|
10968
|
+
const clonedVersion = cloneInputVersion(version2, options);
|
|
10969
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
10970
|
+
};
|
|
10971
|
+
var cloneInputVersion = (version2, options) => {
|
|
10972
|
+
const versionStringToParse = version2 instanceof SemVer ? version2.version : version2;
|
|
10973
|
+
return parse(versionStringToParse, options);
|
|
10974
|
+
};
|
|
10975
|
+
var doTruncation = (version2, truncation) => {
|
|
10976
|
+
if (isPrerelease(truncation)) {
|
|
10977
|
+
return version2.version;
|
|
10978
|
+
}
|
|
10979
|
+
version2.prerelease = [];
|
|
10980
|
+
switch (truncation) {
|
|
10981
|
+
case "major":
|
|
10982
|
+
version2.minor = 0;
|
|
10983
|
+
version2.patch = 0;
|
|
10984
|
+
break;
|
|
10985
|
+
case "minor":
|
|
10986
|
+
version2.patch = 0;
|
|
10987
|
+
break;
|
|
10988
|
+
}
|
|
10989
|
+
return version2.format();
|
|
10990
|
+
};
|
|
10991
|
+
var isPrerelease = (type) => {
|
|
10992
|
+
return type.startsWith("pre");
|
|
10993
|
+
};
|
|
10994
|
+
module.exports = truncate;
|
|
10995
|
+
}
|
|
10996
|
+
});
|
|
10938
10997
|
var require_lrucache = __commonJS2({
|
|
10939
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10998
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/lrucache.js"(exports$1, module) {
|
|
10940
10999
|
var LRUCache = class {
|
|
10941
11000
|
constructor() {
|
|
10942
11001
|
this.max = 1e3;
|
|
@@ -10971,7 +11030,7 @@ var require_lrucache = __commonJS2({
|
|
|
10971
11030
|
}
|
|
10972
11031
|
});
|
|
10973
11032
|
var require_range = __commonJS2({
|
|
10974
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11033
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/range.js"(exports$1, module) {
|
|
10975
11034
|
var SPACE_CHARACTERS = /\s+/g;
|
|
10976
11035
|
var Range = class _Range {
|
|
10977
11036
|
constructor(range, options) {
|
|
@@ -11141,6 +11200,7 @@ var require_range = __commonJS2({
|
|
|
11141
11200
|
return result;
|
|
11142
11201
|
};
|
|
11143
11202
|
var parseComparator = (comp, options) => {
|
|
11203
|
+
comp = comp.replace(re3[t2.BUILD], "");
|
|
11144
11204
|
debug("comp", comp, options);
|
|
11145
11205
|
comp = replaceCarets(comp, options);
|
|
11146
11206
|
debug("caret", comp);
|
|
@@ -11344,7 +11404,7 @@ var require_range = __commonJS2({
|
|
|
11344
11404
|
}
|
|
11345
11405
|
});
|
|
11346
11406
|
var require_comparator = __commonJS2({
|
|
11347
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11407
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/comparator.js"(exports$1, module) {
|
|
11348
11408
|
var ANY = Symbol("SemVer ANY");
|
|
11349
11409
|
var Comparator = class _Comparator {
|
|
11350
11410
|
static get ANY() {
|
|
@@ -11454,7 +11514,7 @@ var require_comparator = __commonJS2({
|
|
|
11454
11514
|
}
|
|
11455
11515
|
});
|
|
11456
11516
|
var require_satisfies = __commonJS2({
|
|
11457
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11517
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/satisfies.js"(exports$1, module) {
|
|
11458
11518
|
var Range = require_range();
|
|
11459
11519
|
var satisfies = (version2, range, options) => {
|
|
11460
11520
|
try {
|
|
@@ -11468,14 +11528,14 @@ var require_satisfies = __commonJS2({
|
|
|
11468
11528
|
}
|
|
11469
11529
|
});
|
|
11470
11530
|
var require_to_comparators = __commonJS2({
|
|
11471
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11531
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/to-comparators.js"(exports$1, module) {
|
|
11472
11532
|
var Range = require_range();
|
|
11473
11533
|
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c3) => c3.value).join(" ").trim().split(" "));
|
|
11474
11534
|
module.exports = toComparators;
|
|
11475
11535
|
}
|
|
11476
11536
|
});
|
|
11477
11537
|
var require_max_satisfying = __commonJS2({
|
|
11478
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11538
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/max-satisfying.js"(exports$1, module) {
|
|
11479
11539
|
var SemVer = require_semver();
|
|
11480
11540
|
var Range = require_range();
|
|
11481
11541
|
var maxSatisfying = (versions, range, options) => {
|
|
@@ -11501,7 +11561,7 @@ var require_max_satisfying = __commonJS2({
|
|
|
11501
11561
|
}
|
|
11502
11562
|
});
|
|
11503
11563
|
var require_min_satisfying = __commonJS2({
|
|
11504
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11564
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-satisfying.js"(exports$1, module) {
|
|
11505
11565
|
var SemVer = require_semver();
|
|
11506
11566
|
var Range = require_range();
|
|
11507
11567
|
var minSatisfying = (versions, range, options) => {
|
|
@@ -11527,7 +11587,7 @@ var require_min_satisfying = __commonJS2({
|
|
|
11527
11587
|
}
|
|
11528
11588
|
});
|
|
11529
11589
|
var require_min_version = __commonJS2({
|
|
11530
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11590
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-version.js"(exports$1, module) {
|
|
11531
11591
|
var SemVer = require_semver();
|
|
11532
11592
|
var Range = require_range();
|
|
11533
11593
|
var gt4 = require_gt();
|
|
@@ -11583,7 +11643,7 @@ var require_min_version = __commonJS2({
|
|
|
11583
11643
|
}
|
|
11584
11644
|
});
|
|
11585
11645
|
var require_valid2 = __commonJS2({
|
|
11586
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11646
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/valid.js"(exports$1, module) {
|
|
11587
11647
|
var Range = require_range();
|
|
11588
11648
|
var validRange = (range, options) => {
|
|
11589
11649
|
try {
|
|
@@ -11596,7 +11656,7 @@ var require_valid2 = __commonJS2({
|
|
|
11596
11656
|
}
|
|
11597
11657
|
});
|
|
11598
11658
|
var require_outside = __commonJS2({
|
|
11599
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11659
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/outside.js"(exports$1, module) {
|
|
11600
11660
|
var SemVer = require_semver();
|
|
11601
11661
|
var Comparator = require_comparator();
|
|
11602
11662
|
var { ANY } = Comparator;
|
|
@@ -11662,21 +11722,21 @@ var require_outside = __commonJS2({
|
|
|
11662
11722
|
}
|
|
11663
11723
|
});
|
|
11664
11724
|
var require_gtr = __commonJS2({
|
|
11665
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11725
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/gtr.js"(exports$1, module) {
|
|
11666
11726
|
var outside = require_outside();
|
|
11667
11727
|
var gtr = (version2, range, options) => outside(version2, range, ">", options);
|
|
11668
11728
|
module.exports = gtr;
|
|
11669
11729
|
}
|
|
11670
11730
|
});
|
|
11671
11731
|
var require_ltr = __commonJS2({
|
|
11672
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11732
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/ltr.js"(exports$1, module) {
|
|
11673
11733
|
var outside = require_outside();
|
|
11674
11734
|
var ltr = (version2, range, options) => outside(version2, range, "<", options);
|
|
11675
11735
|
module.exports = ltr;
|
|
11676
11736
|
}
|
|
11677
11737
|
});
|
|
11678
11738
|
var require_intersects = __commonJS2({
|
|
11679
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11739
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/intersects.js"(exports$1, module) {
|
|
11680
11740
|
var Range = require_range();
|
|
11681
11741
|
var intersects = (r1, r2, options) => {
|
|
11682
11742
|
r1 = new Range(r1, options);
|
|
@@ -11687,7 +11747,7 @@ var require_intersects = __commonJS2({
|
|
|
11687
11747
|
}
|
|
11688
11748
|
});
|
|
11689
11749
|
var require_simplify = __commonJS2({
|
|
11690
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11750
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/simplify.js"(exports$1, module) {
|
|
11691
11751
|
var satisfies = require_satisfies();
|
|
11692
11752
|
var compare = require_compare();
|
|
11693
11753
|
module.exports = (versions, range, options) => {
|
|
@@ -11734,7 +11794,7 @@ var require_simplify = __commonJS2({
|
|
|
11734
11794
|
}
|
|
11735
11795
|
});
|
|
11736
11796
|
var require_subset = __commonJS2({
|
|
11737
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11797
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/subset.js"(exports$1, module) {
|
|
11738
11798
|
var Range = require_range();
|
|
11739
11799
|
var Comparator = require_comparator();
|
|
11740
11800
|
var { ANY } = Comparator;
|
|
@@ -11893,7 +11953,7 @@ var require_subset = __commonJS2({
|
|
|
11893
11953
|
}
|
|
11894
11954
|
});
|
|
11895
11955
|
var require_semver2 = __commonJS2({
|
|
11896
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11956
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/index.js"(exports$1, module) {
|
|
11897
11957
|
var internalRe = require_re();
|
|
11898
11958
|
var constants4 = require_constants();
|
|
11899
11959
|
var SemVer = require_semver();
|
|
@@ -11921,6 +11981,7 @@ var require_semver2 = __commonJS2({
|
|
|
11921
11981
|
var lte = require_lte();
|
|
11922
11982
|
var cmp = require_cmp();
|
|
11923
11983
|
var coerce = require_coerce();
|
|
11984
|
+
var truncate = require_truncate();
|
|
11924
11985
|
var Comparator = require_comparator();
|
|
11925
11986
|
var Range = require_range();
|
|
11926
11987
|
var satisfies = require_satisfies();
|
|
@@ -11959,6 +12020,7 @@ var require_semver2 = __commonJS2({
|
|
|
11959
12020
|
lte,
|
|
11960
12021
|
cmp,
|
|
11961
12022
|
coerce,
|
|
12023
|
+
truncate,
|
|
11962
12024
|
Comparator,
|
|
11963
12025
|
Range,
|
|
11964
12026
|
satisfies,
|
|
@@ -15947,36 +16009,36 @@ var homedir = os.homedir();
|
|
|
15947
16009
|
var tmpdir = os.tmpdir();
|
|
15948
16010
|
var { env } = process4;
|
|
15949
16011
|
var macos = (name) => {
|
|
15950
|
-
const library =
|
|
16012
|
+
const library = path15.join(homedir, "Library");
|
|
15951
16013
|
return {
|
|
15952
|
-
data:
|
|
15953
|
-
config:
|
|
15954
|
-
cache:
|
|
15955
|
-
log:
|
|
15956
|
-
temp:
|
|
16014
|
+
data: path15.join(library, "Application Support", name),
|
|
16015
|
+
config: path15.join(library, "Preferences", name),
|
|
16016
|
+
cache: path15.join(library, "Caches", name),
|
|
16017
|
+
log: path15.join(library, "Logs", name),
|
|
16018
|
+
temp: path15.join(tmpdir, name)
|
|
15957
16019
|
};
|
|
15958
16020
|
};
|
|
15959
16021
|
var windows = (name) => {
|
|
15960
|
-
const appData = env.APPDATA ||
|
|
15961
|
-
const localAppData = env.LOCALAPPDATA ||
|
|
16022
|
+
const appData = env.APPDATA || path15.join(homedir, "AppData", "Roaming");
|
|
16023
|
+
const localAppData = env.LOCALAPPDATA || path15.join(homedir, "AppData", "Local");
|
|
15962
16024
|
return {
|
|
15963
16025
|
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
|
15964
|
-
data:
|
|
15965
|
-
config:
|
|
15966
|
-
cache:
|
|
15967
|
-
log:
|
|
15968
|
-
temp:
|
|
16026
|
+
data: path15.join(localAppData, name, "Data"),
|
|
16027
|
+
config: path15.join(appData, name, "Config"),
|
|
16028
|
+
cache: path15.join(localAppData, name, "Cache"),
|
|
16029
|
+
log: path15.join(localAppData, name, "Log"),
|
|
16030
|
+
temp: path15.join(tmpdir, name)
|
|
15969
16031
|
};
|
|
15970
16032
|
};
|
|
15971
16033
|
var linux = (name) => {
|
|
15972
|
-
const username =
|
|
16034
|
+
const username = path15.basename(homedir);
|
|
15973
16035
|
return {
|
|
15974
|
-
data:
|
|
15975
|
-
config:
|
|
15976
|
-
cache:
|
|
16036
|
+
data: path15.join(env.XDG_DATA_HOME || path15.join(homedir, ".local", "share"), name),
|
|
16037
|
+
config: path15.join(env.XDG_CONFIG_HOME || path15.join(homedir, ".config"), name),
|
|
16038
|
+
cache: path15.join(env.XDG_CACHE_HOME || path15.join(homedir, ".cache"), name),
|
|
15977
16039
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
15978
|
-
log:
|
|
15979
|
-
temp:
|
|
16040
|
+
log: path15.join(env.XDG_STATE_HOME || path15.join(homedir, ".local", "state"), name),
|
|
16041
|
+
temp: path15.join(tmpdir, username, name)
|
|
15980
16042
|
};
|
|
15981
16043
|
};
|
|
15982
16044
|
function envPaths(name, { suffix = "nodejs" } = {}) {
|
|
@@ -16253,7 +16315,7 @@ var Temp = {
|
|
|
16253
16315
|
}
|
|
16254
16316
|
},
|
|
16255
16317
|
truncate: (filePath) => {
|
|
16256
|
-
const basename =
|
|
16318
|
+
const basename = path15.basename(filePath);
|
|
16257
16319
|
if (basename.length <= LIMIT_BASENAME_LENGTH)
|
|
16258
16320
|
return filePath;
|
|
16259
16321
|
const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename);
|
|
@@ -16293,7 +16355,7 @@ function writeFileSync(filePath, data, options = DEFAULT_WRITE_OPTIONS) {
|
|
|
16293
16355
|
}
|
|
16294
16356
|
}
|
|
16295
16357
|
if (!filePathExists) {
|
|
16296
|
-
const parentPath =
|
|
16358
|
+
const parentPath = path15.dirname(filePath);
|
|
16297
16359
|
dist_default.attempt.mkdirSync(parentPath, {
|
|
16298
16360
|
mode: DEFAULT_FOLDER_MODE,
|
|
16299
16361
|
recursive: true
|
|
@@ -16596,7 +16658,7 @@ var Conf = class {
|
|
|
16596
16658
|
this.events = new EventTarget();
|
|
16597
16659
|
this.#encryptionKey = options.encryptionKey;
|
|
16598
16660
|
const fileExtension = options.fileExtension ? `.${options.fileExtension}` : "";
|
|
16599
|
-
this.path =
|
|
16661
|
+
this.path = path15.resolve(options.cwd, `${options.configName ?? "config"}${fileExtension}`);
|
|
16600
16662
|
const fileStore = this.store;
|
|
16601
16663
|
const store = Object.assign(createPlainObject(), options.defaults, fileStore);
|
|
16602
16664
|
if (options.migrations) {
|
|
@@ -16801,7 +16863,7 @@ var Conf = class {
|
|
|
16801
16863
|
throw new Error("Config schema violation: " + errors.join("; "));
|
|
16802
16864
|
}
|
|
16803
16865
|
_ensureDirectory() {
|
|
16804
|
-
fs.mkdirSync(
|
|
16866
|
+
fs.mkdirSync(path15.dirname(this.path), { recursive: true });
|
|
16805
16867
|
}
|
|
16806
16868
|
_write(value) {
|
|
16807
16869
|
let data = this._serialize(value);
|
|
@@ -17113,6 +17175,29 @@ async function shutdown() {
|
|
|
17113
17175
|
if (!state || !state.client) return;
|
|
17114
17176
|
await state.client.shutdown();
|
|
17115
17177
|
}
|
|
17178
|
+
function resolveProjectArg(directory) {
|
|
17179
|
+
const trimmed = directory?.trim();
|
|
17180
|
+
if (!trimmed) {
|
|
17181
|
+
return { projectName: void 0, installInCwd: false };
|
|
17182
|
+
}
|
|
17183
|
+
if (trimmed === "." || trimmed === "./") {
|
|
17184
|
+
return { projectName: void 0, installInCwd: true };
|
|
17185
|
+
}
|
|
17186
|
+
return { projectName: path15.basename(trimmed), installInCwd: false };
|
|
17187
|
+
}
|
|
17188
|
+
function validateProjectName(name) {
|
|
17189
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(name)) {
|
|
17190
|
+
return "Use lowercase letters, numbers, hyphens, dots, or underscores";
|
|
17191
|
+
}
|
|
17192
|
+
return void 0;
|
|
17193
|
+
}
|
|
17194
|
+
function validateProjectNamePromptInput(value) {
|
|
17195
|
+
const trimmed = (value ?? "").trim();
|
|
17196
|
+
if (trimmed === "") return void 0;
|
|
17197
|
+
if (trimmed === "." || trimmed === "./") return void 0;
|
|
17198
|
+
const candidate = trimmed.startsWith("./") ? trimmed.slice(2) : trimmed;
|
|
17199
|
+
return validateProjectName(path15.basename(candidate));
|
|
17200
|
+
}
|
|
17116
17201
|
|
|
17117
17202
|
// ../../node_modules/.pnpm/@clack+core@1.1.0/node_modules/@clack/core/dist/index.mjs
|
|
17118
17203
|
var import_sisteransi = __toESM(require_src(), 1);
|
|
@@ -17995,7 +18080,7 @@ ${l}
|
|
|
17995
18080
|
} }).prompt();
|
|
17996
18081
|
|
|
17997
18082
|
// src/create-nextly.ts
|
|
17998
|
-
var
|
|
18083
|
+
var import_fs_extra13 = __toESM(require_lib(), 1);
|
|
17999
18084
|
var import_picocolors3 = __toESM(require_picocolors2(), 1);
|
|
18000
18085
|
|
|
18001
18086
|
// src/generators/admin.ts
|
|
@@ -18003,9 +18088,6 @@ var import_fs_extra = __toESM(require_lib(), 1);
|
|
|
18003
18088
|
var ADMIN_PAGE_TEMPLATE = `"use client";
|
|
18004
18089
|
|
|
18005
18090
|
import "@nextlyhq/admin/style.css";
|
|
18006
|
-
import "@nextlyhq/plugin-form-builder/admin";
|
|
18007
|
-
import "@nextlyhq/plugin-form-builder/styles/builder.css";
|
|
18008
|
-
import "@nextlyhq/plugin-form-builder/styles/submissions-filter.css";
|
|
18009
18091
|
import { RootLayout, QueryProvider, ErrorBoundary } from "@nextlyhq/admin";
|
|
18010
18092
|
|
|
18011
18093
|
export default function AdminPage() {
|
|
@@ -18047,9 +18129,9 @@ export default function AdminLayout({
|
|
|
18047
18129
|
`;
|
|
18048
18130
|
}
|
|
18049
18131
|
async function generateAdminPage(cwd, projectInfo) {
|
|
18050
|
-
const adminDir =
|
|
18051
|
-
const pagePath =
|
|
18052
|
-
const layoutPath =
|
|
18132
|
+
const adminDir = path15.join(cwd, projectInfo.appDir, "admin", "[[...params]]");
|
|
18133
|
+
const pagePath = path15.join(adminDir, "page.tsx");
|
|
18134
|
+
const layoutPath = path15.join(adminDir, "layout.tsx");
|
|
18053
18135
|
if (await import_fs_extra.default.pathExists(pagePath)) {
|
|
18054
18136
|
throw new Error(
|
|
18055
18137
|
"Admin page already exists at admin/[[...params]]/page.tsx"
|
|
@@ -18102,7 +18184,7 @@ ${singlesLine}
|
|
|
18102
18184
|
return template;
|
|
18103
18185
|
}
|
|
18104
18186
|
async function generateConfig(cwd, projectType) {
|
|
18105
|
-
const configPath =
|
|
18187
|
+
const configPath = path15.join(cwd, "nextly.config.ts");
|
|
18106
18188
|
if (await import_fs_extra2.default.pathExists(configPath)) {
|
|
18107
18189
|
throw new Error(
|
|
18108
18190
|
"nextly.config.ts already exists. Please remove it first or run in a fresh project."
|
|
@@ -18133,8 +18215,8 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000
|
|
|
18133
18215
|
`;
|
|
18134
18216
|
}
|
|
18135
18217
|
async function generateEnv(cwd, database) {
|
|
18136
|
-
const envPath =
|
|
18137
|
-
const envExamplePath =
|
|
18218
|
+
const envPath = path15.join(cwd, ".env");
|
|
18219
|
+
const envExamplePath = path15.join(cwd, ".env.example");
|
|
18138
18220
|
const envContent = getEnvTemplate(database);
|
|
18139
18221
|
await import_fs_extra3.default.writeFile(envExamplePath, envContent, "utf-8");
|
|
18140
18222
|
if (await import_fs_extra3.default.pathExists(envPath)) {
|
|
@@ -18198,50 +18280,70 @@ var HEALTH_ROUTE_TEMPLATE = `/**
|
|
|
18198
18280
|
export { GET, HEAD } from "nextly/api/health";
|
|
18199
18281
|
`;
|
|
18200
18282
|
async function generateMediaRoutes(cwd, projectInfo) {
|
|
18201
|
-
const apiDir =
|
|
18202
|
-
const mediaDir =
|
|
18283
|
+
const apiDir = path15.join(cwd, projectInfo.appDir, "api");
|
|
18284
|
+
const mediaDir = path15.join(apiDir, "media");
|
|
18203
18285
|
if (await import_fs_extra4.default.pathExists(mediaDir)) {
|
|
18204
18286
|
throw new Error(
|
|
18205
18287
|
"Media API routes already exist at api/media. Please remove them first."
|
|
18206
18288
|
);
|
|
18207
18289
|
}
|
|
18208
|
-
const mediaRoutePath =
|
|
18290
|
+
const mediaRoutePath = path15.join(apiDir, "media", "[[...path]]", "route.ts");
|
|
18209
18291
|
const configImportPath = getConfigImportPath(
|
|
18210
18292
|
projectInfo.appDir.startsWith("src")
|
|
18211
18293
|
);
|
|
18212
|
-
await import_fs_extra4.default.ensureDir(
|
|
18294
|
+
await import_fs_extra4.default.ensureDir(path15.dirname(mediaRoutePath));
|
|
18213
18295
|
await import_fs_extra4.default.writeFile(
|
|
18214
18296
|
mediaRoutePath,
|
|
18215
18297
|
MEDIA_CATCH_ALL_TEMPLATE(configImportPath),
|
|
18216
18298
|
"utf-8"
|
|
18217
18299
|
);
|
|
18218
|
-
const healthRoutePath =
|
|
18219
|
-
await import_fs_extra4.default.ensureDir(
|
|
18300
|
+
const healthRoutePath = path15.join(apiDir, "health", "route.ts");
|
|
18301
|
+
await import_fs_extra4.default.ensureDir(path15.dirname(healthRoutePath));
|
|
18220
18302
|
await import_fs_extra4.default.writeFile(healthRoutePath, HEALTH_ROUTE_TEMPLATE, "utf-8");
|
|
18221
18303
|
}
|
|
18222
18304
|
|
|
18223
18305
|
// src/generators/next-config.ts
|
|
18224
18306
|
var import_fs_extra5 = __toESM(require_lib(), 1);
|
|
18225
|
-
var
|
|
18307
|
+
var COMMON_SERVER_EXTERNAL_PACKAGES = [
|
|
18226
18308
|
"nextly",
|
|
18227
18309
|
"@nextlyhq/adapter-drizzle",
|
|
18228
|
-
"@nextlyhq/adapter-postgres",
|
|
18229
|
-
"@nextlyhq/adapter-mysql",
|
|
18230
|
-
"@nextlyhq/adapter-sqlite",
|
|
18231
18310
|
"drizzle-orm",
|
|
18232
18311
|
"drizzle-kit",
|
|
18233
|
-
"pg",
|
|
18234
|
-
"mysql2",
|
|
18235
|
-
"better-sqlite3",
|
|
18236
18312
|
"bcryptjs",
|
|
18237
18313
|
"sharp",
|
|
18238
18314
|
"esbuild"
|
|
18239
18315
|
];
|
|
18240
|
-
|
|
18316
|
+
var DATABASE_SERVER_EXTERNAL_PACKAGES = {
|
|
18317
|
+
postgresql: ["@nextlyhq/adapter-postgres", "pg"],
|
|
18318
|
+
mysql: ["@nextlyhq/adapter-mysql", "mysql2"],
|
|
18319
|
+
sqlite: ["@nextlyhq/adapter-sqlite", "better-sqlite3"]
|
|
18320
|
+
};
|
|
18321
|
+
function getServerExternalPackages(database) {
|
|
18322
|
+
return [
|
|
18323
|
+
...COMMON_SERVER_EXTERNAL_PACKAGES,
|
|
18324
|
+
...DATABASE_SERVER_EXTERNAL_PACKAGES[database.type]
|
|
18325
|
+
];
|
|
18326
|
+
}
|
|
18327
|
+
function buildNextConfigTemplate(database) {
|
|
18328
|
+
const packagesArray = JSON.stringify(
|
|
18329
|
+
getServerExternalPackages(database),
|
|
18330
|
+
null,
|
|
18331
|
+
2
|
|
18332
|
+
).replace(/\n/g, "\n ");
|
|
18333
|
+
return `import type { NextConfig } from "next";
|
|
18334
|
+
|
|
18335
|
+
const nextConfig: NextConfig = {
|
|
18336
|
+
serverExternalPackages: ${packagesArray},
|
|
18337
|
+
};
|
|
18338
|
+
|
|
18339
|
+
export default nextConfig;
|
|
18340
|
+
`;
|
|
18341
|
+
}
|
|
18342
|
+
async function patchNextConfig(cwd, database) {
|
|
18241
18343
|
const candidates = ["next.config.ts", "next.config.mjs", "next.config.js"];
|
|
18242
18344
|
let configPath = null;
|
|
18243
18345
|
for (const name of candidates) {
|
|
18244
|
-
const full =
|
|
18346
|
+
const full = path15.join(cwd, name);
|
|
18245
18347
|
if (await import_fs_extra5.default.pathExists(full)) {
|
|
18246
18348
|
configPath = full;
|
|
18247
18349
|
break;
|
|
@@ -18254,7 +18356,11 @@ async function patchNextConfig(cwd) {
|
|
|
18254
18356
|
if (content.includes("serverExternalPackages")) {
|
|
18255
18357
|
return;
|
|
18256
18358
|
}
|
|
18257
|
-
const packagesArray = JSON.stringify(
|
|
18359
|
+
const packagesArray = JSON.stringify(
|
|
18360
|
+
getServerExternalPackages(database),
|
|
18361
|
+
null,
|
|
18362
|
+
2
|
|
18363
|
+
).replace(/\n/g, "\n ");
|
|
18258
18364
|
const configObjectPattern = /(const\s+\w+\s*(?::\s*NextConfig\s*)?=\s*\{)/;
|
|
18259
18365
|
if (configObjectPattern.test(content)) {
|
|
18260
18366
|
const patched = content.replace(
|
|
@@ -18294,7 +18400,7 @@ export const DELETE = handlers.DELETE;
|
|
|
18294
18400
|
export const OPTIONS = handlers.OPTIONS;
|
|
18295
18401
|
`;
|
|
18296
18402
|
async function generateRoutes(cwd, projectInfo) {
|
|
18297
|
-
const routePath =
|
|
18403
|
+
const routePath = path15.join(
|
|
18298
18404
|
cwd,
|
|
18299
18405
|
projectInfo.appDir,
|
|
18300
18406
|
"admin",
|
|
@@ -18307,7 +18413,7 @@ async function generateRoutes(cwd, projectInfo) {
|
|
|
18307
18413
|
"API route already exists at admin/api/[[...params]]/route.ts"
|
|
18308
18414
|
);
|
|
18309
18415
|
}
|
|
18310
|
-
await import_fs_extra6.default.ensureDir(
|
|
18416
|
+
await import_fs_extra6.default.ensureDir(path15.dirname(routePath));
|
|
18311
18417
|
await import_fs_extra6.default.writeFile(routePath, API_ROUTE_TEMPLATE, "utf-8");
|
|
18312
18418
|
}
|
|
18313
18419
|
|
|
@@ -18315,13 +18421,13 @@ async function generateRoutes(cwd, projectInfo) {
|
|
|
18315
18421
|
var import_fs_extra7 = __toESM(require_lib(), 1);
|
|
18316
18422
|
async function generateTypesDirectory(cwd, projectInfo) {
|
|
18317
18423
|
const baseDir = projectInfo.srcDir ? "src" : ".";
|
|
18318
|
-
const typesDir =
|
|
18424
|
+
const typesDir = path15.join(cwd, baseDir, "types", "generated");
|
|
18319
18425
|
await import_fs_extra7.default.ensureDir(typesDir);
|
|
18320
|
-
const gitkeepPath =
|
|
18426
|
+
const gitkeepPath = path15.join(typesDir, ".gitkeep");
|
|
18321
18427
|
if (!await import_fs_extra7.default.pathExists(gitkeepPath)) {
|
|
18322
18428
|
await import_fs_extra7.default.writeFile(gitkeepPath, "", "utf-8");
|
|
18323
18429
|
}
|
|
18324
|
-
const placeholderPath =
|
|
18430
|
+
const placeholderPath = path15.join(typesDir, "nextly-types.ts");
|
|
18325
18431
|
if (!await import_fs_extra7.default.pathExists(placeholderPath)) {
|
|
18326
18432
|
const placeholderContent = `/**
|
|
18327
18433
|
* Nextly Generated Types
|
|
@@ -19132,12 +19238,12 @@ function toPath(urlOrPath) {
|
|
|
19132
19238
|
function traversePathUp(startPath) {
|
|
19133
19239
|
return {
|
|
19134
19240
|
*[Symbol.iterator]() {
|
|
19135
|
-
let currentPath =
|
|
19241
|
+
let currentPath = path15.resolve(toPath(startPath));
|
|
19136
19242
|
let previousPath;
|
|
19137
19243
|
while (previousPath !== currentPath) {
|
|
19138
19244
|
yield currentPath;
|
|
19139
19245
|
previousPath = currentPath;
|
|
19140
|
-
currentPath =
|
|
19246
|
+
currentPath = path15.resolve(currentPath, "..");
|
|
19141
19247
|
}
|
|
19142
19248
|
}
|
|
19143
19249
|
};
|
|
@@ -19151,27 +19257,27 @@ var npmRunPath = ({
|
|
|
19151
19257
|
execPath: execPath2 = process4.execPath,
|
|
19152
19258
|
addExecPath = true
|
|
19153
19259
|
} = {}) => {
|
|
19154
|
-
const cwdPath =
|
|
19260
|
+
const cwdPath = path15.resolve(toPath(cwd));
|
|
19155
19261
|
const result = [];
|
|
19156
|
-
const pathParts = pathOption.split(
|
|
19262
|
+
const pathParts = pathOption.split(path15.delimiter);
|
|
19157
19263
|
if (preferLocal) {
|
|
19158
19264
|
applyPreferLocal(result, pathParts, cwdPath);
|
|
19159
19265
|
}
|
|
19160
19266
|
if (addExecPath) {
|
|
19161
19267
|
applyExecPath(result, pathParts, execPath2, cwdPath);
|
|
19162
19268
|
}
|
|
19163
|
-
return pathOption === "" || pathOption ===
|
|
19269
|
+
return pathOption === "" || pathOption === path15.delimiter ? `${result.join(path15.delimiter)}${pathOption}` : [...result, pathOption].join(path15.delimiter);
|
|
19164
19270
|
};
|
|
19165
19271
|
var applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
19166
19272
|
for (const directory of traversePathUp(cwdPath)) {
|
|
19167
|
-
const pathPart =
|
|
19273
|
+
const pathPart = path15.join(directory, "node_modules/.bin");
|
|
19168
19274
|
if (!pathParts.includes(pathPart)) {
|
|
19169
19275
|
result.push(pathPart);
|
|
19170
19276
|
}
|
|
19171
19277
|
}
|
|
19172
19278
|
};
|
|
19173
19279
|
var applyExecPath = (result, pathParts, execPath2, cwdPath) => {
|
|
19174
|
-
const pathPart =
|
|
19280
|
+
const pathPart = path15.resolve(cwdPath, toPath(execPath2), "..");
|
|
19175
19281
|
if (!pathParts.includes(pathPart)) {
|
|
19176
19282
|
result.push(pathPart);
|
|
19177
19283
|
}
|
|
@@ -20304,7 +20410,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
20304
20410
|
throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
|
|
20305
20411
|
}
|
|
20306
20412
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The "nodePath" option');
|
|
20307
|
-
const resolvedNodePath =
|
|
20413
|
+
const resolvedNodePath = path15.resolve(cwd, normalizedNodePath);
|
|
20308
20414
|
const newOptions = {
|
|
20309
20415
|
...options,
|
|
20310
20416
|
nodePath: resolvedNodePath,
|
|
@@ -20314,7 +20420,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
20314
20420
|
if (!shouldHandleNode) {
|
|
20315
20421
|
return [file, commandArguments, newOptions];
|
|
20316
20422
|
}
|
|
20317
|
-
if (
|
|
20423
|
+
if (path15.basename(file, ".exe") === "node") {
|
|
20318
20424
|
throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
|
|
20319
20425
|
}
|
|
20320
20426
|
return [
|
|
@@ -20400,7 +20506,7 @@ var ENCODING_ALIASES = {
|
|
|
20400
20506
|
var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding);
|
|
20401
20507
|
var normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
20402
20508
|
const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
|
|
20403
|
-
return
|
|
20509
|
+
return path15.resolve(cwdString);
|
|
20404
20510
|
};
|
|
20405
20511
|
var getDefaultCwd = () => {
|
|
20406
20512
|
try {
|
|
@@ -20447,7 +20553,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
20447
20553
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
20448
20554
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
20449
20555
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
20450
|
-
if (process4.platform === "win32" &&
|
|
20556
|
+
if (process4.platform === "win32" && path15.basename(file, ".exe") === "cmd") {
|
|
20451
20557
|
commandArguments.unshift("/q");
|
|
20452
20558
|
}
|
|
20453
20559
|
return { file, commandArguments, options };
|
|
@@ -22554,13 +22660,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state: state2, verboseInfo, e
|
|
|
22554
22660
|
}
|
|
22555
22661
|
};
|
|
22556
22662
|
var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
22557
|
-
for (const { path:
|
|
22558
|
-
const pathString = typeof
|
|
22663
|
+
for (const { path: path21, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
|
|
22664
|
+
const pathString = typeof path21 === "string" ? path21 : path21.toString();
|
|
22559
22665
|
if (append || outputFiles.has(pathString)) {
|
|
22560
|
-
appendFileSync(
|
|
22666
|
+
appendFileSync(path21, serializedResult);
|
|
22561
22667
|
} else {
|
|
22562
22668
|
outputFiles.add(pathString);
|
|
22563
|
-
writeFileSync$1(
|
|
22669
|
+
writeFileSync$1(path21, serializedResult);
|
|
22564
22670
|
}
|
|
22565
22671
|
}
|
|
22566
22672
|
};
|
|
@@ -24856,102 +24962,576 @@ createExeca(mapNode);
|
|
|
24856
24962
|
createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
|
|
24857
24963
|
getIpcExport();
|
|
24858
24964
|
|
|
24859
|
-
// src/
|
|
24860
|
-
var
|
|
24861
|
-
|
|
24862
|
-
|
|
24863
|
-
|
|
24864
|
-
|
|
24965
|
+
// src/utils/template.ts
|
|
24966
|
+
var import_fs_extra8 = __toESM(require_lib(), 1);
|
|
24967
|
+
var PROJECT_TYPES_WITH_FORM_BUILDER = /* @__PURE__ */ new Set([
|
|
24968
|
+
"blog"
|
|
24969
|
+
]);
|
|
24970
|
+
function projectUsesFormBuilder(projectType) {
|
|
24971
|
+
return PROJECT_TYPES_WITH_FORM_BUILDER.has(projectType);
|
|
24972
|
+
}
|
|
24973
|
+
var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
24974
|
+
".ts",
|
|
24975
|
+
".tsx",
|
|
24976
|
+
".js",
|
|
24977
|
+
".jsx",
|
|
24978
|
+
".json",
|
|
24979
|
+
".env",
|
|
24980
|
+
".md",
|
|
24981
|
+
".css",
|
|
24982
|
+
".html",
|
|
24983
|
+
".mjs",
|
|
24984
|
+
".cjs"
|
|
24985
|
+
]);
|
|
24986
|
+
var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
|
|
24987
|
+
function resolveTemplatePath(localTemplatePath) {
|
|
24988
|
+
const __dirname = path15.dirname(fileURLToPath(import.meta.url));
|
|
24989
|
+
const fromDist = path15.resolve(__dirname, "../templates");
|
|
24990
|
+
if (import_fs_extra8.default.existsSync(fromDist)) {
|
|
24991
|
+
return fromDist;
|
|
24992
|
+
}
|
|
24993
|
+
const fromSrc = path15.resolve(__dirname, "../../templates");
|
|
24994
|
+
if (import_fs_extra8.default.existsSync(fromSrc)) {
|
|
24995
|
+
return fromSrc;
|
|
24996
|
+
}
|
|
24997
|
+
throw new Error(
|
|
24998
|
+
"Could not find templates directory. Use --local-template to specify the templates path, or ensure templates are bundled."
|
|
24999
|
+
);
|
|
25000
|
+
}
|
|
25001
|
+
function buildPlaceholderMap(options) {
|
|
25002
|
+
const { database, databaseUrl, pluginName, nextlyRange } = options;
|
|
25003
|
+
const map = {};
|
|
25004
|
+
if (database) {
|
|
25005
|
+
map["{{databaseDialect}}"] = database.type;
|
|
25006
|
+
map["{{databaseUrl}}"] = databaseUrl || database.envExample;
|
|
25007
|
+
}
|
|
25008
|
+
if (pluginName) map["{{pluginName}}"] = pluginName;
|
|
25009
|
+
if (nextlyRange) map["{{nextlyRange}}"] = nextlyRange;
|
|
25010
|
+
return map;
|
|
25011
|
+
}
|
|
25012
|
+
async function replacePlaceholdersInFile(filePath, placeholders) {
|
|
25013
|
+
const ext = path15.extname(filePath).toLowerCase();
|
|
25014
|
+
const basename = path15.basename(filePath);
|
|
25015
|
+
const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
|
|
25016
|
+
if (!isTextFile) return;
|
|
25017
|
+
let content = await import_fs_extra8.default.readFile(filePath, "utf-8");
|
|
25018
|
+
let changed = false;
|
|
25019
|
+
for (const [placeholder, value] of Object.entries(placeholders)) {
|
|
25020
|
+
if (content.includes(placeholder)) {
|
|
25021
|
+
content = content.replaceAll(placeholder, value);
|
|
25022
|
+
changed = true;
|
|
25023
|
+
}
|
|
25024
|
+
}
|
|
25025
|
+
if (changed) {
|
|
25026
|
+
await import_fs_extra8.default.writeFile(filePath, content, "utf-8");
|
|
25027
|
+
}
|
|
25028
|
+
}
|
|
25029
|
+
async function replacePlaceholders(dir, placeholders) {
|
|
25030
|
+
const entries = await import_fs_extra8.default.readdir(dir, { withFileTypes: true });
|
|
25031
|
+
for (const entry of entries) {
|
|
25032
|
+
const fullPath = path15.join(dir, entry.name);
|
|
25033
|
+
if (entry.isDirectory()) {
|
|
25034
|
+
if (entry.name === "node_modules" || entry.name === ".git") continue;
|
|
25035
|
+
await replacePlaceholders(fullPath, placeholders);
|
|
25036
|
+
} else if (entry.isFile()) {
|
|
25037
|
+
await replacePlaceholdersInFile(fullPath, placeholders);
|
|
25038
|
+
}
|
|
25039
|
+
}
|
|
25040
|
+
}
|
|
25041
|
+
var PINNED_VERSIONS = {
|
|
25042
|
+
// Next.js ecosystem — resolved at runtime via fetchLatestVersion()
|
|
25043
|
+
// (see generatePackageJson)
|
|
25044
|
+
react: "^19.1.0",
|
|
25045
|
+
"react-dom": "^19.1.0",
|
|
25046
|
+
// Dev dependencies
|
|
25047
|
+
typescript: "^5",
|
|
25048
|
+
"@types/node": "^20",
|
|
25049
|
+
"@types/react": "^19",
|
|
25050
|
+
"@types/react-dom": "^19",
|
|
25051
|
+
"@tailwindcss/postcss": "^4",
|
|
25052
|
+
tailwindcss: "^4",
|
|
25053
|
+
eslint: "^9"
|
|
24865
25054
|
};
|
|
24866
|
-
var
|
|
25055
|
+
var RUNTIME_RESOLVED_PACKAGES = ["next", "eslint-config-next"];
|
|
25056
|
+
var NEXTLY_PACKAGES = [
|
|
24867
25057
|
"nextly",
|
|
24868
25058
|
"@nextlyhq/admin",
|
|
24869
|
-
"@nextlyhq/adapter-drizzle",
|
|
24870
25059
|
"@nextlyhq/ui",
|
|
24871
|
-
"@
|
|
24872
|
-
];
|
|
24873
|
-
var ALL_ADAPTER_PACKAGES = [
|
|
25060
|
+
"@nextlyhq/adapter-drizzle",
|
|
24874
25061
|
"@nextlyhq/adapter-postgres",
|
|
24875
25062
|
"@nextlyhq/adapter-mysql",
|
|
24876
|
-
"@nextlyhq/adapter-sqlite"
|
|
24877
|
-
|
|
24878
|
-
|
|
24879
|
-
"@nextlyhq/plugin-form-builder"
|
|
25063
|
+
"@nextlyhq/adapter-sqlite",
|
|
25064
|
+
"@nextlyhq/plugin-form-builder",
|
|
25065
|
+
"@nextlyhq/plugin-sdk"
|
|
24880
25066
|
];
|
|
24881
|
-
|
|
24882
|
-
|
|
25067
|
+
var resolvedNextlyVersions = null;
|
|
25068
|
+
async function fetchLatestVersion(pkg) {
|
|
25069
|
+
try {
|
|
25070
|
+
const res = await fetch(
|
|
25071
|
+
`https://registry.npmjs.org/-/package/${encodeURIComponent(pkg)}/dist-tags`,
|
|
25072
|
+
{ signal: AbortSignal.timeout(5e3) }
|
|
25073
|
+
);
|
|
25074
|
+
if (!res.ok) return "latest";
|
|
25075
|
+
const data = await res.json();
|
|
25076
|
+
return data.latest ? `^${data.latest}` : "latest";
|
|
25077
|
+
} catch {
|
|
25078
|
+
return "latest";
|
|
25079
|
+
}
|
|
24883
25080
|
}
|
|
24884
|
-
async function
|
|
24885
|
-
|
|
24886
|
-
|
|
24887
|
-
|
|
24888
|
-
|
|
24889
|
-
|
|
24890
|
-
|
|
24891
|
-
|
|
24892
|
-
|
|
24893
|
-
|
|
24894
|
-
|
|
24895
|
-
|
|
24896
|
-
|
|
24897
|
-
|
|
24898
|
-
|
|
24899
|
-
|
|
24900
|
-
|
|
24901
|
-
|
|
24902
|
-
|
|
24903
|
-
|
|
24904
|
-
|
|
24905
|
-
}
|
|
24906
|
-
|
|
24907
|
-
|
|
24908
|
-
|
|
24909
|
-
|
|
24910
|
-
|
|
24911
|
-
|
|
24912
|
-
|
|
24913
|
-
|
|
24914
|
-
|
|
24915
|
-
|
|
24916
|
-
|
|
24917
|
-
|
|
24918
|
-
|
|
24919
|
-
|
|
24920
|
-
|
|
24921
|
-
|
|
24922
|
-
|
|
24923
|
-
|
|
24924
|
-
|
|
24925
|
-
|
|
25081
|
+
async function resolveNextlyVersions() {
|
|
25082
|
+
if (resolvedNextlyVersions) return resolvedNextlyVersions;
|
|
25083
|
+
const entries = await Promise.all(
|
|
25084
|
+
NEXTLY_PACKAGES.map(
|
|
25085
|
+
async (pkg) => [pkg, await fetchLatestVersion(pkg)]
|
|
25086
|
+
)
|
|
25087
|
+
);
|
|
25088
|
+
resolvedNextlyVersions = Object.fromEntries(entries);
|
|
25089
|
+
return resolvedNextlyVersions;
|
|
25090
|
+
}
|
|
25091
|
+
var resolvedRuntimeVersions = null;
|
|
25092
|
+
async function resolveRuntimeVersions() {
|
|
25093
|
+
if (resolvedRuntimeVersions) return resolvedRuntimeVersions;
|
|
25094
|
+
const FALLBACKS = {
|
|
25095
|
+
next: "^16.1.0",
|
|
25096
|
+
"eslint-config-next": "^16.1.0"
|
|
25097
|
+
};
|
|
25098
|
+
const entries = await Promise.all(
|
|
25099
|
+
RUNTIME_RESOLVED_PACKAGES.map(async (pkg) => {
|
|
25100
|
+
const version2 = await fetchLatestVersion(pkg);
|
|
25101
|
+
return [pkg, version2 === "latest" ? FALLBACKS[pkg] : version2];
|
|
25102
|
+
})
|
|
25103
|
+
);
|
|
25104
|
+
resolvedRuntimeVersions = Object.fromEntries(entries);
|
|
25105
|
+
return resolvedRuntimeVersions;
|
|
25106
|
+
}
|
|
25107
|
+
async function generatePackageJson(projectName, database, useYalc = false, projectType = "blank") {
|
|
25108
|
+
if (projectType === "plugin") {
|
|
25109
|
+
return generatePluginPackageJson(projectName, useYalc);
|
|
25110
|
+
}
|
|
25111
|
+
const runtimeVersions = await resolveRuntimeVersions();
|
|
25112
|
+
const dependencies = {
|
|
25113
|
+
next: runtimeVersions.next,
|
|
25114
|
+
react: PINNED_VERSIONS.react,
|
|
25115
|
+
"react-dom": PINNED_VERSIONS["react-dom"]
|
|
25116
|
+
};
|
|
25117
|
+
dependencies["@tanstack/react-query"] = "^5.62.0";
|
|
25118
|
+
if (!useYalc) {
|
|
25119
|
+
const versions = await resolveNextlyVersions();
|
|
25120
|
+
dependencies["nextly"] = versions["nextly"];
|
|
25121
|
+
dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
|
|
25122
|
+
dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";
|
|
25123
|
+
dependencies["@nextlyhq/adapter-drizzle"] = versions["@nextlyhq/adapter-drizzle"];
|
|
25124
|
+
dependencies[database.adapter] = versions[database.adapter] || "latest";
|
|
25125
|
+
if (projectUsesFormBuilder(projectType)) {
|
|
25126
|
+
dependencies["@nextlyhq/plugin-form-builder"] = versions["@nextlyhq/plugin-form-builder"] || "latest";
|
|
24926
25127
|
}
|
|
24927
25128
|
}
|
|
24928
|
-
|
|
24929
|
-
|
|
24930
|
-
|
|
24931
|
-
|
|
24932
|
-
|
|
24933
|
-
|
|
24934
|
-
|
|
24935
|
-
|
|
24936
|
-
|
|
24937
|
-
|
|
24938
|
-
|
|
24939
|
-
|
|
24940
|
-
|
|
24941
|
-
|
|
24942
|
-
|
|
24943
|
-
|
|
24944
|
-
|
|
24945
|
-
|
|
24946
|
-
|
|
24947
|
-
|
|
24948
|
-
|
|
24949
|
-
|
|
24950
|
-
|
|
24951
|
-
|
|
24952
|
-
|
|
24953
|
-
|
|
24954
|
-
|
|
25129
|
+
const devDependencies = {
|
|
25130
|
+
typescript: PINNED_VERSIONS.typescript,
|
|
25131
|
+
"@types/node": PINNED_VERSIONS["@types/node"],
|
|
25132
|
+
"@types/react": PINNED_VERSIONS["@types/react"],
|
|
25133
|
+
"@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
|
|
25134
|
+
"@tailwindcss/postcss": PINNED_VERSIONS["@tailwindcss/postcss"],
|
|
25135
|
+
tailwindcss: PINNED_VERSIONS.tailwindcss,
|
|
25136
|
+
eslint: PINNED_VERSIONS.eslint,
|
|
25137
|
+
"eslint-config-next": runtimeVersions["eslint-config-next"],
|
|
25138
|
+
// Pagefind powers /search in the blog template. Zero-config
|
|
25139
|
+
// static index generated at `next build` time. Templates that
|
|
25140
|
+
// don't ship a /search page simply won't invoke it.
|
|
25141
|
+
pagefind: "^1.1.0"
|
|
25142
|
+
};
|
|
25143
|
+
const pkg = {
|
|
25144
|
+
name: projectName,
|
|
25145
|
+
version: "0.1.0",
|
|
25146
|
+
private: true,
|
|
25147
|
+
scripts: {
|
|
25148
|
+
// F1 PR 4: dev now boots Nextly in single-process mode via `next dev`.
|
|
25149
|
+
// The lazy drizzle-kit/api import (PR 1) plus the in-process HMR
|
|
25150
|
+
// listener (PR 2) replaced the wrapper that previously owned the
|
|
25151
|
+
// terminal, schema prompts, and child supervision. `nextly dev` is
|
|
25152
|
+
// gone; the only supported dev command is the standard `next dev`.
|
|
25153
|
+
dev: "next dev --turbopack",
|
|
25154
|
+
// Build: migrate DB + compile Next.js + (if present) generate
|
|
25155
|
+
// the Pagefind search index. Templates without the search
|
|
25156
|
+
// script silently skip the last step.
|
|
25157
|
+
build: "nextly migrate && next build && (test -f scripts/build-search-index.mjs && node scripts/build-search-index.mjs || true)",
|
|
25158
|
+
"search:index": "node scripts/build-search-index.mjs",
|
|
25159
|
+
start: "next start",
|
|
25160
|
+
lint: "next lint",
|
|
25161
|
+
nextly: "nextly",
|
|
25162
|
+
// First-time setup: sync schema + seed system permissions. Demo
|
|
25163
|
+
// content is seeded separately from the admin UI (visit /welcome
|
|
25164
|
+
// after running `pnpm dev` and completing /admin/setup).
|
|
25165
|
+
"db:setup": "nextly db:sync",
|
|
25166
|
+
"db:migrate": "nextly migrate",
|
|
25167
|
+
"db:migrate:status": "nextly migrate:status",
|
|
25168
|
+
"db:migrate:fresh": "nextly migrate:fresh",
|
|
25169
|
+
"db:migrate:reset": "nextly migrate:reset",
|
|
25170
|
+
"types:generate": "nextly generate:types"
|
|
25171
|
+
},
|
|
25172
|
+
dependencies,
|
|
25173
|
+
devDependencies
|
|
25174
|
+
};
|
|
25175
|
+
return JSON.stringify(pkg, null, 2) + "\n";
|
|
25176
|
+
}
|
|
25177
|
+
async function resolvePluginNextlyRange(useYalc) {
|
|
25178
|
+
if (useYalc) return ">=0.0.0";
|
|
25179
|
+
const versions = await resolveNextlyVersions();
|
|
25180
|
+
const v2 = versions["nextly"];
|
|
25181
|
+
return v2 && v2 !== "latest" ? v2 : ">=0.0.0";
|
|
25182
|
+
}
|
|
25183
|
+
async function generatePluginPackageJson(projectName, useYalc) {
|
|
25184
|
+
const versions = useYalc ? {} : await resolveNextlyVersions();
|
|
25185
|
+
const runtimeVersions = await resolveRuntimeVersions();
|
|
25186
|
+
const range = (pkg2) => versions[pkg2] ?? "latest";
|
|
25187
|
+
const peerDependencies = {
|
|
25188
|
+
nextly: range("nextly"),
|
|
25189
|
+
"@nextlyhq/admin": range("@nextlyhq/admin"),
|
|
25190
|
+
"@nextlyhq/plugin-sdk": range("@nextlyhq/plugin-sdk"),
|
|
25191
|
+
react: PINNED_VERSIONS.react,
|
|
25192
|
+
"react-dom": PINNED_VERSIONS["react-dom"]
|
|
25193
|
+
};
|
|
25194
|
+
const devDependencies = {
|
|
25195
|
+
nextly: range("nextly"),
|
|
25196
|
+
"@nextlyhq/admin": range("@nextlyhq/admin"),
|
|
25197
|
+
"@nextlyhq/ui": range("@nextlyhq/ui"),
|
|
25198
|
+
"@nextlyhq/plugin-sdk": range("@nextlyhq/plugin-sdk"),
|
|
25199
|
+
"@nextlyhq/adapter-drizzle": range("@nextlyhq/adapter-drizzle"),
|
|
25200
|
+
"@nextlyhq/adapter-sqlite": range("@nextlyhq/adapter-sqlite"),
|
|
25201
|
+
next: runtimeVersions.next,
|
|
25202
|
+
react: PINNED_VERSIONS.react,
|
|
25203
|
+
"react-dom": PINNED_VERSIONS["react-dom"],
|
|
25204
|
+
"better-sqlite3": "^12.0.0",
|
|
25205
|
+
"@types/node": PINNED_VERSIONS["@types/node"],
|
|
25206
|
+
"@types/react": PINNED_VERSIONS["@types/react"],
|
|
25207
|
+
"@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
|
|
25208
|
+
typescript: PINNED_VERSIONS.typescript,
|
|
25209
|
+
tsup: "^8.5.0",
|
|
25210
|
+
vitest: "^4.0.8",
|
|
25211
|
+
eslint: PINNED_VERSIONS.eslint,
|
|
25212
|
+
"@eslint/js": PINNED_VERSIONS.eslint,
|
|
25213
|
+
"typescript-eslint": "^8.0.0"
|
|
25214
|
+
};
|
|
25215
|
+
const pkg = {
|
|
25216
|
+
name: projectName,
|
|
25217
|
+
version: "0.1.0",
|
|
25218
|
+
description: "A Nextly plugin.",
|
|
25219
|
+
type: "module",
|
|
25220
|
+
main: "./dist/index.mjs",
|
|
25221
|
+
module: "./dist/index.mjs",
|
|
25222
|
+
types: "./dist/index.d.ts",
|
|
25223
|
+
exports: {
|
|
25224
|
+
".": {
|
|
25225
|
+
types: "./dist/index.d.ts",
|
|
25226
|
+
import: "./dist/index.mjs"
|
|
25227
|
+
},
|
|
25228
|
+
"./admin": {
|
|
25229
|
+
types: "./dist/admin/index.d.ts",
|
|
25230
|
+
import: "./dist/admin/index.mjs"
|
|
25231
|
+
}
|
|
25232
|
+
},
|
|
25233
|
+
// Only the built library ships. The dev/ playground is never published.
|
|
25234
|
+
files: ["dist"],
|
|
25235
|
+
keywords: ["nextly", "nextly-plugin"],
|
|
25236
|
+
scripts: {
|
|
25237
|
+
build: "tsup",
|
|
25238
|
+
// Runs the embedded playground (next dev with dev/ as the project root).
|
|
25239
|
+
dev: "next dev dev --turbopack",
|
|
25240
|
+
"check-types": "tsc --noEmit",
|
|
25241
|
+
lint: "eslint .",
|
|
25242
|
+
test: "vitest run",
|
|
25243
|
+
"types:generate": "nextly generate:types"
|
|
25244
|
+
},
|
|
25245
|
+
peerDependencies,
|
|
25246
|
+
devDependencies
|
|
25247
|
+
// Native build-script allowlist is NOT emitted here: pnpm 11 ignores the
|
|
25248
|
+
// package.json `pnpm` field. It lives in pnpm-workspace.yaml instead (written
|
|
25249
|
+
// by copyPluginTemplate via generatePnpmWorkspaceYaml).
|
|
25250
|
+
};
|
|
25251
|
+
return JSON.stringify(pkg, null, 2) + "\n";
|
|
25252
|
+
}
|
|
25253
|
+
var NATIVE_BUILD_DEPENDENCIES = [
|
|
25254
|
+
"better-sqlite3",
|
|
25255
|
+
"esbuild",
|
|
25256
|
+
"sharp",
|
|
25257
|
+
"unrs-resolver"
|
|
25258
|
+
];
|
|
25259
|
+
function generatePnpmWorkspaceYaml() {
|
|
25260
|
+
const allowBuilds = NATIVE_BUILD_DEPENDENCIES.map(
|
|
25261
|
+
(dep) => ` ${dep}: true`
|
|
25262
|
+
).join("\n");
|
|
25263
|
+
const onlyBuilt = NATIVE_BUILD_DEPENDENCIES.map((dep) => ` - ${dep}`).join(
|
|
25264
|
+
"\n"
|
|
25265
|
+
);
|
|
25266
|
+
return `# Allow native dependencies to run their build scripts. pnpm 10+ blocks
|
|
25267
|
+
# dependency build scripts by default; without this better-sqlite3 has no
|
|
25268
|
+
# compiled binding (sqlite apps crash at boot) and sharp/esbuild degrade.
|
|
25269
|
+
#
|
|
25270
|
+
# pnpm 11+ reads \`allowBuilds\`; pnpm 10.6+ reads \`onlyBuiltDependencies\`.
|
|
25271
|
+
# npm, yarn, and pnpm 9 ignore this file (they run build scripts by default).
|
|
25272
|
+
allowBuilds:
|
|
25273
|
+
${allowBuilds}
|
|
25274
|
+
onlyBuiltDependencies:
|
|
25275
|
+
${onlyBuilt}
|
|
25276
|
+
`;
|
|
25277
|
+
}
|
|
25278
|
+
async function copyTemplate(options) {
|
|
25279
|
+
const {
|
|
25280
|
+
projectName,
|
|
25281
|
+
projectType,
|
|
25282
|
+
targetDir,
|
|
25283
|
+
database,
|
|
25284
|
+
databaseUrl,
|
|
25285
|
+
useYalc = false,
|
|
25286
|
+
approach,
|
|
25287
|
+
templateSource,
|
|
25288
|
+
allowExistingTarget = false
|
|
25289
|
+
} = options;
|
|
25290
|
+
if (!allowExistingTarget && targetDir !== process.cwd() && await import_fs_extra8.default.pathExists(targetDir)) {
|
|
25291
|
+
throw new Error(
|
|
25292
|
+
`Directory "${path15.basename(targetDir)}" already exists. Please choose a different name.`
|
|
25293
|
+
);
|
|
25294
|
+
}
|
|
25295
|
+
let baseDir;
|
|
25296
|
+
let typeDir;
|
|
25297
|
+
if (templateSource) {
|
|
25298
|
+
baseDir = templateSource.basePath;
|
|
25299
|
+
typeDir = templateSource.templatePath;
|
|
25300
|
+
} else {
|
|
25301
|
+
const templatesRoot = resolveTemplatePath();
|
|
25302
|
+
baseDir = path15.join(templatesRoot, "base");
|
|
25303
|
+
typeDir = path15.join(templatesRoot, projectType);
|
|
25304
|
+
}
|
|
25305
|
+
if (projectType === "plugin") {
|
|
25306
|
+
await copyPluginTemplate({ projectName, typeDir, targetDir, useYalc });
|
|
25307
|
+
return;
|
|
25308
|
+
}
|
|
25309
|
+
if (!await import_fs_extra8.default.pathExists(baseDir)) {
|
|
25310
|
+
throw new Error(
|
|
25311
|
+
`Base template not found at ${baseDir}. The package may be corrupted or the download failed.`
|
|
25312
|
+
);
|
|
25313
|
+
}
|
|
25314
|
+
if (!await import_fs_extra8.default.pathExists(typeDir)) {
|
|
25315
|
+
throw new Error(
|
|
25316
|
+
`Template "${projectType}" not found at ${typeDir}. Available templates: blank, blog.`
|
|
25317
|
+
);
|
|
25318
|
+
}
|
|
25319
|
+
await import_fs_extra8.default.copy(baseDir, targetDir, {
|
|
25320
|
+
filter: (_src) => {
|
|
25321
|
+
const basename = path15.basename(_src);
|
|
25322
|
+
return !SKIP_FILES.has(basename);
|
|
25323
|
+
}
|
|
25324
|
+
});
|
|
25325
|
+
const templateSrcDir = path15.join(typeDir, "src");
|
|
25326
|
+
if (await import_fs_extra8.default.pathExists(templateSrcDir)) {
|
|
25327
|
+
await import_fs_extra8.default.copy(templateSrcDir, path15.join(targetDir, "src"), {
|
|
25328
|
+
overwrite: true,
|
|
25329
|
+
filter: (_src) => {
|
|
25330
|
+
const basename = path15.basename(_src);
|
|
25331
|
+
return !SKIP_FILES.has(basename);
|
|
25332
|
+
}
|
|
25333
|
+
});
|
|
25334
|
+
}
|
|
25335
|
+
const templateRootConfig = path15.join(typeDir, "nextly.config.ts");
|
|
25336
|
+
if (await import_fs_extra8.default.pathExists(templateRootConfig)) {
|
|
25337
|
+
await import_fs_extra8.default.copy(
|
|
25338
|
+
templateRootConfig,
|
|
25339
|
+
path15.join(targetDir, "nextly.config.ts"),
|
|
25340
|
+
{ overwrite: true }
|
|
25341
|
+
);
|
|
25342
|
+
}
|
|
25343
|
+
const configsDir = path15.join(typeDir, "configs");
|
|
25344
|
+
if (approach && await import_fs_extra8.default.pathExists(configsDir)) {
|
|
25345
|
+
const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
|
|
25346
|
+
const configSrc = path15.join(configsDir, configFileName);
|
|
25347
|
+
if (await import_fs_extra8.default.pathExists(configSrc)) {
|
|
25348
|
+
await import_fs_extra8.default.copy(configSrc, path15.join(targetDir, "nextly.config.ts"), {
|
|
25349
|
+
overwrite: true
|
|
25350
|
+
});
|
|
25351
|
+
}
|
|
25352
|
+
const sharedSrc = path15.join(configsDir, "shared.ts");
|
|
25353
|
+
if (await import_fs_extra8.default.pathExists(sharedSrc)) {
|
|
25354
|
+
await import_fs_extra8.default.copy(sharedSrc, path15.join(targetDir, "shared.ts"), {
|
|
25355
|
+
overwrite: true
|
|
25356
|
+
});
|
|
25357
|
+
}
|
|
25358
|
+
}
|
|
25359
|
+
const frontendPagePath = path15.join(
|
|
25360
|
+
targetDir,
|
|
25361
|
+
"src",
|
|
25362
|
+
"app",
|
|
25363
|
+
"(frontend)",
|
|
25364
|
+
"page.tsx"
|
|
25365
|
+
);
|
|
25366
|
+
const basePagePath = path15.join(targetDir, "src", "app", "page.tsx");
|
|
25367
|
+
if (await import_fs_extra8.default.pathExists(frontendPagePath) && await import_fs_extra8.default.pathExists(basePagePath)) {
|
|
25368
|
+
await import_fs_extra8.default.remove(basePagePath);
|
|
25369
|
+
}
|
|
25370
|
+
const packageJsonContent = await generatePackageJson(
|
|
25371
|
+
projectName,
|
|
25372
|
+
database,
|
|
25373
|
+
useYalc,
|
|
25374
|
+
projectType
|
|
25375
|
+
);
|
|
25376
|
+
await import_fs_extra8.default.writeFile(
|
|
25377
|
+
path15.join(targetDir, "package.json"),
|
|
25378
|
+
packageJsonContent,
|
|
25379
|
+
"utf-8"
|
|
25380
|
+
);
|
|
25381
|
+
await import_fs_extra8.default.writeFile(
|
|
25382
|
+
path15.join(targetDir, "pnpm-workspace.yaml"),
|
|
25383
|
+
generatePnpmWorkspaceYaml(),
|
|
25384
|
+
"utf-8"
|
|
25385
|
+
);
|
|
25386
|
+
if (database.type === "sqlite") {
|
|
25387
|
+
await import_fs_extra8.default.ensureDir(path15.join(targetDir, "data"));
|
|
25388
|
+
}
|
|
25389
|
+
await import_fs_extra8.default.writeFile(
|
|
25390
|
+
path15.join(targetDir, "next.config.ts"),
|
|
25391
|
+
buildNextConfigTemplate(database),
|
|
25392
|
+
"utf-8"
|
|
25393
|
+
);
|
|
25394
|
+
const placeholders = buildPlaceholderMap({ database, databaseUrl });
|
|
25395
|
+
if (approach) {
|
|
25396
|
+
placeholders["{{approach}}"] = approach;
|
|
25397
|
+
}
|
|
25398
|
+
await replacePlaceholders(targetDir, placeholders);
|
|
25399
|
+
}
|
|
25400
|
+
async function copyPluginTemplate(opts) {
|
|
25401
|
+
const { projectName, typeDir, targetDir, useYalc } = opts;
|
|
25402
|
+
if (!await import_fs_extra8.default.pathExists(typeDir)) {
|
|
25403
|
+
throw new Error(
|
|
25404
|
+
`Plugin template not found at ${typeDir}. The package may be corrupted or the download failed.`
|
|
25405
|
+
);
|
|
25406
|
+
}
|
|
25407
|
+
await import_fs_extra8.default.copy(typeDir, targetDir, {
|
|
25408
|
+
overwrite: true,
|
|
25409
|
+
filter: (src) => {
|
|
25410
|
+
const basename = path15.basename(src);
|
|
25411
|
+
return !SKIP_FILES.has(basename) && basename !== "template.json";
|
|
25412
|
+
}
|
|
25413
|
+
});
|
|
25414
|
+
const packageJsonContent = await generatePackageJson(
|
|
25415
|
+
projectName,
|
|
25416
|
+
{ },
|
|
25417
|
+
useYalc,
|
|
25418
|
+
"plugin"
|
|
25419
|
+
);
|
|
25420
|
+
await import_fs_extra8.default.writeFile(
|
|
25421
|
+
path15.join(targetDir, "package.json"),
|
|
25422
|
+
packageJsonContent,
|
|
25423
|
+
"utf-8"
|
|
25424
|
+
);
|
|
25425
|
+
await import_fs_extra8.default.writeFile(
|
|
25426
|
+
path15.join(targetDir, "pnpm-workspace.yaml"),
|
|
25427
|
+
generatePnpmWorkspaceYaml(),
|
|
25428
|
+
"utf-8"
|
|
25429
|
+
);
|
|
25430
|
+
const nextlyRange = await resolvePluginNextlyRange(useYalc);
|
|
25431
|
+
await replacePlaceholders(
|
|
25432
|
+
targetDir,
|
|
25433
|
+
buildPlaceholderMap({ pluginName: projectName, nextlyRange })
|
|
25434
|
+
);
|
|
25435
|
+
}
|
|
25436
|
+
|
|
25437
|
+
// src/installers/dependencies.ts
|
|
25438
|
+
var INSTALL_COMMANDS = {
|
|
25439
|
+
npm: ["npm", "install"],
|
|
25440
|
+
yarn: ["yarn", "add"],
|
|
25441
|
+
pnpm: ["pnpm", "add"],
|
|
25442
|
+
bun: ["bun", "add"]
|
|
25443
|
+
};
|
|
25444
|
+
var CORE_PACKAGES = [
|
|
25445
|
+
"nextly",
|
|
25446
|
+
"@nextlyhq/admin",
|
|
25447
|
+
"@nextlyhq/adapter-drizzle",
|
|
25448
|
+
"@nextlyhq/ui",
|
|
25449
|
+
"@tanstack/react-query"
|
|
25450
|
+
];
|
|
25451
|
+
var ALL_ADAPTER_PACKAGES = [
|
|
25452
|
+
"@nextlyhq/adapter-postgres",
|
|
25453
|
+
"@nextlyhq/adapter-mysql",
|
|
25454
|
+
"@nextlyhq/adapter-sqlite"
|
|
25455
|
+
];
|
|
25456
|
+
var TEMPLATE_PLUGIN_PACKAGES = ["@nextlyhq/plugin-form-builder"];
|
|
25457
|
+
function templatePluginPackages(projectType) {
|
|
25458
|
+
return projectType && projectUsesFormBuilder(projectType) ? TEMPLATE_PLUGIN_PACKAGES : [];
|
|
25459
|
+
}
|
|
25460
|
+
function getPackagesToInstall(database) {
|
|
25461
|
+
return [...CORE_PACKAGES, database.adapter];
|
|
25462
|
+
}
|
|
25463
|
+
async function installDependencies(cwd, projectInfo, database, useYalc = false, isFreshProject = false, projectType) {
|
|
25464
|
+
const pm = projectInfo.packageManager;
|
|
25465
|
+
const pluginPackages = templatePluginPackages(projectType);
|
|
25466
|
+
if (isFreshProject) {
|
|
25467
|
+
if (useYalc) {
|
|
25468
|
+
const yalcPackages = [
|
|
25469
|
+
.../* @__PURE__ */ new Set([
|
|
25470
|
+
"nextly",
|
|
25471
|
+
"@nextlyhq/admin",
|
|
25472
|
+
"@nextlyhq/ui",
|
|
25473
|
+
"@nextlyhq/adapter-drizzle",
|
|
25474
|
+
...ALL_ADAPTER_PACKAGES,
|
|
25475
|
+
...pluginPackages
|
|
25476
|
+
])
|
|
25477
|
+
];
|
|
25478
|
+
await execa(pm, ["install"], { cwd });
|
|
25479
|
+
for (const pkg of yalcPackages) {
|
|
25480
|
+
await execa("yalc", ["add", pkg], { cwd });
|
|
25481
|
+
}
|
|
25482
|
+
await execa(pm, ["install"], { cwd });
|
|
25483
|
+
} else {
|
|
25484
|
+
await execa(pm, ["install"], { cwd });
|
|
25485
|
+
}
|
|
25486
|
+
} else {
|
|
25487
|
+
const allPackages = getPackagesToInstall(database);
|
|
25488
|
+
if (useYalc) {
|
|
25489
|
+
const yalcPackages = [
|
|
25490
|
+
.../* @__PURE__ */ new Set([
|
|
25491
|
+
"nextly",
|
|
25492
|
+
"@nextlyhq/admin",
|
|
25493
|
+
"@nextlyhq/ui",
|
|
25494
|
+
"@nextlyhq/adapter-drizzle",
|
|
25495
|
+
...ALL_ADAPTER_PACKAGES,
|
|
25496
|
+
...pluginPackages
|
|
25497
|
+
])
|
|
25498
|
+
];
|
|
25499
|
+
for (const pkg of yalcPackages) {
|
|
25500
|
+
await execa("yalc", ["add", pkg], { cwd });
|
|
25501
|
+
}
|
|
25502
|
+
await execa(pm, ["install"], { cwd });
|
|
25503
|
+
} else {
|
|
25504
|
+
const [cmd, ...args] = INSTALL_COMMANDS[pm];
|
|
25505
|
+
await execa(cmd, [...args, ...allPackages], { cwd });
|
|
25506
|
+
}
|
|
25507
|
+
}
|
|
25508
|
+
}
|
|
25509
|
+
|
|
25510
|
+
// src/lib/download-template.ts
|
|
25511
|
+
var import_fs_extra9 = __toESM(require_lib(), 1);
|
|
25512
|
+
var kr = Object.defineProperty;
|
|
25513
|
+
var vr = (s3, t2) => {
|
|
25514
|
+
for (var e in t2) kr(s3, e, { get: t2[e], enumerable: true });
|
|
25515
|
+
};
|
|
25516
|
+
var Os = typeof process == "object" && process ? process : { stdout: null, stderr: null };
|
|
25517
|
+
var Br = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof D3 || s3 instanceof Ns || Pr(s3) || zr(s3));
|
|
25518
|
+
var Pr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof EventEmitter && typeof s3.pipe == "function" && s3.pipe !== Ns.Writable.prototype.pipe;
|
|
25519
|
+
var zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
|
|
25520
|
+
var q3 = Symbol("EOF");
|
|
25521
|
+
var j2 = Symbol("maybeEmitEnd");
|
|
25522
|
+
var rt2 = Symbol("emittedEnd");
|
|
25523
|
+
var Le2 = Symbol("emittingEnd");
|
|
25524
|
+
var jt2 = Symbol("emittedError");
|
|
25525
|
+
var Ne2 = Symbol("closed");
|
|
25526
|
+
var Ts = Symbol("read");
|
|
25527
|
+
var Ae2 = Symbol("flush");
|
|
25528
|
+
var xs = Symbol("flushChunk");
|
|
25529
|
+
var z3 = Symbol("encoding");
|
|
25530
|
+
var Mt2 = Symbol("decoder");
|
|
25531
|
+
var b = Symbol("flowing");
|
|
25532
|
+
var Qt = Symbol("paused");
|
|
25533
|
+
var Bt2 = Symbol("resume");
|
|
25534
|
+
var _2 = Symbol("buffer");
|
|
24955
25535
|
var A = Symbol("pipes");
|
|
24956
25536
|
var g = Symbol("bufferLength");
|
|
24957
25537
|
var yi = Symbol("bufferPush");
|
|
@@ -26358,7 +26938,7 @@ var de2 = class extends D3 {
|
|
|
26358
26938
|
let [o2, h3] = ce2(this.path);
|
|
26359
26939
|
o2 && typeof h3 == "string" && (this.path = h3, r = o2);
|
|
26360
26940
|
}
|
|
26361
|
-
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 ||
|
|
26941
|
+
this.win32 = !!i2.win32 || process.platform === "win32", this.win32 && (this.path = Ks(this.path.replaceAll(/\\/g, "/")), t2 = t2.replaceAll(/\\/g, "/")), this.absolute = f(i2.absolute || path15.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 });
|
|
26362
26942
|
let n2 = this.statCache.get(this.absolute);
|
|
26363
26943
|
n2 ? this[ei](n2) : this[Qi]();
|
|
26364
26944
|
}
|
|
@@ -26417,7 +26997,7 @@ var de2 = class extends D3 {
|
|
|
26417
26997
|
}
|
|
26418
26998
|
[Qs](t2) {
|
|
26419
26999
|
if (!this.stat) throw new Error("cannot create link entry without stat");
|
|
26420
|
-
this.type = "Link", this.linkpath = f(
|
|
27000
|
+
this.type = "Link", this.linkpath = f(path15.relative(this.cwd, t2)), this.stat.size = 0, this[fe2](), this.end();
|
|
26421
27001
|
}
|
|
26422
27002
|
[qs]() {
|
|
26423
27003
|
if (!this.stat) throw new Error("cannot create file entry without stat");
|
|
@@ -26828,7 +27408,7 @@ var Et3 = class extends D3 {
|
|
|
26828
27408
|
return t2 instanceof Yt ? this[er](t2) : this[hi](t2), this.flowing;
|
|
26829
27409
|
}
|
|
26830
27410
|
[er](t2) {
|
|
26831
|
-
let e = f(
|
|
27411
|
+
let e = f(path15.resolve(this.cwd, t2.path));
|
|
26832
27412
|
if (!this.filter(t2.path, t2)) t2.resume();
|
|
26833
27413
|
else {
|
|
26834
27414
|
let i2 = new di(t2.path, e);
|
|
@@ -26837,7 +27417,7 @@ var Et3 = class extends D3 {
|
|
|
26837
27417
|
this[Ft3]();
|
|
26838
27418
|
}
|
|
26839
27419
|
[hi](t2) {
|
|
26840
|
-
let e = f(
|
|
27420
|
+
let e = f(path15.resolve(this.cwd, t2));
|
|
26841
27421
|
this[W3].push(new di(t2, e)), this[Ft3]();
|
|
26842
27422
|
}
|
|
26843
27423
|
[as](t2) {
|
|
@@ -26975,11 +27555,11 @@ var Hn = (s3, t2) => {
|
|
|
26975
27555
|
};
|
|
26976
27556
|
var or = (s3, t2) => {
|
|
26977
27557
|
t2.forEach((e) => {
|
|
26978
|
-
e.charAt(0) === "@" ? It3({ file:
|
|
27558
|
+
e.charAt(0) === "@" ? It3({ file: path15.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
|
|
26979
27559
|
}), s3.end();
|
|
26980
27560
|
};
|
|
26981
27561
|
var hr = async (s3, t2) => {
|
|
26982
|
-
for (let e of t2) e.charAt(0) === "@" ? await It3({ file:
|
|
27562
|
+
for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path15.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => {
|
|
26983
27563
|
s3.add(i2);
|
|
26984
27564
|
} }) : s3.add(e);
|
|
26985
27565
|
s3.end();
|
|
@@ -27004,7 +27584,7 @@ var Vn = 512 * 1024;
|
|
|
27004
27584
|
var $n = pr | ur | dr | mr;
|
|
27005
27585
|
var lr = !fr && typeof ar == "number" ? ar | ur | dr | mr : null;
|
|
27006
27586
|
var cs = lr !== null ? () => lr : Kn ? (s3) => s3 < Vn ? $n : "w" : () => "w";
|
|
27007
|
-
var
|
|
27587
|
+
var fs10 = (s3, t2, e) => {
|
|
27008
27588
|
try {
|
|
27009
27589
|
return fs.lchownSync(s3, t2, e);
|
|
27010
27590
|
} catch (i2) {
|
|
@@ -27017,13 +27597,13 @@ var ui = (s3, t2, e, i2) => {
|
|
|
27017
27597
|
});
|
|
27018
27598
|
};
|
|
27019
27599
|
var Xn = (s3, t2, e, i2, r) => {
|
|
27020
|
-
if (t2.isDirectory()) ds(
|
|
27600
|
+
if (t2.isDirectory()) ds(path15.resolve(s3, t2.name), e, i2, (n2) => {
|
|
27021
27601
|
if (n2) return r(n2);
|
|
27022
|
-
let o2 =
|
|
27602
|
+
let o2 = path15.resolve(s3, t2.name);
|
|
27023
27603
|
ui(o2, e, i2, r);
|
|
27024
27604
|
});
|
|
27025
27605
|
else {
|
|
27026
|
-
let n2 =
|
|
27606
|
+
let n2 = path15.resolve(s3, t2.name);
|
|
27027
27607
|
ui(n2, e, i2, r);
|
|
27028
27608
|
}
|
|
27029
27609
|
};
|
|
@@ -27044,7 +27624,7 @@ var ds = (s3, t2, e, i2) => {
|
|
|
27044
27624
|
});
|
|
27045
27625
|
};
|
|
27046
27626
|
var qn = (s3, t2, e, i2) => {
|
|
27047
|
-
t2.isDirectory() && us(
|
|
27627
|
+
t2.isDirectory() && us(path15.resolve(s3, t2.name), e, i2), fs10(path15.resolve(s3, t2.name), e, i2);
|
|
27048
27628
|
};
|
|
27049
27629
|
var us = (s3, t2, e) => {
|
|
27050
27630
|
let i2;
|
|
@@ -27053,11 +27633,11 @@ var us = (s3, t2, e) => {
|
|
|
27053
27633
|
} catch (r) {
|
|
27054
27634
|
let n2 = r;
|
|
27055
27635
|
if (n2?.code === "ENOENT") return;
|
|
27056
|
-
if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return
|
|
27636
|
+
if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return fs10(s3, t2, e);
|
|
27057
27637
|
throw n2;
|
|
27058
27638
|
}
|
|
27059
27639
|
for (let r of i2) qn(s3, r, t2, e);
|
|
27060
|
-
return
|
|
27640
|
+
return fs10(s3, t2, e);
|
|
27061
27641
|
};
|
|
27062
27642
|
var we2 = class extends Error {
|
|
27063
27643
|
path;
|
|
@@ -27094,12 +27674,12 @@ var Er = (s3, t2, e) => {
|
|
|
27094
27674
|
};
|
|
27095
27675
|
if (s3 === d) return Qn(s3, S2);
|
|
27096
27676
|
if (l) return jn.mkdir(s3, { mode: r, recursive: true }).then((E) => S2(null, E ?? void 0), S2);
|
|
27097
|
-
let N3 = f(
|
|
27677
|
+
let N3 = f(path15.relative(d, s3)).split("/");
|
|
27098
27678
|
ms(d, N3, r, c3, d, void 0, S2);
|
|
27099
27679
|
};
|
|
27100
27680
|
var ms = (s3, t2, e, i2, r, n2, o2) => {
|
|
27101
27681
|
if (t2.length === 0) return o2(null, n2);
|
|
27102
|
-
let h3 = t2.shift(), a2 = f(
|
|
27682
|
+
let h3 = t2.shift(), a2 = f(path15.resolve(s3 + "/" + h3));
|
|
27103
27683
|
fs.mkdir(a2, e, wr(a2, t2, e, i2, r, n2, o2));
|
|
27104
27684
|
};
|
|
27105
27685
|
var wr = (s3, t2, e, i2, r, n2, o2) => (h3) => {
|
|
@@ -27133,9 +27713,9 @@ var Sr = (s3, t2) => {
|
|
|
27133
27713
|
};
|
|
27134
27714
|
if (s3 === c3) return Jn(c3), d();
|
|
27135
27715
|
if (a2) return d(fs.mkdirSync(s3, { mode: i2, recursive: true }) ?? void 0);
|
|
27136
|
-
let T2 = f(
|
|
27716
|
+
let T2 = f(path15.relative(c3, s3)).split("/"), N3;
|
|
27137
27717
|
for (let E = T2.shift(), x3 = c3; E && (x3 += "/" + E); E = T2.shift()) {
|
|
27138
|
-
x3 = f(
|
|
27718
|
+
x3 = f(path15.resolve(x3));
|
|
27139
27719
|
try {
|
|
27140
27720
|
fs.mkdirSync(x3, i2), N3 = N3 || x3;
|
|
27141
27721
|
} catch {
|
|
@@ -27311,7 +27891,7 @@ var qt = class extends st2 {
|
|
|
27311
27891
|
if (t2.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
|
|
27312
27892
|
this.uid = t2.uid, this.gid = t2.gid, this.setOwner = true;
|
|
27313
27893
|
} else this.uid = void 0, this.gid = void 0, this.setOwner = false;
|
|
27314
|
-
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(
|
|
27894
|
+
this.preserveOwner = t2.preserveOwner === void 0 && typeof t2.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t2.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t2.maxDepth == "number" ? t2.maxDepth : no, this.forceChown = t2.forceChown === true, this.win32 = !!t2.win32 || Oe2, this.newer = !!t2.newer, this.keep = !!t2.keep, this.noMtime = !!t2.noMtime, this.preservePaths = !!t2.preservePaths, this.unlink = !!t2.unlink, this.cwd = f(path15.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));
|
|
27315
27895
|
}
|
|
27316
27896
|
warn(t2, e, i2 = {}) {
|
|
27317
27897
|
return (t2 === "TAR_BAD_ARCHIVE" || t2 === "TAR_ABORT") && (i2.recoverable = false), super.warn(t2, e, i2);
|
|
@@ -27325,7 +27905,7 @@ var qt = class extends st2 {
|
|
|
27325
27905
|
let [n2, o2] = ce2(i2), h3 = o2.replaceAll(/\\/g, "/").split("/");
|
|
27326
27906
|
if (h3.includes("..") || Oe2 && /^[a-z]:\.\.$/i.test(h3[0] ?? "")) {
|
|
27327
27907
|
if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t2, [e]: i2 }), false;
|
|
27328
|
-
let a2 =
|
|
27908
|
+
let a2 = path15.posix.dirname(t2.path), l = path15.posix.normalize(path15.posix.join(a2, h3.join("/")));
|
|
27329
27909
|
if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t2, [e]: i2 }), false;
|
|
27330
27910
|
}
|
|
27331
27911
|
return n2 && (t2[e] = String(o2), this.warn("TAR_ENTRY_INFO", `stripping ${n2} from absolute ${e}`, { entry: t2, [e]: i2 })), true;
|
|
@@ -27343,12 +27923,12 @@ var qt = class extends st2 {
|
|
|
27343
27923
|
}
|
|
27344
27924
|
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;
|
|
27345
27925
|
if (!this[Es](t2, "path") || !this[Es](t2, "linkpath")) return false;
|
|
27346
|
-
if (t2.absolute =
|
|
27926
|
+
if (t2.absolute = path15.isAbsolute(t2.path) ? f(path15.resolve(t2.path)) : f(path15.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;
|
|
27347
27927
|
if (t2.absolute === this.cwd && t2.type !== "Directory" && t2.type !== "GNUDumpDir") return false;
|
|
27348
27928
|
if (this.win32) {
|
|
27349
|
-
let { root: r } =
|
|
27929
|
+
let { root: r } = path15.win32.parse(String(t2.absolute));
|
|
27350
27930
|
t2.absolute = r + Xi(String(t2.absolute).slice(r.length));
|
|
27351
|
-
let { root: n2 } =
|
|
27931
|
+
let { root: n2 } = path15.win32.parse(t2.path);
|
|
27352
27932
|
t2.path = n2 + Xi(t2.path.slice(n2.length));
|
|
27353
27933
|
}
|
|
27354
27934
|
return true;
|
|
@@ -27436,13 +28016,13 @@ var qt = class extends st2 {
|
|
|
27436
28016
|
t2.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t2.type}`, { entry: t2 }), t2.resume();
|
|
27437
28017
|
}
|
|
27438
28018
|
[Tr](t2, e) {
|
|
27439
|
-
let i2 = f(
|
|
28019
|
+
let i2 = f(path15.relative(this.cwd, path15.resolve(path15.dirname(String(t2.absolute)), String(t2.linkpath)))).split("/");
|
|
27440
28020
|
this[ye2](t2, this.cwd, i2, () => this[Si](t2, String(t2.linkpath), "symlink", e), (r) => {
|
|
27441
28021
|
this[O2](r, t2), e();
|
|
27442
28022
|
});
|
|
27443
28023
|
}
|
|
27444
28024
|
[xr](t2, e) {
|
|
27445
|
-
let i2 = f(
|
|
28025
|
+
let i2 = f(path15.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
|
|
27446
28026
|
this[ye2](t2, this.cwd, r, () => this[Si](t2, i2, "link", e), (n2) => {
|
|
27447
28027
|
this[O2](n2, t2), e();
|
|
27448
28028
|
});
|
|
@@ -27450,10 +28030,10 @@ var qt = class extends st2 {
|
|
|
27450
28030
|
[ye2](t2, e, i2, r, n2) {
|
|
27451
28031
|
let o2 = i2.shift();
|
|
27452
28032
|
if (this.preservePaths || o2 === void 0) return r();
|
|
27453
|
-
let h3 =
|
|
28033
|
+
let h3 = path15.resolve(e, o2);
|
|
27454
28034
|
fs.lstat(h3, (a2, l) => {
|
|
27455
28035
|
if (a2) return r();
|
|
27456
|
-
if (l?.isSymbolicLink()) return n2(new wt2(h3,
|
|
28036
|
+
if (l?.isSymbolicLink()) return n2(new wt2(h3, path15.resolve(h3, i2.join("/"))));
|
|
27457
28037
|
this[ye2](t2, h3, i2, r, n2);
|
|
27458
28038
|
});
|
|
27459
28039
|
}
|
|
@@ -27487,7 +28067,7 @@ var qt = class extends st2 {
|
|
|
27487
28067
|
});
|
|
27488
28068
|
}, n2 = () => {
|
|
27489
28069
|
if (t2.absolute !== this.cwd) {
|
|
27490
|
-
let h3 = f(
|
|
28070
|
+
let h3 = f(path15.dirname(String(t2.absolute)));
|
|
27491
28071
|
if (h3 !== this.cwd) return this[St2](h3, this.dmode, (a2) => {
|
|
27492
28072
|
if (a2) {
|
|
27493
28073
|
this[O2](a2, t2), i2();
|
|
@@ -27562,7 +28142,7 @@ var Te2 = class extends qt {
|
|
|
27562
28142
|
this[ge2] = true;
|
|
27563
28143
|
}
|
|
27564
28144
|
if (t2.absolute !== this.cwd) {
|
|
27565
|
-
let n2 = f(
|
|
28145
|
+
let n2 = f(path15.dirname(String(t2.absolute)));
|
|
27566
28146
|
if (n2 !== this.cwd) {
|
|
27567
28147
|
let o2 = this[St2](n2, this.dmode);
|
|
27568
28148
|
if (o2) return this[O2](o2, t2);
|
|
@@ -27662,10 +28242,10 @@ var Te2 = class extends qt {
|
|
|
27662
28242
|
if (this.preservePaths || i2.length === 0) return r();
|
|
27663
28243
|
let o2 = e;
|
|
27664
28244
|
for (let h3 of i2) {
|
|
27665
|
-
o2 =
|
|
28245
|
+
o2 = path15.resolve(o2, h3);
|
|
27666
28246
|
let [a2, l] = Se2(() => fs.lstatSync(o2));
|
|
27667
28247
|
if (a2) return r();
|
|
27668
|
-
if (l.isSymbolicLink()) return n2(new wt2(o2,
|
|
28248
|
+
if (l.isSymbolicLink()) return n2(new wt2(o2, path15.resolve(e, i2.join("/"))));
|
|
27669
28249
|
}
|
|
27670
28250
|
r();
|
|
27671
28251
|
}
|
|
@@ -27769,11 +28349,11 @@ var mo = (s3, t2) => {
|
|
|
27769
28349
|
};
|
|
27770
28350
|
var po = (s3, t2) => {
|
|
27771
28351
|
t2.forEach((e) => {
|
|
27772
|
-
e.charAt(0) === "@" ? It3({ file:
|
|
28352
|
+
e.charAt(0) === "@" ? It3({ file: path15.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
|
|
27773
28353
|
}), s3.end();
|
|
27774
28354
|
};
|
|
27775
28355
|
var Eo = async (s3, t2) => {
|
|
27776
|
-
for (let e of t2) e.charAt(0) === "@" ? await It3({ file:
|
|
28356
|
+
for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path15.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
|
|
27777
28357
|
s3.end();
|
|
27778
28358
|
};
|
|
27779
28359
|
var vt3 = K2(fo, mo, () => {
|
|
@@ -27798,11 +28378,11 @@ var GITHUB_ORG = "nextlyhq";
|
|
|
27798
28378
|
var GITHUB_REPO = "nextly";
|
|
27799
28379
|
async function downloadTemplate(templateName, branch = "main") {
|
|
27800
28380
|
const url = `https://codeload.github.com/${GITHUB_ORG}/${GITHUB_REPO}/tar.gz/${branch}`;
|
|
27801
|
-
const tmpDir =
|
|
28381
|
+
const tmpDir = path15.join(
|
|
27802
28382
|
process.env.TMPDIR || "/tmp",
|
|
27803
28383
|
`nextly-template-${Date.now()}`
|
|
27804
28384
|
);
|
|
27805
|
-
await
|
|
28385
|
+
await import_fs_extra9.default.ensureDir(tmpDir);
|
|
27806
28386
|
const repoPrefix = `${GITHUB_REPO}-${branch}`;
|
|
27807
28387
|
const baseFilter = `${repoPrefix}/templates/base/`;
|
|
27808
28388
|
const templateFilter = `${repoPrefix}/templates/${templateName}/`;
|
|
@@ -27831,7 +28411,7 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
27831
28411
|
})
|
|
27832
28412
|
);
|
|
27833
28413
|
} catch (error) {
|
|
27834
|
-
await
|
|
28414
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
27835
28415
|
});
|
|
27836
28416
|
if (error instanceof Error && error.name === "TimeoutError") {
|
|
27837
28417
|
throw new Error(
|
|
@@ -27840,17 +28420,17 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
27840
28420
|
}
|
|
27841
28421
|
throw error;
|
|
27842
28422
|
}
|
|
27843
|
-
const basePath =
|
|
27844
|
-
const templatePath =
|
|
27845
|
-
if (!await
|
|
27846
|
-
await
|
|
28423
|
+
const basePath = path15.join(tmpDir, "templates", "base");
|
|
28424
|
+
const templatePath = path15.join(tmpDir, "templates", templateName);
|
|
28425
|
+
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
28426
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
27847
28427
|
});
|
|
27848
28428
|
throw new Error(
|
|
27849
28429
|
`Base template not found in downloaded archive. The branch "${branch}" may not contain templates.`
|
|
27850
28430
|
);
|
|
27851
28431
|
}
|
|
27852
|
-
if (!await
|
|
27853
|
-
await
|
|
28432
|
+
if (!await import_fs_extra9.default.pathExists(templatePath)) {
|
|
28433
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
27854
28434
|
});
|
|
27855
28435
|
throw new Error(
|
|
27856
28436
|
`Template "${templateName}" not found in downloaded archive. Available templates may differ on branch "${branch}".`
|
|
@@ -27859,14 +28439,14 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
27859
28439
|
return { basePath, templatePath };
|
|
27860
28440
|
}
|
|
27861
28441
|
async function resolveLocalTemplate(localPath, templateName) {
|
|
27862
|
-
const basePath =
|
|
27863
|
-
const templatePath =
|
|
27864
|
-
if (!await
|
|
28442
|
+
const basePath = path15.join(localPath, "base");
|
|
28443
|
+
const templatePath = path15.join(localPath, templateName);
|
|
28444
|
+
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
27865
28445
|
throw new Error(
|
|
27866
28446
|
`Base template not found at ${basePath}. Check the --local-template path points to the templates/ directory.`
|
|
27867
28447
|
);
|
|
27868
28448
|
}
|
|
27869
|
-
if (!await
|
|
28449
|
+
if (!await import_fs_extra9.default.pathExists(templatePath)) {
|
|
27870
28450
|
throw new Error(
|
|
27871
28451
|
`Template "${templateName}" not found at ${templatePath}. Check the --local-template path points to the templates/ directory.`
|
|
27872
28452
|
);
|
|
@@ -27883,8 +28463,8 @@ async function resolveTemplateSource(templateName, options = {}) {
|
|
|
27883
28463
|
async function cleanupDownload(source) {
|
|
27884
28464
|
const tmpBase = process.env.TMPDIR || "/tmp";
|
|
27885
28465
|
if (source.basePath.startsWith(tmpBase)) {
|
|
27886
|
-
const extractionRoot =
|
|
27887
|
-
await
|
|
28466
|
+
const extractionRoot = path15.resolve(source.basePath, "../..");
|
|
28467
|
+
await import_fs_extra9.default.remove(extractionRoot).catch(() => {
|
|
27888
28468
|
});
|
|
27889
28469
|
}
|
|
27890
28470
|
}
|
|
@@ -27918,6 +28498,22 @@ var AVAILABLE_TEMPLATES = [
|
|
|
27918
28498
|
hasFrontendPages: true,
|
|
27919
28499
|
recommendedDatabase: "any",
|
|
27920
28500
|
release: "alpha"
|
|
28501
|
+
},
|
|
28502
|
+
{
|
|
28503
|
+
name: "plugin",
|
|
28504
|
+
label: "Plugin",
|
|
28505
|
+
description: "Build a reusable Nextly plugin (publishable npm package)",
|
|
28506
|
+
hint: "Plugin package + embedded /dev playground; no schema approach",
|
|
28507
|
+
// Plugins don't ask code-first vs visual, ship no app frontend, and bring
|
|
28508
|
+
// their own collections — they are a publishable library, not an app.
|
|
28509
|
+
approaches: [],
|
|
28510
|
+
defaultApproach: null,
|
|
28511
|
+
collections: [],
|
|
28512
|
+
singles: [],
|
|
28513
|
+
hasDemoData: false,
|
|
28514
|
+
hasFrontendPages: false,
|
|
28515
|
+
recommendedDatabase: "sqlite",
|
|
28516
|
+
release: "alpha"
|
|
27921
28517
|
}
|
|
27922
28518
|
];
|
|
27923
28519
|
function getTemplate(name) {
|
|
@@ -27986,14 +28582,12 @@ var DATABASE_LABELS = {
|
|
|
27986
28582
|
hint: "Popular alternative for production"
|
|
27987
28583
|
}
|
|
27988
28584
|
};
|
|
27989
|
-
|
|
27990
|
-
// src/prompts/project-name.ts
|
|
27991
|
-
var import_fs_extra9 = __toESM(require_lib(), 1);
|
|
28585
|
+
var import_fs_extra10 = __toESM(require_lib(), 1);
|
|
27992
28586
|
async function isExistingNextProject(cwd) {
|
|
27993
|
-
const packageJsonPath =
|
|
27994
|
-
if (!await
|
|
28587
|
+
const packageJsonPath = path15.join(cwd, "package.json");
|
|
28588
|
+
if (!await import_fs_extra10.default.pathExists(packageJsonPath)) return false;
|
|
27995
28589
|
try {
|
|
27996
|
-
const packageJson = await
|
|
28590
|
+
const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
|
|
27997
28591
|
const deps = {
|
|
27998
28592
|
...packageJson.dependencies,
|
|
27999
28593
|
...packageJson.devDependencies
|
|
@@ -28003,6 +28597,42 @@ async function isExistingNextProject(cwd) {
|
|
|
28003
28597
|
return false;
|
|
28004
28598
|
}
|
|
28005
28599
|
}
|
|
28600
|
+
var DEFAULT_PROJECT_NAME = "my-nextly-app";
|
|
28601
|
+
async function promptForProjectName() {
|
|
28602
|
+
const answer = await Zt({
|
|
28603
|
+
message: "What should your project be called?",
|
|
28604
|
+
// `initialValue` pre-fills the buffer so Enter accepts the default.
|
|
28605
|
+
// The previous version used `placeholder` alone, which returned an
|
|
28606
|
+
// empty string on Enter and silently fell through to a cwd install —
|
|
28607
|
+
// the root cause of the original bug. `placeholder` is omitted here
|
|
28608
|
+
// because clack only shows it when the buffer is empty, and the
|
|
28609
|
+
// initialValue keeps it populated.
|
|
28610
|
+
initialValue: DEFAULT_PROJECT_NAME,
|
|
28611
|
+
validate: validateProjectNamePromptInput
|
|
28612
|
+
});
|
|
28613
|
+
if (Ct(answer)) {
|
|
28614
|
+
return { kind: "cancelled" };
|
|
28615
|
+
}
|
|
28616
|
+
return { kind: "resolved", value: resolveProjectArg(answer) };
|
|
28617
|
+
}
|
|
28618
|
+
async function promptDirectoryConflict(targetLabel) {
|
|
28619
|
+
const choice = await Jt({
|
|
28620
|
+
message: `Target directory ${targetLabel} is not empty. How would you like to proceed?`,
|
|
28621
|
+
options: [
|
|
28622
|
+
{ value: "cancel", label: "Cancel operation" },
|
|
28623
|
+
{
|
|
28624
|
+
value: "remove",
|
|
28625
|
+
label: "Remove existing files and continue"
|
|
28626
|
+
},
|
|
28627
|
+
{
|
|
28628
|
+
value: "ignore",
|
|
28629
|
+
label: "Ignore files and continue"
|
|
28630
|
+
}
|
|
28631
|
+
]
|
|
28632
|
+
});
|
|
28633
|
+
if (Ct(choice)) return "cancel";
|
|
28634
|
+
return choice;
|
|
28635
|
+
}
|
|
28006
28636
|
|
|
28007
28637
|
// src/prompts/template.ts
|
|
28008
28638
|
var import_picocolors2 = __toESM(require_picocolors2(), 1);
|
|
@@ -28018,395 +28648,117 @@ function getTemplatePromptOptions() {
|
|
|
28018
28648
|
label: "Blog",
|
|
28019
28649
|
hint: "Posts, authors, categories, clean design"
|
|
28020
28650
|
},
|
|
28651
|
+
{
|
|
28652
|
+
value: "plugin",
|
|
28653
|
+
label: "Plugin",
|
|
28654
|
+
hint: "Build a reusable Nextly plugin + embedded /dev playground"
|
|
28655
|
+
},
|
|
28021
28656
|
{
|
|
28022
28657
|
value: "_coming_soon",
|
|
28023
28658
|
label: import_picocolors2.default.dim("More templates coming soon"),
|
|
28024
|
-
hint: "website, portfolio, e-commerce"
|
|
28025
|
-
}
|
|
28026
|
-
];
|
|
28027
|
-
}
|
|
28028
|
-
function isValidTemplateSelection(value) {
|
|
28029
|
-
return value !== "_coming_soon";
|
|
28030
|
-
}
|
|
28031
|
-
|
|
28032
|
-
// src/utils/detect.ts
|
|
28033
|
-
var import_fs_extra10 = __toESM(require_lib(), 1);
|
|
28034
|
-
|
|
28035
|
-
// src/utils/detect-pm-from-user-agent.ts
|
|
28036
|
-
function detectPmFromUserAgent(userAgent) {
|
|
28037
|
-
if (!userAgent) return null;
|
|
28038
|
-
if (userAgent.startsWith("pnpm/")) return "pnpm";
|
|
28039
|
-
if (userAgent.startsWith("yarn/")) return "yarn";
|
|
28040
|
-
if (userAgent.startsWith("bun/")) return "bun";
|
|
28041
|
-
if (userAgent.startsWith("npm/")) return "npm";
|
|
28042
|
-
return null;
|
|
28043
|
-
}
|
|
28044
|
-
|
|
28045
|
-
// src/utils/detect.ts
|
|
28046
|
-
async function detectPackageManager2(cwd) {
|
|
28047
|
-
const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
|
|
28048
|
-
if (fromUa) return fromUa;
|
|
28049
|
-
if (await import_fs_extra10.default.pathExists(path.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
28050
|
-
if (await import_fs_extra10.default.pathExists(path.join(cwd, "yarn.lock"))) return "yarn";
|
|
28051
|
-
if (await import_fs_extra10.default.pathExists(path.join(cwd, "bun.lockb"))) return "bun";
|
|
28052
|
-
return "npm";
|
|
28053
|
-
}
|
|
28054
|
-
async function detectProject(cwd) {
|
|
28055
|
-
const packageJsonPath = path.join(cwd, "package.json");
|
|
28056
|
-
if (!await import_fs_extra10.default.pathExists(packageJsonPath)) {
|
|
28057
|
-
throw new Error(
|
|
28058
|
-
"No package.json found. Please run this command in a Next.js project."
|
|
28059
|
-
);
|
|
28060
|
-
}
|
|
28061
|
-
const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
|
|
28062
|
-
const deps = {
|
|
28063
|
-
...packageJson.dependencies,
|
|
28064
|
-
...packageJson.devDependencies
|
|
28065
|
-
};
|
|
28066
|
-
const isNextJs = "next" in deps;
|
|
28067
|
-
if (!isNextJs) {
|
|
28068
|
-
throw new Error(
|
|
28069
|
-
"Next.js not found in dependencies. Please run this in a Next.js project."
|
|
28070
|
-
);
|
|
28071
|
-
}
|
|
28072
|
-
const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
|
|
28073
|
-
const srcDir = await import_fs_extra10.default.pathExists(path.join(cwd, "src"));
|
|
28074
|
-
const appDirPaths = srcDir ? [path.join(cwd, "src", "app")] : [path.join(cwd, "app")];
|
|
28075
|
-
let isAppRouter = false;
|
|
28076
|
-
for (const appPath of appDirPaths) {
|
|
28077
|
-
if (await import_fs_extra10.default.pathExists(appPath)) {
|
|
28078
|
-
isAppRouter = true;
|
|
28079
|
-
break;
|
|
28080
|
-
}
|
|
28081
|
-
}
|
|
28082
|
-
if (!isAppRouter) {
|
|
28083
|
-
throw new Error(
|
|
28084
|
-
"App Router not detected. Nextly requires Next.js App Router (app/ directory)."
|
|
28085
|
-
);
|
|
28086
|
-
}
|
|
28087
|
-
const hasTypescript = await import_fs_extra10.default.pathExists(path.join(cwd, "tsconfig.json"));
|
|
28088
|
-
const packageManager = await detectPackageManager2(cwd);
|
|
28089
|
-
const appDir = srcDir ? "src/app" : "app";
|
|
28090
|
-
return {
|
|
28091
|
-
isNextJs,
|
|
28092
|
-
isAppRouter,
|
|
28093
|
-
hasTypescript,
|
|
28094
|
-
packageManager,
|
|
28095
|
-
nextVersion,
|
|
28096
|
-
srcDir,
|
|
28097
|
-
appDir
|
|
28098
|
-
};
|
|
28099
|
-
}
|
|
28100
|
-
|
|
28101
|
-
// src/utils/template.ts
|
|
28102
|
-
var import_fs_extra11 = __toESM(require_lib(), 1);
|
|
28103
|
-
var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
28104
|
-
".ts",
|
|
28105
|
-
".tsx",
|
|
28106
|
-
".js",
|
|
28107
|
-
".jsx",
|
|
28108
|
-
".json",
|
|
28109
|
-
".env",
|
|
28110
|
-
".md",
|
|
28111
|
-
".css",
|
|
28112
|
-
".html",
|
|
28113
|
-
".mjs",
|
|
28114
|
-
".cjs"
|
|
28115
|
-
]);
|
|
28116
|
-
var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
|
|
28117
|
-
function resolveTemplatePath(localTemplatePath) {
|
|
28118
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
28119
|
-
const fromDist = path.resolve(__dirname, "../templates");
|
|
28120
|
-
if (import_fs_extra11.default.existsSync(fromDist)) {
|
|
28121
|
-
return fromDist;
|
|
28122
|
-
}
|
|
28123
|
-
const fromSrc = path.resolve(__dirname, "../../templates");
|
|
28124
|
-
if (import_fs_extra11.default.existsSync(fromSrc)) {
|
|
28125
|
-
return fromSrc;
|
|
28126
|
-
}
|
|
28127
|
-
throw new Error(
|
|
28128
|
-
"Could not find templates directory. Use --local-template to specify the templates path, or ensure templates are bundled."
|
|
28129
|
-
);
|
|
28130
|
-
}
|
|
28131
|
-
function buildPlaceholderMap(options) {
|
|
28132
|
-
const { database, databaseUrl } = options;
|
|
28133
|
-
return {
|
|
28134
|
-
"{{databaseDialect}}": database.type,
|
|
28135
|
-
"{{databaseUrl}}": databaseUrl || database.envExample
|
|
28136
|
-
};
|
|
28137
|
-
}
|
|
28138
|
-
async function replacePlaceholdersInFile(filePath, placeholders) {
|
|
28139
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
28140
|
-
const basename = path.basename(filePath);
|
|
28141
|
-
const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
|
|
28142
|
-
if (!isTextFile) return;
|
|
28143
|
-
let content = await import_fs_extra11.default.readFile(filePath, "utf-8");
|
|
28144
|
-
let changed = false;
|
|
28145
|
-
for (const [placeholder, value] of Object.entries(placeholders)) {
|
|
28146
|
-
if (content.includes(placeholder)) {
|
|
28147
|
-
content = content.replaceAll(placeholder, value);
|
|
28148
|
-
changed = true;
|
|
28149
|
-
}
|
|
28150
|
-
}
|
|
28151
|
-
if (changed) {
|
|
28152
|
-
await import_fs_extra11.default.writeFile(filePath, content, "utf-8");
|
|
28153
|
-
}
|
|
28154
|
-
}
|
|
28155
|
-
async function replacePlaceholders(dir, placeholders) {
|
|
28156
|
-
const entries = await import_fs_extra11.default.readdir(dir, { withFileTypes: true });
|
|
28157
|
-
for (const entry of entries) {
|
|
28158
|
-
const fullPath = path.join(dir, entry.name);
|
|
28159
|
-
if (entry.isDirectory()) {
|
|
28160
|
-
if (entry.name === "node_modules" || entry.name === ".git") continue;
|
|
28161
|
-
await replacePlaceholders(fullPath, placeholders);
|
|
28162
|
-
} else if (entry.isFile()) {
|
|
28163
|
-
await replacePlaceholdersInFile(fullPath, placeholders);
|
|
28164
|
-
}
|
|
28165
|
-
}
|
|
28166
|
-
}
|
|
28167
|
-
var PINNED_VERSIONS = {
|
|
28168
|
-
// Next.js ecosystem — resolved at runtime via fetchLatestVersion()
|
|
28169
|
-
// (see generatePackageJson)
|
|
28170
|
-
react: "^19.1.0",
|
|
28171
|
-
"react-dom": "^19.1.0",
|
|
28172
|
-
// Dev dependencies
|
|
28173
|
-
typescript: "^5",
|
|
28174
|
-
"@types/node": "^20",
|
|
28175
|
-
"@types/react": "^19",
|
|
28176
|
-
"@types/react-dom": "^19",
|
|
28177
|
-
"@tailwindcss/postcss": "^4",
|
|
28178
|
-
tailwindcss: "^4",
|
|
28179
|
-
eslint: "^9"
|
|
28180
|
-
};
|
|
28181
|
-
var RUNTIME_RESOLVED_PACKAGES = ["next", "eslint-config-next"];
|
|
28182
|
-
var NEXTLY_PACKAGES = [
|
|
28183
|
-
"nextly",
|
|
28184
|
-
"@nextlyhq/admin",
|
|
28185
|
-
"@nextlyhq/adapter-drizzle",
|
|
28186
|
-
"@nextlyhq/adapter-postgres",
|
|
28187
|
-
"@nextlyhq/adapter-mysql",
|
|
28188
|
-
"@nextlyhq/adapter-sqlite"
|
|
28189
|
-
];
|
|
28190
|
-
var resolvedNextlyVersions = null;
|
|
28191
|
-
async function fetchLatestVersion(pkg) {
|
|
28192
|
-
try {
|
|
28193
|
-
const res = await fetch(
|
|
28194
|
-
`https://registry.npmjs.org/-/package/${encodeURIComponent(pkg)}/dist-tags`,
|
|
28195
|
-
{ signal: AbortSignal.timeout(5e3) }
|
|
28196
|
-
);
|
|
28197
|
-
if (!res.ok) return "latest";
|
|
28198
|
-
const data = await res.json();
|
|
28199
|
-
return data.latest ? `^${data.latest}` : "latest";
|
|
28200
|
-
} catch {
|
|
28201
|
-
return "latest";
|
|
28202
|
-
}
|
|
28659
|
+
hint: "website, portfolio, e-commerce"
|
|
28660
|
+
}
|
|
28661
|
+
];
|
|
28203
28662
|
}
|
|
28204
|
-
|
|
28205
|
-
|
|
28206
|
-
const entries = await Promise.all(
|
|
28207
|
-
NEXTLY_PACKAGES.map(
|
|
28208
|
-
async (pkg) => [pkg, await fetchLatestVersion(pkg)]
|
|
28209
|
-
)
|
|
28210
|
-
);
|
|
28211
|
-
resolvedNextlyVersions = Object.fromEntries(entries);
|
|
28212
|
-
return resolvedNextlyVersions;
|
|
28663
|
+
function isValidTemplateSelection(value) {
|
|
28664
|
+
return value !== "_coming_soon";
|
|
28213
28665
|
}
|
|
28214
|
-
|
|
28215
|
-
|
|
28216
|
-
|
|
28217
|
-
|
|
28218
|
-
|
|
28219
|
-
|
|
28220
|
-
|
|
28221
|
-
|
|
28222
|
-
|
|
28223
|
-
|
|
28224
|
-
|
|
28225
|
-
|
|
28226
|
-
);
|
|
28227
|
-
resolvedRuntimeVersions = Object.fromEntries(entries);
|
|
28228
|
-
return resolvedRuntimeVersions;
|
|
28666
|
+
|
|
28667
|
+
// src/utils/detect.ts
|
|
28668
|
+
var import_fs_extra11 = __toESM(require_lib(), 1);
|
|
28669
|
+
|
|
28670
|
+
// src/utils/detect-pm-from-user-agent.ts
|
|
28671
|
+
function detectPmFromUserAgent(userAgent) {
|
|
28672
|
+
if (!userAgent) return null;
|
|
28673
|
+
if (userAgent.startsWith("pnpm/")) return "pnpm";
|
|
28674
|
+
if (userAgent.startsWith("yarn/")) return "yarn";
|
|
28675
|
+
if (userAgent.startsWith("bun/")) return "bun";
|
|
28676
|
+
if (userAgent.startsWith("npm/")) return "npm";
|
|
28677
|
+
return null;
|
|
28229
28678
|
}
|
|
28230
|
-
|
|
28231
|
-
|
|
28232
|
-
|
|
28233
|
-
|
|
28234
|
-
|
|
28235
|
-
|
|
28236
|
-
|
|
28237
|
-
|
|
28238
|
-
|
|
28239
|
-
const versions = await resolveNextlyVersions();
|
|
28240
|
-
dependencies["nextly"] = versions["nextly"];
|
|
28241
|
-
dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
|
|
28242
|
-
dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";
|
|
28243
|
-
dependencies["@nextlyhq/adapter-drizzle"] = versions["@nextlyhq/adapter-drizzle"];
|
|
28244
|
-
dependencies[database.adapter] = versions[database.adapter] || "latest";
|
|
28245
|
-
dependencies["@nextlyhq/plugin-form-builder"] = versions["@nextlyhq/plugin-form-builder"] || "latest";
|
|
28246
|
-
}
|
|
28247
|
-
const devDependencies = {
|
|
28248
|
-
typescript: PINNED_VERSIONS.typescript,
|
|
28249
|
-
"@types/node": PINNED_VERSIONS["@types/node"],
|
|
28250
|
-
"@types/react": PINNED_VERSIONS["@types/react"],
|
|
28251
|
-
"@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
|
|
28252
|
-
"@tailwindcss/postcss": PINNED_VERSIONS["@tailwindcss/postcss"],
|
|
28253
|
-
tailwindcss: PINNED_VERSIONS.tailwindcss,
|
|
28254
|
-
eslint: PINNED_VERSIONS.eslint,
|
|
28255
|
-
"eslint-config-next": runtimeVersions["eslint-config-next"],
|
|
28256
|
-
// Pagefind powers /search in the blog template. Zero-config
|
|
28257
|
-
// static index generated at `next build` time. Templates that
|
|
28258
|
-
// don't ship a /search page simply won't invoke it.
|
|
28259
|
-
pagefind: "^1.1.0"
|
|
28260
|
-
};
|
|
28261
|
-
const pkg = {
|
|
28262
|
-
name: projectName,
|
|
28263
|
-
version: "0.1.0",
|
|
28264
|
-
private: true,
|
|
28265
|
-
scripts: {
|
|
28266
|
-
// F1 PR 4: dev now boots Nextly in single-process mode via `next dev`.
|
|
28267
|
-
// The lazy drizzle-kit/api import (PR 1) plus the in-process HMR
|
|
28268
|
-
// listener (PR 2) replaced the wrapper that previously owned the
|
|
28269
|
-
// terminal, schema prompts, and child supervision. `nextly dev` is
|
|
28270
|
-
// gone; the only supported dev command is the standard `next dev`.
|
|
28271
|
-
dev: "next dev --turbopack",
|
|
28272
|
-
// Build: migrate DB + compile Next.js + (if present) generate
|
|
28273
|
-
// the Pagefind search index. Templates without the search
|
|
28274
|
-
// script silently skip the last step.
|
|
28275
|
-
build: "nextly migrate && next build && (test -f scripts/build-search-index.mjs && node scripts/build-search-index.mjs || true)",
|
|
28276
|
-
"search:index": "node scripts/build-search-index.mjs",
|
|
28277
|
-
start: "next start",
|
|
28278
|
-
lint: "next lint",
|
|
28279
|
-
nextly: "nextly",
|
|
28280
|
-
// First-time setup: sync schema + seed system permissions. Demo
|
|
28281
|
-
// content is seeded separately from the admin UI (visit /welcome
|
|
28282
|
-
// after running `pnpm dev` and completing /admin/setup).
|
|
28283
|
-
"db:setup": "nextly db:sync",
|
|
28284
|
-
"db:migrate": "nextly migrate",
|
|
28285
|
-
"db:migrate:status": "nextly migrate:status",
|
|
28286
|
-
"db:migrate:fresh": "nextly migrate:fresh",
|
|
28287
|
-
"db:migrate:reset": "nextly migrate:reset",
|
|
28288
|
-
"types:generate": "nextly generate:types"
|
|
28289
|
-
},
|
|
28290
|
-
dependencies,
|
|
28291
|
-
devDependencies
|
|
28292
|
-
};
|
|
28293
|
-
return JSON.stringify(pkg, null, 2) + "\n";
|
|
28679
|
+
|
|
28680
|
+
// src/utils/detect.ts
|
|
28681
|
+
async function detectPackageManager2(cwd) {
|
|
28682
|
+
const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
|
|
28683
|
+
if (fromUa) return fromUa;
|
|
28684
|
+
if (await import_fs_extra11.default.pathExists(path15.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
28685
|
+
if (await import_fs_extra11.default.pathExists(path15.join(cwd, "yarn.lock"))) return "yarn";
|
|
28686
|
+
if (await import_fs_extra11.default.pathExists(path15.join(cwd, "bun.lockb"))) return "bun";
|
|
28687
|
+
return "npm";
|
|
28294
28688
|
}
|
|
28295
|
-
async function
|
|
28296
|
-
const
|
|
28297
|
-
|
|
28298
|
-
projectType,
|
|
28299
|
-
targetDir,
|
|
28300
|
-
database,
|
|
28301
|
-
databaseUrl,
|
|
28302
|
-
useYalc = false,
|
|
28303
|
-
approach,
|
|
28304
|
-
templateSource
|
|
28305
|
-
} = options;
|
|
28306
|
-
if (targetDir !== process.cwd() && await import_fs_extra11.default.pathExists(targetDir)) {
|
|
28307
|
-
throw new Error(
|
|
28308
|
-
`Directory "${path.basename(targetDir)}" already exists. Please choose a different name.`
|
|
28309
|
-
);
|
|
28310
|
-
}
|
|
28311
|
-
let baseDir;
|
|
28312
|
-
let typeDir;
|
|
28313
|
-
if (templateSource) {
|
|
28314
|
-
baseDir = templateSource.basePath;
|
|
28315
|
-
typeDir = templateSource.templatePath;
|
|
28316
|
-
} else {
|
|
28317
|
-
const templatesRoot = resolveTemplatePath();
|
|
28318
|
-
baseDir = path.join(templatesRoot, "base");
|
|
28319
|
-
typeDir = path.join(templatesRoot, projectType);
|
|
28320
|
-
}
|
|
28321
|
-
if (!await import_fs_extra11.default.pathExists(baseDir)) {
|
|
28689
|
+
async function detectProject(cwd) {
|
|
28690
|
+
const packageJsonPath = path15.join(cwd, "package.json");
|
|
28691
|
+
if (!await import_fs_extra11.default.pathExists(packageJsonPath)) {
|
|
28322
28692
|
throw new Error(
|
|
28323
|
-
|
|
28693
|
+
"No package.json found. Please run this command in a Next.js project."
|
|
28324
28694
|
);
|
|
28325
28695
|
}
|
|
28326
|
-
|
|
28696
|
+
const packageJson = await import_fs_extra11.default.readJson(packageJsonPath);
|
|
28697
|
+
const deps = {
|
|
28698
|
+
...packageJson.dependencies,
|
|
28699
|
+
...packageJson.devDependencies
|
|
28700
|
+
};
|
|
28701
|
+
const isNextJs = "next" in deps;
|
|
28702
|
+
if (!isNextJs) {
|
|
28327
28703
|
throw new Error(
|
|
28328
|
-
|
|
28704
|
+
"Next.js not found in dependencies. Please run this in a Next.js project."
|
|
28329
28705
|
);
|
|
28330
28706
|
}
|
|
28331
|
-
|
|
28332
|
-
|
|
28333
|
-
|
|
28334
|
-
|
|
28707
|
+
const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
|
|
28708
|
+
const srcDir = await import_fs_extra11.default.pathExists(path15.join(cwd, "src"));
|
|
28709
|
+
const appDirPaths = srcDir ? [path15.join(cwd, "src", "app")] : [path15.join(cwd, "app")];
|
|
28710
|
+
let isAppRouter = false;
|
|
28711
|
+
for (const appPath of appDirPaths) {
|
|
28712
|
+
if (await import_fs_extra11.default.pathExists(appPath)) {
|
|
28713
|
+
isAppRouter = true;
|
|
28714
|
+
break;
|
|
28335
28715
|
}
|
|
28336
|
-
});
|
|
28337
|
-
const templateSrcDir = path.join(typeDir, "src");
|
|
28338
|
-
if (await import_fs_extra11.default.pathExists(templateSrcDir)) {
|
|
28339
|
-
await import_fs_extra11.default.copy(templateSrcDir, path.join(targetDir, "src"), {
|
|
28340
|
-
overwrite: true,
|
|
28341
|
-
filter: (_src) => {
|
|
28342
|
-
const basename = path.basename(_src);
|
|
28343
|
-
return !SKIP_FILES.has(basename);
|
|
28344
|
-
}
|
|
28345
|
-
});
|
|
28346
28716
|
}
|
|
28347
|
-
|
|
28348
|
-
|
|
28349
|
-
|
|
28350
|
-
templateRootConfig,
|
|
28351
|
-
path.join(targetDir, "nextly.config.ts"),
|
|
28352
|
-
{ overwrite: true }
|
|
28717
|
+
if (!isAppRouter) {
|
|
28718
|
+
throw new Error(
|
|
28719
|
+
"App Router not detected. Nextly requires Next.js App Router (app/ directory)."
|
|
28353
28720
|
);
|
|
28354
28721
|
}
|
|
28355
|
-
const
|
|
28356
|
-
|
|
28357
|
-
|
|
28358
|
-
|
|
28359
|
-
|
|
28360
|
-
|
|
28361
|
-
|
|
28362
|
-
|
|
28363
|
-
|
|
28364
|
-
|
|
28365
|
-
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28371
|
-
|
|
28372
|
-
|
|
28373
|
-
|
|
28374
|
-
|
|
28375
|
-
|
|
28376
|
-
|
|
28377
|
-
);
|
|
28378
|
-
const
|
|
28379
|
-
|
|
28380
|
-
await
|
|
28381
|
-
}
|
|
28382
|
-
const packageJsonContent = await generatePackageJson(
|
|
28383
|
-
projectName,
|
|
28384
|
-
database,
|
|
28385
|
-
useYalc
|
|
28386
|
-
);
|
|
28387
|
-
await import_fs_extra11.default.writeFile(
|
|
28388
|
-
path.join(targetDir, "package.json"),
|
|
28389
|
-
packageJsonContent,
|
|
28390
|
-
"utf-8"
|
|
28391
|
-
);
|
|
28392
|
-
if (database.type === "sqlite") {
|
|
28393
|
-
await import_fs_extra11.default.ensureDir(path.join(targetDir, "data"));
|
|
28394
|
-
}
|
|
28395
|
-
const placeholders = buildPlaceholderMap({ database, databaseUrl });
|
|
28396
|
-
if (approach) {
|
|
28397
|
-
placeholders["{{approach}}"] = approach;
|
|
28722
|
+
const hasTypescript = await import_fs_extra11.default.pathExists(path15.join(cwd, "tsconfig.json"));
|
|
28723
|
+
const packageManager = await detectPackageManager2(cwd);
|
|
28724
|
+
const appDir = srcDir ? "src/app" : "app";
|
|
28725
|
+
return {
|
|
28726
|
+
isNextJs,
|
|
28727
|
+
isAppRouter,
|
|
28728
|
+
hasTypescript,
|
|
28729
|
+
packageManager,
|
|
28730
|
+
nextVersion,
|
|
28731
|
+
srcDir,
|
|
28732
|
+
appDir
|
|
28733
|
+
};
|
|
28734
|
+
}
|
|
28735
|
+
|
|
28736
|
+
// src/utils/fs.ts
|
|
28737
|
+
var import_fs_extra12 = __toESM(require_lib(), 1);
|
|
28738
|
+
async function isDirectoryNotEmpty(dir) {
|
|
28739
|
+
if (!await import_fs_extra12.default.pathExists(dir)) return false;
|
|
28740
|
+
const entries = await import_fs_extra12.default.readdir(dir);
|
|
28741
|
+
return entries.some((entry) => entry !== ".git");
|
|
28742
|
+
}
|
|
28743
|
+
async function emptyDirectory(dir) {
|
|
28744
|
+
if (!await import_fs_extra12.default.pathExists(dir)) return;
|
|
28745
|
+
for (const entry of await import_fs_extra12.default.readdir(dir)) {
|
|
28746
|
+
if (entry === ".git") continue;
|
|
28747
|
+
await import_fs_extra12.default.remove(path15.join(dir, entry));
|
|
28398
28748
|
}
|
|
28399
|
-
await replacePlaceholders(targetDir, placeholders);
|
|
28400
28749
|
}
|
|
28401
28750
|
|
|
28402
28751
|
// src/create-nextly.ts
|
|
28752
|
+
function cwdProjectName(cwd) {
|
|
28753
|
+
const basename = path15.basename(cwd);
|
|
28754
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(basename)) {
|
|
28755
|
+
return DEFAULT_PROJECT_NAME;
|
|
28756
|
+
}
|
|
28757
|
+
return basename;
|
|
28758
|
+
}
|
|
28403
28759
|
async function createNextly(options = {}) {
|
|
28404
|
-
const {
|
|
28405
|
-
|
|
28406
|
-
skipInstall = false,
|
|
28407
|
-
useYalc = false,
|
|
28408
|
-
installInCwd = false
|
|
28409
|
-
} = options;
|
|
28760
|
+
const { defaults = false, skipInstall = false, useYalc = false } = options;
|
|
28761
|
+
let installInCwd = options.installInCwd ?? false;
|
|
28410
28762
|
let { cwd = process.cwd() } = options;
|
|
28411
28763
|
let isFreshProject = false;
|
|
28412
28764
|
let projectName;
|
|
@@ -28428,37 +28780,48 @@ async function createNextly(options = {}) {
|
|
|
28428
28780
|
}
|
|
28429
28781
|
}
|
|
28430
28782
|
} else if (installInCwd) {
|
|
28431
|
-
projectName =
|
|
28783
|
+
projectName = cwdProjectName(cwd);
|
|
28432
28784
|
isFreshProject = true;
|
|
28433
28785
|
} else {
|
|
28434
28786
|
if (options.projectNameFromArg) {
|
|
28435
28787
|
projectName = options.projectNameFromArg;
|
|
28436
28788
|
} else if (!defaults) {
|
|
28437
|
-
const
|
|
28438
|
-
|
|
28439
|
-
placeholder: "my-nextly-app",
|
|
28440
|
-
defaultValue: "my-nextly-app",
|
|
28441
|
-
validate: (value) => {
|
|
28442
|
-
if (!value || !value.trim()) return void 0;
|
|
28443
|
-
if (!/^[a-z0-9][a-z0-9._-]*$/.test(value)) {
|
|
28444
|
-
return "Use lowercase letters, numbers, hyphens, dots, or underscores";
|
|
28445
|
-
}
|
|
28446
|
-
}
|
|
28447
|
-
});
|
|
28448
|
-
if (Ct(name)) {
|
|
28789
|
+
const result = await promptForProjectName();
|
|
28790
|
+
if (result.kind === "cancelled") {
|
|
28449
28791
|
Nt("Cancelled.");
|
|
28450
28792
|
return;
|
|
28451
28793
|
}
|
|
28452
|
-
|
|
28794
|
+
if (result.value.installInCwd) {
|
|
28795
|
+
installInCwd = true;
|
|
28796
|
+
projectName = cwdProjectName(cwd);
|
|
28797
|
+
} else {
|
|
28798
|
+
projectName = result.value.projectName ?? DEFAULT_PROJECT_NAME;
|
|
28799
|
+
}
|
|
28453
28800
|
} else {
|
|
28454
|
-
projectName =
|
|
28801
|
+
projectName = DEFAULT_PROJECT_NAME;
|
|
28455
28802
|
}
|
|
28456
28803
|
isFreshProject = true;
|
|
28457
28804
|
}
|
|
28805
|
+
let allowExistingTarget = false;
|
|
28806
|
+
if (isFreshProject && projectName) {
|
|
28807
|
+
const conflictTargetDir = installInCwd ? cwd : path15.join(cwd, projectName);
|
|
28808
|
+
if (await isDirectoryNotEmpty(conflictTargetDir)) {
|
|
28809
|
+
const targetLabel = installInCwd ? "the current directory" : `"${projectName}"`;
|
|
28810
|
+
const choice = await promptDirectoryConflict(targetLabel);
|
|
28811
|
+
if (choice === "cancel") {
|
|
28812
|
+
Nt("Cancelled. No changes were made.");
|
|
28813
|
+
return;
|
|
28814
|
+
}
|
|
28815
|
+
allowExistingTarget = true;
|
|
28816
|
+
if (choice === "remove") {
|
|
28817
|
+
await emptyDirectory(conflictTargetDir);
|
|
28818
|
+
}
|
|
28819
|
+
}
|
|
28820
|
+
}
|
|
28458
28821
|
let projectType;
|
|
28459
28822
|
if (options.projectType) {
|
|
28460
28823
|
projectType = options.projectType;
|
|
28461
|
-
} else if (defaults) {
|
|
28824
|
+
} else if (defaults || existingProject) {
|
|
28462
28825
|
projectType = "blank";
|
|
28463
28826
|
} else {
|
|
28464
28827
|
const template = await Jt({
|
|
@@ -28551,6 +28914,7 @@ async function createNextly(options = {}) {
|
|
|
28551
28914
|
databaseUrl = url?.trim() || database.connectionUrl;
|
|
28552
28915
|
}
|
|
28553
28916
|
if (isFreshProject && projectName) {
|
|
28917
|
+
const targetDir = installInCwd ? cwd : path15.join(cwd, projectName);
|
|
28554
28918
|
const s3 = be();
|
|
28555
28919
|
let templateSource;
|
|
28556
28920
|
try {
|
|
@@ -28565,47 +28929,29 @@ async function createNextly(options = {}) {
|
|
|
28565
28929
|
} else {
|
|
28566
28930
|
s3.start("Scaffolding project...");
|
|
28567
28931
|
}
|
|
28568
|
-
|
|
28569
|
-
|
|
28570
|
-
|
|
28571
|
-
|
|
28572
|
-
|
|
28573
|
-
|
|
28574
|
-
|
|
28575
|
-
|
|
28576
|
-
|
|
28577
|
-
|
|
28578
|
-
|
|
28579
|
-
|
|
28580
|
-
|
|
28581
|
-
|
|
28582
|
-
|
|
28583
|
-
|
|
28584
|
-
|
|
28585
|
-
useYalc,
|
|
28586
|
-
approach,
|
|
28587
|
-
templateSource
|
|
28588
|
-
});
|
|
28589
|
-
} else {
|
|
28590
|
-
await copyTemplate({
|
|
28591
|
-
projectName,
|
|
28592
|
-
projectType,
|
|
28593
|
-
targetDir,
|
|
28594
|
-
database,
|
|
28595
|
-
databaseUrl,
|
|
28596
|
-
useYalc,
|
|
28597
|
-
approach,
|
|
28598
|
-
templateSource
|
|
28599
|
-
});
|
|
28600
|
-
cwd = targetDir;
|
|
28601
|
-
}
|
|
28932
|
+
await copyTemplate({
|
|
28933
|
+
projectName,
|
|
28934
|
+
projectType,
|
|
28935
|
+
targetDir,
|
|
28936
|
+
database,
|
|
28937
|
+
databaseUrl,
|
|
28938
|
+
useYalc,
|
|
28939
|
+
approach,
|
|
28940
|
+
templateSource,
|
|
28941
|
+
// Suppress copyTemplate's "directory already exists" guard when the
|
|
28942
|
+
// installer has already negotiated the conflict with the user
|
|
28943
|
+
// (either by emptying the dir or accepting an overlay). Without
|
|
28944
|
+
// this, the "ignore" path would still throw on the subdirectory
|
|
28945
|
+
// case where the target was non-empty.
|
|
28946
|
+
allowExistingTarget
|
|
28947
|
+
});
|
|
28948
|
+
if (!installInCwd) cwd = targetDir;
|
|
28602
28949
|
s3.stop("Project scaffolded");
|
|
28603
28950
|
} catch (error) {
|
|
28604
28951
|
s3.stop("Scaffolding failed");
|
|
28605
|
-
if (!installInCwd) {
|
|
28606
|
-
|
|
28607
|
-
|
|
28608
|
-
await import_fs_extra12.default.remove(targetDir);
|
|
28952
|
+
if (!installInCwd && !allowExistingTarget) {
|
|
28953
|
+
if (await import_fs_extra13.default.pathExists(targetDir)) {
|
|
28954
|
+
await import_fs_extra13.default.remove(targetDir);
|
|
28609
28955
|
}
|
|
28610
28956
|
}
|
|
28611
28957
|
capture("scaffold_failed", {
|
|
@@ -28652,7 +28998,8 @@ async function createNextly(options = {}) {
|
|
|
28652
28998
|
projectInfo,
|
|
28653
28999
|
database,
|
|
28654
29000
|
useYalc,
|
|
28655
|
-
isFreshProject
|
|
29001
|
+
isFreshProject,
|
|
29002
|
+
projectType
|
|
28656
29003
|
);
|
|
28657
29004
|
s3.stop("Dependencies installed");
|
|
28658
29005
|
capture("install_completed", {
|
|
@@ -28678,10 +29025,12 @@ async function createNextly(options = {}) {
|
|
|
28678
29025
|
await generateAdminPage(cwd, projectInfo);
|
|
28679
29026
|
await generateMediaRoutes(cwd, projectInfo);
|
|
28680
29027
|
await generateTypesDirectory(cwd, projectInfo);
|
|
28681
|
-
await patchNextConfig(cwd);
|
|
29028
|
+
await patchNextConfig(cwd, database);
|
|
29029
|
+
}
|
|
29030
|
+
if (projectType !== "plugin") {
|
|
29031
|
+
const envDatabase = databaseUrl ? { ...database, connectionUrl: databaseUrl, envExample: databaseUrl } : database;
|
|
29032
|
+
await generateEnv(cwd, envDatabase);
|
|
28682
29033
|
}
|
|
28683
|
-
const envDatabase = databaseUrl ? { ...database, connectionUrl: databaseUrl, envExample: databaseUrl } : database;
|
|
28684
|
-
await generateEnv(cwd, envDatabase);
|
|
28685
29034
|
s3.stop("Environment configured");
|
|
28686
29035
|
} catch (error) {
|
|
28687
29036
|
s3.stop("Failed to generate configuration");
|
|
@@ -28700,31 +29049,58 @@ async function createNextly(options = {}) {
|
|
|
28700
29049
|
if (isFreshProject && projectName && !installInCwd) {
|
|
28701
29050
|
lines.push(` ${import_picocolors3.default.bold("cd")} ${projectName}`);
|
|
28702
29051
|
}
|
|
28703
|
-
|
|
28704
|
-
|
|
28705
|
-
|
|
29052
|
+
if (projectType === "plugin") {
|
|
29053
|
+
lines.push(` ${import_picocolors3.default.bold(devCommand)}`);
|
|
29054
|
+
lines.push(
|
|
29055
|
+
` ${import_picocolors3.default.dim("\u2192 runs the embedded /dev playground (SQLite, hot-reload)")}`
|
|
29056
|
+
);
|
|
29057
|
+
lines.push("");
|
|
29058
|
+
lines.push(
|
|
29059
|
+
` Open ${import_picocolors3.default.cyan("http://localhost:3000/admin")} \u2014 your plugin is registered.`
|
|
29060
|
+
);
|
|
29061
|
+
lines.push(
|
|
29062
|
+
` Edit your plugin in ${import_picocolors3.default.dim("src/")}; the ${import_picocolors3.default.dim("dev/")} app is never published.`
|
|
29063
|
+
);
|
|
29064
|
+
lines.push("");
|
|
29065
|
+
lines.push(
|
|
29066
|
+
` ${import_picocolors3.default.bold(`${pm} test`)} runs the in-memory integration harness.`
|
|
29067
|
+
);
|
|
28706
29068
|
lines.push(
|
|
28707
|
-
`
|
|
29069
|
+
` ${import_picocolors3.default.bold(`${pm} run build`)}, then ${import_picocolors3.default.bold("npm publish")} to ship.`
|
|
29070
|
+
);
|
|
29071
|
+
lines.push("");
|
|
29072
|
+
lines.push(
|
|
29073
|
+
` Use it in an app: add ${import_picocolors3.default.dim("myPlugin()")} to ${import_picocolors3.default.dim("plugins")} in nextly.config.ts.`
|
|
28708
29074
|
);
|
|
28709
29075
|
} else {
|
|
29076
|
+
lines.push(` ${import_picocolors3.default.bold(devCommand)}`);
|
|
29077
|
+
lines.push("");
|
|
29078
|
+
if (databaseType === "sqlite") {
|
|
29079
|
+
lines.push(
|
|
29080
|
+
` Your database (SQLite) is stored at ${import_picocolors3.default.dim("./data/nextly.db")}`
|
|
29081
|
+
);
|
|
29082
|
+
} else {
|
|
29083
|
+
lines.push(
|
|
29084
|
+
` Make sure your ${DATABASE_LABELS[databaseType].label} server is running before starting.`
|
|
29085
|
+
);
|
|
29086
|
+
}
|
|
28710
29087
|
lines.push(
|
|
28711
|
-
`
|
|
29088
|
+
` ${import_picocolors3.default.bold(devCommand)} will create system tables on first run.`
|
|
28712
29089
|
);
|
|
29090
|
+
if (projectType === "blog") {
|
|
29091
|
+
lines.push(
|
|
29092
|
+
` Visit ${import_picocolors3.default.cyan("http://localhost:3000")} to see your blog.`
|
|
29093
|
+
);
|
|
29094
|
+
}
|
|
29095
|
+
lines.push(
|
|
29096
|
+
` Visit ${import_picocolors3.default.cyan("http://localhost:3000/admin/setup")} to create your admin account.`
|
|
29097
|
+
);
|
|
29098
|
+
lines.push("");
|
|
29099
|
+
lines.push(
|
|
29100
|
+
` Storage: Using local disk ${import_picocolors3.default.dim("(./public/uploads)")} by default.`
|
|
29101
|
+
);
|
|
29102
|
+
lines.push(" See docs to configure S3, Vercel Blob, or other providers.");
|
|
28713
29103
|
}
|
|
28714
|
-
lines.push(
|
|
28715
|
-
` ${import_picocolors3.default.bold(devCommand)} will create system tables on first run.`
|
|
28716
|
-
);
|
|
28717
|
-
if (projectType === "blog") {
|
|
28718
|
-
lines.push(` Visit ${import_picocolors3.default.cyan("http://localhost:3000")} to see your blog.`);
|
|
28719
|
-
}
|
|
28720
|
-
lines.push(
|
|
28721
|
-
` Visit ${import_picocolors3.default.cyan("http://localhost:3000/admin/setup")} to create your admin account.`
|
|
28722
|
-
);
|
|
28723
|
-
lines.push("");
|
|
28724
|
-
lines.push(
|
|
28725
|
-
` Storage: Using local disk ${import_picocolors3.default.dim("(./public/uploads)")} by default.`
|
|
28726
|
-
);
|
|
28727
|
-
lines.push(" See docs to configure S3, Vercel Blob, or other providers.");
|
|
28728
29104
|
Vt2(lines.join("\n"), "Next steps");
|
|
28729
29105
|
capture("scaffold_completed", {
|
|
28730
29106
|
total_duration_ms: Date.now() - overallStartedAt,
|
|
@@ -28747,6 +29123,6 @@ async function createNextly(options = {}) {
|
|
|
28747
29123
|
*)
|
|
28748
29124
|
*/
|
|
28749
29125
|
|
|
28750
|
-
export { __commonJS, __require, __toESM, capture, createNextly, init, shutdown };
|
|
28751
|
-
//# sourceMappingURL=chunk-
|
|
28752
|
-
//# sourceMappingURL=chunk-
|
|
29126
|
+
export { __commonJS, __require, __toESM, capture, createNextly, init, resolveProjectArg, shutdown, validateProjectName };
|
|
29127
|
+
//# sourceMappingURL=chunk-C5CWOU22.mjs.map
|
|
29128
|
+
//# sourceMappingURL=chunk-C5CWOU22.mjs.map
|