create-nextly-app 0.0.2-alpha.1 → 0.0.2-alpha.11
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-RPGFJSDP.mjs} +937 -854
- package/dist/chunk-RPGFJSDP.mjs.map +1 -0
- package/dist/cli.cjs +956 -875
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +24 -27
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +1026 -941
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/templates/base/.env.example +16 -0
- package/templates/base/README.md +30 -0
- package/templates/base/eslint.config.mjs +18 -0
- package/templates/base/next.config.ts +21 -0
- package/templates/base/postcss.config.mjs +7 -0
- package/templates/base/public/file.svg +1 -0
- package/templates/base/public/globe.svg +1 -0
- package/templates/base/public/next.svg +1 -0
- package/templates/base/public/vercel.svg +1 -0
- package/templates/base/public/window.svg +1 -0
- package/templates/base/src/app/admin/[[...params]]/layout.tsx +20 -0
- package/templates/base/src/app/admin/[[...params]]/page.tsx +18 -0
- package/templates/base/src/app/admin/api/[[...params]]/route.ts +12 -0
- package/templates/base/src/app/api/health/route.ts +7 -0
- package/templates/base/src/app/api/media/[[...path]]/route.ts +34 -0
- package/templates/base/src/app/favicon.ico +0 -0
- package/templates/base/src/app/globals.css +55 -0
- package/templates/base/src/app/layout.tsx +43 -0
- package/templates/base/src/app/page.tsx +65 -0
- package/templates/base/src/types/generated/.gitkeep +0 -0
- package/templates/base/src/types/generated/nextly-types.ts +12 -0
- package/templates/base/tsconfig.json +35 -0
- package/templates/blank/.env.example +8 -0
- package/templates/blank/README.md +63 -0
- package/templates/blank/nextly.config.ts +14 -0
- package/templates/blank/src/access/README.md +22 -0
- package/templates/blank/src/app/(frontend)/page.tsx +176 -0
- package/templates/blank/src/app/globals.css +79 -0
- package/templates/blank/src/app/layout.tsx +46 -0
- package/templates/blank/src/collections/README.md +22 -0
- package/templates/blank/src/components/README.md +10 -0
- package/templates/blank/src/components/ThemeToggle.tsx +113 -0
- package/templates/blank/src/lib/README.md +15 -0
- package/templates/blank/src/singles/README.md +19 -0
- package/templates/blank/template.json +14 -0
- package/dist/chunk-AYJ2RKVJ.mjs.map +0 -1
|
@@ -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(" ");
|
|
@@ -17113,6 +17113,29 @@ async function shutdown() {
|
|
|
17113
17113
|
if (!state || !state.client) return;
|
|
17114
17114
|
await state.client.shutdown();
|
|
17115
17115
|
}
|
|
17116
|
+
function resolveProjectArg(directory) {
|
|
17117
|
+
const trimmed = directory?.trim();
|
|
17118
|
+
if (!trimmed) {
|
|
17119
|
+
return { projectName: void 0, installInCwd: false };
|
|
17120
|
+
}
|
|
17121
|
+
if (trimmed === "." || trimmed === "./") {
|
|
17122
|
+
return { projectName: void 0, installInCwd: true };
|
|
17123
|
+
}
|
|
17124
|
+
return { projectName: path.basename(trimmed), installInCwd: false };
|
|
17125
|
+
}
|
|
17126
|
+
function validateProjectName(name) {
|
|
17127
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(name)) {
|
|
17128
|
+
return "Use lowercase letters, numbers, hyphens, dots, or underscores";
|
|
17129
|
+
}
|
|
17130
|
+
return void 0;
|
|
17131
|
+
}
|
|
17132
|
+
function validateProjectNamePromptInput(value) {
|
|
17133
|
+
const trimmed = (value ?? "").trim();
|
|
17134
|
+
if (trimmed === "") return void 0;
|
|
17135
|
+
if (trimmed === "." || trimmed === "./") return void 0;
|
|
17136
|
+
const candidate = trimmed.startsWith("./") ? trimmed.slice(2) : trimmed;
|
|
17137
|
+
return validateProjectName(path.basename(candidate));
|
|
17138
|
+
}
|
|
17116
17139
|
|
|
17117
17140
|
// ../../node_modules/.pnpm/@clack+core@1.1.0/node_modules/@clack/core/dist/index.mjs
|
|
17118
17141
|
var import_sisteransi = __toESM(require_src(), 1);
|
|
@@ -17995,7 +18018,7 @@ ${l}
|
|
|
17995
18018
|
} }).prompt();
|
|
17996
18019
|
|
|
17997
18020
|
// src/create-nextly.ts
|
|
17998
|
-
var
|
|
18021
|
+
var import_fs_extra13 = __toESM(require_lib(), 1);
|
|
17999
18022
|
var import_picocolors3 = __toESM(require_picocolors2(), 1);
|
|
18000
18023
|
|
|
18001
18024
|
// src/generators/admin.ts
|
|
@@ -18003,9 +18026,6 @@ var import_fs_extra = __toESM(require_lib(), 1);
|
|
|
18003
18026
|
var ADMIN_PAGE_TEMPLATE = `"use client";
|
|
18004
18027
|
|
|
18005
18028
|
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
18029
|
import { RootLayout, QueryProvider, ErrorBoundary } from "@nextlyhq/admin";
|
|
18010
18030
|
|
|
18011
18031
|
export default function AdminPage() {
|
|
@@ -22554,13 +22574,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state: state2, verboseInfo, e
|
|
|
22554
22574
|
}
|
|
22555
22575
|
};
|
|
22556
22576
|
var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
22557
|
-
for (const { path:
|
|
22558
|
-
const pathString = typeof
|
|
22577
|
+
for (const { path: path21, append } of stdioItems.filter(({ type }) => FILE_TYPES.has(type))) {
|
|
22578
|
+
const pathString = typeof path21 === "string" ? path21 : path21.toString();
|
|
22559
22579
|
if (append || outputFiles.has(pathString)) {
|
|
22560
|
-
appendFileSync(
|
|
22580
|
+
appendFileSync(path21, serializedResult);
|
|
22561
22581
|
} else {
|
|
22562
22582
|
outputFiles.add(pathString);
|
|
22563
|
-
writeFileSync$1(
|
|
22583
|
+
writeFileSync$1(path21, serializedResult);
|
|
22564
22584
|
}
|
|
22565
22585
|
}
|
|
22566
22586
|
};
|
|
@@ -24856,90 +24876,403 @@ createExeca(mapNode);
|
|
|
24856
24876
|
createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync);
|
|
24857
24877
|
getIpcExport();
|
|
24858
24878
|
|
|
24859
|
-
// src/
|
|
24860
|
-
var
|
|
24861
|
-
|
|
24862
|
-
|
|
24863
|
-
|
|
24864
|
-
|
|
24879
|
+
// src/utils/template.ts
|
|
24880
|
+
var import_fs_extra8 = __toESM(require_lib(), 1);
|
|
24881
|
+
var PROJECT_TYPES_WITH_FORM_BUILDER = /* @__PURE__ */ new Set([
|
|
24882
|
+
"blog"
|
|
24883
|
+
]);
|
|
24884
|
+
function projectUsesFormBuilder(projectType) {
|
|
24885
|
+
return PROJECT_TYPES_WITH_FORM_BUILDER.has(projectType);
|
|
24886
|
+
}
|
|
24887
|
+
var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
24888
|
+
".ts",
|
|
24889
|
+
".tsx",
|
|
24890
|
+
".js",
|
|
24891
|
+
".jsx",
|
|
24892
|
+
".json",
|
|
24893
|
+
".env",
|
|
24894
|
+
".md",
|
|
24895
|
+
".css",
|
|
24896
|
+
".html",
|
|
24897
|
+
".mjs",
|
|
24898
|
+
".cjs"
|
|
24899
|
+
]);
|
|
24900
|
+
var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
|
|
24901
|
+
function resolveTemplatePath(localTemplatePath) {
|
|
24902
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
24903
|
+
const fromDist = path.resolve(__dirname, "../templates");
|
|
24904
|
+
if (import_fs_extra8.default.existsSync(fromDist)) {
|
|
24905
|
+
return fromDist;
|
|
24906
|
+
}
|
|
24907
|
+
const fromSrc = path.resolve(__dirname, "../../templates");
|
|
24908
|
+
if (import_fs_extra8.default.existsSync(fromSrc)) {
|
|
24909
|
+
return fromSrc;
|
|
24910
|
+
}
|
|
24911
|
+
throw new Error(
|
|
24912
|
+
"Could not find templates directory. Use --local-template to specify the templates path, or ensure templates are bundled."
|
|
24913
|
+
);
|
|
24914
|
+
}
|
|
24915
|
+
function buildPlaceholderMap(options) {
|
|
24916
|
+
const { database, databaseUrl } = options;
|
|
24917
|
+
return {
|
|
24918
|
+
"{{databaseDialect}}": database.type,
|
|
24919
|
+
"{{databaseUrl}}": databaseUrl || database.envExample
|
|
24920
|
+
};
|
|
24921
|
+
}
|
|
24922
|
+
async function replacePlaceholdersInFile(filePath, placeholders) {
|
|
24923
|
+
const ext = path.extname(filePath).toLowerCase();
|
|
24924
|
+
const basename = path.basename(filePath);
|
|
24925
|
+
const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
|
|
24926
|
+
if (!isTextFile) return;
|
|
24927
|
+
let content = await import_fs_extra8.default.readFile(filePath, "utf-8");
|
|
24928
|
+
let changed = false;
|
|
24929
|
+
for (const [placeholder, value] of Object.entries(placeholders)) {
|
|
24930
|
+
if (content.includes(placeholder)) {
|
|
24931
|
+
content = content.replaceAll(placeholder, value);
|
|
24932
|
+
changed = true;
|
|
24933
|
+
}
|
|
24934
|
+
}
|
|
24935
|
+
if (changed) {
|
|
24936
|
+
await import_fs_extra8.default.writeFile(filePath, content, "utf-8");
|
|
24937
|
+
}
|
|
24938
|
+
}
|
|
24939
|
+
async function replacePlaceholders(dir, placeholders) {
|
|
24940
|
+
const entries = await import_fs_extra8.default.readdir(dir, { withFileTypes: true });
|
|
24941
|
+
for (const entry of entries) {
|
|
24942
|
+
const fullPath = path.join(dir, entry.name);
|
|
24943
|
+
if (entry.isDirectory()) {
|
|
24944
|
+
if (entry.name === "node_modules" || entry.name === ".git") continue;
|
|
24945
|
+
await replacePlaceholders(fullPath, placeholders);
|
|
24946
|
+
} else if (entry.isFile()) {
|
|
24947
|
+
await replacePlaceholdersInFile(fullPath, placeholders);
|
|
24948
|
+
}
|
|
24949
|
+
}
|
|
24950
|
+
}
|
|
24951
|
+
var PINNED_VERSIONS = {
|
|
24952
|
+
// Next.js ecosystem — resolved at runtime via fetchLatestVersion()
|
|
24953
|
+
// (see generatePackageJson)
|
|
24954
|
+
react: "^19.1.0",
|
|
24955
|
+
"react-dom": "^19.1.0",
|
|
24956
|
+
// Dev dependencies
|
|
24957
|
+
typescript: "^5",
|
|
24958
|
+
"@types/node": "^20",
|
|
24959
|
+
"@types/react": "^19",
|
|
24960
|
+
"@types/react-dom": "^19",
|
|
24961
|
+
"@tailwindcss/postcss": "^4",
|
|
24962
|
+
tailwindcss: "^4",
|
|
24963
|
+
eslint: "^9"
|
|
24865
24964
|
};
|
|
24866
|
-
var
|
|
24965
|
+
var RUNTIME_RESOLVED_PACKAGES = ["next", "eslint-config-next"];
|
|
24966
|
+
var NEXTLY_PACKAGES = [
|
|
24867
24967
|
"nextly",
|
|
24868
24968
|
"@nextlyhq/admin",
|
|
24869
24969
|
"@nextlyhq/adapter-drizzle",
|
|
24870
|
-
"@nextlyhq/ui",
|
|
24871
|
-
"@tanstack/react-query"
|
|
24872
|
-
];
|
|
24873
|
-
var ALL_ADAPTER_PACKAGES = [
|
|
24874
24970
|
"@nextlyhq/adapter-postgres",
|
|
24875
24971
|
"@nextlyhq/adapter-mysql",
|
|
24876
24972
|
"@nextlyhq/adapter-sqlite"
|
|
24877
24973
|
];
|
|
24878
|
-
var
|
|
24879
|
-
|
|
24880
|
-
|
|
24881
|
-
|
|
24882
|
-
|
|
24974
|
+
var resolvedNextlyVersions = null;
|
|
24975
|
+
async function fetchLatestVersion(pkg) {
|
|
24976
|
+
try {
|
|
24977
|
+
const res = await fetch(
|
|
24978
|
+
`https://registry.npmjs.org/-/package/${encodeURIComponent(pkg)}/dist-tags`,
|
|
24979
|
+
{ signal: AbortSignal.timeout(5e3) }
|
|
24980
|
+
);
|
|
24981
|
+
if (!res.ok) return "latest";
|
|
24982
|
+
const data = await res.json();
|
|
24983
|
+
return data.latest ? `^${data.latest}` : "latest";
|
|
24984
|
+
} catch {
|
|
24985
|
+
return "latest";
|
|
24986
|
+
}
|
|
24883
24987
|
}
|
|
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
|
-
|
|
24988
|
+
async function resolveNextlyVersions() {
|
|
24989
|
+
if (resolvedNextlyVersions) return resolvedNextlyVersions;
|
|
24990
|
+
const entries = await Promise.all(
|
|
24991
|
+
NEXTLY_PACKAGES.map(
|
|
24992
|
+
async (pkg) => [pkg, await fetchLatestVersion(pkg)]
|
|
24993
|
+
)
|
|
24994
|
+
);
|
|
24995
|
+
resolvedNextlyVersions = Object.fromEntries(entries);
|
|
24996
|
+
return resolvedNextlyVersions;
|
|
24997
|
+
}
|
|
24998
|
+
var resolvedRuntimeVersions = null;
|
|
24999
|
+
async function resolveRuntimeVersions() {
|
|
25000
|
+
if (resolvedRuntimeVersions) return resolvedRuntimeVersions;
|
|
25001
|
+
const FALLBACKS = {
|
|
25002
|
+
next: "^16.1.0",
|
|
25003
|
+
"eslint-config-next": "^16.1.0"
|
|
25004
|
+
};
|
|
25005
|
+
const entries = await Promise.all(
|
|
25006
|
+
RUNTIME_RESOLVED_PACKAGES.map(async (pkg) => {
|
|
25007
|
+
const version2 = await fetchLatestVersion(pkg);
|
|
25008
|
+
return [pkg, version2 === "latest" ? FALLBACKS[pkg] : version2];
|
|
25009
|
+
})
|
|
25010
|
+
);
|
|
25011
|
+
resolvedRuntimeVersions = Object.fromEntries(entries);
|
|
25012
|
+
return resolvedRuntimeVersions;
|
|
25013
|
+
}
|
|
25014
|
+
async function generatePackageJson(projectName, database, useYalc = false, projectType = "blank") {
|
|
25015
|
+
const runtimeVersions = await resolveRuntimeVersions();
|
|
25016
|
+
const dependencies = {
|
|
25017
|
+
next: runtimeVersions.next,
|
|
25018
|
+
react: PINNED_VERSIONS.react,
|
|
25019
|
+
"react-dom": PINNED_VERSIONS["react-dom"]
|
|
25020
|
+
};
|
|
25021
|
+
dependencies["@tanstack/react-query"] = "^5.62.0";
|
|
25022
|
+
if (!useYalc) {
|
|
25023
|
+
const versions = await resolveNextlyVersions();
|
|
25024
|
+
dependencies["nextly"] = versions["nextly"];
|
|
25025
|
+
dependencies["@nextlyhq/admin"] = versions["@nextlyhq/admin"];
|
|
25026
|
+
dependencies["@nextlyhq/ui"] = versions["@nextlyhq/ui"] || "latest";
|
|
25027
|
+
dependencies["@nextlyhq/adapter-drizzle"] = versions["@nextlyhq/adapter-drizzle"];
|
|
25028
|
+
dependencies[database.adapter] = versions[database.adapter] || "latest";
|
|
25029
|
+
if (projectUsesFormBuilder(projectType)) {
|
|
25030
|
+
dependencies["@nextlyhq/plugin-form-builder"] = versions["@nextlyhq/plugin-form-builder"] || "latest";
|
|
24926
25031
|
}
|
|
24927
25032
|
}
|
|
25033
|
+
const devDependencies = {
|
|
25034
|
+
typescript: PINNED_VERSIONS.typescript,
|
|
25035
|
+
"@types/node": PINNED_VERSIONS["@types/node"],
|
|
25036
|
+
"@types/react": PINNED_VERSIONS["@types/react"],
|
|
25037
|
+
"@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
|
|
25038
|
+
"@tailwindcss/postcss": PINNED_VERSIONS["@tailwindcss/postcss"],
|
|
25039
|
+
tailwindcss: PINNED_VERSIONS.tailwindcss,
|
|
25040
|
+
eslint: PINNED_VERSIONS.eslint,
|
|
25041
|
+
"eslint-config-next": runtimeVersions["eslint-config-next"],
|
|
25042
|
+
// Pagefind powers /search in the blog template. Zero-config
|
|
25043
|
+
// static index generated at `next build` time. Templates that
|
|
25044
|
+
// don't ship a /search page simply won't invoke it.
|
|
25045
|
+
pagefind: "^1.1.0"
|
|
25046
|
+
};
|
|
25047
|
+
const pkg = {
|
|
25048
|
+
name: projectName,
|
|
25049
|
+
version: "0.1.0",
|
|
25050
|
+
private: true,
|
|
25051
|
+
scripts: {
|
|
25052
|
+
// F1 PR 4: dev now boots Nextly in single-process mode via `next dev`.
|
|
25053
|
+
// The lazy drizzle-kit/api import (PR 1) plus the in-process HMR
|
|
25054
|
+
// listener (PR 2) replaced the wrapper that previously owned the
|
|
25055
|
+
// terminal, schema prompts, and child supervision. `nextly dev` is
|
|
25056
|
+
// gone; the only supported dev command is the standard `next dev`.
|
|
25057
|
+
dev: "next dev --turbopack",
|
|
25058
|
+
// Build: migrate DB + compile Next.js + (if present) generate
|
|
25059
|
+
// the Pagefind search index. Templates without the search
|
|
25060
|
+
// script silently skip the last step.
|
|
25061
|
+
build: "nextly migrate && next build && (test -f scripts/build-search-index.mjs && node scripts/build-search-index.mjs || true)",
|
|
25062
|
+
"search:index": "node scripts/build-search-index.mjs",
|
|
25063
|
+
start: "next start",
|
|
25064
|
+
lint: "next lint",
|
|
25065
|
+
nextly: "nextly",
|
|
25066
|
+
// First-time setup: sync schema + seed system permissions. Demo
|
|
25067
|
+
// content is seeded separately from the admin UI (visit /welcome
|
|
25068
|
+
// after running `pnpm dev` and completing /admin/setup).
|
|
25069
|
+
"db:setup": "nextly db:sync",
|
|
25070
|
+
"db:migrate": "nextly migrate",
|
|
25071
|
+
"db:migrate:status": "nextly migrate:status",
|
|
25072
|
+
"db:migrate:fresh": "nextly migrate:fresh",
|
|
25073
|
+
"db:migrate:reset": "nextly migrate:reset",
|
|
25074
|
+
"types:generate": "nextly generate:types"
|
|
25075
|
+
},
|
|
25076
|
+
dependencies,
|
|
25077
|
+
devDependencies
|
|
25078
|
+
};
|
|
25079
|
+
return JSON.stringify(pkg, null, 2) + "\n";
|
|
24928
25080
|
}
|
|
24929
|
-
|
|
24930
|
-
|
|
24931
|
-
|
|
24932
|
-
|
|
24933
|
-
|
|
24934
|
-
|
|
24935
|
-
|
|
24936
|
-
|
|
24937
|
-
|
|
24938
|
-
|
|
24939
|
-
|
|
24940
|
-
|
|
24941
|
-
|
|
24942
|
-
|
|
25081
|
+
async function copyTemplate(options) {
|
|
25082
|
+
const {
|
|
25083
|
+
projectName,
|
|
25084
|
+
projectType,
|
|
25085
|
+
targetDir,
|
|
25086
|
+
database,
|
|
25087
|
+
databaseUrl,
|
|
25088
|
+
useYalc = false,
|
|
25089
|
+
approach,
|
|
25090
|
+
templateSource,
|
|
25091
|
+
allowExistingTarget = false
|
|
25092
|
+
} = options;
|
|
25093
|
+
if (!allowExistingTarget && targetDir !== process.cwd() && await import_fs_extra8.default.pathExists(targetDir)) {
|
|
25094
|
+
throw new Error(
|
|
25095
|
+
`Directory "${path.basename(targetDir)}" already exists. Please choose a different name.`
|
|
25096
|
+
);
|
|
25097
|
+
}
|
|
25098
|
+
let baseDir;
|
|
25099
|
+
let typeDir;
|
|
25100
|
+
if (templateSource) {
|
|
25101
|
+
baseDir = templateSource.basePath;
|
|
25102
|
+
typeDir = templateSource.templatePath;
|
|
25103
|
+
} else {
|
|
25104
|
+
const templatesRoot = resolveTemplatePath();
|
|
25105
|
+
baseDir = path.join(templatesRoot, "base");
|
|
25106
|
+
typeDir = path.join(templatesRoot, projectType);
|
|
25107
|
+
}
|
|
25108
|
+
if (!await import_fs_extra8.default.pathExists(baseDir)) {
|
|
25109
|
+
throw new Error(
|
|
25110
|
+
`Base template not found at ${baseDir}. The package may be corrupted or the download failed.`
|
|
25111
|
+
);
|
|
25112
|
+
}
|
|
25113
|
+
if (!await import_fs_extra8.default.pathExists(typeDir)) {
|
|
25114
|
+
throw new Error(
|
|
25115
|
+
`Template "${projectType}" not found at ${typeDir}. Available templates: blank, blog.`
|
|
25116
|
+
);
|
|
25117
|
+
}
|
|
25118
|
+
await import_fs_extra8.default.copy(baseDir, targetDir, {
|
|
25119
|
+
filter: (_src) => {
|
|
25120
|
+
const basename = path.basename(_src);
|
|
25121
|
+
return !SKIP_FILES.has(basename);
|
|
25122
|
+
}
|
|
25123
|
+
});
|
|
25124
|
+
const templateSrcDir = path.join(typeDir, "src");
|
|
25125
|
+
if (await import_fs_extra8.default.pathExists(templateSrcDir)) {
|
|
25126
|
+
await import_fs_extra8.default.copy(templateSrcDir, path.join(targetDir, "src"), {
|
|
25127
|
+
overwrite: true,
|
|
25128
|
+
filter: (_src) => {
|
|
25129
|
+
const basename = path.basename(_src);
|
|
25130
|
+
return !SKIP_FILES.has(basename);
|
|
25131
|
+
}
|
|
25132
|
+
});
|
|
25133
|
+
}
|
|
25134
|
+
const templateRootConfig = path.join(typeDir, "nextly.config.ts");
|
|
25135
|
+
if (await import_fs_extra8.default.pathExists(templateRootConfig)) {
|
|
25136
|
+
await import_fs_extra8.default.copy(
|
|
25137
|
+
templateRootConfig,
|
|
25138
|
+
path.join(targetDir, "nextly.config.ts"),
|
|
25139
|
+
{ overwrite: true }
|
|
25140
|
+
);
|
|
25141
|
+
}
|
|
25142
|
+
const configsDir = path.join(typeDir, "configs");
|
|
25143
|
+
if (approach && await import_fs_extra8.default.pathExists(configsDir)) {
|
|
25144
|
+
const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
|
|
25145
|
+
const configSrc = path.join(configsDir, configFileName);
|
|
25146
|
+
if (await import_fs_extra8.default.pathExists(configSrc)) {
|
|
25147
|
+
await import_fs_extra8.default.copy(configSrc, path.join(targetDir, "nextly.config.ts"), {
|
|
25148
|
+
overwrite: true
|
|
25149
|
+
});
|
|
25150
|
+
}
|
|
25151
|
+
const sharedSrc = path.join(configsDir, "shared.ts");
|
|
25152
|
+
if (await import_fs_extra8.default.pathExists(sharedSrc)) {
|
|
25153
|
+
await import_fs_extra8.default.copy(sharedSrc, path.join(targetDir, "shared.ts"), {
|
|
25154
|
+
overwrite: true
|
|
25155
|
+
});
|
|
25156
|
+
}
|
|
25157
|
+
}
|
|
25158
|
+
const frontendPagePath = path.join(
|
|
25159
|
+
targetDir,
|
|
25160
|
+
"src",
|
|
25161
|
+
"app",
|
|
25162
|
+
"(frontend)",
|
|
25163
|
+
"page.tsx"
|
|
25164
|
+
);
|
|
25165
|
+
const basePagePath = path.join(targetDir, "src", "app", "page.tsx");
|
|
25166
|
+
if (await import_fs_extra8.default.pathExists(frontendPagePath) && await import_fs_extra8.default.pathExists(basePagePath)) {
|
|
25167
|
+
await import_fs_extra8.default.remove(basePagePath);
|
|
25168
|
+
}
|
|
25169
|
+
const packageJsonContent = await generatePackageJson(
|
|
25170
|
+
projectName,
|
|
25171
|
+
database,
|
|
25172
|
+
useYalc,
|
|
25173
|
+
projectType
|
|
25174
|
+
);
|
|
25175
|
+
await import_fs_extra8.default.writeFile(
|
|
25176
|
+
path.join(targetDir, "package.json"),
|
|
25177
|
+
packageJsonContent,
|
|
25178
|
+
"utf-8"
|
|
25179
|
+
);
|
|
25180
|
+
if (database.type === "sqlite") {
|
|
25181
|
+
await import_fs_extra8.default.ensureDir(path.join(targetDir, "data"));
|
|
25182
|
+
}
|
|
25183
|
+
const placeholders = buildPlaceholderMap({ database, databaseUrl });
|
|
25184
|
+
if (approach) {
|
|
25185
|
+
placeholders["{{approach}}"] = approach;
|
|
25186
|
+
}
|
|
25187
|
+
await replacePlaceholders(targetDir, placeholders);
|
|
25188
|
+
}
|
|
25189
|
+
|
|
25190
|
+
// src/installers/dependencies.ts
|
|
25191
|
+
var INSTALL_COMMANDS = {
|
|
25192
|
+
npm: ["npm", "install"],
|
|
25193
|
+
yarn: ["yarn", "add"],
|
|
25194
|
+
pnpm: ["pnpm", "add"],
|
|
25195
|
+
bun: ["bun", "add"]
|
|
25196
|
+
};
|
|
25197
|
+
var CORE_PACKAGES = [
|
|
25198
|
+
"nextly",
|
|
25199
|
+
"@nextlyhq/admin",
|
|
25200
|
+
"@nextlyhq/adapter-drizzle",
|
|
25201
|
+
"@nextlyhq/ui",
|
|
25202
|
+
"@tanstack/react-query"
|
|
25203
|
+
];
|
|
25204
|
+
var ALL_ADAPTER_PACKAGES = [
|
|
25205
|
+
"@nextlyhq/adapter-postgres",
|
|
25206
|
+
"@nextlyhq/adapter-mysql",
|
|
25207
|
+
"@nextlyhq/adapter-sqlite"
|
|
25208
|
+
];
|
|
25209
|
+
var TEMPLATE_PLUGIN_PACKAGES = ["@nextlyhq/plugin-form-builder"];
|
|
25210
|
+
function templatePluginPackages(projectType) {
|
|
25211
|
+
return projectType && projectUsesFormBuilder(projectType) ? TEMPLATE_PLUGIN_PACKAGES : [];
|
|
25212
|
+
}
|
|
25213
|
+
function getPackagesToInstall(database) {
|
|
25214
|
+
return [...CORE_PACKAGES, database.adapter];
|
|
25215
|
+
}
|
|
25216
|
+
async function installDependencies(cwd, projectInfo, database, useYalc = false, isFreshProject = false, projectType) {
|
|
25217
|
+
const pm = projectInfo.packageManager;
|
|
25218
|
+
const pluginPackages = templatePluginPackages(projectType);
|
|
25219
|
+
if (isFreshProject) {
|
|
25220
|
+
if (useYalc) {
|
|
25221
|
+
const yalcPackages = [
|
|
25222
|
+
.../* @__PURE__ */ new Set([
|
|
25223
|
+
"nextly",
|
|
25224
|
+
"@nextlyhq/admin",
|
|
25225
|
+
"@nextlyhq/ui",
|
|
25226
|
+
"@nextlyhq/adapter-drizzle",
|
|
25227
|
+
...ALL_ADAPTER_PACKAGES,
|
|
25228
|
+
...pluginPackages
|
|
25229
|
+
])
|
|
25230
|
+
];
|
|
25231
|
+
await execa(pm, ["install"], { cwd });
|
|
25232
|
+
for (const pkg of yalcPackages) {
|
|
25233
|
+
await execa("yalc", ["add", pkg], { cwd });
|
|
25234
|
+
}
|
|
25235
|
+
await execa(pm, ["install"], { cwd });
|
|
25236
|
+
} else {
|
|
25237
|
+
await execa(pm, ["install"], { cwd });
|
|
25238
|
+
}
|
|
25239
|
+
} else {
|
|
25240
|
+
const allPackages = getPackagesToInstall(database);
|
|
25241
|
+
if (useYalc) {
|
|
25242
|
+
const yalcPackages = [
|
|
25243
|
+
.../* @__PURE__ */ new Set([
|
|
25244
|
+
"nextly",
|
|
25245
|
+
"@nextlyhq/admin",
|
|
25246
|
+
"@nextlyhq/ui",
|
|
25247
|
+
"@nextlyhq/adapter-drizzle",
|
|
25248
|
+
...ALL_ADAPTER_PACKAGES,
|
|
25249
|
+
...pluginPackages
|
|
25250
|
+
])
|
|
25251
|
+
];
|
|
25252
|
+
for (const pkg of yalcPackages) {
|
|
25253
|
+
await execa("yalc", ["add", pkg], { cwd });
|
|
25254
|
+
}
|
|
25255
|
+
await execa(pm, ["install"], { cwd });
|
|
25256
|
+
} else {
|
|
25257
|
+
const [cmd, ...args] = INSTALL_COMMANDS[pm];
|
|
25258
|
+
await execa(cmd, [...args, ...allPackages], { cwd });
|
|
25259
|
+
}
|
|
25260
|
+
}
|
|
25261
|
+
}
|
|
25262
|
+
|
|
25263
|
+
// src/lib/download-template.ts
|
|
25264
|
+
var import_fs_extra9 = __toESM(require_lib(), 1);
|
|
25265
|
+
var kr = Object.defineProperty;
|
|
25266
|
+
var vr = (s3, t2) => {
|
|
25267
|
+
for (var e in t2) kr(s3, e, { get: t2[e], enumerable: true });
|
|
25268
|
+
};
|
|
25269
|
+
var Os = typeof process == "object" && process ? process : { stdout: null, stderr: null };
|
|
25270
|
+
var Br = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof D3 || s3 instanceof Ns || Pr(s3) || zr(s3));
|
|
25271
|
+
var Pr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof EventEmitter && typeof s3.pipe == "function" && s3.pipe !== Ns.Writable.prototype.pipe;
|
|
25272
|
+
var zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
|
|
25273
|
+
var q3 = Symbol("EOF");
|
|
25274
|
+
var j2 = Symbol("maybeEmitEnd");
|
|
25275
|
+
var rt2 = Symbol("emittedEnd");
|
|
24943
25276
|
var Le2 = Symbol("emittingEnd");
|
|
24944
25277
|
var jt2 = Symbol("emittedError");
|
|
24945
25278
|
var Ne2 = Symbol("closed");
|
|
@@ -27004,7 +27337,7 @@ var Vn = 512 * 1024;
|
|
|
27004
27337
|
var $n = pr | ur | dr | mr;
|
|
27005
27338
|
var lr = !fr && typeof ar == "number" ? ar | ur | dr | mr : null;
|
|
27006
27339
|
var cs = lr !== null ? () => lr : Kn ? (s3) => s3 < Vn ? $n : "w" : () => "w";
|
|
27007
|
-
var
|
|
27340
|
+
var fs10 = (s3, t2, e) => {
|
|
27008
27341
|
try {
|
|
27009
27342
|
return fs.lchownSync(s3, t2, e);
|
|
27010
27343
|
} catch (i2) {
|
|
@@ -27044,7 +27377,7 @@ var ds = (s3, t2, e, i2) => {
|
|
|
27044
27377
|
});
|
|
27045
27378
|
};
|
|
27046
27379
|
var qn = (s3, t2, e, i2) => {
|
|
27047
|
-
t2.isDirectory() && us(path.resolve(s3, t2.name), e, i2),
|
|
27380
|
+
t2.isDirectory() && us(path.resolve(s3, t2.name), e, i2), fs10(path.resolve(s3, t2.name), e, i2);
|
|
27048
27381
|
};
|
|
27049
27382
|
var us = (s3, t2, e) => {
|
|
27050
27383
|
let i2;
|
|
@@ -27053,11 +27386,11 @@ var us = (s3, t2, e) => {
|
|
|
27053
27386
|
} catch (r) {
|
|
27054
27387
|
let n2 = r;
|
|
27055
27388
|
if (n2?.code === "ENOENT") return;
|
|
27056
|
-
if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return
|
|
27389
|
+
if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return fs10(s3, t2, e);
|
|
27057
27390
|
throw n2;
|
|
27058
27391
|
}
|
|
27059
27392
|
for (let r of i2) qn(s3, r, t2, e);
|
|
27060
|
-
return
|
|
27393
|
+
return fs10(s3, t2, e);
|
|
27061
27394
|
};
|
|
27062
27395
|
var we2 = class extends Error {
|
|
27063
27396
|
path;
|
|
@@ -27802,7 +28135,7 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
27802
28135
|
process.env.TMPDIR || "/tmp",
|
|
27803
28136
|
`nextly-template-${Date.now()}`
|
|
27804
28137
|
);
|
|
27805
|
-
await
|
|
28138
|
+
await import_fs_extra9.default.ensureDir(tmpDir);
|
|
27806
28139
|
const repoPrefix = `${GITHUB_REPO}-${branch}`;
|
|
27807
28140
|
const baseFilter = `${repoPrefix}/templates/base/`;
|
|
27808
28141
|
const templateFilter = `${repoPrefix}/templates/${templateName}/`;
|
|
@@ -27831,7 +28164,7 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
27831
28164
|
})
|
|
27832
28165
|
);
|
|
27833
28166
|
} catch (error) {
|
|
27834
|
-
await
|
|
28167
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
27835
28168
|
});
|
|
27836
28169
|
if (error instanceof Error && error.name === "TimeoutError") {
|
|
27837
28170
|
throw new Error(
|
|
@@ -27842,15 +28175,15 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
27842
28175
|
}
|
|
27843
28176
|
const basePath = path.join(tmpDir, "templates", "base");
|
|
27844
28177
|
const templatePath = path.join(tmpDir, "templates", templateName);
|
|
27845
|
-
if (!await
|
|
27846
|
-
await
|
|
28178
|
+
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
28179
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
27847
28180
|
});
|
|
27848
28181
|
throw new Error(
|
|
27849
28182
|
`Base template not found in downloaded archive. The branch "${branch}" may not contain templates.`
|
|
27850
28183
|
);
|
|
27851
28184
|
}
|
|
27852
|
-
if (!await
|
|
27853
|
-
await
|
|
28185
|
+
if (!await import_fs_extra9.default.pathExists(templatePath)) {
|
|
28186
|
+
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
27854
28187
|
});
|
|
27855
28188
|
throw new Error(
|
|
27856
28189
|
`Template "${templateName}" not found in downloaded archive. Available templates may differ on branch "${branch}".`
|
|
@@ -27861,12 +28194,12 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
27861
28194
|
async function resolveLocalTemplate(localPath, templateName) {
|
|
27862
28195
|
const basePath = path.join(localPath, "base");
|
|
27863
28196
|
const templatePath = path.join(localPath, templateName);
|
|
27864
|
-
if (!await
|
|
28197
|
+
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
27865
28198
|
throw new Error(
|
|
27866
28199
|
`Base template not found at ${basePath}. Check the --local-template path points to the templates/ directory.`
|
|
27867
28200
|
);
|
|
27868
28201
|
}
|
|
27869
|
-
if (!await
|
|
28202
|
+
if (!await import_fs_extra9.default.pathExists(templatePath)) {
|
|
27870
28203
|
throw new Error(
|
|
27871
28204
|
`Template "${templateName}" not found at ${templatePath}. Check the --local-template path points to the templates/ directory.`
|
|
27872
28205
|
);
|
|
@@ -27884,7 +28217,7 @@ async function cleanupDownload(source) {
|
|
|
27884
28217
|
const tmpBase = process.env.TMPDIR || "/tmp";
|
|
27885
28218
|
if (source.basePath.startsWith(tmpBase)) {
|
|
27886
28219
|
const extractionRoot = path.resolve(source.basePath, "../..");
|
|
27887
|
-
await
|
|
28220
|
+
await import_fs_extra9.default.remove(extractionRoot).catch(() => {
|
|
27888
28221
|
});
|
|
27889
28222
|
}
|
|
27890
28223
|
}
|
|
@@ -27986,14 +28319,12 @@ var DATABASE_LABELS = {
|
|
|
27986
28319
|
hint: "Popular alternative for production"
|
|
27987
28320
|
}
|
|
27988
28321
|
};
|
|
27989
|
-
|
|
27990
|
-
// src/prompts/project-name.ts
|
|
27991
|
-
var import_fs_extra9 = __toESM(require_lib(), 1);
|
|
28322
|
+
var import_fs_extra10 = __toESM(require_lib(), 1);
|
|
27992
28323
|
async function isExistingNextProject(cwd) {
|
|
27993
28324
|
const packageJsonPath = path.join(cwd, "package.json");
|
|
27994
|
-
if (!await
|
|
28325
|
+
if (!await import_fs_extra10.default.pathExists(packageJsonPath)) return false;
|
|
27995
28326
|
try {
|
|
27996
|
-
const packageJson = await
|
|
28327
|
+
const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
|
|
27997
28328
|
const deps = {
|
|
27998
28329
|
...packageJson.dependencies,
|
|
27999
28330
|
...packageJson.devDependencies
|
|
@@ -28003,6 +28334,42 @@ async function isExistingNextProject(cwd) {
|
|
|
28003
28334
|
return false;
|
|
28004
28335
|
}
|
|
28005
28336
|
}
|
|
28337
|
+
var DEFAULT_PROJECT_NAME = "my-nextly-app";
|
|
28338
|
+
async function promptForProjectName() {
|
|
28339
|
+
const answer = await Zt({
|
|
28340
|
+
message: "What should your project be called?",
|
|
28341
|
+
// `initialValue` pre-fills the buffer so Enter accepts the default.
|
|
28342
|
+
// The previous version used `placeholder` alone, which returned an
|
|
28343
|
+
// empty string on Enter and silently fell through to a cwd install —
|
|
28344
|
+
// the root cause of the original bug. `placeholder` is omitted here
|
|
28345
|
+
// because clack only shows it when the buffer is empty, and the
|
|
28346
|
+
// initialValue keeps it populated.
|
|
28347
|
+
initialValue: DEFAULT_PROJECT_NAME,
|
|
28348
|
+
validate: validateProjectNamePromptInput
|
|
28349
|
+
});
|
|
28350
|
+
if (Ct(answer)) {
|
|
28351
|
+
return { kind: "cancelled" };
|
|
28352
|
+
}
|
|
28353
|
+
return { kind: "resolved", value: resolveProjectArg(answer) };
|
|
28354
|
+
}
|
|
28355
|
+
async function promptDirectoryConflict(targetLabel) {
|
|
28356
|
+
const choice = await Jt({
|
|
28357
|
+
message: `Target directory ${targetLabel} is not empty. How would you like to proceed?`,
|
|
28358
|
+
options: [
|
|
28359
|
+
{ value: "cancel", label: "Cancel operation" },
|
|
28360
|
+
{
|
|
28361
|
+
value: "remove",
|
|
28362
|
+
label: "Remove existing files and continue"
|
|
28363
|
+
},
|
|
28364
|
+
{
|
|
28365
|
+
value: "ignore",
|
|
28366
|
+
label: "Ignore files and continue"
|
|
28367
|
+
}
|
|
28368
|
+
]
|
|
28369
|
+
});
|
|
28370
|
+
if (Ct(choice)) return "cancel";
|
|
28371
|
+
return choice;
|
|
28372
|
+
}
|
|
28006
28373
|
|
|
28007
28374
|
// src/prompts/template.ts
|
|
28008
28375
|
var import_picocolors2 = __toESM(require_picocolors2(), 1);
|
|
@@ -28030,7 +28397,7 @@ function isValidTemplateSelection(value) {
|
|
|
28030
28397
|
}
|
|
28031
28398
|
|
|
28032
28399
|
// src/utils/detect.ts
|
|
28033
|
-
var
|
|
28400
|
+
var import_fs_extra11 = __toESM(require_lib(), 1);
|
|
28034
28401
|
|
|
28035
28402
|
// src/utils/detect-pm-from-user-agent.ts
|
|
28036
28403
|
function detectPmFromUserAgent(userAgent) {
|
|
@@ -28046,19 +28413,19 @@ function detectPmFromUserAgent(userAgent) {
|
|
|
28046
28413
|
async function detectPackageManager2(cwd) {
|
|
28047
28414
|
const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
|
|
28048
28415
|
if (fromUa) return fromUa;
|
|
28049
|
-
if (await
|
|
28050
|
-
if (await
|
|
28051
|
-
if (await
|
|
28416
|
+
if (await import_fs_extra11.default.pathExists(path.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
28417
|
+
if (await import_fs_extra11.default.pathExists(path.join(cwd, "yarn.lock"))) return "yarn";
|
|
28418
|
+
if (await import_fs_extra11.default.pathExists(path.join(cwd, "bun.lockb"))) return "bun";
|
|
28052
28419
|
return "npm";
|
|
28053
28420
|
}
|
|
28054
28421
|
async function detectProject(cwd) {
|
|
28055
28422
|
const packageJsonPath = path.join(cwd, "package.json");
|
|
28056
|
-
if (!await
|
|
28423
|
+
if (!await import_fs_extra11.default.pathExists(packageJsonPath)) {
|
|
28057
28424
|
throw new Error(
|
|
28058
28425
|
"No package.json found. Please run this command in a Next.js project."
|
|
28059
28426
|
);
|
|
28060
28427
|
}
|
|
28061
|
-
const packageJson = await
|
|
28428
|
+
const packageJson = await import_fs_extra11.default.readJson(packageJsonPath);
|
|
28062
28429
|
const deps = {
|
|
28063
28430
|
...packageJson.dependencies,
|
|
28064
28431
|
...packageJson.devDependencies
|
|
@@ -28070,11 +28437,11 @@ async function detectProject(cwd) {
|
|
|
28070
28437
|
);
|
|
28071
28438
|
}
|
|
28072
28439
|
const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
|
|
28073
|
-
const srcDir = await
|
|
28440
|
+
const srcDir = await import_fs_extra11.default.pathExists(path.join(cwd, "src"));
|
|
28074
28441
|
const appDirPaths = srcDir ? [path.join(cwd, "src", "app")] : [path.join(cwd, "app")];
|
|
28075
28442
|
let isAppRouter = false;
|
|
28076
28443
|
for (const appPath of appDirPaths) {
|
|
28077
|
-
if (await
|
|
28444
|
+
if (await import_fs_extra11.default.pathExists(appPath)) {
|
|
28078
28445
|
isAppRouter = true;
|
|
28079
28446
|
break;
|
|
28080
28447
|
}
|
|
@@ -28084,7 +28451,7 @@ async function detectProject(cwd) {
|
|
|
28084
28451
|
"App Router not detected. Nextly requires Next.js App Router (app/ directory)."
|
|
28085
28452
|
);
|
|
28086
28453
|
}
|
|
28087
|
-
const hasTypescript = await
|
|
28454
|
+
const hasTypescript = await import_fs_extra11.default.pathExists(path.join(cwd, "tsconfig.json"));
|
|
28088
28455
|
const packageManager = await detectPackageManager2(cwd);
|
|
28089
28456
|
const appDir = srcDir ? "src/app" : "app";
|
|
28090
28457
|
return {
|
|
@@ -28098,315 +28465,36 @@ async function detectProject(cwd) {
|
|
|
28098
28465
|
};
|
|
28099
28466
|
}
|
|
28100
28467
|
|
|
28101
|
-
// src/utils/
|
|
28102
|
-
var
|
|
28103
|
-
|
|
28104
|
-
|
|
28105
|
-
|
|
28106
|
-
".
|
|
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
|
-
}
|
|
28203
|
-
}
|
|
28204
|
-
async function resolveNextlyVersions() {
|
|
28205
|
-
if (resolvedNextlyVersions) return resolvedNextlyVersions;
|
|
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;
|
|
28213
|
-
}
|
|
28214
|
-
var resolvedRuntimeVersions = null;
|
|
28215
|
-
async function resolveRuntimeVersions() {
|
|
28216
|
-
if (resolvedRuntimeVersions) return resolvedRuntimeVersions;
|
|
28217
|
-
const FALLBACKS = {
|
|
28218
|
-
next: "^16.1.0",
|
|
28219
|
-
"eslint-config-next": "^16.1.0"
|
|
28220
|
-
};
|
|
28221
|
-
const entries = await Promise.all(
|
|
28222
|
-
RUNTIME_RESOLVED_PACKAGES.map(async (pkg) => {
|
|
28223
|
-
const version2 = await fetchLatestVersion(pkg);
|
|
28224
|
-
return [pkg, version2 === "latest" ? FALLBACKS[pkg] : version2];
|
|
28225
|
-
})
|
|
28226
|
-
);
|
|
28227
|
-
resolvedRuntimeVersions = Object.fromEntries(entries);
|
|
28228
|
-
return resolvedRuntimeVersions;
|
|
28229
|
-
}
|
|
28230
|
-
async function generatePackageJson(projectName, database, useYalc = false) {
|
|
28231
|
-
const runtimeVersions = await resolveRuntimeVersions();
|
|
28232
|
-
const dependencies = {
|
|
28233
|
-
next: runtimeVersions.next,
|
|
28234
|
-
react: PINNED_VERSIONS.react,
|
|
28235
|
-
"react-dom": PINNED_VERSIONS["react-dom"]
|
|
28236
|
-
};
|
|
28237
|
-
dependencies["@tanstack/react-query"] = "^5.62.0";
|
|
28238
|
-
if (!useYalc) {
|
|
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";
|
|
28468
|
+
// src/utils/fs.ts
|
|
28469
|
+
var import_fs_extra12 = __toESM(require_lib(), 1);
|
|
28470
|
+
async function isDirectoryNotEmpty(dir) {
|
|
28471
|
+
if (!await import_fs_extra12.default.pathExists(dir)) return false;
|
|
28472
|
+
const entries = await import_fs_extra12.default.readdir(dir);
|
|
28473
|
+
return entries.some((entry) => entry !== ".git");
|
|
28294
28474
|
}
|
|
28295
|
-
async function
|
|
28296
|
-
|
|
28297
|
-
|
|
28298
|
-
|
|
28299
|
-
|
|
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)) {
|
|
28322
|
-
throw new Error(
|
|
28323
|
-
`Base template not found at ${baseDir}. The package may be corrupted or the download failed.`
|
|
28324
|
-
);
|
|
28325
|
-
}
|
|
28326
|
-
if (!await import_fs_extra11.default.pathExists(typeDir)) {
|
|
28327
|
-
throw new Error(
|
|
28328
|
-
`Template "${projectType}" not found at ${typeDir}. Available templates: blank, blog.`
|
|
28329
|
-
);
|
|
28330
|
-
}
|
|
28331
|
-
await import_fs_extra11.default.copy(baseDir, targetDir, {
|
|
28332
|
-
filter: (_src) => {
|
|
28333
|
-
const basename = path.basename(_src);
|
|
28334
|
-
return !SKIP_FILES.has(basename);
|
|
28335
|
-
}
|
|
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
|
-
});
|
|
28475
|
+
async function emptyDirectory(dir) {
|
|
28476
|
+
if (!await import_fs_extra12.default.pathExists(dir)) return;
|
|
28477
|
+
for (const entry of await import_fs_extra12.default.readdir(dir)) {
|
|
28478
|
+
if (entry === ".git") continue;
|
|
28479
|
+
await import_fs_extra12.default.remove(path.join(dir, entry));
|
|
28346
28480
|
}
|
|
28347
|
-
const templateRootConfig = path.join(typeDir, "nextly.config.ts");
|
|
28348
|
-
if (await import_fs_extra11.default.pathExists(templateRootConfig)) {
|
|
28349
|
-
await import_fs_extra11.default.copy(
|
|
28350
|
-
templateRootConfig,
|
|
28351
|
-
path.join(targetDir, "nextly.config.ts"),
|
|
28352
|
-
{ overwrite: true }
|
|
28353
|
-
);
|
|
28354
|
-
}
|
|
28355
|
-
const configsDir = path.join(typeDir, "configs");
|
|
28356
|
-
if (approach && await import_fs_extra11.default.pathExists(configsDir)) {
|
|
28357
|
-
const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
|
|
28358
|
-
const configSrc = path.join(configsDir, configFileName);
|
|
28359
|
-
if (await import_fs_extra11.default.pathExists(configSrc)) {
|
|
28360
|
-
await import_fs_extra11.default.copy(configSrc, path.join(targetDir, "nextly.config.ts"), {
|
|
28361
|
-
overwrite: true
|
|
28362
|
-
});
|
|
28363
|
-
}
|
|
28364
|
-
const sharedSrc = path.join(configsDir, "shared.ts");
|
|
28365
|
-
if (await import_fs_extra11.default.pathExists(sharedSrc)) {
|
|
28366
|
-
await import_fs_extra11.default.copy(sharedSrc, path.join(targetDir, "shared.ts"), {
|
|
28367
|
-
overwrite: true
|
|
28368
|
-
});
|
|
28369
|
-
}
|
|
28370
|
-
}
|
|
28371
|
-
const frontendPagePath = path.join(
|
|
28372
|
-
targetDir,
|
|
28373
|
-
"src",
|
|
28374
|
-
"app",
|
|
28375
|
-
"(frontend)",
|
|
28376
|
-
"page.tsx"
|
|
28377
|
-
);
|
|
28378
|
-
const basePagePath = path.join(targetDir, "src", "app", "page.tsx");
|
|
28379
|
-
if (await import_fs_extra11.default.pathExists(frontendPagePath) && await import_fs_extra11.default.pathExists(basePagePath)) {
|
|
28380
|
-
await import_fs_extra11.default.remove(basePagePath);
|
|
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;
|
|
28398
|
-
}
|
|
28399
|
-
await replacePlaceholders(targetDir, placeholders);
|
|
28400
28481
|
}
|
|
28401
28482
|
|
|
28402
28483
|
// src/create-nextly.ts
|
|
28484
|
+
function cwdProjectName(cwd) {
|
|
28485
|
+
const basename = path.basename(cwd);
|
|
28486
|
+
if (!/^[a-z0-9][a-z0-9._-]*$/.test(basename)) {
|
|
28487
|
+
return DEFAULT_PROJECT_NAME;
|
|
28488
|
+
}
|
|
28489
|
+
return basename;
|
|
28490
|
+
}
|
|
28403
28491
|
async function createNextly(options = {}) {
|
|
28404
28492
|
const {
|
|
28405
28493
|
defaults = false,
|
|
28406
28494
|
skipInstall = false,
|
|
28407
|
-
useYalc = false
|
|
28408
|
-
installInCwd = false
|
|
28495
|
+
useYalc = false
|
|
28409
28496
|
} = options;
|
|
28497
|
+
let installInCwd = options.installInCwd ?? false;
|
|
28410
28498
|
let { cwd = process.cwd() } = options;
|
|
28411
28499
|
let isFreshProject = false;
|
|
28412
28500
|
let projectName;
|
|
@@ -28428,33 +28516,44 @@ async function createNextly(options = {}) {
|
|
|
28428
28516
|
}
|
|
28429
28517
|
}
|
|
28430
28518
|
} else if (installInCwd) {
|
|
28431
|
-
projectName =
|
|
28519
|
+
projectName = cwdProjectName(cwd);
|
|
28432
28520
|
isFreshProject = true;
|
|
28433
28521
|
} else {
|
|
28434
28522
|
if (options.projectNameFromArg) {
|
|
28435
28523
|
projectName = options.projectNameFromArg;
|
|
28436
28524
|
} 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)) {
|
|
28525
|
+
const result = await promptForProjectName();
|
|
28526
|
+
if (result.kind === "cancelled") {
|
|
28449
28527
|
Nt("Cancelled.");
|
|
28450
28528
|
return;
|
|
28451
28529
|
}
|
|
28452
|
-
|
|
28530
|
+
if (result.value.installInCwd) {
|
|
28531
|
+
installInCwd = true;
|
|
28532
|
+
projectName = cwdProjectName(cwd);
|
|
28533
|
+
} else {
|
|
28534
|
+
projectName = result.value.projectName ?? DEFAULT_PROJECT_NAME;
|
|
28535
|
+
}
|
|
28453
28536
|
} else {
|
|
28454
|
-
projectName =
|
|
28537
|
+
projectName = DEFAULT_PROJECT_NAME;
|
|
28455
28538
|
}
|
|
28456
28539
|
isFreshProject = true;
|
|
28457
28540
|
}
|
|
28541
|
+
let allowExistingTarget = false;
|
|
28542
|
+
if (isFreshProject && projectName) {
|
|
28543
|
+
const conflictTargetDir = installInCwd ? cwd : path.join(cwd, projectName);
|
|
28544
|
+
if (await isDirectoryNotEmpty(conflictTargetDir)) {
|
|
28545
|
+
const targetLabel = installInCwd ? "the current directory" : `"${projectName}"`;
|
|
28546
|
+
const choice = await promptDirectoryConflict(targetLabel);
|
|
28547
|
+
if (choice === "cancel") {
|
|
28548
|
+
Nt("Cancelled. No changes were made.");
|
|
28549
|
+
return;
|
|
28550
|
+
}
|
|
28551
|
+
allowExistingTarget = true;
|
|
28552
|
+
if (choice === "remove") {
|
|
28553
|
+
await emptyDirectory(conflictTargetDir);
|
|
28554
|
+
}
|
|
28555
|
+
}
|
|
28556
|
+
}
|
|
28458
28557
|
let projectType;
|
|
28459
28558
|
if (options.projectType) {
|
|
28460
28559
|
projectType = options.projectType;
|
|
@@ -28551,6 +28650,7 @@ async function createNextly(options = {}) {
|
|
|
28551
28650
|
databaseUrl = url?.trim() || database.connectionUrl;
|
|
28552
28651
|
}
|
|
28553
28652
|
if (isFreshProject && projectName) {
|
|
28653
|
+
const targetDir = installInCwd ? cwd : path.join(cwd, projectName);
|
|
28554
28654
|
const s3 = be();
|
|
28555
28655
|
let templateSource;
|
|
28556
28656
|
try {
|
|
@@ -28565,47 +28665,29 @@ async function createNextly(options = {}) {
|
|
|
28565
28665
|
} else {
|
|
28566
28666
|
s3.start("Scaffolding project...");
|
|
28567
28667
|
}
|
|
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
|
-
}
|
|
28668
|
+
await copyTemplate({
|
|
28669
|
+
projectName,
|
|
28670
|
+
projectType,
|
|
28671
|
+
targetDir,
|
|
28672
|
+
database,
|
|
28673
|
+
databaseUrl,
|
|
28674
|
+
useYalc,
|
|
28675
|
+
approach,
|
|
28676
|
+
templateSource,
|
|
28677
|
+
// Suppress copyTemplate's "directory already exists" guard when the
|
|
28678
|
+
// installer has already negotiated the conflict with the user
|
|
28679
|
+
// (either by emptying the dir or accepting an overlay). Without
|
|
28680
|
+
// this, the "ignore" path would still throw on the subdirectory
|
|
28681
|
+
// case where the target was non-empty.
|
|
28682
|
+
allowExistingTarget
|
|
28683
|
+
});
|
|
28684
|
+
if (!installInCwd) cwd = targetDir;
|
|
28602
28685
|
s3.stop("Project scaffolded");
|
|
28603
28686
|
} catch (error) {
|
|
28604
28687
|
s3.stop("Scaffolding failed");
|
|
28605
|
-
if (!installInCwd) {
|
|
28606
|
-
|
|
28607
|
-
|
|
28608
|
-
await import_fs_extra12.default.remove(targetDir);
|
|
28688
|
+
if (!installInCwd && !allowExistingTarget) {
|
|
28689
|
+
if (await import_fs_extra13.default.pathExists(targetDir)) {
|
|
28690
|
+
await import_fs_extra13.default.remove(targetDir);
|
|
28609
28691
|
}
|
|
28610
28692
|
}
|
|
28611
28693
|
capture("scaffold_failed", {
|
|
@@ -28652,7 +28734,8 @@ async function createNextly(options = {}) {
|
|
|
28652
28734
|
projectInfo,
|
|
28653
28735
|
database,
|
|
28654
28736
|
useYalc,
|
|
28655
|
-
isFreshProject
|
|
28737
|
+
isFreshProject,
|
|
28738
|
+
projectType
|
|
28656
28739
|
);
|
|
28657
28740
|
s3.stop("Dependencies installed");
|
|
28658
28741
|
capture("install_completed", {
|
|
@@ -28747,6 +28830,6 @@ async function createNextly(options = {}) {
|
|
|
28747
28830
|
*)
|
|
28748
28831
|
*/
|
|
28749
28832
|
|
|
28750
|
-
export { __commonJS, __require, __toESM, capture, createNextly, init, shutdown };
|
|
28751
|
-
//# sourceMappingURL=chunk-
|
|
28752
|
-
//# sourceMappingURL=chunk-
|
|
28833
|
+
export { __commonJS, __require, __toESM, capture, createNextly, init, resolveProjectArg, shutdown, validateProjectName };
|
|
28834
|
+
//# sourceMappingURL=chunk-RPGFJSDP.mjs.map
|
|
28835
|
+
//# sourceMappingURL=chunk-RPGFJSDP.mjs.map
|