@chatbi-v/cli 1.0.7 → 1.0.8
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/default/apps/main/src/App.tsx.hbs +46 -30
- package/dist/default/package.json.hbs +1 -0
- package/dist/default/plugins/demo-plugin/package.json.hbs +2 -1
- package/dist/default/plugins/demo-plugin/src/index.tsx.hbs +13 -13
- package/dist/index.js +926 -471
- package/package.json +11 -4
- package/templates/default/.gitignore.hbs +0 -3
- package/templates/default/README.md.hbs +0 -30
- package/templates/default/apps/main/index.html.hbs +0 -13
- package/templates/default/apps/main/package.json.hbs +0 -20
- package/templates/default/apps/main/postcss.config.cjs.hbs +0 -6
- package/templates/default/apps/main/src/App.tsx.hbs +0 -162
- package/templates/default/apps/main/src/components/NavIcon.tsx.hbs +0 -41
- package/templates/default/apps/main/src/hooks/usePluginLoader.ts.hbs +0 -25
- package/templates/default/apps/main/src/index.css.hbs +0 -8
- package/templates/default/apps/main/src/main.tsx.hbs +0 -13
- package/templates/default/apps/main/src/pages/Guide.tsx.hbs +0 -133
- package/templates/default/apps/main/tailwind.config.cjs.hbs +0 -17
- package/templates/default/apps/main/tsconfig.json.hbs +0 -10
- package/templates/default/apps/main/vite.config.ts.hbs +0 -16
- package/templates/default/package.json.hbs +0 -33
- package/templates/default/plugins/demo-plugin/package.json.hbs +0 -17
- package/templates/default/plugins/demo-plugin/src/index.tsx.hbs +0 -44
- package/templates/default/plugins/demo-plugin/tsconfig.json.hbs +0 -10
- package/templates/default/pnpm-workspace.yaml.hbs +0 -3
- package/templates/default/tsconfig.json.hbs +0 -24
package/dist/index.js
CHANGED
|
@@ -160,54 +160,54 @@ var require_polyfills = __commonJS({
|
|
|
160
160
|
}
|
|
161
161
|
var chdir;
|
|
162
162
|
module2.exports = patch;
|
|
163
|
-
function patch(
|
|
163
|
+
function patch(fs5) {
|
|
164
164
|
if (constants3.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
165
|
-
patchLchmod(
|
|
166
|
-
}
|
|
167
|
-
if (!
|
|
168
|
-
patchLutimes(
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (
|
|
189
|
-
|
|
165
|
+
patchLchmod(fs5);
|
|
166
|
+
}
|
|
167
|
+
if (!fs5.lutimes) {
|
|
168
|
+
patchLutimes(fs5);
|
|
169
|
+
}
|
|
170
|
+
fs5.chown = chownFix(fs5.chown);
|
|
171
|
+
fs5.fchown = chownFix(fs5.fchown);
|
|
172
|
+
fs5.lchown = chownFix(fs5.lchown);
|
|
173
|
+
fs5.chmod = chmodFix(fs5.chmod);
|
|
174
|
+
fs5.fchmod = chmodFix(fs5.fchmod);
|
|
175
|
+
fs5.lchmod = chmodFix(fs5.lchmod);
|
|
176
|
+
fs5.chownSync = chownFixSync(fs5.chownSync);
|
|
177
|
+
fs5.fchownSync = chownFixSync(fs5.fchownSync);
|
|
178
|
+
fs5.lchownSync = chownFixSync(fs5.lchownSync);
|
|
179
|
+
fs5.chmodSync = chmodFixSync(fs5.chmodSync);
|
|
180
|
+
fs5.fchmodSync = chmodFixSync(fs5.fchmodSync);
|
|
181
|
+
fs5.lchmodSync = chmodFixSync(fs5.lchmodSync);
|
|
182
|
+
fs5.stat = statFix(fs5.stat);
|
|
183
|
+
fs5.fstat = statFix(fs5.fstat);
|
|
184
|
+
fs5.lstat = statFix(fs5.lstat);
|
|
185
|
+
fs5.statSync = statFixSync(fs5.statSync);
|
|
186
|
+
fs5.fstatSync = statFixSync(fs5.fstatSync);
|
|
187
|
+
fs5.lstatSync = statFixSync(fs5.lstatSync);
|
|
188
|
+
if (fs5.chmod && !fs5.lchmod) {
|
|
189
|
+
fs5.lchmod = function(path7, mode, cb) {
|
|
190
190
|
if (cb) process.nextTick(cb);
|
|
191
191
|
};
|
|
192
|
-
|
|
192
|
+
fs5.lchmodSync = function() {
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
if (
|
|
196
|
-
|
|
195
|
+
if (fs5.chown && !fs5.lchown) {
|
|
196
|
+
fs5.lchown = function(path7, uid, gid, cb) {
|
|
197
197
|
if (cb) process.nextTick(cb);
|
|
198
198
|
};
|
|
199
|
-
|
|
199
|
+
fs5.lchownSync = function() {
|
|
200
200
|
};
|
|
201
201
|
}
|
|
202
202
|
if (platform === "win32") {
|
|
203
|
-
|
|
203
|
+
fs5.rename = typeof fs5.rename !== "function" ? fs5.rename : (function(fs$rename) {
|
|
204
204
|
function rename(from, to, cb) {
|
|
205
205
|
var start = Date.now();
|
|
206
206
|
var backoff = 0;
|
|
207
207
|
fs$rename(from, to, function CB(er) {
|
|
208
208
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
209
209
|
setTimeout(function() {
|
|
210
|
-
|
|
210
|
+
fs5.stat(to, function(stater, st) {
|
|
211
211
|
if (stater && stater.code === "ENOENT")
|
|
212
212
|
fs$rename(from, to, CB);
|
|
213
213
|
else
|
|
@@ -223,9 +223,9 @@ var require_polyfills = __commonJS({
|
|
|
223
223
|
}
|
|
224
224
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
225
225
|
return rename;
|
|
226
|
-
})(
|
|
226
|
+
})(fs5.rename);
|
|
227
227
|
}
|
|
228
|
-
|
|
228
|
+
fs5.read = typeof fs5.read !== "function" ? fs5.read : (function(fs$read) {
|
|
229
229
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
230
230
|
var callback;
|
|
231
231
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -233,22 +233,22 @@ var require_polyfills = __commonJS({
|
|
|
233
233
|
callback = function(er, _, __) {
|
|
234
234
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
235
235
|
eagCounter++;
|
|
236
|
-
return fs$read.call(
|
|
236
|
+
return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
|
|
237
237
|
}
|
|
238
238
|
callback_.apply(this, arguments);
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
-
return fs$read.call(
|
|
241
|
+
return fs$read.call(fs5, fd, buffer, offset, length, position, callback);
|
|
242
242
|
}
|
|
243
243
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
244
244
|
return read;
|
|
245
|
-
})(
|
|
246
|
-
|
|
245
|
+
})(fs5.read);
|
|
246
|
+
fs5.readSync = typeof fs5.readSync !== "function" ? fs5.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
247
247
|
return function(fd, buffer, offset, length, position) {
|
|
248
248
|
var eagCounter = 0;
|
|
249
249
|
while (true) {
|
|
250
250
|
try {
|
|
251
|
-
return fs$readSync.call(
|
|
251
|
+
return fs$readSync.call(fs5, fd, buffer, offset, length, position);
|
|
252
252
|
} catch (er) {
|
|
253
253
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
254
254
|
eagCounter++;
|
|
@@ -258,11 +258,11 @@ var require_polyfills = __commonJS({
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
};
|
|
261
|
-
})(
|
|
262
|
-
function patchLchmod(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
261
|
+
})(fs5.readSync);
|
|
262
|
+
function patchLchmod(fs6) {
|
|
263
|
+
fs6.lchmod = function(path7, mode, callback) {
|
|
264
|
+
fs6.open(
|
|
265
|
+
path7,
|
|
266
266
|
constants3.O_WRONLY | constants3.O_SYMLINK,
|
|
267
267
|
mode,
|
|
268
268
|
function(err, fd) {
|
|
@@ -270,80 +270,80 @@ var require_polyfills = __commonJS({
|
|
|
270
270
|
if (callback) callback(err);
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
fs6.fchmod(fd, mode, function(err2) {
|
|
274
|
+
fs6.close(fd, function(err22) {
|
|
275
275
|
if (callback) callback(err2 || err22);
|
|
276
276
|
});
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
279
|
);
|
|
280
280
|
};
|
|
281
|
-
|
|
282
|
-
var fd =
|
|
281
|
+
fs6.lchmodSync = function(path7, mode) {
|
|
282
|
+
var fd = fs6.openSync(path7, constants3.O_WRONLY | constants3.O_SYMLINK, mode);
|
|
283
283
|
var threw = true;
|
|
284
284
|
var ret;
|
|
285
285
|
try {
|
|
286
|
-
ret =
|
|
286
|
+
ret = fs6.fchmodSync(fd, mode);
|
|
287
287
|
threw = false;
|
|
288
288
|
} finally {
|
|
289
289
|
if (threw) {
|
|
290
290
|
try {
|
|
291
|
-
|
|
291
|
+
fs6.closeSync(fd);
|
|
292
292
|
} catch (er) {
|
|
293
293
|
}
|
|
294
294
|
} else {
|
|
295
|
-
|
|
295
|
+
fs6.closeSync(fd);
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
return ret;
|
|
299
299
|
};
|
|
300
300
|
}
|
|
301
|
-
function patchLutimes(
|
|
302
|
-
if (constants3.hasOwnProperty("O_SYMLINK") &&
|
|
303
|
-
|
|
304
|
-
|
|
301
|
+
function patchLutimes(fs6) {
|
|
302
|
+
if (constants3.hasOwnProperty("O_SYMLINK") && fs6.futimes) {
|
|
303
|
+
fs6.lutimes = function(path7, at, mt, cb) {
|
|
304
|
+
fs6.open(path7, constants3.O_SYMLINK, function(er, fd) {
|
|
305
305
|
if (er) {
|
|
306
306
|
if (cb) cb(er);
|
|
307
307
|
return;
|
|
308
308
|
}
|
|
309
|
-
|
|
310
|
-
|
|
309
|
+
fs6.futimes(fd, at, mt, function(er2) {
|
|
310
|
+
fs6.close(fd, function(er22) {
|
|
311
311
|
if (cb) cb(er2 || er22);
|
|
312
312
|
});
|
|
313
313
|
});
|
|
314
314
|
});
|
|
315
315
|
};
|
|
316
|
-
|
|
317
|
-
var fd =
|
|
316
|
+
fs6.lutimesSync = function(path7, at, mt) {
|
|
317
|
+
var fd = fs6.openSync(path7, constants3.O_SYMLINK);
|
|
318
318
|
var ret;
|
|
319
319
|
var threw = true;
|
|
320
320
|
try {
|
|
321
|
-
ret =
|
|
321
|
+
ret = fs6.futimesSync(fd, at, mt);
|
|
322
322
|
threw = false;
|
|
323
323
|
} finally {
|
|
324
324
|
if (threw) {
|
|
325
325
|
try {
|
|
326
|
-
|
|
326
|
+
fs6.closeSync(fd);
|
|
327
327
|
} catch (er) {
|
|
328
328
|
}
|
|
329
329
|
} else {
|
|
330
|
-
|
|
330
|
+
fs6.closeSync(fd);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
return ret;
|
|
334
334
|
};
|
|
335
|
-
} else if (
|
|
336
|
-
|
|
335
|
+
} else if (fs6.futimes) {
|
|
336
|
+
fs6.lutimes = function(_a, _b, _c, cb) {
|
|
337
337
|
if (cb) process.nextTick(cb);
|
|
338
338
|
};
|
|
339
|
-
|
|
339
|
+
fs6.lutimesSync = function() {
|
|
340
340
|
};
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
function chmodFix(orig) {
|
|
344
344
|
if (!orig) return orig;
|
|
345
345
|
return function(target, mode, cb) {
|
|
346
|
-
return orig.call(
|
|
346
|
+
return orig.call(fs5, target, mode, function(er) {
|
|
347
347
|
if (chownErOk(er)) er = null;
|
|
348
348
|
if (cb) cb.apply(this, arguments);
|
|
349
349
|
});
|
|
@@ -353,7 +353,7 @@ var require_polyfills = __commonJS({
|
|
|
353
353
|
if (!orig) return orig;
|
|
354
354
|
return function(target, mode) {
|
|
355
355
|
try {
|
|
356
|
-
return orig.call(
|
|
356
|
+
return orig.call(fs5, target, mode);
|
|
357
357
|
} catch (er) {
|
|
358
358
|
if (!chownErOk(er)) throw er;
|
|
359
359
|
}
|
|
@@ -362,7 +362,7 @@ var require_polyfills = __commonJS({
|
|
|
362
362
|
function chownFix(orig) {
|
|
363
363
|
if (!orig) return orig;
|
|
364
364
|
return function(target, uid, gid, cb) {
|
|
365
|
-
return orig.call(
|
|
365
|
+
return orig.call(fs5, target, uid, gid, function(er) {
|
|
366
366
|
if (chownErOk(er)) er = null;
|
|
367
367
|
if (cb) cb.apply(this, arguments);
|
|
368
368
|
});
|
|
@@ -372,7 +372,7 @@ var require_polyfills = __commonJS({
|
|
|
372
372
|
if (!orig) return orig;
|
|
373
373
|
return function(target, uid, gid) {
|
|
374
374
|
try {
|
|
375
|
-
return orig.call(
|
|
375
|
+
return orig.call(fs5, target, uid, gid);
|
|
376
376
|
} catch (er) {
|
|
377
377
|
if (!chownErOk(er)) throw er;
|
|
378
378
|
}
|
|
@@ -392,13 +392,13 @@ var require_polyfills = __commonJS({
|
|
|
392
392
|
}
|
|
393
393
|
if (cb) cb.apply(this, arguments);
|
|
394
394
|
}
|
|
395
|
-
return options ? orig.call(
|
|
395
|
+
return options ? orig.call(fs5, target, options, callback) : orig.call(fs5, target, callback);
|
|
396
396
|
};
|
|
397
397
|
}
|
|
398
398
|
function statFixSync(orig) {
|
|
399
399
|
if (!orig) return orig;
|
|
400
400
|
return function(target, options) {
|
|
401
|
-
var stats = options ? orig.call(
|
|
401
|
+
var stats = options ? orig.call(fs5, target, options) : orig.call(fs5, target);
|
|
402
402
|
if (stats) {
|
|
403
403
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
404
404
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -428,16 +428,16 @@ var require_legacy_streams = __commonJS({
|
|
|
428
428
|
"use strict";
|
|
429
429
|
var Stream = require("stream").Stream;
|
|
430
430
|
module2.exports = legacy;
|
|
431
|
-
function legacy(
|
|
431
|
+
function legacy(fs5) {
|
|
432
432
|
return {
|
|
433
433
|
ReadStream,
|
|
434
434
|
WriteStream
|
|
435
435
|
};
|
|
436
|
-
function ReadStream(
|
|
437
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
436
|
+
function ReadStream(path7, options) {
|
|
437
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path7, options);
|
|
438
438
|
Stream.call(this);
|
|
439
439
|
var self = this;
|
|
440
|
-
this.path =
|
|
440
|
+
this.path = path7;
|
|
441
441
|
this.fd = null;
|
|
442
442
|
this.readable = true;
|
|
443
443
|
this.paused = false;
|
|
@@ -471,7 +471,7 @@ var require_legacy_streams = __commonJS({
|
|
|
471
471
|
});
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
|
-
|
|
474
|
+
fs5.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
475
475
|
if (err) {
|
|
476
476
|
self.emit("error", err);
|
|
477
477
|
self.readable = false;
|
|
@@ -482,10 +482,10 @@ var require_legacy_streams = __commonJS({
|
|
|
482
482
|
self._read();
|
|
483
483
|
});
|
|
484
484
|
}
|
|
485
|
-
function WriteStream(
|
|
486
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
485
|
+
function WriteStream(path7, options) {
|
|
486
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path7, options);
|
|
487
487
|
Stream.call(this);
|
|
488
|
-
this.path =
|
|
488
|
+
this.path = path7;
|
|
489
489
|
this.fd = null;
|
|
490
490
|
this.writable = true;
|
|
491
491
|
this.flags = "w";
|
|
@@ -510,7 +510,7 @@ var require_legacy_streams = __commonJS({
|
|
|
510
510
|
this.busy = false;
|
|
511
511
|
this._queue = [];
|
|
512
512
|
if (this.fd === null) {
|
|
513
|
-
this._open =
|
|
513
|
+
this._open = fs5.open;
|
|
514
514
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
515
515
|
this.flush();
|
|
516
516
|
}
|
|
@@ -546,7 +546,7 @@ var require_clone = __commonJS({
|
|
|
546
546
|
var require_graceful_fs = __commonJS({
|
|
547
547
|
"../../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
548
548
|
"use strict";
|
|
549
|
-
var
|
|
549
|
+
var fs5 = require("fs");
|
|
550
550
|
var polyfills = require_polyfills();
|
|
551
551
|
var legacy = require_legacy_streams();
|
|
552
552
|
var clone = require_clone();
|
|
@@ -578,12 +578,12 @@ var require_graceful_fs = __commonJS({
|
|
|
578
578
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
579
579
|
console.error(m);
|
|
580
580
|
};
|
|
581
|
-
if (!
|
|
581
|
+
if (!fs5[gracefulQueue]) {
|
|
582
582
|
queue = global[gracefulQueue] || [];
|
|
583
|
-
publishQueue(
|
|
584
|
-
|
|
583
|
+
publishQueue(fs5, queue);
|
|
584
|
+
fs5.close = (function(fs$close) {
|
|
585
585
|
function close(fd, cb) {
|
|
586
|
-
return fs$close.call(
|
|
586
|
+
return fs$close.call(fs5, fd, function(err) {
|
|
587
587
|
if (!err) {
|
|
588
588
|
resetQueue();
|
|
589
589
|
}
|
|
@@ -595,48 +595,48 @@ var require_graceful_fs = __commonJS({
|
|
|
595
595
|
value: fs$close
|
|
596
596
|
});
|
|
597
597
|
return close;
|
|
598
|
-
})(
|
|
599
|
-
|
|
598
|
+
})(fs5.close);
|
|
599
|
+
fs5.closeSync = (function(fs$closeSync) {
|
|
600
600
|
function closeSync(fd) {
|
|
601
|
-
fs$closeSync.apply(
|
|
601
|
+
fs$closeSync.apply(fs5, arguments);
|
|
602
602
|
resetQueue();
|
|
603
603
|
}
|
|
604
604
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
605
605
|
value: fs$closeSync
|
|
606
606
|
});
|
|
607
607
|
return closeSync;
|
|
608
|
-
})(
|
|
608
|
+
})(fs5.closeSync);
|
|
609
609
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
610
610
|
process.on("exit", function() {
|
|
611
|
-
debug(
|
|
612
|
-
require("assert").equal(
|
|
611
|
+
debug(fs5[gracefulQueue]);
|
|
612
|
+
require("assert").equal(fs5[gracefulQueue].length, 0);
|
|
613
613
|
});
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
var queue;
|
|
617
617
|
if (!global[gracefulQueue]) {
|
|
618
|
-
publishQueue(global,
|
|
619
|
-
}
|
|
620
|
-
module2.exports = patch(clone(
|
|
621
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
622
|
-
module2.exports = patch(
|
|
623
|
-
|
|
624
|
-
}
|
|
625
|
-
function patch(
|
|
626
|
-
polyfills(
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
var fs$readFile =
|
|
631
|
-
|
|
632
|
-
function readFile(
|
|
618
|
+
publishQueue(global, fs5[gracefulQueue]);
|
|
619
|
+
}
|
|
620
|
+
module2.exports = patch(clone(fs5));
|
|
621
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs5.__patched) {
|
|
622
|
+
module2.exports = patch(fs5);
|
|
623
|
+
fs5.__patched = true;
|
|
624
|
+
}
|
|
625
|
+
function patch(fs6) {
|
|
626
|
+
polyfills(fs6);
|
|
627
|
+
fs6.gracefulify = patch;
|
|
628
|
+
fs6.createReadStream = createReadStream2;
|
|
629
|
+
fs6.createWriteStream = createWriteStream2;
|
|
630
|
+
var fs$readFile = fs6.readFile;
|
|
631
|
+
fs6.readFile = readFile;
|
|
632
|
+
function readFile(path7, options, cb) {
|
|
633
633
|
if (typeof options === "function")
|
|
634
634
|
cb = options, options = null;
|
|
635
|
-
return go$readFile(
|
|
636
|
-
function go$readFile(
|
|
637
|
-
return fs$readFile(
|
|
635
|
+
return go$readFile(path7, options, cb);
|
|
636
|
+
function go$readFile(path8, options2, cb2, startTime) {
|
|
637
|
+
return fs$readFile(path8, options2, function(err) {
|
|
638
638
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
639
|
-
enqueue([go$readFile, [
|
|
639
|
+
enqueue([go$readFile, [path8, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
640
640
|
else {
|
|
641
641
|
if (typeof cb2 === "function")
|
|
642
642
|
cb2.apply(this, arguments);
|
|
@@ -644,16 +644,16 @@ var require_graceful_fs = __commonJS({
|
|
|
644
644
|
});
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
var fs$writeFile =
|
|
648
|
-
|
|
649
|
-
function writeFile(
|
|
647
|
+
var fs$writeFile = fs6.writeFile;
|
|
648
|
+
fs6.writeFile = writeFile;
|
|
649
|
+
function writeFile(path7, data, options, cb) {
|
|
650
650
|
if (typeof options === "function")
|
|
651
651
|
cb = options, options = null;
|
|
652
|
-
return go$writeFile(
|
|
653
|
-
function go$writeFile(
|
|
654
|
-
return fs$writeFile(
|
|
652
|
+
return go$writeFile(path7, data, options, cb);
|
|
653
|
+
function go$writeFile(path8, data2, options2, cb2, startTime) {
|
|
654
|
+
return fs$writeFile(path8, data2, options2, function(err) {
|
|
655
655
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
656
|
-
enqueue([go$writeFile, [
|
|
656
|
+
enqueue([go$writeFile, [path8, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
657
657
|
else {
|
|
658
658
|
if (typeof cb2 === "function")
|
|
659
659
|
cb2.apply(this, arguments);
|
|
@@ -661,17 +661,17 @@ var require_graceful_fs = __commonJS({
|
|
|
661
661
|
});
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
|
-
var fs$appendFile =
|
|
664
|
+
var fs$appendFile = fs6.appendFile;
|
|
665
665
|
if (fs$appendFile)
|
|
666
|
-
|
|
667
|
-
function appendFile(
|
|
666
|
+
fs6.appendFile = appendFile;
|
|
667
|
+
function appendFile(path7, data, options, cb) {
|
|
668
668
|
if (typeof options === "function")
|
|
669
669
|
cb = options, options = null;
|
|
670
|
-
return go$appendFile(
|
|
671
|
-
function go$appendFile(
|
|
672
|
-
return fs$appendFile(
|
|
670
|
+
return go$appendFile(path7, data, options, cb);
|
|
671
|
+
function go$appendFile(path8, data2, options2, cb2, startTime) {
|
|
672
|
+
return fs$appendFile(path8, data2, options2, function(err) {
|
|
673
673
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
674
|
-
enqueue([go$appendFile, [
|
|
674
|
+
enqueue([go$appendFile, [path8, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
675
675
|
else {
|
|
676
676
|
if (typeof cb2 === "function")
|
|
677
677
|
cb2.apply(this, arguments);
|
|
@@ -679,9 +679,9 @@ var require_graceful_fs = __commonJS({
|
|
|
679
679
|
});
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
|
-
var fs$copyFile =
|
|
682
|
+
var fs$copyFile = fs6.copyFile;
|
|
683
683
|
if (fs$copyFile)
|
|
684
|
-
|
|
684
|
+
fs6.copyFile = copyFile;
|
|
685
685
|
function copyFile(src, dest, flags, cb) {
|
|
686
686
|
if (typeof flags === "function") {
|
|
687
687
|
cb = flags;
|
|
@@ -699,34 +699,34 @@ var require_graceful_fs = __commonJS({
|
|
|
699
699
|
});
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
|
-
var fs$readdir =
|
|
703
|
-
|
|
702
|
+
var fs$readdir = fs6.readdir;
|
|
703
|
+
fs6.readdir = readdir;
|
|
704
704
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
705
|
-
function readdir(
|
|
705
|
+
function readdir(path7, options, cb) {
|
|
706
706
|
if (typeof options === "function")
|
|
707
707
|
cb = options, options = null;
|
|
708
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
709
|
-
return fs$readdir(
|
|
710
|
-
|
|
708
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path8, options2, cb2, startTime) {
|
|
709
|
+
return fs$readdir(path8, fs$readdirCallback(
|
|
710
|
+
path8,
|
|
711
711
|
options2,
|
|
712
712
|
cb2,
|
|
713
713
|
startTime
|
|
714
714
|
));
|
|
715
|
-
} : function go$readdir2(
|
|
716
|
-
return fs$readdir(
|
|
717
|
-
|
|
715
|
+
} : function go$readdir2(path8, options2, cb2, startTime) {
|
|
716
|
+
return fs$readdir(path8, options2, fs$readdirCallback(
|
|
717
|
+
path8,
|
|
718
718
|
options2,
|
|
719
719
|
cb2,
|
|
720
720
|
startTime
|
|
721
721
|
));
|
|
722
722
|
};
|
|
723
|
-
return go$readdir(
|
|
724
|
-
function fs$readdirCallback(
|
|
723
|
+
return go$readdir(path7, options, cb);
|
|
724
|
+
function fs$readdirCallback(path8, options2, cb2, startTime) {
|
|
725
725
|
return function(err, files) {
|
|
726
726
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
727
727
|
enqueue([
|
|
728
728
|
go$readdir,
|
|
729
|
-
[
|
|
729
|
+
[path8, options2, cb2],
|
|
730
730
|
err,
|
|
731
731
|
startTime || Date.now(),
|
|
732
732
|
Date.now()
|
|
@@ -741,21 +741,21 @@ var require_graceful_fs = __commonJS({
|
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
743
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
744
|
-
var legStreams = legacy(
|
|
744
|
+
var legStreams = legacy(fs6);
|
|
745
745
|
ReadStream = legStreams.ReadStream;
|
|
746
746
|
WriteStream = legStreams.WriteStream;
|
|
747
747
|
}
|
|
748
|
-
var fs$ReadStream =
|
|
748
|
+
var fs$ReadStream = fs6.ReadStream;
|
|
749
749
|
if (fs$ReadStream) {
|
|
750
750
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
751
751
|
ReadStream.prototype.open = ReadStream$open;
|
|
752
752
|
}
|
|
753
|
-
var fs$WriteStream =
|
|
753
|
+
var fs$WriteStream = fs6.WriteStream;
|
|
754
754
|
if (fs$WriteStream) {
|
|
755
755
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
756
756
|
WriteStream.prototype.open = WriteStream$open;
|
|
757
757
|
}
|
|
758
|
-
Object.defineProperty(
|
|
758
|
+
Object.defineProperty(fs6, "ReadStream", {
|
|
759
759
|
get: function() {
|
|
760
760
|
return ReadStream;
|
|
761
761
|
},
|
|
@@ -765,7 +765,7 @@ var require_graceful_fs = __commonJS({
|
|
|
765
765
|
enumerable: true,
|
|
766
766
|
configurable: true
|
|
767
767
|
});
|
|
768
|
-
Object.defineProperty(
|
|
768
|
+
Object.defineProperty(fs6, "WriteStream", {
|
|
769
769
|
get: function() {
|
|
770
770
|
return WriteStream;
|
|
771
771
|
},
|
|
@@ -776,7 +776,7 @@ var require_graceful_fs = __commonJS({
|
|
|
776
776
|
configurable: true
|
|
777
777
|
});
|
|
778
778
|
var FileReadStream = ReadStream;
|
|
779
|
-
Object.defineProperty(
|
|
779
|
+
Object.defineProperty(fs6, "FileReadStream", {
|
|
780
780
|
get: function() {
|
|
781
781
|
return FileReadStream;
|
|
782
782
|
},
|
|
@@ -787,7 +787,7 @@ var require_graceful_fs = __commonJS({
|
|
|
787
787
|
configurable: true
|
|
788
788
|
});
|
|
789
789
|
var FileWriteStream = WriteStream;
|
|
790
|
-
Object.defineProperty(
|
|
790
|
+
Object.defineProperty(fs6, "FileWriteStream", {
|
|
791
791
|
get: function() {
|
|
792
792
|
return FileWriteStream;
|
|
793
793
|
},
|
|
@@ -797,7 +797,7 @@ var require_graceful_fs = __commonJS({
|
|
|
797
797
|
enumerable: true,
|
|
798
798
|
configurable: true
|
|
799
799
|
});
|
|
800
|
-
function ReadStream(
|
|
800
|
+
function ReadStream(path7, options) {
|
|
801
801
|
if (this instanceof ReadStream)
|
|
802
802
|
return fs$ReadStream.apply(this, arguments), this;
|
|
803
803
|
else
|
|
@@ -817,7 +817,7 @@ var require_graceful_fs = __commonJS({
|
|
|
817
817
|
}
|
|
818
818
|
});
|
|
819
819
|
}
|
|
820
|
-
function WriteStream(
|
|
820
|
+
function WriteStream(path7, options) {
|
|
821
821
|
if (this instanceof WriteStream)
|
|
822
822
|
return fs$WriteStream.apply(this, arguments), this;
|
|
823
823
|
else
|
|
@@ -835,22 +835,22 @@ var require_graceful_fs = __commonJS({
|
|
|
835
835
|
}
|
|
836
836
|
});
|
|
837
837
|
}
|
|
838
|
-
function createReadStream2(
|
|
839
|
-
return new
|
|
838
|
+
function createReadStream2(path7, options) {
|
|
839
|
+
return new fs6.ReadStream(path7, options);
|
|
840
840
|
}
|
|
841
|
-
function createWriteStream2(
|
|
842
|
-
return new
|
|
841
|
+
function createWriteStream2(path7, options) {
|
|
842
|
+
return new fs6.WriteStream(path7, options);
|
|
843
843
|
}
|
|
844
|
-
var fs$open =
|
|
845
|
-
|
|
846
|
-
function open(
|
|
844
|
+
var fs$open = fs6.open;
|
|
845
|
+
fs6.open = open;
|
|
846
|
+
function open(path7, flags, mode, cb) {
|
|
847
847
|
if (typeof mode === "function")
|
|
848
848
|
cb = mode, mode = null;
|
|
849
|
-
return go$open(
|
|
850
|
-
function go$open(
|
|
851
|
-
return fs$open(
|
|
849
|
+
return go$open(path7, flags, mode, cb);
|
|
850
|
+
function go$open(path8, flags2, mode2, cb2, startTime) {
|
|
851
|
+
return fs$open(path8, flags2, mode2, function(err, fd) {
|
|
852
852
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
853
|
-
enqueue([go$open, [
|
|
853
|
+
enqueue([go$open, [path8, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
854
854
|
else {
|
|
855
855
|
if (typeof cb2 === "function")
|
|
856
856
|
cb2.apply(this, arguments);
|
|
@@ -858,20 +858,20 @@ var require_graceful_fs = __commonJS({
|
|
|
858
858
|
});
|
|
859
859
|
}
|
|
860
860
|
}
|
|
861
|
-
return
|
|
861
|
+
return fs6;
|
|
862
862
|
}
|
|
863
863
|
function enqueue(elem) {
|
|
864
864
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
865
|
-
|
|
865
|
+
fs5[gracefulQueue].push(elem);
|
|
866
866
|
retry();
|
|
867
867
|
}
|
|
868
868
|
var retryTimer;
|
|
869
869
|
function resetQueue() {
|
|
870
870
|
var now = Date.now();
|
|
871
|
-
for (var i = 0; i <
|
|
872
|
-
if (
|
|
873
|
-
|
|
874
|
-
|
|
871
|
+
for (var i = 0; i < fs5[gracefulQueue].length; ++i) {
|
|
872
|
+
if (fs5[gracefulQueue][i].length > 2) {
|
|
873
|
+
fs5[gracefulQueue][i][3] = now;
|
|
874
|
+
fs5[gracefulQueue][i][4] = now;
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
877
|
retry();
|
|
@@ -879,9 +879,9 @@ var require_graceful_fs = __commonJS({
|
|
|
879
879
|
function retry() {
|
|
880
880
|
clearTimeout(retryTimer);
|
|
881
881
|
retryTimer = void 0;
|
|
882
|
-
if (
|
|
882
|
+
if (fs5[gracefulQueue].length === 0)
|
|
883
883
|
return;
|
|
884
|
-
var elem =
|
|
884
|
+
var elem = fs5[gracefulQueue].shift();
|
|
885
885
|
var fn = elem[0];
|
|
886
886
|
var args = elem[1];
|
|
887
887
|
var err = elem[2];
|
|
@@ -903,7 +903,7 @@ var require_graceful_fs = __commonJS({
|
|
|
903
903
|
debug("RETRY", fn.name, args);
|
|
904
904
|
fn.apply(null, args.concat([startTime]));
|
|
905
905
|
} else {
|
|
906
|
-
|
|
906
|
+
fs5[gracefulQueue].push(elem);
|
|
907
907
|
}
|
|
908
908
|
}
|
|
909
909
|
if (retryTimer === void 0) {
|
|
@@ -918,7 +918,7 @@ var require_fs = __commonJS({
|
|
|
918
918
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
919
919
|
"use strict";
|
|
920
920
|
var u = require_universalify().fromCallback;
|
|
921
|
-
var
|
|
921
|
+
var fs5 = 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 fs5[key] === "function";
|
|
963
963
|
});
|
|
964
|
-
Object.assign(exports2,
|
|
964
|
+
Object.assign(exports2, fs5);
|
|
965
965
|
api.forEach((method) => {
|
|
966
|
-
exports2[method] = u(
|
|
966
|
+
exports2[method] = u(fs5[method]);
|
|
967
967
|
});
|
|
968
968
|
exports2.exists = function(filename, callback) {
|
|
969
969
|
if (typeof callback === "function") {
|
|
970
|
-
return
|
|
970
|
+
return fs5.exists(filename, callback);
|
|
971
971
|
}
|
|
972
972
|
return new Promise((resolve) => {
|
|
973
|
-
return
|
|
973
|
+
return fs5.exists(filename, resolve);
|
|
974
974
|
});
|
|
975
975
|
};
|
|
976
976
|
exports2.read = function(fd, buffer, offset, length, position, callback) {
|
|
977
977
|
if (typeof callback === "function") {
|
|
978
|
-
return
|
|
978
|
+
return fs5.read(fd, buffer, offset, length, position, callback);
|
|
979
979
|
}
|
|
980
980
|
return new Promise((resolve, reject) => {
|
|
981
|
-
|
|
981
|
+
fs5.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
|
exports2.write = function(fd, buffer, ...args) {
|
|
988
988
|
if (typeof args[args.length - 1] === "function") {
|
|
989
|
-
return
|
|
989
|
+
return fs5.write(fd, buffer, ...args);
|
|
990
990
|
}
|
|
991
991
|
return new Promise((resolve, reject) => {
|
|
992
|
-
|
|
992
|
+
fs5.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
|
exports2.readv = function(fd, buffers, ...args) {
|
|
999
999
|
if (typeof args[args.length - 1] === "function") {
|
|
1000
|
-
return
|
|
1000
|
+
return fs5.readv(fd, buffers, ...args);
|
|
1001
1001
|
}
|
|
1002
1002
|
return new Promise((resolve, reject) => {
|
|
1003
|
-
|
|
1003
|
+
fs5.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
|
exports2.writev = function(fd, buffers, ...args) {
|
|
1010
1010
|
if (typeof args[args.length - 1] === "function") {
|
|
1011
|
-
return
|
|
1011
|
+
return fs5.writev(fd, buffers, ...args);
|
|
1012
1012
|
}
|
|
1013
1013
|
return new Promise((resolve, reject) => {
|
|
1014
|
-
|
|
1014
|
+
fs5.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
|
-
exports2.realpath.native = u(
|
|
1020
|
+
if (typeof fs5.realpath.native === "function") {
|
|
1021
|
+
exports2.realpath.native = u(fs5.realpath.native);
|
|
1022
1022
|
} else {
|
|
1023
1023
|
process.emitWarning(
|
|
1024
1024
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
@@ -1033,10 +1033,10 @@ var require_fs = __commonJS({
|
|
|
1033
1033
|
var require_utils = __commonJS({
|
|
1034
1034
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
1035
1035
|
"use strict";
|
|
1036
|
-
var
|
|
1036
|
+
var path7 = require("path");
|
|
1037
1037
|
module2.exports.checkPath = function checkPath(pth) {
|
|
1038
1038
|
if (process.platform === "win32") {
|
|
1039
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
1039
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path7.parse(pth).root, ""));
|
|
1040
1040
|
if (pathHasInvalidWinCharacters) {
|
|
1041
1041
|
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
1042
1042
|
error.code = "EINVAL";
|
|
@@ -1051,7 +1051,7 @@ var require_utils = __commonJS({
|
|
|
1051
1051
|
var require_make_dir = __commonJS({
|
|
1052
1052
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
1053
1053
|
"use strict";
|
|
1054
|
-
var
|
|
1054
|
+
var fs5 = require_fs();
|
|
1055
1055
|
var { checkPath } = require_utils();
|
|
1056
1056
|
var getMode = (options) => {
|
|
1057
1057
|
const defaults = { mode: 511 };
|
|
@@ -1060,14 +1060,14 @@ var require_make_dir = __commonJS({
|
|
|
1060
1060
|
};
|
|
1061
1061
|
module2.exports.makeDir = async (dir, options) => {
|
|
1062
1062
|
checkPath(dir);
|
|
1063
|
-
return
|
|
1063
|
+
return fs5.mkdir(dir, {
|
|
1064
1064
|
mode: getMode(options),
|
|
1065
1065
|
recursive: true
|
|
1066
1066
|
});
|
|
1067
1067
|
};
|
|
1068
1068
|
module2.exports.makeDirSync = (dir, options) => {
|
|
1069
1069
|
checkPath(dir);
|
|
1070
|
-
return
|
|
1070
|
+
return fs5.mkdirSync(dir, {
|
|
1071
1071
|
mode: getMode(options),
|
|
1072
1072
|
recursive: true
|
|
1073
1073
|
});
|
|
@@ -1099,13 +1099,13 @@ var require_path_exists = __commonJS({
|
|
|
1099
1099
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
1100
1100
|
"use strict";
|
|
1101
1101
|
var u = require_universalify().fromPromise;
|
|
1102
|
-
var
|
|
1103
|
-
function pathExists(
|
|
1104
|
-
return
|
|
1102
|
+
var fs5 = require_fs();
|
|
1103
|
+
function pathExists(path7) {
|
|
1104
|
+
return fs5.access(path7).then(() => true).catch(() => false);
|
|
1105
1105
|
}
|
|
1106
1106
|
module2.exports = {
|
|
1107
1107
|
pathExists: u(pathExists),
|
|
1108
|
-
pathExistsSync:
|
|
1108
|
+
pathExistsSync: fs5.existsSync
|
|
1109
1109
|
};
|
|
1110
1110
|
}
|
|
1111
1111
|
});
|
|
@@ -1114,16 +1114,16 @@ var require_path_exists = __commonJS({
|
|
|
1114
1114
|
var require_utimes = __commonJS({
|
|
1115
1115
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
1116
1116
|
"use strict";
|
|
1117
|
-
var
|
|
1117
|
+
var fs5 = require_fs();
|
|
1118
1118
|
var u = require_universalify().fromPromise;
|
|
1119
|
-
async function utimesMillis(
|
|
1120
|
-
const fd = await
|
|
1119
|
+
async function utimesMillis(path7, atime, mtime) {
|
|
1120
|
+
const fd = await fs5.open(path7, "r+");
|
|
1121
1121
|
let closeErr = null;
|
|
1122
1122
|
try {
|
|
1123
|
-
await
|
|
1123
|
+
await fs5.futimes(fd, atime, mtime);
|
|
1124
1124
|
} finally {
|
|
1125
1125
|
try {
|
|
1126
|
-
await
|
|
1126
|
+
await fs5.close(fd);
|
|
1127
1127
|
} catch (e) {
|
|
1128
1128
|
closeErr = e;
|
|
1129
1129
|
}
|
|
@@ -1132,10 +1132,10 @@ var require_utimes = __commonJS({
|
|
|
1132
1132
|
throw closeErr;
|
|
1133
1133
|
}
|
|
1134
1134
|
}
|
|
1135
|
-
function utimesMillisSync(
|
|
1136
|
-
const fd =
|
|
1137
|
-
|
|
1138
|
-
return
|
|
1135
|
+
function utimesMillisSync(path7, atime, mtime) {
|
|
1136
|
+
const fd = fs5.openSync(path7, "r+");
|
|
1137
|
+
fs5.futimesSync(fd, atime, mtime);
|
|
1138
|
+
return fs5.closeSync(fd);
|
|
1139
1139
|
}
|
|
1140
1140
|
module2.exports = {
|
|
1141
1141
|
utimesMillis: u(utimesMillis),
|
|
@@ -1148,11 +1148,11 @@ var require_utimes = __commonJS({
|
|
|
1148
1148
|
var require_stat = __commonJS({
|
|
1149
1149
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
1150
1150
|
"use strict";
|
|
1151
|
-
var
|
|
1152
|
-
var
|
|
1151
|
+
var fs5 = require_fs();
|
|
1152
|
+
var path7 = require("path");
|
|
1153
1153
|
var u = require_universalify().fromPromise;
|
|
1154
1154
|
function getStats(src, dest, opts) {
|
|
1155
|
-
const statFunc = opts.dereference ? (file) =>
|
|
1155
|
+
const statFunc = opts.dereference ? (file) => fs5.stat(file, { bigint: true }) : (file) => fs5.lstat(file, { bigint: true });
|
|
1156
1156
|
return Promise.all([
|
|
1157
1157
|
statFunc(src),
|
|
1158
1158
|
statFunc(dest).catch((err) => {
|
|
@@ -1163,7 +1163,7 @@ var require_stat = __commonJS({
|
|
|
1163
1163
|
}
|
|
1164
1164
|
function getStatsSync(src, dest, opts) {
|
|
1165
1165
|
let destStat;
|
|
1166
|
-
const statFunc = opts.dereference ? (file) =>
|
|
1166
|
+
const statFunc = opts.dereference ? (file) => fs5.statSync(file, { bigint: true }) : (file) => fs5.lstatSync(file, { bigint: true });
|
|
1167
1167
|
const srcStat = statFunc(src);
|
|
1168
1168
|
try {
|
|
1169
1169
|
destStat = statFunc(dest);
|
|
@@ -1177,8 +1177,8 @@ var require_stat = __commonJS({
|
|
|
1177
1177
|
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
1178
1178
|
if (destStat) {
|
|
1179
1179
|
if (areIdentical(srcStat, destStat)) {
|
|
1180
|
-
const srcBaseName =
|
|
1181
|
-
const destBaseName =
|
|
1180
|
+
const srcBaseName = path7.basename(src);
|
|
1181
|
+
const destBaseName = path7.basename(dest);
|
|
1182
1182
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1183
1183
|
return { srcStat, destStat, isChangingCase: true };
|
|
1184
1184
|
}
|
|
@@ -1200,8 +1200,8 @@ var require_stat = __commonJS({
|
|
|
1200
1200
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
1201
1201
|
if (destStat) {
|
|
1202
1202
|
if (areIdentical(srcStat, destStat)) {
|
|
1203
|
-
const srcBaseName =
|
|
1204
|
-
const destBaseName =
|
|
1203
|
+
const srcBaseName = path7.basename(src);
|
|
1204
|
+
const destBaseName = path7.basename(dest);
|
|
1205
1205
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1206
1206
|
return { srcStat, destStat, isChangingCase: true };
|
|
1207
1207
|
}
|
|
@@ -1220,12 +1220,12 @@ var require_stat = __commonJS({
|
|
|
1220
1220
|
return { srcStat, destStat };
|
|
1221
1221
|
}
|
|
1222
1222
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
1223
|
-
const srcParent =
|
|
1224
|
-
const destParent =
|
|
1225
|
-
if (destParent === srcParent || destParent ===
|
|
1223
|
+
const srcParent = path7.resolve(path7.dirname(src));
|
|
1224
|
+
const destParent = path7.resolve(path7.dirname(dest));
|
|
1225
|
+
if (destParent === srcParent || destParent === path7.parse(destParent).root) return;
|
|
1226
1226
|
let destStat;
|
|
1227
1227
|
try {
|
|
1228
|
-
destStat = await
|
|
1228
|
+
destStat = await fs5.stat(destParent, { bigint: true });
|
|
1229
1229
|
} catch (err) {
|
|
1230
1230
|
if (err.code === "ENOENT") return;
|
|
1231
1231
|
throw err;
|
|
@@ -1236,12 +1236,12 @@ var require_stat = __commonJS({
|
|
|
1236
1236
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
1237
1237
|
}
|
|
1238
1238
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
1239
|
-
const srcParent =
|
|
1240
|
-
const destParent =
|
|
1241
|
-
if (destParent === srcParent || destParent ===
|
|
1239
|
+
const srcParent = path7.resolve(path7.dirname(src));
|
|
1240
|
+
const destParent = path7.resolve(path7.dirname(dest));
|
|
1241
|
+
if (destParent === srcParent || destParent === path7.parse(destParent).root) return;
|
|
1242
1242
|
let destStat;
|
|
1243
1243
|
try {
|
|
1244
|
-
destStat =
|
|
1244
|
+
destStat = fs5.statSync(destParent, { bigint: true });
|
|
1245
1245
|
} catch (err) {
|
|
1246
1246
|
if (err.code === "ENOENT") return;
|
|
1247
1247
|
throw err;
|
|
@@ -1255,8 +1255,8 @@ var require_stat = __commonJS({
|
|
|
1255
1255
|
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
1256
1256
|
}
|
|
1257
1257
|
function isSrcSubdir(src, dest) {
|
|
1258
|
-
const srcArr =
|
|
1259
|
-
const destArr =
|
|
1258
|
+
const srcArr = path7.resolve(src).split(path7.sep).filter((i) => i);
|
|
1259
|
+
const destArr = path7.resolve(dest).split(path7.sep).filter((i) => i);
|
|
1260
1260
|
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
1261
1261
|
}
|
|
1262
1262
|
function errMsg(src, dest, funcName) {
|
|
@@ -1308,8 +1308,8 @@ var require_async = __commonJS({
|
|
|
1308
1308
|
var require_copy = __commonJS({
|
|
1309
1309
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
1310
1310
|
"use strict";
|
|
1311
|
-
var
|
|
1312
|
-
var
|
|
1311
|
+
var fs5 = require_fs();
|
|
1312
|
+
var path7 = require("path");
|
|
1313
1313
|
var { mkdirs } = require_mkdirs();
|
|
1314
1314
|
var { pathExists } = require_path_exists();
|
|
1315
1315
|
var { utimesMillis } = require_utimes();
|
|
@@ -1332,7 +1332,7 @@ var require_copy = __commonJS({
|
|
|
1332
1332
|
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
1333
1333
|
const include = await runFilter(src, dest, opts);
|
|
1334
1334
|
if (!include) return;
|
|
1335
|
-
const destParent =
|
|
1335
|
+
const destParent = path7.dirname(dest);
|
|
1336
1336
|
const dirExists = await pathExists(destParent);
|
|
1337
1337
|
if (!dirExists) {
|
|
1338
1338
|
await mkdirs(destParent);
|
|
@@ -1344,7 +1344,7 @@ var require_copy = __commonJS({
|
|
|
1344
1344
|
return opts.filter(src, dest);
|
|
1345
1345
|
}
|
|
1346
1346
|
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
1347
|
-
const statFn = opts.dereference ?
|
|
1347
|
+
const statFn = opts.dereference ? fs5.stat : fs5.lstat;
|
|
1348
1348
|
const srcStat = await statFn(src);
|
|
1349
1349
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
1350
1350
|
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -1356,7 +1356,7 @@ var require_copy = __commonJS({
|
|
|
1356
1356
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
1357
1357
|
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
1358
1358
|
if (opts.overwrite) {
|
|
1359
|
-
await
|
|
1359
|
+
await fs5.unlink(dest);
|
|
1360
1360
|
return copyFile(srcStat, src, dest, opts);
|
|
1361
1361
|
}
|
|
1362
1362
|
if (opts.errorOnExist) {
|
|
@@ -1364,29 +1364,29 @@ var require_copy = __commonJS({
|
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
1366
|
async function copyFile(srcStat, src, dest, opts) {
|
|
1367
|
-
await
|
|
1367
|
+
await fs5.copyFile(src, dest);
|
|
1368
1368
|
if (opts.preserveTimestamps) {
|
|
1369
1369
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
1370
1370
|
await makeFileWritable(dest, srcStat.mode);
|
|
1371
1371
|
}
|
|
1372
|
-
const updatedSrcStat = await
|
|
1372
|
+
const updatedSrcStat = await fs5.stat(src);
|
|
1373
1373
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1374
1374
|
}
|
|
1375
|
-
return
|
|
1375
|
+
return fs5.chmod(dest, srcStat.mode);
|
|
1376
1376
|
}
|
|
1377
1377
|
function fileIsNotWritable(srcMode) {
|
|
1378
1378
|
return (srcMode & 128) === 0;
|
|
1379
1379
|
}
|
|
1380
1380
|
function makeFileWritable(dest, srcMode) {
|
|
1381
|
-
return
|
|
1381
|
+
return fs5.chmod(dest, srcMode | 128);
|
|
1382
1382
|
}
|
|
1383
1383
|
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
1384
1384
|
if (!destStat) {
|
|
1385
|
-
await
|
|
1385
|
+
await fs5.mkdir(dest);
|
|
1386
1386
|
}
|
|
1387
|
-
await asyncIteratorConcurrentProcess(await
|
|
1388
|
-
const srcItem =
|
|
1389
|
-
const destItem =
|
|
1387
|
+
await asyncIteratorConcurrentProcess(await fs5.opendir(src), async (item) => {
|
|
1388
|
+
const srcItem = path7.join(src, item.name);
|
|
1389
|
+
const destItem = path7.join(dest, item.name);
|
|
1390
1390
|
const include = await runFilter(srcItem, destItem, opts);
|
|
1391
1391
|
if (include) {
|
|
1392
1392
|
const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
@@ -1394,26 +1394,26 @@ var require_copy = __commonJS({
|
|
|
1394
1394
|
}
|
|
1395
1395
|
});
|
|
1396
1396
|
if (!destStat) {
|
|
1397
|
-
await
|
|
1397
|
+
await fs5.chmod(dest, srcStat.mode);
|
|
1398
1398
|
}
|
|
1399
1399
|
}
|
|
1400
1400
|
async function onLink(destStat, src, dest, opts) {
|
|
1401
|
-
let resolvedSrc = await
|
|
1401
|
+
let resolvedSrc = await fs5.readlink(src);
|
|
1402
1402
|
if (opts.dereference) {
|
|
1403
|
-
resolvedSrc =
|
|
1403
|
+
resolvedSrc = path7.resolve(process.cwd(), resolvedSrc);
|
|
1404
1404
|
}
|
|
1405
1405
|
if (!destStat) {
|
|
1406
|
-
return
|
|
1406
|
+
return fs5.symlink(resolvedSrc, dest);
|
|
1407
1407
|
}
|
|
1408
1408
|
let resolvedDest = null;
|
|
1409
1409
|
try {
|
|
1410
|
-
resolvedDest = await
|
|
1410
|
+
resolvedDest = await fs5.readlink(dest);
|
|
1411
1411
|
} catch (e) {
|
|
1412
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
1412
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs5.symlink(resolvedSrc, dest);
|
|
1413
1413
|
throw e;
|
|
1414
1414
|
}
|
|
1415
1415
|
if (opts.dereference) {
|
|
1416
|
-
resolvedDest =
|
|
1416
|
+
resolvedDest = path7.resolve(process.cwd(), resolvedDest);
|
|
1417
1417
|
}
|
|
1418
1418
|
if (resolvedSrc !== resolvedDest) {
|
|
1419
1419
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -1423,8 +1423,8 @@ var require_copy = __commonJS({
|
|
|
1423
1423
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
1424
1424
|
}
|
|
1425
1425
|
}
|
|
1426
|
-
await
|
|
1427
|
-
return
|
|
1426
|
+
await fs5.unlink(dest);
|
|
1427
|
+
return fs5.symlink(resolvedSrc, dest);
|
|
1428
1428
|
}
|
|
1429
1429
|
module2.exports = copy;
|
|
1430
1430
|
}
|
|
@@ -1434,8 +1434,8 @@ var require_copy = __commonJS({
|
|
|
1434
1434
|
var require_copy_sync = __commonJS({
|
|
1435
1435
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
1436
1436
|
"use strict";
|
|
1437
|
-
var
|
|
1438
|
-
var
|
|
1437
|
+
var fs5 = require_graceful_fs();
|
|
1438
|
+
var path7 = require("path");
|
|
1439
1439
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
1440
1440
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
1441
1441
|
var stat = require_stat();
|
|
@@ -1456,12 +1456,12 @@ var require_copy_sync = __commonJS({
|
|
|
1456
1456
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
1457
1457
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
1458
1458
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
1459
|
-
const destParent =
|
|
1460
|
-
if (!
|
|
1459
|
+
const destParent = path7.dirname(dest);
|
|
1460
|
+
if (!fs5.existsSync(destParent)) mkdirsSync(destParent);
|
|
1461
1461
|
return getStats(destStat, src, dest, opts);
|
|
1462
1462
|
}
|
|
1463
1463
|
function getStats(destStat, src, dest, opts) {
|
|
1464
|
-
const statSync = opts.dereference ?
|
|
1464
|
+
const statSync = opts.dereference ? fs5.statSync : fs5.lstatSync;
|
|
1465
1465
|
const srcStat = statSync(src);
|
|
1466
1466
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
1467
1467
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -1476,14 +1476,14 @@ var require_copy_sync = __commonJS({
|
|
|
1476
1476
|
}
|
|
1477
1477
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
1478
1478
|
if (opts.overwrite) {
|
|
1479
|
-
|
|
1479
|
+
fs5.unlinkSync(dest);
|
|
1480
1480
|
return copyFile(srcStat, src, dest, opts);
|
|
1481
1481
|
} else if (opts.errorOnExist) {
|
|
1482
1482
|
throw new Error(`'${dest}' already exists`);
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
1485
|
function copyFile(srcStat, src, dest, opts) {
|
|
1486
|
-
|
|
1486
|
+
fs5.copyFileSync(src, dest);
|
|
1487
1487
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
1488
1488
|
return setDestMode(dest, srcStat.mode);
|
|
1489
1489
|
}
|
|
@@ -1498,10 +1498,10 @@ var require_copy_sync = __commonJS({
|
|
|
1498
1498
|
return setDestMode(dest, srcMode | 128);
|
|
1499
1499
|
}
|
|
1500
1500
|
function setDestMode(dest, srcMode) {
|
|
1501
|
-
return
|
|
1501
|
+
return fs5.chmodSync(dest, srcMode);
|
|
1502
1502
|
}
|
|
1503
1503
|
function setDestTimestamps(src, dest) {
|
|
1504
|
-
const updatedSrcStat =
|
|
1504
|
+
const updatedSrcStat = fs5.statSync(src);
|
|
1505
1505
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
1506
1506
|
}
|
|
1507
1507
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -1509,12 +1509,12 @@ var require_copy_sync = __commonJS({
|
|
|
1509
1509
|
return copyDir(src, dest, opts);
|
|
1510
1510
|
}
|
|
1511
1511
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
1512
|
-
|
|
1512
|
+
fs5.mkdirSync(dest);
|
|
1513
1513
|
copyDir(src, dest, opts);
|
|
1514
1514
|
return setDestMode(dest, srcMode);
|
|
1515
1515
|
}
|
|
1516
1516
|
function copyDir(src, dest, opts) {
|
|
1517
|
-
const dir =
|
|
1517
|
+
const dir = fs5.opendirSync(src);
|
|
1518
1518
|
try {
|
|
1519
1519
|
let dirent;
|
|
1520
1520
|
while ((dirent = dir.readSync()) !== null) {
|
|
@@ -1525,29 +1525,29 @@ var require_copy_sync = __commonJS({
|
|
|
1525
1525
|
}
|
|
1526
1526
|
}
|
|
1527
1527
|
function copyDirItem(item, src, dest, opts) {
|
|
1528
|
-
const srcItem =
|
|
1529
|
-
const destItem =
|
|
1528
|
+
const srcItem = path7.join(src, item);
|
|
1529
|
+
const destItem = path7.join(dest, item);
|
|
1530
1530
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
1531
1531
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
1532
1532
|
return getStats(destStat, srcItem, destItem, opts);
|
|
1533
1533
|
}
|
|
1534
1534
|
function onLink(destStat, src, dest, opts) {
|
|
1535
|
-
let resolvedSrc =
|
|
1535
|
+
let resolvedSrc = fs5.readlinkSync(src);
|
|
1536
1536
|
if (opts.dereference) {
|
|
1537
|
-
resolvedSrc =
|
|
1537
|
+
resolvedSrc = path7.resolve(process.cwd(), resolvedSrc);
|
|
1538
1538
|
}
|
|
1539
1539
|
if (!destStat) {
|
|
1540
|
-
return
|
|
1540
|
+
return fs5.symlinkSync(resolvedSrc, dest);
|
|
1541
1541
|
} else {
|
|
1542
1542
|
let resolvedDest;
|
|
1543
1543
|
try {
|
|
1544
|
-
resolvedDest =
|
|
1544
|
+
resolvedDest = fs5.readlinkSync(dest);
|
|
1545
1545
|
} catch (err) {
|
|
1546
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
1546
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs5.symlinkSync(resolvedSrc, dest);
|
|
1547
1547
|
throw err;
|
|
1548
1548
|
}
|
|
1549
1549
|
if (opts.dereference) {
|
|
1550
|
-
resolvedDest =
|
|
1550
|
+
resolvedDest = path7.resolve(process.cwd(), resolvedDest);
|
|
1551
1551
|
}
|
|
1552
1552
|
if (resolvedSrc !== resolvedDest) {
|
|
1553
1553
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -1561,8 +1561,8 @@ var require_copy_sync = __commonJS({
|
|
|
1561
1561
|
}
|
|
1562
1562
|
}
|
|
1563
1563
|
function copyLink(resolvedSrc, dest) {
|
|
1564
|
-
|
|
1565
|
-
return
|
|
1564
|
+
fs5.unlinkSync(dest);
|
|
1565
|
+
return fs5.symlinkSync(resolvedSrc, dest);
|
|
1566
1566
|
}
|
|
1567
1567
|
module2.exports = copySync;
|
|
1568
1568
|
}
|
|
@@ -1584,13 +1584,13 @@ var require_copy2 = __commonJS({
|
|
|
1584
1584
|
var require_remove = __commonJS({
|
|
1585
1585
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
1586
1586
|
"use strict";
|
|
1587
|
-
var
|
|
1587
|
+
var fs5 = require_graceful_fs();
|
|
1588
1588
|
var u = require_universalify().fromCallback;
|
|
1589
|
-
function remove(
|
|
1590
|
-
|
|
1589
|
+
function remove(path7, callback) {
|
|
1590
|
+
fs5.rm(path7, { recursive: true, force: true }, callback);
|
|
1591
1591
|
}
|
|
1592
|
-
function removeSync(
|
|
1593
|
-
|
|
1592
|
+
function removeSync(path7) {
|
|
1593
|
+
fs5.rmSync(path7, { recursive: true, force: true });
|
|
1594
1594
|
}
|
|
1595
1595
|
module2.exports = {
|
|
1596
1596
|
remove: u(remove),
|
|
@@ -1604,28 +1604,28 @@ var require_empty = __commonJS({
|
|
|
1604
1604
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
1605
1605
|
"use strict";
|
|
1606
1606
|
var u = require_universalify().fromPromise;
|
|
1607
|
-
var
|
|
1608
|
-
var
|
|
1607
|
+
var fs5 = require_fs();
|
|
1608
|
+
var path7 = require("path");
|
|
1609
1609
|
var mkdir = require_mkdirs();
|
|
1610
1610
|
var remove = require_remove();
|
|
1611
1611
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
1612
1612
|
let items;
|
|
1613
1613
|
try {
|
|
1614
|
-
items = await
|
|
1614
|
+
items = await fs5.readdir(dir);
|
|
1615
1615
|
} catch {
|
|
1616
1616
|
return mkdir.mkdirs(dir);
|
|
1617
1617
|
}
|
|
1618
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
1618
|
+
return Promise.all(items.map((item) => remove.remove(path7.join(dir, item))));
|
|
1619
1619
|
});
|
|
1620
1620
|
function emptyDirSync(dir) {
|
|
1621
1621
|
let items;
|
|
1622
1622
|
try {
|
|
1623
|
-
items =
|
|
1623
|
+
items = fs5.readdirSync(dir);
|
|
1624
1624
|
} catch {
|
|
1625
1625
|
return mkdir.mkdirsSync(dir);
|
|
1626
1626
|
}
|
|
1627
1627
|
items.forEach((item) => {
|
|
1628
|
-
item =
|
|
1628
|
+
item = path7.join(dir, item);
|
|
1629
1629
|
remove.removeSync(item);
|
|
1630
1630
|
});
|
|
1631
1631
|
}
|
|
@@ -1643,52 +1643,52 @@ var require_file = __commonJS({
|
|
|
1643
1643
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
1644
1644
|
"use strict";
|
|
1645
1645
|
var u = require_universalify().fromPromise;
|
|
1646
|
-
var
|
|
1647
|
-
var
|
|
1646
|
+
var path7 = require("path");
|
|
1647
|
+
var fs5 = require_fs();
|
|
1648
1648
|
var mkdir = require_mkdirs();
|
|
1649
1649
|
async function createFile(file) {
|
|
1650
1650
|
let stats;
|
|
1651
1651
|
try {
|
|
1652
|
-
stats = await
|
|
1652
|
+
stats = await fs5.stat(file);
|
|
1653
1653
|
} catch {
|
|
1654
1654
|
}
|
|
1655
1655
|
if (stats && stats.isFile()) return;
|
|
1656
|
-
const dir =
|
|
1656
|
+
const dir = path7.dirname(file);
|
|
1657
1657
|
let dirStats = null;
|
|
1658
1658
|
try {
|
|
1659
|
-
dirStats = await
|
|
1659
|
+
dirStats = await fs5.stat(dir);
|
|
1660
1660
|
} catch (err) {
|
|
1661
1661
|
if (err.code === "ENOENT") {
|
|
1662
1662
|
await mkdir.mkdirs(dir);
|
|
1663
|
-
await
|
|
1663
|
+
await fs5.writeFile(file, "");
|
|
1664
1664
|
return;
|
|
1665
1665
|
} else {
|
|
1666
1666
|
throw err;
|
|
1667
1667
|
}
|
|
1668
1668
|
}
|
|
1669
1669
|
if (dirStats.isDirectory()) {
|
|
1670
|
-
await
|
|
1670
|
+
await fs5.writeFile(file, "");
|
|
1671
1671
|
} else {
|
|
1672
|
-
await
|
|
1672
|
+
await fs5.readdir(dir);
|
|
1673
1673
|
}
|
|
1674
1674
|
}
|
|
1675
1675
|
function createFileSync(file) {
|
|
1676
1676
|
let stats;
|
|
1677
1677
|
try {
|
|
1678
|
-
stats =
|
|
1678
|
+
stats = fs5.statSync(file);
|
|
1679
1679
|
} catch {
|
|
1680
1680
|
}
|
|
1681
1681
|
if (stats && stats.isFile()) return;
|
|
1682
|
-
const dir =
|
|
1682
|
+
const dir = path7.dirname(file);
|
|
1683
1683
|
try {
|
|
1684
|
-
if (!
|
|
1685
|
-
|
|
1684
|
+
if (!fs5.statSync(dir).isDirectory()) {
|
|
1685
|
+
fs5.readdirSync(dir);
|
|
1686
1686
|
}
|
|
1687
1687
|
} catch (err) {
|
|
1688
1688
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
1689
1689
|
else throw err;
|
|
1690
1690
|
}
|
|
1691
|
-
|
|
1691
|
+
fs5.writeFileSync(file, "");
|
|
1692
1692
|
}
|
|
1693
1693
|
module2.exports = {
|
|
1694
1694
|
createFile: u(createFile),
|
|
@@ -1702,50 +1702,50 @@ var require_link = __commonJS({
|
|
|
1702
1702
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
1703
1703
|
"use strict";
|
|
1704
1704
|
var u = require_universalify().fromPromise;
|
|
1705
|
-
var
|
|
1706
|
-
var
|
|
1705
|
+
var path7 = require("path");
|
|
1706
|
+
var fs5 = require_fs();
|
|
1707
1707
|
var mkdir = require_mkdirs();
|
|
1708
1708
|
var { pathExists } = require_path_exists();
|
|
1709
1709
|
var { areIdentical } = require_stat();
|
|
1710
1710
|
async function createLink(srcpath, dstpath) {
|
|
1711
1711
|
let dstStat;
|
|
1712
1712
|
try {
|
|
1713
|
-
dstStat = await
|
|
1713
|
+
dstStat = await fs5.lstat(dstpath);
|
|
1714
1714
|
} catch {
|
|
1715
1715
|
}
|
|
1716
1716
|
let srcStat;
|
|
1717
1717
|
try {
|
|
1718
|
-
srcStat = await
|
|
1718
|
+
srcStat = await fs5.lstat(srcpath);
|
|
1719
1719
|
} catch (err) {
|
|
1720
1720
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
1721
1721
|
throw err;
|
|
1722
1722
|
}
|
|
1723
1723
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1724
|
-
const dir =
|
|
1724
|
+
const dir = path7.dirname(dstpath);
|
|
1725
1725
|
const dirExists = await pathExists(dir);
|
|
1726
1726
|
if (!dirExists) {
|
|
1727
1727
|
await mkdir.mkdirs(dir);
|
|
1728
1728
|
}
|
|
1729
|
-
await
|
|
1729
|
+
await fs5.link(srcpath, dstpath);
|
|
1730
1730
|
}
|
|
1731
1731
|
function createLinkSync(srcpath, dstpath) {
|
|
1732
1732
|
let dstStat;
|
|
1733
1733
|
try {
|
|
1734
|
-
dstStat =
|
|
1734
|
+
dstStat = fs5.lstatSync(dstpath);
|
|
1735
1735
|
} catch {
|
|
1736
1736
|
}
|
|
1737
1737
|
try {
|
|
1738
|
-
const srcStat =
|
|
1738
|
+
const srcStat = fs5.lstatSync(srcpath);
|
|
1739
1739
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1740
1740
|
} catch (err) {
|
|
1741
1741
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
1742
1742
|
throw err;
|
|
1743
1743
|
}
|
|
1744
|
-
const dir =
|
|
1745
|
-
const dirExists =
|
|
1746
|
-
if (dirExists) return
|
|
1744
|
+
const dir = path7.dirname(dstpath);
|
|
1745
|
+
const dirExists = fs5.existsSync(dir);
|
|
1746
|
+
if (dirExists) return fs5.linkSync(srcpath, dstpath);
|
|
1747
1747
|
mkdir.mkdirsSync(dir);
|
|
1748
|
-
return
|
|
1748
|
+
return fs5.linkSync(srcpath, dstpath);
|
|
1749
1749
|
}
|
|
1750
1750
|
module2.exports = {
|
|
1751
1751
|
createLink: u(createLink),
|
|
@@ -1758,14 +1758,14 @@ var require_link = __commonJS({
|
|
|
1758
1758
|
var require_symlink_paths = __commonJS({
|
|
1759
1759
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
1760
1760
|
"use strict";
|
|
1761
|
-
var
|
|
1762
|
-
var
|
|
1761
|
+
var path7 = require("path");
|
|
1762
|
+
var fs5 = require_fs();
|
|
1763
1763
|
var { pathExists } = require_path_exists();
|
|
1764
1764
|
var u = require_universalify().fromPromise;
|
|
1765
1765
|
async function symlinkPaths(srcpath, dstpath) {
|
|
1766
|
-
if (
|
|
1766
|
+
if (path7.isAbsolute(srcpath)) {
|
|
1767
1767
|
try {
|
|
1768
|
-
await
|
|
1768
|
+
await fs5.lstat(srcpath);
|
|
1769
1769
|
} catch (err) {
|
|
1770
1770
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1771
1771
|
throw err;
|
|
@@ -1775,8 +1775,8 @@ var require_symlink_paths = __commonJS({
|
|
|
1775
1775
|
toDst: srcpath
|
|
1776
1776
|
};
|
|
1777
1777
|
}
|
|
1778
|
-
const dstdir =
|
|
1779
|
-
const relativeToDst =
|
|
1778
|
+
const dstdir = path7.dirname(dstpath);
|
|
1779
|
+
const relativeToDst = path7.join(dstdir, srcpath);
|
|
1780
1780
|
const exists = await pathExists(relativeToDst);
|
|
1781
1781
|
if (exists) {
|
|
1782
1782
|
return {
|
|
@@ -1785,39 +1785,39 @@ var require_symlink_paths = __commonJS({
|
|
|
1785
1785
|
};
|
|
1786
1786
|
}
|
|
1787
1787
|
try {
|
|
1788
|
-
await
|
|
1788
|
+
await fs5.lstat(srcpath);
|
|
1789
1789
|
} catch (err) {
|
|
1790
1790
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
1791
1791
|
throw err;
|
|
1792
1792
|
}
|
|
1793
1793
|
return {
|
|
1794
1794
|
toCwd: srcpath,
|
|
1795
|
-
toDst:
|
|
1795
|
+
toDst: path7.relative(dstdir, srcpath)
|
|
1796
1796
|
};
|
|
1797
1797
|
}
|
|
1798
1798
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
1799
|
-
if (
|
|
1800
|
-
const exists2 =
|
|
1799
|
+
if (path7.isAbsolute(srcpath)) {
|
|
1800
|
+
const exists2 = fs5.existsSync(srcpath);
|
|
1801
1801
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
1802
1802
|
return {
|
|
1803
1803
|
toCwd: srcpath,
|
|
1804
1804
|
toDst: srcpath
|
|
1805
1805
|
};
|
|
1806
1806
|
}
|
|
1807
|
-
const dstdir =
|
|
1808
|
-
const relativeToDst =
|
|
1809
|
-
const exists =
|
|
1807
|
+
const dstdir = path7.dirname(dstpath);
|
|
1808
|
+
const relativeToDst = path7.join(dstdir, srcpath);
|
|
1809
|
+
const exists = fs5.existsSync(relativeToDst);
|
|
1810
1810
|
if (exists) {
|
|
1811
1811
|
return {
|
|
1812
1812
|
toCwd: relativeToDst,
|
|
1813
1813
|
toDst: srcpath
|
|
1814
1814
|
};
|
|
1815
1815
|
}
|
|
1816
|
-
const srcExists =
|
|
1816
|
+
const srcExists = fs5.existsSync(srcpath);
|
|
1817
1817
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
1818
1818
|
return {
|
|
1819
1819
|
toCwd: srcpath,
|
|
1820
|
-
toDst:
|
|
1820
|
+
toDst: path7.relative(dstdir, srcpath)
|
|
1821
1821
|
};
|
|
1822
1822
|
}
|
|
1823
1823
|
module2.exports = {
|
|
@@ -1831,13 +1831,13 @@ var require_symlink_paths = __commonJS({
|
|
|
1831
1831
|
var require_symlink_type = __commonJS({
|
|
1832
1832
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
1833
1833
|
"use strict";
|
|
1834
|
-
var
|
|
1834
|
+
var fs5 = require_fs();
|
|
1835
1835
|
var u = require_universalify().fromPromise;
|
|
1836
1836
|
async function symlinkType(srcpath, type) {
|
|
1837
1837
|
if (type) return type;
|
|
1838
1838
|
let stats;
|
|
1839
1839
|
try {
|
|
1840
|
-
stats = await
|
|
1840
|
+
stats = await fs5.lstat(srcpath);
|
|
1841
1841
|
} catch {
|
|
1842
1842
|
return "file";
|
|
1843
1843
|
}
|
|
@@ -1847,7 +1847,7 @@ var require_symlink_type = __commonJS({
|
|
|
1847
1847
|
if (type) return type;
|
|
1848
1848
|
let stats;
|
|
1849
1849
|
try {
|
|
1850
|
-
stats =
|
|
1850
|
+
stats = fs5.lstatSync(srcpath);
|
|
1851
1851
|
} catch {
|
|
1852
1852
|
return "file";
|
|
1853
1853
|
}
|
|
@@ -1865,8 +1865,8 @@ var require_symlink = __commonJS({
|
|
|
1865
1865
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
1866
1866
|
"use strict";
|
|
1867
1867
|
var u = require_universalify().fromPromise;
|
|
1868
|
-
var
|
|
1869
|
-
var
|
|
1868
|
+
var path7 = require("path");
|
|
1869
|
+
var fs5 = require_fs();
|
|
1870
1870
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
1871
1871
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
1872
1872
|
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
@@ -1875,44 +1875,44 @@ var require_symlink = __commonJS({
|
|
|
1875
1875
|
async function createSymlink(srcpath, dstpath, type) {
|
|
1876
1876
|
let stats;
|
|
1877
1877
|
try {
|
|
1878
|
-
stats = await
|
|
1878
|
+
stats = await fs5.lstat(dstpath);
|
|
1879
1879
|
} catch {
|
|
1880
1880
|
}
|
|
1881
1881
|
if (stats && stats.isSymbolicLink()) {
|
|
1882
1882
|
const [srcStat, dstStat] = await Promise.all([
|
|
1883
|
-
|
|
1884
|
-
|
|
1883
|
+
fs5.stat(srcpath),
|
|
1884
|
+
fs5.stat(dstpath)
|
|
1885
1885
|
]);
|
|
1886
1886
|
if (areIdentical(srcStat, dstStat)) return;
|
|
1887
1887
|
}
|
|
1888
1888
|
const relative = await symlinkPaths(srcpath, dstpath);
|
|
1889
1889
|
srcpath = relative.toDst;
|
|
1890
1890
|
const toType = await symlinkType(relative.toCwd, type);
|
|
1891
|
-
const dir =
|
|
1891
|
+
const dir = path7.dirname(dstpath);
|
|
1892
1892
|
if (!await pathExists(dir)) {
|
|
1893
1893
|
await mkdirs(dir);
|
|
1894
1894
|
}
|
|
1895
|
-
return
|
|
1895
|
+
return fs5.symlink(srcpath, dstpath, toType);
|
|
1896
1896
|
}
|
|
1897
1897
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
1898
1898
|
let stats;
|
|
1899
1899
|
try {
|
|
1900
|
-
stats =
|
|
1900
|
+
stats = fs5.lstatSync(dstpath);
|
|
1901
1901
|
} catch {
|
|
1902
1902
|
}
|
|
1903
1903
|
if (stats && stats.isSymbolicLink()) {
|
|
1904
|
-
const srcStat =
|
|
1905
|
-
const dstStat =
|
|
1904
|
+
const srcStat = fs5.statSync(srcpath);
|
|
1905
|
+
const dstStat = fs5.statSync(dstpath);
|
|
1906
1906
|
if (areIdentical(srcStat, dstStat)) return;
|
|
1907
1907
|
}
|
|
1908
1908
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
1909
1909
|
srcpath = relative.toDst;
|
|
1910
1910
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
1911
|
-
const dir =
|
|
1912
|
-
const exists =
|
|
1913
|
-
if (exists) return
|
|
1911
|
+
const dir = path7.dirname(dstpath);
|
|
1912
|
+
const exists = fs5.existsSync(dir);
|
|
1913
|
+
if (exists) return fs5.symlinkSync(srcpath, dstpath, type);
|
|
1914
1914
|
mkdirsSync(dir);
|
|
1915
|
-
return
|
|
1915
|
+
return fs5.symlinkSync(srcpath, dstpath, type);
|
|
1916
1916
|
}
|
|
1917
1917
|
module2.exports = {
|
|
1918
1918
|
createSymlink: u(createSymlink),
|
|
@@ -1981,9 +1981,9 @@ var require_jsonfile = __commonJS({
|
|
|
1981
1981
|
if (typeof options === "string") {
|
|
1982
1982
|
options = { encoding: options };
|
|
1983
1983
|
}
|
|
1984
|
-
const
|
|
1984
|
+
const fs5 = options.fs || _fs;
|
|
1985
1985
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
1986
|
-
let data = await universalify.fromCallback(
|
|
1986
|
+
let data = await universalify.fromCallback(fs5.readFile)(file, options);
|
|
1987
1987
|
data = stripBom(data);
|
|
1988
1988
|
let obj;
|
|
1989
1989
|
try {
|
|
@@ -2003,10 +2003,10 @@ var require_jsonfile = __commonJS({
|
|
|
2003
2003
|
if (typeof options === "string") {
|
|
2004
2004
|
options = { encoding: options };
|
|
2005
2005
|
}
|
|
2006
|
-
const
|
|
2006
|
+
const fs5 = options.fs || _fs;
|
|
2007
2007
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
2008
2008
|
try {
|
|
2009
|
-
let content =
|
|
2009
|
+
let content = fs5.readFileSync(file, options);
|
|
2010
2010
|
content = stripBom(content);
|
|
2011
2011
|
return JSON.parse(content, options.reviver);
|
|
2012
2012
|
} catch (err) {
|
|
@@ -2019,15 +2019,15 @@ var require_jsonfile = __commonJS({
|
|
|
2019
2019
|
}
|
|
2020
2020
|
}
|
|
2021
2021
|
async function _writeFile(file, obj, options = {}) {
|
|
2022
|
-
const
|
|
2022
|
+
const fs5 = options.fs || _fs;
|
|
2023
2023
|
const str = stringify(obj, options);
|
|
2024
|
-
await universalify.fromCallback(
|
|
2024
|
+
await universalify.fromCallback(fs5.writeFile)(file, str, options);
|
|
2025
2025
|
}
|
|
2026
2026
|
var writeFile = universalify.fromPromise(_writeFile);
|
|
2027
2027
|
function writeFileSync(file, obj, options = {}) {
|
|
2028
|
-
const
|
|
2028
|
+
const fs5 = options.fs || _fs;
|
|
2029
2029
|
const str = stringify(obj, options);
|
|
2030
|
-
return
|
|
2030
|
+
return fs5.writeFileSync(file, str, options);
|
|
2031
2031
|
}
|
|
2032
2032
|
module2.exports = {
|
|
2033
2033
|
readFile,
|
|
@@ -2058,23 +2058,23 @@ var require_output_file = __commonJS({
|
|
|
2058
2058
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
|
|
2059
2059
|
"use strict";
|
|
2060
2060
|
var u = require_universalify().fromPromise;
|
|
2061
|
-
var
|
|
2062
|
-
var
|
|
2061
|
+
var fs5 = require_fs();
|
|
2062
|
+
var path7 = require("path");
|
|
2063
2063
|
var mkdir = require_mkdirs();
|
|
2064
2064
|
var pathExists = require_path_exists().pathExists;
|
|
2065
2065
|
async function outputFile(file, data, encoding = "utf-8") {
|
|
2066
|
-
const dir =
|
|
2066
|
+
const dir = path7.dirname(file);
|
|
2067
2067
|
if (!await pathExists(dir)) {
|
|
2068
2068
|
await mkdir.mkdirs(dir);
|
|
2069
2069
|
}
|
|
2070
|
-
return
|
|
2070
|
+
return fs5.writeFile(file, data, encoding);
|
|
2071
2071
|
}
|
|
2072
2072
|
function outputFileSync(file, ...args) {
|
|
2073
|
-
const dir =
|
|
2074
|
-
if (!
|
|
2073
|
+
const dir = path7.dirname(file);
|
|
2074
|
+
if (!fs5.existsSync(dir)) {
|
|
2075
2075
|
mkdir.mkdirsSync(dir);
|
|
2076
2076
|
}
|
|
2077
|
-
|
|
2077
|
+
fs5.writeFileSync(file, ...args);
|
|
2078
2078
|
}
|
|
2079
2079
|
module2.exports = {
|
|
2080
2080
|
outputFile: u(outputFile),
|
|
@@ -2133,8 +2133,8 @@ var require_json = __commonJS({
|
|
|
2133
2133
|
var require_move = __commonJS({
|
|
2134
2134
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
2135
2135
|
"use strict";
|
|
2136
|
-
var
|
|
2137
|
-
var
|
|
2136
|
+
var fs5 = require_fs();
|
|
2137
|
+
var path7 = require("path");
|
|
2138
2138
|
var { copy } = require_copy2();
|
|
2139
2139
|
var { remove } = require_remove();
|
|
2140
2140
|
var { mkdirp } = require_mkdirs();
|
|
@@ -2144,8 +2144,8 @@ var require_move = __commonJS({
|
|
|
2144
2144
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2145
2145
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
2146
2146
|
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
2147
|
-
const destParent =
|
|
2148
|
-
const parsedParentPath =
|
|
2147
|
+
const destParent = path7.dirname(dest);
|
|
2148
|
+
const parsedParentPath = path7.parse(destParent);
|
|
2149
2149
|
if (parsedParentPath.root !== destParent) {
|
|
2150
2150
|
await mkdirp(destParent);
|
|
2151
2151
|
}
|
|
@@ -2160,7 +2160,7 @@ var require_move = __commonJS({
|
|
|
2160
2160
|
}
|
|
2161
2161
|
}
|
|
2162
2162
|
try {
|
|
2163
|
-
await
|
|
2163
|
+
await fs5.rename(src, dest);
|
|
2164
2164
|
} catch (err) {
|
|
2165
2165
|
if (err.code !== "EXDEV") {
|
|
2166
2166
|
throw err;
|
|
@@ -2185,8 +2185,8 @@ var require_move = __commonJS({
|
|
|
2185
2185
|
var require_move_sync = __commonJS({
|
|
2186
2186
|
"../../../node_modules/.pnpm/fs-extra@11.3.3/node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
2187
2187
|
"use strict";
|
|
2188
|
-
var
|
|
2189
|
-
var
|
|
2188
|
+
var fs5 = require_graceful_fs();
|
|
2189
|
+
var path7 = require("path");
|
|
2190
2190
|
var copySync = require_copy2().copySync;
|
|
2191
2191
|
var removeSync = require_remove().removeSync;
|
|
2192
2192
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -2196,12 +2196,12 @@ var require_move_sync = __commonJS({
|
|
|
2196
2196
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2197
2197
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
2198
2198
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
2199
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
2199
|
+
if (!isParentRoot(dest)) mkdirpSync(path7.dirname(dest));
|
|
2200
2200
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
2201
2201
|
}
|
|
2202
2202
|
function isParentRoot(dest) {
|
|
2203
|
-
const parent =
|
|
2204
|
-
const parsedPath =
|
|
2203
|
+
const parent = path7.dirname(dest);
|
|
2204
|
+
const parsedPath = path7.parse(parent);
|
|
2205
2205
|
return parsedPath.root === parent;
|
|
2206
2206
|
}
|
|
2207
2207
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -2210,12 +2210,12 @@ var require_move_sync = __commonJS({
|
|
|
2210
2210
|
removeSync(dest);
|
|
2211
2211
|
return rename(src, dest, overwrite);
|
|
2212
2212
|
}
|
|
2213
|
-
if (
|
|
2213
|
+
if (fs5.existsSync(dest)) throw new Error("dest already exists.");
|
|
2214
2214
|
return rename(src, dest, overwrite);
|
|
2215
2215
|
}
|
|
2216
2216
|
function rename(src, dest, overwrite) {
|
|
2217
2217
|
try {
|
|
2218
|
-
|
|
2218
|
+
fs5.renameSync(src, dest);
|
|
2219
2219
|
} catch (err) {
|
|
2220
2220
|
if (err.code !== "EXDEV") throw err;
|
|
2221
2221
|
return moveAcrossDevice(src, dest, overwrite);
|
|
@@ -2273,8 +2273,8 @@ var require_windows = __commonJS({
|
|
|
2273
2273
|
"use strict";
|
|
2274
2274
|
module2.exports = isexe;
|
|
2275
2275
|
isexe.sync = sync;
|
|
2276
|
-
var
|
|
2277
|
-
function checkPathExt(
|
|
2276
|
+
var fs5 = require("fs");
|
|
2277
|
+
function checkPathExt(path7, options) {
|
|
2278
2278
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
2279
2279
|
if (!pathext) {
|
|
2280
2280
|
return true;
|
|
@@ -2285,25 +2285,25 @@ var require_windows = __commonJS({
|
|
|
2285
2285
|
}
|
|
2286
2286
|
for (var i = 0; i < pathext.length; i++) {
|
|
2287
2287
|
var p = pathext[i].toLowerCase();
|
|
2288
|
-
if (p &&
|
|
2288
|
+
if (p && path7.substr(-p.length).toLowerCase() === p) {
|
|
2289
2289
|
return true;
|
|
2290
2290
|
}
|
|
2291
2291
|
}
|
|
2292
2292
|
return false;
|
|
2293
2293
|
}
|
|
2294
|
-
function checkStat(stat,
|
|
2294
|
+
function checkStat(stat, path7, options) {
|
|
2295
2295
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
2296
2296
|
return false;
|
|
2297
2297
|
}
|
|
2298
|
-
return checkPathExt(
|
|
2298
|
+
return checkPathExt(path7, options);
|
|
2299
2299
|
}
|
|
2300
|
-
function isexe(
|
|
2301
|
-
|
|
2302
|
-
cb(er, er ? false : checkStat(stat,
|
|
2300
|
+
function isexe(path7, options, cb) {
|
|
2301
|
+
fs5.stat(path7, function(er, stat) {
|
|
2302
|
+
cb(er, er ? false : checkStat(stat, path7, options));
|
|
2303
2303
|
});
|
|
2304
2304
|
}
|
|
2305
|
-
function sync(
|
|
2306
|
-
return checkStat(
|
|
2305
|
+
function sync(path7, options) {
|
|
2306
|
+
return checkStat(fs5.statSync(path7), path7, options);
|
|
2307
2307
|
}
|
|
2308
2308
|
}
|
|
2309
2309
|
});
|
|
@@ -2314,14 +2314,14 @@ var require_mode = __commonJS({
|
|
|
2314
2314
|
"use strict";
|
|
2315
2315
|
module2.exports = isexe;
|
|
2316
2316
|
isexe.sync = sync;
|
|
2317
|
-
var
|
|
2318
|
-
function isexe(
|
|
2319
|
-
|
|
2317
|
+
var fs5 = require("fs");
|
|
2318
|
+
function isexe(path7, options, cb) {
|
|
2319
|
+
fs5.stat(path7, function(er, stat) {
|
|
2320
2320
|
cb(er, er ? false : checkStat(stat, options));
|
|
2321
2321
|
});
|
|
2322
2322
|
}
|
|
2323
|
-
function sync(
|
|
2324
|
-
return checkStat(
|
|
2323
|
+
function sync(path7, options) {
|
|
2324
|
+
return checkStat(fs5.statSync(path7), options);
|
|
2325
2325
|
}
|
|
2326
2326
|
function checkStat(stat, options) {
|
|
2327
2327
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -2346,7 +2346,7 @@ var require_mode = __commonJS({
|
|
|
2346
2346
|
var require_isexe = __commonJS({
|
|
2347
2347
|
"../../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports2, module2) {
|
|
2348
2348
|
"use strict";
|
|
2349
|
-
var
|
|
2349
|
+
var fs5 = require("fs");
|
|
2350
2350
|
var core;
|
|
2351
2351
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
2352
2352
|
core = require_windows();
|
|
@@ -2355,7 +2355,7 @@ var require_isexe = __commonJS({
|
|
|
2355
2355
|
}
|
|
2356
2356
|
module2.exports = isexe;
|
|
2357
2357
|
isexe.sync = sync;
|
|
2358
|
-
function isexe(
|
|
2358
|
+
function isexe(path7, options, cb) {
|
|
2359
2359
|
if (typeof options === "function") {
|
|
2360
2360
|
cb = options;
|
|
2361
2361
|
options = {};
|
|
@@ -2365,7 +2365,7 @@ var require_isexe = __commonJS({
|
|
|
2365
2365
|
throw new TypeError("callback not provided");
|
|
2366
2366
|
}
|
|
2367
2367
|
return new Promise(function(resolve, reject) {
|
|
2368
|
-
isexe(
|
|
2368
|
+
isexe(path7, options || {}, function(er, is) {
|
|
2369
2369
|
if (er) {
|
|
2370
2370
|
reject(er);
|
|
2371
2371
|
} else {
|
|
@@ -2374,7 +2374,7 @@ var require_isexe = __commonJS({
|
|
|
2374
2374
|
});
|
|
2375
2375
|
});
|
|
2376
2376
|
}
|
|
2377
|
-
core(
|
|
2377
|
+
core(path7, options || {}, function(er, is) {
|
|
2378
2378
|
if (er) {
|
|
2379
2379
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
2380
2380
|
er = null;
|
|
@@ -2384,9 +2384,9 @@ var require_isexe = __commonJS({
|
|
|
2384
2384
|
cb(er, is);
|
|
2385
2385
|
});
|
|
2386
2386
|
}
|
|
2387
|
-
function sync(
|
|
2387
|
+
function sync(path7, options) {
|
|
2388
2388
|
try {
|
|
2389
|
-
return core.sync(
|
|
2389
|
+
return core.sync(path7, options || {});
|
|
2390
2390
|
} catch (er) {
|
|
2391
2391
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
2392
2392
|
return false;
|
|
@@ -2403,7 +2403,7 @@ var require_which = __commonJS({
|
|
|
2403
2403
|
"../../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports2, module2) {
|
|
2404
2404
|
"use strict";
|
|
2405
2405
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
2406
|
-
var
|
|
2406
|
+
var path7 = require("path");
|
|
2407
2407
|
var COLON = isWindows ? ";" : ":";
|
|
2408
2408
|
var isexe = require_isexe();
|
|
2409
2409
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -2441,7 +2441,7 @@ var require_which = __commonJS({
|
|
|
2441
2441
|
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
2442
2442
|
const ppRaw = pathEnv[i];
|
|
2443
2443
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2444
|
-
const pCmd =
|
|
2444
|
+
const pCmd = path7.join(pathPart, cmd);
|
|
2445
2445
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2446
2446
|
resolve(subStep(p, i, 0));
|
|
2447
2447
|
});
|
|
@@ -2468,7 +2468,7 @@ var require_which = __commonJS({
|
|
|
2468
2468
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
2469
2469
|
const ppRaw = pathEnv[i];
|
|
2470
2470
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2471
|
-
const pCmd =
|
|
2471
|
+
const pCmd = path7.join(pathPart, cmd);
|
|
2472
2472
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2473
2473
|
for (let j = 0; j < pathExt.length; j++) {
|
|
2474
2474
|
const cur = p + pathExt[j];
|
|
@@ -2516,7 +2516,7 @@ var require_path_key = __commonJS({
|
|
|
2516
2516
|
var require_resolveCommand = __commonJS({
|
|
2517
2517
|
"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
|
|
2518
2518
|
"use strict";
|
|
2519
|
-
var
|
|
2519
|
+
var path7 = require("path");
|
|
2520
2520
|
var which = require_which();
|
|
2521
2521
|
var getPathKey = require_path_key();
|
|
2522
2522
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -2534,7 +2534,7 @@ var require_resolveCommand = __commonJS({
|
|
|
2534
2534
|
try {
|
|
2535
2535
|
resolved = which.sync(parsed.command, {
|
|
2536
2536
|
path: env[getPathKey({ env })],
|
|
2537
|
-
pathExt: withoutPathExt ?
|
|
2537
|
+
pathExt: withoutPathExt ? path7.delimiter : void 0
|
|
2538
2538
|
});
|
|
2539
2539
|
} catch (e) {
|
|
2540
2540
|
} finally {
|
|
@@ -2543,7 +2543,7 @@ var require_resolveCommand = __commonJS({
|
|
|
2543
2543
|
}
|
|
2544
2544
|
}
|
|
2545
2545
|
if (resolved) {
|
|
2546
|
-
resolved =
|
|
2546
|
+
resolved = path7.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
2547
2547
|
}
|
|
2548
2548
|
return resolved;
|
|
2549
2549
|
}
|
|
@@ -2597,8 +2597,8 @@ var require_shebang_command = __commonJS({
|
|
|
2597
2597
|
if (!match) {
|
|
2598
2598
|
return null;
|
|
2599
2599
|
}
|
|
2600
|
-
const [
|
|
2601
|
-
const binary =
|
|
2600
|
+
const [path7, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
2601
|
+
const binary = path7.split("/").pop();
|
|
2602
2602
|
if (binary === "env") {
|
|
2603
2603
|
return argument;
|
|
2604
2604
|
}
|
|
@@ -2611,16 +2611,16 @@ var require_shebang_command = __commonJS({
|
|
|
2611
2611
|
var require_readShebang = __commonJS({
|
|
2612
2612
|
"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
|
|
2613
2613
|
"use strict";
|
|
2614
|
-
var
|
|
2614
|
+
var fs5 = require("fs");
|
|
2615
2615
|
var shebangCommand = require_shebang_command();
|
|
2616
2616
|
function readShebang(command) {
|
|
2617
2617
|
const size = 150;
|
|
2618
2618
|
const buffer = Buffer.alloc(size);
|
|
2619
2619
|
let fd;
|
|
2620
2620
|
try {
|
|
2621
|
-
fd =
|
|
2622
|
-
|
|
2623
|
-
|
|
2621
|
+
fd = fs5.openSync(command, "r");
|
|
2622
|
+
fs5.readSync(fd, buffer, 0, size, 0);
|
|
2623
|
+
fs5.closeSync(fd);
|
|
2624
2624
|
} catch (e) {
|
|
2625
2625
|
}
|
|
2626
2626
|
return shebangCommand(buffer.toString());
|
|
@@ -2633,7 +2633,7 @@ var require_readShebang = __commonJS({
|
|
|
2633
2633
|
var require_parse = __commonJS({
|
|
2634
2634
|
"../../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
|
|
2635
2635
|
"use strict";
|
|
2636
|
-
var
|
|
2636
|
+
var path7 = require("path");
|
|
2637
2637
|
var resolveCommand = require_resolveCommand();
|
|
2638
2638
|
var escape = require_escape();
|
|
2639
2639
|
var readShebang = require_readShebang();
|
|
@@ -2658,7 +2658,7 @@ var require_parse = __commonJS({
|
|
|
2658
2658
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
2659
2659
|
if (parsed.options.forceShell || needsShell) {
|
|
2660
2660
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
2661
|
-
parsed.command =
|
|
2661
|
+
parsed.command = path7.normalize(parsed.command);
|
|
2662
2662
|
parsed.command = escape.command(parsed.command);
|
|
2663
2663
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
2664
2664
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -4106,14 +4106,14 @@ var require_merge_stream = __commonJS({
|
|
|
4106
4106
|
var sources = [];
|
|
4107
4107
|
var output = new PassThrough({ objectMode: true });
|
|
4108
4108
|
output.setMaxListeners(0);
|
|
4109
|
-
output.add =
|
|
4109
|
+
output.add = add2;
|
|
4110
4110
|
output.isEmpty = isEmpty;
|
|
4111
4111
|
output.on("unpipe", remove);
|
|
4112
|
-
Array.prototype.slice.call(arguments).forEach(
|
|
4112
|
+
Array.prototype.slice.call(arguments).forEach(add2);
|
|
4113
4113
|
return output;
|
|
4114
|
-
function
|
|
4114
|
+
function add2(source) {
|
|
4115
4115
|
if (Array.isArray(source)) {
|
|
4116
|
-
source.forEach(
|
|
4116
|
+
source.forEach(add2);
|
|
4117
4117
|
return this;
|
|
4118
4118
|
}
|
|
4119
4119
|
sources.push(source);
|
|
@@ -5732,7 +5732,7 @@ var require_no_conflict = __commonJS({
|
|
|
5732
5732
|
"../../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/no-conflict.js"(exports2, module2) {
|
|
5733
5733
|
"use strict";
|
|
5734
5734
|
exports2.__esModule = true;
|
|
5735
|
-
exports2["default"] = function(
|
|
5735
|
+
exports2["default"] = function(Handlebars3) {
|
|
5736
5736
|
(function() {
|
|
5737
5737
|
if (typeof globalThis === "object") return;
|
|
5738
5738
|
Object.prototype.__defineGetter__("__magic__", function() {
|
|
@@ -5742,11 +5742,11 @@ var require_no_conflict = __commonJS({
|
|
|
5742
5742
|
delete Object.prototype.__magic__;
|
|
5743
5743
|
})();
|
|
5744
5744
|
var $Handlebars = globalThis.Handlebars;
|
|
5745
|
-
|
|
5746
|
-
if (globalThis.Handlebars ===
|
|
5745
|
+
Handlebars3.noConflict = function() {
|
|
5746
|
+
if (globalThis.Handlebars === Handlebars3) {
|
|
5747
5747
|
globalThis.Handlebars = $Handlebars;
|
|
5748
5748
|
}
|
|
5749
|
-
return
|
|
5749
|
+
return Handlebars3;
|
|
5750
5750
|
};
|
|
5751
5751
|
};
|
|
5752
5752
|
module2.exports = exports2["default"];
|
|
@@ -5823,13 +5823,13 @@ var require_ast = __commonJS({
|
|
|
5823
5823
|
helperExpression: function helperExpression(node) {
|
|
5824
5824
|
return node.type === "SubExpression" || (node.type === "MustacheStatement" || node.type === "BlockStatement") && !!(node.params && node.params.length || node.hash);
|
|
5825
5825
|
},
|
|
5826
|
-
scopedId: function scopedId(
|
|
5827
|
-
return /^\.|this\b/.test(
|
|
5826
|
+
scopedId: function scopedId(path7) {
|
|
5827
|
+
return /^\.|this\b/.test(path7.original);
|
|
5828
5828
|
},
|
|
5829
5829
|
// an ID is simple if it only has one part, and that part is not
|
|
5830
5830
|
// `..` or `this`.
|
|
5831
|
-
simpleId: function simpleId(
|
|
5832
|
-
return
|
|
5831
|
+
simpleId: function simpleId(path7) {
|
|
5832
|
+
return path7.parts.length === 1 && !AST.helpers.scopedId(path7) && !path7.depth;
|
|
5833
5833
|
}
|
|
5834
5834
|
}
|
|
5835
5835
|
};
|
|
@@ -6899,12 +6899,12 @@ var require_helpers2 = __commonJS({
|
|
|
6899
6899
|
loc
|
|
6900
6900
|
};
|
|
6901
6901
|
}
|
|
6902
|
-
function prepareMustache(
|
|
6902
|
+
function prepareMustache(path7, params, hash, open, strip, locInfo) {
|
|
6903
6903
|
var escapeFlag = open.charAt(3) || open.charAt(2), escaped = escapeFlag !== "{" && escapeFlag !== "&";
|
|
6904
6904
|
var decorator = /\*/.test(open);
|
|
6905
6905
|
return {
|
|
6906
6906
|
type: decorator ? "Decorator" : "MustacheStatement",
|
|
6907
|
-
path:
|
|
6907
|
+
path: path7,
|
|
6908
6908
|
params,
|
|
6909
6909
|
hash,
|
|
6910
6910
|
escaped,
|
|
@@ -7174,9 +7174,9 @@ var require_compiler = __commonJS({
|
|
|
7174
7174
|
},
|
|
7175
7175
|
DecoratorBlock: function DecoratorBlock(decorator) {
|
|
7176
7176
|
var program = decorator.program && this.compileProgram(decorator.program);
|
|
7177
|
-
var params = this.setupFullMustacheParams(decorator, program, void 0),
|
|
7177
|
+
var params = this.setupFullMustacheParams(decorator, program, void 0), path7 = decorator.path;
|
|
7178
7178
|
this.useDecorators = true;
|
|
7179
|
-
this.opcode("registerDecorator", params.length,
|
|
7179
|
+
this.opcode("registerDecorator", params.length, path7.original);
|
|
7180
7180
|
},
|
|
7181
7181
|
PartialStatement: function PartialStatement(partial) {
|
|
7182
7182
|
this.usePartial = true;
|
|
@@ -7240,46 +7240,46 @@ var require_compiler = __commonJS({
|
|
|
7240
7240
|
}
|
|
7241
7241
|
},
|
|
7242
7242
|
ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
|
|
7243
|
-
var
|
|
7244
|
-
this.opcode("getContext",
|
|
7243
|
+
var path7 = sexpr.path, name = path7.parts[0], isBlock = program != null || inverse != null;
|
|
7244
|
+
this.opcode("getContext", path7.depth);
|
|
7245
7245
|
this.opcode("pushProgram", program);
|
|
7246
7246
|
this.opcode("pushProgram", inverse);
|
|
7247
|
-
|
|
7248
|
-
this.accept(
|
|
7247
|
+
path7.strict = true;
|
|
7248
|
+
this.accept(path7);
|
|
7249
7249
|
this.opcode("invokeAmbiguous", name, isBlock);
|
|
7250
7250
|
},
|
|
7251
7251
|
simpleSexpr: function simpleSexpr(sexpr) {
|
|
7252
|
-
var
|
|
7253
|
-
|
|
7254
|
-
this.accept(
|
|
7252
|
+
var path7 = sexpr.path;
|
|
7253
|
+
path7.strict = true;
|
|
7254
|
+
this.accept(path7);
|
|
7255
7255
|
this.opcode("resolvePossibleLambda");
|
|
7256
7256
|
},
|
|
7257
7257
|
helperSexpr: function helperSexpr(sexpr, program, inverse) {
|
|
7258
|
-
var params = this.setupFullMustacheParams(sexpr, program, inverse),
|
|
7258
|
+
var params = this.setupFullMustacheParams(sexpr, program, inverse), path7 = sexpr.path, name = path7.parts[0];
|
|
7259
7259
|
if (this.options.knownHelpers[name]) {
|
|
7260
7260
|
this.opcode("invokeKnownHelper", params.length, name);
|
|
7261
7261
|
} else if (this.options.knownHelpersOnly) {
|
|
7262
7262
|
throw new _exception2["default"]("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr);
|
|
7263
7263
|
} else {
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
this.accept(
|
|
7267
|
-
this.opcode("invokeHelper", params.length,
|
|
7264
|
+
path7.strict = true;
|
|
7265
|
+
path7.falsy = true;
|
|
7266
|
+
this.accept(path7);
|
|
7267
|
+
this.opcode("invokeHelper", params.length, path7.original, _ast2["default"].helpers.simpleId(path7));
|
|
7268
7268
|
}
|
|
7269
7269
|
},
|
|
7270
|
-
PathExpression: function PathExpression(
|
|
7271
|
-
this.addDepth(
|
|
7272
|
-
this.opcode("getContext",
|
|
7273
|
-
var name =
|
|
7270
|
+
PathExpression: function PathExpression(path7) {
|
|
7271
|
+
this.addDepth(path7.depth);
|
|
7272
|
+
this.opcode("getContext", path7.depth);
|
|
7273
|
+
var name = path7.parts[0], scoped = _ast2["default"].helpers.scopedId(path7), blockParamId = !path7.depth && !scoped && this.blockParamIndex(name);
|
|
7274
7274
|
if (blockParamId) {
|
|
7275
|
-
this.opcode("lookupBlockParam", blockParamId,
|
|
7275
|
+
this.opcode("lookupBlockParam", blockParamId, path7.parts);
|
|
7276
7276
|
} else if (!name) {
|
|
7277
7277
|
this.opcode("pushContext");
|
|
7278
|
-
} else if (
|
|
7278
|
+
} else if (path7.data) {
|
|
7279
7279
|
this.options.data = true;
|
|
7280
|
-
this.opcode("lookupData",
|
|
7280
|
+
this.opcode("lookupData", path7.depth, path7.parts, path7.strict);
|
|
7281
7281
|
} else {
|
|
7282
|
-
this.opcode("lookupOnContext",
|
|
7282
|
+
this.opcode("lookupOnContext", path7.parts, path7.falsy, path7.strict, scoped);
|
|
7283
7283
|
}
|
|
7284
7284
|
},
|
|
7285
7285
|
StringLiteral: function StringLiteral(string) {
|
|
@@ -7632,16 +7632,16 @@ var require_util = __commonJS({
|
|
|
7632
7632
|
}
|
|
7633
7633
|
exports2.urlGenerate = urlGenerate;
|
|
7634
7634
|
function normalize(aPath) {
|
|
7635
|
-
var
|
|
7635
|
+
var path7 = aPath;
|
|
7636
7636
|
var url = urlParse(aPath);
|
|
7637
7637
|
if (url) {
|
|
7638
7638
|
if (!url.path) {
|
|
7639
7639
|
return aPath;
|
|
7640
7640
|
}
|
|
7641
|
-
|
|
7641
|
+
path7 = url.path;
|
|
7642
7642
|
}
|
|
7643
|
-
var isAbsolute = exports2.isAbsolute(
|
|
7644
|
-
var parts =
|
|
7643
|
+
var isAbsolute = exports2.isAbsolute(path7);
|
|
7644
|
+
var parts = path7.split(/\/+/);
|
|
7645
7645
|
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
|
7646
7646
|
part = parts[i];
|
|
7647
7647
|
if (part === ".") {
|
|
@@ -7658,15 +7658,15 @@ var require_util = __commonJS({
|
|
|
7658
7658
|
}
|
|
7659
7659
|
}
|
|
7660
7660
|
}
|
|
7661
|
-
|
|
7662
|
-
if (
|
|
7663
|
-
|
|
7661
|
+
path7 = parts.join("/");
|
|
7662
|
+
if (path7 === "") {
|
|
7663
|
+
path7 = isAbsolute ? "/" : ".";
|
|
7664
7664
|
}
|
|
7665
7665
|
if (url) {
|
|
7666
|
-
url.path =
|
|
7666
|
+
url.path = path7;
|
|
7667
7667
|
return urlGenerate(url);
|
|
7668
7668
|
}
|
|
7669
|
-
return
|
|
7669
|
+
return path7;
|
|
7670
7670
|
}
|
|
7671
7671
|
exports2.normalize = normalize;
|
|
7672
7672
|
function join(aRoot, aPath) {
|
|
@@ -9264,7 +9264,7 @@ var require_code_gen = __commonJS({
|
|
|
9264
9264
|
}
|
|
9265
9265
|
};
|
|
9266
9266
|
SourceNode.prototype = {
|
|
9267
|
-
add: function
|
|
9267
|
+
add: function add2(chunks) {
|
|
9268
9268
|
if (_utils.isArray(chunks)) {
|
|
9269
9269
|
chunks = chunks.join("");
|
|
9270
9270
|
}
|
|
@@ -10455,8 +10455,8 @@ var require_printer = __commonJS({
|
|
|
10455
10455
|
return this.accept(sexpr.path) + " " + params + hash;
|
|
10456
10456
|
};
|
|
10457
10457
|
PrintVisitor.prototype.PathExpression = function(id) {
|
|
10458
|
-
var
|
|
10459
|
-
return (id.data ? "@" : "") + "PATH:" +
|
|
10458
|
+
var path7 = id.parts.join("/");
|
|
10459
|
+
return (id.data ? "@" : "") + "PATH:" + path7;
|
|
10460
10460
|
};
|
|
10461
10461
|
PrintVisitor.prototype.StringLiteral = function(string) {
|
|
10462
10462
|
return '"' + string.value + '"';
|
|
@@ -10496,8 +10496,8 @@ var require_lib2 = __commonJS({
|
|
|
10496
10496
|
handlebars.print = printer.print;
|
|
10497
10497
|
module2.exports = handlebars;
|
|
10498
10498
|
function extension(module3, filename) {
|
|
10499
|
-
var
|
|
10500
|
-
var templateString =
|
|
10499
|
+
var fs5 = require("fs");
|
|
10500
|
+
var templateString = fs5.readFileSync(filename, "utf8");
|
|
10501
10501
|
module3.exports = handlebars.compile(templateString);
|
|
10502
10502
|
}
|
|
10503
10503
|
if (typeof require !== "undefined" && require.extensions) {
|
|
@@ -11094,7 +11094,10 @@ var cac = (name = "") => new CAC(name);
|
|
|
11094
11094
|
var dist_default = cac;
|
|
11095
11095
|
|
|
11096
11096
|
// src/index.ts
|
|
11097
|
-
var
|
|
11097
|
+
var import_picocolors5 = __toESM(require_picocolors());
|
|
11098
|
+
var import_figlet = __toESM(require("figlet"));
|
|
11099
|
+
var import_gradient_string = __toESM(require("gradient-string"));
|
|
11100
|
+
var import_boxen = __toESM(require("boxen"));
|
|
11098
11101
|
|
|
11099
11102
|
// src/commands/build.ts
|
|
11100
11103
|
var import_fs_extra = __toESM(require_lib());
|
|
@@ -11234,19 +11237,72 @@ var import_picocolors2 = __toESM(require_picocolors());
|
|
|
11234
11237
|
var import_module = require("module");
|
|
11235
11238
|
var import_url = require("url");
|
|
11236
11239
|
var import_handlebars = __toESM(require_lib2());
|
|
11240
|
+
var import_prompts = __toESM(require("prompts"));
|
|
11237
11241
|
var import_meta = {};
|
|
11238
11242
|
var _require = typeof require !== "undefined" ? require : (0, import_module.createRequire)(import_meta.url);
|
|
11239
11243
|
var _filename = typeof __filename !== "undefined" ? __filename : (0, import_url.fileURLToPath)(import_meta.url);
|
|
11240
11244
|
var _dirname = typeof __dirname !== "undefined" ? __dirname : import_path2.default.dirname(_filename);
|
|
11241
11245
|
async function init(options) {
|
|
11242
|
-
|
|
11246
|
+
let { name, template = "default", pluginType = "business", theme = "standard" } = options;
|
|
11247
|
+
const response = await (0, import_prompts.default)([
|
|
11248
|
+
{
|
|
11249
|
+
type: name ? null : "text",
|
|
11250
|
+
name: "projectName",
|
|
11251
|
+
message: "\u8BF7\u8F93\u5165\u9879\u76EE\u540D\u79F0:",
|
|
11252
|
+
initial: "my-chatbi-plugin"
|
|
11253
|
+
},
|
|
11254
|
+
{
|
|
11255
|
+
type: "select",
|
|
11256
|
+
name: "template",
|
|
11257
|
+
message: "\u8BF7\u9009\u62E9\u9879\u76EE\u6A21\u677F:",
|
|
11258
|
+
choices: [
|
|
11259
|
+
{ title: "Standard (\u63A8\u8350)", value: "default", description: "\u5305\u542B\u5B8C\u6574\u8DEF\u7531\u548C\u63D2\u4EF6\u793A\u4F8B" },
|
|
11260
|
+
{ title: "Minimal (\u6781\u7B80)", value: "minimal", description: "\u4EC5\u5305\u542B\u6838\u5FC3\u7ED3\u6784" }
|
|
11261
|
+
],
|
|
11262
|
+
initial: 0
|
|
11263
|
+
},
|
|
11264
|
+
{
|
|
11265
|
+
type: "select",
|
|
11266
|
+
name: "pluginType",
|
|
11267
|
+
message: "\u8BF7\u9009\u62E9\u4E3B\u63D2\u4EF6\u7C7B\u578B:",
|
|
11268
|
+
choices: [
|
|
11269
|
+
{ title: "Business (\u4E1A\u52A1\u63D2\u4EF6)", value: "business", description: "\u4FA7\u91CD\u4E8E\u4E1A\u52A1\u903B\u8F91\u548C UI \u5C55\u793A" },
|
|
11270
|
+
{ title: "System (\u7CFB\u7EDF\u63D2\u4EF6)", value: "system", description: "\u4FA7\u91CD\u4E8E\u7CFB\u7EDF\u80FD\u529B\u548C\u5E95\u5C42\u6269\u5C55" }
|
|
11271
|
+
],
|
|
11272
|
+
initial: 0
|
|
11273
|
+
},
|
|
11274
|
+
{
|
|
11275
|
+
type: "select",
|
|
11276
|
+
name: "theme",
|
|
11277
|
+
message: "\u8BF7\u9009\u62E9\u9ED8\u8BA4\u4E3B\u9898\u98CE\u683C:",
|
|
11278
|
+
choices: [
|
|
11279
|
+
{ title: "Standard (\u7ECF\u5178\u84DD)", value: "standard" },
|
|
11280
|
+
{ title: "Nebula (\u661F\u4E91\u7D2B)", value: "nebula" },
|
|
11281
|
+
{ title: "Glass (\u6BDB\u73BB\u7483)", value: "glass" }
|
|
11282
|
+
],
|
|
11283
|
+
initial: 0
|
|
11284
|
+
}
|
|
11285
|
+
], {
|
|
11286
|
+
onCancel: () => {
|
|
11287
|
+
console.log(import_picocolors2.default.yellow("\n\u5DF2\u53D6\u6D88\u521D\u59CB\u5316"));
|
|
11288
|
+
process.exit(0);
|
|
11289
|
+
}
|
|
11290
|
+
});
|
|
11291
|
+
name = name || response.projectName;
|
|
11292
|
+
template = response.template || template;
|
|
11293
|
+
pluginType = response.pluginType || pluginType;
|
|
11294
|
+
theme = response.theme || theme;
|
|
11243
11295
|
const rootDir = process.cwd();
|
|
11244
11296
|
const targetDir = import_path2.default.resolve(rootDir, name);
|
|
11245
11297
|
if (import_fs_extra2.default.existsSync(targetDir)) {
|
|
11246
|
-
console.error(import_picocolors2.default.red(
|
|
11298
|
+
console.error(import_picocolors2.default.red(`
|
|
11299
|
+
\u9519\u8BEF: \u76EE\u5F55 ${name} \u5DF2\u5B58\u5728\u3002`));
|
|
11247
11300
|
return;
|
|
11248
11301
|
}
|
|
11249
|
-
console.log(import_picocolors2.default.cyan(
|
|
11302
|
+
console.log(import_picocolors2.default.cyan(`
|
|
11303
|
+
\u{1F680} \u6B63\u5728\u521D\u59CB\u5316\u9879\u76EE: ${import_picocolors2.default.bold(name)}...`));
|
|
11304
|
+
console.log(import_picocolors2.default.gray(` \u6A21\u677F: ${template} | \u7C7B\u578B: ${pluginType} | \u4E3B\u9898: ${theme}
|
|
11305
|
+
`));
|
|
11250
11306
|
try {
|
|
11251
11307
|
const findPackageRoot = (pkgName) => {
|
|
11252
11308
|
try {
|
|
@@ -11261,19 +11317,49 @@ async function init(options) {
|
|
|
11261
11317
|
};
|
|
11262
11318
|
const renderTemplate = async (templatePath, targetPath, data) => {
|
|
11263
11319
|
const content = await import_fs_extra2.default.readFile(templatePath, "utf-8");
|
|
11264
|
-
const
|
|
11265
|
-
const result =
|
|
11320
|
+
const templateFn = import_handlebars.default.compile(content);
|
|
11321
|
+
const result = templateFn(data);
|
|
11266
11322
|
await import_fs_extra2.default.outputFile(targetPath.replace(".hbs", ""), result);
|
|
11267
11323
|
};
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
|
|
11324
|
+
let myCliRoot = "";
|
|
11325
|
+
let checkDir = _dirname;
|
|
11326
|
+
while (checkDir !== import_path2.default.parse(checkDir).root) {
|
|
11327
|
+
if (import_fs_extra2.default.existsSync(import_path2.default.join(checkDir, "package.json"))) {
|
|
11328
|
+
const pkg = await import_fs_extra2.default.readJson(import_path2.default.join(checkDir, "package.json"));
|
|
11329
|
+
if (pkg.name === "@chatbi-v/cli") {
|
|
11330
|
+
myCliRoot = checkDir;
|
|
11331
|
+
break;
|
|
11332
|
+
}
|
|
11333
|
+
}
|
|
11334
|
+
checkDir = import_path2.default.dirname(checkDir);
|
|
11335
|
+
}
|
|
11336
|
+
if (!myCliRoot) {
|
|
11337
|
+
myCliRoot = findPackageRoot("@chatbi-v/cli");
|
|
11338
|
+
}
|
|
11339
|
+
const possibleTemplatesPaths = [
|
|
11340
|
+
import_path2.default.join(myCliRoot, "templates", template),
|
|
11341
|
+
import_path2.default.join(myCliRoot, "dist", template),
|
|
11342
|
+
import_path2.default.join(myCliRoot, template)
|
|
11343
|
+
];
|
|
11344
|
+
let activeTemplatesDir = "";
|
|
11345
|
+
for (const p of possibleTemplatesPaths) {
|
|
11346
|
+
if (import_fs_extra2.default.existsSync(p)) {
|
|
11347
|
+
activeTemplatesDir = p;
|
|
11348
|
+
break;
|
|
11349
|
+
}
|
|
11350
|
+
}
|
|
11351
|
+
if (!activeTemplatesDir) {
|
|
11352
|
+
console.warn(import_picocolors2.default.yellow(`\u8B66\u544A: \u6A21\u677F ${template} \u4E0D\u5B58\u5728\uFF0C\u964D\u7EA7\u5230 default \u6A21\u677F`));
|
|
11353
|
+
activeTemplatesDir = import_path2.default.join(myCliRoot, "templates", "default");
|
|
11354
|
+
if (!import_fs_extra2.default.existsSync(activeTemplatesDir)) {
|
|
11355
|
+
activeTemplatesDir = import_path2.default.join(myCliRoot, "dist", "default");
|
|
11356
|
+
}
|
|
11357
|
+
}
|
|
11272
11358
|
if (!import_fs_extra2.default.existsSync(activeTemplatesDir)) {
|
|
11273
|
-
throw new Error(`\u627E\u4E0D\u5230\u6A21\u677F\u76EE\u5F55
|
|
11359
|
+
throw new Error(`\u627E\u4E0D\u5230\u4EFB\u4F55\u6A21\u677F\u76EE\u5F55`);
|
|
11274
11360
|
}
|
|
11275
11361
|
await import_fs_extra2.default.ensureDir(targetDir);
|
|
11276
|
-
|
|
11362
|
+
process.stdout.write(import_picocolors2.default.blue("\u{1F4E6} \u51C6\u5907\u79BB\u7EBF SDK... "));
|
|
11277
11363
|
const corePath = findPackageRoot("@chatbi-v/core");
|
|
11278
11364
|
const coreDist = import_path2.default.join(corePath, "dist");
|
|
11279
11365
|
if (import_fs_extra2.default.existsSync(coreDist)) {
|
|
@@ -11297,7 +11383,17 @@ async function init(options) {
|
|
|
11297
11383
|
await import_fs_extra2.default.copy(pPkg, import_path2.default.join(targetDir, `.chatbi/plugins/${shortName}/package.json`));
|
|
11298
11384
|
}
|
|
11299
11385
|
}
|
|
11300
|
-
console.log(import_picocolors2.default.
|
|
11386
|
+
console.log(import_picocolors2.default.green("\u5B8C\u6210"));
|
|
11387
|
+
process.stdout.write(import_picocolors2.default.blue("\u{1F4C4} \u751F\u6210\u9879\u76EE\u6587\u4EF6... "));
|
|
11388
|
+
const templateData = {
|
|
11389
|
+
name,
|
|
11390
|
+
template,
|
|
11391
|
+
pluginType,
|
|
11392
|
+
theme,
|
|
11393
|
+
isNebula: theme === "nebula",
|
|
11394
|
+
isGlass: theme === "glass",
|
|
11395
|
+
isBusiness: pluginType === "business"
|
|
11396
|
+
};
|
|
11301
11397
|
const processTemplates = async (currentDir, currentTarget) => {
|
|
11302
11398
|
const files = await import_fs_extra2.default.readdir(currentDir);
|
|
11303
11399
|
for (const file of files) {
|
|
@@ -11308,14 +11404,15 @@ async function init(options) {
|
|
|
11308
11404
|
await import_fs_extra2.default.ensureDir(destPath);
|
|
11309
11405
|
await processTemplates(srcPath, destPath);
|
|
11310
11406
|
} else if (file.endsWith(".hbs")) {
|
|
11311
|
-
await renderTemplate(srcPath, destPath,
|
|
11407
|
+
await renderTemplate(srcPath, destPath, templateData);
|
|
11312
11408
|
} else {
|
|
11313
11409
|
await import_fs_extra2.default.copy(srcPath, destPath);
|
|
11314
11410
|
}
|
|
11315
11411
|
}
|
|
11316
11412
|
};
|
|
11317
11413
|
await processTemplates(activeTemplatesDir, targetDir);
|
|
11318
|
-
console.log(import_picocolors2.default.
|
|
11414
|
+
console.log(import_picocolors2.default.green("\u5B8C\u6210"));
|
|
11415
|
+
process.stdout.write(import_picocolors2.default.blue("\u{1F4DC} \u590D\u5236\u5F00\u53D1\u5DE5\u5177... "));
|
|
11319
11416
|
await import_fs_extra2.default.ensureDir(import_path2.default.join(targetDir, "scripts"));
|
|
11320
11417
|
let createPluginScript = null;
|
|
11321
11418
|
let currentSearchDir = _dirname;
|
|
@@ -11330,7 +11427,8 @@ async function init(options) {
|
|
|
11330
11427
|
if (createPluginScript) {
|
|
11331
11428
|
await import_fs_extra2.default.copy(createPluginScript, import_path2.default.join(targetDir, "scripts/create-plugin.js"));
|
|
11332
11429
|
}
|
|
11333
|
-
console.log(import_picocolors2.default.
|
|
11430
|
+
console.log(import_picocolors2.default.green("\u5B8C\u6210"));
|
|
11431
|
+
process.stdout.write(import_picocolors2.default.blue("\u{1F6E0}\uFE0F \u51C6\u5907\u79BB\u7EBF\u5DE5\u5177... "));
|
|
11334
11432
|
const cliSourceDir = findPackageRoot("@chatbi-v/cli");
|
|
11335
11433
|
const cliTargetDir = import_path2.default.join(targetDir, ".chatbi/cli");
|
|
11336
11434
|
await import_fs_extra2.default.ensureDir(import_path2.default.join(cliTargetDir, "dist"));
|
|
@@ -11342,39 +11440,396 @@ async function init(options) {
|
|
|
11342
11440
|
await import_fs_extra2.default.copy(import_path2.default.join(cliSourceDir, "bin"), import_path2.default.join(cliTargetDir, "bin"));
|
|
11343
11441
|
}
|
|
11344
11442
|
}
|
|
11443
|
+
console.log(import_picocolors2.default.green("\u5B8C\u6210"));
|
|
11345
11444
|
console.log(`
|
|
11346
|
-
\
|
|
11445
|
+
\u2728 \u9879\u76EE ${import_picocolors2.default.green(import_picocolors2.default.bold(name))} \u521D\u59CB\u5316\u6210\u529F!`);
|
|
11347
11446
|
console.log(import_picocolors2.default.cyan(`
|
|
11348
|
-
\
|
|
11349
|
-
console.log(import_picocolors2.default.white(`
|
|
11350
|
-
console.log(import_picocolors2.default.white(`
|
|
11351
|
-
console.log(import_picocolors2.default.white(`
|
|
11447
|
+
\u63A5\u4E0B\u6765\u4F60\u53EF\u4EE5\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u5F00\u59CB\u5F00\u53D1:`));
|
|
11448
|
+
console.log(import_picocolors2.default.white(` cd ${name}`));
|
|
11449
|
+
console.log(import_picocolors2.default.white(` pnpm install`));
|
|
11450
|
+
console.log(import_picocolors2.default.white(` pnpm dev`));
|
|
11451
|
+
console.log("");
|
|
11352
11452
|
} catch (error) {
|
|
11353
|
-
console.error(import_picocolors2.default.red("\u521D\u59CB\u5316\u9879\u76EE\u5931\u8D25:"), error);
|
|
11453
|
+
console.error(import_picocolors2.default.red("\n\u274C \u521D\u59CB\u5316\u9879\u76EE\u5931\u8D25:"), error);
|
|
11354
11454
|
throw error;
|
|
11355
11455
|
}
|
|
11356
11456
|
}
|
|
11357
11457
|
|
|
11458
|
+
// src/commands/add.ts
|
|
11459
|
+
var import_fs_extra3 = __toESM(require_lib());
|
|
11460
|
+
var import_path3 = __toESM(require("path"));
|
|
11461
|
+
var import_picocolors3 = __toESM(require_picocolors());
|
|
11462
|
+
var import_prompts2 = __toESM(require("prompts"));
|
|
11463
|
+
var import_handlebars2 = __toESM(require_lib2());
|
|
11464
|
+
var import_module2 = require("module");
|
|
11465
|
+
var import_url2 = require("url");
|
|
11466
|
+
var import_meta2 = {};
|
|
11467
|
+
var _require2 = typeof require !== "undefined" ? require : (0, import_module2.createRequire)(import_meta2.url);
|
|
11468
|
+
var _filename2 = typeof __filename !== "undefined" ? __filename : (0, import_url2.fileURLToPath)(import_meta2.url);
|
|
11469
|
+
var _dirname2 = typeof __dirname !== "undefined" ? __dirname : import_path3.default.dirname(_filename2);
|
|
11470
|
+
async function add(options) {
|
|
11471
|
+
let { name, type } = options;
|
|
11472
|
+
const cwd = process.cwd();
|
|
11473
|
+
const pkgPath = import_path3.default.join(cwd, "package.json");
|
|
11474
|
+
if (!import_fs_extra3.default.existsSync(pkgPath)) {
|
|
11475
|
+
console.error(import_picocolors3.default.red("\u274C \u9519\u8BEF: \u672A\u627E\u5230 package.json\u3002\u8BF7\u5728 ChatBI-V \u9879\u76EE\u6839\u76EE\u5F55\u4E0B\u8FD0\u884C\u6B64\u547D\u4EE4\u3002"));
|
|
11476
|
+
return;
|
|
11477
|
+
}
|
|
11478
|
+
const pkg = await import_fs_extra3.default.readJson(pkgPath);
|
|
11479
|
+
if (!pkg.workspaces || !pkg.workspaces.includes("plugins/*")) {
|
|
11480
|
+
console.error(import_picocolors3.default.red("\u274C \u9519\u8BEF: \u5F53\u524D\u76EE\u5F55\u4F3C\u4E4E\u4E0D\u662F\u6709\u6548\u7684 ChatBI-V \u9879\u76EE\u6839\u76EE\u5F55\u3002"));
|
|
11481
|
+
return;
|
|
11482
|
+
}
|
|
11483
|
+
const response = await (0, import_prompts2.default)([
|
|
11484
|
+
{
|
|
11485
|
+
type: name ? null : "text",
|
|
11486
|
+
name: "pluginName",
|
|
11487
|
+
message: "\u8BF7\u8F93\u5165\u63D2\u4EF6\u540D\u79F0 (\u82F1\u6587/\u4E2D\u5212\u7EBF):",
|
|
11488
|
+
initial: "my-custom-plugin",
|
|
11489
|
+
validate: (value) => /^[a-z0-9-]+$/.test(value) || "\u540D\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E2D\u5212\u7EBF"
|
|
11490
|
+
},
|
|
11491
|
+
{
|
|
11492
|
+
type: type ? null : "select",
|
|
11493
|
+
name: "pluginType",
|
|
11494
|
+
message: "\u8BF7\u9009\u62E9\u63D2\u4EF6\u7C7B\u578B:",
|
|
11495
|
+
choices: [
|
|
11496
|
+
{ title: "Business (\u4E1A\u52A1\u63D2\u4EF6)", value: "business", description: "\u5305\u542B UI \u754C\u9762\u548C\u4E1A\u52A1\u903B\u8F91" },
|
|
11497
|
+
{ title: "System (\u7CFB\u7EDF\u63D2\u4EF6)", value: "system", description: "\u4FA7\u91CD\u4E8E\u5E95\u5C42\u80FD\u529B\u548C\u7CFB\u7EDF\u6269\u5C55" }
|
|
11498
|
+
],
|
|
11499
|
+
initial: 0
|
|
11500
|
+
}
|
|
11501
|
+
], {
|
|
11502
|
+
onCancel: () => {
|
|
11503
|
+
console.log(import_picocolors3.default.yellow("\n\u5DF2\u53D6\u6D88\u6DFB\u52A0\u63D2\u4EF6"));
|
|
11504
|
+
process.exit(0);
|
|
11505
|
+
}
|
|
11506
|
+
});
|
|
11507
|
+
name = name || response.pluginName;
|
|
11508
|
+
type = type || response.pluginType;
|
|
11509
|
+
const pluginDir = import_path3.default.resolve(cwd, "plugins", name);
|
|
11510
|
+
if (import_fs_extra3.default.existsSync(pluginDir)) {
|
|
11511
|
+
console.error(import_picocolors3.default.red(`\u274C \u9519\u8BEF: \u63D2\u4EF6\u76EE\u5F55 ${name} \u5DF2\u5B58\u5728\u3002`));
|
|
11512
|
+
return;
|
|
11513
|
+
}
|
|
11514
|
+
console.log(import_picocolors3.default.cyan(`
|
|
11515
|
+
\u{1F680} \u6B63\u5728\u6DFB\u52A0\u65B0\u63D2\u4EF6: ${import_picocolors3.default.bold(name)}...`));
|
|
11516
|
+
console.log(import_picocolors3.default.gray(` \u7C7B\u578B: ${type}
|
|
11517
|
+
`));
|
|
11518
|
+
try {
|
|
11519
|
+
let myCliRoot = "";
|
|
11520
|
+
let checkDir = _dirname2;
|
|
11521
|
+
while (checkDir !== import_path3.default.parse(checkDir).root) {
|
|
11522
|
+
if (import_fs_extra3.default.existsSync(import_path3.default.join(checkDir, "package.json"))) {
|
|
11523
|
+
const p = await import_fs_extra3.default.readJson(import_path3.default.join(checkDir, "package.json"));
|
|
11524
|
+
if (p.name === "@chatbi-v/cli") {
|
|
11525
|
+
myCliRoot = checkDir;
|
|
11526
|
+
break;
|
|
11527
|
+
}
|
|
11528
|
+
}
|
|
11529
|
+
checkDir = import_path3.default.dirname(checkDir);
|
|
11530
|
+
}
|
|
11531
|
+
const templateDir = import_path3.default.join(myCliRoot, "templates/default/plugins/demo-plugin");
|
|
11532
|
+
const targetDir = pluginDir;
|
|
11533
|
+
const data = {
|
|
11534
|
+
name: `@chatbi-v/plugin-${name}`,
|
|
11535
|
+
pluginId: name,
|
|
11536
|
+
pluginType: type,
|
|
11537
|
+
className: name.split("-").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(""),
|
|
11538
|
+
isBusiness: type === "business"
|
|
11539
|
+
};
|
|
11540
|
+
const renderFile = async (src, dest) => {
|
|
11541
|
+
const content = await import_fs_extra3.default.readFile(src, "utf-8");
|
|
11542
|
+
const templateFn = import_handlebars2.default.compile(content);
|
|
11543
|
+
const result = templateFn(data);
|
|
11544
|
+
await import_fs_extra3.default.outputFile(dest.replace(".hbs", ""), result);
|
|
11545
|
+
};
|
|
11546
|
+
const processTemplates = async (currentSrc, currentDest) => {
|
|
11547
|
+
const files = await import_fs_extra3.default.readdir(currentSrc);
|
|
11548
|
+
for (const file of files) {
|
|
11549
|
+
const srcPath = import_path3.default.join(currentSrc, file);
|
|
11550
|
+
const destPath = import_path3.default.join(currentDest, file);
|
|
11551
|
+
const stats = await import_fs_extra3.default.stat(srcPath);
|
|
11552
|
+
if (stats.isDirectory()) {
|
|
11553
|
+
await import_fs_extra3.default.ensureDir(destPath);
|
|
11554
|
+
await processTemplates(srcPath, destPath);
|
|
11555
|
+
} else if (file.endsWith(".hbs")) {
|
|
11556
|
+
await renderFile(srcPath, destPath);
|
|
11557
|
+
} else {
|
|
11558
|
+
await import_fs_extra3.default.copy(srcPath, destPath);
|
|
11559
|
+
}
|
|
11560
|
+
}
|
|
11561
|
+
};
|
|
11562
|
+
await processTemplates(templateDir, targetDir);
|
|
11563
|
+
console.log(import_picocolors3.default.green(`
|
|
11564
|
+
\u2728 \u63D2\u4EF6 ${import_picocolors3.default.bold(name)} \u5DF2\u6210\u529F\u521B\u5EFA!`));
|
|
11565
|
+
console.log(import_picocolors3.default.cyan(`
|
|
11566
|
+
\u63A5\u4E0B\u6765\u4F60\u53EF\u4EE5:`));
|
|
11567
|
+
console.log(import_picocolors3.default.white(` 1. \u5728 plugins/${name}/src/index.tsx \u4E2D\u7F16\u5199\u903B\u8F91`));
|
|
11568
|
+
console.log(import_picocolors3.default.white(` 2. \u8FD0\u884C pnpm install \u5B89\u88C5\u4F9D\u8D56`));
|
|
11569
|
+
console.log(import_picocolors3.default.white(` 3. \u8FD0\u884C pnpm dev \u542F\u52A8\u9879\u76EE`));
|
|
11570
|
+
console.log("");
|
|
11571
|
+
} catch (error) {
|
|
11572
|
+
console.error(import_picocolors3.default.red("\n\u274C \u521B\u5EFA\u63D2\u4EF6\u5931\u8D25:"), error);
|
|
11573
|
+
}
|
|
11574
|
+
}
|
|
11575
|
+
|
|
11576
|
+
// src/commands/gl.ts
|
|
11577
|
+
var import_fs_extra4 = __toESM(require_lib());
|
|
11578
|
+
var import_path4 = __toESM(require("path"));
|
|
11579
|
+
var import_picocolors4 = __toESM(require_picocolors());
|
|
11580
|
+
var import_prompts3 = __toESM(require("prompts"));
|
|
11581
|
+
init_execa();
|
|
11582
|
+
async function gl(options) {
|
|
11583
|
+
const { type: initialType, prompt: initialPrompt } = options;
|
|
11584
|
+
const cwd = process.cwd();
|
|
11585
|
+
const pkgPath = import_path4.default.join(cwd, "package.json");
|
|
11586
|
+
if (!import_fs_extra4.default.existsSync(pkgPath)) {
|
|
11587
|
+
console.error(import_picocolors4.default.red("\u274C \u9519\u8BEF: \u672A\u627E\u5230 package.json\u3002\u8BF7\u5728 ChatBI-V \u9879\u76EE\u6839\u76EE\u5F55\u4E0B\u8FD0\u884C\u6B64\u547D\u4EE4\u3002"));
|
|
11588
|
+
return;
|
|
11589
|
+
}
|
|
11590
|
+
const response = await (0, import_prompts3.default)([
|
|
11591
|
+
{
|
|
11592
|
+
type: initialType ? null : "select",
|
|
11593
|
+
name: "genType",
|
|
11594
|
+
message: "\u8BF7\u9009\u62E9 AI \u811A\u624B\u67B6\u6307\u4EE4:",
|
|
11595
|
+
choices: [
|
|
11596
|
+
{ title: "\u{1F916} smart", value: "smart", description: "\u667A\u80FD\u51B3\u7B56 (\u6839\u636E\u9700\u6C42\u81EA\u52A8\u9009\u62E9\u5DE5\u5177)" },
|
|
11597
|
+
{ title: "\u{1F50C} plugin", value: "plugin", description: "\u751F\u6210\u65B0\u63D2\u4EF6" },
|
|
11598
|
+
{ title: "\u{1F9E9} component", value: "component", description: "\u751F\u6210\u4E1A\u52A1\u7EC4\u4EF6" },
|
|
11599
|
+
{ title: "\u{1F4E1} api", value: "api", description: "\u751F\u6210 API \u5B9A\u4E49\u4E0E\u8BF7\u6C42\u51FD\u6570" },
|
|
11600
|
+
{ title: "\u{1F3AD} mock", value: "mock", description: "\u751F\u6210 Mock \u6D4B\u8BD5\u6570\u636E" },
|
|
11601
|
+
{ title: "\u{1F6E0}\uFE0F util", value: "util", description: "\u751F\u6210\u5DE5\u5177\u51FD\u6570" },
|
|
11602
|
+
{ title: "\u{1F4C4} doc", value: "doc", description: "\u751F\u6210\u9879\u76EE\u6587\u6863" },
|
|
11603
|
+
{ title: "\u2728 chat", value: "chat", description: "\u81EA\u7531\u5BF9\u8BDD" }
|
|
11604
|
+
],
|
|
11605
|
+
initial: 0
|
|
11606
|
+
},
|
|
11607
|
+
{
|
|
11608
|
+
type: (prev, values) => initialPrompt || values.genType === "chat" ? null : "text",
|
|
11609
|
+
name: "userPrompt",
|
|
11610
|
+
message: "\u8BF7\u8F93\u5165\u8BE6\u7EC6\u9700\u6C42\u63CF\u8FF0:",
|
|
11611
|
+
initial: initialPrompt || ""
|
|
11612
|
+
}
|
|
11613
|
+
], {
|
|
11614
|
+
onCancel: () => {
|
|
11615
|
+
console.log(import_picocolors4.default.yellow("\n\u5DF2\u53D6\u6D88 AI \u751F\u6210"));
|
|
11616
|
+
process.exit(0);
|
|
11617
|
+
}
|
|
11618
|
+
});
|
|
11619
|
+
const genType = initialType || response.genType;
|
|
11620
|
+
const userPrompt = initialPrompt || response.userPrompt;
|
|
11621
|
+
if (!userPrompt && genType !== "chat") {
|
|
11622
|
+
console.error(import_picocolors4.default.red("\u274C \u9519\u8BEF: \u9700\u6C42\u63CF\u8FF0\u4E0D\u80FD\u4E3A\u7A7A\u3002"));
|
|
11623
|
+
return;
|
|
11624
|
+
}
|
|
11625
|
+
console.log(import_picocolors4.default.cyan(`
|
|
11626
|
+
\u{1F916} \u6B63\u5728\u547C\u53EB AI \u5F15\u64CE [\u6A21\u5F0F: ${import_picocolors4.default.bold(genType)}]...`));
|
|
11627
|
+
const toolsContext = `
|
|
11628
|
+
[Available Tools & Capabilities]
|
|
11629
|
+
- Tool: plugin -> For creating new feature modules. Requires: name, type (business|system).
|
|
11630
|
+
- Tool: component -> For UI elements. Tech: AntD5, Tailwind.
|
|
11631
|
+
- Tool: api -> For network requests. Structure: src/api/[name].ts, uses shared request util, defines TS interfaces.
|
|
11632
|
+
- Tool: mock -> For dev data. Structure: mock/[name].ts, follows Mock.js or MSW format.
|
|
11633
|
+
- Tool: util -> For pure functions. Structure: src/utils/[name].ts, requires unit tests.
|
|
11634
|
+
- Tool: doc -> For documentation. Format: Markdown, structure: docs/[type]/[name].md.
|
|
11635
|
+
|
|
11636
|
+
[Tool Functions Implementation Details]
|
|
11637
|
+
- API Function: Should include request method, URL, params/data types, and response type. Use '@chatbi-v/core/request'.
|
|
11638
|
+
- Mock Function: Should provide realistic data based on API definition.
|
|
11639
|
+
- Plugin Function: Should follow the Micro-Kernel architecture, registering to 'pluginManager'.
|
|
11640
|
+
|
|
11641
|
+
[Requirement Slots / Missing Info]
|
|
11642
|
+
If the user's request is ambiguous or missing key information (e.g., missing plugin name, missing API endpoint),
|
|
11643
|
+
you MUST output a specific format: "SLOT_REQUIRED: [Field Name] | [Question to User]".
|
|
11644
|
+
Example: "SLOT_REQUIRED: pluginName | Please provide a name for the plugin (lowercase-kebab-case)."
|
|
11645
|
+
`.trim();
|
|
11646
|
+
const templatesContext = `
|
|
11647
|
+
[Project Templates Structure]
|
|
11648
|
+
- Plugin: class extends Plugin, metadata: { id, name, version, type, routes, extensions }.
|
|
11649
|
+
- API: export const fetchData = (params: T) => request.get<R>('/url', { params }).
|
|
11650
|
+
- Mock: export default { 'GET /api/test': { code: 200, data: {} } }.
|
|
11651
|
+
- UI: React 18, Ant Design 5, Tailwind CSS 3.
|
|
11652
|
+
`.trim();
|
|
11653
|
+
const systemContext = `[Context: ChatBI-V System | Dir: ${cwd} | Tech: React18, AntD5, Tailwind, Micro-Kernel]
|
|
11654
|
+
${toolsContext}
|
|
11655
|
+
${templatesContext}
|
|
11656
|
+
|
|
11657
|
+
[Decision Logic]
|
|
11658
|
+
If genType is 'smart', you must first decide which of the [Available Tools] is most appropriate.
|
|
11659
|
+
If the requirement is clear, proceed with generation.
|
|
11660
|
+
If not, use the SLOT_REQUIRED format.`.trim();
|
|
11661
|
+
const finalPrompt = userPrompt ? `${systemContext}
|
|
11662
|
+
|
|
11663
|
+
[User Request]: ${userPrompt}` : systemContext;
|
|
11664
|
+
try {
|
|
11665
|
+
const geminiCmd = genType === "smart" ? "chat" : genType;
|
|
11666
|
+
console.log(import_picocolors4.default.gray(" AI \u5F15\u64CE\u601D\u8003\u4E2D...\n"));
|
|
11667
|
+
let currentPrompt = finalPrompt;
|
|
11668
|
+
let retry = true;
|
|
11669
|
+
while (retry) {
|
|
11670
|
+
const { stdout } = await execa("gemini", [geminiCmd, currentPrompt], {
|
|
11671
|
+
stdio: "pipe"
|
|
11672
|
+
// 先捕获输出以解析 SLOT_REQUIRED
|
|
11673
|
+
});
|
|
11674
|
+
if (stdout.includes("SLOT_REQUIRED:")) {
|
|
11675
|
+
const slots = [];
|
|
11676
|
+
const lines = stdout.split("\n");
|
|
11677
|
+
for (const line of lines) {
|
|
11678
|
+
if (line.includes("SLOT_REQUIRED:")) {
|
|
11679
|
+
const match = line.match(/SLOT_REQUIRED:\s*([^|]+)\|\s*(.+)/);
|
|
11680
|
+
if (match) {
|
|
11681
|
+
slots.push({
|
|
11682
|
+
type: "text",
|
|
11683
|
+
name: match[1].trim(),
|
|
11684
|
+
message: match[2].trim()
|
|
11685
|
+
});
|
|
11686
|
+
}
|
|
11687
|
+
}
|
|
11688
|
+
}
|
|
11689
|
+
if (slots.length > 0) {
|
|
11690
|
+
console.log(import_picocolors4.default.yellow("\n\u{1F4DD} AI \u9700\u8981\u66F4\u591A\u4FE1\u606F\u4EE5\u7EE7\u7EED:"));
|
|
11691
|
+
const answers = await (0, import_prompts3.default)(slots, {
|
|
11692
|
+
onCancel: () => process.exit(0)
|
|
11693
|
+
});
|
|
11694
|
+
const answerContext = Object.entries(answers).map(([k, v]) => `[${k}]: ${v}`).join("\n");
|
|
11695
|
+
currentPrompt += `
|
|
11696
|
+
|
|
11697
|
+
[User Answers]:
|
|
11698
|
+
${answerContext}
|
|
11699
|
+
|
|
11700
|
+
Please proceed with generation based on these answers.`;
|
|
11701
|
+
console.log(import_picocolors4.default.cyan("\n\u{1F504} \u6B63\u5728\u91CD\u65B0\u63D0\u4EA4\u9700\u6C42..."));
|
|
11702
|
+
continue;
|
|
11703
|
+
}
|
|
11704
|
+
}
|
|
11705
|
+
console.log(stdout);
|
|
11706
|
+
retry = false;
|
|
11707
|
+
}
|
|
11708
|
+
console.log(import_picocolors4.default.green(`
|
|
11709
|
+
\u2705 AI \u547D\u4EE4 [gemini ${geminiCmd}] \u6267\u884C\u5B8C\u6BD5!`));
|
|
11710
|
+
} catch (error) {
|
|
11711
|
+
if (error.code === "ENOENT") {
|
|
11712
|
+
console.error(import_picocolors4.default.red("\n\u274C \u9519\u8BEF: \u672A\u5728\u7CFB\u7EDF\u4E2D\u627E\u5230 `gemini-cli` \u547D\u4EE4\u3002"));
|
|
11713
|
+
console.log(import_picocolors4.default.yellow("\u8BF7\u786E\u4FDD\u5DF2\u5B89\u88C5 gemini-cli \u5E76\u5C06\u5176\u6DFB\u52A0\u5230\u7CFB\u7EDF PATH \u4E2D\u3002"));
|
|
11714
|
+
} else {
|
|
11715
|
+
console.error(import_picocolors4.default.red("\n\u274C AI \u751F\u6210\u8FC7\u7A0B\u4E2D\u51FA\u9519:"), error.message);
|
|
11716
|
+
}
|
|
11717
|
+
}
|
|
11718
|
+
}
|
|
11719
|
+
|
|
11720
|
+
// package.json
|
|
11721
|
+
var package_default = {
|
|
11722
|
+
name: "@chatbi-v/cli",
|
|
11723
|
+
version: "1.0.7",
|
|
11724
|
+
description: "Standardized CLI tooling for ChatBI Monorepo",
|
|
11725
|
+
main: "dist/index.js",
|
|
11726
|
+
bin: {
|
|
11727
|
+
"chatbi-cli": "./bin/chatbi-cli.js"
|
|
11728
|
+
},
|
|
11729
|
+
files: [
|
|
11730
|
+
"dist",
|
|
11731
|
+
"bin"
|
|
11732
|
+
],
|
|
11733
|
+
publishConfig: {
|
|
11734
|
+
access: "public"
|
|
11735
|
+
},
|
|
11736
|
+
scripts: {
|
|
11737
|
+
build: "tsup",
|
|
11738
|
+
dev: "tsup --watch",
|
|
11739
|
+
test: "vitest"
|
|
11740
|
+
},
|
|
11741
|
+
dependencies: {
|
|
11742
|
+
"@chatbi-v/core": "workspace:*",
|
|
11743
|
+
"@chatbi-v/plugin-system-monitor": "workspace:*",
|
|
11744
|
+
"@chatbi-v/plugin-system-user": "workspace:*",
|
|
11745
|
+
"@chatbi-v/plugin-theme-manager": "workspace:*",
|
|
11746
|
+
boxen: "^8.0.1",
|
|
11747
|
+
cac: "^6.7.14",
|
|
11748
|
+
execa: "^8.0.1",
|
|
11749
|
+
figlet: "^1.9.4",
|
|
11750
|
+
"fs-extra": "^11.2.0",
|
|
11751
|
+
"gradient-string": "^3.0.0",
|
|
11752
|
+
handlebars: "^4.7.8",
|
|
11753
|
+
picocolors: "^1.0.0",
|
|
11754
|
+
prompts: "^2.4.2",
|
|
11755
|
+
tsup: "^8.5.1",
|
|
11756
|
+
typescript: "^5.0.0"
|
|
11757
|
+
},
|
|
11758
|
+
devDependencies: {
|
|
11759
|
+
"@chatbi-v/tsconfig": "workspace:*",
|
|
11760
|
+
"@types/boxen": "^3.0.5",
|
|
11761
|
+
"@types/figlet": "^1.7.0",
|
|
11762
|
+
"@types/fs-extra": "^11.0.0",
|
|
11763
|
+
"@types/gradient-string": "^1.1.6",
|
|
11764
|
+
"@types/node": "^20.0.0",
|
|
11765
|
+
"@types/prompts": "^2.4.9",
|
|
11766
|
+
tsup: "^8.5.1",
|
|
11767
|
+
vitest: "^1.0.0"
|
|
11768
|
+
}
|
|
11769
|
+
};
|
|
11770
|
+
|
|
11358
11771
|
// src/index.ts
|
|
11359
11772
|
var cli = dist_default("chatbi-cli");
|
|
11360
|
-
|
|
11773
|
+
var showHeader = () => {
|
|
11774
|
+
const title = import_figlet.default.textSync("ChatBI-V CLI", { font: "Standard" });
|
|
11775
|
+
console.log(import_gradient_string.default.pastel.multiline(title));
|
|
11776
|
+
console.log(
|
|
11777
|
+
(0, import_boxen.default)(import_picocolors5.default.cyan(`ChatBI-V \u7EDF\u4E00\u5F00\u53D1\u5DE5\u5177 v${package_default.version}`), {
|
|
11778
|
+
padding: 0,
|
|
11779
|
+
margin: { top: 1, bottom: 1 },
|
|
11780
|
+
borderStyle: "round",
|
|
11781
|
+
borderColor: "cyan"
|
|
11782
|
+
})
|
|
11783
|
+
);
|
|
11784
|
+
};
|
|
11785
|
+
cli.command("build", "\u6784\u5EFA\u5F53\u524D\u9879\u76EE").option("--watch", "\u5F00\u542F\u76D1\u542C\u6A21\u5F0F").action(async (options) => {
|
|
11786
|
+
showHeader();
|
|
11361
11787
|
try {
|
|
11362
11788
|
await build(options);
|
|
11363
11789
|
} catch (e) {
|
|
11364
|
-
console.error(
|
|
11790
|
+
console.error(import_picocolors5.default.red("\u274C \u6784\u5EFA\u5931\u8D25"));
|
|
11365
11791
|
console.error(e);
|
|
11366
11792
|
process.exit(1);
|
|
11367
11793
|
}
|
|
11368
11794
|
});
|
|
11369
|
-
cli.command("init
|
|
11795
|
+
cli.command("init [name]", "\u521D\u59CB\u5316\u4E00\u4E2A\u65B0\u7684\u4E1A\u52A1\u63D2\u4EF6\u9879\u76EE").action(async (name) => {
|
|
11796
|
+
showHeader();
|
|
11370
11797
|
try {
|
|
11371
11798
|
await init({ name });
|
|
11372
11799
|
} catch (e) {
|
|
11373
|
-
console.error(
|
|
11800
|
+
console.error(import_picocolors5.default.red("\u274C \u521D\u59CB\u5316\u5931\u8D25"));
|
|
11374
11801
|
console.error(e);
|
|
11375
11802
|
process.exit(1);
|
|
11376
11803
|
}
|
|
11377
11804
|
});
|
|
11378
|
-
cli.
|
|
11379
|
-
|
|
11380
|
-
|
|
11805
|
+
cli.command("add [name]", "\u5728\u5F53\u524D\u9879\u76EE\u4E2D\u6DFB\u52A0\u4E00\u4E2A\u65B0\u63D2\u4EF6").option("-t, --type <type>", "\u63D2\u4EF6\u7C7B\u578B (business | system)").action(async (name, options) => {
|
|
11806
|
+
showHeader();
|
|
11807
|
+
try {
|
|
11808
|
+
await add({ name, type: options.type });
|
|
11809
|
+
} catch (e) {
|
|
11810
|
+
console.error(import_picocolors5.default.red("\u274C \u6DFB\u52A0\u63D2\u4EF6\u5931\u8D25"));
|
|
11811
|
+
console.error(e);
|
|
11812
|
+
process.exit(1);
|
|
11813
|
+
}
|
|
11814
|
+
});
|
|
11815
|
+
cli.command("gl", "\u4F7F\u7528 AI \u811A\u624B\u67B6\u751F\u6210\u4EE3\u7801\u6216\u6587\u6863").option("-t, --type <type>", "\u751F\u6210\u7C7B\u578B (plugin|util|doc|component)").option("-p, --prompt <prompt>", "AI \u9700\u6C42\u63CF\u8FF0").action(async (options) => {
|
|
11816
|
+
showHeader();
|
|
11817
|
+
try {
|
|
11818
|
+
await gl(options);
|
|
11819
|
+
} catch (e) {
|
|
11820
|
+
console.error(import_picocolors5.default.red("\u274C AI \u751F\u6210\u5931\u8D25"));
|
|
11821
|
+
console.error(e);
|
|
11822
|
+
process.exit(1);
|
|
11823
|
+
}
|
|
11824
|
+
});
|
|
11825
|
+
cli.help((sections) => {
|
|
11826
|
+
showHeader();
|
|
11827
|
+
sections[0].body = import_picocolors5.default.white("ChatBI-V \u5F00\u53D1\u8005\u547D\u4EE4\u884C\u5DE5\u5177\uFF0C\u52A9\u529B\u5FEB\u901F\u5F00\u53D1\u548C\u6784\u5EFA\u63D2\u4EF6\u3002");
|
|
11828
|
+
});
|
|
11829
|
+
cli.version(package_default.version);
|
|
11830
|
+
if (process.argv.length <= 2) {
|
|
11831
|
+
showHeader();
|
|
11832
|
+
cli.outputHelp();
|
|
11833
|
+
} else {
|
|
11834
|
+
cli.parse();
|
|
11835
|
+
}
|