@fern-api/generator-cli 0.9.33 → 0.9.34

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.
Files changed (3) hide show
  1. package/dist/api.js +1877 -64
  2. package/dist/cli.js +238 -48
  3. package/package.json +2 -2
package/dist/api.js CHANGED
@@ -57,14 +57,14 @@ var require_ms = __commonJS({
57
57
  if (str.length > 100) {
58
58
  return;
59
59
  }
60
- var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
60
+ var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
61
61
  str
62
62
  );
63
- if (!match) {
63
+ if (!match2) {
64
64
  return;
65
65
  }
66
- var n = parseFloat(match[1]);
67
- var type = (match[2] || "ms").toLowerCase();
66
+ var n = parseFloat(match2[1]);
67
+ var type = (match2[2] || "ms").toLowerCase();
68
68
  switch (type) {
69
69
  case "years":
70
70
  case "year":
@@ -196,19 +196,19 @@ var require_common = __commonJS({
196
196
  args.unshift("%O");
197
197
  }
198
198
  let index = 0;
199
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
200
- if (match === "%%") {
199
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format) => {
200
+ if (match2 === "%%") {
201
201
  return "%";
202
202
  }
203
203
  index++;
204
204
  const formatter = createDebug.formatters[format];
205
205
  if (typeof formatter === "function") {
206
206
  const val = args[index];
207
- match = formatter.call(self2, val);
207
+ match2 = formatter.call(self2, val);
208
208
  args.splice(index, 1);
209
209
  index--;
210
210
  }
211
- return match;
211
+ return match2;
212
212
  });
213
213
  createDebug.formatArgs.call(self2, args);
214
214
  const logFn = self2.log || createDebug.log;
@@ -444,12 +444,12 @@ var require_browser = __commonJS({
444
444
  args.splice(1, 0, c3, "color: inherit");
445
445
  let index = 0;
446
446
  let lastC = 0;
447
- args[0].replace(/%[a-zA-Z%]/g, (match) => {
448
- if (match === "%%") {
447
+ args[0].replace(/%[a-zA-Z%]/g, (match2) => {
448
+ if (match2 === "%%") {
449
449
  return;
450
450
  }
451
451
  index++;
452
- if (match === "%c") {
452
+ if (match2 === "%c") {
453
453
  lastC = index;
454
454
  }
455
455
  });
@@ -790,10 +790,10 @@ var require_src2 = __commonJS({
790
790
  var fs_1 = require("fs");
791
791
  var debug_1 = __importDefault(require_src());
792
792
  var log = debug_1.default("@kwsites/file-exists");
793
- function check(path3, isFile, isDirectory) {
794
- log(`checking %s`, path3);
793
+ function check(path4, isFile, isDirectory) {
794
+ log(`checking %s`, path4);
795
795
  try {
796
- const stat = fs_1.statSync(path3);
796
+ const stat = fs_1.statSync(path4);
797
797
  if (stat.isFile() && isFile) {
798
798
  log(`[OK] path represents a file`);
799
799
  return true;
@@ -813,8 +813,8 @@ var require_src2 = __commonJS({
813
813
  throw e;
814
814
  }
815
815
  }
816
- function exists2(path3, type = exports2.READABLE) {
817
- return check(path3, (type & exports2.FILE) > 0, (type & exports2.FOLDER) > 0);
816
+ function exists2(path4, type = exports2.READABLE) {
817
+ return check(path4, (type & exports2.FILE) > 0, (type & exports2.FOLDER) > 0);
818
818
  }
819
819
  exports2.exists = exists2;
820
820
  exports2.FILE = 1;
@@ -1492,8 +1492,8 @@ function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
1492
1492
  function forEachLineWithContent(input, callback) {
1493
1493
  return toLinesWithContent(input, true).map((line) => callback(line));
1494
1494
  }
1495
- function folderExists(path3) {
1496
- return (0, import_file_exists.exists)(path3, import_file_exists.FOLDER);
1495
+ function folderExists(path4) {
1496
+ return (0, import_file_exists.exists)(path4, import_file_exists.FOLDER);
1497
1497
  }
1498
1498
  function append(target, item) {
1499
1499
  if (Array.isArray(target)) {
@@ -1583,8 +1583,8 @@ var init_util = __esm({
1583
1583
  objectToString = Object.prototype.toString.call.bind(Object.prototype.toString);
1584
1584
  }
1585
1585
  });
1586
- function filterType(input, filter, def) {
1587
- if (filter(input)) {
1586
+ function filterType(input, filter2, def) {
1587
+ if (filter2(input)) {
1588
1588
  return input;
1589
1589
  }
1590
1590
  return arguments.length > 2 ? def : void 0;
@@ -1895,8 +1895,8 @@ function checkIsRepoRootTask() {
1895
1895
  commands,
1896
1896
  format: "utf-8",
1897
1897
  onError,
1898
- parser(path3) {
1899
- return /^\.(git)?$/.test(path3.trim());
1898
+ parser(path4) {
1899
+ return /^\.(git)?$/.test(path4.trim());
1900
1900
  }
1901
1901
  };
1902
1902
  }
@@ -2330,11 +2330,11 @@ function parseGrep(grep) {
2330
2330
  const paths = /* @__PURE__ */ new Set();
2331
2331
  const results = {};
2332
2332
  forEachLineWithContent(grep, (input) => {
2333
- const [path3, line, preview] = input.split(NULL);
2334
- paths.add(path3);
2335
- (results[path3] = results[path3] || []).push({
2333
+ const [path4, line, preview] = input.split(NULL);
2334
+ paths.add(path4);
2335
+ (results[path4] = results[path4] || []).push({
2336
2336
  line: asNumber(line),
2337
- path: path3,
2337
+ path: path4,
2338
2338
  preview
2339
2339
  });
2340
2340
  });
@@ -3098,14 +3098,14 @@ var init_hash_object = __esm({
3098
3098
  init_task();
3099
3099
  }
3100
3100
  });
3101
- function parseInit(bare, path3, text) {
3101
+ function parseInit(bare, path4, text) {
3102
3102
  const response = String(text).trim();
3103
3103
  let result;
3104
3104
  if (result = initResponseRegex.exec(response)) {
3105
- return new InitSummary(bare, path3, false, result[1]);
3105
+ return new InitSummary(bare, path4, false, result[1]);
3106
3106
  }
3107
3107
  if (result = reInitResponseRegex.exec(response)) {
3108
- return new InitSummary(bare, path3, true, result[1]);
3108
+ return new InitSummary(bare, path4, true, result[1]);
3109
3109
  }
3110
3110
  let gitDir = "";
3111
3111
  const tokens = response.split(" ");
@@ -3116,7 +3116,7 @@ function parseInit(bare, path3, text) {
3116
3116
  break;
3117
3117
  }
3118
3118
  }
3119
- return new InitSummary(bare, path3, /^re/i.test(response), gitDir);
3119
+ return new InitSummary(bare, path4, /^re/i.test(response), gitDir);
3120
3120
  }
3121
3121
  var InitSummary;
3122
3122
  var initResponseRegex;
@@ -3125,9 +3125,9 @@ var init_InitSummary = __esm({
3125
3125
  "src/lib/responses/InitSummary.ts"() {
3126
3126
  "use strict";
3127
3127
  InitSummary = class {
3128
- constructor(bare, path3, existing, gitDir) {
3128
+ constructor(bare, path4, existing, gitDir) {
3129
3129
  this.bare = bare;
3130
- this.path = path3;
3130
+ this.path = path4;
3131
3131
  this.existing = existing;
3132
3132
  this.gitDir = gitDir;
3133
3133
  }
@@ -3139,7 +3139,7 @@ var init_InitSummary = __esm({
3139
3139
  function hasBareCommand(command) {
3140
3140
  return command.includes(bareCommand);
3141
3141
  }
3142
- function initTask(bare = false, path3, customArgs) {
3142
+ function initTask(bare = false, path4, customArgs) {
3143
3143
  const commands = ["init", ...customArgs];
3144
3144
  if (bare && !hasBareCommand(commands)) {
3145
3145
  commands.splice(1, 0, bareCommand);
@@ -3148,7 +3148,7 @@ function initTask(bare = false, path3, customArgs) {
3148
3148
  commands,
3149
3149
  format: "utf-8",
3150
3150
  parser(text) {
3151
- return parseInit(commands.includes("--bare"), path3, text);
3151
+ return parseInit(commands.includes("--bare"), path4, text);
3152
3152
  }
3153
3153
  };
3154
3154
  }
@@ -3963,12 +3963,12 @@ var init_FileStatusSummary = __esm({
3963
3963
  "use strict";
3964
3964
  fromPathRegex = /^(.+)\0(.+)$/;
3965
3965
  FileStatusSummary = class {
3966
- constructor(path3, index, working_dir) {
3967
- this.path = path3;
3966
+ constructor(path4, index, working_dir) {
3967
+ this.path = path4;
3968
3968
  this.index = index;
3969
3969
  this.working_dir = working_dir;
3970
3970
  if (index === "R" || working_dir === "R") {
3971
- const detail = fromPathRegex.exec(path3) || [null, path3, path3];
3971
+ const detail = fromPathRegex.exec(path4) || [null, path4, path4];
3972
3972
  this.from = detail[2] || "";
3973
3973
  this.path = detail[1] || "";
3974
3974
  }
@@ -3999,14 +3999,14 @@ function splitLine(result, lineStr) {
3999
3999
  default:
4000
4000
  return;
4001
4001
  }
4002
- function data(index, workingDir, path3) {
4002
+ function data(index, workingDir, path4) {
4003
4003
  const raw = `${index}${workingDir}`;
4004
4004
  const handler = parsers6.get(raw);
4005
4005
  if (handler) {
4006
- handler(result, path3);
4006
+ handler(result, path4);
4007
4007
  }
4008
4008
  if (raw !== "##" && raw !== "!!") {
4009
- result.files.push(new FileStatusSummary(path3, index, workingDir));
4009
+ result.files.push(new FileStatusSummary(path4, index, workingDir));
4010
4010
  }
4011
4011
  }
4012
4012
  }
@@ -4357,9 +4357,9 @@ var init_simple_git_api = __esm({
4357
4357
  next
4358
4358
  );
4359
4359
  }
4360
- hashObject(path3, write) {
4360
+ hashObject(path4, write) {
4361
4361
  return this._runTask(
4362
- hashObjectTask(path3, write === true),
4362
+ hashObjectTask(path4, write === true),
4363
4363
  trailingFunctionArgument(arguments)
4364
4364
  );
4365
4365
  }
@@ -4713,8 +4713,8 @@ var init_branch = __esm({
4713
4713
  }
4714
4714
  });
4715
4715
  function toPath(input) {
4716
- const path3 = input.trim().replace(/^["']|["']$/g, "");
4717
- return path3 && (0, import_node_path.normalize)(path3);
4716
+ const path4 = input.trim().replace(/^["']|["']$/g, "");
4717
+ return path4 && (0, import_node_path.normalize)(path4);
4718
4718
  }
4719
4719
  var parseCheckIgnore;
4720
4720
  var init_CheckIgnore = __esm({
@@ -4999,8 +4999,8 @@ __export2(sub_module_exports, {
4999
4999
  subModuleTask: () => subModuleTask,
5000
5000
  updateSubModuleTask: () => updateSubModuleTask
5001
5001
  });
5002
- function addSubModuleTask(repo, path3) {
5003
- return subModuleTask(["add", repo, path3]);
5002
+ function addSubModuleTask(repo, path4) {
5003
+ return subModuleTask(["add", repo, path4]);
5004
5004
  }
5005
5005
  function initSubModuleTask(customArgs) {
5006
5006
  return subModuleTask(["init", ...customArgs]);
@@ -5314,8 +5314,8 @@ var require_git = __commonJS2({
5314
5314
  }
5315
5315
  return this._runTask(straightThroughStringTask2(command, this._trimmed), next);
5316
5316
  };
5317
- Git2.prototype.submoduleAdd = function(repo, path3, then) {
5318
- return this._runTask(addSubModuleTask2(repo, path3), trailingFunctionArgument2(arguments));
5317
+ Git2.prototype.submoduleAdd = function(repo, path4, then) {
5318
+ return this._runTask(addSubModuleTask2(repo, path4), trailingFunctionArgument2(arguments));
5319
5319
  };
5320
5320
  Git2.prototype.submoduleUpdate = function(args, then) {
5321
5321
  return this._runTask(
@@ -5897,11 +5897,11 @@ var ClonedRepository = class _ClonedRepository {
5897
5897
  if (remoteInfo == null) {
5898
5898
  throw new Error("Could not determine default branch");
5899
5899
  }
5900
- const match = remoteInfo.match(/HEAD branch: (.+)/);
5901
- if (!match?.[1]) {
5900
+ const match2 = remoteInfo.match(/HEAD branch: (.+)/);
5901
+ if (!match2?.[1]) {
5902
5902
  throw new Error("Could not determine default branch");
5903
5903
  }
5904
- return match[1].trim();
5904
+ return match2[1].trim();
5905
5905
  }
5906
5906
  async getCurrentBranch() {
5907
5907
  await this.git.cwd(this.clonePath);
@@ -5929,6 +5929,11 @@ var ClonedRepository = class _ClonedRepository {
5929
5929
  }
5930
5930
  await this.git.raw([...args, ...Array.isArray(files) ? files : [files]]);
5931
5931
  }
5932
+ async listTrackedFiles() {
5933
+ await this.git.cwd(this.clonePath);
5934
+ const result = await this.git.raw(["ls-tree", "-r", "HEAD", "--name-only"]);
5935
+ return result.split("\n").filter((line) => line.length > 0);
5936
+ }
5932
5937
  async restoreFilesFromCommit(commitSha, files) {
5933
5938
  await this.git.cwd(this.clonePath);
5934
5939
  const fileList = Array.isArray(files) ? files : [files];
@@ -6200,8 +6205,8 @@ var ClonedRepository = class _ClonedRepository {
6200
6205
  });
6201
6206
  }));
6202
6207
  await Promise.all(sourceContents.filter((content) => !DEFAULT_IGNORED_FILES.includes(content)).map(async (content) => {
6203
- const path3 = (0, import_path.resolve)(sourceDirectoryPath, content);
6204
- await (0, import_promises.cp)(path3, (0, import_path.resolve)(this.clonePath, content), { recursive: true });
6208
+ const path4 = (0, import_path.resolve)(sourceDirectoryPath, content);
6209
+ await (0, import_promises.cp)(path4, (0, import_path.resolve)(this.clonePath, content), { recursive: true });
6205
6210
  }));
6206
6211
  }
6207
6212
  async readFile({ relativeFilePath }) {
@@ -6365,6 +6370,1821 @@ async function cloneRepository({ githubRepository, installationToken, targetDire
6365
6370
  });
6366
6371
  }
6367
6372
 
6373
+ // ../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
6374
+ var balanced = (a, b2, str) => {
6375
+ const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
6376
+ const mb = b2 instanceof RegExp ? maybeMatch(b2, str) : b2;
6377
+ const r2 = ma !== null && mb != null && range(ma, mb, str);
6378
+ return r2 && {
6379
+ start: r2[0],
6380
+ end: r2[1],
6381
+ pre: str.slice(0, r2[0]),
6382
+ body: str.slice(r2[0] + ma.length, r2[1]),
6383
+ post: str.slice(r2[1] + mb.length)
6384
+ };
6385
+ };
6386
+ var maybeMatch = (reg, str) => {
6387
+ const m = str.match(reg);
6388
+ return m ? m[0] : null;
6389
+ };
6390
+ var range = (a, b2, str) => {
6391
+ let begs, beg, left, right = void 0, result;
6392
+ let ai = str.indexOf(a);
6393
+ let bi = str.indexOf(b2, ai + 1);
6394
+ let i2 = ai;
6395
+ if (ai >= 0 && bi > 0) {
6396
+ if (a === b2) {
6397
+ return [ai, bi];
6398
+ }
6399
+ begs = [];
6400
+ left = str.length;
6401
+ while (i2 >= 0 && !result) {
6402
+ if (i2 === ai) {
6403
+ begs.push(i2);
6404
+ ai = str.indexOf(a, i2 + 1);
6405
+ } else if (begs.length === 1) {
6406
+ const r2 = begs.pop();
6407
+ if (r2 !== void 0)
6408
+ result = [r2, bi];
6409
+ } else {
6410
+ beg = begs.pop();
6411
+ if (beg !== void 0 && beg < left) {
6412
+ left = beg;
6413
+ right = bi;
6414
+ }
6415
+ bi = str.indexOf(b2, i2 + 1);
6416
+ }
6417
+ i2 = ai < bi && ai >= 0 ? ai : bi;
6418
+ }
6419
+ if (begs.length && right !== void 0) {
6420
+ result = [left, right];
6421
+ }
6422
+ }
6423
+ return result;
6424
+ };
6425
+
6426
+ // ../../node_modules/.pnpm/brace-expansion@5.0.6/node_modules/brace-expansion/dist/esm/index.js
6427
+ var escSlash = "\0SLASH" + Math.random() + "\0";
6428
+ var escOpen = "\0OPEN" + Math.random() + "\0";
6429
+ var escClose = "\0CLOSE" + Math.random() + "\0";
6430
+ var escComma = "\0COMMA" + Math.random() + "\0";
6431
+ var escPeriod = "\0PERIOD" + Math.random() + "\0";
6432
+ var escSlashPattern = new RegExp(escSlash, "g");
6433
+ var escOpenPattern = new RegExp(escOpen, "g");
6434
+ var escClosePattern = new RegExp(escClose, "g");
6435
+ var escCommaPattern = new RegExp(escComma, "g");
6436
+ var escPeriodPattern = new RegExp(escPeriod, "g");
6437
+ var slashPattern = /\\\\/g;
6438
+ var openPattern = /\\{/g;
6439
+ var closePattern = /\\}/g;
6440
+ var commaPattern = /\\,/g;
6441
+ var periodPattern = /\\\./g;
6442
+ var EXPANSION_MAX = 1e5;
6443
+ function numeric(str) {
6444
+ return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
6445
+ }
6446
+ function escapeBraces(str) {
6447
+ return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
6448
+ }
6449
+ function unescapeBraces(str) {
6450
+ return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
6451
+ }
6452
+ function parseCommaParts(str) {
6453
+ if (!str) {
6454
+ return [""];
6455
+ }
6456
+ const parts = [];
6457
+ const m = balanced("{", "}", str);
6458
+ if (!m) {
6459
+ return str.split(",");
6460
+ }
6461
+ const { pre, body, post } = m;
6462
+ const p2 = pre.split(",");
6463
+ p2[p2.length - 1] += "{" + body + "}";
6464
+ const postParts = parseCommaParts(post);
6465
+ if (post.length) {
6466
+ ;
6467
+ p2[p2.length - 1] += postParts.shift();
6468
+ p2.push.apply(p2, postParts);
6469
+ }
6470
+ parts.push.apply(parts, p2);
6471
+ return parts;
6472
+ }
6473
+ function expand(str, options = {}) {
6474
+ if (!str) {
6475
+ return [];
6476
+ }
6477
+ const { max = EXPANSION_MAX } = options;
6478
+ if (str.slice(0, 2) === "{}") {
6479
+ str = "\\{\\}" + str.slice(2);
6480
+ }
6481
+ return expand_(escapeBraces(str), max, true).map(unescapeBraces);
6482
+ }
6483
+ function embrace(str) {
6484
+ return "{" + str + "}";
6485
+ }
6486
+ function isPadded(el) {
6487
+ return /^-?0\d/.test(el);
6488
+ }
6489
+ function lte(i2, y2) {
6490
+ return i2 <= y2;
6491
+ }
6492
+ function gte(i2, y2) {
6493
+ return i2 >= y2;
6494
+ }
6495
+ function expand_(str, max, isTop) {
6496
+ const expansions = [];
6497
+ const m = balanced("{", "}", str);
6498
+ if (!m)
6499
+ return [str];
6500
+ const pre = m.pre;
6501
+ const post = m.post.length ? expand_(m.post, max, false) : [""];
6502
+ if (/\$$/.test(m.pre)) {
6503
+ for (let k2 = 0; k2 < post.length && k2 < max; k2++) {
6504
+ const expansion = pre + "{" + m.body + "}" + post[k2];
6505
+ expansions.push(expansion);
6506
+ }
6507
+ } else {
6508
+ const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
6509
+ const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
6510
+ const isSequence = isNumericSequence || isAlphaSequence;
6511
+ const isOptions = m.body.indexOf(",") >= 0;
6512
+ if (!isSequence && !isOptions) {
6513
+ if (m.post.match(/,(?!,).*\}/)) {
6514
+ str = m.pre + "{" + m.body + escClose + m.post;
6515
+ return expand_(str, max, true);
6516
+ }
6517
+ return [str];
6518
+ }
6519
+ let n;
6520
+ if (isSequence) {
6521
+ n = m.body.split(/\.\./);
6522
+ } else {
6523
+ n = parseCommaParts(m.body);
6524
+ if (n.length === 1 && n[0] !== void 0) {
6525
+ n = expand_(n[0], max, false).map(embrace);
6526
+ if (n.length === 1) {
6527
+ return post.map((p2) => m.pre + n[0] + p2);
6528
+ }
6529
+ }
6530
+ }
6531
+ let N2;
6532
+ if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
6533
+ const x2 = numeric(n[0]);
6534
+ const y2 = numeric(n[1]);
6535
+ const width = Math.max(n[0].length, n[1].length);
6536
+ let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
6537
+ let test = lte;
6538
+ const reverse = y2 < x2;
6539
+ if (reverse) {
6540
+ incr *= -1;
6541
+ test = gte;
6542
+ }
6543
+ const pad = n.some(isPadded);
6544
+ N2 = [];
6545
+ for (let i2 = x2; test(i2, y2) && N2.length < max; i2 += incr) {
6546
+ let c3;
6547
+ if (isAlphaSequence) {
6548
+ c3 = String.fromCharCode(i2);
6549
+ if (c3 === "\\") {
6550
+ c3 = "";
6551
+ }
6552
+ } else {
6553
+ c3 = String(i2);
6554
+ if (pad) {
6555
+ const need = width - c3.length;
6556
+ if (need > 0) {
6557
+ const z2 = new Array(need + 1).join("0");
6558
+ if (i2 < 0) {
6559
+ c3 = "-" + z2 + c3.slice(1);
6560
+ } else {
6561
+ c3 = z2 + c3;
6562
+ }
6563
+ }
6564
+ }
6565
+ }
6566
+ N2.push(c3);
6567
+ }
6568
+ } else {
6569
+ N2 = [];
6570
+ for (let j2 = 0; j2 < n.length; j2++) {
6571
+ N2.push.apply(N2, expand_(n[j2], max, false));
6572
+ }
6573
+ }
6574
+ for (let j2 = 0; j2 < N2.length; j2++) {
6575
+ for (let k2 = 0; k2 < post.length && expansions.length < max; k2++) {
6576
+ const expansion = pre + N2[j2] + post[k2];
6577
+ if (!isTop || isSequence || expansion) {
6578
+ expansions.push(expansion);
6579
+ }
6580
+ }
6581
+ }
6582
+ }
6583
+ return expansions;
6584
+ }
6585
+
6586
+ // ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js
6587
+ var MAX_PATTERN_LENGTH = 1024 * 64;
6588
+ var assertValidPattern = (pattern) => {
6589
+ if (typeof pattern !== "string") {
6590
+ throw new TypeError("invalid pattern");
6591
+ }
6592
+ if (pattern.length > MAX_PATTERN_LENGTH) {
6593
+ throw new TypeError("pattern is too long");
6594
+ }
6595
+ };
6596
+
6597
+ // ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/brace-expressions.js
6598
+ var posixClasses = {
6599
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
6600
+ "[:alpha:]": ["\\p{L}\\p{Nl}", true],
6601
+ "[:ascii:]": ["\\x00-\\x7f", false],
6602
+ "[:blank:]": ["\\p{Zs}\\t", true],
6603
+ "[:cntrl:]": ["\\p{Cc}", true],
6604
+ "[:digit:]": ["\\p{Nd}", true],
6605
+ "[:graph:]": ["\\p{Z}\\p{C}", true, true],
6606
+ "[:lower:]": ["\\p{Ll}", true],
6607
+ "[:print:]": ["\\p{C}", true],
6608
+ "[:punct:]": ["\\p{P}", true],
6609
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
6610
+ "[:upper:]": ["\\p{Lu}", true],
6611
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
6612
+ "[:xdigit:]": ["A-Fa-f0-9", false]
6613
+ };
6614
+ var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
6615
+ var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
6616
+ var rangesToString = (ranges) => ranges.join("");
6617
+ var parseClass = (glob, position) => {
6618
+ const pos = position;
6619
+ if (glob.charAt(pos) !== "[") {
6620
+ throw new Error("not in a brace expression");
6621
+ }
6622
+ const ranges = [];
6623
+ const negs = [];
6624
+ let i2 = pos + 1;
6625
+ let sawStart = false;
6626
+ let uflag = false;
6627
+ let escaping = false;
6628
+ let negate = false;
6629
+ let endPos = pos;
6630
+ let rangeStart = "";
6631
+ WHILE: while (i2 < glob.length) {
6632
+ const c3 = glob.charAt(i2);
6633
+ if ((c3 === "!" || c3 === "^") && i2 === pos + 1) {
6634
+ negate = true;
6635
+ i2++;
6636
+ continue;
6637
+ }
6638
+ if (c3 === "]" && sawStart && !escaping) {
6639
+ endPos = i2 + 1;
6640
+ break;
6641
+ }
6642
+ sawStart = true;
6643
+ if (c3 === "\\") {
6644
+ if (!escaping) {
6645
+ escaping = true;
6646
+ i2++;
6647
+ continue;
6648
+ }
6649
+ }
6650
+ if (c3 === "[" && !escaping) {
6651
+ for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
6652
+ if (glob.startsWith(cls, i2)) {
6653
+ if (rangeStart) {
6654
+ return ["$.", false, glob.length - pos, true];
6655
+ }
6656
+ i2 += cls.length;
6657
+ if (neg)
6658
+ negs.push(unip);
6659
+ else
6660
+ ranges.push(unip);
6661
+ uflag = uflag || u;
6662
+ continue WHILE;
6663
+ }
6664
+ }
6665
+ }
6666
+ escaping = false;
6667
+ if (rangeStart) {
6668
+ if (c3 > rangeStart) {
6669
+ ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c3));
6670
+ } else if (c3 === rangeStart) {
6671
+ ranges.push(braceEscape(c3));
6672
+ }
6673
+ rangeStart = "";
6674
+ i2++;
6675
+ continue;
6676
+ }
6677
+ if (glob.startsWith("-]", i2 + 1)) {
6678
+ ranges.push(braceEscape(c3 + "-"));
6679
+ i2 += 2;
6680
+ continue;
6681
+ }
6682
+ if (glob.startsWith("-", i2 + 1)) {
6683
+ rangeStart = c3;
6684
+ i2 += 2;
6685
+ continue;
6686
+ }
6687
+ ranges.push(braceEscape(c3));
6688
+ i2++;
6689
+ }
6690
+ if (endPos < i2) {
6691
+ return ["", false, 0, false];
6692
+ }
6693
+ if (!ranges.length && !negs.length) {
6694
+ return ["$.", false, glob.length - pos, true];
6695
+ }
6696
+ if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
6697
+ const r2 = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
6698
+ return [regexpEscape(r2), false, endPos - pos, false];
6699
+ }
6700
+ const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
6701
+ const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
6702
+ const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
6703
+ return [comb, uflag, endPos - pos, true];
6704
+ };
6705
+
6706
+ // ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/unescape.js
6707
+ var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
6708
+ if (magicalBraces) {
6709
+ return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1");
6710
+ }
6711
+ return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
6712
+ };
6713
+
6714
+ // ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/ast.js
6715
+ var _a2;
6716
+ var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
6717
+ var isExtglobType = (c3) => types.has(c3);
6718
+ var isExtglobAST = (c3) => isExtglobType(c3.type);
6719
+ var adoptionMap = /* @__PURE__ */ new Map([
6720
+ ["!", ["@"]],
6721
+ ["?", ["?", "@"]],
6722
+ ["@", ["@"]],
6723
+ ["*", ["*", "+", "?", "@"]],
6724
+ ["+", ["+", "@"]]
6725
+ ]);
6726
+ var adoptionWithSpaceMap = /* @__PURE__ */ new Map([
6727
+ ["!", ["?"]],
6728
+ ["@", ["?"]],
6729
+ ["+", ["?", "*"]]
6730
+ ]);
6731
+ var adoptionAnyMap = /* @__PURE__ */ new Map([
6732
+ ["!", ["?", "@"]],
6733
+ ["?", ["?", "@"]],
6734
+ ["@", ["?", "@"]],
6735
+ ["*", ["*", "+", "?", "@"]],
6736
+ ["+", ["+", "@", "?", "*"]]
6737
+ ]);
6738
+ var usurpMap = /* @__PURE__ */ new Map([
6739
+ ["!", /* @__PURE__ */ new Map([["!", "@"]])],
6740
+ [
6741
+ "?",
6742
+ /* @__PURE__ */ new Map([
6743
+ ["*", "*"],
6744
+ ["+", "*"]
6745
+ ])
6746
+ ],
6747
+ [
6748
+ "@",
6749
+ /* @__PURE__ */ new Map([
6750
+ ["!", "!"],
6751
+ ["?", "?"],
6752
+ ["@", "@"],
6753
+ ["*", "*"],
6754
+ ["+", "+"]
6755
+ ])
6756
+ ],
6757
+ [
6758
+ "+",
6759
+ /* @__PURE__ */ new Map([
6760
+ ["?", "*"],
6761
+ ["*", "*"]
6762
+ ])
6763
+ ]
6764
+ ]);
6765
+ var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
6766
+ var startNoDot = "(?!\\.)";
6767
+ var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
6768
+ var justDots = /* @__PURE__ */ new Set(["..", "."]);
6769
+ var reSpecials = new Set("().*{}+?[]^$\\!");
6770
+ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
6771
+ var qmark = "[^/]";
6772
+ var star = qmark + "*?";
6773
+ var starNoEmpty = qmark + "+?";
6774
+ var ID = 0;
6775
+ var AST = class {
6776
+ type;
6777
+ #root;
6778
+ #hasMagic;
6779
+ #uflag = false;
6780
+ #parts = [];
6781
+ #parent;
6782
+ #parentIndex;
6783
+ #negs;
6784
+ #filledNegs = false;
6785
+ #options;
6786
+ #toString;
6787
+ // set to true if it's an extglob with no children
6788
+ // (which really means one child of '')
6789
+ #emptyExt = false;
6790
+ id = ++ID;
6791
+ get depth() {
6792
+ return (this.#parent?.depth ?? -1) + 1;
6793
+ }
6794
+ [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
6795
+ return {
6796
+ "@@type": "AST",
6797
+ id: this.id,
6798
+ type: this.type,
6799
+ root: this.#root.id,
6800
+ parent: this.#parent?.id,
6801
+ depth: this.depth,
6802
+ partsLength: this.#parts.length,
6803
+ parts: this.#parts
6804
+ };
6805
+ }
6806
+ constructor(type, parent, options = {}) {
6807
+ this.type = type;
6808
+ if (type)
6809
+ this.#hasMagic = true;
6810
+ this.#parent = parent;
6811
+ this.#root = this.#parent ? this.#parent.#root : this;
6812
+ this.#options = this.#root === this ? options : this.#root.#options;
6813
+ this.#negs = this.#root === this ? [] : this.#root.#negs;
6814
+ if (type === "!" && !this.#root.#filledNegs)
6815
+ this.#negs.push(this);
6816
+ this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
6817
+ }
6818
+ get hasMagic() {
6819
+ if (this.#hasMagic !== void 0)
6820
+ return this.#hasMagic;
6821
+ for (const p2 of this.#parts) {
6822
+ if (typeof p2 === "string")
6823
+ continue;
6824
+ if (p2.type || p2.hasMagic)
6825
+ return this.#hasMagic = true;
6826
+ }
6827
+ return this.#hasMagic;
6828
+ }
6829
+ // reconstructs the pattern
6830
+ toString() {
6831
+ return this.#toString !== void 0 ? this.#toString : !this.type ? this.#toString = this.#parts.map((p2) => String(p2)).join("") : this.#toString = this.type + "(" + this.#parts.map((p2) => String(p2)).join("|") + ")";
6832
+ }
6833
+ #fillNegs() {
6834
+ if (this !== this.#root)
6835
+ throw new Error("should only call on root");
6836
+ if (this.#filledNegs)
6837
+ return this;
6838
+ this.toString();
6839
+ this.#filledNegs = true;
6840
+ let n;
6841
+ while (n = this.#negs.pop()) {
6842
+ if (n.type !== "!")
6843
+ continue;
6844
+ let p2 = n;
6845
+ let pp = p2.#parent;
6846
+ while (pp) {
6847
+ for (let i2 = p2.#parentIndex + 1; !pp.type && i2 < pp.#parts.length; i2++) {
6848
+ for (const part of n.#parts) {
6849
+ if (typeof part === "string") {
6850
+ throw new Error("string part in extglob AST??");
6851
+ }
6852
+ part.copyIn(pp.#parts[i2]);
6853
+ }
6854
+ }
6855
+ p2 = pp;
6856
+ pp = p2.#parent;
6857
+ }
6858
+ }
6859
+ return this;
6860
+ }
6861
+ push(...parts) {
6862
+ for (const p2 of parts) {
6863
+ if (p2 === "")
6864
+ continue;
6865
+ if (typeof p2 !== "string" && !(p2 instanceof _a2 && p2.#parent === this)) {
6866
+ throw new Error("invalid part: " + p2);
6867
+ }
6868
+ this.#parts.push(p2);
6869
+ }
6870
+ }
6871
+ toJSON() {
6872
+ const ret = this.type === null ? this.#parts.slice().map((p2) => typeof p2 === "string" ? p2 : p2.toJSON()) : [this.type, ...this.#parts.map((p2) => p2.toJSON())];
6873
+ if (this.isStart() && !this.type)
6874
+ ret.unshift([]);
6875
+ if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) {
6876
+ ret.push({});
6877
+ }
6878
+ return ret;
6879
+ }
6880
+ isStart() {
6881
+ if (this.#root === this)
6882
+ return true;
6883
+ if (!this.#parent?.isStart())
6884
+ return false;
6885
+ if (this.#parentIndex === 0)
6886
+ return true;
6887
+ const p2 = this.#parent;
6888
+ for (let i2 = 0; i2 < this.#parentIndex; i2++) {
6889
+ const pp = p2.#parts[i2];
6890
+ if (!(pp instanceof _a2 && pp.type === "!")) {
6891
+ return false;
6892
+ }
6893
+ }
6894
+ return true;
6895
+ }
6896
+ isEnd() {
6897
+ if (this.#root === this)
6898
+ return true;
6899
+ if (this.#parent?.type === "!")
6900
+ return true;
6901
+ if (!this.#parent?.isEnd())
6902
+ return false;
6903
+ if (!this.type)
6904
+ return this.#parent?.isEnd();
6905
+ const pl = this.#parent ? this.#parent.#parts.length : 0;
6906
+ return this.#parentIndex === pl - 1;
6907
+ }
6908
+ copyIn(part) {
6909
+ if (typeof part === "string")
6910
+ this.push(part);
6911
+ else
6912
+ this.push(part.clone(this));
6913
+ }
6914
+ clone(parent) {
6915
+ const c3 = new _a2(this.type, parent);
6916
+ for (const p2 of this.#parts) {
6917
+ c3.copyIn(p2);
6918
+ }
6919
+ return c3;
6920
+ }
6921
+ static #parseAST(str, ast, pos, opt, extDepth) {
6922
+ const maxDepth = opt.maxExtglobRecursion ?? 2;
6923
+ let escaping = false;
6924
+ let inBrace = false;
6925
+ let braceStart = -1;
6926
+ let braceNeg = false;
6927
+ if (ast.type === null) {
6928
+ let i3 = pos;
6929
+ let acc2 = "";
6930
+ while (i3 < str.length) {
6931
+ const c3 = str.charAt(i3++);
6932
+ if (escaping || c3 === "\\") {
6933
+ escaping = !escaping;
6934
+ acc2 += c3;
6935
+ continue;
6936
+ }
6937
+ if (inBrace) {
6938
+ if (i3 === braceStart + 1) {
6939
+ if (c3 === "^" || c3 === "!") {
6940
+ braceNeg = true;
6941
+ }
6942
+ } else if (c3 === "]" && !(i3 === braceStart + 2 && braceNeg)) {
6943
+ inBrace = false;
6944
+ }
6945
+ acc2 += c3;
6946
+ continue;
6947
+ } else if (c3 === "[") {
6948
+ inBrace = true;
6949
+ braceStart = i3;
6950
+ braceNeg = false;
6951
+ acc2 += c3;
6952
+ continue;
6953
+ }
6954
+ const doRecurse = !opt.noext && isExtglobType(c3) && str.charAt(i3) === "(" && extDepth <= maxDepth;
6955
+ if (doRecurse) {
6956
+ ast.push(acc2);
6957
+ acc2 = "";
6958
+ const ext2 = new _a2(c3, ast);
6959
+ i3 = _a2.#parseAST(str, ext2, i3, opt, extDepth + 1);
6960
+ ast.push(ext2);
6961
+ continue;
6962
+ }
6963
+ acc2 += c3;
6964
+ }
6965
+ ast.push(acc2);
6966
+ return i3;
6967
+ }
6968
+ let i2 = pos + 1;
6969
+ let part = new _a2(null, ast);
6970
+ const parts = [];
6971
+ let acc = "";
6972
+ while (i2 < str.length) {
6973
+ const c3 = str.charAt(i2++);
6974
+ if (escaping || c3 === "\\") {
6975
+ escaping = !escaping;
6976
+ acc += c3;
6977
+ continue;
6978
+ }
6979
+ if (inBrace) {
6980
+ if (i2 === braceStart + 1) {
6981
+ if (c3 === "^" || c3 === "!") {
6982
+ braceNeg = true;
6983
+ }
6984
+ } else if (c3 === "]" && !(i2 === braceStart + 2 && braceNeg)) {
6985
+ inBrace = false;
6986
+ }
6987
+ acc += c3;
6988
+ continue;
6989
+ } else if (c3 === "[") {
6990
+ inBrace = true;
6991
+ braceStart = i2;
6992
+ braceNeg = false;
6993
+ acc += c3;
6994
+ continue;
6995
+ }
6996
+ const doRecurse = !opt.noext && isExtglobType(c3) && str.charAt(i2) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
6997
+ (extDepth <= maxDepth || ast && ast.#canAdoptType(c3));
6998
+ if (doRecurse) {
6999
+ const depthAdd = ast && ast.#canAdoptType(c3) ? 0 : 1;
7000
+ part.push(acc);
7001
+ acc = "";
7002
+ const ext2 = new _a2(c3, part);
7003
+ part.push(ext2);
7004
+ i2 = _a2.#parseAST(str, ext2, i2, opt, extDepth + depthAdd);
7005
+ continue;
7006
+ }
7007
+ if (c3 === "|") {
7008
+ part.push(acc);
7009
+ acc = "";
7010
+ parts.push(part);
7011
+ part = new _a2(null, ast);
7012
+ continue;
7013
+ }
7014
+ if (c3 === ")") {
7015
+ if (acc === "" && ast.#parts.length === 0) {
7016
+ ast.#emptyExt = true;
7017
+ }
7018
+ part.push(acc);
7019
+ acc = "";
7020
+ ast.push(...parts, part);
7021
+ return i2;
7022
+ }
7023
+ acc += c3;
7024
+ }
7025
+ ast.type = null;
7026
+ ast.#hasMagic = void 0;
7027
+ ast.#parts = [str.substring(pos - 1)];
7028
+ return i2;
7029
+ }
7030
+ #canAdoptWithSpace(child) {
7031
+ return this.#canAdopt(child, adoptionWithSpaceMap);
7032
+ }
7033
+ #canAdopt(child, map = adoptionMap) {
7034
+ if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
7035
+ return false;
7036
+ }
7037
+ const gc = child.#parts[0];
7038
+ if (!gc || typeof gc !== "object" || gc.type === null) {
7039
+ return false;
7040
+ }
7041
+ return this.#canAdoptType(gc.type, map);
7042
+ }
7043
+ #canAdoptType(c3, map = adoptionAnyMap) {
7044
+ return !!map.get(this.type)?.includes(c3);
7045
+ }
7046
+ #adoptWithSpace(child, index) {
7047
+ const gc = child.#parts[0];
7048
+ const blank = new _a2(null, gc, this.options);
7049
+ blank.#parts.push("");
7050
+ gc.push(blank);
7051
+ this.#adopt(child, index);
7052
+ }
7053
+ #adopt(child, index) {
7054
+ const gc = child.#parts[0];
7055
+ this.#parts.splice(index, 1, ...gc.#parts);
7056
+ for (const p2 of gc.#parts) {
7057
+ if (typeof p2 === "object")
7058
+ p2.#parent = this;
7059
+ }
7060
+ this.#toString = void 0;
7061
+ }
7062
+ #canUsurpType(c3) {
7063
+ const m = usurpMap.get(this.type);
7064
+ return !!m?.has(c3);
7065
+ }
7066
+ #canUsurp(child) {
7067
+ if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
7068
+ return false;
7069
+ }
7070
+ const gc = child.#parts[0];
7071
+ if (!gc || typeof gc !== "object" || gc.type === null) {
7072
+ return false;
7073
+ }
7074
+ return this.#canUsurpType(gc.type);
7075
+ }
7076
+ #usurp(child) {
7077
+ const m = usurpMap.get(this.type);
7078
+ const gc = child.#parts[0];
7079
+ const nt = m?.get(gc.type);
7080
+ if (!nt)
7081
+ return false;
7082
+ this.#parts = gc.#parts;
7083
+ for (const p2 of this.#parts) {
7084
+ if (typeof p2 === "object") {
7085
+ p2.#parent = this;
7086
+ }
7087
+ }
7088
+ this.type = nt;
7089
+ this.#toString = void 0;
7090
+ this.#emptyExt = false;
7091
+ }
7092
+ static fromGlob(pattern, options = {}) {
7093
+ const ast = new _a2(null, void 0, options);
7094
+ _a2.#parseAST(pattern, ast, 0, options, 0);
7095
+ return ast;
7096
+ }
7097
+ // returns the regular expression if there's magic, or the unescaped
7098
+ // string if not.
7099
+ toMMPattern() {
7100
+ if (this !== this.#root)
7101
+ return this.#root.toMMPattern();
7102
+ const glob = this.toString();
7103
+ const [re, body, hasMagic, uflag] = this.toRegExpSource();
7104
+ const anyMagic = hasMagic || this.#hasMagic || this.#options.nocase && !this.#options.nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
7105
+ if (!anyMagic) {
7106
+ return body;
7107
+ }
7108
+ const flags = (this.#options.nocase ? "i" : "") + (uflag ? "u" : "");
7109
+ return Object.assign(new RegExp(`^${re}$`, flags), {
7110
+ _src: re,
7111
+ _glob: glob
7112
+ });
7113
+ }
7114
+ get options() {
7115
+ return this.#options;
7116
+ }
7117
+ // returns the string match, the regexp source, whether there's magic
7118
+ // in the regexp (so a regular expression is required) and whether or
7119
+ // not the uflag is needed for the regular expression (for posix classes)
7120
+ // TODO: instead of injecting the start/end at this point, just return
7121
+ // the BODY of the regexp, along with the start/end portions suitable
7122
+ // for binding the start/end in either a joined full-path makeRe context
7123
+ // (where we bind to (^|/), or a standalone matchPart context (where
7124
+ // we bind to ^, and not /). Otherwise slashes get duped!
7125
+ //
7126
+ // In part-matching mode, the start is:
7127
+ // - if not isStart: nothing
7128
+ // - if traversal possible, but not allowed: ^(?!\.\.?$)
7129
+ // - if dots allowed or not possible: ^
7130
+ // - if dots possible and not allowed: ^(?!\.)
7131
+ // end is:
7132
+ // - if not isEnd(): nothing
7133
+ // - else: $
7134
+ //
7135
+ // In full-path matching mode, we put the slash at the START of the
7136
+ // pattern, so start is:
7137
+ // - if first pattern: same as part-matching mode
7138
+ // - if not isStart(): nothing
7139
+ // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
7140
+ // - if dots allowed or not possible: /
7141
+ // - if dots possible and not allowed: /(?!\.)
7142
+ // end is:
7143
+ // - if last pattern, same as part-matching mode
7144
+ // - else nothing
7145
+ //
7146
+ // Always put the (?:$|/) on negated tails, though, because that has to be
7147
+ // there to bind the end of the negated pattern portion, and it's easier to
7148
+ // just stick it in now rather than try to inject it later in the middle of
7149
+ // the pattern.
7150
+ //
7151
+ // We can just always return the same end, and leave it up to the caller
7152
+ // to know whether it's going to be used joined or in parts.
7153
+ // And, if the start is adjusted slightly, can do the same there:
7154
+ // - if not isStart: nothing
7155
+ // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
7156
+ // - if dots allowed or not possible: (?:/|^)
7157
+ // - if dots possible and not allowed: (?:/|^)(?!\.)
7158
+ //
7159
+ // But it's better to have a simpler binding without a conditional, for
7160
+ // performance, so probably better to return both start options.
7161
+ //
7162
+ // Then the caller just ignores the end if it's not the first pattern,
7163
+ // and the start always gets applied.
7164
+ //
7165
+ // But that's always going to be $ if it's the ending pattern, or nothing,
7166
+ // so the caller can just attach $ at the end of the pattern when building.
7167
+ //
7168
+ // So the todo is:
7169
+ // - better detect what kind of start is needed
7170
+ // - return both flavors of starting pattern
7171
+ // - attach $ at the end of the pattern when creating the actual RegExp
7172
+ //
7173
+ // Ah, but wait, no, that all only applies to the root when the first pattern
7174
+ // is not an extglob. If the first pattern IS an extglob, then we need all
7175
+ // that dot prevention biz to live in the extglob portions, because eg
7176
+ // +(*|.x*) can match .xy but not .yx.
7177
+ //
7178
+ // So, return the two flavors if it's #root and the first child is not an
7179
+ // AST, otherwise leave it to the child AST to handle it, and there,
7180
+ // use the (?:^|/) style of start binding.
7181
+ //
7182
+ // Even simplified further:
7183
+ // - Since the start for a join is eg /(?!\.) and the start for a part
7184
+ // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
7185
+ // or start or whatever) and prepend ^ or / at the Regexp construction.
7186
+ toRegExpSource(allowDot) {
7187
+ const dot = allowDot ?? !!this.#options.dot;
7188
+ if (this.#root === this) {
7189
+ this.#flatten();
7190
+ this.#fillNegs();
7191
+ }
7192
+ if (!isExtglobAST(this)) {
7193
+ const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
7194
+ const src = this.#parts.map((p2) => {
7195
+ const [re, _2, hasMagic, uflag] = typeof p2 === "string" ? _a2.#parseGlob(p2, this.#hasMagic, noEmpty) : p2.toRegExpSource(allowDot);
7196
+ this.#hasMagic = this.#hasMagic || hasMagic;
7197
+ this.#uflag = this.#uflag || uflag;
7198
+ return re;
7199
+ }).join("");
7200
+ let start2 = "";
7201
+ if (this.isStart()) {
7202
+ if (typeof this.#parts[0] === "string") {
7203
+ const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
7204
+ if (!dotTravAllowed) {
7205
+ const aps = addPatternStart;
7206
+ const needNoTrav = (
7207
+ // dots are allowed, and the pattern starts with [ or .
7208
+ dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
7209
+ src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
7210
+ src.startsWith("\\.\\.") && aps.has(src.charAt(4))
7211
+ );
7212
+ const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
7213
+ start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
7214
+ }
7215
+ }
7216
+ }
7217
+ let end = "";
7218
+ if (this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!") {
7219
+ end = "(?:$|\\/)";
7220
+ }
7221
+ const final2 = start2 + src + end;
7222
+ return [
7223
+ final2,
7224
+ unescape(src),
7225
+ this.#hasMagic = !!this.#hasMagic,
7226
+ this.#uflag
7227
+ ];
7228
+ }
7229
+ const repeated = this.type === "*" || this.type === "+";
7230
+ const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
7231
+ let body = this.#partsToRegExp(dot);
7232
+ if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
7233
+ const s = this.toString();
7234
+ const me = this;
7235
+ me.#parts = [s];
7236
+ me.type = null;
7237
+ me.#hasMagic = void 0;
7238
+ return [s, unescape(this.toString()), false, false];
7239
+ }
7240
+ let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
7241
+ if (bodyDotAllowed === body) {
7242
+ bodyDotAllowed = "";
7243
+ }
7244
+ if (bodyDotAllowed) {
7245
+ body = `(?:${body})(?:${bodyDotAllowed})*?`;
7246
+ }
7247
+ let final = "";
7248
+ if (this.type === "!" && this.#emptyExt) {
7249
+ final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
7250
+ } else {
7251
+ const close = this.type === "!" ? (
7252
+ // !() must match something,but !(x) can match ''
7253
+ "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
7254
+ ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
7255
+ final = start + body + close;
7256
+ }
7257
+ return [
7258
+ final,
7259
+ unescape(body),
7260
+ this.#hasMagic = !!this.#hasMagic,
7261
+ this.#uflag
7262
+ ];
7263
+ }
7264
+ #flatten() {
7265
+ if (!isExtglobAST(this)) {
7266
+ for (const p2 of this.#parts) {
7267
+ if (typeof p2 === "object") {
7268
+ p2.#flatten();
7269
+ }
7270
+ }
7271
+ } else {
7272
+ let iterations = 0;
7273
+ let done = false;
7274
+ do {
7275
+ done = true;
7276
+ for (let i2 = 0; i2 < this.#parts.length; i2++) {
7277
+ const c3 = this.#parts[i2];
7278
+ if (typeof c3 === "object") {
7279
+ c3.#flatten();
7280
+ if (this.#canAdopt(c3)) {
7281
+ done = false;
7282
+ this.#adopt(c3, i2);
7283
+ } else if (this.#canAdoptWithSpace(c3)) {
7284
+ done = false;
7285
+ this.#adoptWithSpace(c3, i2);
7286
+ } else if (this.#canUsurp(c3)) {
7287
+ done = false;
7288
+ this.#usurp(c3);
7289
+ }
7290
+ }
7291
+ }
7292
+ } while (!done && ++iterations < 10);
7293
+ }
7294
+ this.#toString = void 0;
7295
+ }
7296
+ #partsToRegExp(dot) {
7297
+ return this.#parts.map((p2) => {
7298
+ if (typeof p2 === "string") {
7299
+ throw new Error("string type in extglob ast??");
7300
+ }
7301
+ const [re, _2, _hasMagic, uflag] = p2.toRegExpSource(dot);
7302
+ this.#uflag = this.#uflag || uflag;
7303
+ return re;
7304
+ }).filter((p2) => !(this.isStart() && this.isEnd()) || !!p2).join("|");
7305
+ }
7306
+ static #parseGlob(glob, hasMagic, noEmpty = false) {
7307
+ let escaping = false;
7308
+ let re = "";
7309
+ let uflag = false;
7310
+ let inStar = false;
7311
+ for (let i2 = 0; i2 < glob.length; i2++) {
7312
+ const c3 = glob.charAt(i2);
7313
+ if (escaping) {
7314
+ escaping = false;
7315
+ re += (reSpecials.has(c3) ? "\\" : "") + c3;
7316
+ continue;
7317
+ }
7318
+ if (c3 === "*") {
7319
+ if (inStar)
7320
+ continue;
7321
+ inStar = true;
7322
+ re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
7323
+ hasMagic = true;
7324
+ continue;
7325
+ } else {
7326
+ inStar = false;
7327
+ }
7328
+ if (c3 === "\\") {
7329
+ if (i2 === glob.length - 1) {
7330
+ re += "\\\\";
7331
+ } else {
7332
+ escaping = true;
7333
+ }
7334
+ continue;
7335
+ }
7336
+ if (c3 === "[") {
7337
+ const [src, needUflag, consumed, magic] = parseClass(glob, i2);
7338
+ if (consumed) {
7339
+ re += src;
7340
+ uflag = uflag || needUflag;
7341
+ i2 += consumed - 1;
7342
+ hasMagic = hasMagic || magic;
7343
+ continue;
7344
+ }
7345
+ }
7346
+ if (c3 === "?") {
7347
+ re += qmark;
7348
+ hasMagic = true;
7349
+ continue;
7350
+ }
7351
+ re += regExpEscape(c3);
7352
+ }
7353
+ return [re, unescape(glob), !!hasMagic, uflag];
7354
+ }
7355
+ };
7356
+ _a2 = AST;
7357
+
7358
+ // ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/escape.js
7359
+ var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
7360
+ if (magicalBraces) {
7361
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
7362
+ }
7363
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
7364
+ };
7365
+
7366
+ // ../../node_modules/.pnpm/minimatch@10.2.5/node_modules/minimatch/dist/esm/index.js
7367
+ var minimatch = (p2, pattern, options = {}) => {
7368
+ assertValidPattern(pattern);
7369
+ if (!options.nocomment && pattern.charAt(0) === "#") {
7370
+ return false;
7371
+ }
7372
+ return new Minimatch(pattern, options).match(p2);
7373
+ };
7374
+ var starDotExtRE = /^\*+([^+@!?*[(]*)$/;
7375
+ var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
7376
+ var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
7377
+ var starDotExtTestNocase = (ext2) => {
7378
+ ext2 = ext2.toLowerCase();
7379
+ return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
7380
+ };
7381
+ var starDotExtTestNocaseDot = (ext2) => {
7382
+ ext2 = ext2.toLowerCase();
7383
+ return (f) => f.toLowerCase().endsWith(ext2);
7384
+ };
7385
+ var starDotStarRE = /^\*+\.\*+$/;
7386
+ var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
7387
+ var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
7388
+ var dotStarRE = /^\.\*+$/;
7389
+ var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
7390
+ var starRE = /^\*+$/;
7391
+ var starTest = (f) => f.length !== 0 && !f.startsWith(".");
7392
+ var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
7393
+ var qmarksRE = /^\?+([^+@!?*[(]*)?$/;
7394
+ var qmarksTestNocase = ([$0, ext2 = ""]) => {
7395
+ const noext = qmarksTestNoExt([$0]);
7396
+ if (!ext2)
7397
+ return noext;
7398
+ ext2 = ext2.toLowerCase();
7399
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
7400
+ };
7401
+ var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
7402
+ const noext = qmarksTestNoExtDot([$0]);
7403
+ if (!ext2)
7404
+ return noext;
7405
+ ext2 = ext2.toLowerCase();
7406
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
7407
+ };
7408
+ var qmarksTestDot = ([$0, ext2 = ""]) => {
7409
+ const noext = qmarksTestNoExtDot([$0]);
7410
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
7411
+ };
7412
+ var qmarksTest = ([$0, ext2 = ""]) => {
7413
+ const noext = qmarksTestNoExt([$0]);
7414
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
7415
+ };
7416
+ var qmarksTestNoExt = ([$0]) => {
7417
+ const len = $0.length;
7418
+ return (f) => f.length === len && !f.startsWith(".");
7419
+ };
7420
+ var qmarksTestNoExtDot = ([$0]) => {
7421
+ const len = $0.length;
7422
+ return (f) => f.length === len && f !== "." && f !== "..";
7423
+ };
7424
+ var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
7425
+ var path2 = {
7426
+ win32: { sep: "\\" },
7427
+ posix: { sep: "/" }
7428
+ };
7429
+ var sep = defaultPlatform === "win32" ? path2.win32.sep : path2.posix.sep;
7430
+ minimatch.sep = sep;
7431
+ var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **");
7432
+ minimatch.GLOBSTAR = GLOBSTAR;
7433
+ var qmark2 = "[^/]";
7434
+ var star2 = qmark2 + "*?";
7435
+ var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
7436
+ var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
7437
+ var filter = (pattern, options = {}) => (p2) => minimatch(p2, pattern, options);
7438
+ minimatch.filter = filter;
7439
+ var ext = (a, b2 = {}) => Object.assign({}, a, b2);
7440
+ var defaults = (def) => {
7441
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
7442
+ return minimatch;
7443
+ }
7444
+ const orig = minimatch;
7445
+ const m = (p2, pattern, options = {}) => orig(p2, pattern, ext(def, options));
7446
+ return Object.assign(m, {
7447
+ Minimatch: class Minimatch extends orig.Minimatch {
7448
+ constructor(pattern, options = {}) {
7449
+ super(pattern, ext(def, options));
7450
+ }
7451
+ static defaults(options) {
7452
+ return orig.defaults(ext(def, options)).Minimatch;
7453
+ }
7454
+ },
7455
+ AST: class AST extends orig.AST {
7456
+ /* c8 ignore start */
7457
+ constructor(type, parent, options = {}) {
7458
+ super(type, parent, ext(def, options));
7459
+ }
7460
+ /* c8 ignore stop */
7461
+ static fromGlob(pattern, options = {}) {
7462
+ return orig.AST.fromGlob(pattern, ext(def, options));
7463
+ }
7464
+ },
7465
+ unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
7466
+ escape: (s, options = {}) => orig.escape(s, ext(def, options)),
7467
+ filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
7468
+ defaults: (options) => orig.defaults(ext(def, options)),
7469
+ makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
7470
+ braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
7471
+ match: (list2, pattern, options = {}) => orig.match(list2, pattern, ext(def, options)),
7472
+ sep: orig.sep,
7473
+ GLOBSTAR
7474
+ });
7475
+ };
7476
+ minimatch.defaults = defaults;
7477
+ var braceExpand = (pattern, options = {}) => {
7478
+ assertValidPattern(pattern);
7479
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
7480
+ return [pattern];
7481
+ }
7482
+ return expand(pattern, { max: options.braceExpandMax });
7483
+ };
7484
+ minimatch.braceExpand = braceExpand;
7485
+ var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
7486
+ minimatch.makeRe = makeRe;
7487
+ var match = (list2, pattern, options = {}) => {
7488
+ const mm = new Minimatch(pattern, options);
7489
+ list2 = list2.filter((f) => mm.match(f));
7490
+ if (mm.options.nonull && !list2.length) {
7491
+ list2.push(pattern);
7492
+ }
7493
+ return list2;
7494
+ };
7495
+ minimatch.match = match;
7496
+ var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
7497
+ var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
7498
+ var Minimatch = class {
7499
+ options;
7500
+ set;
7501
+ pattern;
7502
+ windowsPathsNoEscape;
7503
+ nonegate;
7504
+ negate;
7505
+ comment;
7506
+ empty;
7507
+ preserveMultipleSlashes;
7508
+ partial;
7509
+ globSet;
7510
+ globParts;
7511
+ nocase;
7512
+ isWindows;
7513
+ platform;
7514
+ windowsNoMagicRoot;
7515
+ maxGlobstarRecursion;
7516
+ regexp;
7517
+ constructor(pattern, options = {}) {
7518
+ assertValidPattern(pattern);
7519
+ options = options || {};
7520
+ this.options = options;
7521
+ this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
7522
+ this.pattern = pattern;
7523
+ this.platform = options.platform || defaultPlatform;
7524
+ this.isWindows = this.platform === "win32";
7525
+ const awe = "allowWindowsEscape";
7526
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options[awe] === false;
7527
+ if (this.windowsPathsNoEscape) {
7528
+ this.pattern = this.pattern.replace(/\\/g, "/");
7529
+ }
7530
+ this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
7531
+ this.regexp = null;
7532
+ this.negate = false;
7533
+ this.nonegate = !!options.nonegate;
7534
+ this.comment = false;
7535
+ this.empty = false;
7536
+ this.partial = !!options.partial;
7537
+ this.nocase = !!this.options.nocase;
7538
+ this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
7539
+ this.globSet = [];
7540
+ this.globParts = [];
7541
+ this.set = [];
7542
+ this.make();
7543
+ }
7544
+ hasMagic() {
7545
+ if (this.options.magicalBraces && this.set.length > 1) {
7546
+ return true;
7547
+ }
7548
+ for (const pattern of this.set) {
7549
+ for (const part of pattern) {
7550
+ if (typeof part !== "string")
7551
+ return true;
7552
+ }
7553
+ }
7554
+ return false;
7555
+ }
7556
+ debug(..._2) {
7557
+ }
7558
+ make() {
7559
+ const pattern = this.pattern;
7560
+ const options = this.options;
7561
+ if (!options.nocomment && pattern.charAt(0) === "#") {
7562
+ this.comment = true;
7563
+ return;
7564
+ }
7565
+ if (!pattern) {
7566
+ this.empty = true;
7567
+ return;
7568
+ }
7569
+ this.parseNegate();
7570
+ this.globSet = [...new Set(this.braceExpand())];
7571
+ if (options.debug) {
7572
+ this.debug = (...args) => console.error(...args);
7573
+ }
7574
+ this.debug(this.pattern, this.globSet);
7575
+ const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
7576
+ this.globParts = this.preprocess(rawGlobParts);
7577
+ this.debug(this.pattern, this.globParts);
7578
+ let set2 = this.globParts.map((s, _2, __) => {
7579
+ if (this.isWindows && this.windowsNoMagicRoot) {
7580
+ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
7581
+ const isDrive = /^[a-z]:/i.test(s[0]);
7582
+ if (isUNC) {
7583
+ return [
7584
+ ...s.slice(0, 4),
7585
+ ...s.slice(4).map((ss) => this.parse(ss))
7586
+ ];
7587
+ } else if (isDrive) {
7588
+ return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
7589
+ }
7590
+ }
7591
+ return s.map((ss) => this.parse(ss));
7592
+ });
7593
+ this.debug(this.pattern, set2);
7594
+ this.set = set2.filter((s) => s.indexOf(false) === -1);
7595
+ if (this.isWindows) {
7596
+ for (let i2 = 0; i2 < this.set.length; i2++) {
7597
+ const p2 = this.set[i2];
7598
+ if (p2[0] === "" && p2[1] === "" && this.globParts[i2][2] === "?" && typeof p2[3] === "string" && /^[a-z]:$/i.test(p2[3])) {
7599
+ p2[2] = "?";
7600
+ }
7601
+ }
7602
+ }
7603
+ this.debug(this.pattern, this.set);
7604
+ }
7605
+ // various transforms to equivalent pattern sets that are
7606
+ // faster to process in a filesystem walk. The goal is to
7607
+ // eliminate what we can, and push all ** patterns as far
7608
+ // to the right as possible, even if it increases the number
7609
+ // of patterns that we have to process.
7610
+ preprocess(globParts) {
7611
+ if (this.options.noglobstar) {
7612
+ for (const partset of globParts) {
7613
+ for (let j2 = 0; j2 < partset.length; j2++) {
7614
+ if (partset[j2] === "**") {
7615
+ partset[j2] = "*";
7616
+ }
7617
+ }
7618
+ }
7619
+ }
7620
+ const { optimizationLevel = 1 } = this.options;
7621
+ if (optimizationLevel >= 2) {
7622
+ globParts = this.firstPhasePreProcess(globParts);
7623
+ globParts = this.secondPhasePreProcess(globParts);
7624
+ } else if (optimizationLevel >= 1) {
7625
+ globParts = this.levelOneOptimize(globParts);
7626
+ } else {
7627
+ globParts = this.adjascentGlobstarOptimize(globParts);
7628
+ }
7629
+ return globParts;
7630
+ }
7631
+ // just get rid of adjascent ** portions
7632
+ adjascentGlobstarOptimize(globParts) {
7633
+ return globParts.map((parts) => {
7634
+ let gs = -1;
7635
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
7636
+ let i2 = gs;
7637
+ while (parts[i2 + 1] === "**") {
7638
+ i2++;
7639
+ }
7640
+ if (i2 !== gs) {
7641
+ parts.splice(gs, i2 - gs);
7642
+ }
7643
+ }
7644
+ return parts;
7645
+ });
7646
+ }
7647
+ // get rid of adjascent ** and resolve .. portions
7648
+ levelOneOptimize(globParts) {
7649
+ return globParts.map((parts) => {
7650
+ parts = parts.reduce((set2, part) => {
7651
+ const prev = set2[set2.length - 1];
7652
+ if (part === "**" && prev === "**") {
7653
+ return set2;
7654
+ }
7655
+ if (part === "..") {
7656
+ if (prev && prev !== ".." && prev !== "." && prev !== "**") {
7657
+ set2.pop();
7658
+ return set2;
7659
+ }
7660
+ }
7661
+ set2.push(part);
7662
+ return set2;
7663
+ }, []);
7664
+ return parts.length === 0 ? [""] : parts;
7665
+ });
7666
+ }
7667
+ levelTwoFileOptimize(parts) {
7668
+ if (!Array.isArray(parts)) {
7669
+ parts = this.slashSplit(parts);
7670
+ }
7671
+ let didSomething = false;
7672
+ do {
7673
+ didSomething = false;
7674
+ if (!this.preserveMultipleSlashes) {
7675
+ for (let i2 = 1; i2 < parts.length - 1; i2++) {
7676
+ const p2 = parts[i2];
7677
+ if (i2 === 1 && p2 === "" && parts[0] === "")
7678
+ continue;
7679
+ if (p2 === "." || p2 === "") {
7680
+ didSomething = true;
7681
+ parts.splice(i2, 1);
7682
+ i2--;
7683
+ }
7684
+ }
7685
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
7686
+ didSomething = true;
7687
+ parts.pop();
7688
+ }
7689
+ }
7690
+ let dd = 0;
7691
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
7692
+ const p2 = parts[dd - 1];
7693
+ if (p2 && p2 !== "." && p2 !== ".." && p2 !== "**" && !(this.isWindows && /^[a-z]:$/i.test(p2))) {
7694
+ didSomething = true;
7695
+ parts.splice(dd - 1, 2);
7696
+ dd -= 2;
7697
+ }
7698
+ }
7699
+ } while (didSomething);
7700
+ return parts.length === 0 ? [""] : parts;
7701
+ }
7702
+ // First phase: single-pattern processing
7703
+ // <pre> is 1 or more portions
7704
+ // <rest> is 1 or more portions
7705
+ // <p> is any portion other than ., .., '', or **
7706
+ // <e> is . or ''
7707
+ //
7708
+ // **/.. is *brutal* for filesystem walking performance, because
7709
+ // it effectively resets the recursive walk each time it occurs,
7710
+ // and ** cannot be reduced out by a .. pattern part like a regexp
7711
+ // or most strings (other than .., ., and '') can be.
7712
+ //
7713
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
7714
+ // <pre>/<e>/<rest> -> <pre>/<rest>
7715
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
7716
+ // **/**/<rest> -> **/<rest>
7717
+ //
7718
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
7719
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
7720
+ firstPhasePreProcess(globParts) {
7721
+ let didSomething = false;
7722
+ do {
7723
+ didSomething = false;
7724
+ for (let parts of globParts) {
7725
+ let gs = -1;
7726
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
7727
+ let gss = gs;
7728
+ while (parts[gss + 1] === "**") {
7729
+ gss++;
7730
+ }
7731
+ if (gss > gs) {
7732
+ parts.splice(gs + 1, gss - gs);
7733
+ }
7734
+ let next = parts[gs + 1];
7735
+ const p2 = parts[gs + 2];
7736
+ const p22 = parts[gs + 3];
7737
+ if (next !== "..")
7738
+ continue;
7739
+ if (!p2 || p2 === "." || p2 === ".." || !p22 || p22 === "." || p22 === "..") {
7740
+ continue;
7741
+ }
7742
+ didSomething = true;
7743
+ parts.splice(gs, 1);
7744
+ const other = parts.slice(0);
7745
+ other[gs] = "**";
7746
+ globParts.push(other);
7747
+ gs--;
7748
+ }
7749
+ if (!this.preserveMultipleSlashes) {
7750
+ for (let i2 = 1; i2 < parts.length - 1; i2++) {
7751
+ const p2 = parts[i2];
7752
+ if (i2 === 1 && p2 === "" && parts[0] === "")
7753
+ continue;
7754
+ if (p2 === "." || p2 === "") {
7755
+ didSomething = true;
7756
+ parts.splice(i2, 1);
7757
+ i2--;
7758
+ }
7759
+ }
7760
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
7761
+ didSomething = true;
7762
+ parts.pop();
7763
+ }
7764
+ }
7765
+ let dd = 0;
7766
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
7767
+ const p2 = parts[dd - 1];
7768
+ if (p2 && p2 !== "." && p2 !== ".." && p2 !== "**") {
7769
+ didSomething = true;
7770
+ const needDot = dd === 1 && parts[dd + 1] === "**";
7771
+ const splin = needDot ? ["."] : [];
7772
+ parts.splice(dd - 1, 2, ...splin);
7773
+ if (parts.length === 0)
7774
+ parts.push("");
7775
+ dd -= 2;
7776
+ }
7777
+ }
7778
+ }
7779
+ } while (didSomething);
7780
+ return globParts;
7781
+ }
7782
+ // second phase: multi-pattern dedupes
7783
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
7784
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
7785
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
7786
+ //
7787
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
7788
+ // ^-- not valid because ** doens't follow symlinks
7789
+ secondPhasePreProcess(globParts) {
7790
+ for (let i2 = 0; i2 < globParts.length - 1; i2++) {
7791
+ for (let j2 = i2 + 1; j2 < globParts.length; j2++) {
7792
+ const matched = this.partsMatch(globParts[i2], globParts[j2], !this.preserveMultipleSlashes);
7793
+ if (matched) {
7794
+ globParts[i2] = [];
7795
+ globParts[j2] = matched;
7796
+ break;
7797
+ }
7798
+ }
7799
+ }
7800
+ return globParts.filter((gs) => gs.length);
7801
+ }
7802
+ partsMatch(a, b2, emptyGSMatch = false) {
7803
+ let ai = 0;
7804
+ let bi = 0;
7805
+ let result = [];
7806
+ let which = "";
7807
+ while (ai < a.length && bi < b2.length) {
7808
+ if (a[ai] === b2[bi]) {
7809
+ result.push(which === "b" ? b2[bi] : a[ai]);
7810
+ ai++;
7811
+ bi++;
7812
+ } else if (emptyGSMatch && a[ai] === "**" && b2[bi] === a[ai + 1]) {
7813
+ result.push(a[ai]);
7814
+ ai++;
7815
+ } else if (emptyGSMatch && b2[bi] === "**" && a[ai] === b2[bi + 1]) {
7816
+ result.push(b2[bi]);
7817
+ bi++;
7818
+ } else if (a[ai] === "*" && b2[bi] && (this.options.dot || !b2[bi].startsWith(".")) && b2[bi] !== "**") {
7819
+ if (which === "b")
7820
+ return false;
7821
+ which = "a";
7822
+ result.push(a[ai]);
7823
+ ai++;
7824
+ bi++;
7825
+ } else if (b2[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
7826
+ if (which === "a")
7827
+ return false;
7828
+ which = "b";
7829
+ result.push(b2[bi]);
7830
+ ai++;
7831
+ bi++;
7832
+ } else {
7833
+ return false;
7834
+ }
7835
+ }
7836
+ return a.length === b2.length && result;
7837
+ }
7838
+ parseNegate() {
7839
+ if (this.nonegate)
7840
+ return;
7841
+ const pattern = this.pattern;
7842
+ let negate = false;
7843
+ let negateOffset = 0;
7844
+ for (let i2 = 0; i2 < pattern.length && pattern.charAt(i2) === "!"; i2++) {
7845
+ negate = !negate;
7846
+ negateOffset++;
7847
+ }
7848
+ if (negateOffset)
7849
+ this.pattern = pattern.slice(negateOffset);
7850
+ this.negate = negate;
7851
+ }
7852
+ // set partial to true to test if, for example,
7853
+ // "/a/b" matches the start of "/*/b/*/d"
7854
+ // Partial means, if you run out of file before you run
7855
+ // out of pattern, then that's fine, as long as all
7856
+ // the parts match.
7857
+ matchOne(file, pattern, partial = false) {
7858
+ let fileStartIndex = 0;
7859
+ let patternStartIndex = 0;
7860
+ if (this.isWindows) {
7861
+ const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
7862
+ const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
7863
+ const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
7864
+ const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
7865
+ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
7866
+ const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
7867
+ if (typeof fdi === "number" && typeof pdi === "number") {
7868
+ const [fd, pd] = [
7869
+ file[fdi],
7870
+ pattern[pdi]
7871
+ ];
7872
+ if (fd.toLowerCase() === pd.toLowerCase()) {
7873
+ pattern[pdi] = fd;
7874
+ patternStartIndex = pdi;
7875
+ fileStartIndex = fdi;
7876
+ }
7877
+ }
7878
+ }
7879
+ const { optimizationLevel = 1 } = this.options;
7880
+ if (optimizationLevel >= 2) {
7881
+ file = this.levelTwoFileOptimize(file);
7882
+ }
7883
+ if (pattern.includes(GLOBSTAR)) {
7884
+ return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
7885
+ }
7886
+ return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
7887
+ }
7888
+ #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
7889
+ const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
7890
+ const lastgs = pattern.lastIndexOf(GLOBSTAR);
7891
+ const [head, body, tail] = partial ? [
7892
+ pattern.slice(patternIndex, firstgs),
7893
+ pattern.slice(firstgs + 1),
7894
+ []
7895
+ ] : [
7896
+ pattern.slice(patternIndex, firstgs),
7897
+ pattern.slice(firstgs + 1, lastgs),
7898
+ pattern.slice(lastgs + 1)
7899
+ ];
7900
+ if (head.length) {
7901
+ const fileHead = file.slice(fileIndex, fileIndex + head.length);
7902
+ if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
7903
+ return false;
7904
+ }
7905
+ fileIndex += head.length;
7906
+ patternIndex += head.length;
7907
+ }
7908
+ let fileTailMatch = 0;
7909
+ if (tail.length) {
7910
+ if (tail.length + fileIndex > file.length)
7911
+ return false;
7912
+ let tailStart = file.length - tail.length;
7913
+ if (this.#matchOne(file, tail, partial, tailStart, 0)) {
7914
+ fileTailMatch = tail.length;
7915
+ } else {
7916
+ if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
7917
+ return false;
7918
+ }
7919
+ tailStart--;
7920
+ if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
7921
+ return false;
7922
+ }
7923
+ fileTailMatch = tail.length + 1;
7924
+ }
7925
+ }
7926
+ if (!body.length) {
7927
+ let sawSome = !!fileTailMatch;
7928
+ for (let i3 = fileIndex; i3 < file.length - fileTailMatch; i3++) {
7929
+ const f = String(file[i3]);
7930
+ sawSome = true;
7931
+ if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
7932
+ return false;
7933
+ }
7934
+ }
7935
+ return partial || sawSome;
7936
+ }
7937
+ const bodySegments = [[[], 0]];
7938
+ let currentBody = bodySegments[0];
7939
+ let nonGsParts = 0;
7940
+ const nonGsPartsSums = [0];
7941
+ for (const b2 of body) {
7942
+ if (b2 === GLOBSTAR) {
7943
+ nonGsPartsSums.push(nonGsParts);
7944
+ currentBody = [[], 0];
7945
+ bodySegments.push(currentBody);
7946
+ } else {
7947
+ currentBody[0].push(b2);
7948
+ nonGsParts++;
7949
+ }
7950
+ }
7951
+ let i2 = bodySegments.length - 1;
7952
+ const fileLength = file.length - fileTailMatch;
7953
+ for (const b2 of bodySegments) {
7954
+ b2[1] = fileLength - (nonGsPartsSums[i2--] + b2[0].length);
7955
+ }
7956
+ return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
7957
+ }
7958
+ // return false for "nope, not matching"
7959
+ // return null for "not matching, cannot keep trying"
7960
+ #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
7961
+ const bs = bodySegments[bodyIndex];
7962
+ if (!bs) {
7963
+ for (let i2 = fileIndex; i2 < file.length; i2++) {
7964
+ sawTail = true;
7965
+ const f = file[i2];
7966
+ if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
7967
+ return false;
7968
+ }
7969
+ }
7970
+ return sawTail;
7971
+ }
7972
+ const [body, after] = bs;
7973
+ while (fileIndex <= after) {
7974
+ const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
7975
+ if (m && globStarDepth < this.maxGlobstarRecursion) {
7976
+ const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
7977
+ if (sub !== false) {
7978
+ return sub;
7979
+ }
7980
+ }
7981
+ const f = file[fileIndex];
7982
+ if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
7983
+ return false;
7984
+ }
7985
+ fileIndex++;
7986
+ }
7987
+ return partial || null;
7988
+ }
7989
+ #matchOne(file, pattern, partial, fileIndex, patternIndex) {
7990
+ let fi;
7991
+ let pi;
7992
+ let pl;
7993
+ let fl;
7994
+ for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
7995
+ this.debug("matchOne loop");
7996
+ let p2 = pattern[pi];
7997
+ let f = file[fi];
7998
+ this.debug(pattern, p2, f);
7999
+ if (p2 === false || p2 === GLOBSTAR) {
8000
+ return false;
8001
+ }
8002
+ let hit;
8003
+ if (typeof p2 === "string") {
8004
+ hit = f === p2;
8005
+ this.debug("string match", p2, f, hit);
8006
+ } else {
8007
+ hit = p2.test(f);
8008
+ this.debug("pattern match", p2, f, hit);
8009
+ }
8010
+ if (!hit)
8011
+ return false;
8012
+ }
8013
+ if (fi === fl && pi === pl) {
8014
+ return true;
8015
+ } else if (fi === fl) {
8016
+ return partial;
8017
+ } else if (pi === pl) {
8018
+ return fi === fl - 1 && file[fi] === "";
8019
+ } else {
8020
+ throw new Error("wtf?");
8021
+ }
8022
+ }
8023
+ braceExpand() {
8024
+ return braceExpand(this.pattern, this.options);
8025
+ }
8026
+ parse(pattern) {
8027
+ assertValidPattern(pattern);
8028
+ const options = this.options;
8029
+ if (pattern === "**")
8030
+ return GLOBSTAR;
8031
+ if (pattern === "")
8032
+ return "";
8033
+ let m;
8034
+ let fastTest = null;
8035
+ if (m = pattern.match(starRE)) {
8036
+ fastTest = options.dot ? starTestDot : starTest;
8037
+ } else if (m = pattern.match(starDotExtRE)) {
8038
+ fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
8039
+ } else if (m = pattern.match(qmarksRE)) {
8040
+ fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
8041
+ } else if (m = pattern.match(starDotStarRE)) {
8042
+ fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
8043
+ } else if (m = pattern.match(dotStarRE)) {
8044
+ fastTest = dotStarTest;
8045
+ }
8046
+ const re = AST.fromGlob(pattern, this.options).toMMPattern();
8047
+ if (fastTest && typeof re === "object") {
8048
+ Reflect.defineProperty(re, "test", { value: fastTest });
8049
+ }
8050
+ return re;
8051
+ }
8052
+ makeRe() {
8053
+ if (this.regexp || this.regexp === false)
8054
+ return this.regexp;
8055
+ const set2 = this.set;
8056
+ if (!set2.length) {
8057
+ this.regexp = false;
8058
+ return this.regexp;
8059
+ }
8060
+ const options = this.options;
8061
+ const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
8062
+ const flags = new Set(options.nocase ? ["i"] : []);
8063
+ let re = set2.map((pattern) => {
8064
+ const pp = pattern.map((p2) => {
8065
+ if (p2 instanceof RegExp) {
8066
+ for (const f of p2.flags.split(""))
8067
+ flags.add(f);
8068
+ }
8069
+ return typeof p2 === "string" ? regExpEscape2(p2) : p2 === GLOBSTAR ? GLOBSTAR : p2._src;
8070
+ });
8071
+ pp.forEach((p2, i2) => {
8072
+ const next = pp[i2 + 1];
8073
+ const prev = pp[i2 - 1];
8074
+ if (p2 !== GLOBSTAR || prev === GLOBSTAR) {
8075
+ return;
8076
+ }
8077
+ if (prev === void 0) {
8078
+ if (next !== void 0 && next !== GLOBSTAR) {
8079
+ pp[i2 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
8080
+ } else {
8081
+ pp[i2] = twoStar;
8082
+ }
8083
+ } else if (next === void 0) {
8084
+ pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
8085
+ } else if (next !== GLOBSTAR) {
8086
+ pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
8087
+ pp[i2 + 1] = GLOBSTAR;
8088
+ }
8089
+ });
8090
+ const filtered = pp.filter((p2) => p2 !== GLOBSTAR);
8091
+ if (this.partial && filtered.length >= 1) {
8092
+ const prefixes = [];
8093
+ for (let i2 = 1; i2 <= filtered.length; i2++) {
8094
+ prefixes.push(filtered.slice(0, i2).join("/"));
8095
+ }
8096
+ return "(?:" + prefixes.join("|") + ")";
8097
+ }
8098
+ return filtered.join("/");
8099
+ }).join("|");
8100
+ const [open, close] = set2.length > 1 ? ["(?:", ")"] : ["", ""];
8101
+ re = "^" + open + re + close + "$";
8102
+ if (this.partial) {
8103
+ re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$";
8104
+ }
8105
+ if (this.negate)
8106
+ re = "^(?!" + re + ").+$";
8107
+ try {
8108
+ this.regexp = new RegExp(re, [...flags].join(""));
8109
+ } catch {
8110
+ this.regexp = false;
8111
+ }
8112
+ return this.regexp;
8113
+ }
8114
+ slashSplit(p2) {
8115
+ if (this.preserveMultipleSlashes) {
8116
+ return p2.split("/");
8117
+ } else if (this.isWindows && /^\/\/[^/]+/.test(p2)) {
8118
+ return ["", ...p2.split(/\/+/)];
8119
+ } else {
8120
+ return p2.split(/\/+/);
8121
+ }
8122
+ }
8123
+ match(f, partial = this.partial) {
8124
+ this.debug("match", f, this.pattern);
8125
+ if (this.comment) {
8126
+ return false;
8127
+ }
8128
+ if (this.empty) {
8129
+ return f === "";
8130
+ }
8131
+ if (f === "/" && partial) {
8132
+ return true;
8133
+ }
8134
+ const options = this.options;
8135
+ if (this.isWindows) {
8136
+ f = f.split("\\").join("/");
8137
+ }
8138
+ const ff = this.slashSplit(f);
8139
+ this.debug(this.pattern, "split", ff);
8140
+ const set2 = this.set;
8141
+ this.debug(this.pattern, "set", set2);
8142
+ let filename = ff[ff.length - 1];
8143
+ if (!filename) {
8144
+ for (let i2 = ff.length - 2; !filename && i2 >= 0; i2--) {
8145
+ filename = ff[i2];
8146
+ }
8147
+ }
8148
+ for (const pattern of set2) {
8149
+ let file = ff;
8150
+ if (options.matchBase && pattern.length === 1) {
8151
+ file = [filename];
8152
+ }
8153
+ const hit = this.matchOne(file, pattern, partial);
8154
+ if (hit) {
8155
+ if (options.flipNegate) {
8156
+ return true;
8157
+ }
8158
+ return !this.negate;
8159
+ }
8160
+ }
8161
+ if (options.flipNegate) {
8162
+ return false;
8163
+ }
8164
+ return this.negate;
8165
+ }
8166
+ static defaults(def) {
8167
+ return minimatch.defaults(def).Minimatch;
8168
+ }
8169
+ };
8170
+ minimatch.AST = AST;
8171
+ minimatch.Minimatch = Minimatch;
8172
+ minimatch.escape = escape;
8173
+ minimatch.unescape = unescape;
8174
+
8175
+ // ../commons/github/lib/expandFernignorePatterns.js
8176
+ function expandFernignorePatterns(fernignoreContent, candidatePaths) {
8177
+ const patterns = fernignoreContent.split("\n").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
8178
+ return candidatePaths.filter((candidate) => patterns.some((pattern) => matches(candidate, pattern)));
8179
+ }
8180
+ function matches(candidate, pattern) {
8181
+ const normalized = pattern.endsWith("/") ? pattern.slice(0, -1) : pattern;
8182
+ if (minimatch(candidate, normalized, { dot: true })) {
8183
+ return true;
8184
+ }
8185
+ return candidate === normalized || candidate.startsWith(normalized + "/");
8186
+ }
8187
+
6368
8188
  // ../commons/github/lib/getGithubApiBaseUrl.js
6369
8189
  function getGithubApiBaseUrl(repositoryUri) {
6370
8190
  const { remote } = parseRepository(repositoryUri);
@@ -9994,8 +11814,8 @@ async function generateReference(params) {
9994
11814
  }
9995
11815
 
9996
11816
  // ../commons/path-utils/lib/convertToOsPath.js
9997
- function convertToOsPath(path3) {
9998
- return path3.replace(/\\/g, "/");
11817
+ function convertToOsPath(path4) {
11818
+ return path4.replace(/\\/g, "/");
9999
11819
  }
10000
11820
 
10001
11821
  // ../commons/fs-utils/lib/cwd.js
@@ -10119,15 +11939,8 @@ var GitHub = class {
10119
11939
  if (fernignore === void 0) {
10120
11940
  return [];
10121
11941
  }
10122
- const fernignoreLines = fernignore.split("\n");
10123
- const fernignoreFiles = [];
10124
- for (const line of fernignoreLines) {
10125
- const trimmedLine = line.trim();
10126
- if (!trimmedLine.startsWith("#") && trimmedLine.length > 0 && await repository.fileExists({ relativeFilePath: trimmedLine })) {
10127
- fernignoreFiles.push(trimmedLine);
10128
- }
10129
- }
10130
- return fernignoreFiles;
11942
+ const tracked = await repository.listTrackedFiles();
11943
+ return expandFernignorePatterns(fernignore, tracked);
10131
11944
  }
10132
11945
  async restoreFiles(repository, files) {
10133
11946
  if (files.length === 0) {