drizzle-kit 0.16.9-7942574 → 0.16.9-97db3d7
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/index.js +2533 -76
- package/package.json +6 -2
- package/utils.js +12961 -0
package/index.js
CHANGED
|
@@ -5947,7 +5947,7 @@ var require_hanji = __commonJS({
|
|
|
5947
5947
|
}
|
|
5948
5948
|
};
|
|
5949
5949
|
exports.TaskTerminal = TaskTerminal;
|
|
5950
|
-
function
|
|
5950
|
+
function render5(view) {
|
|
5951
5951
|
const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
|
|
5952
5952
|
if (view instanceof Prompt2) {
|
|
5953
5953
|
const terminal = new Terminal(view, stdin, stdout, closable);
|
|
@@ -5959,7 +5959,7 @@ var require_hanji = __commonJS({
|
|
|
5959
5959
|
closable.close();
|
|
5960
5960
|
return;
|
|
5961
5961
|
}
|
|
5962
|
-
exports.render =
|
|
5962
|
+
exports.render = render5;
|
|
5963
5963
|
function renderWithTask3(view, task) {
|
|
5964
5964
|
return __awaiter(this, void 0, void 0, function* () {
|
|
5965
5965
|
const terminal = new TaskTerminal(view, process.stdout);
|
|
@@ -5979,7 +5979,7 @@ var require_hanji = __commonJS({
|
|
|
5979
5979
|
});
|
|
5980
5980
|
|
|
5981
5981
|
// src/cli/views.ts
|
|
5982
|
-
var import_hanji, err, info, error, schema, isRenamePromptItem, ResolveColumnSelect, ResolveTableSelect, ResolveSchemasSelect, Spinner, IntrospectProgress;
|
|
5982
|
+
var import_hanji, err, info, error, schema, isRenamePromptItem, ResolveColumnSelect, ResolveTableSelect, ResolveSchemasSelect, Spinner, IntrospectProgress, DropMigrationView, trimmedRange;
|
|
5983
5983
|
var init_views = __esm({
|
|
5984
5984
|
"src/cli/views.ts"() {
|
|
5985
5985
|
init_source();
|
|
@@ -6242,6 +6242,60 @@ Is ${source_default.bold.blue(
|
|
|
6242
6242
|
return info2;
|
|
6243
6243
|
}
|
|
6244
6244
|
};
|
|
6245
|
+
DropMigrationView = class extends import_hanji.Prompt {
|
|
6246
|
+
constructor(data) {
|
|
6247
|
+
super();
|
|
6248
|
+
this.on("attach", (terminal) => terminal.toggleCursor("hide"));
|
|
6249
|
+
this.data = new import_hanji.SelectState(data);
|
|
6250
|
+
this.data.selectedIdx = data.length - 1;
|
|
6251
|
+
this.data.bind(this);
|
|
6252
|
+
}
|
|
6253
|
+
render(status) {
|
|
6254
|
+
if (status === "submitted" || status === "aborted") {
|
|
6255
|
+
return "\n";
|
|
6256
|
+
}
|
|
6257
|
+
let text = source_default.bold("Please select migration to drop:\n");
|
|
6258
|
+
const selectedPrefix = source_default.yellow("\u276F ");
|
|
6259
|
+
const data = trimmedRange(this.data.items, this.data.selectedIdx, 9);
|
|
6260
|
+
const labelLength = data.trimmed.map((it) => it.tag.length).reduce((a, b) => {
|
|
6261
|
+
if (a > b) {
|
|
6262
|
+
return a;
|
|
6263
|
+
}
|
|
6264
|
+
return b;
|
|
6265
|
+
}, 0);
|
|
6266
|
+
text += data.startTrimmed ? " ...\n" : "";
|
|
6267
|
+
data.trimmed.forEach((it, idx) => {
|
|
6268
|
+
const isSelected = idx === this.data.selectedIdx - data.offset;
|
|
6269
|
+
let title = it.tag.padEnd(labelLength, " ");
|
|
6270
|
+
title = isSelected ? source_default.yellow(title) : title;
|
|
6271
|
+
text += isSelected ? `${selectedPrefix}${title}` : ` ${title}`;
|
|
6272
|
+
text += idx != this.data.items.length - 1 ? "\n" : "";
|
|
6273
|
+
});
|
|
6274
|
+
text += data.endTrimmed ? " ...\n" : "";
|
|
6275
|
+
return text;
|
|
6276
|
+
}
|
|
6277
|
+
result() {
|
|
6278
|
+
return this.data.items[this.data.selectedIdx];
|
|
6279
|
+
}
|
|
6280
|
+
};
|
|
6281
|
+
trimmedRange = (arr, index4, limitLines) => {
|
|
6282
|
+
const limit = limitLines - 2;
|
|
6283
|
+
const sideLimit = Math.round(limit / 2);
|
|
6284
|
+
const endTrimmed = arr.length - sideLimit > index4;
|
|
6285
|
+
const startTrimmed = index4 > sideLimit - 1;
|
|
6286
|
+
const paddingStart = Math.max(index4 + sideLimit - arr.length, 0);
|
|
6287
|
+
const paddingEnd = Math.min(index4 - sideLimit + 1, 0);
|
|
6288
|
+
const d1 = endTrimmed ? 1 : 0;
|
|
6289
|
+
const d2 = startTrimmed ? 0 : 1;
|
|
6290
|
+
const start = Math.max(0, index4 - sideLimit + d1 - paddingStart);
|
|
6291
|
+
const end = Math.min(arr.length, index4 + sideLimit + d2 - paddingEnd);
|
|
6292
|
+
return {
|
|
6293
|
+
trimmed: arr.slice(start, end),
|
|
6294
|
+
offset: start,
|
|
6295
|
+
startTrimmed,
|
|
6296
|
+
endTrimmed
|
|
6297
|
+
};
|
|
6298
|
+
};
|
|
6245
6299
|
}
|
|
6246
6300
|
});
|
|
6247
6301
|
|
|
@@ -11495,7 +11549,7 @@ var require_bare = __commonJS({
|
|
|
11495
11549
|
var sgr = require_sgr();
|
|
11496
11550
|
var supportsColor2 = require_supports_color();
|
|
11497
11551
|
var mods = sgr.mods;
|
|
11498
|
-
var
|
|
11552
|
+
var join5 = Array.prototype.join;
|
|
11499
11553
|
var defineProperty = Object.defineProperty;
|
|
11500
11554
|
var max = Math.max;
|
|
11501
11555
|
var min = Math.min;
|
|
@@ -11549,7 +11603,7 @@ var require_bare = __commonJS({
|
|
|
11549
11603
|
getFn = function() {
|
|
11550
11604
|
return setPrototypeOf(
|
|
11551
11605
|
function self2() {
|
|
11552
|
-
var start = "", end = "", msg =
|
|
11606
|
+
var start = "", end = "", msg = join5.call(arguments, " "), conf = self2._cliColorData, hasAnsi = sgr.hasCSI(msg);
|
|
11553
11607
|
forEach(
|
|
11554
11608
|
conf,
|
|
11555
11609
|
function(mod, key) {
|
|
@@ -16508,7 +16562,7 @@ var init_upFolders = __esm({
|
|
|
16508
16562
|
idx: it.idx,
|
|
16509
16563
|
when: +it.date,
|
|
16510
16564
|
tag,
|
|
16511
|
-
breakpoints:
|
|
16565
|
+
breakpoints: false
|
|
16512
16566
|
});
|
|
16513
16567
|
const patchedJSON = fullfill(prev, it.json, it.sql, dialect6);
|
|
16514
16568
|
(0, import_fs.writeFileSync)(
|
|
@@ -19760,7 +19814,7 @@ var require_node2 = __commonJS({
|
|
|
19760
19814
|
resolve(data);
|
|
19761
19815
|
});
|
|
19762
19816
|
});
|
|
19763
|
-
var
|
|
19817
|
+
var readFileSync4 = (fp) => {
|
|
19764
19818
|
return _fs.default.readFileSync(fp, "utf8");
|
|
19765
19819
|
};
|
|
19766
19820
|
var pathExists = (fp) => new Promise((resolve) => {
|
|
@@ -19991,7 +20045,7 @@ var require_node2 = __commonJS({
|
|
|
19991
20045
|
data: this.packageJsonCache.get(filepath)[options.packageKey]
|
|
19992
20046
|
};
|
|
19993
20047
|
}
|
|
19994
|
-
const data = this.options.parseJSON(
|
|
20048
|
+
const data = this.options.parseJSON(readFileSync4(filepath));
|
|
19995
20049
|
return {
|
|
19996
20050
|
path: filepath,
|
|
19997
20051
|
data
|
|
@@ -19999,7 +20053,7 @@ var require_node2 = __commonJS({
|
|
|
19999
20053
|
}
|
|
20000
20054
|
return {
|
|
20001
20055
|
path: filepath,
|
|
20002
|
-
data:
|
|
20056
|
+
data: readFileSync4(filepath)
|
|
20003
20057
|
};
|
|
20004
20058
|
}
|
|
20005
20059
|
return {};
|
|
@@ -21621,19 +21675,19 @@ var require_node2 = __commonJS({
|
|
|
21621
21675
|
return walkForTsConfig(parentDirectory, existsSync4);
|
|
21622
21676
|
}
|
|
21623
21677
|
exports2.walkForTsConfig = walkForTsConfig;
|
|
21624
|
-
function loadTsconfig(configFilePath, existsSync4,
|
|
21678
|
+
function loadTsconfig(configFilePath, existsSync4, readFileSync4) {
|
|
21625
21679
|
if (existsSync4 === void 0) {
|
|
21626
21680
|
existsSync4 = fs32.existsSync;
|
|
21627
21681
|
}
|
|
21628
|
-
if (
|
|
21629
|
-
|
|
21682
|
+
if (readFileSync4 === void 0) {
|
|
21683
|
+
readFileSync4 = function(filename) {
|
|
21630
21684
|
return fs32.readFileSync(filename, "utf8");
|
|
21631
21685
|
};
|
|
21632
21686
|
}
|
|
21633
21687
|
if (!existsSync4(configFilePath)) {
|
|
21634
21688
|
return void 0;
|
|
21635
21689
|
}
|
|
21636
|
-
var configString =
|
|
21690
|
+
var configString = readFileSync4(configFilePath);
|
|
21637
21691
|
var cleanedJson = StripBom(configString);
|
|
21638
21692
|
var config = JSON5.parse(cleanedJson);
|
|
21639
21693
|
var extendedConfig = config.extends;
|
|
@@ -21646,7 +21700,7 @@ var require_node2 = __commonJS({
|
|
|
21646
21700
|
if (extendedConfig.indexOf("/") !== -1 && extendedConfig.indexOf(".") !== -1 && !existsSync4(extendedConfigPath)) {
|
|
21647
21701
|
extendedConfigPath = path4.join(currentDir, "node_modules", extendedConfig);
|
|
21648
21702
|
}
|
|
21649
|
-
var base = loadTsconfig(extendedConfigPath, existsSync4,
|
|
21703
|
+
var base = loadTsconfig(extendedConfigPath, existsSync4, readFileSync4) || {};
|
|
21650
21704
|
if (base.compilerOptions && base.compilerOptions.baseUrl) {
|
|
21651
21705
|
var extendsDir = path4.dirname(extendedConfig);
|
|
21652
21706
|
base.compilerOptions.baseUrl = path4.join(extendsDir, base.compilerOptions.baseUrl);
|
|
@@ -22283,6 +22337,2337 @@ var require_node2 = __commonJS({
|
|
|
22283
22337
|
}
|
|
22284
22338
|
});
|
|
22285
22339
|
|
|
22340
|
+
// node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js
|
|
22341
|
+
var require_old = __commonJS({
|
|
22342
|
+
"node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js"(exports) {
|
|
22343
|
+
var pathModule = require("path");
|
|
22344
|
+
var isWindows = process.platform === "win32";
|
|
22345
|
+
var fs7 = require("fs");
|
|
22346
|
+
var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
|
|
22347
|
+
function rethrow() {
|
|
22348
|
+
var callback;
|
|
22349
|
+
if (DEBUG) {
|
|
22350
|
+
var backtrace = new Error();
|
|
22351
|
+
callback = debugCallback;
|
|
22352
|
+
} else
|
|
22353
|
+
callback = missingCallback;
|
|
22354
|
+
return callback;
|
|
22355
|
+
function debugCallback(err2) {
|
|
22356
|
+
if (err2) {
|
|
22357
|
+
backtrace.message = err2.message;
|
|
22358
|
+
err2 = backtrace;
|
|
22359
|
+
missingCallback(err2);
|
|
22360
|
+
}
|
|
22361
|
+
}
|
|
22362
|
+
function missingCallback(err2) {
|
|
22363
|
+
if (err2) {
|
|
22364
|
+
if (process.throwDeprecation)
|
|
22365
|
+
throw err2;
|
|
22366
|
+
else if (!process.noDeprecation) {
|
|
22367
|
+
var msg = "fs: missing callback " + (err2.stack || err2.message);
|
|
22368
|
+
if (process.traceDeprecation)
|
|
22369
|
+
console.trace(msg);
|
|
22370
|
+
else
|
|
22371
|
+
console.error(msg);
|
|
22372
|
+
}
|
|
22373
|
+
}
|
|
22374
|
+
}
|
|
22375
|
+
}
|
|
22376
|
+
function maybeCallback(cb) {
|
|
22377
|
+
return typeof cb === "function" ? cb : rethrow();
|
|
22378
|
+
}
|
|
22379
|
+
var normalize = pathModule.normalize;
|
|
22380
|
+
if (isWindows) {
|
|
22381
|
+
nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
|
|
22382
|
+
} else {
|
|
22383
|
+
nextPartRe = /(.*?)(?:[\/]+|$)/g;
|
|
22384
|
+
}
|
|
22385
|
+
var nextPartRe;
|
|
22386
|
+
if (isWindows) {
|
|
22387
|
+
splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
|
|
22388
|
+
} else {
|
|
22389
|
+
splitRootRe = /^[\/]*/;
|
|
22390
|
+
}
|
|
22391
|
+
var splitRootRe;
|
|
22392
|
+
exports.realpathSync = function realpathSync(p, cache) {
|
|
22393
|
+
p = pathModule.resolve(p);
|
|
22394
|
+
if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
|
|
22395
|
+
return cache[p];
|
|
22396
|
+
}
|
|
22397
|
+
var original = p, seenLinks = {}, knownHard = {};
|
|
22398
|
+
var pos;
|
|
22399
|
+
var current;
|
|
22400
|
+
var base;
|
|
22401
|
+
var previous;
|
|
22402
|
+
start();
|
|
22403
|
+
function start() {
|
|
22404
|
+
var m = splitRootRe.exec(p);
|
|
22405
|
+
pos = m[0].length;
|
|
22406
|
+
current = m[0];
|
|
22407
|
+
base = m[0];
|
|
22408
|
+
previous = "";
|
|
22409
|
+
if (isWindows && !knownHard[base]) {
|
|
22410
|
+
fs7.lstatSync(base);
|
|
22411
|
+
knownHard[base] = true;
|
|
22412
|
+
}
|
|
22413
|
+
}
|
|
22414
|
+
while (pos < p.length) {
|
|
22415
|
+
nextPartRe.lastIndex = pos;
|
|
22416
|
+
var result = nextPartRe.exec(p);
|
|
22417
|
+
previous = current;
|
|
22418
|
+
current += result[0];
|
|
22419
|
+
base = previous + result[1];
|
|
22420
|
+
pos = nextPartRe.lastIndex;
|
|
22421
|
+
if (knownHard[base] || cache && cache[base] === base) {
|
|
22422
|
+
continue;
|
|
22423
|
+
}
|
|
22424
|
+
var resolvedLink;
|
|
22425
|
+
if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
|
|
22426
|
+
resolvedLink = cache[base];
|
|
22427
|
+
} else {
|
|
22428
|
+
var stat = fs7.lstatSync(base);
|
|
22429
|
+
if (!stat.isSymbolicLink()) {
|
|
22430
|
+
knownHard[base] = true;
|
|
22431
|
+
if (cache)
|
|
22432
|
+
cache[base] = base;
|
|
22433
|
+
continue;
|
|
22434
|
+
}
|
|
22435
|
+
var linkTarget = null;
|
|
22436
|
+
if (!isWindows) {
|
|
22437
|
+
var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
|
|
22438
|
+
if (seenLinks.hasOwnProperty(id)) {
|
|
22439
|
+
linkTarget = seenLinks[id];
|
|
22440
|
+
}
|
|
22441
|
+
}
|
|
22442
|
+
if (linkTarget === null) {
|
|
22443
|
+
fs7.statSync(base);
|
|
22444
|
+
linkTarget = fs7.readlinkSync(base);
|
|
22445
|
+
}
|
|
22446
|
+
resolvedLink = pathModule.resolve(previous, linkTarget);
|
|
22447
|
+
if (cache)
|
|
22448
|
+
cache[base] = resolvedLink;
|
|
22449
|
+
if (!isWindows)
|
|
22450
|
+
seenLinks[id] = linkTarget;
|
|
22451
|
+
}
|
|
22452
|
+
p = pathModule.resolve(resolvedLink, p.slice(pos));
|
|
22453
|
+
start();
|
|
22454
|
+
}
|
|
22455
|
+
if (cache)
|
|
22456
|
+
cache[original] = p;
|
|
22457
|
+
return p;
|
|
22458
|
+
};
|
|
22459
|
+
exports.realpath = function realpath(p, cache, cb) {
|
|
22460
|
+
if (typeof cb !== "function") {
|
|
22461
|
+
cb = maybeCallback(cache);
|
|
22462
|
+
cache = null;
|
|
22463
|
+
}
|
|
22464
|
+
p = pathModule.resolve(p);
|
|
22465
|
+
if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
|
|
22466
|
+
return process.nextTick(cb.bind(null, null, cache[p]));
|
|
22467
|
+
}
|
|
22468
|
+
var original = p, seenLinks = {}, knownHard = {};
|
|
22469
|
+
var pos;
|
|
22470
|
+
var current;
|
|
22471
|
+
var base;
|
|
22472
|
+
var previous;
|
|
22473
|
+
start();
|
|
22474
|
+
function start() {
|
|
22475
|
+
var m = splitRootRe.exec(p);
|
|
22476
|
+
pos = m[0].length;
|
|
22477
|
+
current = m[0];
|
|
22478
|
+
base = m[0];
|
|
22479
|
+
previous = "";
|
|
22480
|
+
if (isWindows && !knownHard[base]) {
|
|
22481
|
+
fs7.lstat(base, function(err2) {
|
|
22482
|
+
if (err2)
|
|
22483
|
+
return cb(err2);
|
|
22484
|
+
knownHard[base] = true;
|
|
22485
|
+
LOOP();
|
|
22486
|
+
});
|
|
22487
|
+
} else {
|
|
22488
|
+
process.nextTick(LOOP);
|
|
22489
|
+
}
|
|
22490
|
+
}
|
|
22491
|
+
function LOOP() {
|
|
22492
|
+
if (pos >= p.length) {
|
|
22493
|
+
if (cache)
|
|
22494
|
+
cache[original] = p;
|
|
22495
|
+
return cb(null, p);
|
|
22496
|
+
}
|
|
22497
|
+
nextPartRe.lastIndex = pos;
|
|
22498
|
+
var result = nextPartRe.exec(p);
|
|
22499
|
+
previous = current;
|
|
22500
|
+
current += result[0];
|
|
22501
|
+
base = previous + result[1];
|
|
22502
|
+
pos = nextPartRe.lastIndex;
|
|
22503
|
+
if (knownHard[base] || cache && cache[base] === base) {
|
|
22504
|
+
return process.nextTick(LOOP);
|
|
22505
|
+
}
|
|
22506
|
+
if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
|
|
22507
|
+
return gotResolvedLink(cache[base]);
|
|
22508
|
+
}
|
|
22509
|
+
return fs7.lstat(base, gotStat);
|
|
22510
|
+
}
|
|
22511
|
+
function gotStat(err2, stat) {
|
|
22512
|
+
if (err2)
|
|
22513
|
+
return cb(err2);
|
|
22514
|
+
if (!stat.isSymbolicLink()) {
|
|
22515
|
+
knownHard[base] = true;
|
|
22516
|
+
if (cache)
|
|
22517
|
+
cache[base] = base;
|
|
22518
|
+
return process.nextTick(LOOP);
|
|
22519
|
+
}
|
|
22520
|
+
if (!isWindows) {
|
|
22521
|
+
var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
|
|
22522
|
+
if (seenLinks.hasOwnProperty(id)) {
|
|
22523
|
+
return gotTarget(null, seenLinks[id], base);
|
|
22524
|
+
}
|
|
22525
|
+
}
|
|
22526
|
+
fs7.stat(base, function(err3) {
|
|
22527
|
+
if (err3)
|
|
22528
|
+
return cb(err3);
|
|
22529
|
+
fs7.readlink(base, function(err4, target) {
|
|
22530
|
+
if (!isWindows)
|
|
22531
|
+
seenLinks[id] = target;
|
|
22532
|
+
gotTarget(err4, target);
|
|
22533
|
+
});
|
|
22534
|
+
});
|
|
22535
|
+
}
|
|
22536
|
+
function gotTarget(err2, target, base2) {
|
|
22537
|
+
if (err2)
|
|
22538
|
+
return cb(err2);
|
|
22539
|
+
var resolvedLink = pathModule.resolve(previous, target);
|
|
22540
|
+
if (cache)
|
|
22541
|
+
cache[base2] = resolvedLink;
|
|
22542
|
+
gotResolvedLink(resolvedLink);
|
|
22543
|
+
}
|
|
22544
|
+
function gotResolvedLink(resolvedLink) {
|
|
22545
|
+
p = pathModule.resolve(resolvedLink, p.slice(pos));
|
|
22546
|
+
start();
|
|
22547
|
+
}
|
|
22548
|
+
};
|
|
22549
|
+
}
|
|
22550
|
+
});
|
|
22551
|
+
|
|
22552
|
+
// node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/index.js
|
|
22553
|
+
var require_fs = __commonJS({
|
|
22554
|
+
"node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/index.js"(exports, module2) {
|
|
22555
|
+
module2.exports = realpath;
|
|
22556
|
+
realpath.realpath = realpath;
|
|
22557
|
+
realpath.sync = realpathSync;
|
|
22558
|
+
realpath.realpathSync = realpathSync;
|
|
22559
|
+
realpath.monkeypatch = monkeypatch;
|
|
22560
|
+
realpath.unmonkeypatch = unmonkeypatch;
|
|
22561
|
+
var fs7 = require("fs");
|
|
22562
|
+
var origRealpath = fs7.realpath;
|
|
22563
|
+
var origRealpathSync = fs7.realpathSync;
|
|
22564
|
+
var version = process.version;
|
|
22565
|
+
var ok = /^v[0-5]\./.test(version);
|
|
22566
|
+
var old = require_old();
|
|
22567
|
+
function newError(er) {
|
|
22568
|
+
return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG");
|
|
22569
|
+
}
|
|
22570
|
+
function realpath(p, cache, cb) {
|
|
22571
|
+
if (ok) {
|
|
22572
|
+
return origRealpath(p, cache, cb);
|
|
22573
|
+
}
|
|
22574
|
+
if (typeof cache === "function") {
|
|
22575
|
+
cb = cache;
|
|
22576
|
+
cache = null;
|
|
22577
|
+
}
|
|
22578
|
+
origRealpath(p, cache, function(er, result) {
|
|
22579
|
+
if (newError(er)) {
|
|
22580
|
+
old.realpath(p, cache, cb);
|
|
22581
|
+
} else {
|
|
22582
|
+
cb(er, result);
|
|
22583
|
+
}
|
|
22584
|
+
});
|
|
22585
|
+
}
|
|
22586
|
+
function realpathSync(p, cache) {
|
|
22587
|
+
if (ok) {
|
|
22588
|
+
return origRealpathSync(p, cache);
|
|
22589
|
+
}
|
|
22590
|
+
try {
|
|
22591
|
+
return origRealpathSync(p, cache);
|
|
22592
|
+
} catch (er) {
|
|
22593
|
+
if (newError(er)) {
|
|
22594
|
+
return old.realpathSync(p, cache);
|
|
22595
|
+
} else {
|
|
22596
|
+
throw er;
|
|
22597
|
+
}
|
|
22598
|
+
}
|
|
22599
|
+
}
|
|
22600
|
+
function monkeypatch() {
|
|
22601
|
+
fs7.realpath = realpath;
|
|
22602
|
+
fs7.realpathSync = realpathSync;
|
|
22603
|
+
}
|
|
22604
|
+
function unmonkeypatch() {
|
|
22605
|
+
fs7.realpath = origRealpath;
|
|
22606
|
+
fs7.realpathSync = origRealpathSync;
|
|
22607
|
+
}
|
|
22608
|
+
}
|
|
22609
|
+
});
|
|
22610
|
+
|
|
22611
|
+
// node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js
|
|
22612
|
+
var require_path = __commonJS({
|
|
22613
|
+
"node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js"(exports, module2) {
|
|
22614
|
+
var isWindows = typeof process === "object" && process && process.platform === "win32";
|
|
22615
|
+
module2.exports = isWindows ? { sep: "\\" } : { sep: "/" };
|
|
22616
|
+
}
|
|
22617
|
+
});
|
|
22618
|
+
|
|
22619
|
+
// node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js
|
|
22620
|
+
var require_balanced_match = __commonJS({
|
|
22621
|
+
"node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports, module2) {
|
|
22622
|
+
"use strict";
|
|
22623
|
+
module2.exports = balanced;
|
|
22624
|
+
function balanced(a, b, str) {
|
|
22625
|
+
if (a instanceof RegExp)
|
|
22626
|
+
a = maybeMatch(a, str);
|
|
22627
|
+
if (b instanceof RegExp)
|
|
22628
|
+
b = maybeMatch(b, str);
|
|
22629
|
+
var r = range(a, b, str);
|
|
22630
|
+
return r && {
|
|
22631
|
+
start: r[0],
|
|
22632
|
+
end: r[1],
|
|
22633
|
+
pre: str.slice(0, r[0]),
|
|
22634
|
+
body: str.slice(r[0] + a.length, r[1]),
|
|
22635
|
+
post: str.slice(r[1] + b.length)
|
|
22636
|
+
};
|
|
22637
|
+
}
|
|
22638
|
+
function maybeMatch(reg, str) {
|
|
22639
|
+
var m = str.match(reg);
|
|
22640
|
+
return m ? m[0] : null;
|
|
22641
|
+
}
|
|
22642
|
+
balanced.range = range;
|
|
22643
|
+
function range(a, b, str) {
|
|
22644
|
+
var begs, beg, left, right, result;
|
|
22645
|
+
var ai = str.indexOf(a);
|
|
22646
|
+
var bi = str.indexOf(b, ai + 1);
|
|
22647
|
+
var i = ai;
|
|
22648
|
+
if (ai >= 0 && bi > 0) {
|
|
22649
|
+
if (a === b) {
|
|
22650
|
+
return [ai, bi];
|
|
22651
|
+
}
|
|
22652
|
+
begs = [];
|
|
22653
|
+
left = str.length;
|
|
22654
|
+
while (i >= 0 && !result) {
|
|
22655
|
+
if (i == ai) {
|
|
22656
|
+
begs.push(i);
|
|
22657
|
+
ai = str.indexOf(a, i + 1);
|
|
22658
|
+
} else if (begs.length == 1) {
|
|
22659
|
+
result = [begs.pop(), bi];
|
|
22660
|
+
} else {
|
|
22661
|
+
beg = begs.pop();
|
|
22662
|
+
if (beg < left) {
|
|
22663
|
+
left = beg;
|
|
22664
|
+
right = bi;
|
|
22665
|
+
}
|
|
22666
|
+
bi = str.indexOf(b, i + 1);
|
|
22667
|
+
}
|
|
22668
|
+
i = ai < bi && ai >= 0 ? ai : bi;
|
|
22669
|
+
}
|
|
22670
|
+
if (begs.length) {
|
|
22671
|
+
result = [left, right];
|
|
22672
|
+
}
|
|
22673
|
+
}
|
|
22674
|
+
return result;
|
|
22675
|
+
}
|
|
22676
|
+
}
|
|
22677
|
+
});
|
|
22678
|
+
|
|
22679
|
+
// node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js
|
|
22680
|
+
var require_brace_expansion = __commonJS({
|
|
22681
|
+
"node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports, module2) {
|
|
22682
|
+
var balanced = require_balanced_match();
|
|
22683
|
+
module2.exports = expandTop;
|
|
22684
|
+
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
22685
|
+
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
22686
|
+
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
22687
|
+
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
22688
|
+
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
22689
|
+
function numeric(str) {
|
|
22690
|
+
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
22691
|
+
}
|
|
22692
|
+
function escapeBraces(str) {
|
|
22693
|
+
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
22694
|
+
}
|
|
22695
|
+
function unescapeBraces(str) {
|
|
22696
|
+
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
22697
|
+
}
|
|
22698
|
+
function parseCommaParts(str) {
|
|
22699
|
+
if (!str)
|
|
22700
|
+
return [""];
|
|
22701
|
+
var parts = [];
|
|
22702
|
+
var m = balanced("{", "}", str);
|
|
22703
|
+
if (!m)
|
|
22704
|
+
return str.split(",");
|
|
22705
|
+
var pre = m.pre;
|
|
22706
|
+
var body = m.body;
|
|
22707
|
+
var post = m.post;
|
|
22708
|
+
var p = pre.split(",");
|
|
22709
|
+
p[p.length - 1] += "{" + body + "}";
|
|
22710
|
+
var postParts = parseCommaParts(post);
|
|
22711
|
+
if (post.length) {
|
|
22712
|
+
p[p.length - 1] += postParts.shift();
|
|
22713
|
+
p.push.apply(p, postParts);
|
|
22714
|
+
}
|
|
22715
|
+
parts.push.apply(parts, p);
|
|
22716
|
+
return parts;
|
|
22717
|
+
}
|
|
22718
|
+
function expandTop(str) {
|
|
22719
|
+
if (!str)
|
|
22720
|
+
return [];
|
|
22721
|
+
if (str.substr(0, 2) === "{}") {
|
|
22722
|
+
str = "\\{\\}" + str.substr(2);
|
|
22723
|
+
}
|
|
22724
|
+
return expand(escapeBraces(str), true).map(unescapeBraces);
|
|
22725
|
+
}
|
|
22726
|
+
function embrace(str) {
|
|
22727
|
+
return "{" + str + "}";
|
|
22728
|
+
}
|
|
22729
|
+
function isPadded(el) {
|
|
22730
|
+
return /^-?0\d/.test(el);
|
|
22731
|
+
}
|
|
22732
|
+
function lte(i, y) {
|
|
22733
|
+
return i <= y;
|
|
22734
|
+
}
|
|
22735
|
+
function gte(i, y) {
|
|
22736
|
+
return i >= y;
|
|
22737
|
+
}
|
|
22738
|
+
function expand(str, isTop) {
|
|
22739
|
+
var expansions = [];
|
|
22740
|
+
var m = balanced("{", "}", str);
|
|
22741
|
+
if (!m)
|
|
22742
|
+
return [str];
|
|
22743
|
+
var pre = m.pre;
|
|
22744
|
+
var post = m.post.length ? expand(m.post, false) : [""];
|
|
22745
|
+
if (/\$$/.test(m.pre)) {
|
|
22746
|
+
for (var k = 0; k < post.length; k++) {
|
|
22747
|
+
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
22748
|
+
expansions.push(expansion);
|
|
22749
|
+
}
|
|
22750
|
+
} else {
|
|
22751
|
+
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
22752
|
+
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
22753
|
+
var isSequence = isNumericSequence || isAlphaSequence;
|
|
22754
|
+
var isOptions = m.body.indexOf(",") >= 0;
|
|
22755
|
+
if (!isSequence && !isOptions) {
|
|
22756
|
+
if (m.post.match(/,.*\}/)) {
|
|
22757
|
+
str = m.pre + "{" + m.body + escClose + m.post;
|
|
22758
|
+
return expand(str);
|
|
22759
|
+
}
|
|
22760
|
+
return [str];
|
|
22761
|
+
}
|
|
22762
|
+
var n;
|
|
22763
|
+
if (isSequence) {
|
|
22764
|
+
n = m.body.split(/\.\./);
|
|
22765
|
+
} else {
|
|
22766
|
+
n = parseCommaParts(m.body);
|
|
22767
|
+
if (n.length === 1) {
|
|
22768
|
+
n = expand(n[0], false).map(embrace);
|
|
22769
|
+
if (n.length === 1) {
|
|
22770
|
+
return post.map(function(p) {
|
|
22771
|
+
return m.pre + n[0] + p;
|
|
22772
|
+
});
|
|
22773
|
+
}
|
|
22774
|
+
}
|
|
22775
|
+
}
|
|
22776
|
+
var N;
|
|
22777
|
+
if (isSequence) {
|
|
22778
|
+
var x = numeric(n[0]);
|
|
22779
|
+
var y = numeric(n[1]);
|
|
22780
|
+
var width = Math.max(n[0].length, n[1].length);
|
|
22781
|
+
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
22782
|
+
var test = lte;
|
|
22783
|
+
var reverse = y < x;
|
|
22784
|
+
if (reverse) {
|
|
22785
|
+
incr *= -1;
|
|
22786
|
+
test = gte;
|
|
22787
|
+
}
|
|
22788
|
+
var pad = n.some(isPadded);
|
|
22789
|
+
N = [];
|
|
22790
|
+
for (var i = x; test(i, y); i += incr) {
|
|
22791
|
+
var c;
|
|
22792
|
+
if (isAlphaSequence) {
|
|
22793
|
+
c = String.fromCharCode(i);
|
|
22794
|
+
if (c === "\\")
|
|
22795
|
+
c = "";
|
|
22796
|
+
} else {
|
|
22797
|
+
c = String(i);
|
|
22798
|
+
if (pad) {
|
|
22799
|
+
var need = width - c.length;
|
|
22800
|
+
if (need > 0) {
|
|
22801
|
+
var z2 = new Array(need + 1).join("0");
|
|
22802
|
+
if (i < 0)
|
|
22803
|
+
c = "-" + z2 + c.slice(1);
|
|
22804
|
+
else
|
|
22805
|
+
c = z2 + c;
|
|
22806
|
+
}
|
|
22807
|
+
}
|
|
22808
|
+
}
|
|
22809
|
+
N.push(c);
|
|
22810
|
+
}
|
|
22811
|
+
} else {
|
|
22812
|
+
N = [];
|
|
22813
|
+
for (var j = 0; j < n.length; j++) {
|
|
22814
|
+
N.push.apply(N, expand(n[j], false));
|
|
22815
|
+
}
|
|
22816
|
+
}
|
|
22817
|
+
for (var j = 0; j < N.length; j++) {
|
|
22818
|
+
for (var k = 0; k < post.length; k++) {
|
|
22819
|
+
var expansion = pre + N[j] + post[k];
|
|
22820
|
+
if (!isTop || isSequence || expansion)
|
|
22821
|
+
expansions.push(expansion);
|
|
22822
|
+
}
|
|
22823
|
+
}
|
|
22824
|
+
}
|
|
22825
|
+
return expansions;
|
|
22826
|
+
}
|
|
22827
|
+
}
|
|
22828
|
+
});
|
|
22829
|
+
|
|
22830
|
+
// node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js
|
|
22831
|
+
var require_minimatch = __commonJS({
|
|
22832
|
+
"node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js"(exports, module2) {
|
|
22833
|
+
var minimatch = module2.exports = (p, pattern, options = {}) => {
|
|
22834
|
+
assertValidPattern(pattern);
|
|
22835
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
22836
|
+
return false;
|
|
22837
|
+
}
|
|
22838
|
+
return new Minimatch(pattern, options).match(p);
|
|
22839
|
+
};
|
|
22840
|
+
module2.exports = minimatch;
|
|
22841
|
+
var path4 = require_path();
|
|
22842
|
+
minimatch.sep = path4.sep;
|
|
22843
|
+
var GLOBSTAR = Symbol("globstar **");
|
|
22844
|
+
minimatch.GLOBSTAR = GLOBSTAR;
|
|
22845
|
+
var expand = require_brace_expansion();
|
|
22846
|
+
var plTypes = {
|
|
22847
|
+
"!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
|
|
22848
|
+
"?": { open: "(?:", close: ")?" },
|
|
22849
|
+
"+": { open: "(?:", close: ")+" },
|
|
22850
|
+
"*": { open: "(?:", close: ")*" },
|
|
22851
|
+
"@": { open: "(?:", close: ")" }
|
|
22852
|
+
};
|
|
22853
|
+
var qmark = "[^/]";
|
|
22854
|
+
var star = qmark + "*?";
|
|
22855
|
+
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
22856
|
+
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
22857
|
+
var charSet = (s) => s.split("").reduce((set, c) => {
|
|
22858
|
+
set[c] = true;
|
|
22859
|
+
return set;
|
|
22860
|
+
}, {});
|
|
22861
|
+
var reSpecials = charSet("().*{}+?[]^$\\!");
|
|
22862
|
+
var addPatternStartSet = charSet("[.(");
|
|
22863
|
+
var slashSplit = /\/+/;
|
|
22864
|
+
minimatch.filter = (pattern, options = {}) => (p, i, list) => minimatch(p, pattern, options);
|
|
22865
|
+
var ext = (a, b = {}) => {
|
|
22866
|
+
const t = {};
|
|
22867
|
+
Object.keys(a).forEach((k) => t[k] = a[k]);
|
|
22868
|
+
Object.keys(b).forEach((k) => t[k] = b[k]);
|
|
22869
|
+
return t;
|
|
22870
|
+
};
|
|
22871
|
+
minimatch.defaults = (def) => {
|
|
22872
|
+
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
22873
|
+
return minimatch;
|
|
22874
|
+
}
|
|
22875
|
+
const orig = minimatch;
|
|
22876
|
+
const m = (p, pattern, options) => orig(p, pattern, ext(def, options));
|
|
22877
|
+
m.Minimatch = class Minimatch extends orig.Minimatch {
|
|
22878
|
+
constructor(pattern, options) {
|
|
22879
|
+
super(pattern, ext(def, options));
|
|
22880
|
+
}
|
|
22881
|
+
};
|
|
22882
|
+
m.Minimatch.defaults = (options) => orig.defaults(ext(def, options)).Minimatch;
|
|
22883
|
+
m.filter = (pattern, options) => orig.filter(pattern, ext(def, options));
|
|
22884
|
+
m.defaults = (options) => orig.defaults(ext(def, options));
|
|
22885
|
+
m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options));
|
|
22886
|
+
m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options));
|
|
22887
|
+
m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options));
|
|
22888
|
+
return m;
|
|
22889
|
+
};
|
|
22890
|
+
minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options);
|
|
22891
|
+
var braceExpand = (pattern, options = {}) => {
|
|
22892
|
+
assertValidPattern(pattern);
|
|
22893
|
+
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
22894
|
+
return [pattern];
|
|
22895
|
+
}
|
|
22896
|
+
return expand(pattern);
|
|
22897
|
+
};
|
|
22898
|
+
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
22899
|
+
var assertValidPattern = (pattern) => {
|
|
22900
|
+
if (typeof pattern !== "string") {
|
|
22901
|
+
throw new TypeError("invalid pattern");
|
|
22902
|
+
}
|
|
22903
|
+
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
22904
|
+
throw new TypeError("pattern is too long");
|
|
22905
|
+
}
|
|
22906
|
+
};
|
|
22907
|
+
var SUBPARSE = Symbol("subparse");
|
|
22908
|
+
minimatch.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe();
|
|
22909
|
+
minimatch.match = (list, pattern, options = {}) => {
|
|
22910
|
+
const mm = new Minimatch(pattern, options);
|
|
22911
|
+
list = list.filter((f) => mm.match(f));
|
|
22912
|
+
if (mm.options.nonull && !list.length) {
|
|
22913
|
+
list.push(pattern);
|
|
22914
|
+
}
|
|
22915
|
+
return list;
|
|
22916
|
+
};
|
|
22917
|
+
var globUnescape = (s) => s.replace(/\\(.)/g, "$1");
|
|
22918
|
+
var charUnescape = (s) => s.replace(/\\([^-\]])/g, "$1");
|
|
22919
|
+
var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
22920
|
+
var braExpEscape = (s) => s.replace(/[[\]\\]/g, "\\$&");
|
|
22921
|
+
var Minimatch = class {
|
|
22922
|
+
constructor(pattern, options) {
|
|
22923
|
+
assertValidPattern(pattern);
|
|
22924
|
+
if (!options)
|
|
22925
|
+
options = {};
|
|
22926
|
+
this.options = options;
|
|
22927
|
+
this.set = [];
|
|
22928
|
+
this.pattern = pattern;
|
|
22929
|
+
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
22930
|
+
if (this.windowsPathsNoEscape) {
|
|
22931
|
+
this.pattern = this.pattern.replace(/\\/g, "/");
|
|
22932
|
+
}
|
|
22933
|
+
this.regexp = null;
|
|
22934
|
+
this.negate = false;
|
|
22935
|
+
this.comment = false;
|
|
22936
|
+
this.empty = false;
|
|
22937
|
+
this.partial = !!options.partial;
|
|
22938
|
+
this.make();
|
|
22939
|
+
}
|
|
22940
|
+
debug() {
|
|
22941
|
+
}
|
|
22942
|
+
make() {
|
|
22943
|
+
const pattern = this.pattern;
|
|
22944
|
+
const options = this.options;
|
|
22945
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
22946
|
+
this.comment = true;
|
|
22947
|
+
return;
|
|
22948
|
+
}
|
|
22949
|
+
if (!pattern) {
|
|
22950
|
+
this.empty = true;
|
|
22951
|
+
return;
|
|
22952
|
+
}
|
|
22953
|
+
this.parseNegate();
|
|
22954
|
+
let set = this.globSet = this.braceExpand();
|
|
22955
|
+
if (options.debug)
|
|
22956
|
+
this.debug = (...args) => console.error(...args);
|
|
22957
|
+
this.debug(this.pattern, set);
|
|
22958
|
+
set = this.globParts = set.map((s) => s.split(slashSplit));
|
|
22959
|
+
this.debug(this.pattern, set);
|
|
22960
|
+
set = set.map((s, si, set2) => s.map(this.parse, this));
|
|
22961
|
+
this.debug(this.pattern, set);
|
|
22962
|
+
set = set.filter((s) => s.indexOf(false) === -1);
|
|
22963
|
+
this.debug(this.pattern, set);
|
|
22964
|
+
this.set = set;
|
|
22965
|
+
}
|
|
22966
|
+
parseNegate() {
|
|
22967
|
+
if (this.options.nonegate)
|
|
22968
|
+
return;
|
|
22969
|
+
const pattern = this.pattern;
|
|
22970
|
+
let negate = false;
|
|
22971
|
+
let negateOffset = 0;
|
|
22972
|
+
for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
|
|
22973
|
+
negate = !negate;
|
|
22974
|
+
negateOffset++;
|
|
22975
|
+
}
|
|
22976
|
+
if (negateOffset)
|
|
22977
|
+
this.pattern = pattern.slice(negateOffset);
|
|
22978
|
+
this.negate = negate;
|
|
22979
|
+
}
|
|
22980
|
+
matchOne(file, pattern, partial) {
|
|
22981
|
+
var options = this.options;
|
|
22982
|
+
this.debug(
|
|
22983
|
+
"matchOne",
|
|
22984
|
+
{ "this": this, file, pattern }
|
|
22985
|
+
);
|
|
22986
|
+
this.debug("matchOne", file.length, pattern.length);
|
|
22987
|
+
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
22988
|
+
this.debug("matchOne loop");
|
|
22989
|
+
var p = pattern[pi];
|
|
22990
|
+
var f = file[fi];
|
|
22991
|
+
this.debug(pattern, p, f);
|
|
22992
|
+
if (p === false)
|
|
22993
|
+
return false;
|
|
22994
|
+
if (p === GLOBSTAR) {
|
|
22995
|
+
this.debug("GLOBSTAR", [pattern, p, f]);
|
|
22996
|
+
var fr = fi;
|
|
22997
|
+
var pr = pi + 1;
|
|
22998
|
+
if (pr === pl) {
|
|
22999
|
+
this.debug("** at the end");
|
|
23000
|
+
for (; fi < fl; fi++) {
|
|
23001
|
+
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
|
23002
|
+
return false;
|
|
23003
|
+
}
|
|
23004
|
+
return true;
|
|
23005
|
+
}
|
|
23006
|
+
while (fr < fl) {
|
|
23007
|
+
var swallowee = file[fr];
|
|
23008
|
+
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
|
23009
|
+
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
23010
|
+
this.debug("globstar found match!", fr, fl, swallowee);
|
|
23011
|
+
return true;
|
|
23012
|
+
} else {
|
|
23013
|
+
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
|
23014
|
+
this.debug("dot detected!", file, fr, pattern, pr);
|
|
23015
|
+
break;
|
|
23016
|
+
}
|
|
23017
|
+
this.debug("globstar swallow a segment, and continue");
|
|
23018
|
+
fr++;
|
|
23019
|
+
}
|
|
23020
|
+
}
|
|
23021
|
+
if (partial) {
|
|
23022
|
+
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
|
23023
|
+
if (fr === fl)
|
|
23024
|
+
return true;
|
|
23025
|
+
}
|
|
23026
|
+
return false;
|
|
23027
|
+
}
|
|
23028
|
+
var hit;
|
|
23029
|
+
if (typeof p === "string") {
|
|
23030
|
+
hit = f === p;
|
|
23031
|
+
this.debug("string match", p, f, hit);
|
|
23032
|
+
} else {
|
|
23033
|
+
hit = f.match(p);
|
|
23034
|
+
this.debug("pattern match", p, f, hit);
|
|
23035
|
+
}
|
|
23036
|
+
if (!hit)
|
|
23037
|
+
return false;
|
|
23038
|
+
}
|
|
23039
|
+
if (fi === fl && pi === pl) {
|
|
23040
|
+
return true;
|
|
23041
|
+
} else if (fi === fl) {
|
|
23042
|
+
return partial;
|
|
23043
|
+
} else if (pi === pl) {
|
|
23044
|
+
return fi === fl - 1 && file[fi] === "";
|
|
23045
|
+
}
|
|
23046
|
+
throw new Error("wtf?");
|
|
23047
|
+
}
|
|
23048
|
+
braceExpand() {
|
|
23049
|
+
return braceExpand(this.pattern, this.options);
|
|
23050
|
+
}
|
|
23051
|
+
parse(pattern, isSub) {
|
|
23052
|
+
assertValidPattern(pattern);
|
|
23053
|
+
const options = this.options;
|
|
23054
|
+
if (pattern === "**") {
|
|
23055
|
+
if (!options.noglobstar)
|
|
23056
|
+
return GLOBSTAR;
|
|
23057
|
+
else
|
|
23058
|
+
pattern = "*";
|
|
23059
|
+
}
|
|
23060
|
+
if (pattern === "")
|
|
23061
|
+
return "";
|
|
23062
|
+
let re = "";
|
|
23063
|
+
let hasMagic = false;
|
|
23064
|
+
let escaping = false;
|
|
23065
|
+
const patternListStack = [];
|
|
23066
|
+
const negativeLists = [];
|
|
23067
|
+
let stateChar;
|
|
23068
|
+
let inClass = false;
|
|
23069
|
+
let reClassStart = -1;
|
|
23070
|
+
let classStart = -1;
|
|
23071
|
+
let cs;
|
|
23072
|
+
let pl;
|
|
23073
|
+
let sp;
|
|
23074
|
+
let dotTravAllowed = pattern.charAt(0) === ".";
|
|
23075
|
+
let dotFileAllowed = options.dot || dotTravAllowed;
|
|
23076
|
+
const patternStart = () => dotTravAllowed ? "" : dotFileAllowed ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
|
|
23077
|
+
const subPatternStart = (p) => p.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
|
|
23078
|
+
const clearStateChar = () => {
|
|
23079
|
+
if (stateChar) {
|
|
23080
|
+
switch (stateChar) {
|
|
23081
|
+
case "*":
|
|
23082
|
+
re += star;
|
|
23083
|
+
hasMagic = true;
|
|
23084
|
+
break;
|
|
23085
|
+
case "?":
|
|
23086
|
+
re += qmark;
|
|
23087
|
+
hasMagic = true;
|
|
23088
|
+
break;
|
|
23089
|
+
default:
|
|
23090
|
+
re += "\\" + stateChar;
|
|
23091
|
+
break;
|
|
23092
|
+
}
|
|
23093
|
+
this.debug("clearStateChar %j %j", stateChar, re);
|
|
23094
|
+
stateChar = false;
|
|
23095
|
+
}
|
|
23096
|
+
};
|
|
23097
|
+
for (let i = 0, c; i < pattern.length && (c = pattern.charAt(i)); i++) {
|
|
23098
|
+
this.debug("%s %s %s %j", pattern, i, re, c);
|
|
23099
|
+
if (escaping) {
|
|
23100
|
+
if (c === "/") {
|
|
23101
|
+
return false;
|
|
23102
|
+
}
|
|
23103
|
+
if (reSpecials[c]) {
|
|
23104
|
+
re += "\\";
|
|
23105
|
+
}
|
|
23106
|
+
re += c;
|
|
23107
|
+
escaping = false;
|
|
23108
|
+
continue;
|
|
23109
|
+
}
|
|
23110
|
+
switch (c) {
|
|
23111
|
+
case "/": {
|
|
23112
|
+
return false;
|
|
23113
|
+
}
|
|
23114
|
+
case "\\":
|
|
23115
|
+
if (inClass && pattern.charAt(i + 1) === "-") {
|
|
23116
|
+
re += c;
|
|
23117
|
+
continue;
|
|
23118
|
+
}
|
|
23119
|
+
clearStateChar();
|
|
23120
|
+
escaping = true;
|
|
23121
|
+
continue;
|
|
23122
|
+
case "?":
|
|
23123
|
+
case "*":
|
|
23124
|
+
case "+":
|
|
23125
|
+
case "@":
|
|
23126
|
+
case "!":
|
|
23127
|
+
this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
|
|
23128
|
+
if (inClass) {
|
|
23129
|
+
this.debug(" in class");
|
|
23130
|
+
if (c === "!" && i === classStart + 1)
|
|
23131
|
+
c = "^";
|
|
23132
|
+
re += c;
|
|
23133
|
+
continue;
|
|
23134
|
+
}
|
|
23135
|
+
this.debug("call clearStateChar %j", stateChar);
|
|
23136
|
+
clearStateChar();
|
|
23137
|
+
stateChar = c;
|
|
23138
|
+
if (options.noext)
|
|
23139
|
+
clearStateChar();
|
|
23140
|
+
continue;
|
|
23141
|
+
case "(": {
|
|
23142
|
+
if (inClass) {
|
|
23143
|
+
re += "(";
|
|
23144
|
+
continue;
|
|
23145
|
+
}
|
|
23146
|
+
if (!stateChar) {
|
|
23147
|
+
re += "\\(";
|
|
23148
|
+
continue;
|
|
23149
|
+
}
|
|
23150
|
+
const plEntry = {
|
|
23151
|
+
type: stateChar,
|
|
23152
|
+
start: i - 1,
|
|
23153
|
+
reStart: re.length,
|
|
23154
|
+
open: plTypes[stateChar].open,
|
|
23155
|
+
close: plTypes[stateChar].close
|
|
23156
|
+
};
|
|
23157
|
+
this.debug(this.pattern, " ", plEntry);
|
|
23158
|
+
patternListStack.push(plEntry);
|
|
23159
|
+
re += plEntry.open;
|
|
23160
|
+
if (plEntry.start === 0 && plEntry.type !== "!") {
|
|
23161
|
+
dotTravAllowed = true;
|
|
23162
|
+
re += subPatternStart(pattern.slice(i + 1));
|
|
23163
|
+
}
|
|
23164
|
+
this.debug("plType %j %j", stateChar, re);
|
|
23165
|
+
stateChar = false;
|
|
23166
|
+
continue;
|
|
23167
|
+
}
|
|
23168
|
+
case ")": {
|
|
23169
|
+
const plEntry = patternListStack[patternListStack.length - 1];
|
|
23170
|
+
if (inClass || !plEntry) {
|
|
23171
|
+
re += "\\)";
|
|
23172
|
+
continue;
|
|
23173
|
+
}
|
|
23174
|
+
patternListStack.pop();
|
|
23175
|
+
clearStateChar();
|
|
23176
|
+
hasMagic = true;
|
|
23177
|
+
pl = plEntry;
|
|
23178
|
+
re += pl.close;
|
|
23179
|
+
if (pl.type === "!") {
|
|
23180
|
+
negativeLists.push(Object.assign(pl, { reEnd: re.length }));
|
|
23181
|
+
}
|
|
23182
|
+
continue;
|
|
23183
|
+
}
|
|
23184
|
+
case "|": {
|
|
23185
|
+
const plEntry = patternListStack[patternListStack.length - 1];
|
|
23186
|
+
if (inClass || !plEntry) {
|
|
23187
|
+
re += "\\|";
|
|
23188
|
+
continue;
|
|
23189
|
+
}
|
|
23190
|
+
clearStateChar();
|
|
23191
|
+
re += "|";
|
|
23192
|
+
if (plEntry.start === 0 && plEntry.type !== "!") {
|
|
23193
|
+
dotTravAllowed = true;
|
|
23194
|
+
re += subPatternStart(pattern.slice(i + 1));
|
|
23195
|
+
}
|
|
23196
|
+
continue;
|
|
23197
|
+
}
|
|
23198
|
+
case "[":
|
|
23199
|
+
clearStateChar();
|
|
23200
|
+
if (inClass) {
|
|
23201
|
+
re += "\\" + c;
|
|
23202
|
+
continue;
|
|
23203
|
+
}
|
|
23204
|
+
inClass = true;
|
|
23205
|
+
classStart = i;
|
|
23206
|
+
reClassStart = re.length;
|
|
23207
|
+
re += c;
|
|
23208
|
+
continue;
|
|
23209
|
+
case "]":
|
|
23210
|
+
if (i === classStart + 1 || !inClass) {
|
|
23211
|
+
re += "\\" + c;
|
|
23212
|
+
continue;
|
|
23213
|
+
}
|
|
23214
|
+
cs = pattern.substring(classStart + 1, i);
|
|
23215
|
+
try {
|
|
23216
|
+
RegExp("[" + braExpEscape(charUnescape(cs)) + "]");
|
|
23217
|
+
re += c;
|
|
23218
|
+
} catch (er) {
|
|
23219
|
+
re = re.substring(0, reClassStart) + "(?:$.)";
|
|
23220
|
+
}
|
|
23221
|
+
hasMagic = true;
|
|
23222
|
+
inClass = false;
|
|
23223
|
+
continue;
|
|
23224
|
+
default:
|
|
23225
|
+
clearStateChar();
|
|
23226
|
+
if (reSpecials[c] && !(c === "^" && inClass)) {
|
|
23227
|
+
re += "\\";
|
|
23228
|
+
}
|
|
23229
|
+
re += c;
|
|
23230
|
+
break;
|
|
23231
|
+
}
|
|
23232
|
+
}
|
|
23233
|
+
if (inClass) {
|
|
23234
|
+
cs = pattern.slice(classStart + 1);
|
|
23235
|
+
sp = this.parse(cs, SUBPARSE);
|
|
23236
|
+
re = re.substring(0, reClassStart) + "\\[" + sp[0];
|
|
23237
|
+
hasMagic = hasMagic || sp[1];
|
|
23238
|
+
}
|
|
23239
|
+
for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
|
|
23240
|
+
let tail;
|
|
23241
|
+
tail = re.slice(pl.reStart + pl.open.length);
|
|
23242
|
+
this.debug("setting tail", re, pl);
|
|
23243
|
+
tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
|
|
23244
|
+
if (!$2) {
|
|
23245
|
+
$2 = "\\";
|
|
23246
|
+
}
|
|
23247
|
+
return $1 + $1 + $2 + "|";
|
|
23248
|
+
});
|
|
23249
|
+
this.debug("tail=%j\n %s", tail, tail, pl, re);
|
|
23250
|
+
const t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
|
|
23251
|
+
hasMagic = true;
|
|
23252
|
+
re = re.slice(0, pl.reStart) + t + "\\(" + tail;
|
|
23253
|
+
}
|
|
23254
|
+
clearStateChar();
|
|
23255
|
+
if (escaping) {
|
|
23256
|
+
re += "\\\\";
|
|
23257
|
+
}
|
|
23258
|
+
const addPatternStart = addPatternStartSet[re.charAt(0)];
|
|
23259
|
+
for (let n = negativeLists.length - 1; n > -1; n--) {
|
|
23260
|
+
const nl = negativeLists[n];
|
|
23261
|
+
const nlBefore = re.slice(0, nl.reStart);
|
|
23262
|
+
const nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
|
|
23263
|
+
let nlAfter = re.slice(nl.reEnd);
|
|
23264
|
+
const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter;
|
|
23265
|
+
const closeParensBefore = nlBefore.split(")").length;
|
|
23266
|
+
const openParensBefore = nlBefore.split("(").length - closeParensBefore;
|
|
23267
|
+
let cleanAfter = nlAfter;
|
|
23268
|
+
for (let i = 0; i < openParensBefore; i++) {
|
|
23269
|
+
cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
|
|
23270
|
+
}
|
|
23271
|
+
nlAfter = cleanAfter;
|
|
23272
|
+
const dollar = nlAfter === "" && isSub !== SUBPARSE ? "(?:$|\\/)" : "";
|
|
23273
|
+
re = nlBefore + nlFirst + nlAfter + dollar + nlLast;
|
|
23274
|
+
}
|
|
23275
|
+
if (re !== "" && hasMagic) {
|
|
23276
|
+
re = "(?=.)" + re;
|
|
23277
|
+
}
|
|
23278
|
+
if (addPatternStart) {
|
|
23279
|
+
re = patternStart() + re;
|
|
23280
|
+
}
|
|
23281
|
+
if (isSub === SUBPARSE) {
|
|
23282
|
+
return [re, hasMagic];
|
|
23283
|
+
}
|
|
23284
|
+
if (options.nocase && !hasMagic) {
|
|
23285
|
+
hasMagic = pattern.toUpperCase() !== pattern.toLowerCase();
|
|
23286
|
+
}
|
|
23287
|
+
if (!hasMagic) {
|
|
23288
|
+
return globUnescape(pattern);
|
|
23289
|
+
}
|
|
23290
|
+
const flags = options.nocase ? "i" : "";
|
|
23291
|
+
try {
|
|
23292
|
+
return Object.assign(new RegExp("^" + re + "$", flags), {
|
|
23293
|
+
_glob: pattern,
|
|
23294
|
+
_src: re
|
|
23295
|
+
});
|
|
23296
|
+
} catch (er) {
|
|
23297
|
+
return new RegExp("$.");
|
|
23298
|
+
}
|
|
23299
|
+
}
|
|
23300
|
+
makeRe() {
|
|
23301
|
+
if (this.regexp || this.regexp === false)
|
|
23302
|
+
return this.regexp;
|
|
23303
|
+
const set = this.set;
|
|
23304
|
+
if (!set.length) {
|
|
23305
|
+
this.regexp = false;
|
|
23306
|
+
return this.regexp;
|
|
23307
|
+
}
|
|
23308
|
+
const options = this.options;
|
|
23309
|
+
const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
|
|
23310
|
+
const flags = options.nocase ? "i" : "";
|
|
23311
|
+
let re = set.map((pattern) => {
|
|
23312
|
+
pattern = pattern.map(
|
|
23313
|
+
(p) => typeof p === "string" ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src
|
|
23314
|
+
).reduce((set2, p) => {
|
|
23315
|
+
if (!(set2[set2.length - 1] === GLOBSTAR && p === GLOBSTAR)) {
|
|
23316
|
+
set2.push(p);
|
|
23317
|
+
}
|
|
23318
|
+
return set2;
|
|
23319
|
+
}, []);
|
|
23320
|
+
pattern.forEach((p, i) => {
|
|
23321
|
+
if (p !== GLOBSTAR || pattern[i - 1] === GLOBSTAR) {
|
|
23322
|
+
return;
|
|
23323
|
+
}
|
|
23324
|
+
if (i === 0) {
|
|
23325
|
+
if (pattern.length > 1) {
|
|
23326
|
+
pattern[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + pattern[i + 1];
|
|
23327
|
+
} else {
|
|
23328
|
+
pattern[i] = twoStar;
|
|
23329
|
+
}
|
|
23330
|
+
} else if (i === pattern.length - 1) {
|
|
23331
|
+
pattern[i - 1] += "(?:\\/|" + twoStar + ")?";
|
|
23332
|
+
} else {
|
|
23333
|
+
pattern[i - 1] += "(?:\\/|\\/" + twoStar + "\\/)" + pattern[i + 1];
|
|
23334
|
+
pattern[i + 1] = GLOBSTAR;
|
|
23335
|
+
}
|
|
23336
|
+
});
|
|
23337
|
+
return pattern.filter((p) => p !== GLOBSTAR).join("/");
|
|
23338
|
+
}).join("|");
|
|
23339
|
+
re = "^(?:" + re + ")$";
|
|
23340
|
+
if (this.negate)
|
|
23341
|
+
re = "^(?!" + re + ").*$";
|
|
23342
|
+
try {
|
|
23343
|
+
this.regexp = new RegExp(re, flags);
|
|
23344
|
+
} catch (ex) {
|
|
23345
|
+
this.regexp = false;
|
|
23346
|
+
}
|
|
23347
|
+
return this.regexp;
|
|
23348
|
+
}
|
|
23349
|
+
match(f, partial = this.partial) {
|
|
23350
|
+
this.debug("match", f, this.pattern);
|
|
23351
|
+
if (this.comment)
|
|
23352
|
+
return false;
|
|
23353
|
+
if (this.empty)
|
|
23354
|
+
return f === "";
|
|
23355
|
+
if (f === "/" && partial)
|
|
23356
|
+
return true;
|
|
23357
|
+
const options = this.options;
|
|
23358
|
+
if (path4.sep !== "/") {
|
|
23359
|
+
f = f.split(path4.sep).join("/");
|
|
23360
|
+
}
|
|
23361
|
+
f = f.split(slashSplit);
|
|
23362
|
+
this.debug(this.pattern, "split", f);
|
|
23363
|
+
const set = this.set;
|
|
23364
|
+
this.debug(this.pattern, "set", set);
|
|
23365
|
+
let filename;
|
|
23366
|
+
for (let i = f.length - 1; i >= 0; i--) {
|
|
23367
|
+
filename = f[i];
|
|
23368
|
+
if (filename)
|
|
23369
|
+
break;
|
|
23370
|
+
}
|
|
23371
|
+
for (let i = 0; i < set.length; i++) {
|
|
23372
|
+
const pattern = set[i];
|
|
23373
|
+
let file = f;
|
|
23374
|
+
if (options.matchBase && pattern.length === 1) {
|
|
23375
|
+
file = [filename];
|
|
23376
|
+
}
|
|
23377
|
+
const hit = this.matchOne(file, pattern, partial);
|
|
23378
|
+
if (hit) {
|
|
23379
|
+
if (options.flipNegate)
|
|
23380
|
+
return true;
|
|
23381
|
+
return !this.negate;
|
|
23382
|
+
}
|
|
23383
|
+
}
|
|
23384
|
+
if (options.flipNegate)
|
|
23385
|
+
return false;
|
|
23386
|
+
return this.negate;
|
|
23387
|
+
}
|
|
23388
|
+
static defaults(def) {
|
|
23389
|
+
return minimatch.defaults(def).Minimatch;
|
|
23390
|
+
}
|
|
23391
|
+
};
|
|
23392
|
+
minimatch.Minimatch = Minimatch;
|
|
23393
|
+
}
|
|
23394
|
+
});
|
|
23395
|
+
|
|
23396
|
+
// node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js
|
|
23397
|
+
var require_inherits_browser = __commonJS({
|
|
23398
|
+
"node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js"(exports, module2) {
|
|
23399
|
+
if (typeof Object.create === "function") {
|
|
23400
|
+
module2.exports = function inherits(ctor, superCtor) {
|
|
23401
|
+
if (superCtor) {
|
|
23402
|
+
ctor.super_ = superCtor;
|
|
23403
|
+
ctor.prototype = Object.create(superCtor.prototype, {
|
|
23404
|
+
constructor: {
|
|
23405
|
+
value: ctor,
|
|
23406
|
+
enumerable: false,
|
|
23407
|
+
writable: true,
|
|
23408
|
+
configurable: true
|
|
23409
|
+
}
|
|
23410
|
+
});
|
|
23411
|
+
}
|
|
23412
|
+
};
|
|
23413
|
+
} else {
|
|
23414
|
+
module2.exports = function inherits(ctor, superCtor) {
|
|
23415
|
+
if (superCtor) {
|
|
23416
|
+
ctor.super_ = superCtor;
|
|
23417
|
+
var TempCtor = function() {
|
|
23418
|
+
};
|
|
23419
|
+
TempCtor.prototype = superCtor.prototype;
|
|
23420
|
+
ctor.prototype = new TempCtor();
|
|
23421
|
+
ctor.prototype.constructor = ctor;
|
|
23422
|
+
}
|
|
23423
|
+
};
|
|
23424
|
+
}
|
|
23425
|
+
}
|
|
23426
|
+
});
|
|
23427
|
+
|
|
23428
|
+
// node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js
|
|
23429
|
+
var require_inherits = __commonJS({
|
|
23430
|
+
"node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js"(exports, module2) {
|
|
23431
|
+
try {
|
|
23432
|
+
util2 = require("util");
|
|
23433
|
+
if (typeof util2.inherits !== "function")
|
|
23434
|
+
throw "";
|
|
23435
|
+
module2.exports = util2.inherits;
|
|
23436
|
+
} catch (e) {
|
|
23437
|
+
module2.exports = require_inherits_browser();
|
|
23438
|
+
}
|
|
23439
|
+
var util2;
|
|
23440
|
+
}
|
|
23441
|
+
});
|
|
23442
|
+
|
|
23443
|
+
// node_modules/.pnpm/glob@8.1.0/node_modules/glob/common.js
|
|
23444
|
+
var require_common2 = __commonJS({
|
|
23445
|
+
"node_modules/.pnpm/glob@8.1.0/node_modules/glob/common.js"(exports) {
|
|
23446
|
+
exports.setopts = setopts;
|
|
23447
|
+
exports.ownProp = ownProp;
|
|
23448
|
+
exports.makeAbs = makeAbs;
|
|
23449
|
+
exports.finish = finish;
|
|
23450
|
+
exports.mark = mark;
|
|
23451
|
+
exports.isIgnored = isIgnored;
|
|
23452
|
+
exports.childrenIgnored = childrenIgnored;
|
|
23453
|
+
function ownProp(obj, field) {
|
|
23454
|
+
return Object.prototype.hasOwnProperty.call(obj, field);
|
|
23455
|
+
}
|
|
23456
|
+
var fs7 = require("fs");
|
|
23457
|
+
var path4 = require("path");
|
|
23458
|
+
var minimatch = require_minimatch();
|
|
23459
|
+
var isAbsolute = require("path").isAbsolute;
|
|
23460
|
+
var Minimatch = minimatch.Minimatch;
|
|
23461
|
+
function alphasort(a, b) {
|
|
23462
|
+
return a.localeCompare(b, "en");
|
|
23463
|
+
}
|
|
23464
|
+
function setupIgnores(self2, options) {
|
|
23465
|
+
self2.ignore = options.ignore || [];
|
|
23466
|
+
if (!Array.isArray(self2.ignore))
|
|
23467
|
+
self2.ignore = [self2.ignore];
|
|
23468
|
+
if (self2.ignore.length) {
|
|
23469
|
+
self2.ignore = self2.ignore.map(ignoreMap);
|
|
23470
|
+
}
|
|
23471
|
+
}
|
|
23472
|
+
function ignoreMap(pattern) {
|
|
23473
|
+
var gmatcher = null;
|
|
23474
|
+
if (pattern.slice(-3) === "/**") {
|
|
23475
|
+
var gpattern = pattern.replace(/(\/\*\*)+$/, "");
|
|
23476
|
+
gmatcher = new Minimatch(gpattern, { dot: true });
|
|
23477
|
+
}
|
|
23478
|
+
return {
|
|
23479
|
+
matcher: new Minimatch(pattern, { dot: true }),
|
|
23480
|
+
gmatcher
|
|
23481
|
+
};
|
|
23482
|
+
}
|
|
23483
|
+
function setopts(self2, pattern, options) {
|
|
23484
|
+
if (!options)
|
|
23485
|
+
options = {};
|
|
23486
|
+
if (options.matchBase && -1 === pattern.indexOf("/")) {
|
|
23487
|
+
if (options.noglobstar) {
|
|
23488
|
+
throw new Error("base matching requires globstar");
|
|
23489
|
+
}
|
|
23490
|
+
pattern = "**/" + pattern;
|
|
23491
|
+
}
|
|
23492
|
+
self2.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
23493
|
+
if (self2.windowsPathsNoEscape) {
|
|
23494
|
+
pattern = pattern.replace(/\\/g, "/");
|
|
23495
|
+
}
|
|
23496
|
+
self2.silent = !!options.silent;
|
|
23497
|
+
self2.pattern = pattern;
|
|
23498
|
+
self2.strict = options.strict !== false;
|
|
23499
|
+
self2.realpath = !!options.realpath;
|
|
23500
|
+
self2.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null);
|
|
23501
|
+
self2.follow = !!options.follow;
|
|
23502
|
+
self2.dot = !!options.dot;
|
|
23503
|
+
self2.mark = !!options.mark;
|
|
23504
|
+
self2.nodir = !!options.nodir;
|
|
23505
|
+
if (self2.nodir)
|
|
23506
|
+
self2.mark = true;
|
|
23507
|
+
self2.sync = !!options.sync;
|
|
23508
|
+
self2.nounique = !!options.nounique;
|
|
23509
|
+
self2.nonull = !!options.nonull;
|
|
23510
|
+
self2.nosort = !!options.nosort;
|
|
23511
|
+
self2.nocase = !!options.nocase;
|
|
23512
|
+
self2.stat = !!options.stat;
|
|
23513
|
+
self2.noprocess = !!options.noprocess;
|
|
23514
|
+
self2.absolute = !!options.absolute;
|
|
23515
|
+
self2.fs = options.fs || fs7;
|
|
23516
|
+
self2.maxLength = options.maxLength || Infinity;
|
|
23517
|
+
self2.cache = options.cache || /* @__PURE__ */ Object.create(null);
|
|
23518
|
+
self2.statCache = options.statCache || /* @__PURE__ */ Object.create(null);
|
|
23519
|
+
self2.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null);
|
|
23520
|
+
setupIgnores(self2, options);
|
|
23521
|
+
self2.changedCwd = false;
|
|
23522
|
+
var cwd = process.cwd();
|
|
23523
|
+
if (!ownProp(options, "cwd"))
|
|
23524
|
+
self2.cwd = path4.resolve(cwd);
|
|
23525
|
+
else {
|
|
23526
|
+
self2.cwd = path4.resolve(options.cwd);
|
|
23527
|
+
self2.changedCwd = self2.cwd !== cwd;
|
|
23528
|
+
}
|
|
23529
|
+
self2.root = options.root || path4.resolve(self2.cwd, "/");
|
|
23530
|
+
self2.root = path4.resolve(self2.root);
|
|
23531
|
+
self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
|
|
23532
|
+
self2.nomount = !!options.nomount;
|
|
23533
|
+
if (process.platform === "win32") {
|
|
23534
|
+
self2.root = self2.root.replace(/\\/g, "/");
|
|
23535
|
+
self2.cwd = self2.cwd.replace(/\\/g, "/");
|
|
23536
|
+
self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/");
|
|
23537
|
+
}
|
|
23538
|
+
options.nonegate = true;
|
|
23539
|
+
options.nocomment = true;
|
|
23540
|
+
self2.minimatch = new Minimatch(pattern, options);
|
|
23541
|
+
self2.options = self2.minimatch.options;
|
|
23542
|
+
}
|
|
23543
|
+
function finish(self2) {
|
|
23544
|
+
var nou = self2.nounique;
|
|
23545
|
+
var all = nou ? [] : /* @__PURE__ */ Object.create(null);
|
|
23546
|
+
for (var i = 0, l = self2.matches.length; i < l; i++) {
|
|
23547
|
+
var matches = self2.matches[i];
|
|
23548
|
+
if (!matches || Object.keys(matches).length === 0) {
|
|
23549
|
+
if (self2.nonull) {
|
|
23550
|
+
var literal = self2.minimatch.globSet[i];
|
|
23551
|
+
if (nou)
|
|
23552
|
+
all.push(literal);
|
|
23553
|
+
else
|
|
23554
|
+
all[literal] = true;
|
|
23555
|
+
}
|
|
23556
|
+
} else {
|
|
23557
|
+
var m = Object.keys(matches);
|
|
23558
|
+
if (nou)
|
|
23559
|
+
all.push.apply(all, m);
|
|
23560
|
+
else
|
|
23561
|
+
m.forEach(function(m2) {
|
|
23562
|
+
all[m2] = true;
|
|
23563
|
+
});
|
|
23564
|
+
}
|
|
23565
|
+
}
|
|
23566
|
+
if (!nou)
|
|
23567
|
+
all = Object.keys(all);
|
|
23568
|
+
if (!self2.nosort)
|
|
23569
|
+
all = all.sort(alphasort);
|
|
23570
|
+
if (self2.mark) {
|
|
23571
|
+
for (var i = 0; i < all.length; i++) {
|
|
23572
|
+
all[i] = self2._mark(all[i]);
|
|
23573
|
+
}
|
|
23574
|
+
if (self2.nodir) {
|
|
23575
|
+
all = all.filter(function(e) {
|
|
23576
|
+
var notDir = !/\/$/.test(e);
|
|
23577
|
+
var c = self2.cache[e] || self2.cache[makeAbs(self2, e)];
|
|
23578
|
+
if (notDir && c)
|
|
23579
|
+
notDir = c !== "DIR" && !Array.isArray(c);
|
|
23580
|
+
return notDir;
|
|
23581
|
+
});
|
|
23582
|
+
}
|
|
23583
|
+
}
|
|
23584
|
+
if (self2.ignore.length)
|
|
23585
|
+
all = all.filter(function(m2) {
|
|
23586
|
+
return !isIgnored(self2, m2);
|
|
23587
|
+
});
|
|
23588
|
+
self2.found = all;
|
|
23589
|
+
}
|
|
23590
|
+
function mark(self2, p) {
|
|
23591
|
+
var abs = makeAbs(self2, p);
|
|
23592
|
+
var c = self2.cache[abs];
|
|
23593
|
+
var m = p;
|
|
23594
|
+
if (c) {
|
|
23595
|
+
var isDir = c === "DIR" || Array.isArray(c);
|
|
23596
|
+
var slash = p.slice(-1) === "/";
|
|
23597
|
+
if (isDir && !slash)
|
|
23598
|
+
m += "/";
|
|
23599
|
+
else if (!isDir && slash)
|
|
23600
|
+
m = m.slice(0, -1);
|
|
23601
|
+
if (m !== p) {
|
|
23602
|
+
var mabs = makeAbs(self2, m);
|
|
23603
|
+
self2.statCache[mabs] = self2.statCache[abs];
|
|
23604
|
+
self2.cache[mabs] = self2.cache[abs];
|
|
23605
|
+
}
|
|
23606
|
+
}
|
|
23607
|
+
return m;
|
|
23608
|
+
}
|
|
23609
|
+
function makeAbs(self2, f) {
|
|
23610
|
+
var abs = f;
|
|
23611
|
+
if (f.charAt(0) === "/") {
|
|
23612
|
+
abs = path4.join(self2.root, f);
|
|
23613
|
+
} else if (isAbsolute(f) || f === "") {
|
|
23614
|
+
abs = f;
|
|
23615
|
+
} else if (self2.changedCwd) {
|
|
23616
|
+
abs = path4.resolve(self2.cwd, f);
|
|
23617
|
+
} else {
|
|
23618
|
+
abs = path4.resolve(f);
|
|
23619
|
+
}
|
|
23620
|
+
if (process.platform === "win32")
|
|
23621
|
+
abs = abs.replace(/\\/g, "/");
|
|
23622
|
+
return abs;
|
|
23623
|
+
}
|
|
23624
|
+
function isIgnored(self2, path5) {
|
|
23625
|
+
if (!self2.ignore.length)
|
|
23626
|
+
return false;
|
|
23627
|
+
return self2.ignore.some(function(item) {
|
|
23628
|
+
return item.matcher.match(path5) || !!(item.gmatcher && item.gmatcher.match(path5));
|
|
23629
|
+
});
|
|
23630
|
+
}
|
|
23631
|
+
function childrenIgnored(self2, path5) {
|
|
23632
|
+
if (!self2.ignore.length)
|
|
23633
|
+
return false;
|
|
23634
|
+
return self2.ignore.some(function(item) {
|
|
23635
|
+
return !!(item.gmatcher && item.gmatcher.match(path5));
|
|
23636
|
+
});
|
|
23637
|
+
}
|
|
23638
|
+
}
|
|
23639
|
+
});
|
|
23640
|
+
|
|
23641
|
+
// node_modules/.pnpm/glob@8.1.0/node_modules/glob/sync.js
|
|
23642
|
+
var require_sync = __commonJS({
|
|
23643
|
+
"node_modules/.pnpm/glob@8.1.0/node_modules/glob/sync.js"(exports, module2) {
|
|
23644
|
+
module2.exports = globSync;
|
|
23645
|
+
globSync.GlobSync = GlobSync;
|
|
23646
|
+
var rp = require_fs();
|
|
23647
|
+
var minimatch = require_minimatch();
|
|
23648
|
+
var Minimatch = minimatch.Minimatch;
|
|
23649
|
+
var Glob = require_glob().Glob;
|
|
23650
|
+
var util2 = require("util");
|
|
23651
|
+
var path4 = require("path");
|
|
23652
|
+
var assert = require("assert");
|
|
23653
|
+
var isAbsolute = require("path").isAbsolute;
|
|
23654
|
+
var common = require_common2();
|
|
23655
|
+
var setopts = common.setopts;
|
|
23656
|
+
var ownProp = common.ownProp;
|
|
23657
|
+
var childrenIgnored = common.childrenIgnored;
|
|
23658
|
+
var isIgnored = common.isIgnored;
|
|
23659
|
+
function globSync(pattern, options) {
|
|
23660
|
+
if (typeof options === "function" || arguments.length === 3)
|
|
23661
|
+
throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
|
|
23662
|
+
return new GlobSync(pattern, options).found;
|
|
23663
|
+
}
|
|
23664
|
+
function GlobSync(pattern, options) {
|
|
23665
|
+
if (!pattern)
|
|
23666
|
+
throw new Error("must provide pattern");
|
|
23667
|
+
if (typeof options === "function" || arguments.length === 3)
|
|
23668
|
+
throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
|
|
23669
|
+
if (!(this instanceof GlobSync))
|
|
23670
|
+
return new GlobSync(pattern, options);
|
|
23671
|
+
setopts(this, pattern, options);
|
|
23672
|
+
if (this.noprocess)
|
|
23673
|
+
return this;
|
|
23674
|
+
var n = this.minimatch.set.length;
|
|
23675
|
+
this.matches = new Array(n);
|
|
23676
|
+
for (var i = 0; i < n; i++) {
|
|
23677
|
+
this._process(this.minimatch.set[i], i, false);
|
|
23678
|
+
}
|
|
23679
|
+
this._finish();
|
|
23680
|
+
}
|
|
23681
|
+
GlobSync.prototype._finish = function() {
|
|
23682
|
+
assert.ok(this instanceof GlobSync);
|
|
23683
|
+
if (this.realpath) {
|
|
23684
|
+
var self2 = this;
|
|
23685
|
+
this.matches.forEach(function(matchset, index4) {
|
|
23686
|
+
var set = self2.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
23687
|
+
for (var p in matchset) {
|
|
23688
|
+
try {
|
|
23689
|
+
p = self2._makeAbs(p);
|
|
23690
|
+
var real = rp.realpathSync(p, self2.realpathCache);
|
|
23691
|
+
set[real] = true;
|
|
23692
|
+
} catch (er) {
|
|
23693
|
+
if (er.syscall === "stat")
|
|
23694
|
+
set[self2._makeAbs(p)] = true;
|
|
23695
|
+
else
|
|
23696
|
+
throw er;
|
|
23697
|
+
}
|
|
23698
|
+
}
|
|
23699
|
+
});
|
|
23700
|
+
}
|
|
23701
|
+
common.finish(this);
|
|
23702
|
+
};
|
|
23703
|
+
GlobSync.prototype._process = function(pattern, index4, inGlobStar) {
|
|
23704
|
+
assert.ok(this instanceof GlobSync);
|
|
23705
|
+
var n = 0;
|
|
23706
|
+
while (typeof pattern[n] === "string") {
|
|
23707
|
+
n++;
|
|
23708
|
+
}
|
|
23709
|
+
var prefix;
|
|
23710
|
+
switch (n) {
|
|
23711
|
+
case pattern.length:
|
|
23712
|
+
this._processSimple(pattern.join("/"), index4);
|
|
23713
|
+
return;
|
|
23714
|
+
case 0:
|
|
23715
|
+
prefix = null;
|
|
23716
|
+
break;
|
|
23717
|
+
default:
|
|
23718
|
+
prefix = pattern.slice(0, n).join("/");
|
|
23719
|
+
break;
|
|
23720
|
+
}
|
|
23721
|
+
var remain = pattern.slice(n);
|
|
23722
|
+
var read;
|
|
23723
|
+
if (prefix === null)
|
|
23724
|
+
read = ".";
|
|
23725
|
+
else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
|
|
23726
|
+
return typeof p === "string" ? p : "[*]";
|
|
23727
|
+
}).join("/"))) {
|
|
23728
|
+
if (!prefix || !isAbsolute(prefix))
|
|
23729
|
+
prefix = "/" + prefix;
|
|
23730
|
+
read = prefix;
|
|
23731
|
+
} else
|
|
23732
|
+
read = prefix;
|
|
23733
|
+
var abs = this._makeAbs(read);
|
|
23734
|
+
if (childrenIgnored(this, read))
|
|
23735
|
+
return;
|
|
23736
|
+
var isGlobStar = remain[0] === minimatch.GLOBSTAR;
|
|
23737
|
+
if (isGlobStar)
|
|
23738
|
+
this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar);
|
|
23739
|
+
else
|
|
23740
|
+
this._processReaddir(prefix, read, abs, remain, index4, inGlobStar);
|
|
23741
|
+
};
|
|
23742
|
+
GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar) {
|
|
23743
|
+
var entries = this._readdir(abs, inGlobStar);
|
|
23744
|
+
if (!entries)
|
|
23745
|
+
return;
|
|
23746
|
+
var pn = remain[0];
|
|
23747
|
+
var negate = !!this.minimatch.negate;
|
|
23748
|
+
var rawGlob = pn._glob;
|
|
23749
|
+
var dotOk = this.dot || rawGlob.charAt(0) === ".";
|
|
23750
|
+
var matchedEntries = [];
|
|
23751
|
+
for (var i = 0; i < entries.length; i++) {
|
|
23752
|
+
var e = entries[i];
|
|
23753
|
+
if (e.charAt(0) !== "." || dotOk) {
|
|
23754
|
+
var m;
|
|
23755
|
+
if (negate && !prefix) {
|
|
23756
|
+
m = !e.match(pn);
|
|
23757
|
+
} else {
|
|
23758
|
+
m = e.match(pn);
|
|
23759
|
+
}
|
|
23760
|
+
if (m)
|
|
23761
|
+
matchedEntries.push(e);
|
|
23762
|
+
}
|
|
23763
|
+
}
|
|
23764
|
+
var len = matchedEntries.length;
|
|
23765
|
+
if (len === 0)
|
|
23766
|
+
return;
|
|
23767
|
+
if (remain.length === 1 && !this.mark && !this.stat) {
|
|
23768
|
+
if (!this.matches[index4])
|
|
23769
|
+
this.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
23770
|
+
for (var i = 0; i < len; i++) {
|
|
23771
|
+
var e = matchedEntries[i];
|
|
23772
|
+
if (prefix) {
|
|
23773
|
+
if (prefix.slice(-1) !== "/")
|
|
23774
|
+
e = prefix + "/" + e;
|
|
23775
|
+
else
|
|
23776
|
+
e = prefix + e;
|
|
23777
|
+
}
|
|
23778
|
+
if (e.charAt(0) === "/" && !this.nomount) {
|
|
23779
|
+
e = path4.join(this.root, e);
|
|
23780
|
+
}
|
|
23781
|
+
this._emitMatch(index4, e);
|
|
23782
|
+
}
|
|
23783
|
+
return;
|
|
23784
|
+
}
|
|
23785
|
+
remain.shift();
|
|
23786
|
+
for (var i = 0; i < len; i++) {
|
|
23787
|
+
var e = matchedEntries[i];
|
|
23788
|
+
var newPattern;
|
|
23789
|
+
if (prefix)
|
|
23790
|
+
newPattern = [prefix, e];
|
|
23791
|
+
else
|
|
23792
|
+
newPattern = [e];
|
|
23793
|
+
this._process(newPattern.concat(remain), index4, inGlobStar);
|
|
23794
|
+
}
|
|
23795
|
+
};
|
|
23796
|
+
GlobSync.prototype._emitMatch = function(index4, e) {
|
|
23797
|
+
if (isIgnored(this, e))
|
|
23798
|
+
return;
|
|
23799
|
+
var abs = this._makeAbs(e);
|
|
23800
|
+
if (this.mark)
|
|
23801
|
+
e = this._mark(e);
|
|
23802
|
+
if (this.absolute) {
|
|
23803
|
+
e = abs;
|
|
23804
|
+
}
|
|
23805
|
+
if (this.matches[index4][e])
|
|
23806
|
+
return;
|
|
23807
|
+
if (this.nodir) {
|
|
23808
|
+
var c = this.cache[abs];
|
|
23809
|
+
if (c === "DIR" || Array.isArray(c))
|
|
23810
|
+
return;
|
|
23811
|
+
}
|
|
23812
|
+
this.matches[index4][e] = true;
|
|
23813
|
+
if (this.stat)
|
|
23814
|
+
this._stat(e);
|
|
23815
|
+
};
|
|
23816
|
+
GlobSync.prototype._readdirInGlobStar = function(abs) {
|
|
23817
|
+
if (this.follow)
|
|
23818
|
+
return this._readdir(abs, false);
|
|
23819
|
+
var entries;
|
|
23820
|
+
var lstat;
|
|
23821
|
+
var stat;
|
|
23822
|
+
try {
|
|
23823
|
+
lstat = this.fs.lstatSync(abs);
|
|
23824
|
+
} catch (er) {
|
|
23825
|
+
if (er.code === "ENOENT") {
|
|
23826
|
+
return null;
|
|
23827
|
+
}
|
|
23828
|
+
}
|
|
23829
|
+
var isSym = lstat && lstat.isSymbolicLink();
|
|
23830
|
+
this.symlinks[abs] = isSym;
|
|
23831
|
+
if (!isSym && lstat && !lstat.isDirectory())
|
|
23832
|
+
this.cache[abs] = "FILE";
|
|
23833
|
+
else
|
|
23834
|
+
entries = this._readdir(abs, false);
|
|
23835
|
+
return entries;
|
|
23836
|
+
};
|
|
23837
|
+
GlobSync.prototype._readdir = function(abs, inGlobStar) {
|
|
23838
|
+
var entries;
|
|
23839
|
+
if (inGlobStar && !ownProp(this.symlinks, abs))
|
|
23840
|
+
return this._readdirInGlobStar(abs);
|
|
23841
|
+
if (ownProp(this.cache, abs)) {
|
|
23842
|
+
var c = this.cache[abs];
|
|
23843
|
+
if (!c || c === "FILE")
|
|
23844
|
+
return null;
|
|
23845
|
+
if (Array.isArray(c))
|
|
23846
|
+
return c;
|
|
23847
|
+
}
|
|
23848
|
+
try {
|
|
23849
|
+
return this._readdirEntries(abs, this.fs.readdirSync(abs));
|
|
23850
|
+
} catch (er) {
|
|
23851
|
+
this._readdirError(abs, er);
|
|
23852
|
+
return null;
|
|
23853
|
+
}
|
|
23854
|
+
};
|
|
23855
|
+
GlobSync.prototype._readdirEntries = function(abs, entries) {
|
|
23856
|
+
if (!this.mark && !this.stat) {
|
|
23857
|
+
for (var i = 0; i < entries.length; i++) {
|
|
23858
|
+
var e = entries[i];
|
|
23859
|
+
if (abs === "/")
|
|
23860
|
+
e = abs + e;
|
|
23861
|
+
else
|
|
23862
|
+
e = abs + "/" + e;
|
|
23863
|
+
this.cache[e] = true;
|
|
23864
|
+
}
|
|
23865
|
+
}
|
|
23866
|
+
this.cache[abs] = entries;
|
|
23867
|
+
return entries;
|
|
23868
|
+
};
|
|
23869
|
+
GlobSync.prototype._readdirError = function(f, er) {
|
|
23870
|
+
switch (er.code) {
|
|
23871
|
+
case "ENOTSUP":
|
|
23872
|
+
case "ENOTDIR":
|
|
23873
|
+
var abs = this._makeAbs(f);
|
|
23874
|
+
this.cache[abs] = "FILE";
|
|
23875
|
+
if (abs === this.cwdAbs) {
|
|
23876
|
+
var error2 = new Error(er.code + " invalid cwd " + this.cwd);
|
|
23877
|
+
error2.path = this.cwd;
|
|
23878
|
+
error2.code = er.code;
|
|
23879
|
+
throw error2;
|
|
23880
|
+
}
|
|
23881
|
+
break;
|
|
23882
|
+
case "ENOENT":
|
|
23883
|
+
case "ELOOP":
|
|
23884
|
+
case "ENAMETOOLONG":
|
|
23885
|
+
case "UNKNOWN":
|
|
23886
|
+
this.cache[this._makeAbs(f)] = false;
|
|
23887
|
+
break;
|
|
23888
|
+
default:
|
|
23889
|
+
this.cache[this._makeAbs(f)] = false;
|
|
23890
|
+
if (this.strict)
|
|
23891
|
+
throw er;
|
|
23892
|
+
if (!this.silent)
|
|
23893
|
+
console.error("glob error", er);
|
|
23894
|
+
break;
|
|
23895
|
+
}
|
|
23896
|
+
};
|
|
23897
|
+
GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar) {
|
|
23898
|
+
var entries = this._readdir(abs, inGlobStar);
|
|
23899
|
+
if (!entries)
|
|
23900
|
+
return;
|
|
23901
|
+
var remainWithoutGlobStar = remain.slice(1);
|
|
23902
|
+
var gspref = prefix ? [prefix] : [];
|
|
23903
|
+
var noGlobStar = gspref.concat(remainWithoutGlobStar);
|
|
23904
|
+
this._process(noGlobStar, index4, false);
|
|
23905
|
+
var len = entries.length;
|
|
23906
|
+
var isSym = this.symlinks[abs];
|
|
23907
|
+
if (isSym && inGlobStar)
|
|
23908
|
+
return;
|
|
23909
|
+
for (var i = 0; i < len; i++) {
|
|
23910
|
+
var e = entries[i];
|
|
23911
|
+
if (e.charAt(0) === "." && !this.dot)
|
|
23912
|
+
continue;
|
|
23913
|
+
var instead = gspref.concat(entries[i], remainWithoutGlobStar);
|
|
23914
|
+
this._process(instead, index4, true);
|
|
23915
|
+
var below = gspref.concat(entries[i], remain);
|
|
23916
|
+
this._process(below, index4, true);
|
|
23917
|
+
}
|
|
23918
|
+
};
|
|
23919
|
+
GlobSync.prototype._processSimple = function(prefix, index4) {
|
|
23920
|
+
var exists = this._stat(prefix);
|
|
23921
|
+
if (!this.matches[index4])
|
|
23922
|
+
this.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
23923
|
+
if (!exists)
|
|
23924
|
+
return;
|
|
23925
|
+
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
|
23926
|
+
var trail = /[\/\\]$/.test(prefix);
|
|
23927
|
+
if (prefix.charAt(0) === "/") {
|
|
23928
|
+
prefix = path4.join(this.root, prefix);
|
|
23929
|
+
} else {
|
|
23930
|
+
prefix = path4.resolve(this.root, prefix);
|
|
23931
|
+
if (trail)
|
|
23932
|
+
prefix += "/";
|
|
23933
|
+
}
|
|
23934
|
+
}
|
|
23935
|
+
if (process.platform === "win32")
|
|
23936
|
+
prefix = prefix.replace(/\\/g, "/");
|
|
23937
|
+
this._emitMatch(index4, prefix);
|
|
23938
|
+
};
|
|
23939
|
+
GlobSync.prototype._stat = function(f) {
|
|
23940
|
+
var abs = this._makeAbs(f);
|
|
23941
|
+
var needDir = f.slice(-1) === "/";
|
|
23942
|
+
if (f.length > this.maxLength)
|
|
23943
|
+
return false;
|
|
23944
|
+
if (!this.stat && ownProp(this.cache, abs)) {
|
|
23945
|
+
var c = this.cache[abs];
|
|
23946
|
+
if (Array.isArray(c))
|
|
23947
|
+
c = "DIR";
|
|
23948
|
+
if (!needDir || c === "DIR")
|
|
23949
|
+
return c;
|
|
23950
|
+
if (needDir && c === "FILE")
|
|
23951
|
+
return false;
|
|
23952
|
+
}
|
|
23953
|
+
var exists;
|
|
23954
|
+
var stat = this.statCache[abs];
|
|
23955
|
+
if (!stat) {
|
|
23956
|
+
var lstat;
|
|
23957
|
+
try {
|
|
23958
|
+
lstat = this.fs.lstatSync(abs);
|
|
23959
|
+
} catch (er) {
|
|
23960
|
+
if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
|
|
23961
|
+
this.statCache[abs] = false;
|
|
23962
|
+
return false;
|
|
23963
|
+
}
|
|
23964
|
+
}
|
|
23965
|
+
if (lstat && lstat.isSymbolicLink()) {
|
|
23966
|
+
try {
|
|
23967
|
+
stat = this.fs.statSync(abs);
|
|
23968
|
+
} catch (er) {
|
|
23969
|
+
stat = lstat;
|
|
23970
|
+
}
|
|
23971
|
+
} else {
|
|
23972
|
+
stat = lstat;
|
|
23973
|
+
}
|
|
23974
|
+
}
|
|
23975
|
+
this.statCache[abs] = stat;
|
|
23976
|
+
var c = true;
|
|
23977
|
+
if (stat)
|
|
23978
|
+
c = stat.isDirectory() ? "DIR" : "FILE";
|
|
23979
|
+
this.cache[abs] = this.cache[abs] || c;
|
|
23980
|
+
if (needDir && c === "FILE")
|
|
23981
|
+
return false;
|
|
23982
|
+
return c;
|
|
23983
|
+
};
|
|
23984
|
+
GlobSync.prototype._mark = function(p) {
|
|
23985
|
+
return common.mark(this, p);
|
|
23986
|
+
};
|
|
23987
|
+
GlobSync.prototype._makeAbs = function(f) {
|
|
23988
|
+
return common.makeAbs(this, f);
|
|
23989
|
+
};
|
|
23990
|
+
}
|
|
23991
|
+
});
|
|
23992
|
+
|
|
23993
|
+
// node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
|
|
23994
|
+
var require_wrappy = __commonJS({
|
|
23995
|
+
"node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports, module2) {
|
|
23996
|
+
module2.exports = wrappy;
|
|
23997
|
+
function wrappy(fn, cb) {
|
|
23998
|
+
if (fn && cb)
|
|
23999
|
+
return wrappy(fn)(cb);
|
|
24000
|
+
if (typeof fn !== "function")
|
|
24001
|
+
throw new TypeError("need wrapper function");
|
|
24002
|
+
Object.keys(fn).forEach(function(k) {
|
|
24003
|
+
wrapper[k] = fn[k];
|
|
24004
|
+
});
|
|
24005
|
+
return wrapper;
|
|
24006
|
+
function wrapper() {
|
|
24007
|
+
var args = new Array(arguments.length);
|
|
24008
|
+
for (var i = 0; i < args.length; i++) {
|
|
24009
|
+
args[i] = arguments[i];
|
|
24010
|
+
}
|
|
24011
|
+
var ret = fn.apply(this, args);
|
|
24012
|
+
var cb2 = args[args.length - 1];
|
|
24013
|
+
if (typeof ret === "function" && ret !== cb2) {
|
|
24014
|
+
Object.keys(cb2).forEach(function(k) {
|
|
24015
|
+
ret[k] = cb2[k];
|
|
24016
|
+
});
|
|
24017
|
+
}
|
|
24018
|
+
return ret;
|
|
24019
|
+
}
|
|
24020
|
+
}
|
|
24021
|
+
}
|
|
24022
|
+
});
|
|
24023
|
+
|
|
24024
|
+
// node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
|
|
24025
|
+
var require_once = __commonJS({
|
|
24026
|
+
"node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports, module2) {
|
|
24027
|
+
var wrappy = require_wrappy();
|
|
24028
|
+
module2.exports = wrappy(once);
|
|
24029
|
+
module2.exports.strict = wrappy(onceStrict);
|
|
24030
|
+
once.proto = once(function() {
|
|
24031
|
+
Object.defineProperty(Function.prototype, "once", {
|
|
24032
|
+
value: function() {
|
|
24033
|
+
return once(this);
|
|
24034
|
+
},
|
|
24035
|
+
configurable: true
|
|
24036
|
+
});
|
|
24037
|
+
Object.defineProperty(Function.prototype, "onceStrict", {
|
|
24038
|
+
value: function() {
|
|
24039
|
+
return onceStrict(this);
|
|
24040
|
+
},
|
|
24041
|
+
configurable: true
|
|
24042
|
+
});
|
|
24043
|
+
});
|
|
24044
|
+
function once(fn) {
|
|
24045
|
+
var f = function() {
|
|
24046
|
+
if (f.called)
|
|
24047
|
+
return f.value;
|
|
24048
|
+
f.called = true;
|
|
24049
|
+
return f.value = fn.apply(this, arguments);
|
|
24050
|
+
};
|
|
24051
|
+
f.called = false;
|
|
24052
|
+
return f;
|
|
24053
|
+
}
|
|
24054
|
+
function onceStrict(fn) {
|
|
24055
|
+
var f = function() {
|
|
24056
|
+
if (f.called)
|
|
24057
|
+
throw new Error(f.onceError);
|
|
24058
|
+
f.called = true;
|
|
24059
|
+
return f.value = fn.apply(this, arguments);
|
|
24060
|
+
};
|
|
24061
|
+
var name = fn.name || "Function wrapped with `once`";
|
|
24062
|
+
f.onceError = name + " shouldn't be called more than once";
|
|
24063
|
+
f.called = false;
|
|
24064
|
+
return f;
|
|
24065
|
+
}
|
|
24066
|
+
}
|
|
24067
|
+
});
|
|
24068
|
+
|
|
24069
|
+
// node_modules/.pnpm/inflight@1.0.6/node_modules/inflight/inflight.js
|
|
24070
|
+
var require_inflight = __commonJS({
|
|
24071
|
+
"node_modules/.pnpm/inflight@1.0.6/node_modules/inflight/inflight.js"(exports, module2) {
|
|
24072
|
+
var wrappy = require_wrappy();
|
|
24073
|
+
var reqs = /* @__PURE__ */ Object.create(null);
|
|
24074
|
+
var once = require_once();
|
|
24075
|
+
module2.exports = wrappy(inflight);
|
|
24076
|
+
function inflight(key, cb) {
|
|
24077
|
+
if (reqs[key]) {
|
|
24078
|
+
reqs[key].push(cb);
|
|
24079
|
+
return null;
|
|
24080
|
+
} else {
|
|
24081
|
+
reqs[key] = [cb];
|
|
24082
|
+
return makeres(key);
|
|
24083
|
+
}
|
|
24084
|
+
}
|
|
24085
|
+
function makeres(key) {
|
|
24086
|
+
return once(function RES() {
|
|
24087
|
+
var cbs = reqs[key];
|
|
24088
|
+
var len = cbs.length;
|
|
24089
|
+
var args = slice(arguments);
|
|
24090
|
+
try {
|
|
24091
|
+
for (var i = 0; i < len; i++) {
|
|
24092
|
+
cbs[i].apply(null, args);
|
|
24093
|
+
}
|
|
24094
|
+
} finally {
|
|
24095
|
+
if (cbs.length > len) {
|
|
24096
|
+
cbs.splice(0, len);
|
|
24097
|
+
process.nextTick(function() {
|
|
24098
|
+
RES.apply(null, args);
|
|
24099
|
+
});
|
|
24100
|
+
} else {
|
|
24101
|
+
delete reqs[key];
|
|
24102
|
+
}
|
|
24103
|
+
}
|
|
24104
|
+
});
|
|
24105
|
+
}
|
|
24106
|
+
function slice(args) {
|
|
24107
|
+
var length = args.length;
|
|
24108
|
+
var array = [];
|
|
24109
|
+
for (var i = 0; i < length; i++)
|
|
24110
|
+
array[i] = args[i];
|
|
24111
|
+
return array;
|
|
24112
|
+
}
|
|
24113
|
+
}
|
|
24114
|
+
});
|
|
24115
|
+
|
|
24116
|
+
// node_modules/.pnpm/glob@8.1.0/node_modules/glob/glob.js
|
|
24117
|
+
var require_glob = __commonJS({
|
|
24118
|
+
"node_modules/.pnpm/glob@8.1.0/node_modules/glob/glob.js"(exports, module2) {
|
|
24119
|
+
module2.exports = glob2;
|
|
24120
|
+
var rp = require_fs();
|
|
24121
|
+
var minimatch = require_minimatch();
|
|
24122
|
+
var Minimatch = minimatch.Minimatch;
|
|
24123
|
+
var inherits = require_inherits();
|
|
24124
|
+
var EE = require("events").EventEmitter;
|
|
24125
|
+
var path4 = require("path");
|
|
24126
|
+
var assert = require("assert");
|
|
24127
|
+
var isAbsolute = require("path").isAbsolute;
|
|
24128
|
+
var globSync = require_sync();
|
|
24129
|
+
var common = require_common2();
|
|
24130
|
+
var setopts = common.setopts;
|
|
24131
|
+
var ownProp = common.ownProp;
|
|
24132
|
+
var inflight = require_inflight();
|
|
24133
|
+
var util2 = require("util");
|
|
24134
|
+
var childrenIgnored = common.childrenIgnored;
|
|
24135
|
+
var isIgnored = common.isIgnored;
|
|
24136
|
+
var once = require_once();
|
|
24137
|
+
function glob2(pattern, options, cb) {
|
|
24138
|
+
if (typeof options === "function")
|
|
24139
|
+
cb = options, options = {};
|
|
24140
|
+
if (!options)
|
|
24141
|
+
options = {};
|
|
24142
|
+
if (options.sync) {
|
|
24143
|
+
if (cb)
|
|
24144
|
+
throw new TypeError("callback provided to sync glob");
|
|
24145
|
+
return globSync(pattern, options);
|
|
24146
|
+
}
|
|
24147
|
+
return new Glob(pattern, options, cb);
|
|
24148
|
+
}
|
|
24149
|
+
glob2.sync = globSync;
|
|
24150
|
+
var GlobSync = glob2.GlobSync = globSync.GlobSync;
|
|
24151
|
+
glob2.glob = glob2;
|
|
24152
|
+
function extend(origin, add) {
|
|
24153
|
+
if (add === null || typeof add !== "object") {
|
|
24154
|
+
return origin;
|
|
24155
|
+
}
|
|
24156
|
+
var keys = Object.keys(add);
|
|
24157
|
+
var i = keys.length;
|
|
24158
|
+
while (i--) {
|
|
24159
|
+
origin[keys[i]] = add[keys[i]];
|
|
24160
|
+
}
|
|
24161
|
+
return origin;
|
|
24162
|
+
}
|
|
24163
|
+
glob2.hasMagic = function(pattern, options_) {
|
|
24164
|
+
var options = extend({}, options_);
|
|
24165
|
+
options.noprocess = true;
|
|
24166
|
+
var g = new Glob(pattern, options);
|
|
24167
|
+
var set = g.minimatch.set;
|
|
24168
|
+
if (!pattern)
|
|
24169
|
+
return false;
|
|
24170
|
+
if (set.length > 1)
|
|
24171
|
+
return true;
|
|
24172
|
+
for (var j = 0; j < set[0].length; j++) {
|
|
24173
|
+
if (typeof set[0][j] !== "string")
|
|
24174
|
+
return true;
|
|
24175
|
+
}
|
|
24176
|
+
return false;
|
|
24177
|
+
};
|
|
24178
|
+
glob2.Glob = Glob;
|
|
24179
|
+
inherits(Glob, EE);
|
|
24180
|
+
function Glob(pattern, options, cb) {
|
|
24181
|
+
if (typeof options === "function") {
|
|
24182
|
+
cb = options;
|
|
24183
|
+
options = null;
|
|
24184
|
+
}
|
|
24185
|
+
if (options && options.sync) {
|
|
24186
|
+
if (cb)
|
|
24187
|
+
throw new TypeError("callback provided to sync glob");
|
|
24188
|
+
return new GlobSync(pattern, options);
|
|
24189
|
+
}
|
|
24190
|
+
if (!(this instanceof Glob))
|
|
24191
|
+
return new Glob(pattern, options, cb);
|
|
24192
|
+
setopts(this, pattern, options);
|
|
24193
|
+
this._didRealPath = false;
|
|
24194
|
+
var n = this.minimatch.set.length;
|
|
24195
|
+
this.matches = new Array(n);
|
|
24196
|
+
if (typeof cb === "function") {
|
|
24197
|
+
cb = once(cb);
|
|
24198
|
+
this.on("error", cb);
|
|
24199
|
+
this.on("end", function(matches) {
|
|
24200
|
+
cb(null, matches);
|
|
24201
|
+
});
|
|
24202
|
+
}
|
|
24203
|
+
var self2 = this;
|
|
24204
|
+
this._processing = 0;
|
|
24205
|
+
this._emitQueue = [];
|
|
24206
|
+
this._processQueue = [];
|
|
24207
|
+
this.paused = false;
|
|
24208
|
+
if (this.noprocess)
|
|
24209
|
+
return this;
|
|
24210
|
+
if (n === 0)
|
|
24211
|
+
return done();
|
|
24212
|
+
var sync = true;
|
|
24213
|
+
for (var i = 0; i < n; i++) {
|
|
24214
|
+
this._process(this.minimatch.set[i], i, false, done);
|
|
24215
|
+
}
|
|
24216
|
+
sync = false;
|
|
24217
|
+
function done() {
|
|
24218
|
+
--self2._processing;
|
|
24219
|
+
if (self2._processing <= 0) {
|
|
24220
|
+
if (sync) {
|
|
24221
|
+
process.nextTick(function() {
|
|
24222
|
+
self2._finish();
|
|
24223
|
+
});
|
|
24224
|
+
} else {
|
|
24225
|
+
self2._finish();
|
|
24226
|
+
}
|
|
24227
|
+
}
|
|
24228
|
+
}
|
|
24229
|
+
}
|
|
24230
|
+
Glob.prototype._finish = function() {
|
|
24231
|
+
assert(this instanceof Glob);
|
|
24232
|
+
if (this.aborted)
|
|
24233
|
+
return;
|
|
24234
|
+
if (this.realpath && !this._didRealpath)
|
|
24235
|
+
return this._realpath();
|
|
24236
|
+
common.finish(this);
|
|
24237
|
+
this.emit("end", this.found);
|
|
24238
|
+
};
|
|
24239
|
+
Glob.prototype._realpath = function() {
|
|
24240
|
+
if (this._didRealpath)
|
|
24241
|
+
return;
|
|
24242
|
+
this._didRealpath = true;
|
|
24243
|
+
var n = this.matches.length;
|
|
24244
|
+
if (n === 0)
|
|
24245
|
+
return this._finish();
|
|
24246
|
+
var self2 = this;
|
|
24247
|
+
for (var i = 0; i < this.matches.length; i++)
|
|
24248
|
+
this._realpathSet(i, next);
|
|
24249
|
+
function next() {
|
|
24250
|
+
if (--n === 0)
|
|
24251
|
+
self2._finish();
|
|
24252
|
+
}
|
|
24253
|
+
};
|
|
24254
|
+
Glob.prototype._realpathSet = function(index4, cb) {
|
|
24255
|
+
var matchset = this.matches[index4];
|
|
24256
|
+
if (!matchset)
|
|
24257
|
+
return cb();
|
|
24258
|
+
var found = Object.keys(matchset);
|
|
24259
|
+
var self2 = this;
|
|
24260
|
+
var n = found.length;
|
|
24261
|
+
if (n === 0)
|
|
24262
|
+
return cb();
|
|
24263
|
+
var set = this.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
24264
|
+
found.forEach(function(p, i) {
|
|
24265
|
+
p = self2._makeAbs(p);
|
|
24266
|
+
rp.realpath(p, self2.realpathCache, function(er, real) {
|
|
24267
|
+
if (!er)
|
|
24268
|
+
set[real] = true;
|
|
24269
|
+
else if (er.syscall === "stat")
|
|
24270
|
+
set[p] = true;
|
|
24271
|
+
else
|
|
24272
|
+
self2.emit("error", er);
|
|
24273
|
+
if (--n === 0) {
|
|
24274
|
+
self2.matches[index4] = set;
|
|
24275
|
+
cb();
|
|
24276
|
+
}
|
|
24277
|
+
});
|
|
24278
|
+
});
|
|
24279
|
+
};
|
|
24280
|
+
Glob.prototype._mark = function(p) {
|
|
24281
|
+
return common.mark(this, p);
|
|
24282
|
+
};
|
|
24283
|
+
Glob.prototype._makeAbs = function(f) {
|
|
24284
|
+
return common.makeAbs(this, f);
|
|
24285
|
+
};
|
|
24286
|
+
Glob.prototype.abort = function() {
|
|
24287
|
+
this.aborted = true;
|
|
24288
|
+
this.emit("abort");
|
|
24289
|
+
};
|
|
24290
|
+
Glob.prototype.pause = function() {
|
|
24291
|
+
if (!this.paused) {
|
|
24292
|
+
this.paused = true;
|
|
24293
|
+
this.emit("pause");
|
|
24294
|
+
}
|
|
24295
|
+
};
|
|
24296
|
+
Glob.prototype.resume = function() {
|
|
24297
|
+
if (this.paused) {
|
|
24298
|
+
this.emit("resume");
|
|
24299
|
+
this.paused = false;
|
|
24300
|
+
if (this._emitQueue.length) {
|
|
24301
|
+
var eq = this._emitQueue.slice(0);
|
|
24302
|
+
this._emitQueue.length = 0;
|
|
24303
|
+
for (var i = 0; i < eq.length; i++) {
|
|
24304
|
+
var e = eq[i];
|
|
24305
|
+
this._emitMatch(e[0], e[1]);
|
|
24306
|
+
}
|
|
24307
|
+
}
|
|
24308
|
+
if (this._processQueue.length) {
|
|
24309
|
+
var pq = this._processQueue.slice(0);
|
|
24310
|
+
this._processQueue.length = 0;
|
|
24311
|
+
for (var i = 0; i < pq.length; i++) {
|
|
24312
|
+
var p = pq[i];
|
|
24313
|
+
this._processing--;
|
|
24314
|
+
this._process(p[0], p[1], p[2], p[3]);
|
|
24315
|
+
}
|
|
24316
|
+
}
|
|
24317
|
+
}
|
|
24318
|
+
};
|
|
24319
|
+
Glob.prototype._process = function(pattern, index4, inGlobStar, cb) {
|
|
24320
|
+
assert(this instanceof Glob);
|
|
24321
|
+
assert(typeof cb === "function");
|
|
24322
|
+
if (this.aborted)
|
|
24323
|
+
return;
|
|
24324
|
+
this._processing++;
|
|
24325
|
+
if (this.paused) {
|
|
24326
|
+
this._processQueue.push([pattern, index4, inGlobStar, cb]);
|
|
24327
|
+
return;
|
|
24328
|
+
}
|
|
24329
|
+
var n = 0;
|
|
24330
|
+
while (typeof pattern[n] === "string") {
|
|
24331
|
+
n++;
|
|
24332
|
+
}
|
|
24333
|
+
var prefix;
|
|
24334
|
+
switch (n) {
|
|
24335
|
+
case pattern.length:
|
|
24336
|
+
this._processSimple(pattern.join("/"), index4, cb);
|
|
24337
|
+
return;
|
|
24338
|
+
case 0:
|
|
24339
|
+
prefix = null;
|
|
24340
|
+
break;
|
|
24341
|
+
default:
|
|
24342
|
+
prefix = pattern.slice(0, n).join("/");
|
|
24343
|
+
break;
|
|
24344
|
+
}
|
|
24345
|
+
var remain = pattern.slice(n);
|
|
24346
|
+
var read;
|
|
24347
|
+
if (prefix === null)
|
|
24348
|
+
read = ".";
|
|
24349
|
+
else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
|
|
24350
|
+
return typeof p === "string" ? p : "[*]";
|
|
24351
|
+
}).join("/"))) {
|
|
24352
|
+
if (!prefix || !isAbsolute(prefix))
|
|
24353
|
+
prefix = "/" + prefix;
|
|
24354
|
+
read = prefix;
|
|
24355
|
+
} else
|
|
24356
|
+
read = prefix;
|
|
24357
|
+
var abs = this._makeAbs(read);
|
|
24358
|
+
if (childrenIgnored(this, read))
|
|
24359
|
+
return cb();
|
|
24360
|
+
var isGlobStar = remain[0] === minimatch.GLOBSTAR;
|
|
24361
|
+
if (isGlobStar)
|
|
24362
|
+
this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar, cb);
|
|
24363
|
+
else
|
|
24364
|
+
this._processReaddir(prefix, read, abs, remain, index4, inGlobStar, cb);
|
|
24365
|
+
};
|
|
24366
|
+
Glob.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar, cb) {
|
|
24367
|
+
var self2 = this;
|
|
24368
|
+
this._readdir(abs, inGlobStar, function(er, entries) {
|
|
24369
|
+
return self2._processReaddir2(prefix, read, abs, remain, index4, inGlobStar, entries, cb);
|
|
24370
|
+
});
|
|
24371
|
+
};
|
|
24372
|
+
Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) {
|
|
24373
|
+
if (!entries)
|
|
24374
|
+
return cb();
|
|
24375
|
+
var pn = remain[0];
|
|
24376
|
+
var negate = !!this.minimatch.negate;
|
|
24377
|
+
var rawGlob = pn._glob;
|
|
24378
|
+
var dotOk = this.dot || rawGlob.charAt(0) === ".";
|
|
24379
|
+
var matchedEntries = [];
|
|
24380
|
+
for (var i = 0; i < entries.length; i++) {
|
|
24381
|
+
var e = entries[i];
|
|
24382
|
+
if (e.charAt(0) !== "." || dotOk) {
|
|
24383
|
+
var m;
|
|
24384
|
+
if (negate && !prefix) {
|
|
24385
|
+
m = !e.match(pn);
|
|
24386
|
+
} else {
|
|
24387
|
+
m = e.match(pn);
|
|
24388
|
+
}
|
|
24389
|
+
if (m)
|
|
24390
|
+
matchedEntries.push(e);
|
|
24391
|
+
}
|
|
24392
|
+
}
|
|
24393
|
+
var len = matchedEntries.length;
|
|
24394
|
+
if (len === 0)
|
|
24395
|
+
return cb();
|
|
24396
|
+
if (remain.length === 1 && !this.mark && !this.stat) {
|
|
24397
|
+
if (!this.matches[index4])
|
|
24398
|
+
this.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
24399
|
+
for (var i = 0; i < len; i++) {
|
|
24400
|
+
var e = matchedEntries[i];
|
|
24401
|
+
if (prefix) {
|
|
24402
|
+
if (prefix !== "/")
|
|
24403
|
+
e = prefix + "/" + e;
|
|
24404
|
+
else
|
|
24405
|
+
e = prefix + e;
|
|
24406
|
+
}
|
|
24407
|
+
if (e.charAt(0) === "/" && !this.nomount) {
|
|
24408
|
+
e = path4.join(this.root, e);
|
|
24409
|
+
}
|
|
24410
|
+
this._emitMatch(index4, e);
|
|
24411
|
+
}
|
|
24412
|
+
return cb();
|
|
24413
|
+
}
|
|
24414
|
+
remain.shift();
|
|
24415
|
+
for (var i = 0; i < len; i++) {
|
|
24416
|
+
var e = matchedEntries[i];
|
|
24417
|
+
var newPattern;
|
|
24418
|
+
if (prefix) {
|
|
24419
|
+
if (prefix !== "/")
|
|
24420
|
+
e = prefix + "/" + e;
|
|
24421
|
+
else
|
|
24422
|
+
e = prefix + e;
|
|
24423
|
+
}
|
|
24424
|
+
this._process([e].concat(remain), index4, inGlobStar, cb);
|
|
24425
|
+
}
|
|
24426
|
+
cb();
|
|
24427
|
+
};
|
|
24428
|
+
Glob.prototype._emitMatch = function(index4, e) {
|
|
24429
|
+
if (this.aborted)
|
|
24430
|
+
return;
|
|
24431
|
+
if (isIgnored(this, e))
|
|
24432
|
+
return;
|
|
24433
|
+
if (this.paused) {
|
|
24434
|
+
this._emitQueue.push([index4, e]);
|
|
24435
|
+
return;
|
|
24436
|
+
}
|
|
24437
|
+
var abs = isAbsolute(e) ? e : this._makeAbs(e);
|
|
24438
|
+
if (this.mark)
|
|
24439
|
+
e = this._mark(e);
|
|
24440
|
+
if (this.absolute)
|
|
24441
|
+
e = abs;
|
|
24442
|
+
if (this.matches[index4][e])
|
|
24443
|
+
return;
|
|
24444
|
+
if (this.nodir) {
|
|
24445
|
+
var c = this.cache[abs];
|
|
24446
|
+
if (c === "DIR" || Array.isArray(c))
|
|
24447
|
+
return;
|
|
24448
|
+
}
|
|
24449
|
+
this.matches[index4][e] = true;
|
|
24450
|
+
var st = this.statCache[abs];
|
|
24451
|
+
if (st)
|
|
24452
|
+
this.emit("stat", e, st);
|
|
24453
|
+
this.emit("match", e);
|
|
24454
|
+
};
|
|
24455
|
+
Glob.prototype._readdirInGlobStar = function(abs, cb) {
|
|
24456
|
+
if (this.aborted)
|
|
24457
|
+
return;
|
|
24458
|
+
if (this.follow)
|
|
24459
|
+
return this._readdir(abs, false, cb);
|
|
24460
|
+
var lstatkey = "lstat\0" + abs;
|
|
24461
|
+
var self2 = this;
|
|
24462
|
+
var lstatcb = inflight(lstatkey, lstatcb_);
|
|
24463
|
+
if (lstatcb)
|
|
24464
|
+
self2.fs.lstat(abs, lstatcb);
|
|
24465
|
+
function lstatcb_(er, lstat) {
|
|
24466
|
+
if (er && er.code === "ENOENT")
|
|
24467
|
+
return cb();
|
|
24468
|
+
var isSym = lstat && lstat.isSymbolicLink();
|
|
24469
|
+
self2.symlinks[abs] = isSym;
|
|
24470
|
+
if (!isSym && lstat && !lstat.isDirectory()) {
|
|
24471
|
+
self2.cache[abs] = "FILE";
|
|
24472
|
+
cb();
|
|
24473
|
+
} else
|
|
24474
|
+
self2._readdir(abs, false, cb);
|
|
24475
|
+
}
|
|
24476
|
+
};
|
|
24477
|
+
Glob.prototype._readdir = function(abs, inGlobStar, cb) {
|
|
24478
|
+
if (this.aborted)
|
|
24479
|
+
return;
|
|
24480
|
+
cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb);
|
|
24481
|
+
if (!cb)
|
|
24482
|
+
return;
|
|
24483
|
+
if (inGlobStar && !ownProp(this.symlinks, abs))
|
|
24484
|
+
return this._readdirInGlobStar(abs, cb);
|
|
24485
|
+
if (ownProp(this.cache, abs)) {
|
|
24486
|
+
var c = this.cache[abs];
|
|
24487
|
+
if (!c || c === "FILE")
|
|
24488
|
+
return cb();
|
|
24489
|
+
if (Array.isArray(c))
|
|
24490
|
+
return cb(null, c);
|
|
24491
|
+
}
|
|
24492
|
+
var self2 = this;
|
|
24493
|
+
self2.fs.readdir(abs, readdirCb(this, abs, cb));
|
|
24494
|
+
};
|
|
24495
|
+
function readdirCb(self2, abs, cb) {
|
|
24496
|
+
return function(er, entries) {
|
|
24497
|
+
if (er)
|
|
24498
|
+
self2._readdirError(abs, er, cb);
|
|
24499
|
+
else
|
|
24500
|
+
self2._readdirEntries(abs, entries, cb);
|
|
24501
|
+
};
|
|
24502
|
+
}
|
|
24503
|
+
Glob.prototype._readdirEntries = function(abs, entries, cb) {
|
|
24504
|
+
if (this.aborted)
|
|
24505
|
+
return;
|
|
24506
|
+
if (!this.mark && !this.stat) {
|
|
24507
|
+
for (var i = 0; i < entries.length; i++) {
|
|
24508
|
+
var e = entries[i];
|
|
24509
|
+
if (abs === "/")
|
|
24510
|
+
e = abs + e;
|
|
24511
|
+
else
|
|
24512
|
+
e = abs + "/" + e;
|
|
24513
|
+
this.cache[e] = true;
|
|
24514
|
+
}
|
|
24515
|
+
}
|
|
24516
|
+
this.cache[abs] = entries;
|
|
24517
|
+
return cb(null, entries);
|
|
24518
|
+
};
|
|
24519
|
+
Glob.prototype._readdirError = function(f, er, cb) {
|
|
24520
|
+
if (this.aborted)
|
|
24521
|
+
return;
|
|
24522
|
+
switch (er.code) {
|
|
24523
|
+
case "ENOTSUP":
|
|
24524
|
+
case "ENOTDIR":
|
|
24525
|
+
var abs = this._makeAbs(f);
|
|
24526
|
+
this.cache[abs] = "FILE";
|
|
24527
|
+
if (abs === this.cwdAbs) {
|
|
24528
|
+
var error2 = new Error(er.code + " invalid cwd " + this.cwd);
|
|
24529
|
+
error2.path = this.cwd;
|
|
24530
|
+
error2.code = er.code;
|
|
24531
|
+
this.emit("error", error2);
|
|
24532
|
+
this.abort();
|
|
24533
|
+
}
|
|
24534
|
+
break;
|
|
24535
|
+
case "ENOENT":
|
|
24536
|
+
case "ELOOP":
|
|
24537
|
+
case "ENAMETOOLONG":
|
|
24538
|
+
case "UNKNOWN":
|
|
24539
|
+
this.cache[this._makeAbs(f)] = false;
|
|
24540
|
+
break;
|
|
24541
|
+
default:
|
|
24542
|
+
this.cache[this._makeAbs(f)] = false;
|
|
24543
|
+
if (this.strict) {
|
|
24544
|
+
this.emit("error", er);
|
|
24545
|
+
this.abort();
|
|
24546
|
+
}
|
|
24547
|
+
if (!this.silent)
|
|
24548
|
+
console.error("glob error", er);
|
|
24549
|
+
break;
|
|
24550
|
+
}
|
|
24551
|
+
return cb();
|
|
24552
|
+
};
|
|
24553
|
+
Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar, cb) {
|
|
24554
|
+
var self2 = this;
|
|
24555
|
+
this._readdir(abs, inGlobStar, function(er, entries) {
|
|
24556
|
+
self2._processGlobStar2(prefix, read, abs, remain, index4, inGlobStar, entries, cb);
|
|
24557
|
+
});
|
|
24558
|
+
};
|
|
24559
|
+
Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) {
|
|
24560
|
+
if (!entries)
|
|
24561
|
+
return cb();
|
|
24562
|
+
var remainWithoutGlobStar = remain.slice(1);
|
|
24563
|
+
var gspref = prefix ? [prefix] : [];
|
|
24564
|
+
var noGlobStar = gspref.concat(remainWithoutGlobStar);
|
|
24565
|
+
this._process(noGlobStar, index4, false, cb);
|
|
24566
|
+
var isSym = this.symlinks[abs];
|
|
24567
|
+
var len = entries.length;
|
|
24568
|
+
if (isSym && inGlobStar)
|
|
24569
|
+
return cb();
|
|
24570
|
+
for (var i = 0; i < len; i++) {
|
|
24571
|
+
var e = entries[i];
|
|
24572
|
+
if (e.charAt(0) === "." && !this.dot)
|
|
24573
|
+
continue;
|
|
24574
|
+
var instead = gspref.concat(entries[i], remainWithoutGlobStar);
|
|
24575
|
+
this._process(instead, index4, true, cb);
|
|
24576
|
+
var below = gspref.concat(entries[i], remain);
|
|
24577
|
+
this._process(below, index4, true, cb);
|
|
24578
|
+
}
|
|
24579
|
+
cb();
|
|
24580
|
+
};
|
|
24581
|
+
Glob.prototype._processSimple = function(prefix, index4, cb) {
|
|
24582
|
+
var self2 = this;
|
|
24583
|
+
this._stat(prefix, function(er, exists) {
|
|
24584
|
+
self2._processSimple2(prefix, index4, er, exists, cb);
|
|
24585
|
+
});
|
|
24586
|
+
};
|
|
24587
|
+
Glob.prototype._processSimple2 = function(prefix, index4, er, exists, cb) {
|
|
24588
|
+
if (!this.matches[index4])
|
|
24589
|
+
this.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
24590
|
+
if (!exists)
|
|
24591
|
+
return cb();
|
|
24592
|
+
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
|
24593
|
+
var trail = /[\/\\]$/.test(prefix);
|
|
24594
|
+
if (prefix.charAt(0) === "/") {
|
|
24595
|
+
prefix = path4.join(this.root, prefix);
|
|
24596
|
+
} else {
|
|
24597
|
+
prefix = path4.resolve(this.root, prefix);
|
|
24598
|
+
if (trail)
|
|
24599
|
+
prefix += "/";
|
|
24600
|
+
}
|
|
24601
|
+
}
|
|
24602
|
+
if (process.platform === "win32")
|
|
24603
|
+
prefix = prefix.replace(/\\/g, "/");
|
|
24604
|
+
this._emitMatch(index4, prefix);
|
|
24605
|
+
cb();
|
|
24606
|
+
};
|
|
24607
|
+
Glob.prototype._stat = function(f, cb) {
|
|
24608
|
+
var abs = this._makeAbs(f);
|
|
24609
|
+
var needDir = f.slice(-1) === "/";
|
|
24610
|
+
if (f.length > this.maxLength)
|
|
24611
|
+
return cb();
|
|
24612
|
+
if (!this.stat && ownProp(this.cache, abs)) {
|
|
24613
|
+
var c = this.cache[abs];
|
|
24614
|
+
if (Array.isArray(c))
|
|
24615
|
+
c = "DIR";
|
|
24616
|
+
if (!needDir || c === "DIR")
|
|
24617
|
+
return cb(null, c);
|
|
24618
|
+
if (needDir && c === "FILE")
|
|
24619
|
+
return cb();
|
|
24620
|
+
}
|
|
24621
|
+
var exists;
|
|
24622
|
+
var stat = this.statCache[abs];
|
|
24623
|
+
if (stat !== void 0) {
|
|
24624
|
+
if (stat === false)
|
|
24625
|
+
return cb(null, stat);
|
|
24626
|
+
else {
|
|
24627
|
+
var type = stat.isDirectory() ? "DIR" : "FILE";
|
|
24628
|
+
if (needDir && type === "FILE")
|
|
24629
|
+
return cb();
|
|
24630
|
+
else
|
|
24631
|
+
return cb(null, type, stat);
|
|
24632
|
+
}
|
|
24633
|
+
}
|
|
24634
|
+
var self2 = this;
|
|
24635
|
+
var statcb = inflight("stat\0" + abs, lstatcb_);
|
|
24636
|
+
if (statcb)
|
|
24637
|
+
self2.fs.lstat(abs, statcb);
|
|
24638
|
+
function lstatcb_(er, lstat) {
|
|
24639
|
+
if (lstat && lstat.isSymbolicLink()) {
|
|
24640
|
+
return self2.fs.stat(abs, function(er2, stat2) {
|
|
24641
|
+
if (er2)
|
|
24642
|
+
self2._stat2(f, abs, null, lstat, cb);
|
|
24643
|
+
else
|
|
24644
|
+
self2._stat2(f, abs, er2, stat2, cb);
|
|
24645
|
+
});
|
|
24646
|
+
} else {
|
|
24647
|
+
self2._stat2(f, abs, er, lstat, cb);
|
|
24648
|
+
}
|
|
24649
|
+
}
|
|
24650
|
+
};
|
|
24651
|
+
Glob.prototype._stat2 = function(f, abs, er, stat, cb) {
|
|
24652
|
+
if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
|
|
24653
|
+
this.statCache[abs] = false;
|
|
24654
|
+
return cb();
|
|
24655
|
+
}
|
|
24656
|
+
var needDir = f.slice(-1) === "/";
|
|
24657
|
+
this.statCache[abs] = stat;
|
|
24658
|
+
if (abs.slice(-1) === "/" && stat && !stat.isDirectory())
|
|
24659
|
+
return cb(null, false, stat);
|
|
24660
|
+
var c = true;
|
|
24661
|
+
if (stat)
|
|
24662
|
+
c = stat.isDirectory() ? "DIR" : "FILE";
|
|
24663
|
+
this.cache[abs] = this.cache[abs] || c;
|
|
24664
|
+
if (needDir && c === "FILE")
|
|
24665
|
+
return cb();
|
|
24666
|
+
return cb(null, c, stat);
|
|
24667
|
+
};
|
|
24668
|
+
}
|
|
24669
|
+
});
|
|
24670
|
+
|
|
22286
24671
|
// src/serializer/mysqlImports.ts
|
|
22287
24672
|
var mysqlImports_exports = {};
|
|
22288
24673
|
__export(mysqlImports_exports, {
|
|
@@ -23167,12 +25552,13 @@ var init_sqliteSerializer = __esm({
|
|
|
23167
25552
|
});
|
|
23168
25553
|
|
|
23169
25554
|
// src/serializer/index.ts
|
|
23170
|
-
var import_fs3, import_node, import_path3, safeRegister, serializeMySql, serializePg, serializeSQLite, prepareFilenames;
|
|
25555
|
+
var import_fs3, import_node, import_path3, import_glob, safeRegister, serializeMySql, serializePg, serializeSQLite, prepareFilenames;
|
|
23171
25556
|
var init_serializer = __esm({
|
|
23172
25557
|
"src/serializer/index.ts"() {
|
|
23173
25558
|
import_fs3 = __toESM(require("fs"));
|
|
23174
25559
|
import_node = __toESM(require_node2());
|
|
23175
25560
|
import_path3 = __toESM(require("path"));
|
|
25561
|
+
import_glob = __toESM(require_glob());
|
|
23176
25562
|
safeRegister = () => {
|
|
23177
25563
|
try {
|
|
23178
25564
|
const { unregister } = (0, import_node.register)({
|
|
@@ -23213,9 +25599,19 @@ var init_serializer = __esm({
|
|
|
23213
25599
|
return generateSqliteSnapshot2(tables, enums);
|
|
23214
25600
|
};
|
|
23215
25601
|
prepareFilenames = (path4) => {
|
|
23216
|
-
|
|
23217
|
-
|
|
23218
|
-
|
|
25602
|
+
if (typeof path4 === "string") {
|
|
25603
|
+
path4 = [path4];
|
|
25604
|
+
}
|
|
25605
|
+
const result = path4.reduce((result2, cur) => {
|
|
25606
|
+
const globbed = import_glob.default.sync(cur);
|
|
25607
|
+
globbed.forEach((it) => {
|
|
25608
|
+
const fileName = import_fs3.default.lstatSync(it).isDirectory() ? null : import_path3.default.resolve(it);
|
|
25609
|
+
const filenames = fileName ? [fileName] : import_fs3.default.readdirSync(it).map((file) => import_path3.default.join(import_path3.default.resolve(it), file));
|
|
25610
|
+
filenames.filter((file) => !import_fs3.default.lstatSync(file).isDirectory()).forEach((file) => result2.add(file));
|
|
25611
|
+
});
|
|
25612
|
+
return result2;
|
|
25613
|
+
}, /* @__PURE__ */ new Set());
|
|
25614
|
+
return [...result];
|
|
23219
25615
|
};
|
|
23220
25616
|
}
|
|
23221
25617
|
});
|
|
@@ -23324,10 +25720,10 @@ var init_migrate = __esm({
|
|
|
23324
25720
|
writeResult(
|
|
23325
25721
|
cur,
|
|
23326
25722
|
sqlStatements,
|
|
23327
|
-
snapshots.length,
|
|
23328
25723
|
journal,
|
|
23329
25724
|
_meta,
|
|
23330
|
-
outFolder
|
|
25725
|
+
outFolder,
|
|
25726
|
+
config.breakpoints
|
|
23331
25727
|
);
|
|
23332
25728
|
} catch (e) {
|
|
23333
25729
|
console.error(e);
|
|
@@ -23352,10 +25748,10 @@ var init_migrate = __esm({
|
|
|
23352
25748
|
writeResult(
|
|
23353
25749
|
cur,
|
|
23354
25750
|
sqlStatements,
|
|
23355
|
-
snapshots.length,
|
|
23356
25751
|
journal,
|
|
23357
25752
|
_meta,
|
|
23358
|
-
outFolder
|
|
25753
|
+
outFolder,
|
|
25754
|
+
config.breakpoints
|
|
23359
25755
|
);
|
|
23360
25756
|
} catch (e) {
|
|
23361
25757
|
console.error(e);
|
|
@@ -23380,10 +25776,10 @@ var init_migrate = __esm({
|
|
|
23380
25776
|
writeResult(
|
|
23381
25777
|
cur,
|
|
23382
25778
|
sqlStatements,
|
|
23383
|
-
snapshots.length,
|
|
23384
25779
|
journal,
|
|
23385
25780
|
_meta,
|
|
23386
|
-
outFolder
|
|
25781
|
+
outFolder,
|
|
25782
|
+
config.breakpoints
|
|
23387
25783
|
);
|
|
23388
25784
|
} catch (e) {
|
|
23389
25785
|
console.error(e);
|
|
@@ -23569,12 +25965,14 @@ var init_migrate = __esm({
|
|
|
23569
25965
|
result.deleted.push(...leftMissing);
|
|
23570
25966
|
return result;
|
|
23571
25967
|
};
|
|
23572
|
-
writeResult = (cur, sqlStatements,
|
|
25968
|
+
writeResult = (cur, sqlStatements, journal, _meta, outFolder, breakpoints) => {
|
|
25969
|
+
var _a, _b;
|
|
23573
25970
|
console.log(schema(cur));
|
|
23574
25971
|
if (sqlStatements.length === 0) {
|
|
23575
25972
|
console.log("No schema changes, nothing to migrate \u{1F634}");
|
|
23576
25973
|
return;
|
|
23577
25974
|
}
|
|
25975
|
+
const idx = (_b = (_a = journal.entries[journal.entries.length - 1]) == null ? void 0 : _a.idx) != null ? _b : 0;
|
|
23578
25976
|
const { prefix, tag } = prepareMigrationMetadata(idx);
|
|
23579
25977
|
const toSave = JSON.parse(JSON.stringify(cur));
|
|
23580
25978
|
toSave["_meta"] = _meta;
|
|
@@ -23584,25 +25982,13 @@ var init_migrate = __esm({
|
|
|
23584
25982
|
(0, import_path4.join)(metaFolderPath, `${prefix}_snapshot.json`),
|
|
23585
25983
|
JSON.stringify(toSave, null, 2)
|
|
23586
25984
|
);
|
|
23587
|
-
const sqlDelimiter = "\n";
|
|
23588
|
-
const sqlBreakopoints = sqlStatements.reduce(
|
|
23589
|
-
(acc, cur2) => {
|
|
23590
|
-
const breakpoint = acc.offset + sqlDelimiter.length + cur2.length;
|
|
23591
|
-
acc.res.push(breakpoint);
|
|
23592
|
-
acc.offset = breakpoint;
|
|
23593
|
-
return acc;
|
|
23594
|
-
},
|
|
23595
|
-
{
|
|
23596
|
-
offset: 0,
|
|
23597
|
-
res: []
|
|
23598
|
-
}
|
|
23599
|
-
);
|
|
25985
|
+
const sqlDelimiter = breakpoints ? "--> statement-breakpoint\n" : "\n";
|
|
23600
25986
|
const sql = sqlStatements.join(sqlDelimiter);
|
|
23601
25987
|
journal.entries.push({
|
|
23602
25988
|
idx,
|
|
23603
25989
|
when: +new Date(),
|
|
23604
25990
|
tag,
|
|
23605
|
-
breakpoints
|
|
25991
|
+
breakpoints
|
|
23606
25992
|
});
|
|
23607
25993
|
import_fs5.default.writeFileSync(metaJournal, JSON.stringify(journal, null, 2));
|
|
23608
25994
|
import_fs5.default.writeFileSync(`${outFolder}/${tag}.sql`, sql);
|
|
@@ -28494,10 +30880,10 @@ __export(pgIntrospect_exports, {
|
|
|
28494
30880
|
PgConfig2: () => PgConfig2,
|
|
28495
30881
|
pgIntrospect: () => pgIntrospect
|
|
28496
30882
|
});
|
|
28497
|
-
var
|
|
30883
|
+
var import_hanji4, import_pg, PgConfig1, PgConfig2, Conf, pgIntrospect;
|
|
28498
30884
|
var init_pgIntrospect = __esm({
|
|
28499
30885
|
"src/cli/commands/pgIntrospect.ts"() {
|
|
28500
|
-
|
|
30886
|
+
import_hanji4 = __toESM(require_hanji());
|
|
28501
30887
|
init_lib();
|
|
28502
30888
|
init_views();
|
|
28503
30889
|
import_pg = __toESM(require_lib3());
|
|
@@ -28519,7 +30905,7 @@ var init_pgIntrospect = __esm({
|
|
|
28519
30905
|
pgIntrospect = async (config) => {
|
|
28520
30906
|
const pool = new import_pg.Pool(config);
|
|
28521
30907
|
const progress = new IntrospectProgress();
|
|
28522
|
-
const res = await (0,
|
|
30908
|
+
const res = await (0, import_hanji4.renderWithTask)(
|
|
28523
30909
|
progress,
|
|
28524
30910
|
fromDatabase2(pool, (stage, count, status) => {
|
|
28525
30911
|
progress.update(stage, count, status);
|
|
@@ -42818,7 +45204,7 @@ var require_named_placeholders = __commonJS({
|
|
|
42818
45204
|
}
|
|
42819
45205
|
return s;
|
|
42820
45206
|
}
|
|
42821
|
-
function
|
|
45207
|
+
function join5(tree) {
|
|
42822
45208
|
if (tree.length == 1) {
|
|
42823
45209
|
return tree;
|
|
42824
45210
|
}
|
|
@@ -42844,7 +45230,7 @@ var require_named_placeholders = __commonJS({
|
|
|
42844
45230
|
if (cache && (tree = cache.get(query))) {
|
|
42845
45231
|
return toArrayParams(tree, paramsObj);
|
|
42846
45232
|
}
|
|
42847
|
-
tree =
|
|
45233
|
+
tree = join5(parse(query));
|
|
42848
45234
|
if (cache) {
|
|
42849
45235
|
cache.set(query, tree);
|
|
42850
45236
|
}
|
|
@@ -45157,10 +47543,10 @@ __export(mysqlIntrospect_exports, {
|
|
|
45157
47543
|
MySQLConfig2: () => MySQLConfig2,
|
|
45158
47544
|
mysqlIntrospect: () => mysqlIntrospect
|
|
45159
47545
|
});
|
|
45160
|
-
var
|
|
47546
|
+
var import_hanji5, import_promise, MySQLConfig1, MySQLConfig2, Conf2, mysqlIntrospect;
|
|
45161
47547
|
var init_mysqlIntrospect = __esm({
|
|
45162
47548
|
"src/cli/commands/mysqlIntrospect.ts"() {
|
|
45163
|
-
|
|
47549
|
+
import_hanji5 = __toESM(require_hanji());
|
|
45164
47550
|
init_lib();
|
|
45165
47551
|
init_views();
|
|
45166
47552
|
import_promise = __toESM(require_promise2());
|
|
@@ -45191,7 +47577,7 @@ var init_mysqlIntrospect = __esm({
|
|
|
45191
47577
|
}
|
|
45192
47578
|
await client.connect();
|
|
45193
47579
|
const progress = new IntrospectProgress();
|
|
45194
|
-
const res = await (0,
|
|
47580
|
+
const res = await (0, import_hanji5.renderWithTask)(progress, fromDatabase(client, databaseName, (stage, count, status) => {
|
|
45195
47581
|
progress.update(stage, count, status);
|
|
45196
47582
|
}));
|
|
45197
47583
|
const schema4 = { id: originUUID, prevId: "", ...res };
|
|
@@ -45226,7 +47612,7 @@ var {
|
|
|
45226
47612
|
} = import_index.default;
|
|
45227
47613
|
|
|
45228
47614
|
// src/cli/index.ts
|
|
45229
|
-
var
|
|
47615
|
+
var import_fs10 = __toESM(require("fs"));
|
|
45230
47616
|
init_lib();
|
|
45231
47617
|
|
|
45232
47618
|
// src/cli/commands/check.ts
|
|
@@ -45267,9 +47653,9 @@ var checkHandler = (out, dialect6) => {
|
|
|
45267
47653
|
};
|
|
45268
47654
|
|
|
45269
47655
|
// src/cli/index.ts
|
|
45270
|
-
var
|
|
47656
|
+
var import_hanji6 = __toESM(require_hanji());
|
|
45271
47657
|
init_views();
|
|
45272
|
-
var
|
|
47658
|
+
var import_path8 = __toESM(require("path"));
|
|
45273
47659
|
|
|
45274
47660
|
// src/cli/utils.ts
|
|
45275
47661
|
init_views();
|
|
@@ -45338,7 +47724,9 @@ var package_default = {
|
|
|
45338
47724
|
sim: "node -r esbuild-register ./dev/simulate.ts",
|
|
45339
47725
|
"sim:sqlite": "node -r esbuild-register ./dev/sqlite/index.ts",
|
|
45340
47726
|
test: "ava test",
|
|
45341
|
-
build: "
|
|
47727
|
+
build: "pnpm build:cli && pnpm build:utils",
|
|
47728
|
+
"build:cli": "esbuild ./src/cli/index.ts --bundle --platform=node --target=node10.4 --outfile=./dist/index.js --external:esbuild --external:drizzle-orm-pg --external:drizzle-orm-sqlite --external:drizzle-orm-mysql --external:drizzle-orm --external:pg-native",
|
|
47729
|
+
"build:utils": "esbuild ./src/utils.ts --bundle --platform=node --target=node10.4 --outfile=./dist/utils.js",
|
|
45342
47730
|
pack: "build && package",
|
|
45343
47731
|
tsc: "tsc -p tsconfig.build.json",
|
|
45344
47732
|
pub: "cp package.json readme.md dist/ && cd dist && npm publish"
|
|
@@ -45360,12 +47748,14 @@ var package_default = {
|
|
|
45360
47748
|
commander: "^9.4.1",
|
|
45361
47749
|
esbuild: "^0.15.18",
|
|
45362
47750
|
"esbuild-register": "^3.4.2",
|
|
47751
|
+
glob: "^8.1.0",
|
|
45363
47752
|
hanji: "^0.0.5",
|
|
45364
47753
|
"json-diff": "0.9.0",
|
|
45365
47754
|
zod: "^3.20.2"
|
|
45366
47755
|
},
|
|
45367
47756
|
devDependencies: {
|
|
45368
47757
|
"@types/dockerode": "^3.3.14",
|
|
47758
|
+
"@types/glob": "^8.1.0",
|
|
45369
47759
|
"@types/node": "^18.11.15",
|
|
45370
47760
|
"@types/pg": "^8.6.5",
|
|
45371
47761
|
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
|
@@ -45676,6 +48066,35 @@ var updateV3toV42 = (old) => {
|
|
|
45676
48066
|
// src/cli/index.ts
|
|
45677
48067
|
init_upFolders();
|
|
45678
48068
|
init_mysqlSchema();
|
|
48069
|
+
|
|
48070
|
+
// src/cli/commands/drop.ts
|
|
48071
|
+
init_source();
|
|
48072
|
+
var import_fs9 = require("fs");
|
|
48073
|
+
var import_hanji3 = __toESM(require_hanji());
|
|
48074
|
+
var import_path7 = require("path");
|
|
48075
|
+
init_views();
|
|
48076
|
+
var dropMigration = async (out) => {
|
|
48077
|
+
const metaFilePath = (0, import_path7.join)(out, "meta", "_journal.json");
|
|
48078
|
+
const journal = JSON.parse(
|
|
48079
|
+
(0, import_fs9.readFileSync)(metaFilePath, "utf-8")
|
|
48080
|
+
);
|
|
48081
|
+
const result = await (0, import_hanji3.render)(new DropMigrationView(journal.entries));
|
|
48082
|
+
if (result.status === "aborted")
|
|
48083
|
+
return;
|
|
48084
|
+
delete journal.entries[journal.entries.indexOf(result.data)];
|
|
48085
|
+
const resultJournal = {
|
|
48086
|
+
...journal,
|
|
48087
|
+
entries: journal.entries.filter(Boolean)
|
|
48088
|
+
};
|
|
48089
|
+
const sqlFilePath = (0, import_path7.join)(out, `${result.data.tag}.sql`);
|
|
48090
|
+
const snapshotFilePath = (0, import_path7.join)(out, "meta", `${result.data.idx.toFixed(0).padStart(4, "0")}_snapshot.json`);
|
|
48091
|
+
(0, import_fs9.rmSync)(sqlFilePath);
|
|
48092
|
+
(0, import_fs9.rmSync)(snapshotFilePath);
|
|
48093
|
+
(0, import_fs9.writeFileSync)(metaFilePath, JSON.stringify(resultJournal));
|
|
48094
|
+
console.log(`[${source_default.green("\u2713")}] ${source_default.bold(result.data.tag)} migration successfully dropped`);
|
|
48095
|
+
};
|
|
48096
|
+
|
|
48097
|
+
// src/cli/index.ts
|
|
45679
48098
|
var printVersions = () => {
|
|
45680
48099
|
console.log(`${source_default.gray(versions())}
|
|
45681
48100
|
`);
|
|
@@ -45683,13 +48102,13 @@ var printVersions = () => {
|
|
|
45683
48102
|
var assertEitherConfigOrOut = (config, out) => {
|
|
45684
48103
|
if (out)
|
|
45685
48104
|
return out;
|
|
45686
|
-
if (!(0,
|
|
48105
|
+
if (!(0, import_fs10.existsSync)(import_path8.default.join(import_path8.default.resolve(config)))) {
|
|
45687
48106
|
console.log(`${config} file does not exist`);
|
|
45688
48107
|
process.exit(1);
|
|
45689
48108
|
}
|
|
45690
48109
|
console.log(`Reading ${config}`);
|
|
45691
48110
|
const drizzleConfig = JSON.parse(
|
|
45692
|
-
|
|
48111
|
+
import_fs10.default.readFileSync(import_path8.default.join(import_path8.default.resolve(config))).toString()
|
|
45693
48112
|
);
|
|
45694
48113
|
return drizzleConfig.out;
|
|
45695
48114
|
};
|
|
@@ -45701,19 +48120,22 @@ drizzle-orm: v${npmVersion}` : "";
|
|
|
45701
48120
|
return versions2;
|
|
45702
48121
|
};
|
|
45703
48122
|
var configSchema = objectType({
|
|
45704
|
-
schema: stringType(),
|
|
45705
|
-
out: stringType().default("drizzle")
|
|
48123
|
+
schema: unionType([stringType(), stringType().array()]),
|
|
48124
|
+
out: stringType().default("drizzle"),
|
|
48125
|
+
breakpoints: booleanType()
|
|
45706
48126
|
}).strict();
|
|
45707
48127
|
var optionsSchema = objectType({
|
|
45708
|
-
schema: stringType().optional(),
|
|
48128
|
+
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
45709
48129
|
out: stringType().optional(),
|
|
45710
|
-
config: stringType().optional()
|
|
48130
|
+
config: stringType().optional(),
|
|
48131
|
+
breakpoints: booleanType().optional().default(false)
|
|
45711
48132
|
}).strict();
|
|
45712
|
-
var generatePgCommand = new Command("generate:pg").option("--schema <schema>", "Path to a schema file or folder").option("--out <out>", `Output folder, 'drizzle' by default`).option(
|
|
48133
|
+
var generatePgCommand = new Command("generate:pg").option("--schema <schema>", "Path to a schema file or folder").option("--out <out>", `Output folder, 'drizzle' by default`).option("--breakpoints", `Prepare SQL statements with breakpoints`).option(
|
|
45713
48134
|
"--config <config>",
|
|
45714
48135
|
"Path to a config.json file, drizzle.config.json by default"
|
|
45715
48136
|
).action(async (options) => {
|
|
45716
48137
|
printVersions();
|
|
48138
|
+
assertOrmCoreVersion();
|
|
45717
48139
|
const oprtionsParsed = optionsSchema.parse(options);
|
|
45718
48140
|
const result = prepareGenerateConfig(oprtionsParsed);
|
|
45719
48141
|
if (result instanceof Error) {
|
|
@@ -45724,11 +48146,12 @@ var generatePgCommand = new Command("generate:pg").option("--schema <schema>", "
|
|
|
45724
48146
|
const { prepareAndMigratePg: prepareAndMigratePg2 } = (init_migrate(), __toCommonJS(migrate_exports));
|
|
45725
48147
|
await prepareAndMigratePg2(result);
|
|
45726
48148
|
});
|
|
45727
|
-
var generateMysqlCommand = new Command("generate:mysql").option("--schema <schema>", "Path to a schema file or folder").option("--out <out>", `Output folder, 'drizzle' by default`).option(
|
|
48149
|
+
var generateMysqlCommand = new Command("generate:mysql").option("--schema <schema>", "Path to a schema file or folder").option("--out <out>", `Output folder, 'drizzle' by default`).option("--breakpoints", `Prepare SQL statements with breakpoints`).option(
|
|
45728
48150
|
"--config <config>",
|
|
45729
48151
|
"Path to a config.json file, drizzle.config.json by default"
|
|
45730
48152
|
).action(async (options) => {
|
|
45731
48153
|
printVersions();
|
|
48154
|
+
assertOrmCoreVersion();
|
|
45732
48155
|
const oprtionsParsed = optionsSchema.parse(options);
|
|
45733
48156
|
const result = prepareGenerateConfig(oprtionsParsed);
|
|
45734
48157
|
if (result instanceof Error) {
|
|
@@ -45739,11 +48162,12 @@ var generateMysqlCommand = new Command("generate:mysql").option("--schema <schem
|
|
|
45739
48162
|
const { prepareAndMigrateMySql: prepareAndMigrateMySql2 } = (init_migrate(), __toCommonJS(migrate_exports));
|
|
45740
48163
|
await prepareAndMigrateMySql2(result);
|
|
45741
48164
|
});
|
|
45742
|
-
var generateSqliteCommand = new Command("generate:sqlite").option("--schema <schema>", "Path to a schema file or folder").option("--out <out>", `Output folder, 'drizzle' by default`).option(
|
|
48165
|
+
var generateSqliteCommand = new Command("generate:sqlite").option("--schema <schema>", "Path to a schema file or folder").option("--out <out>", `Output folder, 'drizzle' by default`).option("--breakpoints", `Prepare SQL statements with breakpoints`).option(
|
|
45743
48166
|
"--config <config>",
|
|
45744
48167
|
"Path to a config.json file, drizzle.config.json by default"
|
|
45745
48168
|
).action(async (options) => {
|
|
45746
48169
|
printVersions();
|
|
48170
|
+
assertOrmCoreVersion();
|
|
45747
48171
|
const oprtionsParsed = optionsSchema.parse(options);
|
|
45748
48172
|
const result = prepareGenerateConfig(oprtionsParsed);
|
|
45749
48173
|
if (result instanceof Error) {
|
|
@@ -45755,18 +48179,18 @@ var generateSqliteCommand = new Command("generate:sqlite").option("--schema <sch
|
|
|
45755
48179
|
await prepareAndMigrateSqlite2(result);
|
|
45756
48180
|
});
|
|
45757
48181
|
var prepareGenerateConfig = (options) => {
|
|
45758
|
-
const { schema: schema4, out, config } = options;
|
|
48182
|
+
const { schema: schema4, out, config, breakpoints } = options;
|
|
45759
48183
|
if (!(schema4 || out)) {
|
|
45760
48184
|
const path4 = config != null ? config : "drizzle.config.json";
|
|
45761
48185
|
const drizzleConfig = JSON.parse(
|
|
45762
|
-
|
|
48186
|
+
import_fs10.default.readFileSync(import_path8.default.join(import_path8.default.resolve(path4))).toString()
|
|
45763
48187
|
);
|
|
45764
48188
|
return drizzleConfig;
|
|
45765
48189
|
}
|
|
45766
48190
|
if (!schema4) {
|
|
45767
48191
|
return new Error(`'schema' param must be set`);
|
|
45768
48192
|
}
|
|
45769
|
-
return configSchema.parse({ schema: schema4, out });
|
|
48193
|
+
return configSchema.parse({ schema: schema4, out, breakpoints });
|
|
45770
48194
|
};
|
|
45771
48195
|
var checkSchema = objectType({
|
|
45772
48196
|
out: stringType().optional(),
|
|
@@ -45774,6 +48198,7 @@ var checkSchema = objectType({
|
|
|
45774
48198
|
}).strict();
|
|
45775
48199
|
var checkPgCommand = new Command("check:pg").option("--out <out>", `Output folder`).option("--config <config>", `Config path [default=drizzle.config.json]`).action((options) => {
|
|
45776
48200
|
printVersions();
|
|
48201
|
+
assertOrmCoreVersion();
|
|
45777
48202
|
const params = checkSchema.parse(options);
|
|
45778
48203
|
const out = assertEitherConfigOrOut(params.config, params.out);
|
|
45779
48204
|
if (!out) {
|
|
@@ -45785,6 +48210,7 @@ var checkPgCommand = new Command("check:pg").option("--out <out>", `Output folde
|
|
|
45785
48210
|
});
|
|
45786
48211
|
var checkSqliteCommand = new Command("check:sqlite").option("--out <out>", `Output folder`).option("--config <config>", `Config path [default=drizzle.config.json]`).action((options) => {
|
|
45787
48212
|
printVersions();
|
|
48213
|
+
assertOrmCoreVersion();
|
|
45788
48214
|
const params = checkSchema.parse(options);
|
|
45789
48215
|
const out = assertEitherConfigOrOut(params.config, params.out);
|
|
45790
48216
|
if (!out) {
|
|
@@ -45796,6 +48222,7 @@ var checkSqliteCommand = new Command("check:sqlite").option("--out <out>", `Outp
|
|
|
45796
48222
|
});
|
|
45797
48223
|
var upPgCommand = new Command("up:pg").option("--out <out>", `Output folder`).option("--config <config>", `Config path [default=drizzle.config.json]`).action((options) => {
|
|
45798
48224
|
printVersions();
|
|
48225
|
+
assertOrmCoreVersion();
|
|
45799
48226
|
const params = checkSchema.parse(options);
|
|
45800
48227
|
const out = assertEitherConfigOrOut(params.config, params.out);
|
|
45801
48228
|
if (!out) {
|
|
@@ -45813,6 +48240,7 @@ var upPgCommand = new Command("up:pg").option("--out <out>", `Output folder`).op
|
|
|
45813
48240
|
});
|
|
45814
48241
|
var upMysqlCommand = new Command("up:mysql").option("--out <out>", `Output folder`).option("--config <config>", `Config path [default=drizzle.config.json]`).action((options) => {
|
|
45815
48242
|
printVersions();
|
|
48243
|
+
assertOrmCoreVersion();
|
|
45816
48244
|
const params = checkSchema.parse(options);
|
|
45817
48245
|
const out = assertEitherConfigOrOut(params.config, params.out);
|
|
45818
48246
|
if (!out) {
|
|
@@ -45834,6 +48262,7 @@ var upMysqlCommand = new Command("up:mysql").option("--out <out>", `Output folde
|
|
|
45834
48262
|
});
|
|
45835
48263
|
var upSqliteCommand = new Command("up:sqlite").option("--out <out>", `Output folder`).option("--config <config>", `Config path [default=drizzle.config.json]`).action((options) => {
|
|
45836
48264
|
printVersions();
|
|
48265
|
+
assertOrmCoreVersion();
|
|
45837
48266
|
const params = checkSchema.parse(options);
|
|
45838
48267
|
const out = assertEitherConfigOrOut(params.config, params.out);
|
|
45839
48268
|
if (!out) {
|
|
@@ -45843,9 +48272,10 @@ var upSqliteCommand = new Command("up:sqlite").option("--out <out>", `Output fol
|
|
|
45843
48272
|
upSqliteHandler(out);
|
|
45844
48273
|
});
|
|
45845
48274
|
var pt1 = objectType({
|
|
45846
|
-
out: stringType()
|
|
48275
|
+
out: stringType(),
|
|
48276
|
+
breakpoints: booleanType().optional().default(false)
|
|
45847
48277
|
});
|
|
45848
|
-
var introspectPgCommand = new Command("introspect:pg").option("--out <out>", `Migrations folder`).option("--connectionString <connectionString>", "Postgres connection string").option("--host <host>", "Postgres host").option("--port <port>", "Postgres port").option("--user <user>", "Postgres user").option("--password <password>", "Postgres password").option("--database <database>", "Postgres database name").option("--ssl <ssl>", "Postgres ssl").action(async (options) => {
|
|
48278
|
+
var introspectPgCommand = new Command("introspect:pg").option("--out <out>", `Migrations folder`).option("--breakpoints", `Prepare SQL statements with breakpoints`).option("--connectionString <connectionString>", "Postgres connection string").option("--host <host>", "Postgres host").option("--port <port>", "Postgres port").option("--user <user>", "Postgres user").option("--password <password>", "Postgres password").option("--database <database>", "Postgres database name").option("--ssl <ssl>", "Postgres ssl").action(async (options) => {
|
|
45849
48279
|
printVersions();
|
|
45850
48280
|
assertPackages("drizzle-orm");
|
|
45851
48281
|
assertOrmCoreVersion();
|
|
@@ -45861,8 +48291,8 @@ var introspectPgCommand = new Command("introspect:pg").option("--out <out>", `Mi
|
|
|
45861
48291
|
}
|
|
45862
48292
|
const { snapshots, journal } = prepareOutFolder(res.data.out, "pg");
|
|
45863
48293
|
const { schema: schema4, ts } = await pgIntrospect2(res.data);
|
|
45864
|
-
const schemaFile =
|
|
45865
|
-
(0,
|
|
48294
|
+
const schemaFile = import_path8.default.join(res.data.out, "schema.ts");
|
|
48295
|
+
(0, import_fs10.writeFileSync)(schemaFile, ts);
|
|
45866
48296
|
console.log();
|
|
45867
48297
|
if (snapshots.length === 0) {
|
|
45868
48298
|
const { sqlStatements, _meta } = await prepareSQL(
|
|
@@ -45870,15 +48300,22 @@ var introspectPgCommand = new Command("introspect:pg").option("--out <out>", `Mi
|
|
|
45870
48300
|
squashPgScheme(schema4),
|
|
45871
48301
|
"pg"
|
|
45872
48302
|
);
|
|
45873
|
-
writeResult(
|
|
48303
|
+
writeResult(
|
|
48304
|
+
schema4,
|
|
48305
|
+
sqlStatements,
|
|
48306
|
+
journal,
|
|
48307
|
+
_meta,
|
|
48308
|
+
res.data.out,
|
|
48309
|
+
res.data.breakpoints
|
|
48310
|
+
);
|
|
45874
48311
|
} else {
|
|
45875
|
-
(0,
|
|
48312
|
+
(0, import_hanji6.render)(
|
|
45876
48313
|
`[${source_default.blue(
|
|
45877
48314
|
"i"
|
|
45878
48315
|
)}] No SQL generated, you already have migrations in project`
|
|
45879
48316
|
);
|
|
45880
48317
|
}
|
|
45881
|
-
(0,
|
|
48318
|
+
(0, import_hanji6.render)(
|
|
45882
48319
|
`[${source_default.green(
|
|
45883
48320
|
"\u2713"
|
|
45884
48321
|
)}] You schema file is ready \u279C ${source_default.bold.underline.blue(
|
|
@@ -45887,7 +48324,7 @@ var introspectPgCommand = new Command("introspect:pg").option("--out <out>", `Mi
|
|
|
45887
48324
|
);
|
|
45888
48325
|
process.exit(1);
|
|
45889
48326
|
});
|
|
45890
|
-
var introspectMySqlCommand = new Command("introspect:mysql").option("--out <out>", `Migrations folder`).option("--connectionString <connectionString>", "MySQL connection string").option("--host <host>", "MySQL host").option("--port <port>", "MySQL port").option("--user <user>", "MySQL user").option("--password <password>", "MySQL password").option("--database <database>", "MySQL database name").action(async (options) => {
|
|
48327
|
+
var introspectMySqlCommand = new Command("introspect:mysql").option("--out <out>", `Migrations folder`).option("--breakpoints", `Prepare SQL statements with breakpoints`).option("--connectionString <connectionString>", "MySQL connection string").option("--host <host>", "MySQL host").option("--port <port>", "MySQL port").option("--user <user>", "MySQL user").option("--password <password>", "MySQL password").option("--database <database>", "MySQL database name").action(async (options) => {
|
|
45891
48328
|
printVersions();
|
|
45892
48329
|
assertPackages("drizzle-orm");
|
|
45893
48330
|
assertOrmCoreVersion();
|
|
@@ -45903,8 +48340,8 @@ var introspectMySqlCommand = new Command("introspect:mysql").option("--out <out>
|
|
|
45903
48340
|
}
|
|
45904
48341
|
const { snapshots, journal } = prepareOutFolder(res.data.out, "mysql");
|
|
45905
48342
|
const { schema: schema4, ts } = await mysqlIntrospect2(res.data);
|
|
45906
|
-
const schemaFile =
|
|
45907
|
-
(0,
|
|
48343
|
+
const schemaFile = import_path8.default.join(res.data.out, "schema.ts");
|
|
48344
|
+
(0, import_fs10.writeFileSync)(schemaFile, ts);
|
|
45908
48345
|
console.log();
|
|
45909
48346
|
if (snapshots.length === 0) {
|
|
45910
48347
|
const { sqlStatements, _meta } = await prepareSQL(
|
|
@@ -45912,15 +48349,22 @@ var introspectMySqlCommand = new Command("introspect:mysql").option("--out <out>
|
|
|
45912
48349
|
squashMysqlScheme(schema4),
|
|
45913
48350
|
"mysql"
|
|
45914
48351
|
);
|
|
45915
|
-
writeResult(
|
|
48352
|
+
writeResult(
|
|
48353
|
+
schema4,
|
|
48354
|
+
sqlStatements,
|
|
48355
|
+
journal,
|
|
48356
|
+
_meta,
|
|
48357
|
+
res.data.out,
|
|
48358
|
+
res.data.breakpoints
|
|
48359
|
+
);
|
|
45916
48360
|
} else {
|
|
45917
|
-
(0,
|
|
48361
|
+
(0, import_hanji6.render)(
|
|
45918
48362
|
`[${source_default.blue(
|
|
45919
48363
|
"i"
|
|
45920
48364
|
)}] No SQL generated, you already have migrations in project`
|
|
45921
48365
|
);
|
|
45922
48366
|
}
|
|
45923
|
-
(0,
|
|
48367
|
+
(0, import_hanji6.render)(
|
|
45924
48368
|
`[${source_default.green(
|
|
45925
48369
|
"\u2713"
|
|
45926
48370
|
)}] You schema file is ready \u279C ${source_default.bold.underline.blue(
|
|
@@ -45929,6 +48373,18 @@ var introspectMySqlCommand = new Command("introspect:mysql").option("--out <out>
|
|
|
45929
48373
|
);
|
|
45930
48374
|
process.exit(0);
|
|
45931
48375
|
});
|
|
48376
|
+
var dropCommand = new Command("drop").option("--out <out>", `Output folder`).option("--config <config>", `Config path [default=drizzle.config.json]`).action((options) => {
|
|
48377
|
+
printVersions();
|
|
48378
|
+
assertOrmCoreVersion();
|
|
48379
|
+
const params = checkSchema.parse(options);
|
|
48380
|
+
const out = assertEitherConfigOrOut(params.config, params.out);
|
|
48381
|
+
if (!out) {
|
|
48382
|
+
console.log(error(`'out' folder param must be set`));
|
|
48383
|
+
process.exit(0);
|
|
48384
|
+
}
|
|
48385
|
+
assertV1OutFolder(out, "{dialect}");
|
|
48386
|
+
dropMigration(out);
|
|
48387
|
+
});
|
|
45932
48388
|
program.version(versions(), "--version, -v");
|
|
45933
48389
|
program.addCommand(generatePgCommand);
|
|
45934
48390
|
program.addCommand(generateMysqlCommand);
|
|
@@ -45940,6 +48396,7 @@ program.addCommand(upMysqlCommand);
|
|
|
45940
48396
|
program.addCommand(upSqliteCommand);
|
|
45941
48397
|
program.addCommand(introspectPgCommand);
|
|
45942
48398
|
program.addCommand(introspectMySqlCommand);
|
|
48399
|
+
program.addCommand(dropCommand);
|
|
45943
48400
|
program.parse();
|
|
45944
48401
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45945
48402
|
0 && (module.exports = {
|