@fern-api/generator-cli 0.6.8 → 0.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +8 -84
- package/dist/cli.js +338 -173
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -8388,7 +8388,8 @@ var BlockList = class {
|
|
|
8388
8388
|
}
|
|
8389
8389
|
addBlock(block) {
|
|
8390
8390
|
if (this.hasBlock(block.id)) {
|
|
8391
|
-
|
|
8391
|
+
console.warn(`[readme] Duplicate block with id "${block.id}" detected; overriding with latest content`);
|
|
8392
|
+
this.blocks = this.blocks.filter((b) => b.id !== block.id);
|
|
8392
8393
|
}
|
|
8393
8394
|
this.ids.add(block.id);
|
|
8394
8395
|
this.blocks.push(block);
|
|
@@ -8402,7 +8403,9 @@ var BlockList = class {
|
|
|
8402
8403
|
// }
|
|
8403
8404
|
insertBlock(block, precedingBlockId) {
|
|
8404
8405
|
if (this.hasBlock(block.id)) {
|
|
8405
|
-
|
|
8406
|
+
console.warn(`[readme] Duplicate block with id "${block.id}" detected; overriding with latest content`);
|
|
8407
|
+
this.blocks = this.blocks.filter((b) => b.id !== block.id);
|
|
8408
|
+
this.ids.delete(block.id);
|
|
8406
8409
|
}
|
|
8407
8410
|
if (precedingBlockId === void 0) {
|
|
8408
8411
|
this.addBlock(block);
|
|
@@ -9938,85 +9941,6 @@ function formatReplayPrBody(result, options) {
|
|
|
9938
9941
|
return parts.join("\n");
|
|
9939
9942
|
}
|
|
9940
9943
|
|
|
9941
|
-
// src/pipeline/github/postConflictComments.ts
|
|
9942
|
-
function resolveGuidance(conflictReason) {
|
|
9943
|
-
switch (conflictReason) {
|
|
9944
|
-
case "same-line-edit":
|
|
9945
|
-
return "You likely want to combine both -- keep your logic while incorporating the generation's structural changes.";
|
|
9946
|
-
case "new-file-both":
|
|
9947
|
-
return "Compare both versions and merge any unique content. If you created the file intentionally, your version is likely correct.";
|
|
9948
|
-
case "base-generation-mismatch":
|
|
9949
|
-
return "Review carefully -- the generated code changed significantly. You may need to re-apply your customization on top of the new structure.";
|
|
9950
|
-
case "patch-apply-failed":
|
|
9951
|
-
return "Your customization could not be applied automatically. Re-apply your changes manually on top of the new generated code.";
|
|
9952
|
-
default:
|
|
9953
|
-
return "Review both sides and keep whichever version (or combination) is correct for your use case.";
|
|
9954
|
-
}
|
|
9955
|
-
}
|
|
9956
|
-
function buildConflictCommentBody(conflictDetails) {
|
|
9957
|
-
const entries2 = [];
|
|
9958
|
-
for (const detail of conflictDetails) {
|
|
9959
|
-
const description = patchDescription(detail);
|
|
9960
|
-
for (const file of detail.files) {
|
|
9961
|
-
if (file.status === "conflict") {
|
|
9962
|
-
entries2.push({
|
|
9963
|
-
file: file.file,
|
|
9964
|
-
customization: description,
|
|
9965
|
-
reason: formatConflictReason(file.conflictReason),
|
|
9966
|
-
guidance: resolveGuidance(file.conflictReason)
|
|
9967
|
-
});
|
|
9968
|
-
}
|
|
9969
|
-
}
|
|
9970
|
-
}
|
|
9971
|
-
if (entries2.length === 0) {
|
|
9972
|
-
return void 0;
|
|
9973
|
-
}
|
|
9974
|
-
const parts = [];
|
|
9975
|
-
parts.push("## Conflict Resolution Guide\n");
|
|
9976
|
-
parts.push(
|
|
9977
|
-
`This PR has **${entries2.length} file${entries2.length === 1 ? "" : "s"}** where your customizations conflict with the new SDK generation. Below is per-file guidance to help you resolve each conflict.
|
|
9978
|
-
`
|
|
9979
|
-
);
|
|
9980
|
-
parts.push(
|
|
9981
|
-
'> In GitHub\'s conflict editor, `<<<<<<< HEAD` ("Accept current") = **new generated code**, `>>>>>>> main` ("Accept incoming") = **your customization**.\n'
|
|
9982
|
-
);
|
|
9983
|
-
parts.push("| File | Your customization | Why it conflicted | Suggested resolution |");
|
|
9984
|
-
parts.push("|------|-------------------|-------------------|---------------------|");
|
|
9985
|
-
for (const entry of entries2) {
|
|
9986
|
-
parts.push(`| \`${entry.file}\` | ${entry.customization} | ${entry.reason} | ${entry.guidance} |`);
|
|
9987
|
-
}
|
|
9988
|
-
parts.push("\n---");
|
|
9989
|
-
parts.push("*Posted by Fern Replay to help resolve SDK customization conflicts.*");
|
|
9990
|
-
return parts.join("\n");
|
|
9991
|
-
}
|
|
9992
|
-
async function postConflictComments(octokit, owner, repo, prNumber, replayResult, logger) {
|
|
9993
|
-
if (replayResult == null) {
|
|
9994
|
-
return;
|
|
9995
|
-
}
|
|
9996
|
-
const conflictDetails = replayResult.conflictDetails;
|
|
9997
|
-
if (conflictDetails == null || conflictDetails.length === 0) {
|
|
9998
|
-
return;
|
|
9999
|
-
}
|
|
10000
|
-
const body = buildConflictCommentBody(conflictDetails);
|
|
10001
|
-
if (body == null) {
|
|
10002
|
-
logger.debug("No conflict files to comment on -- skipping conflict comment");
|
|
10003
|
-
return;
|
|
10004
|
-
}
|
|
10005
|
-
try {
|
|
10006
|
-
await octokit.issues.createComment({
|
|
10007
|
-
owner,
|
|
10008
|
-
repo,
|
|
10009
|
-
issue_number: prNumber,
|
|
10010
|
-
body
|
|
10011
|
-
});
|
|
10012
|
-
logger.debug(`Posted conflict resolution guide comment on PR #${prNumber}`);
|
|
10013
|
-
} catch (error) {
|
|
10014
|
-
logger.debug(
|
|
10015
|
-
`Could not post conflict comment on PR #${prNumber}: ${error instanceof Error ? error.message : String(error)}`
|
|
10016
|
-
);
|
|
10017
|
-
}
|
|
10018
|
-
}
|
|
10019
|
-
|
|
10020
9944
|
// src/pipeline/steps/BaseStep.ts
|
|
10021
9945
|
var BaseStep = class {
|
|
10022
9946
|
constructor(outputDir, logger) {
|
|
@@ -10202,9 +10126,6 @@ var GithubStep = class extends BaseStep {
|
|
|
10202
10126
|
}
|
|
10203
10127
|
}
|
|
10204
10128
|
}
|
|
10205
|
-
if (!this.config.previewMode && replayConflictInfo?.hasConflicts === true && result.prNumber != null) {
|
|
10206
|
-
await postConflictComments(octokit, owner, repo, result.prNumber, replayResult, this.logger);
|
|
10207
|
-
}
|
|
10208
10129
|
if (!this.config.previewMode && result.prNumber != null && replayConflictInfo?.hasConflicts === true && replayResult != null) {
|
|
10209
10130
|
await this.postWebEditorFallbackComment(
|
|
10210
10131
|
octokit,
|
|
@@ -10820,7 +10741,10 @@ Base generation: ${bootstrapResult.generationCommit.sha.slice(0, 7)}`;
|
|
|
10820
10741
|
`user.name=${import_replay2.FERN_BOT_NAME}`,
|
|
10821
10742
|
"-c",
|
|
10822
10743
|
`user.email=${import_replay2.FERN_BOT_EMAIL}`,
|
|
10744
|
+
"-c",
|
|
10745
|
+
"commit.gpgsign=false",
|
|
10823
10746
|
"commit",
|
|
10747
|
+
"--no-verify",
|
|
10824
10748
|
"-m",
|
|
10825
10749
|
commitMessage
|
|
10826
10750
|
]);
|
package/dist/cli.js
CHANGED
|
@@ -258,10 +258,10 @@ var init_esm2 = __esm({
|
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
|
|
261
|
-
// ../../node_modules/.pnpm/minimatch@10.2.
|
|
261
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
262
262
|
var MAX_PATTERN_LENGTH, assertValidPattern;
|
|
263
263
|
var init_assert_valid_pattern = __esm({
|
|
264
|
-
"../../node_modules/.pnpm/minimatch@10.2.
|
|
264
|
+
"../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/assert-valid-pattern.js"() {
|
|
265
265
|
"use strict";
|
|
266
266
|
MAX_PATTERN_LENGTH = 1024 * 64;
|
|
267
267
|
assertValidPattern = (pattern) => {
|
|
@@ -275,10 +275,10 @@ var init_assert_valid_pattern = __esm({
|
|
|
275
275
|
}
|
|
276
276
|
});
|
|
277
277
|
|
|
278
|
-
// ../../node_modules/.pnpm/minimatch@10.2.
|
|
278
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/brace-expressions.js
|
|
279
279
|
var posixClasses, braceEscape, regexpEscape, rangesToString, parseClass;
|
|
280
280
|
var init_brace_expressions = __esm({
|
|
281
|
-
"../../node_modules/.pnpm/minimatch@10.2.
|
|
281
|
+
"../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/brace-expressions.js"() {
|
|
282
282
|
"use strict";
|
|
283
283
|
posixClasses = {
|
|
284
284
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
@@ -390,10 +390,10 @@ var init_brace_expressions = __esm({
|
|
|
390
390
|
}
|
|
391
391
|
});
|
|
392
392
|
|
|
393
|
-
// ../../node_modules/.pnpm/minimatch@10.2.
|
|
393
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/unescape.js
|
|
394
394
|
var unescape;
|
|
395
395
|
var init_unescape = __esm({
|
|
396
|
-
"../../node_modules/.pnpm/minimatch@10.2.
|
|
396
|
+
"../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/unescape.js"() {
|
|
397
397
|
"use strict";
|
|
398
398
|
unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
|
|
399
399
|
if (magicalBraces) {
|
|
@@ -404,15 +404,62 @@ var init_unescape = __esm({
|
|
|
404
404
|
}
|
|
405
405
|
});
|
|
406
406
|
|
|
407
|
-
// ../../node_modules/.pnpm/minimatch@10.2.
|
|
408
|
-
var types, isExtglobType, startNoTraversal, startNoDot, addPatternStart, justDots, reSpecials, regExpEscape, qmark, star, starNoEmpty, AST;
|
|
407
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/ast.js
|
|
408
|
+
var _a, types, isExtglobType, isExtglobAST, adoptionMap, adoptionWithSpaceMap, adoptionAnyMap, usurpMap, startNoTraversal, startNoDot, addPatternStart, justDots, reSpecials, regExpEscape, qmark, star, starNoEmpty, ID, AST;
|
|
409
409
|
var init_ast = __esm({
|
|
410
|
-
"../../node_modules/.pnpm/minimatch@10.2.
|
|
410
|
+
"../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/ast.js"() {
|
|
411
411
|
"use strict";
|
|
412
412
|
init_brace_expressions();
|
|
413
413
|
init_unescape();
|
|
414
414
|
types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
415
415
|
isExtglobType = (c) => types.has(c);
|
|
416
|
+
isExtglobAST = (c) => isExtglobType(c.type);
|
|
417
|
+
adoptionMap = /* @__PURE__ */ new Map([
|
|
418
|
+
["!", ["@"]],
|
|
419
|
+
["?", ["?", "@"]],
|
|
420
|
+
["@", ["@"]],
|
|
421
|
+
["*", ["*", "+", "?", "@"]],
|
|
422
|
+
["+", ["+", "@"]]
|
|
423
|
+
]);
|
|
424
|
+
adoptionWithSpaceMap = /* @__PURE__ */ new Map([
|
|
425
|
+
["!", ["?"]],
|
|
426
|
+
["@", ["?"]],
|
|
427
|
+
["+", ["?", "*"]]
|
|
428
|
+
]);
|
|
429
|
+
adoptionAnyMap = /* @__PURE__ */ new Map([
|
|
430
|
+
["!", ["?", "@"]],
|
|
431
|
+
["?", ["?", "@"]],
|
|
432
|
+
["@", ["?", "@"]],
|
|
433
|
+
["*", ["*", "+", "?", "@"]],
|
|
434
|
+
["+", ["+", "@", "?", "*"]]
|
|
435
|
+
]);
|
|
436
|
+
usurpMap = /* @__PURE__ */ new Map([
|
|
437
|
+
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
|
438
|
+
[
|
|
439
|
+
"?",
|
|
440
|
+
/* @__PURE__ */ new Map([
|
|
441
|
+
["*", "*"],
|
|
442
|
+
["+", "*"]
|
|
443
|
+
])
|
|
444
|
+
],
|
|
445
|
+
[
|
|
446
|
+
"@",
|
|
447
|
+
/* @__PURE__ */ new Map([
|
|
448
|
+
["!", "!"],
|
|
449
|
+
["?", "?"],
|
|
450
|
+
["@", "@"],
|
|
451
|
+
["*", "*"],
|
|
452
|
+
["+", "+"]
|
|
453
|
+
])
|
|
454
|
+
],
|
|
455
|
+
[
|
|
456
|
+
"+",
|
|
457
|
+
/* @__PURE__ */ new Map([
|
|
458
|
+
["?", "*"],
|
|
459
|
+
["*", "*"]
|
|
460
|
+
])
|
|
461
|
+
]
|
|
462
|
+
]);
|
|
416
463
|
startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
417
464
|
startNoDot = "(?!\\.)";
|
|
418
465
|
addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
@@ -422,7 +469,8 @@ var init_ast = __esm({
|
|
|
422
469
|
qmark = "[^/]";
|
|
423
470
|
star = qmark + "*?";
|
|
424
471
|
starNoEmpty = qmark + "+?";
|
|
425
|
-
|
|
472
|
+
ID = 0;
|
|
473
|
+
AST = class {
|
|
426
474
|
type;
|
|
427
475
|
#root;
|
|
428
476
|
#hasMagic;
|
|
@@ -437,6 +485,22 @@ var init_ast = __esm({
|
|
|
437
485
|
// set to true if it's an extglob with no children
|
|
438
486
|
// (which really means one child of '')
|
|
439
487
|
#emptyExt = false;
|
|
488
|
+
id = ++ID;
|
|
489
|
+
get depth() {
|
|
490
|
+
return (this.#parent?.depth ?? -1) + 1;
|
|
491
|
+
}
|
|
492
|
+
[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() {
|
|
493
|
+
return {
|
|
494
|
+
"@@type": "AST",
|
|
495
|
+
id: this.id,
|
|
496
|
+
type: this.type,
|
|
497
|
+
root: this.#root.id,
|
|
498
|
+
parent: this.#parent?.id,
|
|
499
|
+
depth: this.depth,
|
|
500
|
+
partsLength: this.#parts.length,
|
|
501
|
+
parts: this.#parts
|
|
502
|
+
};
|
|
503
|
+
}
|
|
440
504
|
constructor(type, parent, options = {}) {
|
|
441
505
|
this.type = type;
|
|
442
506
|
if (type)
|
|
@@ -502,7 +566,7 @@ var init_ast = __esm({
|
|
|
502
566
|
for (const p of parts) {
|
|
503
567
|
if (p === "")
|
|
504
568
|
continue;
|
|
505
|
-
if (typeof p !== "string" && !(p instanceof
|
|
569
|
+
if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
|
|
506
570
|
throw new Error("invalid part: " + p);
|
|
507
571
|
}
|
|
508
572
|
this.#parts.push(p);
|
|
@@ -527,7 +591,7 @@ var init_ast = __esm({
|
|
|
527
591
|
const p = this.#parent;
|
|
528
592
|
for (let i = 0; i < this.#parentIndex; i++) {
|
|
529
593
|
const pp = p.#parts[i];
|
|
530
|
-
if (!(pp instanceof
|
|
594
|
+
if (!(pp instanceof _a && pp.type === "!")) {
|
|
531
595
|
return false;
|
|
532
596
|
}
|
|
533
597
|
}
|
|
@@ -552,13 +616,14 @@ var init_ast = __esm({
|
|
|
552
616
|
this.push(part.clone(this));
|
|
553
617
|
}
|
|
554
618
|
clone(parent) {
|
|
555
|
-
const c = new
|
|
619
|
+
const c = new _a(this.type, parent);
|
|
556
620
|
for (const p of this.#parts) {
|
|
557
621
|
c.copyIn(p);
|
|
558
622
|
}
|
|
559
623
|
return c;
|
|
560
624
|
}
|
|
561
|
-
static #parseAST(str, ast, pos, opt) {
|
|
625
|
+
static #parseAST(str, ast, pos, opt, extDepth) {
|
|
626
|
+
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
|
562
627
|
let escaping = false;
|
|
563
628
|
let inBrace = false;
|
|
564
629
|
let braceStart = -1;
|
|
@@ -590,11 +655,12 @@ var init_ast = __esm({
|
|
|
590
655
|
acc2 += c;
|
|
591
656
|
continue;
|
|
592
657
|
}
|
|
593
|
-
|
|
658
|
+
const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth;
|
|
659
|
+
if (doRecurse) {
|
|
594
660
|
ast.push(acc2);
|
|
595
661
|
acc2 = "";
|
|
596
|
-
const ext2 = new
|
|
597
|
-
i2 =
|
|
662
|
+
const ext2 = new _a(c, ast);
|
|
663
|
+
i2 = _a.#parseAST(str, ext2, i2, opt, extDepth + 1);
|
|
598
664
|
ast.push(ext2);
|
|
599
665
|
continue;
|
|
600
666
|
}
|
|
@@ -604,7 +670,7 @@ var init_ast = __esm({
|
|
|
604
670
|
return i2;
|
|
605
671
|
}
|
|
606
672
|
let i = pos + 1;
|
|
607
|
-
let part = new
|
|
673
|
+
let part = new _a(null, ast);
|
|
608
674
|
const parts = [];
|
|
609
675
|
let acc = "";
|
|
610
676
|
while (i < str.length) {
|
|
@@ -631,19 +697,22 @@ var init_ast = __esm({
|
|
|
631
697
|
acc += c;
|
|
632
698
|
continue;
|
|
633
699
|
}
|
|
634
|
-
|
|
700
|
+
const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
|
|
701
|
+
(extDepth <= maxDepth || ast && ast.#canAdoptType(c));
|
|
702
|
+
if (doRecurse) {
|
|
703
|
+
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
|
635
704
|
part.push(acc);
|
|
636
705
|
acc = "";
|
|
637
|
-
const ext2 = new
|
|
706
|
+
const ext2 = new _a(c, part);
|
|
638
707
|
part.push(ext2);
|
|
639
|
-
i =
|
|
708
|
+
i = _a.#parseAST(str, ext2, i, opt, extDepth + depthAdd);
|
|
640
709
|
continue;
|
|
641
710
|
}
|
|
642
711
|
if (c === "|") {
|
|
643
712
|
part.push(acc);
|
|
644
713
|
acc = "";
|
|
645
714
|
parts.push(part);
|
|
646
|
-
part = new
|
|
715
|
+
part = new _a(null, ast);
|
|
647
716
|
continue;
|
|
648
717
|
}
|
|
649
718
|
if (c === ")") {
|
|
@@ -662,9 +731,71 @@ var init_ast = __esm({
|
|
|
662
731
|
ast.#parts = [str.substring(pos - 1)];
|
|
663
732
|
return i;
|
|
664
733
|
}
|
|
734
|
+
#canAdoptWithSpace(child) {
|
|
735
|
+
return this.#canAdopt(child, adoptionWithSpaceMap);
|
|
736
|
+
}
|
|
737
|
+
#canAdopt(child, map = adoptionMap) {
|
|
738
|
+
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
|
|
739
|
+
return false;
|
|
740
|
+
}
|
|
741
|
+
const gc = child.#parts[0];
|
|
742
|
+
if (!gc || typeof gc !== "object" || gc.type === null) {
|
|
743
|
+
return false;
|
|
744
|
+
}
|
|
745
|
+
return this.#canAdoptType(gc.type, map);
|
|
746
|
+
}
|
|
747
|
+
#canAdoptType(c, map = adoptionAnyMap) {
|
|
748
|
+
return !!map.get(this.type)?.includes(c);
|
|
749
|
+
}
|
|
750
|
+
#adoptWithSpace(child, index) {
|
|
751
|
+
const gc = child.#parts[0];
|
|
752
|
+
const blank = new _a(null, gc, this.options);
|
|
753
|
+
blank.#parts.push("");
|
|
754
|
+
gc.push(blank);
|
|
755
|
+
this.#adopt(child, index);
|
|
756
|
+
}
|
|
757
|
+
#adopt(child, index) {
|
|
758
|
+
const gc = child.#parts[0];
|
|
759
|
+
this.#parts.splice(index, 1, ...gc.#parts);
|
|
760
|
+
for (const p of gc.#parts) {
|
|
761
|
+
if (typeof p === "object")
|
|
762
|
+
p.#parent = this;
|
|
763
|
+
}
|
|
764
|
+
this.#toString = void 0;
|
|
765
|
+
}
|
|
766
|
+
#canUsurpType(c) {
|
|
767
|
+
const m = usurpMap.get(this.type);
|
|
768
|
+
return !!m?.has(c);
|
|
769
|
+
}
|
|
770
|
+
#canUsurp(child) {
|
|
771
|
+
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
|
|
772
|
+
return false;
|
|
773
|
+
}
|
|
774
|
+
const gc = child.#parts[0];
|
|
775
|
+
if (!gc || typeof gc !== "object" || gc.type === null) {
|
|
776
|
+
return false;
|
|
777
|
+
}
|
|
778
|
+
return this.#canUsurpType(gc.type);
|
|
779
|
+
}
|
|
780
|
+
#usurp(child) {
|
|
781
|
+
const m = usurpMap.get(this.type);
|
|
782
|
+
const gc = child.#parts[0];
|
|
783
|
+
const nt = m?.get(gc.type);
|
|
784
|
+
if (!nt)
|
|
785
|
+
return false;
|
|
786
|
+
this.#parts = gc.#parts;
|
|
787
|
+
for (const p of this.#parts) {
|
|
788
|
+
if (typeof p === "object") {
|
|
789
|
+
p.#parent = this;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
this.type = nt;
|
|
793
|
+
this.#toString = void 0;
|
|
794
|
+
this.#emptyExt = false;
|
|
795
|
+
}
|
|
665
796
|
static fromGlob(pattern, options = {}) {
|
|
666
|
-
const ast = new
|
|
667
|
-
|
|
797
|
+
const ast = new _a(null, void 0, options);
|
|
798
|
+
_a.#parseAST(pattern, ast, 0, options, 0);
|
|
668
799
|
return ast;
|
|
669
800
|
}
|
|
670
801
|
// returns the regular expression if there's magic, or the unescaped
|
|
@@ -758,12 +889,14 @@ var init_ast = __esm({
|
|
|
758
889
|
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
759
890
|
toRegExpSource(allowDot) {
|
|
760
891
|
const dot = allowDot ?? !!this.#options.dot;
|
|
761
|
-
if (this.#root === this)
|
|
892
|
+
if (this.#root === this) {
|
|
893
|
+
this.#flatten();
|
|
762
894
|
this.#fillNegs();
|
|
763
|
-
|
|
895
|
+
}
|
|
896
|
+
if (!isExtglobAST(this)) {
|
|
764
897
|
const noEmpty = this.isStart() && this.isEnd() && !this.#parts.some((s) => typeof s !== "string");
|
|
765
898
|
const src = this.#parts.map((p) => {
|
|
766
|
-
const [re, _, hasMagic, uflag] = typeof p === "string" ?
|
|
899
|
+
const [re, _, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
|
767
900
|
this.#hasMagic = this.#hasMagic || hasMagic;
|
|
768
901
|
this.#uflag = this.#uflag || uflag;
|
|
769
902
|
return re;
|
|
@@ -802,9 +935,10 @@ var init_ast = __esm({
|
|
|
802
935
|
let body = this.#partsToRegExp(dot);
|
|
803
936
|
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
804
937
|
const s = this.toString();
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
938
|
+
const me = this;
|
|
939
|
+
me.#parts = [s];
|
|
940
|
+
me.type = null;
|
|
941
|
+
me.#hasMagic = void 0;
|
|
808
942
|
return [s, unescape(this.toString()), false, false];
|
|
809
943
|
}
|
|
810
944
|
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
|
|
@@ -831,6 +965,38 @@ var init_ast = __esm({
|
|
|
831
965
|
this.#uflag
|
|
832
966
|
];
|
|
833
967
|
}
|
|
968
|
+
#flatten() {
|
|
969
|
+
if (!isExtglobAST(this)) {
|
|
970
|
+
for (const p of this.#parts) {
|
|
971
|
+
if (typeof p === "object") {
|
|
972
|
+
p.#flatten();
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
} else {
|
|
976
|
+
let iterations = 0;
|
|
977
|
+
let done = false;
|
|
978
|
+
do {
|
|
979
|
+
done = true;
|
|
980
|
+
for (let i = 0; i < this.#parts.length; i++) {
|
|
981
|
+
const c = this.#parts[i];
|
|
982
|
+
if (typeof c === "object") {
|
|
983
|
+
c.#flatten();
|
|
984
|
+
if (this.#canAdopt(c)) {
|
|
985
|
+
done = false;
|
|
986
|
+
this.#adopt(c, i);
|
|
987
|
+
} else if (this.#canAdoptWithSpace(c)) {
|
|
988
|
+
done = false;
|
|
989
|
+
this.#adoptWithSpace(c, i);
|
|
990
|
+
} else if (this.#canUsurp(c)) {
|
|
991
|
+
done = false;
|
|
992
|
+
this.#usurp(c);
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
} while (!done && ++iterations < 10);
|
|
997
|
+
}
|
|
998
|
+
this.#toString = void 0;
|
|
999
|
+
}
|
|
834
1000
|
#partsToRegExp(dot) {
|
|
835
1001
|
return this.#parts.map((p) => {
|
|
836
1002
|
if (typeof p === "string") {
|
|
@@ -891,13 +1057,14 @@ var init_ast = __esm({
|
|
|
891
1057
|
return [re, unescape(glob), !!hasMagic, uflag];
|
|
892
1058
|
}
|
|
893
1059
|
};
|
|
1060
|
+
_a = AST;
|
|
894
1061
|
}
|
|
895
1062
|
});
|
|
896
1063
|
|
|
897
|
-
// ../../node_modules/.pnpm/minimatch@10.2.
|
|
1064
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/escape.js
|
|
898
1065
|
var escape;
|
|
899
1066
|
var init_escape = __esm({
|
|
900
|
-
"../../node_modules/.pnpm/minimatch@10.2.
|
|
1067
|
+
"../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/escape.js"() {
|
|
901
1068
|
"use strict";
|
|
902
1069
|
escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
|
|
903
1070
|
if (magicalBraces) {
|
|
@@ -908,10 +1075,10 @@ var init_escape = __esm({
|
|
|
908
1075
|
}
|
|
909
1076
|
});
|
|
910
1077
|
|
|
911
|
-
// ../../node_modules/.pnpm/minimatch@10.2.
|
|
1078
|
+
// ../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/index.js
|
|
912
1079
|
var minimatch, starDotExtRE, starDotExtTest, starDotExtTestDot, starDotExtTestNocase, starDotExtTestNocaseDot, starDotStarRE, starDotStarTest, starDotStarTestDot, dotStarRE, dotStarTest, starRE, starTest, starTestDot, qmarksRE, qmarksTestNocase, qmarksTestNocaseDot, qmarksTestDot, qmarksTest, qmarksTestNoExt, qmarksTestNoExtDot, defaultPlatform, path, sep, GLOBSTAR, qmark2, star2, twoStarDot, twoStarNoDot, filter, ext, defaults, braceExpand, makeRe, match, globMagic, regExpEscape2, Minimatch;
|
|
913
1080
|
var init_esm3 = __esm({
|
|
914
|
-
"../../node_modules/.pnpm/minimatch@10.2.
|
|
1081
|
+
"../../node_modules/.pnpm/minimatch@10.2.4/node_modules/minimatch/dist/esm/index.js"() {
|
|
915
1082
|
"use strict";
|
|
916
1083
|
init_esm2();
|
|
917
1084
|
init_assert_valid_pattern();
|
|
@@ -1069,11 +1236,13 @@ var init_esm3 = __esm({
|
|
|
1069
1236
|
isWindows;
|
|
1070
1237
|
platform;
|
|
1071
1238
|
windowsNoMagicRoot;
|
|
1239
|
+
maxGlobstarRecursion;
|
|
1072
1240
|
regexp;
|
|
1073
1241
|
constructor(pattern, options = {}) {
|
|
1074
1242
|
assertValidPattern(pattern);
|
|
1075
1243
|
options = options || {};
|
|
1076
1244
|
this.options = options;
|
|
1245
|
+
this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
|
|
1077
1246
|
this.pattern = pattern;
|
|
1078
1247
|
this.platform = options.platform || defaultPlatform;
|
|
1079
1248
|
this.isWindows = this.platform === "win32";
|
|
@@ -1410,7 +1579,8 @@ var init_esm3 = __esm({
|
|
|
1410
1579
|
// out of pattern, then that's fine, as long as all
|
|
1411
1580
|
// the parts match.
|
|
1412
1581
|
matchOne(file, pattern, partial = false) {
|
|
1413
|
-
|
|
1582
|
+
let fileStartIndex = 0;
|
|
1583
|
+
let patternStartIndex = 0;
|
|
1414
1584
|
if (this.isWindows) {
|
|
1415
1585
|
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
|
1416
1586
|
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
|
@@ -1425,11 +1595,8 @@ var init_esm3 = __esm({
|
|
|
1425
1595
|
];
|
|
1426
1596
|
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
1427
1597
|
pattern[pdi] = fd;
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
} else if (fdi > pdi) {
|
|
1431
|
-
file = file.slice(fdi);
|
|
1432
|
-
}
|
|
1598
|
+
patternStartIndex = pdi;
|
|
1599
|
+
fileStartIndex = fdi;
|
|
1433
1600
|
}
|
|
1434
1601
|
}
|
|
1435
1602
|
}
|
|
@@ -1437,49 +1604,123 @@ var init_esm3 = __esm({
|
|
|
1437
1604
|
if (optimizationLevel >= 2) {
|
|
1438
1605
|
file = this.levelTwoFileOptimize(file);
|
|
1439
1606
|
}
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1607
|
+
if (pattern.includes(GLOBSTAR)) {
|
|
1608
|
+
return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
|
|
1609
|
+
}
|
|
1610
|
+
return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
|
|
1611
|
+
}
|
|
1612
|
+
#matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
|
1613
|
+
const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
|
|
1614
|
+
const lastgs = pattern.lastIndexOf(GLOBSTAR);
|
|
1615
|
+
const [head, body, tail] = partial ? [
|
|
1616
|
+
pattern.slice(patternIndex, firstgs),
|
|
1617
|
+
pattern.slice(firstgs + 1),
|
|
1618
|
+
[]
|
|
1619
|
+
] : [
|
|
1620
|
+
pattern.slice(patternIndex, firstgs),
|
|
1621
|
+
pattern.slice(firstgs + 1, lastgs),
|
|
1622
|
+
pattern.slice(lastgs + 1)
|
|
1623
|
+
];
|
|
1624
|
+
if (head.length) {
|
|
1625
|
+
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
|
1626
|
+
if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
|
|
1448
1627
|
return false;
|
|
1449
1628
|
}
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1629
|
+
fileIndex += head.length;
|
|
1630
|
+
patternIndex += head.length;
|
|
1631
|
+
}
|
|
1632
|
+
let fileTailMatch = 0;
|
|
1633
|
+
if (tail.length) {
|
|
1634
|
+
if (tail.length + fileIndex > file.length)
|
|
1635
|
+
return false;
|
|
1636
|
+
let tailStart = file.length - tail.length;
|
|
1637
|
+
if (this.#matchOne(file, tail, partial, tailStart, 0)) {
|
|
1638
|
+
fileTailMatch = tail.length;
|
|
1639
|
+
} else {
|
|
1640
|
+
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
|
1641
|
+
return false;
|
|
1461
1642
|
}
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
1466
|
-
this.debug("globstar found match!", fr, fl, swallowee);
|
|
1467
|
-
return true;
|
|
1468
|
-
} else {
|
|
1469
|
-
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
|
1470
|
-
this.debug("dot detected!", file, fr, pattern, pr);
|
|
1471
|
-
break;
|
|
1472
|
-
}
|
|
1473
|
-
this.debug("globstar swallow a segment, and continue");
|
|
1474
|
-
fr++;
|
|
1475
|
-
}
|
|
1643
|
+
tailStart--;
|
|
1644
|
+
if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
|
|
1645
|
+
return false;
|
|
1476
1646
|
}
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1647
|
+
fileTailMatch = tail.length + 1;
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
if (!body.length) {
|
|
1651
|
+
let sawSome = !!fileTailMatch;
|
|
1652
|
+
for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
|
|
1653
|
+
const f = String(file[i2]);
|
|
1654
|
+
sawSome = true;
|
|
1655
|
+
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
|
1656
|
+
return false;
|
|
1482
1657
|
}
|
|
1658
|
+
}
|
|
1659
|
+
return partial || sawSome;
|
|
1660
|
+
}
|
|
1661
|
+
const bodySegments = [[[], 0]];
|
|
1662
|
+
let currentBody = bodySegments[0];
|
|
1663
|
+
let nonGsParts = 0;
|
|
1664
|
+
const nonGsPartsSums = [0];
|
|
1665
|
+
for (const b of body) {
|
|
1666
|
+
if (b === GLOBSTAR) {
|
|
1667
|
+
nonGsPartsSums.push(nonGsParts);
|
|
1668
|
+
currentBody = [[], 0];
|
|
1669
|
+
bodySegments.push(currentBody);
|
|
1670
|
+
} else {
|
|
1671
|
+
currentBody[0].push(b);
|
|
1672
|
+
nonGsParts++;
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
let i = bodySegments.length - 1;
|
|
1676
|
+
const fileLength = file.length - fileTailMatch;
|
|
1677
|
+
for (const b of bodySegments) {
|
|
1678
|
+
b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
|
|
1679
|
+
}
|
|
1680
|
+
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
|
|
1681
|
+
}
|
|
1682
|
+
// return false for "nope, not matching"
|
|
1683
|
+
// return null for "not matching, cannot keep trying"
|
|
1684
|
+
#matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
|
1685
|
+
const bs = bodySegments[bodyIndex];
|
|
1686
|
+
if (!bs) {
|
|
1687
|
+
for (let i = fileIndex; i < file.length; i++) {
|
|
1688
|
+
sawTail = true;
|
|
1689
|
+
const f = file[i];
|
|
1690
|
+
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
|
1691
|
+
return false;
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
return sawTail;
|
|
1695
|
+
}
|
|
1696
|
+
const [body, after] = bs;
|
|
1697
|
+
while (fileIndex <= after) {
|
|
1698
|
+
const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
|
|
1699
|
+
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
|
1700
|
+
const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
|
|
1701
|
+
if (sub !== false) {
|
|
1702
|
+
return sub;
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
const f = file[fileIndex];
|
|
1706
|
+
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
|
1707
|
+
return false;
|
|
1708
|
+
}
|
|
1709
|
+
fileIndex++;
|
|
1710
|
+
}
|
|
1711
|
+
return partial || null;
|
|
1712
|
+
}
|
|
1713
|
+
#matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
|
1714
|
+
let fi;
|
|
1715
|
+
let pi;
|
|
1716
|
+
let pl;
|
|
1717
|
+
let fl;
|
|
1718
|
+
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
1719
|
+
this.debug("matchOne loop");
|
|
1720
|
+
let p = pattern[pi];
|
|
1721
|
+
let f = file[fi];
|
|
1722
|
+
this.debug(pattern, p, f);
|
|
1723
|
+
if (p === false || p === GLOBSTAR) {
|
|
1483
1724
|
return false;
|
|
1484
1725
|
}
|
|
1485
1726
|
let hit;
|
|
@@ -3181,11 +3422,11 @@ var require_build2 = __commonJS({
|
|
|
3181
3422
|
function stripQuotes2(val) {
|
|
3182
3423
|
return typeof val === "string" && (val[0] === "'" || val[0] === '"') && val[val.length - 1] === val[0] ? val.substring(1, val.length - 1) : val;
|
|
3183
3424
|
}
|
|
3184
|
-
var
|
|
3425
|
+
var _a4;
|
|
3185
3426
|
var _b2;
|
|
3186
3427
|
var _c2;
|
|
3187
3428
|
var minNodeVersion2 = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12;
|
|
3188
|
-
var nodeVersion2 = (_b2 = (
|
|
3429
|
+
var nodeVersion2 = (_b2 = (_a4 = process === null || process === void 0 ? void 0 : process.versions) === null || _a4 === void 0 ? void 0 : _a4.node) !== null && _b2 !== void 0 ? _b2 : (_c2 = process === null || process === void 0 ? void 0 : process.version) === null || _c2 === void 0 ? void 0 : _c2.slice(1);
|
|
3189
3430
|
if (nodeVersion2) {
|
|
3190
3431
|
const major = Number(nodeVersion2.match(/^([^.]+)/)[1]);
|
|
3191
3432
|
if (major < minNodeVersion2) {
|
|
@@ -4605,9 +4846,9 @@ var require_build3 = __commonJS({
|
|
|
4605
4846
|
var left2 = 3;
|
|
4606
4847
|
var UI2 = class {
|
|
4607
4848
|
constructor(opts) {
|
|
4608
|
-
var
|
|
4849
|
+
var _a4;
|
|
4609
4850
|
this.width = opts.width;
|
|
4610
|
-
this.wrap = (
|
|
4851
|
+
this.wrap = (_a4 = opts.wrap) !== null && _a4 !== void 0 ? _a4 : true;
|
|
4611
4852
|
this.rows = [];
|
|
4612
4853
|
}
|
|
4613
4854
|
span(...args) {
|
|
@@ -9292,7 +9533,7 @@ function gitInstanceFactory(baseDir, options) {
|
|
|
9292
9533
|
customBinaryPlugin(plugins, config.binary, config.unsafe?.allowUnsafeCustomBinary);
|
|
9293
9534
|
return new Git(config, plugins);
|
|
9294
9535
|
}
|
|
9295
|
-
var import_node_buffer, import_file_exists, import_debug, import_child_process, import_promise_deferred, import_node_path, import_promise_deferred2, import_node_events, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __esm2, __commonJS2, __export2, __copyProps2, __toCommonJS, cache, init_pathspec, GitError, init_git_error, GitResponseError, init_git_response_error, TaskConfigurationError, init_task_configuration_error, NULL, NOOP, objectToString, init_util, filterArray, filterNumber, filterString, filterStringOrStringArray, filterHasLength, init_argument_filters, ExitCodes, init_exit_codes, GitOutputStreams, init_git_output_streams, LineParser, RemoteLineParser, init_line_parser, defaultOptions, init_simple_git_options, init_task_options, init_task_parser, utils_exports, init_utils, check_is_repo_exports, CheckRepoActions, onError, parser2, init_check_is_repo, CleanResponse, removalRegexp, dryRunRemovalRegexp, isFolderRegexp, init_CleanSummary, task_exports, EMPTY_COMMANDS, init_task, clean_exports, CONFIG_ERROR_INTERACTIVE_MODE, CONFIG_ERROR_MODE_REQUIRED, CONFIG_ERROR_UNKNOWN_OPTION, CleanOptions, CleanOptionValues, init_clean, ConfigList, init_ConfigList, GitConfigScope, init_config, DiffNameStatus, diffNameStatus, init_diff_name_status, disallowedOptions, Query,
|
|
9536
|
+
var import_node_buffer, import_file_exists, import_debug, import_child_process, import_promise_deferred, import_node_path, import_promise_deferred2, import_node_events, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __hasOwnProp2, __esm2, __commonJS2, __export2, __copyProps2, __toCommonJS, cache, init_pathspec, GitError, init_git_error, GitResponseError, init_git_response_error, TaskConfigurationError, init_task_configuration_error, NULL, NOOP, objectToString, init_util, filterArray, filterNumber, filterString, filterStringOrStringArray, filterHasLength, init_argument_filters, ExitCodes, init_exit_codes, GitOutputStreams, init_git_output_streams, LineParser, RemoteLineParser, init_line_parser, defaultOptions, init_simple_git_options, init_task_options, init_task_parser, utils_exports, init_utils, check_is_repo_exports, CheckRepoActions, onError, parser2, init_check_is_repo, CleanResponse, removalRegexp, dryRunRemovalRegexp, isFolderRegexp, init_CleanSummary, task_exports, EMPTY_COMMANDS, init_task, clean_exports, CONFIG_ERROR_INTERACTIVE_MODE, CONFIG_ERROR_MODE_REQUIRED, CONFIG_ERROR_UNKNOWN_OPTION, CleanOptions, CleanOptionValues, init_clean, ConfigList, init_ConfigList, GitConfigScope, init_config, DiffNameStatus, diffNameStatus, init_diff_name_status, disallowedOptions, Query, _a3, GrepQuery, init_grep, reset_exports, ResetMode, validResetModes, init_reset, init_git_logger, TasksPendingQueue, init_tasks_pending_queue, GitExecutorChain, init_git_executor_chain, git_executor_exports, GitExecutor, init_git_executor, init_task_callback, init_change_working_directory, init_checkout, parser22, init_count_objects, parsers, init_parse_commit, init_commit, init_first_commit, init_hash_object, InitSummary, initResponseRegex, reInitResponseRegex, init_InitSummary, bareCommand, init_init, logFormatRegex, init_log_format, DiffSummary, init_DiffSummary, statParser, numStatParser, nameOnlyParser, nameStatusParser, diffSummaryParsers, init_parse_diff_summary, START_BOUNDARY, COMMIT_BOUNDARY, SPLITTER, defaultFieldNames, init_parse_list_log_summary, diff_exports, init_diff, excludeOptions, init_log, MergeSummaryConflict, MergeSummaryDetail, init_MergeSummary, PullSummary, PullFailedSummary, init_PullSummary, remoteMessagesObjectParsers, init_parse_remote_objects, parsers2, RemoteMessageSummary, init_parse_remote_messages, FILE_UPDATE_REGEX, SUMMARY_REGEX, ACTION_REGEX, parsers3, errorParsers, parsePullDetail, parsePullResult, init_parse_pull, parsers4, parseMergeResult, parseMergeDetail, init_parse_merge, init_merge, parsers5, parsePushResult, parsePushDetail, init_parse_push, push_exports, init_push, init_show, fromPathRegex, FileStatusSummary, init_FileStatusSummary, StatusSummary, parsers6, parseStatusSummary, init_StatusSummary, ignoredOptions, init_status, NOT_INSTALLED, parsers7, init_version, simple_git_api_exports, SimpleGitApi, init_simple_git_api, scheduler_exports, createScheduledTask, Scheduler, init_scheduler, apply_patch_exports, init_apply_patch, BranchDeletionBatch, init_BranchDeleteSummary, deleteSuccessRegex, deleteErrorRegex, parsers8, parseBranchDeletions, init_parse_branch_delete, BranchSummaryResult, init_BranchSummary, parsers9, currentBranchParser, init_parse_branch, branch_exports, init_branch, parseCheckIgnore, init_CheckIgnore, check_ignore_exports, init_check_ignore, clone_exports, init_clone, parsers10, init_parse_fetch, fetch_exports, init_fetch, parsers11, init_parse_move, move_exports, init_move, pull_exports, init_pull, init_GetRemoteSummary, remote_exports, init_remote, stash_list_exports, init_stash_list, sub_module_exports, init_sub_module, TagList, parseTagList, init_TagList, tag_exports, init_tag, require_git, GitConstructError, GitPluginError, never, WRONG_NUMBER_ERR, WRONG_CHARS_ERR, PluginStore, Git, simpleGit;
|
|
9296
9537
|
var init_esm4 = __esm({
|
|
9297
9538
|
"../../node_modules/.pnpm/simple-git@3.30.0/node_modules/simple-git/dist/esm/index.js"() {
|
|
9298
9539
|
"use strict";
|
|
@@ -9738,9 +9979,9 @@ var init_esm4 = __esm({
|
|
|
9738
9979
|
Query = /* @__PURE__ */ Symbol("grepQuery");
|
|
9739
9980
|
GrepQuery = class {
|
|
9740
9981
|
constructor() {
|
|
9741
|
-
this[
|
|
9982
|
+
this[_a3] = [];
|
|
9742
9983
|
}
|
|
9743
|
-
*[(
|
|
9984
|
+
*[(_a3 = Query, Symbol.iterator)]() {
|
|
9744
9985
|
for (const query of this[Query]) {
|
|
9745
9986
|
yield query;
|
|
9746
9987
|
}
|
|
@@ -22282,11 +22523,11 @@ function stripQuotes(val) {
|
|
|
22282
22523
|
|
|
22283
22524
|
// ../../node_modules/.pnpm/yargs-parser@21.1.1/node_modules/yargs-parser/build/lib/index.js
|
|
22284
22525
|
var import_fs = require("fs");
|
|
22285
|
-
var
|
|
22526
|
+
var _a2;
|
|
22286
22527
|
var _b;
|
|
22287
22528
|
var _c;
|
|
22288
22529
|
var minNodeVersion = process && process.env && process.env.YARGS_MIN_NODE_VERSION ? Number(process.env.YARGS_MIN_NODE_VERSION) : 12;
|
|
22289
|
-
var nodeVersion = (_b = (
|
|
22530
|
+
var nodeVersion = (_b = (_a2 = process === null || process === void 0 ? void 0 : process.versions) === null || _a2 === void 0 ? void 0 : _a2.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
|
|
22290
22531
|
if (nodeVersion) {
|
|
22291
22532
|
const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
|
|
22292
22533
|
if (major < minNodeVersion) {
|
|
@@ -22340,9 +22581,9 @@ var bottom = 2;
|
|
|
22340
22581
|
var left = 3;
|
|
22341
22582
|
var UI = class {
|
|
22342
22583
|
constructor(opts) {
|
|
22343
|
-
var
|
|
22584
|
+
var _a4;
|
|
22344
22585
|
this.width = opts.width;
|
|
22345
|
-
this.wrap = (
|
|
22586
|
+
this.wrap = (_a4 = opts.wrap) !== null && _a4 !== void 0 ? _a4 : true;
|
|
22346
22587
|
this.rows = [];
|
|
22347
22588
|
}
|
|
22348
22589
|
span(...args) {
|
|
@@ -29739,7 +29980,8 @@ var BlockList = class {
|
|
|
29739
29980
|
}
|
|
29740
29981
|
addBlock(block) {
|
|
29741
29982
|
if (this.hasBlock(block.id)) {
|
|
29742
|
-
|
|
29983
|
+
console.warn(`[readme] Duplicate block with id "${block.id}" detected; overriding with latest content`);
|
|
29984
|
+
this.blocks = this.blocks.filter((b) => b.id !== block.id);
|
|
29743
29985
|
}
|
|
29744
29986
|
this.ids.add(block.id);
|
|
29745
29987
|
this.blocks.push(block);
|
|
@@ -29753,7 +29995,9 @@ var BlockList = class {
|
|
|
29753
29995
|
// }
|
|
29754
29996
|
insertBlock(block, precedingBlockId) {
|
|
29755
29997
|
if (this.hasBlock(block.id)) {
|
|
29756
|
-
|
|
29998
|
+
console.warn(`[readme] Duplicate block with id "${block.id}" detected; overriding with latest content`);
|
|
29999
|
+
this.blocks = this.blocks.filter((b) => b.id !== block.id);
|
|
30000
|
+
this.ids.delete(block.id);
|
|
29757
30001
|
}
|
|
29758
30002
|
if (precedingBlockId === void 0) {
|
|
29759
30003
|
this.addBlock(block);
|
|
@@ -31065,85 +31309,6 @@ function formatReplayPrBody(result, options) {
|
|
|
31065
31309
|
return parts.join("\n");
|
|
31066
31310
|
}
|
|
31067
31311
|
|
|
31068
|
-
// src/pipeline/github/postConflictComments.ts
|
|
31069
|
-
function resolveGuidance(conflictReason) {
|
|
31070
|
-
switch (conflictReason) {
|
|
31071
|
-
case "same-line-edit":
|
|
31072
|
-
return "You likely want to combine both -- keep your logic while incorporating the generation's structural changes.";
|
|
31073
|
-
case "new-file-both":
|
|
31074
|
-
return "Compare both versions and merge any unique content. If you created the file intentionally, your version is likely correct.";
|
|
31075
|
-
case "base-generation-mismatch":
|
|
31076
|
-
return "Review carefully -- the generated code changed significantly. You may need to re-apply your customization on top of the new structure.";
|
|
31077
|
-
case "patch-apply-failed":
|
|
31078
|
-
return "Your customization could not be applied automatically. Re-apply your changes manually on top of the new generated code.";
|
|
31079
|
-
default:
|
|
31080
|
-
return "Review both sides and keep whichever version (or combination) is correct for your use case.";
|
|
31081
|
-
}
|
|
31082
|
-
}
|
|
31083
|
-
function buildConflictCommentBody(conflictDetails) {
|
|
31084
|
-
const entries2 = [];
|
|
31085
|
-
for (const detail of conflictDetails) {
|
|
31086
|
-
const description = patchDescription(detail);
|
|
31087
|
-
for (const file of detail.files) {
|
|
31088
|
-
if (file.status === "conflict") {
|
|
31089
|
-
entries2.push({
|
|
31090
|
-
file: file.file,
|
|
31091
|
-
customization: description,
|
|
31092
|
-
reason: formatConflictReason(file.conflictReason),
|
|
31093
|
-
guidance: resolveGuidance(file.conflictReason)
|
|
31094
|
-
});
|
|
31095
|
-
}
|
|
31096
|
-
}
|
|
31097
|
-
}
|
|
31098
|
-
if (entries2.length === 0) {
|
|
31099
|
-
return void 0;
|
|
31100
|
-
}
|
|
31101
|
-
const parts = [];
|
|
31102
|
-
parts.push("## Conflict Resolution Guide\n");
|
|
31103
|
-
parts.push(
|
|
31104
|
-
`This PR has **${entries2.length} file${entries2.length === 1 ? "" : "s"}** where your customizations conflict with the new SDK generation. Below is per-file guidance to help you resolve each conflict.
|
|
31105
|
-
`
|
|
31106
|
-
);
|
|
31107
|
-
parts.push(
|
|
31108
|
-
'> In GitHub\'s conflict editor, `<<<<<<< HEAD` ("Accept current") = **new generated code**, `>>>>>>> main` ("Accept incoming") = **your customization**.\n'
|
|
31109
|
-
);
|
|
31110
|
-
parts.push("| File | Your customization | Why it conflicted | Suggested resolution |");
|
|
31111
|
-
parts.push("|------|-------------------|-------------------|---------------------|");
|
|
31112
|
-
for (const entry of entries2) {
|
|
31113
|
-
parts.push(`| \`${entry.file}\` | ${entry.customization} | ${entry.reason} | ${entry.guidance} |`);
|
|
31114
|
-
}
|
|
31115
|
-
parts.push("\n---");
|
|
31116
|
-
parts.push("*Posted by Fern Replay to help resolve SDK customization conflicts.*");
|
|
31117
|
-
return parts.join("\n");
|
|
31118
|
-
}
|
|
31119
|
-
async function postConflictComments(octokit, owner, repo, prNumber, replayResult, logger) {
|
|
31120
|
-
if (replayResult == null) {
|
|
31121
|
-
return;
|
|
31122
|
-
}
|
|
31123
|
-
const conflictDetails = replayResult.conflictDetails;
|
|
31124
|
-
if (conflictDetails == null || conflictDetails.length === 0) {
|
|
31125
|
-
return;
|
|
31126
|
-
}
|
|
31127
|
-
const body = buildConflictCommentBody(conflictDetails);
|
|
31128
|
-
if (body == null) {
|
|
31129
|
-
logger.debug("No conflict files to comment on -- skipping conflict comment");
|
|
31130
|
-
return;
|
|
31131
|
-
}
|
|
31132
|
-
try {
|
|
31133
|
-
await octokit.issues.createComment({
|
|
31134
|
-
owner,
|
|
31135
|
-
repo,
|
|
31136
|
-
issue_number: prNumber,
|
|
31137
|
-
body
|
|
31138
|
-
});
|
|
31139
|
-
logger.debug(`Posted conflict resolution guide comment on PR #${prNumber}`);
|
|
31140
|
-
} catch (error) {
|
|
31141
|
-
logger.debug(
|
|
31142
|
-
`Could not post conflict comment on PR #${prNumber}: ${error instanceof Error ? error.message : String(error)}`
|
|
31143
|
-
);
|
|
31144
|
-
}
|
|
31145
|
-
}
|
|
31146
|
-
|
|
31147
31312
|
// src/pipeline/steps/BaseStep.ts
|
|
31148
31313
|
var BaseStep = class {
|
|
31149
31314
|
constructor(outputDir, logger) {
|
|
@@ -31329,9 +31494,6 @@ var GithubStep = class extends BaseStep {
|
|
|
31329
31494
|
}
|
|
31330
31495
|
}
|
|
31331
31496
|
}
|
|
31332
|
-
if (!this.config.previewMode && replayConflictInfo?.hasConflicts === true && result.prNumber != null) {
|
|
31333
|
-
await postConflictComments(octokit, owner, repo, result.prNumber, replayResult, this.logger);
|
|
31334
|
-
}
|
|
31335
31497
|
if (!this.config.previewMode && result.prNumber != null && replayConflictInfo?.hasConflicts === true && replayResult != null) {
|
|
31336
31498
|
await this.postWebEditorFallbackComment(
|
|
31337
31499
|
octokit,
|
|
@@ -31946,7 +32108,10 @@ Base generation: ${bootstrapResult.generationCommit.sha.slice(0, 7)}`;
|
|
|
31946
32108
|
`user.name=${FERN_BOT_NAME2}`,
|
|
31947
32109
|
"-c",
|
|
31948
32110
|
`user.email=${FERN_BOT_EMAIL2}`,
|
|
32111
|
+
"-c",
|
|
32112
|
+
"commit.gpgsign=false",
|
|
31949
32113
|
"commit",
|
|
32114
|
+
"--no-verify",
|
|
31950
32115
|
"-m",
|
|
31951
32116
|
commitMessage
|
|
31952
32117
|
]);
|