drizzle-kit 0.16.9-dae8c3d → 0.16.9-fcedf83
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 +2500 -47
- package/package.json +3 -1
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
|
|
|
@@ -11496,7 +11550,7 @@ var require_bare = __commonJS({
|
|
|
11496
11550
|
var sgr = require_sgr();
|
|
11497
11551
|
var supportsColor2 = require_supports_color();
|
|
11498
11552
|
var mods = sgr.mods;
|
|
11499
|
-
var
|
|
11553
|
+
var join5 = Array.prototype.join;
|
|
11500
11554
|
var defineProperty = Object.defineProperty;
|
|
11501
11555
|
var max = Math.max;
|
|
11502
11556
|
var min = Math.min;
|
|
@@ -11550,7 +11604,7 @@ var require_bare = __commonJS({
|
|
|
11550
11604
|
getFn = function() {
|
|
11551
11605
|
return setPrototypeOf(
|
|
11552
11606
|
function self2() {
|
|
11553
|
-
var start = "", end = "", msg =
|
|
11607
|
+
var start = "", end = "", msg = join5.call(arguments, " "), conf = self2._cliColorData, hasAnsi = sgr.hasCSI(msg);
|
|
11554
11608
|
forEach(
|
|
11555
11609
|
conf,
|
|
11556
11610
|
function(mod, key) {
|
|
@@ -19978,7 +20032,7 @@ var require_node2 = __commonJS({
|
|
|
19978
20032
|
resolve(data);
|
|
19979
20033
|
});
|
|
19980
20034
|
});
|
|
19981
|
-
var
|
|
20035
|
+
var readFileSync4 = (fp) => {
|
|
19982
20036
|
return _fs.default.readFileSync(fp, "utf8");
|
|
19983
20037
|
};
|
|
19984
20038
|
var pathExists = (fp) => new Promise((resolve) => {
|
|
@@ -20209,7 +20263,7 @@ var require_node2 = __commonJS({
|
|
|
20209
20263
|
data: this.packageJsonCache.get(filepath)[options.packageKey]
|
|
20210
20264
|
};
|
|
20211
20265
|
}
|
|
20212
|
-
const data = this.options.parseJSON(
|
|
20266
|
+
const data = this.options.parseJSON(readFileSync4(filepath));
|
|
20213
20267
|
return {
|
|
20214
20268
|
path: filepath,
|
|
20215
20269
|
data
|
|
@@ -20217,7 +20271,7 @@ var require_node2 = __commonJS({
|
|
|
20217
20271
|
}
|
|
20218
20272
|
return {
|
|
20219
20273
|
path: filepath,
|
|
20220
|
-
data:
|
|
20274
|
+
data: readFileSync4(filepath)
|
|
20221
20275
|
};
|
|
20222
20276
|
}
|
|
20223
20277
|
return {};
|
|
@@ -21839,19 +21893,19 @@ var require_node2 = __commonJS({
|
|
|
21839
21893
|
return walkForTsConfig(parentDirectory, existsSync4);
|
|
21840
21894
|
}
|
|
21841
21895
|
exports2.walkForTsConfig = walkForTsConfig;
|
|
21842
|
-
function loadTsconfig(configFilePath, existsSync4,
|
|
21896
|
+
function loadTsconfig(configFilePath, existsSync4, readFileSync4) {
|
|
21843
21897
|
if (existsSync4 === void 0) {
|
|
21844
21898
|
existsSync4 = fs32.existsSync;
|
|
21845
21899
|
}
|
|
21846
|
-
if (
|
|
21847
|
-
|
|
21900
|
+
if (readFileSync4 === void 0) {
|
|
21901
|
+
readFileSync4 = function(filename) {
|
|
21848
21902
|
return fs32.readFileSync(filename, "utf8");
|
|
21849
21903
|
};
|
|
21850
21904
|
}
|
|
21851
21905
|
if (!existsSync4(configFilePath)) {
|
|
21852
21906
|
return void 0;
|
|
21853
21907
|
}
|
|
21854
|
-
var configString =
|
|
21908
|
+
var configString = readFileSync4(configFilePath);
|
|
21855
21909
|
var cleanedJson = StripBom(configString);
|
|
21856
21910
|
var config = JSON5.parse(cleanedJson);
|
|
21857
21911
|
var extendedConfig = config.extends;
|
|
@@ -21864,7 +21918,7 @@ var require_node2 = __commonJS({
|
|
|
21864
21918
|
if (extendedConfig.indexOf("/") !== -1 && extendedConfig.indexOf(".") !== -1 && !existsSync4(extendedConfigPath)) {
|
|
21865
21919
|
extendedConfigPath = path4.join(currentDir, "node_modules", extendedConfig);
|
|
21866
21920
|
}
|
|
21867
|
-
var base = loadTsconfig(extendedConfigPath, existsSync4,
|
|
21921
|
+
var base = loadTsconfig(extendedConfigPath, existsSync4, readFileSync4) || {};
|
|
21868
21922
|
if (base.compilerOptions && base.compilerOptions.baseUrl) {
|
|
21869
21923
|
var extendsDir = path4.dirname(extendedConfig);
|
|
21870
21924
|
base.compilerOptions.baseUrl = path4.join(extendsDir, base.compilerOptions.baseUrl);
|
|
@@ -22501,6 +22555,2337 @@ var require_node2 = __commonJS({
|
|
|
22501
22555
|
}
|
|
22502
22556
|
});
|
|
22503
22557
|
|
|
22558
|
+
// node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js
|
|
22559
|
+
var require_old = __commonJS({
|
|
22560
|
+
"node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js"(exports) {
|
|
22561
|
+
var pathModule = require("path");
|
|
22562
|
+
var isWindows = process.platform === "win32";
|
|
22563
|
+
var fs7 = require("fs");
|
|
22564
|
+
var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
|
|
22565
|
+
function rethrow() {
|
|
22566
|
+
var callback;
|
|
22567
|
+
if (DEBUG) {
|
|
22568
|
+
var backtrace = new Error();
|
|
22569
|
+
callback = debugCallback;
|
|
22570
|
+
} else
|
|
22571
|
+
callback = missingCallback;
|
|
22572
|
+
return callback;
|
|
22573
|
+
function debugCallback(err2) {
|
|
22574
|
+
if (err2) {
|
|
22575
|
+
backtrace.message = err2.message;
|
|
22576
|
+
err2 = backtrace;
|
|
22577
|
+
missingCallback(err2);
|
|
22578
|
+
}
|
|
22579
|
+
}
|
|
22580
|
+
function missingCallback(err2) {
|
|
22581
|
+
if (err2) {
|
|
22582
|
+
if (process.throwDeprecation)
|
|
22583
|
+
throw err2;
|
|
22584
|
+
else if (!process.noDeprecation) {
|
|
22585
|
+
var msg = "fs: missing callback " + (err2.stack || err2.message);
|
|
22586
|
+
if (process.traceDeprecation)
|
|
22587
|
+
console.trace(msg);
|
|
22588
|
+
else
|
|
22589
|
+
console.error(msg);
|
|
22590
|
+
}
|
|
22591
|
+
}
|
|
22592
|
+
}
|
|
22593
|
+
}
|
|
22594
|
+
function maybeCallback(cb) {
|
|
22595
|
+
return typeof cb === "function" ? cb : rethrow();
|
|
22596
|
+
}
|
|
22597
|
+
var normalize = pathModule.normalize;
|
|
22598
|
+
if (isWindows) {
|
|
22599
|
+
nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
|
|
22600
|
+
} else {
|
|
22601
|
+
nextPartRe = /(.*?)(?:[\/]+|$)/g;
|
|
22602
|
+
}
|
|
22603
|
+
var nextPartRe;
|
|
22604
|
+
if (isWindows) {
|
|
22605
|
+
splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
|
|
22606
|
+
} else {
|
|
22607
|
+
splitRootRe = /^[\/]*/;
|
|
22608
|
+
}
|
|
22609
|
+
var splitRootRe;
|
|
22610
|
+
exports.realpathSync = function realpathSync(p, cache) {
|
|
22611
|
+
p = pathModule.resolve(p);
|
|
22612
|
+
if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
|
|
22613
|
+
return cache[p];
|
|
22614
|
+
}
|
|
22615
|
+
var original = p, seenLinks = {}, knownHard = {};
|
|
22616
|
+
var pos;
|
|
22617
|
+
var current;
|
|
22618
|
+
var base;
|
|
22619
|
+
var previous;
|
|
22620
|
+
start();
|
|
22621
|
+
function start() {
|
|
22622
|
+
var m = splitRootRe.exec(p);
|
|
22623
|
+
pos = m[0].length;
|
|
22624
|
+
current = m[0];
|
|
22625
|
+
base = m[0];
|
|
22626
|
+
previous = "";
|
|
22627
|
+
if (isWindows && !knownHard[base]) {
|
|
22628
|
+
fs7.lstatSync(base);
|
|
22629
|
+
knownHard[base] = true;
|
|
22630
|
+
}
|
|
22631
|
+
}
|
|
22632
|
+
while (pos < p.length) {
|
|
22633
|
+
nextPartRe.lastIndex = pos;
|
|
22634
|
+
var result = nextPartRe.exec(p);
|
|
22635
|
+
previous = current;
|
|
22636
|
+
current += result[0];
|
|
22637
|
+
base = previous + result[1];
|
|
22638
|
+
pos = nextPartRe.lastIndex;
|
|
22639
|
+
if (knownHard[base] || cache && cache[base] === base) {
|
|
22640
|
+
continue;
|
|
22641
|
+
}
|
|
22642
|
+
var resolvedLink;
|
|
22643
|
+
if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
|
|
22644
|
+
resolvedLink = cache[base];
|
|
22645
|
+
} else {
|
|
22646
|
+
var stat = fs7.lstatSync(base);
|
|
22647
|
+
if (!stat.isSymbolicLink()) {
|
|
22648
|
+
knownHard[base] = true;
|
|
22649
|
+
if (cache)
|
|
22650
|
+
cache[base] = base;
|
|
22651
|
+
continue;
|
|
22652
|
+
}
|
|
22653
|
+
var linkTarget = null;
|
|
22654
|
+
if (!isWindows) {
|
|
22655
|
+
var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
|
|
22656
|
+
if (seenLinks.hasOwnProperty(id)) {
|
|
22657
|
+
linkTarget = seenLinks[id];
|
|
22658
|
+
}
|
|
22659
|
+
}
|
|
22660
|
+
if (linkTarget === null) {
|
|
22661
|
+
fs7.statSync(base);
|
|
22662
|
+
linkTarget = fs7.readlinkSync(base);
|
|
22663
|
+
}
|
|
22664
|
+
resolvedLink = pathModule.resolve(previous, linkTarget);
|
|
22665
|
+
if (cache)
|
|
22666
|
+
cache[base] = resolvedLink;
|
|
22667
|
+
if (!isWindows)
|
|
22668
|
+
seenLinks[id] = linkTarget;
|
|
22669
|
+
}
|
|
22670
|
+
p = pathModule.resolve(resolvedLink, p.slice(pos));
|
|
22671
|
+
start();
|
|
22672
|
+
}
|
|
22673
|
+
if (cache)
|
|
22674
|
+
cache[original] = p;
|
|
22675
|
+
return p;
|
|
22676
|
+
};
|
|
22677
|
+
exports.realpath = function realpath(p, cache, cb) {
|
|
22678
|
+
if (typeof cb !== "function") {
|
|
22679
|
+
cb = maybeCallback(cache);
|
|
22680
|
+
cache = null;
|
|
22681
|
+
}
|
|
22682
|
+
p = pathModule.resolve(p);
|
|
22683
|
+
if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
|
|
22684
|
+
return process.nextTick(cb.bind(null, null, cache[p]));
|
|
22685
|
+
}
|
|
22686
|
+
var original = p, seenLinks = {}, knownHard = {};
|
|
22687
|
+
var pos;
|
|
22688
|
+
var current;
|
|
22689
|
+
var base;
|
|
22690
|
+
var previous;
|
|
22691
|
+
start();
|
|
22692
|
+
function start() {
|
|
22693
|
+
var m = splitRootRe.exec(p);
|
|
22694
|
+
pos = m[0].length;
|
|
22695
|
+
current = m[0];
|
|
22696
|
+
base = m[0];
|
|
22697
|
+
previous = "";
|
|
22698
|
+
if (isWindows && !knownHard[base]) {
|
|
22699
|
+
fs7.lstat(base, function(err2) {
|
|
22700
|
+
if (err2)
|
|
22701
|
+
return cb(err2);
|
|
22702
|
+
knownHard[base] = true;
|
|
22703
|
+
LOOP();
|
|
22704
|
+
});
|
|
22705
|
+
} else {
|
|
22706
|
+
process.nextTick(LOOP);
|
|
22707
|
+
}
|
|
22708
|
+
}
|
|
22709
|
+
function LOOP() {
|
|
22710
|
+
if (pos >= p.length) {
|
|
22711
|
+
if (cache)
|
|
22712
|
+
cache[original] = p;
|
|
22713
|
+
return cb(null, p);
|
|
22714
|
+
}
|
|
22715
|
+
nextPartRe.lastIndex = pos;
|
|
22716
|
+
var result = nextPartRe.exec(p);
|
|
22717
|
+
previous = current;
|
|
22718
|
+
current += result[0];
|
|
22719
|
+
base = previous + result[1];
|
|
22720
|
+
pos = nextPartRe.lastIndex;
|
|
22721
|
+
if (knownHard[base] || cache && cache[base] === base) {
|
|
22722
|
+
return process.nextTick(LOOP);
|
|
22723
|
+
}
|
|
22724
|
+
if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
|
|
22725
|
+
return gotResolvedLink(cache[base]);
|
|
22726
|
+
}
|
|
22727
|
+
return fs7.lstat(base, gotStat);
|
|
22728
|
+
}
|
|
22729
|
+
function gotStat(err2, stat) {
|
|
22730
|
+
if (err2)
|
|
22731
|
+
return cb(err2);
|
|
22732
|
+
if (!stat.isSymbolicLink()) {
|
|
22733
|
+
knownHard[base] = true;
|
|
22734
|
+
if (cache)
|
|
22735
|
+
cache[base] = base;
|
|
22736
|
+
return process.nextTick(LOOP);
|
|
22737
|
+
}
|
|
22738
|
+
if (!isWindows) {
|
|
22739
|
+
var id = stat.dev.toString(32) + ":" + stat.ino.toString(32);
|
|
22740
|
+
if (seenLinks.hasOwnProperty(id)) {
|
|
22741
|
+
return gotTarget(null, seenLinks[id], base);
|
|
22742
|
+
}
|
|
22743
|
+
}
|
|
22744
|
+
fs7.stat(base, function(err3) {
|
|
22745
|
+
if (err3)
|
|
22746
|
+
return cb(err3);
|
|
22747
|
+
fs7.readlink(base, function(err4, target) {
|
|
22748
|
+
if (!isWindows)
|
|
22749
|
+
seenLinks[id] = target;
|
|
22750
|
+
gotTarget(err4, target);
|
|
22751
|
+
});
|
|
22752
|
+
});
|
|
22753
|
+
}
|
|
22754
|
+
function gotTarget(err2, target, base2) {
|
|
22755
|
+
if (err2)
|
|
22756
|
+
return cb(err2);
|
|
22757
|
+
var resolvedLink = pathModule.resolve(previous, target);
|
|
22758
|
+
if (cache)
|
|
22759
|
+
cache[base2] = resolvedLink;
|
|
22760
|
+
gotResolvedLink(resolvedLink);
|
|
22761
|
+
}
|
|
22762
|
+
function gotResolvedLink(resolvedLink) {
|
|
22763
|
+
p = pathModule.resolve(resolvedLink, p.slice(pos));
|
|
22764
|
+
start();
|
|
22765
|
+
}
|
|
22766
|
+
};
|
|
22767
|
+
}
|
|
22768
|
+
});
|
|
22769
|
+
|
|
22770
|
+
// node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/index.js
|
|
22771
|
+
var require_fs = __commonJS({
|
|
22772
|
+
"node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/index.js"(exports, module2) {
|
|
22773
|
+
module2.exports = realpath;
|
|
22774
|
+
realpath.realpath = realpath;
|
|
22775
|
+
realpath.sync = realpathSync;
|
|
22776
|
+
realpath.realpathSync = realpathSync;
|
|
22777
|
+
realpath.monkeypatch = monkeypatch;
|
|
22778
|
+
realpath.unmonkeypatch = unmonkeypatch;
|
|
22779
|
+
var fs7 = require("fs");
|
|
22780
|
+
var origRealpath = fs7.realpath;
|
|
22781
|
+
var origRealpathSync = fs7.realpathSync;
|
|
22782
|
+
var version = process.version;
|
|
22783
|
+
var ok = /^v[0-5]\./.test(version);
|
|
22784
|
+
var old = require_old();
|
|
22785
|
+
function newError(er) {
|
|
22786
|
+
return er && er.syscall === "realpath" && (er.code === "ELOOP" || er.code === "ENOMEM" || er.code === "ENAMETOOLONG");
|
|
22787
|
+
}
|
|
22788
|
+
function realpath(p, cache, cb) {
|
|
22789
|
+
if (ok) {
|
|
22790
|
+
return origRealpath(p, cache, cb);
|
|
22791
|
+
}
|
|
22792
|
+
if (typeof cache === "function") {
|
|
22793
|
+
cb = cache;
|
|
22794
|
+
cache = null;
|
|
22795
|
+
}
|
|
22796
|
+
origRealpath(p, cache, function(er, result) {
|
|
22797
|
+
if (newError(er)) {
|
|
22798
|
+
old.realpath(p, cache, cb);
|
|
22799
|
+
} else {
|
|
22800
|
+
cb(er, result);
|
|
22801
|
+
}
|
|
22802
|
+
});
|
|
22803
|
+
}
|
|
22804
|
+
function realpathSync(p, cache) {
|
|
22805
|
+
if (ok) {
|
|
22806
|
+
return origRealpathSync(p, cache);
|
|
22807
|
+
}
|
|
22808
|
+
try {
|
|
22809
|
+
return origRealpathSync(p, cache);
|
|
22810
|
+
} catch (er) {
|
|
22811
|
+
if (newError(er)) {
|
|
22812
|
+
return old.realpathSync(p, cache);
|
|
22813
|
+
} else {
|
|
22814
|
+
throw er;
|
|
22815
|
+
}
|
|
22816
|
+
}
|
|
22817
|
+
}
|
|
22818
|
+
function monkeypatch() {
|
|
22819
|
+
fs7.realpath = realpath;
|
|
22820
|
+
fs7.realpathSync = realpathSync;
|
|
22821
|
+
}
|
|
22822
|
+
function unmonkeypatch() {
|
|
22823
|
+
fs7.realpath = origRealpath;
|
|
22824
|
+
fs7.realpathSync = origRealpathSync;
|
|
22825
|
+
}
|
|
22826
|
+
}
|
|
22827
|
+
});
|
|
22828
|
+
|
|
22829
|
+
// node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js
|
|
22830
|
+
var require_path = __commonJS({
|
|
22831
|
+
"node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/lib/path.js"(exports, module2) {
|
|
22832
|
+
var isWindows = typeof process === "object" && process && process.platform === "win32";
|
|
22833
|
+
module2.exports = isWindows ? { sep: "\\" } : { sep: "/" };
|
|
22834
|
+
}
|
|
22835
|
+
});
|
|
22836
|
+
|
|
22837
|
+
// node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js
|
|
22838
|
+
var require_balanced_match = __commonJS({
|
|
22839
|
+
"node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports, module2) {
|
|
22840
|
+
"use strict";
|
|
22841
|
+
module2.exports = balanced;
|
|
22842
|
+
function balanced(a, b, str) {
|
|
22843
|
+
if (a instanceof RegExp)
|
|
22844
|
+
a = maybeMatch(a, str);
|
|
22845
|
+
if (b instanceof RegExp)
|
|
22846
|
+
b = maybeMatch(b, str);
|
|
22847
|
+
var r = range(a, b, str);
|
|
22848
|
+
return r && {
|
|
22849
|
+
start: r[0],
|
|
22850
|
+
end: r[1],
|
|
22851
|
+
pre: str.slice(0, r[0]),
|
|
22852
|
+
body: str.slice(r[0] + a.length, r[1]),
|
|
22853
|
+
post: str.slice(r[1] + b.length)
|
|
22854
|
+
};
|
|
22855
|
+
}
|
|
22856
|
+
function maybeMatch(reg, str) {
|
|
22857
|
+
var m = str.match(reg);
|
|
22858
|
+
return m ? m[0] : null;
|
|
22859
|
+
}
|
|
22860
|
+
balanced.range = range;
|
|
22861
|
+
function range(a, b, str) {
|
|
22862
|
+
var begs, beg, left, right, result;
|
|
22863
|
+
var ai = str.indexOf(a);
|
|
22864
|
+
var bi = str.indexOf(b, ai + 1);
|
|
22865
|
+
var i = ai;
|
|
22866
|
+
if (ai >= 0 && bi > 0) {
|
|
22867
|
+
if (a === b) {
|
|
22868
|
+
return [ai, bi];
|
|
22869
|
+
}
|
|
22870
|
+
begs = [];
|
|
22871
|
+
left = str.length;
|
|
22872
|
+
while (i >= 0 && !result) {
|
|
22873
|
+
if (i == ai) {
|
|
22874
|
+
begs.push(i);
|
|
22875
|
+
ai = str.indexOf(a, i + 1);
|
|
22876
|
+
} else if (begs.length == 1) {
|
|
22877
|
+
result = [begs.pop(), bi];
|
|
22878
|
+
} else {
|
|
22879
|
+
beg = begs.pop();
|
|
22880
|
+
if (beg < left) {
|
|
22881
|
+
left = beg;
|
|
22882
|
+
right = bi;
|
|
22883
|
+
}
|
|
22884
|
+
bi = str.indexOf(b, i + 1);
|
|
22885
|
+
}
|
|
22886
|
+
i = ai < bi && ai >= 0 ? ai : bi;
|
|
22887
|
+
}
|
|
22888
|
+
if (begs.length) {
|
|
22889
|
+
result = [left, right];
|
|
22890
|
+
}
|
|
22891
|
+
}
|
|
22892
|
+
return result;
|
|
22893
|
+
}
|
|
22894
|
+
}
|
|
22895
|
+
});
|
|
22896
|
+
|
|
22897
|
+
// node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js
|
|
22898
|
+
var require_brace_expansion = __commonJS({
|
|
22899
|
+
"node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports, module2) {
|
|
22900
|
+
var balanced = require_balanced_match();
|
|
22901
|
+
module2.exports = expandTop;
|
|
22902
|
+
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
22903
|
+
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
22904
|
+
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
22905
|
+
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
22906
|
+
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
22907
|
+
function numeric(str) {
|
|
22908
|
+
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
22909
|
+
}
|
|
22910
|
+
function escapeBraces(str) {
|
|
22911
|
+
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
22912
|
+
}
|
|
22913
|
+
function unescapeBraces(str) {
|
|
22914
|
+
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
22915
|
+
}
|
|
22916
|
+
function parseCommaParts(str) {
|
|
22917
|
+
if (!str)
|
|
22918
|
+
return [""];
|
|
22919
|
+
var parts = [];
|
|
22920
|
+
var m = balanced("{", "}", str);
|
|
22921
|
+
if (!m)
|
|
22922
|
+
return str.split(",");
|
|
22923
|
+
var pre = m.pre;
|
|
22924
|
+
var body = m.body;
|
|
22925
|
+
var post = m.post;
|
|
22926
|
+
var p = pre.split(",");
|
|
22927
|
+
p[p.length - 1] += "{" + body + "}";
|
|
22928
|
+
var postParts = parseCommaParts(post);
|
|
22929
|
+
if (post.length) {
|
|
22930
|
+
p[p.length - 1] += postParts.shift();
|
|
22931
|
+
p.push.apply(p, postParts);
|
|
22932
|
+
}
|
|
22933
|
+
parts.push.apply(parts, p);
|
|
22934
|
+
return parts;
|
|
22935
|
+
}
|
|
22936
|
+
function expandTop(str) {
|
|
22937
|
+
if (!str)
|
|
22938
|
+
return [];
|
|
22939
|
+
if (str.substr(0, 2) === "{}") {
|
|
22940
|
+
str = "\\{\\}" + str.substr(2);
|
|
22941
|
+
}
|
|
22942
|
+
return expand(escapeBraces(str), true).map(unescapeBraces);
|
|
22943
|
+
}
|
|
22944
|
+
function embrace(str) {
|
|
22945
|
+
return "{" + str + "}";
|
|
22946
|
+
}
|
|
22947
|
+
function isPadded(el) {
|
|
22948
|
+
return /^-?0\d/.test(el);
|
|
22949
|
+
}
|
|
22950
|
+
function lte(i, y) {
|
|
22951
|
+
return i <= y;
|
|
22952
|
+
}
|
|
22953
|
+
function gte(i, y) {
|
|
22954
|
+
return i >= y;
|
|
22955
|
+
}
|
|
22956
|
+
function expand(str, isTop) {
|
|
22957
|
+
var expansions = [];
|
|
22958
|
+
var m = balanced("{", "}", str);
|
|
22959
|
+
if (!m)
|
|
22960
|
+
return [str];
|
|
22961
|
+
var pre = m.pre;
|
|
22962
|
+
var post = m.post.length ? expand(m.post, false) : [""];
|
|
22963
|
+
if (/\$$/.test(m.pre)) {
|
|
22964
|
+
for (var k = 0; k < post.length; k++) {
|
|
22965
|
+
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
22966
|
+
expansions.push(expansion);
|
|
22967
|
+
}
|
|
22968
|
+
} else {
|
|
22969
|
+
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
22970
|
+
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
22971
|
+
var isSequence = isNumericSequence || isAlphaSequence;
|
|
22972
|
+
var isOptions = m.body.indexOf(",") >= 0;
|
|
22973
|
+
if (!isSequence && !isOptions) {
|
|
22974
|
+
if (m.post.match(/,.*\}/)) {
|
|
22975
|
+
str = m.pre + "{" + m.body + escClose + m.post;
|
|
22976
|
+
return expand(str);
|
|
22977
|
+
}
|
|
22978
|
+
return [str];
|
|
22979
|
+
}
|
|
22980
|
+
var n;
|
|
22981
|
+
if (isSequence) {
|
|
22982
|
+
n = m.body.split(/\.\./);
|
|
22983
|
+
} else {
|
|
22984
|
+
n = parseCommaParts(m.body);
|
|
22985
|
+
if (n.length === 1) {
|
|
22986
|
+
n = expand(n[0], false).map(embrace);
|
|
22987
|
+
if (n.length === 1) {
|
|
22988
|
+
return post.map(function(p) {
|
|
22989
|
+
return m.pre + n[0] + p;
|
|
22990
|
+
});
|
|
22991
|
+
}
|
|
22992
|
+
}
|
|
22993
|
+
}
|
|
22994
|
+
var N;
|
|
22995
|
+
if (isSequence) {
|
|
22996
|
+
var x = numeric(n[0]);
|
|
22997
|
+
var y = numeric(n[1]);
|
|
22998
|
+
var width = Math.max(n[0].length, n[1].length);
|
|
22999
|
+
var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
|
|
23000
|
+
var test = lte;
|
|
23001
|
+
var reverse = y < x;
|
|
23002
|
+
if (reverse) {
|
|
23003
|
+
incr *= -1;
|
|
23004
|
+
test = gte;
|
|
23005
|
+
}
|
|
23006
|
+
var pad = n.some(isPadded);
|
|
23007
|
+
N = [];
|
|
23008
|
+
for (var i = x; test(i, y); i += incr) {
|
|
23009
|
+
var c;
|
|
23010
|
+
if (isAlphaSequence) {
|
|
23011
|
+
c = String.fromCharCode(i);
|
|
23012
|
+
if (c === "\\")
|
|
23013
|
+
c = "";
|
|
23014
|
+
} else {
|
|
23015
|
+
c = String(i);
|
|
23016
|
+
if (pad) {
|
|
23017
|
+
var need = width - c.length;
|
|
23018
|
+
if (need > 0) {
|
|
23019
|
+
var z2 = new Array(need + 1).join("0");
|
|
23020
|
+
if (i < 0)
|
|
23021
|
+
c = "-" + z2 + c.slice(1);
|
|
23022
|
+
else
|
|
23023
|
+
c = z2 + c;
|
|
23024
|
+
}
|
|
23025
|
+
}
|
|
23026
|
+
}
|
|
23027
|
+
N.push(c);
|
|
23028
|
+
}
|
|
23029
|
+
} else {
|
|
23030
|
+
N = [];
|
|
23031
|
+
for (var j = 0; j < n.length; j++) {
|
|
23032
|
+
N.push.apply(N, expand(n[j], false));
|
|
23033
|
+
}
|
|
23034
|
+
}
|
|
23035
|
+
for (var j = 0; j < N.length; j++) {
|
|
23036
|
+
for (var k = 0; k < post.length; k++) {
|
|
23037
|
+
var expansion = pre + N[j] + post[k];
|
|
23038
|
+
if (!isTop || isSequence || expansion)
|
|
23039
|
+
expansions.push(expansion);
|
|
23040
|
+
}
|
|
23041
|
+
}
|
|
23042
|
+
}
|
|
23043
|
+
return expansions;
|
|
23044
|
+
}
|
|
23045
|
+
}
|
|
23046
|
+
});
|
|
23047
|
+
|
|
23048
|
+
// node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js
|
|
23049
|
+
var require_minimatch = __commonJS({
|
|
23050
|
+
"node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js"(exports, module2) {
|
|
23051
|
+
var minimatch = module2.exports = (p, pattern, options = {}) => {
|
|
23052
|
+
assertValidPattern(pattern);
|
|
23053
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
23054
|
+
return false;
|
|
23055
|
+
}
|
|
23056
|
+
return new Minimatch(pattern, options).match(p);
|
|
23057
|
+
};
|
|
23058
|
+
module2.exports = minimatch;
|
|
23059
|
+
var path4 = require_path();
|
|
23060
|
+
minimatch.sep = path4.sep;
|
|
23061
|
+
var GLOBSTAR = Symbol("globstar **");
|
|
23062
|
+
minimatch.GLOBSTAR = GLOBSTAR;
|
|
23063
|
+
var expand = require_brace_expansion();
|
|
23064
|
+
var plTypes = {
|
|
23065
|
+
"!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
|
|
23066
|
+
"?": { open: "(?:", close: ")?" },
|
|
23067
|
+
"+": { open: "(?:", close: ")+" },
|
|
23068
|
+
"*": { open: "(?:", close: ")*" },
|
|
23069
|
+
"@": { open: "(?:", close: ")" }
|
|
23070
|
+
};
|
|
23071
|
+
var qmark = "[^/]";
|
|
23072
|
+
var star = qmark + "*?";
|
|
23073
|
+
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
23074
|
+
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
23075
|
+
var charSet = (s) => s.split("").reduce((set, c) => {
|
|
23076
|
+
set[c] = true;
|
|
23077
|
+
return set;
|
|
23078
|
+
}, {});
|
|
23079
|
+
var reSpecials = charSet("().*{}+?[]^$\\!");
|
|
23080
|
+
var addPatternStartSet = charSet("[.(");
|
|
23081
|
+
var slashSplit = /\/+/;
|
|
23082
|
+
minimatch.filter = (pattern, options = {}) => (p, i, list) => minimatch(p, pattern, options);
|
|
23083
|
+
var ext = (a, b = {}) => {
|
|
23084
|
+
const t = {};
|
|
23085
|
+
Object.keys(a).forEach((k) => t[k] = a[k]);
|
|
23086
|
+
Object.keys(b).forEach((k) => t[k] = b[k]);
|
|
23087
|
+
return t;
|
|
23088
|
+
};
|
|
23089
|
+
minimatch.defaults = (def) => {
|
|
23090
|
+
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
23091
|
+
return minimatch;
|
|
23092
|
+
}
|
|
23093
|
+
const orig = minimatch;
|
|
23094
|
+
const m = (p, pattern, options) => orig(p, pattern, ext(def, options));
|
|
23095
|
+
m.Minimatch = class Minimatch extends orig.Minimatch {
|
|
23096
|
+
constructor(pattern, options) {
|
|
23097
|
+
super(pattern, ext(def, options));
|
|
23098
|
+
}
|
|
23099
|
+
};
|
|
23100
|
+
m.Minimatch.defaults = (options) => orig.defaults(ext(def, options)).Minimatch;
|
|
23101
|
+
m.filter = (pattern, options) => orig.filter(pattern, ext(def, options));
|
|
23102
|
+
m.defaults = (options) => orig.defaults(ext(def, options));
|
|
23103
|
+
m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options));
|
|
23104
|
+
m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options));
|
|
23105
|
+
m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options));
|
|
23106
|
+
return m;
|
|
23107
|
+
};
|
|
23108
|
+
minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options);
|
|
23109
|
+
var braceExpand = (pattern, options = {}) => {
|
|
23110
|
+
assertValidPattern(pattern);
|
|
23111
|
+
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
23112
|
+
return [pattern];
|
|
23113
|
+
}
|
|
23114
|
+
return expand(pattern);
|
|
23115
|
+
};
|
|
23116
|
+
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
23117
|
+
var assertValidPattern = (pattern) => {
|
|
23118
|
+
if (typeof pattern !== "string") {
|
|
23119
|
+
throw new TypeError("invalid pattern");
|
|
23120
|
+
}
|
|
23121
|
+
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
23122
|
+
throw new TypeError("pattern is too long");
|
|
23123
|
+
}
|
|
23124
|
+
};
|
|
23125
|
+
var SUBPARSE = Symbol("subparse");
|
|
23126
|
+
minimatch.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe();
|
|
23127
|
+
minimatch.match = (list, pattern, options = {}) => {
|
|
23128
|
+
const mm = new Minimatch(pattern, options);
|
|
23129
|
+
list = list.filter((f) => mm.match(f));
|
|
23130
|
+
if (mm.options.nonull && !list.length) {
|
|
23131
|
+
list.push(pattern);
|
|
23132
|
+
}
|
|
23133
|
+
return list;
|
|
23134
|
+
};
|
|
23135
|
+
var globUnescape = (s) => s.replace(/\\(.)/g, "$1");
|
|
23136
|
+
var charUnescape = (s) => s.replace(/\\([^-\]])/g, "$1");
|
|
23137
|
+
var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
23138
|
+
var braExpEscape = (s) => s.replace(/[[\]\\]/g, "\\$&");
|
|
23139
|
+
var Minimatch = class {
|
|
23140
|
+
constructor(pattern, options) {
|
|
23141
|
+
assertValidPattern(pattern);
|
|
23142
|
+
if (!options)
|
|
23143
|
+
options = {};
|
|
23144
|
+
this.options = options;
|
|
23145
|
+
this.set = [];
|
|
23146
|
+
this.pattern = pattern;
|
|
23147
|
+
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
23148
|
+
if (this.windowsPathsNoEscape) {
|
|
23149
|
+
this.pattern = this.pattern.replace(/\\/g, "/");
|
|
23150
|
+
}
|
|
23151
|
+
this.regexp = null;
|
|
23152
|
+
this.negate = false;
|
|
23153
|
+
this.comment = false;
|
|
23154
|
+
this.empty = false;
|
|
23155
|
+
this.partial = !!options.partial;
|
|
23156
|
+
this.make();
|
|
23157
|
+
}
|
|
23158
|
+
debug() {
|
|
23159
|
+
}
|
|
23160
|
+
make() {
|
|
23161
|
+
const pattern = this.pattern;
|
|
23162
|
+
const options = this.options;
|
|
23163
|
+
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
23164
|
+
this.comment = true;
|
|
23165
|
+
return;
|
|
23166
|
+
}
|
|
23167
|
+
if (!pattern) {
|
|
23168
|
+
this.empty = true;
|
|
23169
|
+
return;
|
|
23170
|
+
}
|
|
23171
|
+
this.parseNegate();
|
|
23172
|
+
let set = this.globSet = this.braceExpand();
|
|
23173
|
+
if (options.debug)
|
|
23174
|
+
this.debug = (...args) => console.error(...args);
|
|
23175
|
+
this.debug(this.pattern, set);
|
|
23176
|
+
set = this.globParts = set.map((s) => s.split(slashSplit));
|
|
23177
|
+
this.debug(this.pattern, set);
|
|
23178
|
+
set = set.map((s, si, set2) => s.map(this.parse, this));
|
|
23179
|
+
this.debug(this.pattern, set);
|
|
23180
|
+
set = set.filter((s) => s.indexOf(false) === -1);
|
|
23181
|
+
this.debug(this.pattern, set);
|
|
23182
|
+
this.set = set;
|
|
23183
|
+
}
|
|
23184
|
+
parseNegate() {
|
|
23185
|
+
if (this.options.nonegate)
|
|
23186
|
+
return;
|
|
23187
|
+
const pattern = this.pattern;
|
|
23188
|
+
let negate = false;
|
|
23189
|
+
let negateOffset = 0;
|
|
23190
|
+
for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
|
|
23191
|
+
negate = !negate;
|
|
23192
|
+
negateOffset++;
|
|
23193
|
+
}
|
|
23194
|
+
if (negateOffset)
|
|
23195
|
+
this.pattern = pattern.slice(negateOffset);
|
|
23196
|
+
this.negate = negate;
|
|
23197
|
+
}
|
|
23198
|
+
matchOne(file, pattern, partial) {
|
|
23199
|
+
var options = this.options;
|
|
23200
|
+
this.debug(
|
|
23201
|
+
"matchOne",
|
|
23202
|
+
{ "this": this, file, pattern }
|
|
23203
|
+
);
|
|
23204
|
+
this.debug("matchOne", file.length, pattern.length);
|
|
23205
|
+
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
23206
|
+
this.debug("matchOne loop");
|
|
23207
|
+
var p = pattern[pi];
|
|
23208
|
+
var f = file[fi];
|
|
23209
|
+
this.debug(pattern, p, f);
|
|
23210
|
+
if (p === false)
|
|
23211
|
+
return false;
|
|
23212
|
+
if (p === GLOBSTAR) {
|
|
23213
|
+
this.debug("GLOBSTAR", [pattern, p, f]);
|
|
23214
|
+
var fr = fi;
|
|
23215
|
+
var pr = pi + 1;
|
|
23216
|
+
if (pr === pl) {
|
|
23217
|
+
this.debug("** at the end");
|
|
23218
|
+
for (; fi < fl; fi++) {
|
|
23219
|
+
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
|
23220
|
+
return false;
|
|
23221
|
+
}
|
|
23222
|
+
return true;
|
|
23223
|
+
}
|
|
23224
|
+
while (fr < fl) {
|
|
23225
|
+
var swallowee = file[fr];
|
|
23226
|
+
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
|
23227
|
+
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
23228
|
+
this.debug("globstar found match!", fr, fl, swallowee);
|
|
23229
|
+
return true;
|
|
23230
|
+
} else {
|
|
23231
|
+
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
|
23232
|
+
this.debug("dot detected!", file, fr, pattern, pr);
|
|
23233
|
+
break;
|
|
23234
|
+
}
|
|
23235
|
+
this.debug("globstar swallow a segment, and continue");
|
|
23236
|
+
fr++;
|
|
23237
|
+
}
|
|
23238
|
+
}
|
|
23239
|
+
if (partial) {
|
|
23240
|
+
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
|
23241
|
+
if (fr === fl)
|
|
23242
|
+
return true;
|
|
23243
|
+
}
|
|
23244
|
+
return false;
|
|
23245
|
+
}
|
|
23246
|
+
var hit;
|
|
23247
|
+
if (typeof p === "string") {
|
|
23248
|
+
hit = f === p;
|
|
23249
|
+
this.debug("string match", p, f, hit);
|
|
23250
|
+
} else {
|
|
23251
|
+
hit = f.match(p);
|
|
23252
|
+
this.debug("pattern match", p, f, hit);
|
|
23253
|
+
}
|
|
23254
|
+
if (!hit)
|
|
23255
|
+
return false;
|
|
23256
|
+
}
|
|
23257
|
+
if (fi === fl && pi === pl) {
|
|
23258
|
+
return true;
|
|
23259
|
+
} else if (fi === fl) {
|
|
23260
|
+
return partial;
|
|
23261
|
+
} else if (pi === pl) {
|
|
23262
|
+
return fi === fl - 1 && file[fi] === "";
|
|
23263
|
+
}
|
|
23264
|
+
throw new Error("wtf?");
|
|
23265
|
+
}
|
|
23266
|
+
braceExpand() {
|
|
23267
|
+
return braceExpand(this.pattern, this.options);
|
|
23268
|
+
}
|
|
23269
|
+
parse(pattern, isSub) {
|
|
23270
|
+
assertValidPattern(pattern);
|
|
23271
|
+
const options = this.options;
|
|
23272
|
+
if (pattern === "**") {
|
|
23273
|
+
if (!options.noglobstar)
|
|
23274
|
+
return GLOBSTAR;
|
|
23275
|
+
else
|
|
23276
|
+
pattern = "*";
|
|
23277
|
+
}
|
|
23278
|
+
if (pattern === "")
|
|
23279
|
+
return "";
|
|
23280
|
+
let re = "";
|
|
23281
|
+
let hasMagic = false;
|
|
23282
|
+
let escaping = false;
|
|
23283
|
+
const patternListStack = [];
|
|
23284
|
+
const negativeLists = [];
|
|
23285
|
+
let stateChar;
|
|
23286
|
+
let inClass = false;
|
|
23287
|
+
let reClassStart = -1;
|
|
23288
|
+
let classStart = -1;
|
|
23289
|
+
let cs;
|
|
23290
|
+
let pl;
|
|
23291
|
+
let sp;
|
|
23292
|
+
let dotTravAllowed = pattern.charAt(0) === ".";
|
|
23293
|
+
let dotFileAllowed = options.dot || dotTravAllowed;
|
|
23294
|
+
const patternStart = () => dotTravAllowed ? "" : dotFileAllowed ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
|
|
23295
|
+
const subPatternStart = (p) => p.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
|
|
23296
|
+
const clearStateChar = () => {
|
|
23297
|
+
if (stateChar) {
|
|
23298
|
+
switch (stateChar) {
|
|
23299
|
+
case "*":
|
|
23300
|
+
re += star;
|
|
23301
|
+
hasMagic = true;
|
|
23302
|
+
break;
|
|
23303
|
+
case "?":
|
|
23304
|
+
re += qmark;
|
|
23305
|
+
hasMagic = true;
|
|
23306
|
+
break;
|
|
23307
|
+
default:
|
|
23308
|
+
re += "\\" + stateChar;
|
|
23309
|
+
break;
|
|
23310
|
+
}
|
|
23311
|
+
this.debug("clearStateChar %j %j", stateChar, re);
|
|
23312
|
+
stateChar = false;
|
|
23313
|
+
}
|
|
23314
|
+
};
|
|
23315
|
+
for (let i = 0, c; i < pattern.length && (c = pattern.charAt(i)); i++) {
|
|
23316
|
+
this.debug("%s %s %s %j", pattern, i, re, c);
|
|
23317
|
+
if (escaping) {
|
|
23318
|
+
if (c === "/") {
|
|
23319
|
+
return false;
|
|
23320
|
+
}
|
|
23321
|
+
if (reSpecials[c]) {
|
|
23322
|
+
re += "\\";
|
|
23323
|
+
}
|
|
23324
|
+
re += c;
|
|
23325
|
+
escaping = false;
|
|
23326
|
+
continue;
|
|
23327
|
+
}
|
|
23328
|
+
switch (c) {
|
|
23329
|
+
case "/": {
|
|
23330
|
+
return false;
|
|
23331
|
+
}
|
|
23332
|
+
case "\\":
|
|
23333
|
+
if (inClass && pattern.charAt(i + 1) === "-") {
|
|
23334
|
+
re += c;
|
|
23335
|
+
continue;
|
|
23336
|
+
}
|
|
23337
|
+
clearStateChar();
|
|
23338
|
+
escaping = true;
|
|
23339
|
+
continue;
|
|
23340
|
+
case "?":
|
|
23341
|
+
case "*":
|
|
23342
|
+
case "+":
|
|
23343
|
+
case "@":
|
|
23344
|
+
case "!":
|
|
23345
|
+
this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
|
|
23346
|
+
if (inClass) {
|
|
23347
|
+
this.debug(" in class");
|
|
23348
|
+
if (c === "!" && i === classStart + 1)
|
|
23349
|
+
c = "^";
|
|
23350
|
+
re += c;
|
|
23351
|
+
continue;
|
|
23352
|
+
}
|
|
23353
|
+
this.debug("call clearStateChar %j", stateChar);
|
|
23354
|
+
clearStateChar();
|
|
23355
|
+
stateChar = c;
|
|
23356
|
+
if (options.noext)
|
|
23357
|
+
clearStateChar();
|
|
23358
|
+
continue;
|
|
23359
|
+
case "(": {
|
|
23360
|
+
if (inClass) {
|
|
23361
|
+
re += "(";
|
|
23362
|
+
continue;
|
|
23363
|
+
}
|
|
23364
|
+
if (!stateChar) {
|
|
23365
|
+
re += "\\(";
|
|
23366
|
+
continue;
|
|
23367
|
+
}
|
|
23368
|
+
const plEntry = {
|
|
23369
|
+
type: stateChar,
|
|
23370
|
+
start: i - 1,
|
|
23371
|
+
reStart: re.length,
|
|
23372
|
+
open: plTypes[stateChar].open,
|
|
23373
|
+
close: plTypes[stateChar].close
|
|
23374
|
+
};
|
|
23375
|
+
this.debug(this.pattern, " ", plEntry);
|
|
23376
|
+
patternListStack.push(plEntry);
|
|
23377
|
+
re += plEntry.open;
|
|
23378
|
+
if (plEntry.start === 0 && plEntry.type !== "!") {
|
|
23379
|
+
dotTravAllowed = true;
|
|
23380
|
+
re += subPatternStart(pattern.slice(i + 1));
|
|
23381
|
+
}
|
|
23382
|
+
this.debug("plType %j %j", stateChar, re);
|
|
23383
|
+
stateChar = false;
|
|
23384
|
+
continue;
|
|
23385
|
+
}
|
|
23386
|
+
case ")": {
|
|
23387
|
+
const plEntry = patternListStack[patternListStack.length - 1];
|
|
23388
|
+
if (inClass || !plEntry) {
|
|
23389
|
+
re += "\\)";
|
|
23390
|
+
continue;
|
|
23391
|
+
}
|
|
23392
|
+
patternListStack.pop();
|
|
23393
|
+
clearStateChar();
|
|
23394
|
+
hasMagic = true;
|
|
23395
|
+
pl = plEntry;
|
|
23396
|
+
re += pl.close;
|
|
23397
|
+
if (pl.type === "!") {
|
|
23398
|
+
negativeLists.push(Object.assign(pl, { reEnd: re.length }));
|
|
23399
|
+
}
|
|
23400
|
+
continue;
|
|
23401
|
+
}
|
|
23402
|
+
case "|": {
|
|
23403
|
+
const plEntry = patternListStack[patternListStack.length - 1];
|
|
23404
|
+
if (inClass || !plEntry) {
|
|
23405
|
+
re += "\\|";
|
|
23406
|
+
continue;
|
|
23407
|
+
}
|
|
23408
|
+
clearStateChar();
|
|
23409
|
+
re += "|";
|
|
23410
|
+
if (plEntry.start === 0 && plEntry.type !== "!") {
|
|
23411
|
+
dotTravAllowed = true;
|
|
23412
|
+
re += subPatternStart(pattern.slice(i + 1));
|
|
23413
|
+
}
|
|
23414
|
+
continue;
|
|
23415
|
+
}
|
|
23416
|
+
case "[":
|
|
23417
|
+
clearStateChar();
|
|
23418
|
+
if (inClass) {
|
|
23419
|
+
re += "\\" + c;
|
|
23420
|
+
continue;
|
|
23421
|
+
}
|
|
23422
|
+
inClass = true;
|
|
23423
|
+
classStart = i;
|
|
23424
|
+
reClassStart = re.length;
|
|
23425
|
+
re += c;
|
|
23426
|
+
continue;
|
|
23427
|
+
case "]":
|
|
23428
|
+
if (i === classStart + 1 || !inClass) {
|
|
23429
|
+
re += "\\" + c;
|
|
23430
|
+
continue;
|
|
23431
|
+
}
|
|
23432
|
+
cs = pattern.substring(classStart + 1, i);
|
|
23433
|
+
try {
|
|
23434
|
+
RegExp("[" + braExpEscape(charUnescape(cs)) + "]");
|
|
23435
|
+
re += c;
|
|
23436
|
+
} catch (er) {
|
|
23437
|
+
re = re.substring(0, reClassStart) + "(?:$.)";
|
|
23438
|
+
}
|
|
23439
|
+
hasMagic = true;
|
|
23440
|
+
inClass = false;
|
|
23441
|
+
continue;
|
|
23442
|
+
default:
|
|
23443
|
+
clearStateChar();
|
|
23444
|
+
if (reSpecials[c] && !(c === "^" && inClass)) {
|
|
23445
|
+
re += "\\";
|
|
23446
|
+
}
|
|
23447
|
+
re += c;
|
|
23448
|
+
break;
|
|
23449
|
+
}
|
|
23450
|
+
}
|
|
23451
|
+
if (inClass) {
|
|
23452
|
+
cs = pattern.slice(classStart + 1);
|
|
23453
|
+
sp = this.parse(cs, SUBPARSE);
|
|
23454
|
+
re = re.substring(0, reClassStart) + "\\[" + sp[0];
|
|
23455
|
+
hasMagic = hasMagic || sp[1];
|
|
23456
|
+
}
|
|
23457
|
+
for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
|
|
23458
|
+
let tail;
|
|
23459
|
+
tail = re.slice(pl.reStart + pl.open.length);
|
|
23460
|
+
this.debug("setting tail", re, pl);
|
|
23461
|
+
tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_, $1, $2) => {
|
|
23462
|
+
if (!$2) {
|
|
23463
|
+
$2 = "\\";
|
|
23464
|
+
}
|
|
23465
|
+
return $1 + $1 + $2 + "|";
|
|
23466
|
+
});
|
|
23467
|
+
this.debug("tail=%j\n %s", tail, tail, pl, re);
|
|
23468
|
+
const t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
|
|
23469
|
+
hasMagic = true;
|
|
23470
|
+
re = re.slice(0, pl.reStart) + t + "\\(" + tail;
|
|
23471
|
+
}
|
|
23472
|
+
clearStateChar();
|
|
23473
|
+
if (escaping) {
|
|
23474
|
+
re += "\\\\";
|
|
23475
|
+
}
|
|
23476
|
+
const addPatternStart = addPatternStartSet[re.charAt(0)];
|
|
23477
|
+
for (let n = negativeLists.length - 1; n > -1; n--) {
|
|
23478
|
+
const nl = negativeLists[n];
|
|
23479
|
+
const nlBefore = re.slice(0, nl.reStart);
|
|
23480
|
+
const nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
|
|
23481
|
+
let nlAfter = re.slice(nl.reEnd);
|
|
23482
|
+
const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter;
|
|
23483
|
+
const closeParensBefore = nlBefore.split(")").length;
|
|
23484
|
+
const openParensBefore = nlBefore.split("(").length - closeParensBefore;
|
|
23485
|
+
let cleanAfter = nlAfter;
|
|
23486
|
+
for (let i = 0; i < openParensBefore; i++) {
|
|
23487
|
+
cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
|
|
23488
|
+
}
|
|
23489
|
+
nlAfter = cleanAfter;
|
|
23490
|
+
const dollar = nlAfter === "" && isSub !== SUBPARSE ? "(?:$|\\/)" : "";
|
|
23491
|
+
re = nlBefore + nlFirst + nlAfter + dollar + nlLast;
|
|
23492
|
+
}
|
|
23493
|
+
if (re !== "" && hasMagic) {
|
|
23494
|
+
re = "(?=.)" + re;
|
|
23495
|
+
}
|
|
23496
|
+
if (addPatternStart) {
|
|
23497
|
+
re = patternStart() + re;
|
|
23498
|
+
}
|
|
23499
|
+
if (isSub === SUBPARSE) {
|
|
23500
|
+
return [re, hasMagic];
|
|
23501
|
+
}
|
|
23502
|
+
if (options.nocase && !hasMagic) {
|
|
23503
|
+
hasMagic = pattern.toUpperCase() !== pattern.toLowerCase();
|
|
23504
|
+
}
|
|
23505
|
+
if (!hasMagic) {
|
|
23506
|
+
return globUnescape(pattern);
|
|
23507
|
+
}
|
|
23508
|
+
const flags = options.nocase ? "i" : "";
|
|
23509
|
+
try {
|
|
23510
|
+
return Object.assign(new RegExp("^" + re + "$", flags), {
|
|
23511
|
+
_glob: pattern,
|
|
23512
|
+
_src: re
|
|
23513
|
+
});
|
|
23514
|
+
} catch (er) {
|
|
23515
|
+
return new RegExp("$.");
|
|
23516
|
+
}
|
|
23517
|
+
}
|
|
23518
|
+
makeRe() {
|
|
23519
|
+
if (this.regexp || this.regexp === false)
|
|
23520
|
+
return this.regexp;
|
|
23521
|
+
const set = this.set;
|
|
23522
|
+
if (!set.length) {
|
|
23523
|
+
this.regexp = false;
|
|
23524
|
+
return this.regexp;
|
|
23525
|
+
}
|
|
23526
|
+
const options = this.options;
|
|
23527
|
+
const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
|
|
23528
|
+
const flags = options.nocase ? "i" : "";
|
|
23529
|
+
let re = set.map((pattern) => {
|
|
23530
|
+
pattern = pattern.map(
|
|
23531
|
+
(p) => typeof p === "string" ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src
|
|
23532
|
+
).reduce((set2, p) => {
|
|
23533
|
+
if (!(set2[set2.length - 1] === GLOBSTAR && p === GLOBSTAR)) {
|
|
23534
|
+
set2.push(p);
|
|
23535
|
+
}
|
|
23536
|
+
return set2;
|
|
23537
|
+
}, []);
|
|
23538
|
+
pattern.forEach((p, i) => {
|
|
23539
|
+
if (p !== GLOBSTAR || pattern[i - 1] === GLOBSTAR) {
|
|
23540
|
+
return;
|
|
23541
|
+
}
|
|
23542
|
+
if (i === 0) {
|
|
23543
|
+
if (pattern.length > 1) {
|
|
23544
|
+
pattern[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + pattern[i + 1];
|
|
23545
|
+
} else {
|
|
23546
|
+
pattern[i] = twoStar;
|
|
23547
|
+
}
|
|
23548
|
+
} else if (i === pattern.length - 1) {
|
|
23549
|
+
pattern[i - 1] += "(?:\\/|" + twoStar + ")?";
|
|
23550
|
+
} else {
|
|
23551
|
+
pattern[i - 1] += "(?:\\/|\\/" + twoStar + "\\/)" + pattern[i + 1];
|
|
23552
|
+
pattern[i + 1] = GLOBSTAR;
|
|
23553
|
+
}
|
|
23554
|
+
});
|
|
23555
|
+
return pattern.filter((p) => p !== GLOBSTAR).join("/");
|
|
23556
|
+
}).join("|");
|
|
23557
|
+
re = "^(?:" + re + ")$";
|
|
23558
|
+
if (this.negate)
|
|
23559
|
+
re = "^(?!" + re + ").*$";
|
|
23560
|
+
try {
|
|
23561
|
+
this.regexp = new RegExp(re, flags);
|
|
23562
|
+
} catch (ex) {
|
|
23563
|
+
this.regexp = false;
|
|
23564
|
+
}
|
|
23565
|
+
return this.regexp;
|
|
23566
|
+
}
|
|
23567
|
+
match(f, partial = this.partial) {
|
|
23568
|
+
this.debug("match", f, this.pattern);
|
|
23569
|
+
if (this.comment)
|
|
23570
|
+
return false;
|
|
23571
|
+
if (this.empty)
|
|
23572
|
+
return f === "";
|
|
23573
|
+
if (f === "/" && partial)
|
|
23574
|
+
return true;
|
|
23575
|
+
const options = this.options;
|
|
23576
|
+
if (path4.sep !== "/") {
|
|
23577
|
+
f = f.split(path4.sep).join("/");
|
|
23578
|
+
}
|
|
23579
|
+
f = f.split(slashSplit);
|
|
23580
|
+
this.debug(this.pattern, "split", f);
|
|
23581
|
+
const set = this.set;
|
|
23582
|
+
this.debug(this.pattern, "set", set);
|
|
23583
|
+
let filename;
|
|
23584
|
+
for (let i = f.length - 1; i >= 0; i--) {
|
|
23585
|
+
filename = f[i];
|
|
23586
|
+
if (filename)
|
|
23587
|
+
break;
|
|
23588
|
+
}
|
|
23589
|
+
for (let i = 0; i < set.length; i++) {
|
|
23590
|
+
const pattern = set[i];
|
|
23591
|
+
let file = f;
|
|
23592
|
+
if (options.matchBase && pattern.length === 1) {
|
|
23593
|
+
file = [filename];
|
|
23594
|
+
}
|
|
23595
|
+
const hit = this.matchOne(file, pattern, partial);
|
|
23596
|
+
if (hit) {
|
|
23597
|
+
if (options.flipNegate)
|
|
23598
|
+
return true;
|
|
23599
|
+
return !this.negate;
|
|
23600
|
+
}
|
|
23601
|
+
}
|
|
23602
|
+
if (options.flipNegate)
|
|
23603
|
+
return false;
|
|
23604
|
+
return this.negate;
|
|
23605
|
+
}
|
|
23606
|
+
static defaults(def) {
|
|
23607
|
+
return minimatch.defaults(def).Minimatch;
|
|
23608
|
+
}
|
|
23609
|
+
};
|
|
23610
|
+
minimatch.Minimatch = Minimatch;
|
|
23611
|
+
}
|
|
23612
|
+
});
|
|
23613
|
+
|
|
23614
|
+
// node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js
|
|
23615
|
+
var require_inherits_browser = __commonJS({
|
|
23616
|
+
"node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js"(exports, module2) {
|
|
23617
|
+
if (typeof Object.create === "function") {
|
|
23618
|
+
module2.exports = function inherits(ctor, superCtor) {
|
|
23619
|
+
if (superCtor) {
|
|
23620
|
+
ctor.super_ = superCtor;
|
|
23621
|
+
ctor.prototype = Object.create(superCtor.prototype, {
|
|
23622
|
+
constructor: {
|
|
23623
|
+
value: ctor,
|
|
23624
|
+
enumerable: false,
|
|
23625
|
+
writable: true,
|
|
23626
|
+
configurable: true
|
|
23627
|
+
}
|
|
23628
|
+
});
|
|
23629
|
+
}
|
|
23630
|
+
};
|
|
23631
|
+
} else {
|
|
23632
|
+
module2.exports = function inherits(ctor, superCtor) {
|
|
23633
|
+
if (superCtor) {
|
|
23634
|
+
ctor.super_ = superCtor;
|
|
23635
|
+
var TempCtor = function() {
|
|
23636
|
+
};
|
|
23637
|
+
TempCtor.prototype = superCtor.prototype;
|
|
23638
|
+
ctor.prototype = new TempCtor();
|
|
23639
|
+
ctor.prototype.constructor = ctor;
|
|
23640
|
+
}
|
|
23641
|
+
};
|
|
23642
|
+
}
|
|
23643
|
+
}
|
|
23644
|
+
});
|
|
23645
|
+
|
|
23646
|
+
// node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js
|
|
23647
|
+
var require_inherits = __commonJS({
|
|
23648
|
+
"node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js"(exports, module2) {
|
|
23649
|
+
try {
|
|
23650
|
+
util2 = require("util");
|
|
23651
|
+
if (typeof util2.inherits !== "function")
|
|
23652
|
+
throw "";
|
|
23653
|
+
module2.exports = util2.inherits;
|
|
23654
|
+
} catch (e) {
|
|
23655
|
+
module2.exports = require_inherits_browser();
|
|
23656
|
+
}
|
|
23657
|
+
var util2;
|
|
23658
|
+
}
|
|
23659
|
+
});
|
|
23660
|
+
|
|
23661
|
+
// node_modules/.pnpm/glob@8.1.0/node_modules/glob/common.js
|
|
23662
|
+
var require_common2 = __commonJS({
|
|
23663
|
+
"node_modules/.pnpm/glob@8.1.0/node_modules/glob/common.js"(exports) {
|
|
23664
|
+
exports.setopts = setopts;
|
|
23665
|
+
exports.ownProp = ownProp;
|
|
23666
|
+
exports.makeAbs = makeAbs;
|
|
23667
|
+
exports.finish = finish;
|
|
23668
|
+
exports.mark = mark;
|
|
23669
|
+
exports.isIgnored = isIgnored;
|
|
23670
|
+
exports.childrenIgnored = childrenIgnored;
|
|
23671
|
+
function ownProp(obj, field) {
|
|
23672
|
+
return Object.prototype.hasOwnProperty.call(obj, field);
|
|
23673
|
+
}
|
|
23674
|
+
var fs7 = require("fs");
|
|
23675
|
+
var path4 = require("path");
|
|
23676
|
+
var minimatch = require_minimatch();
|
|
23677
|
+
var isAbsolute = require("path").isAbsolute;
|
|
23678
|
+
var Minimatch = minimatch.Minimatch;
|
|
23679
|
+
function alphasort(a, b) {
|
|
23680
|
+
return a.localeCompare(b, "en");
|
|
23681
|
+
}
|
|
23682
|
+
function setupIgnores(self2, options) {
|
|
23683
|
+
self2.ignore = options.ignore || [];
|
|
23684
|
+
if (!Array.isArray(self2.ignore))
|
|
23685
|
+
self2.ignore = [self2.ignore];
|
|
23686
|
+
if (self2.ignore.length) {
|
|
23687
|
+
self2.ignore = self2.ignore.map(ignoreMap);
|
|
23688
|
+
}
|
|
23689
|
+
}
|
|
23690
|
+
function ignoreMap(pattern) {
|
|
23691
|
+
var gmatcher = null;
|
|
23692
|
+
if (pattern.slice(-3) === "/**") {
|
|
23693
|
+
var gpattern = pattern.replace(/(\/\*\*)+$/, "");
|
|
23694
|
+
gmatcher = new Minimatch(gpattern, { dot: true });
|
|
23695
|
+
}
|
|
23696
|
+
return {
|
|
23697
|
+
matcher: new Minimatch(pattern, { dot: true }),
|
|
23698
|
+
gmatcher
|
|
23699
|
+
};
|
|
23700
|
+
}
|
|
23701
|
+
function setopts(self2, pattern, options) {
|
|
23702
|
+
if (!options)
|
|
23703
|
+
options = {};
|
|
23704
|
+
if (options.matchBase && -1 === pattern.indexOf("/")) {
|
|
23705
|
+
if (options.noglobstar) {
|
|
23706
|
+
throw new Error("base matching requires globstar");
|
|
23707
|
+
}
|
|
23708
|
+
pattern = "**/" + pattern;
|
|
23709
|
+
}
|
|
23710
|
+
self2.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
23711
|
+
if (self2.windowsPathsNoEscape) {
|
|
23712
|
+
pattern = pattern.replace(/\\/g, "/");
|
|
23713
|
+
}
|
|
23714
|
+
self2.silent = !!options.silent;
|
|
23715
|
+
self2.pattern = pattern;
|
|
23716
|
+
self2.strict = options.strict !== false;
|
|
23717
|
+
self2.realpath = !!options.realpath;
|
|
23718
|
+
self2.realpathCache = options.realpathCache || /* @__PURE__ */ Object.create(null);
|
|
23719
|
+
self2.follow = !!options.follow;
|
|
23720
|
+
self2.dot = !!options.dot;
|
|
23721
|
+
self2.mark = !!options.mark;
|
|
23722
|
+
self2.nodir = !!options.nodir;
|
|
23723
|
+
if (self2.nodir)
|
|
23724
|
+
self2.mark = true;
|
|
23725
|
+
self2.sync = !!options.sync;
|
|
23726
|
+
self2.nounique = !!options.nounique;
|
|
23727
|
+
self2.nonull = !!options.nonull;
|
|
23728
|
+
self2.nosort = !!options.nosort;
|
|
23729
|
+
self2.nocase = !!options.nocase;
|
|
23730
|
+
self2.stat = !!options.stat;
|
|
23731
|
+
self2.noprocess = !!options.noprocess;
|
|
23732
|
+
self2.absolute = !!options.absolute;
|
|
23733
|
+
self2.fs = options.fs || fs7;
|
|
23734
|
+
self2.maxLength = options.maxLength || Infinity;
|
|
23735
|
+
self2.cache = options.cache || /* @__PURE__ */ Object.create(null);
|
|
23736
|
+
self2.statCache = options.statCache || /* @__PURE__ */ Object.create(null);
|
|
23737
|
+
self2.symlinks = options.symlinks || /* @__PURE__ */ Object.create(null);
|
|
23738
|
+
setupIgnores(self2, options);
|
|
23739
|
+
self2.changedCwd = false;
|
|
23740
|
+
var cwd = process.cwd();
|
|
23741
|
+
if (!ownProp(options, "cwd"))
|
|
23742
|
+
self2.cwd = path4.resolve(cwd);
|
|
23743
|
+
else {
|
|
23744
|
+
self2.cwd = path4.resolve(options.cwd);
|
|
23745
|
+
self2.changedCwd = self2.cwd !== cwd;
|
|
23746
|
+
}
|
|
23747
|
+
self2.root = options.root || path4.resolve(self2.cwd, "/");
|
|
23748
|
+
self2.root = path4.resolve(self2.root);
|
|
23749
|
+
self2.cwdAbs = isAbsolute(self2.cwd) ? self2.cwd : makeAbs(self2, self2.cwd);
|
|
23750
|
+
self2.nomount = !!options.nomount;
|
|
23751
|
+
if (process.platform === "win32") {
|
|
23752
|
+
self2.root = self2.root.replace(/\\/g, "/");
|
|
23753
|
+
self2.cwd = self2.cwd.replace(/\\/g, "/");
|
|
23754
|
+
self2.cwdAbs = self2.cwdAbs.replace(/\\/g, "/");
|
|
23755
|
+
}
|
|
23756
|
+
options.nonegate = true;
|
|
23757
|
+
options.nocomment = true;
|
|
23758
|
+
self2.minimatch = new Minimatch(pattern, options);
|
|
23759
|
+
self2.options = self2.minimatch.options;
|
|
23760
|
+
}
|
|
23761
|
+
function finish(self2) {
|
|
23762
|
+
var nou = self2.nounique;
|
|
23763
|
+
var all = nou ? [] : /* @__PURE__ */ Object.create(null);
|
|
23764
|
+
for (var i = 0, l = self2.matches.length; i < l; i++) {
|
|
23765
|
+
var matches = self2.matches[i];
|
|
23766
|
+
if (!matches || Object.keys(matches).length === 0) {
|
|
23767
|
+
if (self2.nonull) {
|
|
23768
|
+
var literal = self2.minimatch.globSet[i];
|
|
23769
|
+
if (nou)
|
|
23770
|
+
all.push(literal);
|
|
23771
|
+
else
|
|
23772
|
+
all[literal] = true;
|
|
23773
|
+
}
|
|
23774
|
+
} else {
|
|
23775
|
+
var m = Object.keys(matches);
|
|
23776
|
+
if (nou)
|
|
23777
|
+
all.push.apply(all, m);
|
|
23778
|
+
else
|
|
23779
|
+
m.forEach(function(m2) {
|
|
23780
|
+
all[m2] = true;
|
|
23781
|
+
});
|
|
23782
|
+
}
|
|
23783
|
+
}
|
|
23784
|
+
if (!nou)
|
|
23785
|
+
all = Object.keys(all);
|
|
23786
|
+
if (!self2.nosort)
|
|
23787
|
+
all = all.sort(alphasort);
|
|
23788
|
+
if (self2.mark) {
|
|
23789
|
+
for (var i = 0; i < all.length; i++) {
|
|
23790
|
+
all[i] = self2._mark(all[i]);
|
|
23791
|
+
}
|
|
23792
|
+
if (self2.nodir) {
|
|
23793
|
+
all = all.filter(function(e) {
|
|
23794
|
+
var notDir = !/\/$/.test(e);
|
|
23795
|
+
var c = self2.cache[e] || self2.cache[makeAbs(self2, e)];
|
|
23796
|
+
if (notDir && c)
|
|
23797
|
+
notDir = c !== "DIR" && !Array.isArray(c);
|
|
23798
|
+
return notDir;
|
|
23799
|
+
});
|
|
23800
|
+
}
|
|
23801
|
+
}
|
|
23802
|
+
if (self2.ignore.length)
|
|
23803
|
+
all = all.filter(function(m2) {
|
|
23804
|
+
return !isIgnored(self2, m2);
|
|
23805
|
+
});
|
|
23806
|
+
self2.found = all;
|
|
23807
|
+
}
|
|
23808
|
+
function mark(self2, p) {
|
|
23809
|
+
var abs = makeAbs(self2, p);
|
|
23810
|
+
var c = self2.cache[abs];
|
|
23811
|
+
var m = p;
|
|
23812
|
+
if (c) {
|
|
23813
|
+
var isDir = c === "DIR" || Array.isArray(c);
|
|
23814
|
+
var slash = p.slice(-1) === "/";
|
|
23815
|
+
if (isDir && !slash)
|
|
23816
|
+
m += "/";
|
|
23817
|
+
else if (!isDir && slash)
|
|
23818
|
+
m = m.slice(0, -1);
|
|
23819
|
+
if (m !== p) {
|
|
23820
|
+
var mabs = makeAbs(self2, m);
|
|
23821
|
+
self2.statCache[mabs] = self2.statCache[abs];
|
|
23822
|
+
self2.cache[mabs] = self2.cache[abs];
|
|
23823
|
+
}
|
|
23824
|
+
}
|
|
23825
|
+
return m;
|
|
23826
|
+
}
|
|
23827
|
+
function makeAbs(self2, f) {
|
|
23828
|
+
var abs = f;
|
|
23829
|
+
if (f.charAt(0) === "/") {
|
|
23830
|
+
abs = path4.join(self2.root, f);
|
|
23831
|
+
} else if (isAbsolute(f) || f === "") {
|
|
23832
|
+
abs = f;
|
|
23833
|
+
} else if (self2.changedCwd) {
|
|
23834
|
+
abs = path4.resolve(self2.cwd, f);
|
|
23835
|
+
} else {
|
|
23836
|
+
abs = path4.resolve(f);
|
|
23837
|
+
}
|
|
23838
|
+
if (process.platform === "win32")
|
|
23839
|
+
abs = abs.replace(/\\/g, "/");
|
|
23840
|
+
return abs;
|
|
23841
|
+
}
|
|
23842
|
+
function isIgnored(self2, path5) {
|
|
23843
|
+
if (!self2.ignore.length)
|
|
23844
|
+
return false;
|
|
23845
|
+
return self2.ignore.some(function(item) {
|
|
23846
|
+
return item.matcher.match(path5) || !!(item.gmatcher && item.gmatcher.match(path5));
|
|
23847
|
+
});
|
|
23848
|
+
}
|
|
23849
|
+
function childrenIgnored(self2, path5) {
|
|
23850
|
+
if (!self2.ignore.length)
|
|
23851
|
+
return false;
|
|
23852
|
+
return self2.ignore.some(function(item) {
|
|
23853
|
+
return !!(item.gmatcher && item.gmatcher.match(path5));
|
|
23854
|
+
});
|
|
23855
|
+
}
|
|
23856
|
+
}
|
|
23857
|
+
});
|
|
23858
|
+
|
|
23859
|
+
// node_modules/.pnpm/glob@8.1.0/node_modules/glob/sync.js
|
|
23860
|
+
var require_sync = __commonJS({
|
|
23861
|
+
"node_modules/.pnpm/glob@8.1.0/node_modules/glob/sync.js"(exports, module2) {
|
|
23862
|
+
module2.exports = globSync;
|
|
23863
|
+
globSync.GlobSync = GlobSync;
|
|
23864
|
+
var rp = require_fs();
|
|
23865
|
+
var minimatch = require_minimatch();
|
|
23866
|
+
var Minimatch = minimatch.Minimatch;
|
|
23867
|
+
var Glob = require_glob().Glob;
|
|
23868
|
+
var util2 = require("util");
|
|
23869
|
+
var path4 = require("path");
|
|
23870
|
+
var assert = require("assert");
|
|
23871
|
+
var isAbsolute = require("path").isAbsolute;
|
|
23872
|
+
var common = require_common2();
|
|
23873
|
+
var setopts = common.setopts;
|
|
23874
|
+
var ownProp = common.ownProp;
|
|
23875
|
+
var childrenIgnored = common.childrenIgnored;
|
|
23876
|
+
var isIgnored = common.isIgnored;
|
|
23877
|
+
function globSync(pattern, options) {
|
|
23878
|
+
if (typeof options === "function" || arguments.length === 3)
|
|
23879
|
+
throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
|
|
23880
|
+
return new GlobSync(pattern, options).found;
|
|
23881
|
+
}
|
|
23882
|
+
function GlobSync(pattern, options) {
|
|
23883
|
+
if (!pattern)
|
|
23884
|
+
throw new Error("must provide pattern");
|
|
23885
|
+
if (typeof options === "function" || arguments.length === 3)
|
|
23886
|
+
throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");
|
|
23887
|
+
if (!(this instanceof GlobSync))
|
|
23888
|
+
return new GlobSync(pattern, options);
|
|
23889
|
+
setopts(this, pattern, options);
|
|
23890
|
+
if (this.noprocess)
|
|
23891
|
+
return this;
|
|
23892
|
+
var n = this.minimatch.set.length;
|
|
23893
|
+
this.matches = new Array(n);
|
|
23894
|
+
for (var i = 0; i < n; i++) {
|
|
23895
|
+
this._process(this.minimatch.set[i], i, false);
|
|
23896
|
+
}
|
|
23897
|
+
this._finish();
|
|
23898
|
+
}
|
|
23899
|
+
GlobSync.prototype._finish = function() {
|
|
23900
|
+
assert.ok(this instanceof GlobSync);
|
|
23901
|
+
if (this.realpath) {
|
|
23902
|
+
var self2 = this;
|
|
23903
|
+
this.matches.forEach(function(matchset, index4) {
|
|
23904
|
+
var set = self2.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
23905
|
+
for (var p in matchset) {
|
|
23906
|
+
try {
|
|
23907
|
+
p = self2._makeAbs(p);
|
|
23908
|
+
var real = rp.realpathSync(p, self2.realpathCache);
|
|
23909
|
+
set[real] = true;
|
|
23910
|
+
} catch (er) {
|
|
23911
|
+
if (er.syscall === "stat")
|
|
23912
|
+
set[self2._makeAbs(p)] = true;
|
|
23913
|
+
else
|
|
23914
|
+
throw er;
|
|
23915
|
+
}
|
|
23916
|
+
}
|
|
23917
|
+
});
|
|
23918
|
+
}
|
|
23919
|
+
common.finish(this);
|
|
23920
|
+
};
|
|
23921
|
+
GlobSync.prototype._process = function(pattern, index4, inGlobStar) {
|
|
23922
|
+
assert.ok(this instanceof GlobSync);
|
|
23923
|
+
var n = 0;
|
|
23924
|
+
while (typeof pattern[n] === "string") {
|
|
23925
|
+
n++;
|
|
23926
|
+
}
|
|
23927
|
+
var prefix;
|
|
23928
|
+
switch (n) {
|
|
23929
|
+
case pattern.length:
|
|
23930
|
+
this._processSimple(pattern.join("/"), index4);
|
|
23931
|
+
return;
|
|
23932
|
+
case 0:
|
|
23933
|
+
prefix = null;
|
|
23934
|
+
break;
|
|
23935
|
+
default:
|
|
23936
|
+
prefix = pattern.slice(0, n).join("/");
|
|
23937
|
+
break;
|
|
23938
|
+
}
|
|
23939
|
+
var remain = pattern.slice(n);
|
|
23940
|
+
var read;
|
|
23941
|
+
if (prefix === null)
|
|
23942
|
+
read = ".";
|
|
23943
|
+
else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
|
|
23944
|
+
return typeof p === "string" ? p : "[*]";
|
|
23945
|
+
}).join("/"))) {
|
|
23946
|
+
if (!prefix || !isAbsolute(prefix))
|
|
23947
|
+
prefix = "/" + prefix;
|
|
23948
|
+
read = prefix;
|
|
23949
|
+
} else
|
|
23950
|
+
read = prefix;
|
|
23951
|
+
var abs = this._makeAbs(read);
|
|
23952
|
+
if (childrenIgnored(this, read))
|
|
23953
|
+
return;
|
|
23954
|
+
var isGlobStar = remain[0] === minimatch.GLOBSTAR;
|
|
23955
|
+
if (isGlobStar)
|
|
23956
|
+
this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar);
|
|
23957
|
+
else
|
|
23958
|
+
this._processReaddir(prefix, read, abs, remain, index4, inGlobStar);
|
|
23959
|
+
};
|
|
23960
|
+
GlobSync.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar) {
|
|
23961
|
+
var entries = this._readdir(abs, inGlobStar);
|
|
23962
|
+
if (!entries)
|
|
23963
|
+
return;
|
|
23964
|
+
var pn = remain[0];
|
|
23965
|
+
var negate = !!this.minimatch.negate;
|
|
23966
|
+
var rawGlob = pn._glob;
|
|
23967
|
+
var dotOk = this.dot || rawGlob.charAt(0) === ".";
|
|
23968
|
+
var matchedEntries = [];
|
|
23969
|
+
for (var i = 0; i < entries.length; i++) {
|
|
23970
|
+
var e = entries[i];
|
|
23971
|
+
if (e.charAt(0) !== "." || dotOk) {
|
|
23972
|
+
var m;
|
|
23973
|
+
if (negate && !prefix) {
|
|
23974
|
+
m = !e.match(pn);
|
|
23975
|
+
} else {
|
|
23976
|
+
m = e.match(pn);
|
|
23977
|
+
}
|
|
23978
|
+
if (m)
|
|
23979
|
+
matchedEntries.push(e);
|
|
23980
|
+
}
|
|
23981
|
+
}
|
|
23982
|
+
var len = matchedEntries.length;
|
|
23983
|
+
if (len === 0)
|
|
23984
|
+
return;
|
|
23985
|
+
if (remain.length === 1 && !this.mark && !this.stat) {
|
|
23986
|
+
if (!this.matches[index4])
|
|
23987
|
+
this.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
23988
|
+
for (var i = 0; i < len; i++) {
|
|
23989
|
+
var e = matchedEntries[i];
|
|
23990
|
+
if (prefix) {
|
|
23991
|
+
if (prefix.slice(-1) !== "/")
|
|
23992
|
+
e = prefix + "/" + e;
|
|
23993
|
+
else
|
|
23994
|
+
e = prefix + e;
|
|
23995
|
+
}
|
|
23996
|
+
if (e.charAt(0) === "/" && !this.nomount) {
|
|
23997
|
+
e = path4.join(this.root, e);
|
|
23998
|
+
}
|
|
23999
|
+
this._emitMatch(index4, e);
|
|
24000
|
+
}
|
|
24001
|
+
return;
|
|
24002
|
+
}
|
|
24003
|
+
remain.shift();
|
|
24004
|
+
for (var i = 0; i < len; i++) {
|
|
24005
|
+
var e = matchedEntries[i];
|
|
24006
|
+
var newPattern;
|
|
24007
|
+
if (prefix)
|
|
24008
|
+
newPattern = [prefix, e];
|
|
24009
|
+
else
|
|
24010
|
+
newPattern = [e];
|
|
24011
|
+
this._process(newPattern.concat(remain), index4, inGlobStar);
|
|
24012
|
+
}
|
|
24013
|
+
};
|
|
24014
|
+
GlobSync.prototype._emitMatch = function(index4, e) {
|
|
24015
|
+
if (isIgnored(this, e))
|
|
24016
|
+
return;
|
|
24017
|
+
var abs = this._makeAbs(e);
|
|
24018
|
+
if (this.mark)
|
|
24019
|
+
e = this._mark(e);
|
|
24020
|
+
if (this.absolute) {
|
|
24021
|
+
e = abs;
|
|
24022
|
+
}
|
|
24023
|
+
if (this.matches[index4][e])
|
|
24024
|
+
return;
|
|
24025
|
+
if (this.nodir) {
|
|
24026
|
+
var c = this.cache[abs];
|
|
24027
|
+
if (c === "DIR" || Array.isArray(c))
|
|
24028
|
+
return;
|
|
24029
|
+
}
|
|
24030
|
+
this.matches[index4][e] = true;
|
|
24031
|
+
if (this.stat)
|
|
24032
|
+
this._stat(e);
|
|
24033
|
+
};
|
|
24034
|
+
GlobSync.prototype._readdirInGlobStar = function(abs) {
|
|
24035
|
+
if (this.follow)
|
|
24036
|
+
return this._readdir(abs, false);
|
|
24037
|
+
var entries;
|
|
24038
|
+
var lstat;
|
|
24039
|
+
var stat;
|
|
24040
|
+
try {
|
|
24041
|
+
lstat = this.fs.lstatSync(abs);
|
|
24042
|
+
} catch (er) {
|
|
24043
|
+
if (er.code === "ENOENT") {
|
|
24044
|
+
return null;
|
|
24045
|
+
}
|
|
24046
|
+
}
|
|
24047
|
+
var isSym = lstat && lstat.isSymbolicLink();
|
|
24048
|
+
this.symlinks[abs] = isSym;
|
|
24049
|
+
if (!isSym && lstat && !lstat.isDirectory())
|
|
24050
|
+
this.cache[abs] = "FILE";
|
|
24051
|
+
else
|
|
24052
|
+
entries = this._readdir(abs, false);
|
|
24053
|
+
return entries;
|
|
24054
|
+
};
|
|
24055
|
+
GlobSync.prototype._readdir = function(abs, inGlobStar) {
|
|
24056
|
+
var entries;
|
|
24057
|
+
if (inGlobStar && !ownProp(this.symlinks, abs))
|
|
24058
|
+
return this._readdirInGlobStar(abs);
|
|
24059
|
+
if (ownProp(this.cache, abs)) {
|
|
24060
|
+
var c = this.cache[abs];
|
|
24061
|
+
if (!c || c === "FILE")
|
|
24062
|
+
return null;
|
|
24063
|
+
if (Array.isArray(c))
|
|
24064
|
+
return c;
|
|
24065
|
+
}
|
|
24066
|
+
try {
|
|
24067
|
+
return this._readdirEntries(abs, this.fs.readdirSync(abs));
|
|
24068
|
+
} catch (er) {
|
|
24069
|
+
this._readdirError(abs, er);
|
|
24070
|
+
return null;
|
|
24071
|
+
}
|
|
24072
|
+
};
|
|
24073
|
+
GlobSync.prototype._readdirEntries = function(abs, entries) {
|
|
24074
|
+
if (!this.mark && !this.stat) {
|
|
24075
|
+
for (var i = 0; i < entries.length; i++) {
|
|
24076
|
+
var e = entries[i];
|
|
24077
|
+
if (abs === "/")
|
|
24078
|
+
e = abs + e;
|
|
24079
|
+
else
|
|
24080
|
+
e = abs + "/" + e;
|
|
24081
|
+
this.cache[e] = true;
|
|
24082
|
+
}
|
|
24083
|
+
}
|
|
24084
|
+
this.cache[abs] = entries;
|
|
24085
|
+
return entries;
|
|
24086
|
+
};
|
|
24087
|
+
GlobSync.prototype._readdirError = function(f, er) {
|
|
24088
|
+
switch (er.code) {
|
|
24089
|
+
case "ENOTSUP":
|
|
24090
|
+
case "ENOTDIR":
|
|
24091
|
+
var abs = this._makeAbs(f);
|
|
24092
|
+
this.cache[abs] = "FILE";
|
|
24093
|
+
if (abs === this.cwdAbs) {
|
|
24094
|
+
var error2 = new Error(er.code + " invalid cwd " + this.cwd);
|
|
24095
|
+
error2.path = this.cwd;
|
|
24096
|
+
error2.code = er.code;
|
|
24097
|
+
throw error2;
|
|
24098
|
+
}
|
|
24099
|
+
break;
|
|
24100
|
+
case "ENOENT":
|
|
24101
|
+
case "ELOOP":
|
|
24102
|
+
case "ENAMETOOLONG":
|
|
24103
|
+
case "UNKNOWN":
|
|
24104
|
+
this.cache[this._makeAbs(f)] = false;
|
|
24105
|
+
break;
|
|
24106
|
+
default:
|
|
24107
|
+
this.cache[this._makeAbs(f)] = false;
|
|
24108
|
+
if (this.strict)
|
|
24109
|
+
throw er;
|
|
24110
|
+
if (!this.silent)
|
|
24111
|
+
console.error("glob error", er);
|
|
24112
|
+
break;
|
|
24113
|
+
}
|
|
24114
|
+
};
|
|
24115
|
+
GlobSync.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar) {
|
|
24116
|
+
var entries = this._readdir(abs, inGlobStar);
|
|
24117
|
+
if (!entries)
|
|
24118
|
+
return;
|
|
24119
|
+
var remainWithoutGlobStar = remain.slice(1);
|
|
24120
|
+
var gspref = prefix ? [prefix] : [];
|
|
24121
|
+
var noGlobStar = gspref.concat(remainWithoutGlobStar);
|
|
24122
|
+
this._process(noGlobStar, index4, false);
|
|
24123
|
+
var len = entries.length;
|
|
24124
|
+
var isSym = this.symlinks[abs];
|
|
24125
|
+
if (isSym && inGlobStar)
|
|
24126
|
+
return;
|
|
24127
|
+
for (var i = 0; i < len; i++) {
|
|
24128
|
+
var e = entries[i];
|
|
24129
|
+
if (e.charAt(0) === "." && !this.dot)
|
|
24130
|
+
continue;
|
|
24131
|
+
var instead = gspref.concat(entries[i], remainWithoutGlobStar);
|
|
24132
|
+
this._process(instead, index4, true);
|
|
24133
|
+
var below = gspref.concat(entries[i], remain);
|
|
24134
|
+
this._process(below, index4, true);
|
|
24135
|
+
}
|
|
24136
|
+
};
|
|
24137
|
+
GlobSync.prototype._processSimple = function(prefix, index4) {
|
|
24138
|
+
var exists = this._stat(prefix);
|
|
24139
|
+
if (!this.matches[index4])
|
|
24140
|
+
this.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
24141
|
+
if (!exists)
|
|
24142
|
+
return;
|
|
24143
|
+
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
|
24144
|
+
var trail = /[\/\\]$/.test(prefix);
|
|
24145
|
+
if (prefix.charAt(0) === "/") {
|
|
24146
|
+
prefix = path4.join(this.root, prefix);
|
|
24147
|
+
} else {
|
|
24148
|
+
prefix = path4.resolve(this.root, prefix);
|
|
24149
|
+
if (trail)
|
|
24150
|
+
prefix += "/";
|
|
24151
|
+
}
|
|
24152
|
+
}
|
|
24153
|
+
if (process.platform === "win32")
|
|
24154
|
+
prefix = prefix.replace(/\\/g, "/");
|
|
24155
|
+
this._emitMatch(index4, prefix);
|
|
24156
|
+
};
|
|
24157
|
+
GlobSync.prototype._stat = function(f) {
|
|
24158
|
+
var abs = this._makeAbs(f);
|
|
24159
|
+
var needDir = f.slice(-1) === "/";
|
|
24160
|
+
if (f.length > this.maxLength)
|
|
24161
|
+
return false;
|
|
24162
|
+
if (!this.stat && ownProp(this.cache, abs)) {
|
|
24163
|
+
var c = this.cache[abs];
|
|
24164
|
+
if (Array.isArray(c))
|
|
24165
|
+
c = "DIR";
|
|
24166
|
+
if (!needDir || c === "DIR")
|
|
24167
|
+
return c;
|
|
24168
|
+
if (needDir && c === "FILE")
|
|
24169
|
+
return false;
|
|
24170
|
+
}
|
|
24171
|
+
var exists;
|
|
24172
|
+
var stat = this.statCache[abs];
|
|
24173
|
+
if (!stat) {
|
|
24174
|
+
var lstat;
|
|
24175
|
+
try {
|
|
24176
|
+
lstat = this.fs.lstatSync(abs);
|
|
24177
|
+
} catch (er) {
|
|
24178
|
+
if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
|
|
24179
|
+
this.statCache[abs] = false;
|
|
24180
|
+
return false;
|
|
24181
|
+
}
|
|
24182
|
+
}
|
|
24183
|
+
if (lstat && lstat.isSymbolicLink()) {
|
|
24184
|
+
try {
|
|
24185
|
+
stat = this.fs.statSync(abs);
|
|
24186
|
+
} catch (er) {
|
|
24187
|
+
stat = lstat;
|
|
24188
|
+
}
|
|
24189
|
+
} else {
|
|
24190
|
+
stat = lstat;
|
|
24191
|
+
}
|
|
24192
|
+
}
|
|
24193
|
+
this.statCache[abs] = stat;
|
|
24194
|
+
var c = true;
|
|
24195
|
+
if (stat)
|
|
24196
|
+
c = stat.isDirectory() ? "DIR" : "FILE";
|
|
24197
|
+
this.cache[abs] = this.cache[abs] || c;
|
|
24198
|
+
if (needDir && c === "FILE")
|
|
24199
|
+
return false;
|
|
24200
|
+
return c;
|
|
24201
|
+
};
|
|
24202
|
+
GlobSync.prototype._mark = function(p) {
|
|
24203
|
+
return common.mark(this, p);
|
|
24204
|
+
};
|
|
24205
|
+
GlobSync.prototype._makeAbs = function(f) {
|
|
24206
|
+
return common.makeAbs(this, f);
|
|
24207
|
+
};
|
|
24208
|
+
}
|
|
24209
|
+
});
|
|
24210
|
+
|
|
24211
|
+
// node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js
|
|
24212
|
+
var require_wrappy = __commonJS({
|
|
24213
|
+
"node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports, module2) {
|
|
24214
|
+
module2.exports = wrappy;
|
|
24215
|
+
function wrappy(fn, cb) {
|
|
24216
|
+
if (fn && cb)
|
|
24217
|
+
return wrappy(fn)(cb);
|
|
24218
|
+
if (typeof fn !== "function")
|
|
24219
|
+
throw new TypeError("need wrapper function");
|
|
24220
|
+
Object.keys(fn).forEach(function(k) {
|
|
24221
|
+
wrapper[k] = fn[k];
|
|
24222
|
+
});
|
|
24223
|
+
return wrapper;
|
|
24224
|
+
function wrapper() {
|
|
24225
|
+
var args = new Array(arguments.length);
|
|
24226
|
+
for (var i = 0; i < args.length; i++) {
|
|
24227
|
+
args[i] = arguments[i];
|
|
24228
|
+
}
|
|
24229
|
+
var ret = fn.apply(this, args);
|
|
24230
|
+
var cb2 = args[args.length - 1];
|
|
24231
|
+
if (typeof ret === "function" && ret !== cb2) {
|
|
24232
|
+
Object.keys(cb2).forEach(function(k) {
|
|
24233
|
+
ret[k] = cb2[k];
|
|
24234
|
+
});
|
|
24235
|
+
}
|
|
24236
|
+
return ret;
|
|
24237
|
+
}
|
|
24238
|
+
}
|
|
24239
|
+
}
|
|
24240
|
+
});
|
|
24241
|
+
|
|
24242
|
+
// node_modules/.pnpm/once@1.4.0/node_modules/once/once.js
|
|
24243
|
+
var require_once = __commonJS({
|
|
24244
|
+
"node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports, module2) {
|
|
24245
|
+
var wrappy = require_wrappy();
|
|
24246
|
+
module2.exports = wrappy(once);
|
|
24247
|
+
module2.exports.strict = wrappy(onceStrict);
|
|
24248
|
+
once.proto = once(function() {
|
|
24249
|
+
Object.defineProperty(Function.prototype, "once", {
|
|
24250
|
+
value: function() {
|
|
24251
|
+
return once(this);
|
|
24252
|
+
},
|
|
24253
|
+
configurable: true
|
|
24254
|
+
});
|
|
24255
|
+
Object.defineProperty(Function.prototype, "onceStrict", {
|
|
24256
|
+
value: function() {
|
|
24257
|
+
return onceStrict(this);
|
|
24258
|
+
},
|
|
24259
|
+
configurable: true
|
|
24260
|
+
});
|
|
24261
|
+
});
|
|
24262
|
+
function once(fn) {
|
|
24263
|
+
var f = function() {
|
|
24264
|
+
if (f.called)
|
|
24265
|
+
return f.value;
|
|
24266
|
+
f.called = true;
|
|
24267
|
+
return f.value = fn.apply(this, arguments);
|
|
24268
|
+
};
|
|
24269
|
+
f.called = false;
|
|
24270
|
+
return f;
|
|
24271
|
+
}
|
|
24272
|
+
function onceStrict(fn) {
|
|
24273
|
+
var f = function() {
|
|
24274
|
+
if (f.called)
|
|
24275
|
+
throw new Error(f.onceError);
|
|
24276
|
+
f.called = true;
|
|
24277
|
+
return f.value = fn.apply(this, arguments);
|
|
24278
|
+
};
|
|
24279
|
+
var name = fn.name || "Function wrapped with `once`";
|
|
24280
|
+
f.onceError = name + " shouldn't be called more than once";
|
|
24281
|
+
f.called = false;
|
|
24282
|
+
return f;
|
|
24283
|
+
}
|
|
24284
|
+
}
|
|
24285
|
+
});
|
|
24286
|
+
|
|
24287
|
+
// node_modules/.pnpm/inflight@1.0.6/node_modules/inflight/inflight.js
|
|
24288
|
+
var require_inflight = __commonJS({
|
|
24289
|
+
"node_modules/.pnpm/inflight@1.0.6/node_modules/inflight/inflight.js"(exports, module2) {
|
|
24290
|
+
var wrappy = require_wrappy();
|
|
24291
|
+
var reqs = /* @__PURE__ */ Object.create(null);
|
|
24292
|
+
var once = require_once();
|
|
24293
|
+
module2.exports = wrappy(inflight);
|
|
24294
|
+
function inflight(key, cb) {
|
|
24295
|
+
if (reqs[key]) {
|
|
24296
|
+
reqs[key].push(cb);
|
|
24297
|
+
return null;
|
|
24298
|
+
} else {
|
|
24299
|
+
reqs[key] = [cb];
|
|
24300
|
+
return makeres(key);
|
|
24301
|
+
}
|
|
24302
|
+
}
|
|
24303
|
+
function makeres(key) {
|
|
24304
|
+
return once(function RES() {
|
|
24305
|
+
var cbs = reqs[key];
|
|
24306
|
+
var len = cbs.length;
|
|
24307
|
+
var args = slice(arguments);
|
|
24308
|
+
try {
|
|
24309
|
+
for (var i = 0; i < len; i++) {
|
|
24310
|
+
cbs[i].apply(null, args);
|
|
24311
|
+
}
|
|
24312
|
+
} finally {
|
|
24313
|
+
if (cbs.length > len) {
|
|
24314
|
+
cbs.splice(0, len);
|
|
24315
|
+
process.nextTick(function() {
|
|
24316
|
+
RES.apply(null, args);
|
|
24317
|
+
});
|
|
24318
|
+
} else {
|
|
24319
|
+
delete reqs[key];
|
|
24320
|
+
}
|
|
24321
|
+
}
|
|
24322
|
+
});
|
|
24323
|
+
}
|
|
24324
|
+
function slice(args) {
|
|
24325
|
+
var length = args.length;
|
|
24326
|
+
var array = [];
|
|
24327
|
+
for (var i = 0; i < length; i++)
|
|
24328
|
+
array[i] = args[i];
|
|
24329
|
+
return array;
|
|
24330
|
+
}
|
|
24331
|
+
}
|
|
24332
|
+
});
|
|
24333
|
+
|
|
24334
|
+
// node_modules/.pnpm/glob@8.1.0/node_modules/glob/glob.js
|
|
24335
|
+
var require_glob = __commonJS({
|
|
24336
|
+
"node_modules/.pnpm/glob@8.1.0/node_modules/glob/glob.js"(exports, module2) {
|
|
24337
|
+
module2.exports = glob2;
|
|
24338
|
+
var rp = require_fs();
|
|
24339
|
+
var minimatch = require_minimatch();
|
|
24340
|
+
var Minimatch = minimatch.Minimatch;
|
|
24341
|
+
var inherits = require_inherits();
|
|
24342
|
+
var EE = require("events").EventEmitter;
|
|
24343
|
+
var path4 = require("path");
|
|
24344
|
+
var assert = require("assert");
|
|
24345
|
+
var isAbsolute = require("path").isAbsolute;
|
|
24346
|
+
var globSync = require_sync();
|
|
24347
|
+
var common = require_common2();
|
|
24348
|
+
var setopts = common.setopts;
|
|
24349
|
+
var ownProp = common.ownProp;
|
|
24350
|
+
var inflight = require_inflight();
|
|
24351
|
+
var util2 = require("util");
|
|
24352
|
+
var childrenIgnored = common.childrenIgnored;
|
|
24353
|
+
var isIgnored = common.isIgnored;
|
|
24354
|
+
var once = require_once();
|
|
24355
|
+
function glob2(pattern, options, cb) {
|
|
24356
|
+
if (typeof options === "function")
|
|
24357
|
+
cb = options, options = {};
|
|
24358
|
+
if (!options)
|
|
24359
|
+
options = {};
|
|
24360
|
+
if (options.sync) {
|
|
24361
|
+
if (cb)
|
|
24362
|
+
throw new TypeError("callback provided to sync glob");
|
|
24363
|
+
return globSync(pattern, options);
|
|
24364
|
+
}
|
|
24365
|
+
return new Glob(pattern, options, cb);
|
|
24366
|
+
}
|
|
24367
|
+
glob2.sync = globSync;
|
|
24368
|
+
var GlobSync = glob2.GlobSync = globSync.GlobSync;
|
|
24369
|
+
glob2.glob = glob2;
|
|
24370
|
+
function extend(origin, add) {
|
|
24371
|
+
if (add === null || typeof add !== "object") {
|
|
24372
|
+
return origin;
|
|
24373
|
+
}
|
|
24374
|
+
var keys = Object.keys(add);
|
|
24375
|
+
var i = keys.length;
|
|
24376
|
+
while (i--) {
|
|
24377
|
+
origin[keys[i]] = add[keys[i]];
|
|
24378
|
+
}
|
|
24379
|
+
return origin;
|
|
24380
|
+
}
|
|
24381
|
+
glob2.hasMagic = function(pattern, options_) {
|
|
24382
|
+
var options = extend({}, options_);
|
|
24383
|
+
options.noprocess = true;
|
|
24384
|
+
var g = new Glob(pattern, options);
|
|
24385
|
+
var set = g.minimatch.set;
|
|
24386
|
+
if (!pattern)
|
|
24387
|
+
return false;
|
|
24388
|
+
if (set.length > 1)
|
|
24389
|
+
return true;
|
|
24390
|
+
for (var j = 0; j < set[0].length; j++) {
|
|
24391
|
+
if (typeof set[0][j] !== "string")
|
|
24392
|
+
return true;
|
|
24393
|
+
}
|
|
24394
|
+
return false;
|
|
24395
|
+
};
|
|
24396
|
+
glob2.Glob = Glob;
|
|
24397
|
+
inherits(Glob, EE);
|
|
24398
|
+
function Glob(pattern, options, cb) {
|
|
24399
|
+
if (typeof options === "function") {
|
|
24400
|
+
cb = options;
|
|
24401
|
+
options = null;
|
|
24402
|
+
}
|
|
24403
|
+
if (options && options.sync) {
|
|
24404
|
+
if (cb)
|
|
24405
|
+
throw new TypeError("callback provided to sync glob");
|
|
24406
|
+
return new GlobSync(pattern, options);
|
|
24407
|
+
}
|
|
24408
|
+
if (!(this instanceof Glob))
|
|
24409
|
+
return new Glob(pattern, options, cb);
|
|
24410
|
+
setopts(this, pattern, options);
|
|
24411
|
+
this._didRealPath = false;
|
|
24412
|
+
var n = this.minimatch.set.length;
|
|
24413
|
+
this.matches = new Array(n);
|
|
24414
|
+
if (typeof cb === "function") {
|
|
24415
|
+
cb = once(cb);
|
|
24416
|
+
this.on("error", cb);
|
|
24417
|
+
this.on("end", function(matches) {
|
|
24418
|
+
cb(null, matches);
|
|
24419
|
+
});
|
|
24420
|
+
}
|
|
24421
|
+
var self2 = this;
|
|
24422
|
+
this._processing = 0;
|
|
24423
|
+
this._emitQueue = [];
|
|
24424
|
+
this._processQueue = [];
|
|
24425
|
+
this.paused = false;
|
|
24426
|
+
if (this.noprocess)
|
|
24427
|
+
return this;
|
|
24428
|
+
if (n === 0)
|
|
24429
|
+
return done();
|
|
24430
|
+
var sync = true;
|
|
24431
|
+
for (var i = 0; i < n; i++) {
|
|
24432
|
+
this._process(this.minimatch.set[i], i, false, done);
|
|
24433
|
+
}
|
|
24434
|
+
sync = false;
|
|
24435
|
+
function done() {
|
|
24436
|
+
--self2._processing;
|
|
24437
|
+
if (self2._processing <= 0) {
|
|
24438
|
+
if (sync) {
|
|
24439
|
+
process.nextTick(function() {
|
|
24440
|
+
self2._finish();
|
|
24441
|
+
});
|
|
24442
|
+
} else {
|
|
24443
|
+
self2._finish();
|
|
24444
|
+
}
|
|
24445
|
+
}
|
|
24446
|
+
}
|
|
24447
|
+
}
|
|
24448
|
+
Glob.prototype._finish = function() {
|
|
24449
|
+
assert(this instanceof Glob);
|
|
24450
|
+
if (this.aborted)
|
|
24451
|
+
return;
|
|
24452
|
+
if (this.realpath && !this._didRealpath)
|
|
24453
|
+
return this._realpath();
|
|
24454
|
+
common.finish(this);
|
|
24455
|
+
this.emit("end", this.found);
|
|
24456
|
+
};
|
|
24457
|
+
Glob.prototype._realpath = function() {
|
|
24458
|
+
if (this._didRealpath)
|
|
24459
|
+
return;
|
|
24460
|
+
this._didRealpath = true;
|
|
24461
|
+
var n = this.matches.length;
|
|
24462
|
+
if (n === 0)
|
|
24463
|
+
return this._finish();
|
|
24464
|
+
var self2 = this;
|
|
24465
|
+
for (var i = 0; i < this.matches.length; i++)
|
|
24466
|
+
this._realpathSet(i, next);
|
|
24467
|
+
function next() {
|
|
24468
|
+
if (--n === 0)
|
|
24469
|
+
self2._finish();
|
|
24470
|
+
}
|
|
24471
|
+
};
|
|
24472
|
+
Glob.prototype._realpathSet = function(index4, cb) {
|
|
24473
|
+
var matchset = this.matches[index4];
|
|
24474
|
+
if (!matchset)
|
|
24475
|
+
return cb();
|
|
24476
|
+
var found = Object.keys(matchset);
|
|
24477
|
+
var self2 = this;
|
|
24478
|
+
var n = found.length;
|
|
24479
|
+
if (n === 0)
|
|
24480
|
+
return cb();
|
|
24481
|
+
var set = this.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
24482
|
+
found.forEach(function(p, i) {
|
|
24483
|
+
p = self2._makeAbs(p);
|
|
24484
|
+
rp.realpath(p, self2.realpathCache, function(er, real) {
|
|
24485
|
+
if (!er)
|
|
24486
|
+
set[real] = true;
|
|
24487
|
+
else if (er.syscall === "stat")
|
|
24488
|
+
set[p] = true;
|
|
24489
|
+
else
|
|
24490
|
+
self2.emit("error", er);
|
|
24491
|
+
if (--n === 0) {
|
|
24492
|
+
self2.matches[index4] = set;
|
|
24493
|
+
cb();
|
|
24494
|
+
}
|
|
24495
|
+
});
|
|
24496
|
+
});
|
|
24497
|
+
};
|
|
24498
|
+
Glob.prototype._mark = function(p) {
|
|
24499
|
+
return common.mark(this, p);
|
|
24500
|
+
};
|
|
24501
|
+
Glob.prototype._makeAbs = function(f) {
|
|
24502
|
+
return common.makeAbs(this, f);
|
|
24503
|
+
};
|
|
24504
|
+
Glob.prototype.abort = function() {
|
|
24505
|
+
this.aborted = true;
|
|
24506
|
+
this.emit("abort");
|
|
24507
|
+
};
|
|
24508
|
+
Glob.prototype.pause = function() {
|
|
24509
|
+
if (!this.paused) {
|
|
24510
|
+
this.paused = true;
|
|
24511
|
+
this.emit("pause");
|
|
24512
|
+
}
|
|
24513
|
+
};
|
|
24514
|
+
Glob.prototype.resume = function() {
|
|
24515
|
+
if (this.paused) {
|
|
24516
|
+
this.emit("resume");
|
|
24517
|
+
this.paused = false;
|
|
24518
|
+
if (this._emitQueue.length) {
|
|
24519
|
+
var eq = this._emitQueue.slice(0);
|
|
24520
|
+
this._emitQueue.length = 0;
|
|
24521
|
+
for (var i = 0; i < eq.length; i++) {
|
|
24522
|
+
var e = eq[i];
|
|
24523
|
+
this._emitMatch(e[0], e[1]);
|
|
24524
|
+
}
|
|
24525
|
+
}
|
|
24526
|
+
if (this._processQueue.length) {
|
|
24527
|
+
var pq = this._processQueue.slice(0);
|
|
24528
|
+
this._processQueue.length = 0;
|
|
24529
|
+
for (var i = 0; i < pq.length; i++) {
|
|
24530
|
+
var p = pq[i];
|
|
24531
|
+
this._processing--;
|
|
24532
|
+
this._process(p[0], p[1], p[2], p[3]);
|
|
24533
|
+
}
|
|
24534
|
+
}
|
|
24535
|
+
}
|
|
24536
|
+
};
|
|
24537
|
+
Glob.prototype._process = function(pattern, index4, inGlobStar, cb) {
|
|
24538
|
+
assert(this instanceof Glob);
|
|
24539
|
+
assert(typeof cb === "function");
|
|
24540
|
+
if (this.aborted)
|
|
24541
|
+
return;
|
|
24542
|
+
this._processing++;
|
|
24543
|
+
if (this.paused) {
|
|
24544
|
+
this._processQueue.push([pattern, index4, inGlobStar, cb]);
|
|
24545
|
+
return;
|
|
24546
|
+
}
|
|
24547
|
+
var n = 0;
|
|
24548
|
+
while (typeof pattern[n] === "string") {
|
|
24549
|
+
n++;
|
|
24550
|
+
}
|
|
24551
|
+
var prefix;
|
|
24552
|
+
switch (n) {
|
|
24553
|
+
case pattern.length:
|
|
24554
|
+
this._processSimple(pattern.join("/"), index4, cb);
|
|
24555
|
+
return;
|
|
24556
|
+
case 0:
|
|
24557
|
+
prefix = null;
|
|
24558
|
+
break;
|
|
24559
|
+
default:
|
|
24560
|
+
prefix = pattern.slice(0, n).join("/");
|
|
24561
|
+
break;
|
|
24562
|
+
}
|
|
24563
|
+
var remain = pattern.slice(n);
|
|
24564
|
+
var read;
|
|
24565
|
+
if (prefix === null)
|
|
24566
|
+
read = ".";
|
|
24567
|
+
else if (isAbsolute(prefix) || isAbsolute(pattern.map(function(p) {
|
|
24568
|
+
return typeof p === "string" ? p : "[*]";
|
|
24569
|
+
}).join("/"))) {
|
|
24570
|
+
if (!prefix || !isAbsolute(prefix))
|
|
24571
|
+
prefix = "/" + prefix;
|
|
24572
|
+
read = prefix;
|
|
24573
|
+
} else
|
|
24574
|
+
read = prefix;
|
|
24575
|
+
var abs = this._makeAbs(read);
|
|
24576
|
+
if (childrenIgnored(this, read))
|
|
24577
|
+
return cb();
|
|
24578
|
+
var isGlobStar = remain[0] === minimatch.GLOBSTAR;
|
|
24579
|
+
if (isGlobStar)
|
|
24580
|
+
this._processGlobStar(prefix, read, abs, remain, index4, inGlobStar, cb);
|
|
24581
|
+
else
|
|
24582
|
+
this._processReaddir(prefix, read, abs, remain, index4, inGlobStar, cb);
|
|
24583
|
+
};
|
|
24584
|
+
Glob.prototype._processReaddir = function(prefix, read, abs, remain, index4, inGlobStar, cb) {
|
|
24585
|
+
var self2 = this;
|
|
24586
|
+
this._readdir(abs, inGlobStar, function(er, entries) {
|
|
24587
|
+
return self2._processReaddir2(prefix, read, abs, remain, index4, inGlobStar, entries, cb);
|
|
24588
|
+
});
|
|
24589
|
+
};
|
|
24590
|
+
Glob.prototype._processReaddir2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) {
|
|
24591
|
+
if (!entries)
|
|
24592
|
+
return cb();
|
|
24593
|
+
var pn = remain[0];
|
|
24594
|
+
var negate = !!this.minimatch.negate;
|
|
24595
|
+
var rawGlob = pn._glob;
|
|
24596
|
+
var dotOk = this.dot || rawGlob.charAt(0) === ".";
|
|
24597
|
+
var matchedEntries = [];
|
|
24598
|
+
for (var i = 0; i < entries.length; i++) {
|
|
24599
|
+
var e = entries[i];
|
|
24600
|
+
if (e.charAt(0) !== "." || dotOk) {
|
|
24601
|
+
var m;
|
|
24602
|
+
if (negate && !prefix) {
|
|
24603
|
+
m = !e.match(pn);
|
|
24604
|
+
} else {
|
|
24605
|
+
m = e.match(pn);
|
|
24606
|
+
}
|
|
24607
|
+
if (m)
|
|
24608
|
+
matchedEntries.push(e);
|
|
24609
|
+
}
|
|
24610
|
+
}
|
|
24611
|
+
var len = matchedEntries.length;
|
|
24612
|
+
if (len === 0)
|
|
24613
|
+
return cb();
|
|
24614
|
+
if (remain.length === 1 && !this.mark && !this.stat) {
|
|
24615
|
+
if (!this.matches[index4])
|
|
24616
|
+
this.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
24617
|
+
for (var i = 0; i < len; i++) {
|
|
24618
|
+
var e = matchedEntries[i];
|
|
24619
|
+
if (prefix) {
|
|
24620
|
+
if (prefix !== "/")
|
|
24621
|
+
e = prefix + "/" + e;
|
|
24622
|
+
else
|
|
24623
|
+
e = prefix + e;
|
|
24624
|
+
}
|
|
24625
|
+
if (e.charAt(0) === "/" && !this.nomount) {
|
|
24626
|
+
e = path4.join(this.root, e);
|
|
24627
|
+
}
|
|
24628
|
+
this._emitMatch(index4, e);
|
|
24629
|
+
}
|
|
24630
|
+
return cb();
|
|
24631
|
+
}
|
|
24632
|
+
remain.shift();
|
|
24633
|
+
for (var i = 0; i < len; i++) {
|
|
24634
|
+
var e = matchedEntries[i];
|
|
24635
|
+
var newPattern;
|
|
24636
|
+
if (prefix) {
|
|
24637
|
+
if (prefix !== "/")
|
|
24638
|
+
e = prefix + "/" + e;
|
|
24639
|
+
else
|
|
24640
|
+
e = prefix + e;
|
|
24641
|
+
}
|
|
24642
|
+
this._process([e].concat(remain), index4, inGlobStar, cb);
|
|
24643
|
+
}
|
|
24644
|
+
cb();
|
|
24645
|
+
};
|
|
24646
|
+
Glob.prototype._emitMatch = function(index4, e) {
|
|
24647
|
+
if (this.aborted)
|
|
24648
|
+
return;
|
|
24649
|
+
if (isIgnored(this, e))
|
|
24650
|
+
return;
|
|
24651
|
+
if (this.paused) {
|
|
24652
|
+
this._emitQueue.push([index4, e]);
|
|
24653
|
+
return;
|
|
24654
|
+
}
|
|
24655
|
+
var abs = isAbsolute(e) ? e : this._makeAbs(e);
|
|
24656
|
+
if (this.mark)
|
|
24657
|
+
e = this._mark(e);
|
|
24658
|
+
if (this.absolute)
|
|
24659
|
+
e = abs;
|
|
24660
|
+
if (this.matches[index4][e])
|
|
24661
|
+
return;
|
|
24662
|
+
if (this.nodir) {
|
|
24663
|
+
var c = this.cache[abs];
|
|
24664
|
+
if (c === "DIR" || Array.isArray(c))
|
|
24665
|
+
return;
|
|
24666
|
+
}
|
|
24667
|
+
this.matches[index4][e] = true;
|
|
24668
|
+
var st = this.statCache[abs];
|
|
24669
|
+
if (st)
|
|
24670
|
+
this.emit("stat", e, st);
|
|
24671
|
+
this.emit("match", e);
|
|
24672
|
+
};
|
|
24673
|
+
Glob.prototype._readdirInGlobStar = function(abs, cb) {
|
|
24674
|
+
if (this.aborted)
|
|
24675
|
+
return;
|
|
24676
|
+
if (this.follow)
|
|
24677
|
+
return this._readdir(abs, false, cb);
|
|
24678
|
+
var lstatkey = "lstat\0" + abs;
|
|
24679
|
+
var self2 = this;
|
|
24680
|
+
var lstatcb = inflight(lstatkey, lstatcb_);
|
|
24681
|
+
if (lstatcb)
|
|
24682
|
+
self2.fs.lstat(abs, lstatcb);
|
|
24683
|
+
function lstatcb_(er, lstat) {
|
|
24684
|
+
if (er && er.code === "ENOENT")
|
|
24685
|
+
return cb();
|
|
24686
|
+
var isSym = lstat && lstat.isSymbolicLink();
|
|
24687
|
+
self2.symlinks[abs] = isSym;
|
|
24688
|
+
if (!isSym && lstat && !lstat.isDirectory()) {
|
|
24689
|
+
self2.cache[abs] = "FILE";
|
|
24690
|
+
cb();
|
|
24691
|
+
} else
|
|
24692
|
+
self2._readdir(abs, false, cb);
|
|
24693
|
+
}
|
|
24694
|
+
};
|
|
24695
|
+
Glob.prototype._readdir = function(abs, inGlobStar, cb) {
|
|
24696
|
+
if (this.aborted)
|
|
24697
|
+
return;
|
|
24698
|
+
cb = inflight("readdir\0" + abs + "\0" + inGlobStar, cb);
|
|
24699
|
+
if (!cb)
|
|
24700
|
+
return;
|
|
24701
|
+
if (inGlobStar && !ownProp(this.symlinks, abs))
|
|
24702
|
+
return this._readdirInGlobStar(abs, cb);
|
|
24703
|
+
if (ownProp(this.cache, abs)) {
|
|
24704
|
+
var c = this.cache[abs];
|
|
24705
|
+
if (!c || c === "FILE")
|
|
24706
|
+
return cb();
|
|
24707
|
+
if (Array.isArray(c))
|
|
24708
|
+
return cb(null, c);
|
|
24709
|
+
}
|
|
24710
|
+
var self2 = this;
|
|
24711
|
+
self2.fs.readdir(abs, readdirCb(this, abs, cb));
|
|
24712
|
+
};
|
|
24713
|
+
function readdirCb(self2, abs, cb) {
|
|
24714
|
+
return function(er, entries) {
|
|
24715
|
+
if (er)
|
|
24716
|
+
self2._readdirError(abs, er, cb);
|
|
24717
|
+
else
|
|
24718
|
+
self2._readdirEntries(abs, entries, cb);
|
|
24719
|
+
};
|
|
24720
|
+
}
|
|
24721
|
+
Glob.prototype._readdirEntries = function(abs, entries, cb) {
|
|
24722
|
+
if (this.aborted)
|
|
24723
|
+
return;
|
|
24724
|
+
if (!this.mark && !this.stat) {
|
|
24725
|
+
for (var i = 0; i < entries.length; i++) {
|
|
24726
|
+
var e = entries[i];
|
|
24727
|
+
if (abs === "/")
|
|
24728
|
+
e = abs + e;
|
|
24729
|
+
else
|
|
24730
|
+
e = abs + "/" + e;
|
|
24731
|
+
this.cache[e] = true;
|
|
24732
|
+
}
|
|
24733
|
+
}
|
|
24734
|
+
this.cache[abs] = entries;
|
|
24735
|
+
return cb(null, entries);
|
|
24736
|
+
};
|
|
24737
|
+
Glob.prototype._readdirError = function(f, er, cb) {
|
|
24738
|
+
if (this.aborted)
|
|
24739
|
+
return;
|
|
24740
|
+
switch (er.code) {
|
|
24741
|
+
case "ENOTSUP":
|
|
24742
|
+
case "ENOTDIR":
|
|
24743
|
+
var abs = this._makeAbs(f);
|
|
24744
|
+
this.cache[abs] = "FILE";
|
|
24745
|
+
if (abs === this.cwdAbs) {
|
|
24746
|
+
var error2 = new Error(er.code + " invalid cwd " + this.cwd);
|
|
24747
|
+
error2.path = this.cwd;
|
|
24748
|
+
error2.code = er.code;
|
|
24749
|
+
this.emit("error", error2);
|
|
24750
|
+
this.abort();
|
|
24751
|
+
}
|
|
24752
|
+
break;
|
|
24753
|
+
case "ENOENT":
|
|
24754
|
+
case "ELOOP":
|
|
24755
|
+
case "ENAMETOOLONG":
|
|
24756
|
+
case "UNKNOWN":
|
|
24757
|
+
this.cache[this._makeAbs(f)] = false;
|
|
24758
|
+
break;
|
|
24759
|
+
default:
|
|
24760
|
+
this.cache[this._makeAbs(f)] = false;
|
|
24761
|
+
if (this.strict) {
|
|
24762
|
+
this.emit("error", er);
|
|
24763
|
+
this.abort();
|
|
24764
|
+
}
|
|
24765
|
+
if (!this.silent)
|
|
24766
|
+
console.error("glob error", er);
|
|
24767
|
+
break;
|
|
24768
|
+
}
|
|
24769
|
+
return cb();
|
|
24770
|
+
};
|
|
24771
|
+
Glob.prototype._processGlobStar = function(prefix, read, abs, remain, index4, inGlobStar, cb) {
|
|
24772
|
+
var self2 = this;
|
|
24773
|
+
this._readdir(abs, inGlobStar, function(er, entries) {
|
|
24774
|
+
self2._processGlobStar2(prefix, read, abs, remain, index4, inGlobStar, entries, cb);
|
|
24775
|
+
});
|
|
24776
|
+
};
|
|
24777
|
+
Glob.prototype._processGlobStar2 = function(prefix, read, abs, remain, index4, inGlobStar, entries, cb) {
|
|
24778
|
+
if (!entries)
|
|
24779
|
+
return cb();
|
|
24780
|
+
var remainWithoutGlobStar = remain.slice(1);
|
|
24781
|
+
var gspref = prefix ? [prefix] : [];
|
|
24782
|
+
var noGlobStar = gspref.concat(remainWithoutGlobStar);
|
|
24783
|
+
this._process(noGlobStar, index4, false, cb);
|
|
24784
|
+
var isSym = this.symlinks[abs];
|
|
24785
|
+
var len = entries.length;
|
|
24786
|
+
if (isSym && inGlobStar)
|
|
24787
|
+
return cb();
|
|
24788
|
+
for (var i = 0; i < len; i++) {
|
|
24789
|
+
var e = entries[i];
|
|
24790
|
+
if (e.charAt(0) === "." && !this.dot)
|
|
24791
|
+
continue;
|
|
24792
|
+
var instead = gspref.concat(entries[i], remainWithoutGlobStar);
|
|
24793
|
+
this._process(instead, index4, true, cb);
|
|
24794
|
+
var below = gspref.concat(entries[i], remain);
|
|
24795
|
+
this._process(below, index4, true, cb);
|
|
24796
|
+
}
|
|
24797
|
+
cb();
|
|
24798
|
+
};
|
|
24799
|
+
Glob.prototype._processSimple = function(prefix, index4, cb) {
|
|
24800
|
+
var self2 = this;
|
|
24801
|
+
this._stat(prefix, function(er, exists) {
|
|
24802
|
+
self2._processSimple2(prefix, index4, er, exists, cb);
|
|
24803
|
+
});
|
|
24804
|
+
};
|
|
24805
|
+
Glob.prototype._processSimple2 = function(prefix, index4, er, exists, cb) {
|
|
24806
|
+
if (!this.matches[index4])
|
|
24807
|
+
this.matches[index4] = /* @__PURE__ */ Object.create(null);
|
|
24808
|
+
if (!exists)
|
|
24809
|
+
return cb();
|
|
24810
|
+
if (prefix && isAbsolute(prefix) && !this.nomount) {
|
|
24811
|
+
var trail = /[\/\\]$/.test(prefix);
|
|
24812
|
+
if (prefix.charAt(0) === "/") {
|
|
24813
|
+
prefix = path4.join(this.root, prefix);
|
|
24814
|
+
} else {
|
|
24815
|
+
prefix = path4.resolve(this.root, prefix);
|
|
24816
|
+
if (trail)
|
|
24817
|
+
prefix += "/";
|
|
24818
|
+
}
|
|
24819
|
+
}
|
|
24820
|
+
if (process.platform === "win32")
|
|
24821
|
+
prefix = prefix.replace(/\\/g, "/");
|
|
24822
|
+
this._emitMatch(index4, prefix);
|
|
24823
|
+
cb();
|
|
24824
|
+
};
|
|
24825
|
+
Glob.prototype._stat = function(f, cb) {
|
|
24826
|
+
var abs = this._makeAbs(f);
|
|
24827
|
+
var needDir = f.slice(-1) === "/";
|
|
24828
|
+
if (f.length > this.maxLength)
|
|
24829
|
+
return cb();
|
|
24830
|
+
if (!this.stat && ownProp(this.cache, abs)) {
|
|
24831
|
+
var c = this.cache[abs];
|
|
24832
|
+
if (Array.isArray(c))
|
|
24833
|
+
c = "DIR";
|
|
24834
|
+
if (!needDir || c === "DIR")
|
|
24835
|
+
return cb(null, c);
|
|
24836
|
+
if (needDir && c === "FILE")
|
|
24837
|
+
return cb();
|
|
24838
|
+
}
|
|
24839
|
+
var exists;
|
|
24840
|
+
var stat = this.statCache[abs];
|
|
24841
|
+
if (stat !== void 0) {
|
|
24842
|
+
if (stat === false)
|
|
24843
|
+
return cb(null, stat);
|
|
24844
|
+
else {
|
|
24845
|
+
var type = stat.isDirectory() ? "DIR" : "FILE";
|
|
24846
|
+
if (needDir && type === "FILE")
|
|
24847
|
+
return cb();
|
|
24848
|
+
else
|
|
24849
|
+
return cb(null, type, stat);
|
|
24850
|
+
}
|
|
24851
|
+
}
|
|
24852
|
+
var self2 = this;
|
|
24853
|
+
var statcb = inflight("stat\0" + abs, lstatcb_);
|
|
24854
|
+
if (statcb)
|
|
24855
|
+
self2.fs.lstat(abs, statcb);
|
|
24856
|
+
function lstatcb_(er, lstat) {
|
|
24857
|
+
if (lstat && lstat.isSymbolicLink()) {
|
|
24858
|
+
return self2.fs.stat(abs, function(er2, stat2) {
|
|
24859
|
+
if (er2)
|
|
24860
|
+
self2._stat2(f, abs, null, lstat, cb);
|
|
24861
|
+
else
|
|
24862
|
+
self2._stat2(f, abs, er2, stat2, cb);
|
|
24863
|
+
});
|
|
24864
|
+
} else {
|
|
24865
|
+
self2._stat2(f, abs, er, lstat, cb);
|
|
24866
|
+
}
|
|
24867
|
+
}
|
|
24868
|
+
};
|
|
24869
|
+
Glob.prototype._stat2 = function(f, abs, er, stat, cb) {
|
|
24870
|
+
if (er && (er.code === "ENOENT" || er.code === "ENOTDIR")) {
|
|
24871
|
+
this.statCache[abs] = false;
|
|
24872
|
+
return cb();
|
|
24873
|
+
}
|
|
24874
|
+
var needDir = f.slice(-1) === "/";
|
|
24875
|
+
this.statCache[abs] = stat;
|
|
24876
|
+
if (abs.slice(-1) === "/" && stat && !stat.isDirectory())
|
|
24877
|
+
return cb(null, false, stat);
|
|
24878
|
+
var c = true;
|
|
24879
|
+
if (stat)
|
|
24880
|
+
c = stat.isDirectory() ? "DIR" : "FILE";
|
|
24881
|
+
this.cache[abs] = this.cache[abs] || c;
|
|
24882
|
+
if (needDir && c === "FILE")
|
|
24883
|
+
return cb();
|
|
24884
|
+
return cb(null, c, stat);
|
|
24885
|
+
};
|
|
24886
|
+
}
|
|
24887
|
+
});
|
|
24888
|
+
|
|
22504
24889
|
// src/serializer/mysqlImports.ts
|
|
22505
24890
|
var mysqlImports_exports = {};
|
|
22506
24891
|
__export(mysqlImports_exports, {
|
|
@@ -23406,12 +25791,13 @@ var init_sqliteSerializer = __esm({
|
|
|
23406
25791
|
});
|
|
23407
25792
|
|
|
23408
25793
|
// src/serializer/index.ts
|
|
23409
|
-
var import_fs3, import_node, import_path3, safeRegister, serializeMySql, serializePg, serializeSQLite, prepareFilenames;
|
|
25794
|
+
var import_fs3, import_node, import_path3, import_glob, safeRegister, serializeMySql, serializePg, serializeSQLite, prepareFilenames;
|
|
23410
25795
|
var init_serializer = __esm({
|
|
23411
25796
|
"src/serializer/index.ts"() {
|
|
23412
25797
|
import_fs3 = __toESM(require("fs"));
|
|
23413
25798
|
import_node = __toESM(require_node2());
|
|
23414
25799
|
import_path3 = __toESM(require("path"));
|
|
25800
|
+
import_glob = __toESM(require_glob());
|
|
23415
25801
|
safeRegister = () => {
|
|
23416
25802
|
try {
|
|
23417
25803
|
const { unregister } = (0, import_node.register)({
|
|
@@ -23452,9 +25838,19 @@ var init_serializer = __esm({
|
|
|
23452
25838
|
return generateSqliteSnapshot2(tables, enums);
|
|
23453
25839
|
};
|
|
23454
25840
|
prepareFilenames = (path4) => {
|
|
23455
|
-
|
|
23456
|
-
|
|
23457
|
-
|
|
25841
|
+
if (typeof path4 === "string") {
|
|
25842
|
+
path4 = [path4];
|
|
25843
|
+
}
|
|
25844
|
+
const result = path4.reduce((result2, cur) => {
|
|
25845
|
+
const globbed = import_glob.default.sync(cur);
|
|
25846
|
+
globbed.forEach((it) => {
|
|
25847
|
+
const fileName = import_fs3.default.lstatSync(it).isDirectory() ? null : import_path3.default.resolve(it);
|
|
25848
|
+
const filenames = fileName ? [fileName] : import_fs3.default.readdirSync(it).map((file) => import_path3.default.join(import_path3.default.resolve(it), file));
|
|
25849
|
+
filenames.filter((file) => !import_fs3.default.lstatSync(file).isDirectory()).forEach((file) => result2.add(file));
|
|
25850
|
+
});
|
|
25851
|
+
return result2;
|
|
25852
|
+
}, /* @__PURE__ */ new Set());
|
|
25853
|
+
return [...result];
|
|
23458
25854
|
};
|
|
23459
25855
|
}
|
|
23460
25856
|
});
|
|
@@ -23563,7 +25959,6 @@ var init_migrate = __esm({
|
|
|
23563
25959
|
writeResult(
|
|
23564
25960
|
cur,
|
|
23565
25961
|
sqlStatements,
|
|
23566
|
-
snapshots.length,
|
|
23567
25962
|
journal,
|
|
23568
25963
|
_meta,
|
|
23569
25964
|
outFolder,
|
|
@@ -23592,7 +25987,6 @@ var init_migrate = __esm({
|
|
|
23592
25987
|
writeResult(
|
|
23593
25988
|
cur,
|
|
23594
25989
|
sqlStatements,
|
|
23595
|
-
snapshots.length,
|
|
23596
25990
|
journal,
|
|
23597
25991
|
_meta,
|
|
23598
25992
|
outFolder,
|
|
@@ -23621,7 +26015,6 @@ var init_migrate = __esm({
|
|
|
23621
26015
|
writeResult(
|
|
23622
26016
|
cur,
|
|
23623
26017
|
sqlStatements,
|
|
23624
|
-
snapshots.length,
|
|
23625
26018
|
journal,
|
|
23626
26019
|
_meta,
|
|
23627
26020
|
outFolder,
|
|
@@ -23811,12 +26204,14 @@ var init_migrate = __esm({
|
|
|
23811
26204
|
result.deleted.push(...leftMissing);
|
|
23812
26205
|
return result;
|
|
23813
26206
|
};
|
|
23814
|
-
writeResult = (cur, sqlStatements,
|
|
26207
|
+
writeResult = (cur, sqlStatements, journal, _meta, outFolder, breakpoints) => {
|
|
26208
|
+
var _a, _b;
|
|
23815
26209
|
console.log(schema(cur));
|
|
23816
26210
|
if (sqlStatements.length === 0) {
|
|
23817
26211
|
console.log("No schema changes, nothing to migrate \u{1F634}");
|
|
23818
26212
|
return;
|
|
23819
26213
|
}
|
|
26214
|
+
const idx = (_b = (_a = journal.entries[journal.entries.length - 1]) == null ? void 0 : _a.idx) != null ? _b : 0;
|
|
23820
26215
|
const { prefix, tag } = prepareMigrationMetadata(idx);
|
|
23821
26216
|
const toSave = JSON.parse(JSON.stringify(cur));
|
|
23822
26217
|
toSave["_meta"] = _meta;
|
|
@@ -28724,10 +31119,10 @@ __export(pgIntrospect_exports, {
|
|
|
28724
31119
|
PgConfig2: () => PgConfig2,
|
|
28725
31120
|
pgIntrospect: () => pgIntrospect
|
|
28726
31121
|
});
|
|
28727
|
-
var
|
|
31122
|
+
var import_hanji4, import_pg, PgConfig1, PgConfig2, Conf, pgIntrospect;
|
|
28728
31123
|
var init_pgIntrospect = __esm({
|
|
28729
31124
|
"src/cli/commands/pgIntrospect.ts"() {
|
|
28730
|
-
|
|
31125
|
+
import_hanji4 = __toESM(require_hanji());
|
|
28731
31126
|
init_lib();
|
|
28732
31127
|
init_views();
|
|
28733
31128
|
import_pg = __toESM(require_lib3());
|
|
@@ -28749,7 +31144,7 @@ var init_pgIntrospect = __esm({
|
|
|
28749
31144
|
pgIntrospect = async (config) => {
|
|
28750
31145
|
const pool = new import_pg.Pool(config);
|
|
28751
31146
|
const progress = new IntrospectProgress();
|
|
28752
|
-
const res = await (0,
|
|
31147
|
+
const res = await (0, import_hanji4.renderWithTask)(
|
|
28753
31148
|
progress,
|
|
28754
31149
|
fromDatabase2(pool, (stage, count, status) => {
|
|
28755
31150
|
progress.update(stage, count, status);
|
|
@@ -43048,7 +45443,7 @@ var require_named_placeholders = __commonJS({
|
|
|
43048
45443
|
}
|
|
43049
45444
|
return s;
|
|
43050
45445
|
}
|
|
43051
|
-
function
|
|
45446
|
+
function join5(tree) {
|
|
43052
45447
|
if (tree.length == 1) {
|
|
43053
45448
|
return tree;
|
|
43054
45449
|
}
|
|
@@ -43074,7 +45469,7 @@ var require_named_placeholders = __commonJS({
|
|
|
43074
45469
|
if (cache && (tree = cache.get(query))) {
|
|
43075
45470
|
return toArrayParams(tree, paramsObj);
|
|
43076
45471
|
}
|
|
43077
|
-
tree =
|
|
45472
|
+
tree = join5(parse(query));
|
|
43078
45473
|
if (cache) {
|
|
43079
45474
|
cache.set(query, tree);
|
|
43080
45475
|
}
|
|
@@ -45387,10 +47782,10 @@ __export(mysqlIntrospect_exports, {
|
|
|
45387
47782
|
MySQLConfig2: () => MySQLConfig2,
|
|
45388
47783
|
mysqlIntrospect: () => mysqlIntrospect
|
|
45389
47784
|
});
|
|
45390
|
-
var
|
|
47785
|
+
var import_hanji5, import_promise, MySQLConfig1, MySQLConfig2, Conf2, mysqlIntrospect;
|
|
45391
47786
|
var init_mysqlIntrospect = __esm({
|
|
45392
47787
|
"src/cli/commands/mysqlIntrospect.ts"() {
|
|
45393
|
-
|
|
47788
|
+
import_hanji5 = __toESM(require_hanji());
|
|
45394
47789
|
init_lib();
|
|
45395
47790
|
init_views();
|
|
45396
47791
|
import_promise = __toESM(require_promise2());
|
|
@@ -45423,7 +47818,7 @@ var init_mysqlIntrospect = __esm({
|
|
|
45423
47818
|
}
|
|
45424
47819
|
await client.connect();
|
|
45425
47820
|
const progress = new IntrospectProgress();
|
|
45426
|
-
const res = await (0,
|
|
47821
|
+
const res = await (0, import_hanji5.renderWithTask)(
|
|
45427
47822
|
progress,
|
|
45428
47823
|
fromDatabase(client, databaseName, (stage, count, status) => {
|
|
45429
47824
|
progress.update(stage, count, status);
|
|
@@ -45461,7 +47856,7 @@ var {
|
|
|
45461
47856
|
} = import_index.default;
|
|
45462
47857
|
|
|
45463
47858
|
// src/cli/index.ts
|
|
45464
|
-
var
|
|
47859
|
+
var import_fs10 = __toESM(require("fs"));
|
|
45465
47860
|
init_lib();
|
|
45466
47861
|
|
|
45467
47862
|
// src/cli/commands/check.ts
|
|
@@ -45502,9 +47897,9 @@ var checkHandler = (out, dialect6) => {
|
|
|
45502
47897
|
};
|
|
45503
47898
|
|
|
45504
47899
|
// src/cli/index.ts
|
|
45505
|
-
var
|
|
47900
|
+
var import_hanji6 = __toESM(require_hanji());
|
|
45506
47901
|
init_views();
|
|
45507
|
-
var
|
|
47902
|
+
var import_path8 = __toESM(require("path"));
|
|
45508
47903
|
|
|
45509
47904
|
// src/cli/utils.ts
|
|
45510
47905
|
init_views();
|
|
@@ -45598,12 +47993,14 @@ var package_default = {
|
|
|
45598
47993
|
commander: "^9.4.1",
|
|
45599
47994
|
esbuild: "^0.15.18",
|
|
45600
47995
|
"esbuild-register": "^3.4.2",
|
|
47996
|
+
glob: "^8.1.0",
|
|
45601
47997
|
hanji: "^0.0.5",
|
|
45602
47998
|
"json-diff": "0.9.0",
|
|
45603
47999
|
zod: "^3.20.2"
|
|
45604
48000
|
},
|
|
45605
48001
|
devDependencies: {
|
|
45606
48002
|
"@types/dockerode": "^3.3.14",
|
|
48003
|
+
"@types/glob": "^8.1.0",
|
|
45607
48004
|
"@types/node": "^18.11.15",
|
|
45608
48005
|
"@types/pg": "^8.6.5",
|
|
45609
48006
|
"@typescript-eslint/eslint-plugin": "^5.46.1",
|
|
@@ -45914,6 +48311,35 @@ var updateV3toV42 = (old) => {
|
|
|
45914
48311
|
// src/cli/index.ts
|
|
45915
48312
|
init_upFolders();
|
|
45916
48313
|
init_mysqlSchema();
|
|
48314
|
+
|
|
48315
|
+
// src/cli/commands/drop.ts
|
|
48316
|
+
init_source();
|
|
48317
|
+
var import_fs9 = require("fs");
|
|
48318
|
+
var import_hanji3 = __toESM(require_hanji());
|
|
48319
|
+
var import_path7 = require("path");
|
|
48320
|
+
init_views();
|
|
48321
|
+
var dropMigration = async (out) => {
|
|
48322
|
+
const metaFilePath = (0, import_path7.join)(out, "meta", "_journal.json");
|
|
48323
|
+
const journal = JSON.parse(
|
|
48324
|
+
(0, import_fs9.readFileSync)(metaFilePath, "utf-8")
|
|
48325
|
+
);
|
|
48326
|
+
const result = await (0, import_hanji3.render)(new DropMigrationView(journal.entries));
|
|
48327
|
+
if (result.status === "aborted")
|
|
48328
|
+
return;
|
|
48329
|
+
delete journal.entries[journal.entries.indexOf(result.data)];
|
|
48330
|
+
const resultJournal = {
|
|
48331
|
+
...journal,
|
|
48332
|
+
entries: journal.entries.filter(Boolean)
|
|
48333
|
+
};
|
|
48334
|
+
const sqlFilePath = (0, import_path7.join)(out, `${result.data.tag}.sql`);
|
|
48335
|
+
const snapshotFilePath = (0, import_path7.join)(out, "meta", `${result.data.idx.toFixed(0).padStart(4, "0")}_snapshot.json`);
|
|
48336
|
+
(0, import_fs9.rmSync)(sqlFilePath);
|
|
48337
|
+
(0, import_fs9.rmSync)(snapshotFilePath);
|
|
48338
|
+
(0, import_fs9.writeFileSync)(metaFilePath, JSON.stringify(resultJournal));
|
|
48339
|
+
console.log(`[${source_default.green("\u2713")}] ${source_default.bold(result.data.tag)} migration successfully dropped`);
|
|
48340
|
+
};
|
|
48341
|
+
|
|
48342
|
+
// src/cli/index.ts
|
|
45917
48343
|
var printVersions = () => {
|
|
45918
48344
|
console.log(`${source_default.gray(versions())}
|
|
45919
48345
|
`);
|
|
@@ -45921,13 +48347,13 @@ var printVersions = () => {
|
|
|
45921
48347
|
var assertEitherConfigOrOut = (config, out) => {
|
|
45922
48348
|
if (out)
|
|
45923
48349
|
return out;
|
|
45924
|
-
if (!(0,
|
|
48350
|
+
if (!(0, import_fs10.existsSync)(import_path8.default.join(import_path8.default.resolve(config)))) {
|
|
45925
48351
|
console.log(`${config} file does not exist`);
|
|
45926
48352
|
process.exit(1);
|
|
45927
48353
|
}
|
|
45928
48354
|
console.log(`Reading ${config}`);
|
|
45929
48355
|
const drizzleConfig = JSON.parse(
|
|
45930
|
-
|
|
48356
|
+
import_fs10.default.readFileSync(import_path8.default.join(import_path8.default.resolve(config))).toString()
|
|
45931
48357
|
);
|
|
45932
48358
|
return drizzleConfig.out;
|
|
45933
48359
|
};
|
|
@@ -45939,12 +48365,12 @@ drizzle-orm: v${npmVersion}` : "";
|
|
|
45939
48365
|
return versions2;
|
|
45940
48366
|
};
|
|
45941
48367
|
var configSchema = objectType({
|
|
45942
|
-
schema: stringType(),
|
|
48368
|
+
schema: unionType([stringType(), stringType().array()]),
|
|
45943
48369
|
out: stringType().default("drizzle"),
|
|
45944
48370
|
breakpoints: booleanType()
|
|
45945
48371
|
}).strict();
|
|
45946
48372
|
var optionsSchema = objectType({
|
|
45947
|
-
schema: stringType().optional(),
|
|
48373
|
+
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
45948
48374
|
out: stringType().optional(),
|
|
45949
48375
|
config: stringType().optional(),
|
|
45950
48376
|
breakpoints: booleanType().optional().default(false)
|
|
@@ -46002,7 +48428,7 @@ var prepareGenerateConfig = (options) => {
|
|
|
46002
48428
|
if (!(schema4 || out)) {
|
|
46003
48429
|
const path4 = config != null ? config : "drizzle.config.json";
|
|
46004
48430
|
const drizzleConfig = JSON.parse(
|
|
46005
|
-
|
|
48431
|
+
import_fs10.default.readFileSync(import_path8.default.join(import_path8.default.resolve(path4))).toString()
|
|
46006
48432
|
);
|
|
46007
48433
|
return drizzleConfig;
|
|
46008
48434
|
}
|
|
@@ -46110,8 +48536,8 @@ var introspectPgCommand = new Command("introspect:pg").option("--out <out>", `Mi
|
|
|
46110
48536
|
}
|
|
46111
48537
|
const { snapshots, journal } = prepareOutFolder(res.data.out, "pg");
|
|
46112
48538
|
const { schema: schema4, ts } = await pgIntrospect2(res.data);
|
|
46113
|
-
const schemaFile =
|
|
46114
|
-
(0,
|
|
48539
|
+
const schemaFile = import_path8.default.join(res.data.out, "schema.ts");
|
|
48540
|
+
(0, import_fs10.writeFileSync)(schemaFile, ts);
|
|
46115
48541
|
console.log();
|
|
46116
48542
|
if (snapshots.length === 0) {
|
|
46117
48543
|
const { sqlStatements, _meta } = await prepareSQL(
|
|
@@ -46119,15 +48545,22 @@ var introspectPgCommand = new Command("introspect:pg").option("--out <out>", `Mi
|
|
|
46119
48545
|
squashPgScheme(schema4),
|
|
46120
48546
|
"pg"
|
|
46121
48547
|
);
|
|
46122
|
-
writeResult(
|
|
48548
|
+
writeResult(
|
|
48549
|
+
schema4,
|
|
48550
|
+
sqlStatements,
|
|
48551
|
+
journal,
|
|
48552
|
+
_meta,
|
|
48553
|
+
res.data.out,
|
|
48554
|
+
res.data.breakpoints
|
|
48555
|
+
);
|
|
46123
48556
|
} else {
|
|
46124
|
-
(0,
|
|
48557
|
+
(0, import_hanji6.render)(
|
|
46125
48558
|
`[${source_default.blue(
|
|
46126
48559
|
"i"
|
|
46127
48560
|
)}] No SQL generated, you already have migrations in project`
|
|
46128
48561
|
);
|
|
46129
48562
|
}
|
|
46130
|
-
(0,
|
|
48563
|
+
(0, import_hanji6.render)(
|
|
46131
48564
|
`[${source_default.green(
|
|
46132
48565
|
"\u2713"
|
|
46133
48566
|
)}] You schema file is ready \u279C ${source_default.bold.underline.blue(
|
|
@@ -46152,8 +48585,8 @@ var introspectMySqlCommand = new Command("introspect:mysql").option("--out <out>
|
|
|
46152
48585
|
}
|
|
46153
48586
|
const { snapshots, journal } = prepareOutFolder(res.data.out, "mysql");
|
|
46154
48587
|
const { schema: schema4, ts } = await mysqlIntrospect2(res.data);
|
|
46155
|
-
const schemaFile =
|
|
46156
|
-
(0,
|
|
48588
|
+
const schemaFile = import_path8.default.join(res.data.out, "schema.ts");
|
|
48589
|
+
(0, import_fs10.writeFileSync)(schemaFile, ts);
|
|
46157
48590
|
console.log();
|
|
46158
48591
|
if (snapshots.length === 0) {
|
|
46159
48592
|
const { sqlStatements, _meta } = await prepareSQL(
|
|
@@ -46161,15 +48594,22 @@ var introspectMySqlCommand = new Command("introspect:mysql").option("--out <out>
|
|
|
46161
48594
|
squashMysqlScheme(schema4),
|
|
46162
48595
|
"mysql"
|
|
46163
48596
|
);
|
|
46164
|
-
writeResult(
|
|
48597
|
+
writeResult(
|
|
48598
|
+
schema4,
|
|
48599
|
+
sqlStatements,
|
|
48600
|
+
journal,
|
|
48601
|
+
_meta,
|
|
48602
|
+
res.data.out,
|
|
48603
|
+
res.data.breakpoints
|
|
48604
|
+
);
|
|
46165
48605
|
} else {
|
|
46166
|
-
(0,
|
|
48606
|
+
(0, import_hanji6.render)(
|
|
46167
48607
|
`[${source_default.blue(
|
|
46168
48608
|
"i"
|
|
46169
48609
|
)}] No SQL generated, you already have migrations in project`
|
|
46170
48610
|
);
|
|
46171
48611
|
}
|
|
46172
|
-
(0,
|
|
48612
|
+
(0, import_hanji6.render)(
|
|
46173
48613
|
`[${source_default.green(
|
|
46174
48614
|
"\u2713"
|
|
46175
48615
|
)}] You schema file is ready \u279C ${source_default.bold.underline.blue(
|
|
@@ -46178,6 +48618,18 @@ var introspectMySqlCommand = new Command("introspect:mysql").option("--out <out>
|
|
|
46178
48618
|
);
|
|
46179
48619
|
process.exit(0);
|
|
46180
48620
|
});
|
|
48621
|
+
var dropCommand = new Command("drop").option("--out <out>", `Output folder`).option("--config <config>", `Config path [default=drizzle.config.json]`).action((options) => {
|
|
48622
|
+
printVersions();
|
|
48623
|
+
assertOrmCoreVersion();
|
|
48624
|
+
const params = checkSchema.parse(options);
|
|
48625
|
+
const out = assertEitherConfigOrOut(params.config, params.out);
|
|
48626
|
+
if (!out) {
|
|
48627
|
+
console.log(error(`'out' folder param must be set`));
|
|
48628
|
+
process.exit(0);
|
|
48629
|
+
}
|
|
48630
|
+
assertV1OutFolder(out, "{dialect}");
|
|
48631
|
+
dropMigration(out);
|
|
48632
|
+
});
|
|
46181
48633
|
program.version(versions(), "--version, -v");
|
|
46182
48634
|
program.addCommand(generatePgCommand);
|
|
46183
48635
|
program.addCommand(generateMysqlCommand);
|
|
@@ -46189,6 +48641,7 @@ program.addCommand(upMysqlCommand);
|
|
|
46189
48641
|
program.addCommand(upSqliteCommand);
|
|
46190
48642
|
program.addCommand(introspectPgCommand);
|
|
46191
48643
|
program.addCommand(introspectMySqlCommand);
|
|
48644
|
+
program.addCommand(dropCommand);
|
|
46192
48645
|
program.parse();
|
|
46193
48646
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46194
48647
|
0 && (module.exports = {
|