@fern-api/generator-cli 0.9.39 → 0.9.41
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.d.ts +1 -1
- package/dist/api.js +7 -3
- package/dist/cli.js +600 -262
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -5,11 +5,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __esm = (fn, res) => function __init() {
|
|
9
|
-
|
|
8
|
+
var __esm = (fn, res, err) => function __init() {
|
|
9
|
+
if (err) throw err[0];
|
|
10
|
+
try {
|
|
11
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
throw err = [e], e;
|
|
14
|
+
}
|
|
10
15
|
};
|
|
11
16
|
var __commonJS = (cb, mod) => function __require() {
|
|
12
|
-
|
|
17
|
+
try {
|
|
18
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw mod = 0, e;
|
|
21
|
+
}
|
|
13
22
|
};
|
|
14
23
|
var __export = (target, all) => {
|
|
15
24
|
for (var name in all)
|
|
@@ -32,9 +41,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
41
|
mod
|
|
33
42
|
));
|
|
34
43
|
|
|
35
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
44
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/constants.js
|
|
36
45
|
var require_constants = __commonJS({
|
|
37
|
-
"../../node_modules/.pnpm/semver@7.
|
|
46
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/constants.js"(exports2, module2) {
|
|
38
47
|
"use strict";
|
|
39
48
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
40
49
|
var MAX_LENGTH = 256;
|
|
@@ -64,9 +73,9 @@ var require_constants = __commonJS({
|
|
|
64
73
|
}
|
|
65
74
|
});
|
|
66
75
|
|
|
67
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
76
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/debug.js
|
|
68
77
|
var require_debug = __commonJS({
|
|
69
|
-
"../../node_modules/.pnpm/semver@7.
|
|
78
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/debug.js"(exports2, module2) {
|
|
70
79
|
"use strict";
|
|
71
80
|
var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
72
81
|
};
|
|
@@ -74,9 +83,9 @@ var require_debug = __commonJS({
|
|
|
74
83
|
}
|
|
75
84
|
});
|
|
76
85
|
|
|
77
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
86
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/re.js
|
|
78
87
|
var require_re = __commonJS({
|
|
79
|
-
"../../node_modules/.pnpm/semver@7.
|
|
88
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/re.js"(exports2, module2) {
|
|
80
89
|
"use strict";
|
|
81
90
|
var {
|
|
82
91
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
@@ -162,9 +171,9 @@ var require_re = __commonJS({
|
|
|
162
171
|
}
|
|
163
172
|
});
|
|
164
173
|
|
|
165
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
174
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/parse-options.js
|
|
166
175
|
var require_parse_options = __commonJS({
|
|
167
|
-
"../../node_modules/.pnpm/semver@7.
|
|
176
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/parse-options.js"(exports2, module2) {
|
|
168
177
|
"use strict";
|
|
169
178
|
var looseOption = Object.freeze({ loose: true });
|
|
170
179
|
var emptyOpts = Object.freeze({});
|
|
@@ -181,9 +190,9 @@ var require_parse_options = __commonJS({
|
|
|
181
190
|
}
|
|
182
191
|
});
|
|
183
192
|
|
|
184
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
193
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/identifiers.js
|
|
185
194
|
var require_identifiers = __commonJS({
|
|
186
|
-
"../../node_modules/.pnpm/semver@7.
|
|
195
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/identifiers.js"(exports2, module2) {
|
|
187
196
|
"use strict";
|
|
188
197
|
var numeric2 = /^[0-9]+$/;
|
|
189
198
|
var compareIdentifiers = (a, b3) => {
|
|
@@ -206,15 +215,27 @@ var require_identifiers = __commonJS({
|
|
|
206
215
|
}
|
|
207
216
|
});
|
|
208
217
|
|
|
209
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
218
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/semver.js
|
|
210
219
|
var require_semver = __commonJS({
|
|
211
|
-
"../../node_modules/.pnpm/semver@7.
|
|
220
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/semver.js"(exports2, module2) {
|
|
212
221
|
"use strict";
|
|
213
222
|
var debug2 = require_debug();
|
|
214
223
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
215
224
|
var { safeRe: re, t: t2 } = require_re();
|
|
216
225
|
var parseOptions = require_parse_options();
|
|
217
226
|
var { compareIdentifiers } = require_identifiers();
|
|
227
|
+
var isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
228
|
+
const identifiers = identifier.split(".");
|
|
229
|
+
if (identifiers.length > prerelease.length) {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
for (let i2 = 0; i2 < identifiers.length; i2++) {
|
|
233
|
+
if (compareIdentifiers(prerelease[i2], identifiers[i2]) !== 0) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return true;
|
|
238
|
+
};
|
|
218
239
|
var SemVer = class _SemVer {
|
|
219
240
|
constructor(version2, options) {
|
|
220
241
|
options = parseOptions(options);
|
|
@@ -461,8 +482,9 @@ var require_semver = __commonJS({
|
|
|
461
482
|
if (identifierBase === false) {
|
|
462
483
|
prerelease = [identifier];
|
|
463
484
|
}
|
|
464
|
-
if (
|
|
465
|
-
|
|
485
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
486
|
+
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
487
|
+
if (isNaN(prereleaseBase)) {
|
|
466
488
|
this.prerelease = prerelease;
|
|
467
489
|
}
|
|
468
490
|
} else {
|
|
@@ -485,9 +507,9 @@ var require_semver = __commonJS({
|
|
|
485
507
|
}
|
|
486
508
|
});
|
|
487
509
|
|
|
488
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
510
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/parse.js
|
|
489
511
|
var require_parse = __commonJS({
|
|
490
|
-
"../../node_modules/.pnpm/semver@7.
|
|
512
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
491
513
|
"use strict";
|
|
492
514
|
var SemVer = require_semver();
|
|
493
515
|
var parse3 = (version2, options, throwErrors = false) => {
|
|
@@ -507,9 +529,9 @@ var require_parse = __commonJS({
|
|
|
507
529
|
}
|
|
508
530
|
});
|
|
509
531
|
|
|
510
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
532
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/valid.js
|
|
511
533
|
var require_valid = __commonJS({
|
|
512
|
-
"../../node_modules/.pnpm/semver@7.
|
|
534
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
513
535
|
"use strict";
|
|
514
536
|
var parse3 = require_parse();
|
|
515
537
|
var valid = (version2, options) => {
|
|
@@ -520,9 +542,9 @@ var require_valid = __commonJS({
|
|
|
520
542
|
}
|
|
521
543
|
});
|
|
522
544
|
|
|
523
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
545
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/clean.js
|
|
524
546
|
var require_clean = __commonJS({
|
|
525
|
-
"../../node_modules/.pnpm/semver@7.
|
|
547
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
526
548
|
"use strict";
|
|
527
549
|
var parse3 = require_parse();
|
|
528
550
|
var clean = (version2, options) => {
|
|
@@ -533,9 +555,9 @@ var require_clean = __commonJS({
|
|
|
533
555
|
}
|
|
534
556
|
});
|
|
535
557
|
|
|
536
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
558
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/inc.js
|
|
537
559
|
var require_inc = __commonJS({
|
|
538
|
-
"../../node_modules/.pnpm/semver@7.
|
|
560
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/inc.js"(exports2, module2) {
|
|
539
561
|
"use strict";
|
|
540
562
|
var SemVer = require_semver();
|
|
541
563
|
var inc = (version2, release, options, identifier, identifierBase) => {
|
|
@@ -557,9 +579,9 @@ var require_inc = __commonJS({
|
|
|
557
579
|
}
|
|
558
580
|
});
|
|
559
581
|
|
|
560
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
582
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/diff.js
|
|
561
583
|
var require_diff = __commonJS({
|
|
562
|
-
"../../node_modules/.pnpm/semver@7.
|
|
584
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
563
585
|
"use strict";
|
|
564
586
|
var parse3 = require_parse();
|
|
565
587
|
var diff = (version1, version2) => {
|
|
@@ -601,9 +623,9 @@ var require_diff = __commonJS({
|
|
|
601
623
|
}
|
|
602
624
|
});
|
|
603
625
|
|
|
604
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
626
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/major.js
|
|
605
627
|
var require_major = __commonJS({
|
|
606
|
-
"../../node_modules/.pnpm/semver@7.
|
|
628
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/major.js"(exports2, module2) {
|
|
607
629
|
"use strict";
|
|
608
630
|
var SemVer = require_semver();
|
|
609
631
|
var major = (a, loose) => new SemVer(a, loose).major;
|
|
@@ -611,9 +633,9 @@ var require_major = __commonJS({
|
|
|
611
633
|
}
|
|
612
634
|
});
|
|
613
635
|
|
|
614
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
636
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/minor.js
|
|
615
637
|
var require_minor = __commonJS({
|
|
616
|
-
"../../node_modules/.pnpm/semver@7.
|
|
638
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/minor.js"(exports2, module2) {
|
|
617
639
|
"use strict";
|
|
618
640
|
var SemVer = require_semver();
|
|
619
641
|
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
@@ -621,9 +643,9 @@ var require_minor = __commonJS({
|
|
|
621
643
|
}
|
|
622
644
|
});
|
|
623
645
|
|
|
624
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
646
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/patch.js
|
|
625
647
|
var require_patch = __commonJS({
|
|
626
|
-
"../../node_modules/.pnpm/semver@7.
|
|
648
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/patch.js"(exports2, module2) {
|
|
627
649
|
"use strict";
|
|
628
650
|
var SemVer = require_semver();
|
|
629
651
|
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
@@ -631,9 +653,9 @@ var require_patch = __commonJS({
|
|
|
631
653
|
}
|
|
632
654
|
});
|
|
633
655
|
|
|
634
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
656
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/prerelease.js
|
|
635
657
|
var require_prerelease = __commonJS({
|
|
636
|
-
"../../node_modules/.pnpm/semver@7.
|
|
658
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
637
659
|
"use strict";
|
|
638
660
|
var parse3 = require_parse();
|
|
639
661
|
var prerelease = (version2, options) => {
|
|
@@ -644,9 +666,9 @@ var require_prerelease = __commonJS({
|
|
|
644
666
|
}
|
|
645
667
|
});
|
|
646
668
|
|
|
647
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
669
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare.js
|
|
648
670
|
var require_compare = __commonJS({
|
|
649
|
-
"../../node_modules/.pnpm/semver@7.
|
|
671
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare.js"(exports2, module2) {
|
|
650
672
|
"use strict";
|
|
651
673
|
var SemVer = require_semver();
|
|
652
674
|
var compare = (a, b3, loose) => new SemVer(a, loose).compare(new SemVer(b3, loose));
|
|
@@ -654,9 +676,9 @@ var require_compare = __commonJS({
|
|
|
654
676
|
}
|
|
655
677
|
});
|
|
656
678
|
|
|
657
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
679
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rcompare.js
|
|
658
680
|
var require_rcompare = __commonJS({
|
|
659
|
-
"../../node_modules/.pnpm/semver@7.
|
|
681
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rcompare.js"(exports2, module2) {
|
|
660
682
|
"use strict";
|
|
661
683
|
var compare = require_compare();
|
|
662
684
|
var rcompare = (a, b3, loose) => compare(b3, a, loose);
|
|
@@ -664,9 +686,9 @@ var require_rcompare = __commonJS({
|
|
|
664
686
|
}
|
|
665
687
|
});
|
|
666
688
|
|
|
667
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
689
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-loose.js
|
|
668
690
|
var require_compare_loose = __commonJS({
|
|
669
|
-
"../../node_modules/.pnpm/semver@7.
|
|
691
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-loose.js"(exports2, module2) {
|
|
670
692
|
"use strict";
|
|
671
693
|
var compare = require_compare();
|
|
672
694
|
var compareLoose = (a, b3) => compare(a, b3, true);
|
|
@@ -674,9 +696,9 @@ var require_compare_loose = __commonJS({
|
|
|
674
696
|
}
|
|
675
697
|
});
|
|
676
698
|
|
|
677
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
699
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-build.js
|
|
678
700
|
var require_compare_build = __commonJS({
|
|
679
|
-
"../../node_modules/.pnpm/semver@7.
|
|
701
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-build.js"(exports2, module2) {
|
|
680
702
|
"use strict";
|
|
681
703
|
var SemVer = require_semver();
|
|
682
704
|
var compareBuild = (a, b3, loose) => {
|
|
@@ -688,9 +710,9 @@ var require_compare_build = __commonJS({
|
|
|
688
710
|
}
|
|
689
711
|
});
|
|
690
712
|
|
|
691
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
713
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/sort.js
|
|
692
714
|
var require_sort = __commonJS({
|
|
693
|
-
"../../node_modules/.pnpm/semver@7.
|
|
715
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/sort.js"(exports2, module2) {
|
|
694
716
|
"use strict";
|
|
695
717
|
var compareBuild = require_compare_build();
|
|
696
718
|
var sort = (list2, loose) => list2.sort((a, b3) => compareBuild(a, b3, loose));
|
|
@@ -698,9 +720,9 @@ var require_sort = __commonJS({
|
|
|
698
720
|
}
|
|
699
721
|
});
|
|
700
722
|
|
|
701
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
723
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rsort.js
|
|
702
724
|
var require_rsort = __commonJS({
|
|
703
|
-
"../../node_modules/.pnpm/semver@7.
|
|
725
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rsort.js"(exports2, module2) {
|
|
704
726
|
"use strict";
|
|
705
727
|
var compareBuild = require_compare_build();
|
|
706
728
|
var rsort = (list2, loose) => list2.sort((a, b3) => compareBuild(b3, a, loose));
|
|
@@ -708,9 +730,9 @@ var require_rsort = __commonJS({
|
|
|
708
730
|
}
|
|
709
731
|
});
|
|
710
732
|
|
|
711
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
733
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gt.js
|
|
712
734
|
var require_gt = __commonJS({
|
|
713
|
-
"../../node_modules/.pnpm/semver@7.
|
|
735
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gt.js"(exports2, module2) {
|
|
714
736
|
"use strict";
|
|
715
737
|
var compare = require_compare();
|
|
716
738
|
var gt = (a, b3, loose) => compare(a, b3, loose) > 0;
|
|
@@ -718,9 +740,9 @@ var require_gt = __commonJS({
|
|
|
718
740
|
}
|
|
719
741
|
});
|
|
720
742
|
|
|
721
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
743
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lt.js
|
|
722
744
|
var require_lt = __commonJS({
|
|
723
|
-
"../../node_modules/.pnpm/semver@7.
|
|
745
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lt.js"(exports2, module2) {
|
|
724
746
|
"use strict";
|
|
725
747
|
var compare = require_compare();
|
|
726
748
|
var lt = (a, b3, loose) => compare(a, b3, loose) < 0;
|
|
@@ -728,9 +750,9 @@ var require_lt = __commonJS({
|
|
|
728
750
|
}
|
|
729
751
|
});
|
|
730
752
|
|
|
731
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
753
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/eq.js
|
|
732
754
|
var require_eq = __commonJS({
|
|
733
|
-
"../../node_modules/.pnpm/semver@7.
|
|
755
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/eq.js"(exports2, module2) {
|
|
734
756
|
"use strict";
|
|
735
757
|
var compare = require_compare();
|
|
736
758
|
var eq = (a, b3, loose) => compare(a, b3, loose) === 0;
|
|
@@ -738,9 +760,9 @@ var require_eq = __commonJS({
|
|
|
738
760
|
}
|
|
739
761
|
});
|
|
740
762
|
|
|
741
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
763
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/neq.js
|
|
742
764
|
var require_neq = __commonJS({
|
|
743
|
-
"../../node_modules/.pnpm/semver@7.
|
|
765
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/neq.js"(exports2, module2) {
|
|
744
766
|
"use strict";
|
|
745
767
|
var compare = require_compare();
|
|
746
768
|
var neq = (a, b3, loose) => compare(a, b3, loose) !== 0;
|
|
@@ -748,9 +770,9 @@ var require_neq = __commonJS({
|
|
|
748
770
|
}
|
|
749
771
|
});
|
|
750
772
|
|
|
751
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
773
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gte.js
|
|
752
774
|
var require_gte = __commonJS({
|
|
753
|
-
"../../node_modules/.pnpm/semver@7.
|
|
775
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gte.js"(exports2, module2) {
|
|
754
776
|
"use strict";
|
|
755
777
|
var compare = require_compare();
|
|
756
778
|
var gte2 = (a, b3, loose) => compare(a, b3, loose) >= 0;
|
|
@@ -758,9 +780,9 @@ var require_gte = __commonJS({
|
|
|
758
780
|
}
|
|
759
781
|
});
|
|
760
782
|
|
|
761
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
783
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lte.js
|
|
762
784
|
var require_lte = __commonJS({
|
|
763
|
-
"../../node_modules/.pnpm/semver@7.
|
|
785
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lte.js"(exports2, module2) {
|
|
764
786
|
"use strict";
|
|
765
787
|
var compare = require_compare();
|
|
766
788
|
var lte2 = (a, b3, loose) => compare(a, b3, loose) <= 0;
|
|
@@ -768,9 +790,9 @@ var require_lte = __commonJS({
|
|
|
768
790
|
}
|
|
769
791
|
});
|
|
770
792
|
|
|
771
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
793
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/cmp.js
|
|
772
794
|
var require_cmp = __commonJS({
|
|
773
|
-
"../../node_modules/.pnpm/semver@7.
|
|
795
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/cmp.js"(exports2, module2) {
|
|
774
796
|
"use strict";
|
|
775
797
|
var eq = require_eq();
|
|
776
798
|
var neq = require_neq();
|
|
@@ -818,9 +840,9 @@ var require_cmp = __commonJS({
|
|
|
818
840
|
}
|
|
819
841
|
});
|
|
820
842
|
|
|
821
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
843
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/coerce.js
|
|
822
844
|
var require_coerce = __commonJS({
|
|
823
|
-
"../../node_modules/.pnpm/semver@7.
|
|
845
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
824
846
|
"use strict";
|
|
825
847
|
var SemVer = require_semver();
|
|
826
848
|
var parse3 = require_parse();
|
|
@@ -864,9 +886,50 @@ var require_coerce = __commonJS({
|
|
|
864
886
|
}
|
|
865
887
|
});
|
|
866
888
|
|
|
867
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
889
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/truncate.js
|
|
890
|
+
var require_truncate = __commonJS({
|
|
891
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/truncate.js"(exports2, module2) {
|
|
892
|
+
"use strict";
|
|
893
|
+
var parse3 = require_parse();
|
|
894
|
+
var constants = require_constants();
|
|
895
|
+
var SemVer = require_semver();
|
|
896
|
+
var truncate = (version2, truncation, options) => {
|
|
897
|
+
if (!constants.RELEASE_TYPES.includes(truncation)) {
|
|
898
|
+
return null;
|
|
899
|
+
}
|
|
900
|
+
const clonedVersion = cloneInputVersion(version2, options);
|
|
901
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
902
|
+
};
|
|
903
|
+
var cloneInputVersion = (version2, options) => {
|
|
904
|
+
const versionStringToParse = version2 instanceof SemVer ? version2.version : version2;
|
|
905
|
+
return parse3(versionStringToParse, options);
|
|
906
|
+
};
|
|
907
|
+
var doTruncation = (version2, truncation) => {
|
|
908
|
+
if (isPrerelease(truncation)) {
|
|
909
|
+
return version2.version;
|
|
910
|
+
}
|
|
911
|
+
version2.prerelease = [];
|
|
912
|
+
switch (truncation) {
|
|
913
|
+
case "major":
|
|
914
|
+
version2.minor = 0;
|
|
915
|
+
version2.patch = 0;
|
|
916
|
+
break;
|
|
917
|
+
case "minor":
|
|
918
|
+
version2.patch = 0;
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
921
|
+
return version2.format();
|
|
922
|
+
};
|
|
923
|
+
var isPrerelease = (type) => {
|
|
924
|
+
return type.startsWith("pre");
|
|
925
|
+
};
|
|
926
|
+
module2.exports = truncate;
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/lrucache.js
|
|
868
931
|
var require_lrucache = __commonJS({
|
|
869
|
-
"../../node_modules/.pnpm/semver@7.
|
|
932
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/lrucache.js"(exports2, module2) {
|
|
870
933
|
"use strict";
|
|
871
934
|
var LRUCache = class {
|
|
872
935
|
constructor() {
|
|
@@ -902,9 +965,9 @@ var require_lrucache = __commonJS({
|
|
|
902
965
|
}
|
|
903
966
|
});
|
|
904
967
|
|
|
905
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
968
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/range.js
|
|
906
969
|
var require_range = __commonJS({
|
|
907
|
-
"../../node_modules/.pnpm/semver@7.
|
|
970
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/range.js"(exports2, module2) {
|
|
908
971
|
"use strict";
|
|
909
972
|
var SPACE_CHARACTERS = /\s+/g;
|
|
910
973
|
var Range = class _Range {
|
|
@@ -972,6 +1035,7 @@ var require_range = __commonJS({
|
|
|
972
1035
|
return this.range;
|
|
973
1036
|
}
|
|
974
1037
|
parseRange(range2) {
|
|
1038
|
+
range2 = range2.replace(BUILDSTRIPRE, "");
|
|
975
1039
|
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
976
1040
|
const memoKey = memoOpts + ":" + range2;
|
|
977
1041
|
const cached = cache.get(memoKey);
|
|
@@ -1054,12 +1118,14 @@ var require_range = __commonJS({
|
|
|
1054
1118
|
var SemVer = require_semver();
|
|
1055
1119
|
var {
|
|
1056
1120
|
safeRe: re,
|
|
1121
|
+
src,
|
|
1057
1122
|
t: t2,
|
|
1058
1123
|
comparatorTrimReplace,
|
|
1059
1124
|
tildeTrimReplace,
|
|
1060
1125
|
caretTrimReplace
|
|
1061
1126
|
} = require_re();
|
|
1062
1127
|
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1128
|
+
var BUILDSTRIPRE = new RegExp(src[t2.BUILD], "g");
|
|
1063
1129
|
var isNullSet = (c3) => c3.value === "<0.0.0-0";
|
|
1064
1130
|
var isAny = (c3) => c3.value === "";
|
|
1065
1131
|
var isSatisfiable = (comparators, options) => {
|
|
@@ -1088,6 +1154,7 @@ var require_range = __commonJS({
|
|
|
1088
1154
|
return comp;
|
|
1089
1155
|
};
|
|
1090
1156
|
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1157
|
+
var invalidXRangeOrder = (M2, m, p2) => isX(M2) && !isX(m) || isX(m) && p2 && !isX(p2);
|
|
1091
1158
|
var replaceTildes = (comp, options) => {
|
|
1092
1159
|
return comp.trim().split(/\s+/).map((c3) => replaceTilde(c3, options)).join(" ");
|
|
1093
1160
|
};
|
|
@@ -1147,9 +1214,9 @@ var require_range = __commonJS({
|
|
|
1147
1214
|
debug2("no pr");
|
|
1148
1215
|
if (M2 === "0") {
|
|
1149
1216
|
if (m === "0") {
|
|
1150
|
-
ret = `>=${M2}.${m}.${p2}
|
|
1217
|
+
ret = `>=${M2}.${m}.${p2} <${M2}.${m}.${+p2 + 1}-0`;
|
|
1151
1218
|
} else {
|
|
1152
|
-
ret = `>=${M2}.${m}.${p2}
|
|
1219
|
+
ret = `>=${M2}.${m}.${p2} <${M2}.${+m + 1}.0-0`;
|
|
1153
1220
|
}
|
|
1154
1221
|
} else {
|
|
1155
1222
|
ret = `>=${M2}.${m}.${p2} <${+M2 + 1}.0.0-0`;
|
|
@@ -1168,6 +1235,9 @@ var require_range = __commonJS({
|
|
|
1168
1235
|
const r2 = options.loose ? re[t2.XRANGELOOSE] : re[t2.XRANGE];
|
|
1169
1236
|
return comp.replace(r2, (ret, gtlt, M2, m, p2, pr) => {
|
|
1170
1237
|
debug2("xRange", comp, ret, gtlt, M2, m, p2, pr);
|
|
1238
|
+
if (invalidXRangeOrder(M2, m, p2)) {
|
|
1239
|
+
return comp;
|
|
1240
|
+
}
|
|
1171
1241
|
const xM = isX(M2);
|
|
1172
1242
|
const xm = xM || isX(m);
|
|
1173
1243
|
const xp = xm || isX(p2);
|
|
@@ -1279,9 +1349,9 @@ var require_range = __commonJS({
|
|
|
1279
1349
|
}
|
|
1280
1350
|
});
|
|
1281
1351
|
|
|
1282
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1352
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/comparator.js
|
|
1283
1353
|
var require_comparator = __commonJS({
|
|
1284
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1354
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/comparator.js"(exports2, module2) {
|
|
1285
1355
|
"use strict";
|
|
1286
1356
|
var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
1287
1357
|
var Comparator = class _Comparator {
|
|
@@ -1392,9 +1462,9 @@ var require_comparator = __commonJS({
|
|
|
1392
1462
|
}
|
|
1393
1463
|
});
|
|
1394
1464
|
|
|
1395
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1465
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/satisfies.js
|
|
1396
1466
|
var require_satisfies = __commonJS({
|
|
1397
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1467
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/satisfies.js"(exports2, module2) {
|
|
1398
1468
|
"use strict";
|
|
1399
1469
|
var Range = require_range();
|
|
1400
1470
|
var satisfies = (version2, range2, options) => {
|
|
@@ -1409,9 +1479,9 @@ var require_satisfies = __commonJS({
|
|
|
1409
1479
|
}
|
|
1410
1480
|
});
|
|
1411
1481
|
|
|
1412
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1482
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/to-comparators.js
|
|
1413
1483
|
var require_to_comparators = __commonJS({
|
|
1414
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1484
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/to-comparators.js"(exports2, module2) {
|
|
1415
1485
|
"use strict";
|
|
1416
1486
|
var Range = require_range();
|
|
1417
1487
|
var toComparators = (range2, options) => new Range(range2, options).set.map((comp) => comp.map((c3) => c3.value).join(" ").trim().split(" "));
|
|
@@ -1419,9 +1489,9 @@ var require_to_comparators = __commonJS({
|
|
|
1419
1489
|
}
|
|
1420
1490
|
});
|
|
1421
1491
|
|
|
1422
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1492
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/max-satisfying.js
|
|
1423
1493
|
var require_max_satisfying = __commonJS({
|
|
1424
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1494
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/max-satisfying.js"(exports2, module2) {
|
|
1425
1495
|
"use strict";
|
|
1426
1496
|
var SemVer = require_semver();
|
|
1427
1497
|
var Range = require_range();
|
|
@@ -1448,9 +1518,9 @@ var require_max_satisfying = __commonJS({
|
|
|
1448
1518
|
}
|
|
1449
1519
|
});
|
|
1450
1520
|
|
|
1451
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1521
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-satisfying.js
|
|
1452
1522
|
var require_min_satisfying = __commonJS({
|
|
1453
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1523
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-satisfying.js"(exports2, module2) {
|
|
1454
1524
|
"use strict";
|
|
1455
1525
|
var SemVer = require_semver();
|
|
1456
1526
|
var Range = require_range();
|
|
@@ -1477,9 +1547,9 @@ var require_min_satisfying = __commonJS({
|
|
|
1477
1547
|
}
|
|
1478
1548
|
});
|
|
1479
1549
|
|
|
1480
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1550
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-version.js
|
|
1481
1551
|
var require_min_version = __commonJS({
|
|
1482
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1552
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-version.js"(exports2, module2) {
|
|
1483
1553
|
"use strict";
|
|
1484
1554
|
var SemVer = require_semver();
|
|
1485
1555
|
var Range = require_range();
|
|
@@ -1536,9 +1606,9 @@ var require_min_version = __commonJS({
|
|
|
1536
1606
|
}
|
|
1537
1607
|
});
|
|
1538
1608
|
|
|
1539
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1609
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/valid.js
|
|
1540
1610
|
var require_valid2 = __commonJS({
|
|
1541
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1611
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/valid.js"(exports2, module2) {
|
|
1542
1612
|
"use strict";
|
|
1543
1613
|
var Range = require_range();
|
|
1544
1614
|
var validRange = (range2, options) => {
|
|
@@ -1552,9 +1622,9 @@ var require_valid2 = __commonJS({
|
|
|
1552
1622
|
}
|
|
1553
1623
|
});
|
|
1554
1624
|
|
|
1555
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1625
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/outside.js
|
|
1556
1626
|
var require_outside = __commonJS({
|
|
1557
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1627
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/outside.js"(exports2, module2) {
|
|
1558
1628
|
"use strict";
|
|
1559
1629
|
var SemVer = require_semver();
|
|
1560
1630
|
var Comparator = require_comparator();
|
|
@@ -1621,9 +1691,9 @@ var require_outside = __commonJS({
|
|
|
1621
1691
|
}
|
|
1622
1692
|
});
|
|
1623
1693
|
|
|
1624
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1694
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/gtr.js
|
|
1625
1695
|
var require_gtr = __commonJS({
|
|
1626
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1696
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/gtr.js"(exports2, module2) {
|
|
1627
1697
|
"use strict";
|
|
1628
1698
|
var outside = require_outside();
|
|
1629
1699
|
var gtr = (version2, range2, options) => outside(version2, range2, ">", options);
|
|
@@ -1631,9 +1701,9 @@ var require_gtr = __commonJS({
|
|
|
1631
1701
|
}
|
|
1632
1702
|
});
|
|
1633
1703
|
|
|
1634
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1704
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/ltr.js
|
|
1635
1705
|
var require_ltr = __commonJS({
|
|
1636
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1706
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/ltr.js"(exports2, module2) {
|
|
1637
1707
|
"use strict";
|
|
1638
1708
|
var outside = require_outside();
|
|
1639
1709
|
var ltr = (version2, range2, options) => outside(version2, range2, "<", options);
|
|
@@ -1641,9 +1711,9 @@ var require_ltr = __commonJS({
|
|
|
1641
1711
|
}
|
|
1642
1712
|
});
|
|
1643
1713
|
|
|
1644
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1714
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/intersects.js
|
|
1645
1715
|
var require_intersects = __commonJS({
|
|
1646
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1716
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/intersects.js"(exports2, module2) {
|
|
1647
1717
|
"use strict";
|
|
1648
1718
|
var Range = require_range();
|
|
1649
1719
|
var intersects = (r1, r2, options) => {
|
|
@@ -1655,9 +1725,9 @@ var require_intersects = __commonJS({
|
|
|
1655
1725
|
}
|
|
1656
1726
|
});
|
|
1657
1727
|
|
|
1658
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1728
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/simplify.js
|
|
1659
1729
|
var require_simplify = __commonJS({
|
|
1660
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1730
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/simplify.js"(exports2, module2) {
|
|
1661
1731
|
"use strict";
|
|
1662
1732
|
var satisfies = require_satisfies();
|
|
1663
1733
|
var compare = require_compare();
|
|
@@ -1705,9 +1775,9 @@ var require_simplify = __commonJS({
|
|
|
1705
1775
|
}
|
|
1706
1776
|
});
|
|
1707
1777
|
|
|
1708
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1778
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/subset.js
|
|
1709
1779
|
var require_subset = __commonJS({
|
|
1710
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1780
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/subset.js"(exports2, module2) {
|
|
1711
1781
|
"use strict";
|
|
1712
1782
|
var Range = require_range();
|
|
1713
1783
|
var Comparator = require_comparator();
|
|
@@ -1815,7 +1885,7 @@ var require_subset = __commonJS({
|
|
|
1815
1885
|
if (higher === c3 && higher !== gt) {
|
|
1816
1886
|
return false;
|
|
1817
1887
|
}
|
|
1818
|
-
} else if (gt.operator === ">=" && !
|
|
1888
|
+
} else if (gt.operator === ">=" && !c3.test(gt.semver)) {
|
|
1819
1889
|
return false;
|
|
1820
1890
|
}
|
|
1821
1891
|
}
|
|
@@ -1830,7 +1900,7 @@ var require_subset = __commonJS({
|
|
|
1830
1900
|
if (lower === c3 && lower !== lt) {
|
|
1831
1901
|
return false;
|
|
1832
1902
|
}
|
|
1833
|
-
} else if (lt.operator === "<=" && !
|
|
1903
|
+
} else if (lt.operator === "<=" && !c3.test(lt.semver)) {
|
|
1834
1904
|
return false;
|
|
1835
1905
|
}
|
|
1836
1906
|
}
|
|
@@ -1867,9 +1937,9 @@ var require_subset = __commonJS({
|
|
|
1867
1937
|
}
|
|
1868
1938
|
});
|
|
1869
1939
|
|
|
1870
|
-
// ../../node_modules/.pnpm/semver@7.
|
|
1940
|
+
// ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/index.js
|
|
1871
1941
|
var require_semver2 = __commonJS({
|
|
1872
|
-
"../../node_modules/.pnpm/semver@7.
|
|
1942
|
+
"../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/index.js"(exports2, module2) {
|
|
1873
1943
|
"use strict";
|
|
1874
1944
|
var internalRe = require_re();
|
|
1875
1945
|
var constants = require_constants();
|
|
@@ -1898,6 +1968,7 @@ var require_semver2 = __commonJS({
|
|
|
1898
1968
|
var lte2 = require_lte();
|
|
1899
1969
|
var cmp = require_cmp();
|
|
1900
1970
|
var coerce = require_coerce();
|
|
1971
|
+
var truncate = require_truncate();
|
|
1901
1972
|
var Comparator = require_comparator();
|
|
1902
1973
|
var Range = require_range();
|
|
1903
1974
|
var satisfies = require_satisfies();
|
|
@@ -1936,6 +2007,7 @@ var require_semver2 = __commonJS({
|
|
|
1936
2007
|
lte: lte2,
|
|
1937
2008
|
cmp,
|
|
1938
2009
|
coerce,
|
|
2010
|
+
truncate,
|
|
1939
2011
|
Comparator,
|
|
1940
2012
|
Range,
|
|
1941
2013
|
satisfies,
|
|
@@ -3822,9 +3894,9 @@ var init_esm3 = __esm({
|
|
|
3822
3894
|
}
|
|
3823
3895
|
});
|
|
3824
3896
|
|
|
3825
|
-
// ../../node_modules/.pnpm/tmp@0.2.
|
|
3897
|
+
// ../../node_modules/.pnpm/tmp@0.2.7/node_modules/tmp/lib/tmp.js
|
|
3826
3898
|
var require_tmp = __commonJS({
|
|
3827
|
-
"../../node_modules/.pnpm/tmp@0.2.
|
|
3899
|
+
"../../node_modules/.pnpm/tmp@0.2.7/node_modules/tmp/lib/tmp.js"(exports2, module2) {
|
|
3828
3900
|
"use strict";
|
|
3829
3901
|
var fs3 = require("fs");
|
|
3830
3902
|
var os = require("os");
|
|
@@ -4075,11 +4147,14 @@ var require_tmp = __commonJS({
|
|
|
4075
4147
|
].join("");
|
|
4076
4148
|
return path5.join(tmpDir, opts.dir, name);
|
|
4077
4149
|
}
|
|
4078
|
-
function _assertPath(
|
|
4079
|
-
if (
|
|
4150
|
+
function _assertPath(option, value) {
|
|
4151
|
+
if (typeof value !== "string") {
|
|
4152
|
+
throw new Error(`${option} option must be a string, got "${typeof value}".`);
|
|
4153
|
+
}
|
|
4154
|
+
if (value.includes("..")) {
|
|
4080
4155
|
throw new Error("Relative value not allowed");
|
|
4081
4156
|
}
|
|
4082
|
-
return
|
|
4157
|
+
return value;
|
|
4083
4158
|
}
|
|
4084
4159
|
function _assertOptionsBase(options) {
|
|
4085
4160
|
if (!_isUndefined(options.name)) {
|
|
@@ -4090,8 +4165,13 @@ var require_tmp = __commonJS({
|
|
|
4090
4165
|
throw new Error(`name option must not contain a path, found "${name}".`);
|
|
4091
4166
|
}
|
|
4092
4167
|
}
|
|
4093
|
-
if (!_isUndefined(options.template)
|
|
4094
|
-
|
|
4168
|
+
if (!_isUndefined(options.template)) {
|
|
4169
|
+
if (typeof options.template !== "string") {
|
|
4170
|
+
throw new Error(`template option must be a string, got "${typeof options.template}".`);
|
|
4171
|
+
}
|
|
4172
|
+
if (!options.template.match(TEMPLATE_PATTERN)) {
|
|
4173
|
+
throw new Error(`Invalid template, found "${options.template}".`);
|
|
4174
|
+
}
|
|
4095
4175
|
}
|
|
4096
4176
|
if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) {
|
|
4097
4177
|
throw new Error(`Invalid tries, found "${options.tries}".`);
|
|
@@ -4101,9 +4181,9 @@ var require_tmp = __commonJS({
|
|
|
4101
4181
|
options.detachDescriptor = !!options.detachDescriptor;
|
|
4102
4182
|
options.discardDescriptor = !!options.discardDescriptor;
|
|
4103
4183
|
options.unsafeCleanup = !!options.unsafeCleanup;
|
|
4104
|
-
options.prefix = _isUndefined(options.prefix) ? "" : _assertPath(options.prefix);
|
|
4105
|
-
options.postfix = _isUndefined(options.postfix) ? "" : _assertPath(options.postfix);
|
|
4106
|
-
options.template = _isUndefined(options.template) ? void 0 : _assertPath(options.template);
|
|
4184
|
+
options.prefix = _isUndefined(options.prefix) ? "" : _assertPath("prefix", options.prefix);
|
|
4185
|
+
options.postfix = _isUndefined(options.postfix) ? "" : _assertPath("postfix", options.postfix);
|
|
4186
|
+
options.template = _isUndefined(options.template) ? void 0 : _assertPath("template", options.template);
|
|
4107
4187
|
}
|
|
4108
4188
|
function _getRelativePath(option, name, tmpDir, cb) {
|
|
4109
4189
|
if (_isUndefined(name)) return cb(null);
|
|
@@ -7086,7 +7166,7 @@ var require_require_directory = __commonJS({
|
|
|
7086
7166
|
"../../node_modules/.pnpm/require-directory@2.1.1/node_modules/require-directory/index.js"(exports2, module2) {
|
|
7087
7167
|
"use strict";
|
|
7088
7168
|
var fs3 = require("fs");
|
|
7089
|
-
var
|
|
7169
|
+
var join18 = require("path").join;
|
|
7090
7170
|
var resolve8 = require("path").resolve;
|
|
7091
7171
|
var dirname6 = require("path").dirname;
|
|
7092
7172
|
var defaultOptions2 = {
|
|
@@ -7123,7 +7203,7 @@ var require_require_directory = __commonJS({
|
|
|
7123
7203
|
}
|
|
7124
7204
|
path5 = !path5 ? dirname6(m.filename) : resolve8(dirname6(m.filename), path5);
|
|
7125
7205
|
fs3.readdirSync(path5).forEach(function(filename) {
|
|
7126
|
-
var joined =
|
|
7206
|
+
var joined = join18(path5, filename), files, key, obj;
|
|
7127
7207
|
if (fs3.statSync(joined).isDirectory() && options.recurse) {
|
|
7128
7208
|
files = requireDirectory(m, joined, options);
|
|
7129
7209
|
if (Object.keys(files).length) {
|
|
@@ -22134,7 +22214,7 @@ var init_diff3 = __esm({
|
|
|
22134
22214
|
}
|
|
22135
22215
|
});
|
|
22136
22216
|
|
|
22137
|
-
// ../../node_modules/.pnpm/@fern-api+replay@0.
|
|
22217
|
+
// ../../node_modules/.pnpm/@fern-api+replay@0.19.0/node_modules/@fern-api/replay/dist/index.js
|
|
22138
22218
|
var dist_exports = {};
|
|
22139
22219
|
__export(dist_exports, {
|
|
22140
22220
|
CREDENTIAL_PATTERNS: () => CREDENTIAL_PATTERNS,
|
|
@@ -22544,12 +22624,14 @@ async function capturePatchSnapshot(git, files, treeish) {
|
|
|
22544
22624
|
return snapshot;
|
|
22545
22625
|
}
|
|
22546
22626
|
function filterInfrastructureAndSensitiveFiles(rawFilesOutput, fernignorePatterns) {
|
|
22547
|
-
const
|
|
22627
|
+
const rawFiles = rawFilesOutput.trim().split("\n").filter(Boolean);
|
|
22628
|
+
const infrastructureFiles = rawFiles.filter((f) => INFRASTRUCTURE_FILES.has(f) || f.startsWith(".fern/"));
|
|
22629
|
+
const allFiles = rawFiles.filter((f) => !INFRASTRUCTURE_FILES.has(f) && !f.startsWith(".fern/"));
|
|
22548
22630
|
const sensitiveFiles = allFiles.filter((f) => isSensitiveFile(f));
|
|
22549
22631
|
const nonSensitive = allFiles.filter((f) => !isSensitiveFile(f));
|
|
22550
22632
|
const fernignoredFiles = nonSensitive.filter((f) => matchesFernignorePattern(f, fernignorePatterns));
|
|
22551
22633
|
const files = nonSensitive.filter((f) => !matchesFernignorePattern(f, fernignorePatterns));
|
|
22552
|
-
return { files, sensitiveFiles, fernignoredFiles };
|
|
22634
|
+
return { files, sensitiveFiles, fernignoredFiles, infrastructureFiles };
|
|
22553
22635
|
}
|
|
22554
22636
|
function threeWayMerge(base, ours, theirs) {
|
|
22555
22637
|
const baseLines = base.split("\n");
|
|
@@ -23055,6 +23137,11 @@ function isDiffLineForFile(diffLine, filePath) {
|
|
|
23055
23137
|
const match2 = diffLine.match(/^diff --git a\/.+ b\/(.+)$/);
|
|
23056
23138
|
return match2 !== null && match2[1] === filePath;
|
|
23057
23139
|
}
|
|
23140
|
+
function readFernignorePatterns(outputDir) {
|
|
23141
|
+
const fernignorePath = (0, import_path14.join)(outputDir, ".fernignore");
|
|
23142
|
+
if (!(0, import_fs8.existsSync)(fernignorePath)) return [];
|
|
23143
|
+
return (0, import_fs8.readFileSync)(fernignorePath, "utf-8").split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
23144
|
+
}
|
|
23058
23145
|
function normalizeHunkBody(hunk) {
|
|
23059
23146
|
let contextC = 0;
|
|
23060
23147
|
let removeC = 0;
|
|
@@ -23270,10 +23357,10 @@ function overlayRegions(currentGenLines, locInCurrentGen, workingTreeLines, locI
|
|
|
23270
23357
|
}
|
|
23271
23358
|
async function unifiedDiff(beforeContent, afterContent, filePath) {
|
|
23272
23359
|
if (beforeContent === afterContent) return "";
|
|
23273
|
-
const tmp4 = await (0, import_promises8.mkdtemp)((0,
|
|
23360
|
+
const tmp4 = await (0, import_promises8.mkdtemp)((0, import_path15.join)((0, import_os3.tmpdir)(), "fern-replay-pp-"));
|
|
23274
23361
|
try {
|
|
23275
|
-
const beforePath = (0,
|
|
23276
|
-
const afterPath = (0,
|
|
23362
|
+
const beforePath = (0, import_path15.join)(tmp4, "before");
|
|
23363
|
+
const afterPath = (0, import_path15.join)(tmp4, "after");
|
|
23277
23364
|
await (0, import_promises8.writeFile)(beforePath, beforeContent, "utf-8");
|
|
23278
23365
|
await (0, import_promises8.writeFile)(afterPath, afterContent, "utf-8");
|
|
23279
23366
|
const raw = await runGitDiffNoIndex(beforePath, afterPath);
|
|
@@ -23382,6 +23469,17 @@ function assertActive(prep) {
|
|
|
23382
23469
|
);
|
|
23383
23470
|
}
|
|
23384
23471
|
}
|
|
23472
|
+
function dedupeDegradedReasons(reasons) {
|
|
23473
|
+
const seen = /* @__PURE__ */ new Set();
|
|
23474
|
+
const out = [];
|
|
23475
|
+
for (const reason of reasons) {
|
|
23476
|
+
const key = `${reason.code}\0${reason.message}`;
|
|
23477
|
+
if (seen.has(key)) continue;
|
|
23478
|
+
seen.add(key);
|
|
23479
|
+
out.push(reason);
|
|
23480
|
+
}
|
|
23481
|
+
return out;
|
|
23482
|
+
}
|
|
23385
23483
|
function computeCommitBuckets(results, absorbedPatchIds, patchesPassedToCommit) {
|
|
23386
23484
|
const resultByPatchId = /* @__PURE__ */ new Map();
|
|
23387
23485
|
for (const r2 of results) resultByPatchId.set(r2.patch.id, r2);
|
|
@@ -23430,7 +23528,7 @@ function computeLegacyFernignoreCleanse(patch, fernignorePatterns, computeConten
|
|
|
23430
23528
|
}
|
|
23431
23529
|
}
|
|
23432
23530
|
}
|
|
23433
|
-
const { stripped: patchContentStripped, content: newPatchContent, strippedSectionPaths } =
|
|
23531
|
+
const { stripped: patchContentStripped, content: newPatchContent, strippedSectionPaths } = stripDiffSectionsByPredicate(patch.patch_content, matchesFernignore);
|
|
23434
23532
|
const unchanged = strippedFromFiles.length === 0 && !snapshotChanged && !patchContentStripped;
|
|
23435
23533
|
if (unchanged) {
|
|
23436
23534
|
return {
|
|
@@ -23465,7 +23563,38 @@ function computeLegacyFernignoreCleanse(patch, fernignorePatterns, computeConten
|
|
|
23465
23563
|
strippedPaths
|
|
23466
23564
|
};
|
|
23467
23565
|
}
|
|
23468
|
-
function
|
|
23566
|
+
function isInfrastructureFile(filePath) {
|
|
23567
|
+
return filePath === ".fernignore" || filePath.startsWith(".fern/");
|
|
23568
|
+
}
|
|
23569
|
+
function computeInfrastructureFileCleanse(patch, computeContentHash2) {
|
|
23570
|
+
const { stripped, content: newPatchContent, strippedSectionPaths } = stripDiffSectionsByPredicate(patch.patch_content, isInfrastructureFile);
|
|
23571
|
+
if (!stripped) {
|
|
23572
|
+
return {
|
|
23573
|
+
unchanged: true,
|
|
23574
|
+
remove: false,
|
|
23575
|
+
patch_content: patch.patch_content,
|
|
23576
|
+
content_hash: patch.content_hash,
|
|
23577
|
+
strippedPaths: []
|
|
23578
|
+
};
|
|
23579
|
+
}
|
|
23580
|
+
if (newPatchContent.trim() === "" || patch.files.length === 0) {
|
|
23581
|
+
return {
|
|
23582
|
+
unchanged: false,
|
|
23583
|
+
remove: true,
|
|
23584
|
+
patch_content: "",
|
|
23585
|
+
content_hash: "",
|
|
23586
|
+
strippedPaths: strippedSectionPaths
|
|
23587
|
+
};
|
|
23588
|
+
}
|
|
23589
|
+
return {
|
|
23590
|
+
unchanged: false,
|
|
23591
|
+
remove: false,
|
|
23592
|
+
patch_content: newPatchContent,
|
|
23593
|
+
content_hash: computeContentHash2(newPatchContent),
|
|
23594
|
+
strippedPaths: strippedSectionPaths
|
|
23595
|
+
};
|
|
23596
|
+
}
|
|
23597
|
+
function stripDiffSectionsByPredicate(patchContent, shouldStrip) {
|
|
23469
23598
|
const lines = patchContent.split("\n");
|
|
23470
23599
|
const sectionStarts = [];
|
|
23471
23600
|
for (let i2 = 0; i2 < lines.length; i2++) {
|
|
@@ -23487,7 +23616,7 @@ function stripFernignoreDiffSections(patchContent, matchesFernignore) {
|
|
|
23487
23616
|
const section = sectionStarts[i2];
|
|
23488
23617
|
const next = sectionStarts[i2 + 1];
|
|
23489
23618
|
const endIdx = next ? next.idx : lines.length;
|
|
23490
|
-
if (section.path !== null &&
|
|
23619
|
+
if (section.path !== null && shouldStrip(section.path)) {
|
|
23491
23620
|
stripped = true;
|
|
23492
23621
|
strippedSectionPaths.push(section.path);
|
|
23493
23622
|
continue;
|
|
@@ -23660,10 +23789,10 @@ function parseGitLog(log) {
|
|
|
23660
23789
|
});
|
|
23661
23790
|
}
|
|
23662
23791
|
function ensureFernignoreEntries(outputDir) {
|
|
23663
|
-
const fernignorePath = (0,
|
|
23792
|
+
const fernignorePath = (0, import_path17.join)(outputDir, ".fernignore");
|
|
23664
23793
|
let content = "";
|
|
23665
|
-
if ((0,
|
|
23666
|
-
content = (0,
|
|
23794
|
+
if ((0, import_fs10.existsSync)(fernignorePath)) {
|
|
23795
|
+
content = (0, import_fs10.readFileSync)(fernignorePath, "utf-8");
|
|
23667
23796
|
}
|
|
23668
23797
|
const lines = content.split("\n");
|
|
23669
23798
|
const toAdd = [];
|
|
@@ -23679,14 +23808,14 @@ function ensureFernignoreEntries(outputDir) {
|
|
|
23679
23808
|
content += "\n";
|
|
23680
23809
|
}
|
|
23681
23810
|
content += toAdd.join("\n") + "\n";
|
|
23682
|
-
(0,
|
|
23811
|
+
(0, import_fs10.writeFileSync)(fernignorePath, content, "utf-8");
|
|
23683
23812
|
return true;
|
|
23684
23813
|
}
|
|
23685
23814
|
function ensureGitattributesEntries(outputDir) {
|
|
23686
|
-
const gitattributesPath = (0,
|
|
23815
|
+
const gitattributesPath = (0, import_path17.join)(outputDir, ".gitattributes");
|
|
23687
23816
|
let content = "";
|
|
23688
|
-
if ((0,
|
|
23689
|
-
content = (0,
|
|
23817
|
+
if ((0, import_fs10.existsSync)(gitattributesPath)) {
|
|
23818
|
+
content = (0, import_fs10.readFileSync)(gitattributesPath, "utf-8");
|
|
23690
23819
|
}
|
|
23691
23820
|
const lines = content.split("\n");
|
|
23692
23821
|
const toAdd = [];
|
|
@@ -23702,7 +23831,7 @@ function ensureGitattributesEntries(outputDir) {
|
|
|
23702
23831
|
content += "\n";
|
|
23703
23832
|
}
|
|
23704
23833
|
content += toAdd.join("\n") + "\n";
|
|
23705
|
-
(0,
|
|
23834
|
+
(0, import_fs10.writeFileSync)(gitattributesPath, content, "utf-8");
|
|
23706
23835
|
}
|
|
23707
23836
|
function computeContentHash(patchContent) {
|
|
23708
23837
|
const lines = patchContent.split("\n");
|
|
@@ -23760,7 +23889,28 @@ function buildWarnings(patches) {
|
|
|
23760
23889
|
}
|
|
23761
23890
|
return warnings;
|
|
23762
23891
|
}
|
|
23763
|
-
function
|
|
23892
|
+
async function dismissPatches(outputDir, lockManager, patches) {
|
|
23893
|
+
const git = new GitClient(outputDir);
|
|
23894
|
+
const detector = new ReplayDetector(git, lockManager, outputDir, readFernignorePatterns(outputDir));
|
|
23895
|
+
for (const patch of patches) {
|
|
23896
|
+
const hashes = [patch.content_hash];
|
|
23897
|
+
if (patch.original_commit) {
|
|
23898
|
+
const materialized = await detector.materializeCommitPatch(patch.original_commit);
|
|
23899
|
+
if (materialized.status === "ok" && !hashes.includes(materialized.contentHash)) {
|
|
23900
|
+
hashes.push(materialized.contentHash);
|
|
23901
|
+
}
|
|
23902
|
+
}
|
|
23903
|
+
lockManager.addDismissal({
|
|
23904
|
+
patch_id: patch.id,
|
|
23905
|
+
original_commit: patch.original_commit,
|
|
23906
|
+
original_message: patch.original_message,
|
|
23907
|
+
content_hashes: hashes,
|
|
23908
|
+
dismissed_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
23909
|
+
via: "forget"
|
|
23910
|
+
});
|
|
23911
|
+
}
|
|
23912
|
+
}
|
|
23913
|
+
async function forget(outputDir, options) {
|
|
23764
23914
|
const lockManager = new LockfileManager(outputDir);
|
|
23765
23915
|
if (!lockManager.exists()) {
|
|
23766
23916
|
return { ...EMPTY_RESULT };
|
|
@@ -23771,9 +23921,7 @@ function forget(outputDir, options) {
|
|
|
23771
23921
|
const removed = lock.patches.map(toMatchedPatch);
|
|
23772
23922
|
const warnings = buildWarnings(lock.patches);
|
|
23773
23923
|
if (!options.dryRun) {
|
|
23774
|
-
|
|
23775
|
-
lockManager.addForgottenHash(patch.content_hash);
|
|
23776
|
-
}
|
|
23924
|
+
await dismissPatches(outputDir, lockManager, lock.patches);
|
|
23777
23925
|
lockManager.clearPatches();
|
|
23778
23926
|
lockManager.save();
|
|
23779
23927
|
}
|
|
@@ -23802,8 +23950,8 @@ function forget(outputDir, options) {
|
|
|
23802
23950
|
}
|
|
23803
23951
|
const warnings = buildWarnings(patchesToRemove);
|
|
23804
23952
|
if (!options.dryRun) {
|
|
23953
|
+
await dismissPatches(outputDir, lockManager, patchesToRemove);
|
|
23805
23954
|
for (const patch of patchesToRemove) {
|
|
23806
|
-
lockManager.addForgottenHash(patch.content_hash);
|
|
23807
23955
|
lockManager.removePatch(patch.id);
|
|
23808
23956
|
}
|
|
23809
23957
|
lockManager.save();
|
|
@@ -23855,7 +24003,7 @@ function reset(outputDir, options) {
|
|
|
23855
24003
|
const lock = lockManager.read();
|
|
23856
24004
|
const patchCount = lock.patches.length;
|
|
23857
24005
|
if (!options?.dryRun) {
|
|
23858
|
-
(0,
|
|
24006
|
+
(0, import_fs11.unlinkSync)(lockManager.lockfilePath);
|
|
23859
24007
|
}
|
|
23860
24008
|
return {
|
|
23861
24009
|
success: true,
|
|
@@ -23903,15 +24051,16 @@ async function resolve7(outputDir, options) {
|
|
|
23903
24051
|
const patchesToCommit = [...resolvingPatches, ...unresolvedPatches];
|
|
23904
24052
|
if (patchesToCommit.length > 0) {
|
|
23905
24053
|
const currentGen = lock.current_generation;
|
|
23906
|
-
const detector = new ReplayDetector(git, lockManager, outputDir);
|
|
24054
|
+
const detector = new ReplayDetector(git, lockManager, outputDir, readFernignorePatterns(outputDir));
|
|
23907
24055
|
const warnings = [];
|
|
24056
|
+
const patchesDismissed = [];
|
|
23908
24057
|
let patchesResolved = 0;
|
|
23909
24058
|
const pass1 = [];
|
|
23910
24059
|
for (const patch of patchesToCommit) {
|
|
23911
24060
|
const result = await computePerPatchDiffWithFallback(
|
|
23912
24061
|
patch,
|
|
23913
24062
|
(f) => git.showFile(currentGen, f),
|
|
23914
|
-
(f) => (0, import_promises9.readFile)((0,
|
|
24063
|
+
(f) => (0, import_promises9.readFile)((0, import_path18.join)(outputDir, f), "utf-8").catch(() => null),
|
|
23915
24064
|
(files) => git.exec(["diff", currentGen, "--", ...files]).catch(() => null)
|
|
23916
24065
|
);
|
|
23917
24066
|
if (result === null) {
|
|
@@ -23945,7 +24094,27 @@ async function resolve7(outputDir, options) {
|
|
|
23945
24094
|
const r2 = pass1[i2];
|
|
23946
24095
|
if (r2.kind === "skip") continue;
|
|
23947
24096
|
if (r2.kind === "revert") {
|
|
24097
|
+
const hashes = [patch.content_hash];
|
|
24098
|
+
if (patch.original_commit) {
|
|
24099
|
+
const materialized = await detector.materializeCommitPatch(patch.original_commit);
|
|
24100
|
+
if (materialized.status === "ok" && !hashes.includes(materialized.contentHash)) {
|
|
24101
|
+
hashes.push(materialized.contentHash);
|
|
24102
|
+
} else if (materialized.status === "unreachable") {
|
|
24103
|
+
warnings.push(
|
|
24104
|
+
`Patch ${patch.id}: original commit ${patch.original_commit.slice(0, 7)} is unreachable; dismissed using the stored content hash only. If this commit reappears in history, the customization may be re-detected once.`
|
|
24105
|
+
);
|
|
24106
|
+
}
|
|
24107
|
+
}
|
|
24108
|
+
lockManager.addDismissal({
|
|
24109
|
+
patch_id: patch.id,
|
|
24110
|
+
original_commit: patch.original_commit,
|
|
24111
|
+
original_message: patch.original_message,
|
|
24112
|
+
content_hashes: hashes,
|
|
24113
|
+
dismissed_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
24114
|
+
via: "resolve"
|
|
24115
|
+
});
|
|
23948
24116
|
lockManager.removePatch(patch.id);
|
|
24117
|
+
patchesDismissed.push({ id: patch.id, message: patch.original_message });
|
|
23949
24118
|
continue;
|
|
23950
24119
|
}
|
|
23951
24120
|
if (lastIndexByHash.get(r2.hash) !== i2) {
|
|
@@ -23967,7 +24136,7 @@ async function resolve7(outputDir, options) {
|
|
|
23967
24136
|
const theirsSnapshot = {};
|
|
23968
24137
|
for (const file of filesForSnapshot) {
|
|
23969
24138
|
if (isBinaryFile(file)) continue;
|
|
23970
|
-
const content = await (0, import_promises9.readFile)((0,
|
|
24139
|
+
const content = await (0, import_promises9.readFile)((0, import_path18.join)(outputDir, file), "utf-8").catch(() => null);
|
|
23971
24140
|
if (content != null) {
|
|
23972
24141
|
theirsSnapshot[file] = content;
|
|
23973
24142
|
}
|
|
@@ -23994,6 +24163,7 @@ async function resolve7(outputDir, options) {
|
|
|
23994
24163
|
commitSha: commitSha2,
|
|
23995
24164
|
phase: "committed",
|
|
23996
24165
|
patchesResolved,
|
|
24166
|
+
patchesDismissed: patchesDismissed.length > 0 ? patchesDismissed : void 0,
|
|
23997
24167
|
warnings: warnings.length > 0 ? warnings : void 0
|
|
23998
24168
|
};
|
|
23999
24169
|
}
|
|
@@ -24039,7 +24209,9 @@ function status(outputDir) {
|
|
|
24039
24209
|
lastGeneration: void 0,
|
|
24040
24210
|
patches: [],
|
|
24041
24211
|
unresolvedCount: 0,
|
|
24042
|
-
excludePatterns: []
|
|
24212
|
+
excludePatterns: [],
|
|
24213
|
+
dismissed: [],
|
|
24214
|
+
legacyDismissedCount: 0
|
|
24043
24215
|
};
|
|
24044
24216
|
}
|
|
24045
24217
|
const lock = lockManager.read();
|
|
@@ -24068,18 +24240,29 @@ function status(outputDir) {
|
|
|
24068
24240
|
}
|
|
24069
24241
|
const config = lockManager.getCustomizationsConfig();
|
|
24070
24242
|
const excludePatterns = config.exclude ?? [];
|
|
24243
|
+
const dismissals = lock.dismissals ?? [];
|
|
24244
|
+
const dismissed = dismissals.map((d) => ({
|
|
24245
|
+
message: d.original_message,
|
|
24246
|
+
sha: d.original_commit.slice(0, 7),
|
|
24247
|
+
via: d.via,
|
|
24248
|
+
dismissedAt: d.dismissed_at
|
|
24249
|
+
}));
|
|
24250
|
+
const coveredHashes = new Set(dismissals.flatMap((d) => d.content_hashes));
|
|
24251
|
+
const legacyDismissedCount = (lock.forgotten_hashes ?? []).filter((h2) => !coveredHashes.has(h2)).length;
|
|
24071
24252
|
return {
|
|
24072
24253
|
initialized: true,
|
|
24073
24254
|
generationCount: lock.generations.length,
|
|
24074
24255
|
lastGeneration,
|
|
24075
24256
|
patches,
|
|
24076
24257
|
unresolvedCount,
|
|
24077
|
-
excludePatterns
|
|
24258
|
+
excludePatterns,
|
|
24259
|
+
dismissed,
|
|
24260
|
+
legacyDismissedCount
|
|
24078
24261
|
};
|
|
24079
24262
|
}
|
|
24080
|
-
var import_promises3, import_os, import_path7, import_fs6, import_path8, import_yaml, import_crypto, import_path9, import_promises4, import_os2, import_path10, import_promises5, import_path11, import_promises6, import_path12, import_fs7, import_promises7, import_path13, import_promises8, import_os3,
|
|
24263
|
+
var import_promises3, import_os, import_path7, import_fs6, import_path8, import_yaml, import_crypto, import_path9, import_promises4, import_os2, import_path10, import_promises5, import_path11, import_promises6, import_path12, import_fs7, import_promises7, import_path13, import_fs8, import_path14, import_promises8, import_os3, import_path15, import_child_process3, import_crypto2, import_fs9, import_path16, import_yaml2, import_crypto3, import_fs10, import_path17, import_fs11, import_promises9, import_path18, __defProp3, __getOwnPropNames3, __esm3, __export3, GitClient_exports, GitClient, init_GitClient, HybridReconstruction_exports, init_HybridReconstruction, PatchApplyTheirs_exports, init_PatchApplyTheirs, CREDENTIAL_PATTERNS, SENSITIVE_FILE_PATTERNS, FERN_BOT_NAME, FERN_BOT_EMAIL, FERN_BOT_LOGIN, FERN_SUPPORT_NAMES, LOCKFILE_HEADER, LockfileNotFoundError, LockfileManager, BINARY_EXTENSIONS, INFRASTRUCTURE_FILES, ReplayDetector, MergeAccumulator, CONFLICT_OPENER, CONFLICT_SEPARATOR, CONFLICT_CLOSER, ReplayApplicator, ReplayCommitter, FileOwnership, FirstGenerationFlow, SkipApplicationFlow, NoPatchesFlow, NormalRegenerationFlow, ReplayService, FernignoreMigrator, REPLAY_FERNIGNORE_ENTRIES, GITATTRIBUTES_ENTRIES, EMPTY_RESULT;
|
|
24081
24264
|
var init_dist3 = __esm({
|
|
24082
|
-
"../../node_modules/.pnpm/@fern-api+replay@0.
|
|
24265
|
+
"../../node_modules/.pnpm/@fern-api+replay@0.19.0/node_modules/@fern-api/replay/dist/index.js"() {
|
|
24083
24266
|
"use strict";
|
|
24084
24267
|
init_esm4();
|
|
24085
24268
|
import_promises3 = require("fs/promises");
|
|
@@ -24105,23 +24288,25 @@ var init_dist3 = __esm({
|
|
|
24105
24288
|
import_promises7 = require("fs/promises");
|
|
24106
24289
|
import_path13 = require("path");
|
|
24107
24290
|
init_esm3();
|
|
24291
|
+
import_fs8 = require("fs");
|
|
24292
|
+
import_path14 = require("path");
|
|
24108
24293
|
import_promises8 = require("fs/promises");
|
|
24109
24294
|
import_os3 = require("os");
|
|
24110
|
-
|
|
24295
|
+
import_path15 = require("path");
|
|
24111
24296
|
import_child_process3 = require("child_process");
|
|
24112
24297
|
init_esm3();
|
|
24113
24298
|
import_crypto2 = require("crypto");
|
|
24114
|
-
import_fs8 = require("fs");
|
|
24115
|
-
import_path15 = require("path");
|
|
24116
|
-
init_esm3();
|
|
24117
|
-
import_yaml2 = __toESM(require_dist3(), 1);
|
|
24118
|
-
import_crypto3 = require("crypto");
|
|
24119
24299
|
import_fs9 = require("fs");
|
|
24120
24300
|
import_path16 = require("path");
|
|
24121
24301
|
init_esm3();
|
|
24302
|
+
import_yaml2 = __toESM(require_dist3(), 1);
|
|
24303
|
+
import_crypto3 = require("crypto");
|
|
24122
24304
|
import_fs10 = require("fs");
|
|
24123
|
-
import_promises9 = require("fs/promises");
|
|
24124
24305
|
import_path17 = require("path");
|
|
24306
|
+
init_esm3();
|
|
24307
|
+
import_fs11 = require("fs");
|
|
24308
|
+
import_promises9 = require("fs/promises");
|
|
24309
|
+
import_path18 = require("path");
|
|
24125
24310
|
__defProp3 = Object.defineProperty;
|
|
24126
24311
|
__getOwnPropNames3 = Object.getOwnPropertyNames;
|
|
24127
24312
|
__esm3 = (fn, res) => function __init() {
|
|
@@ -24471,6 +24656,22 @@ var init_dist3 = __esm({
|
|
|
24471
24656
|
this.lock.forgotten_hashes.push(hash);
|
|
24472
24657
|
}
|
|
24473
24658
|
}
|
|
24659
|
+
/**
|
|
24660
|
+
* Record a dismissed customization: visibility metadata in `dismissals`
|
|
24661
|
+
* plus a tombstone in `forgotten_hashes` for every content hash.
|
|
24662
|
+
* `forgotten_hashes` stays the only list the detector consults; the
|
|
24663
|
+
* metadata exists so `status` can show what was dismissed.
|
|
24664
|
+
*/
|
|
24665
|
+
addDismissal(record2) {
|
|
24666
|
+
this.ensureLoaded();
|
|
24667
|
+
if (!this.lock.dismissals) {
|
|
24668
|
+
this.lock.dismissals = [];
|
|
24669
|
+
}
|
|
24670
|
+
this.lock.dismissals.push(record2);
|
|
24671
|
+
for (const hash of record2.content_hashes) {
|
|
24672
|
+
this.addForgottenHash(hash);
|
|
24673
|
+
}
|
|
24674
|
+
}
|
|
24474
24675
|
getUnresolvedPatches() {
|
|
24475
24676
|
this.ensureLoaded();
|
|
24476
24677
|
return this.lock.patches.filter((p2) => p2.status === "unresolved");
|
|
@@ -24580,6 +24781,15 @@ var init_dist3 = __esm({
|
|
|
24580
24781
|
sdkOutputDir;
|
|
24581
24782
|
fernignorePatterns;
|
|
24582
24783
|
warnings = [];
|
|
24784
|
+
/**
|
|
24785
|
+
* Structured degraded-state channel, mirroring `warnings`. Populated when
|
|
24786
|
+
* detection cannot guarantee customizations were carried forward (baseline
|
|
24787
|
+
* unreachable in this clone). Cleared per-run by `ReplayService.prepareReplay`
|
|
24788
|
+
* alongside `warnings`. Merged into `ReplayReport.degradedReasons` by each
|
|
24789
|
+
* flow handler. Degraded is observability only: detection results are
|
|
24790
|
+
* unchanged.
|
|
24791
|
+
*/
|
|
24792
|
+
degradedReasons = [];
|
|
24583
24793
|
constructor(git, lockManager, sdkOutputDir, fernignorePatterns = []) {
|
|
24584
24794
|
this.git = git;
|
|
24585
24795
|
this.lockManager = lockManager;
|
|
@@ -24650,6 +24860,10 @@ var init_dist3 = __esm({
|
|
|
24650
24860
|
this.warnings.push(
|
|
24651
24861
|
`No generation boundary found in git history and the lockfile's recorded generation (${lock.current_generation.slice(0, 7)}) matches no entry in its generation records. Customer customizations may differ from the last known generation and could be lost on the next regeneration. Run \`fern-replay bootstrap --force\` to re-initialize tracking.`
|
|
24652
24862
|
);
|
|
24863
|
+
this.degradedReasons.push({
|
|
24864
|
+
code: "baseline-unresolvable",
|
|
24865
|
+
message: `The previous generation recorded in the lockfile (${lock.current_generation.slice(0, 7)}) could not be resolved to any reachable baseline during this run. Customizations may not have been carried forward \u2014 review the result before merging.`
|
|
24866
|
+
});
|
|
24653
24867
|
}
|
|
24654
24868
|
return { patches: [], revertedPatchIds: [] };
|
|
24655
24869
|
}
|
|
@@ -24658,6 +24872,12 @@ var init_dist3 = __esm({
|
|
|
24658
24872
|
this.warnings.push(
|
|
24659
24873
|
`Generation commit ${lastGen.commit_sha.slice(0, 7)} not found in git history. Falling back to tree-diff detection (likely a shallow clone).`
|
|
24660
24874
|
);
|
|
24875
|
+
if (lock.patches.length > 0) {
|
|
24876
|
+
this.degradedReasons.push({
|
|
24877
|
+
code: "generation-anchor-unreachable",
|
|
24878
|
+
message: `The previous generation (${lastGen.commit_sha.slice(0, 7)}) was not reachable during this run, and ${lock.patches.length} tracked customization(s) could not be verified against it. Customizations may not have been carried forward \u2014 review the result before merging.`
|
|
24879
|
+
});
|
|
24880
|
+
}
|
|
24661
24881
|
return this.detectPatchesViaTreeDiff(
|
|
24662
24882
|
lastGen,
|
|
24663
24883
|
/* commitKnownMissing */
|
|
@@ -24697,54 +24917,27 @@ var init_dist3 = __esm({
|
|
|
24697
24917
|
if (lock.patches.find((p2) => p2.original_commit === commit.sha)) {
|
|
24698
24918
|
continue;
|
|
24699
24919
|
}
|
|
24700
|
-
const
|
|
24701
|
-
|
|
24702
|
-
try {
|
|
24703
|
-
filesOutput = await this.git.exec(["diff-tree", "--no-commit-id", "--name-only", "-r", commit.sha]);
|
|
24704
|
-
} catch {
|
|
24920
|
+
const materialized = await this.materializeCommitPatch(commit.sha);
|
|
24921
|
+
if (materialized.sensitiveFiles.length > 0) {
|
|
24705
24922
|
this.warnings.push(
|
|
24706
|
-
`
|
|
24923
|
+
`Sensitive file(s) excluded from patch for commit ${commit.sha.slice(0, 7)}: ${materialized.sensitiveFiles.join(", ")}. These files will not be tracked by replay.`
|
|
24707
24924
|
);
|
|
24708
|
-
continue;
|
|
24709
24925
|
}
|
|
24710
|
-
|
|
24711
|
-
filesOutput,
|
|
24712
|
-
this.fernignorePatterns
|
|
24713
|
-
);
|
|
24714
|
-
if (sensitiveFiles.length > 0) {
|
|
24926
|
+
if (materialized.fernignoredFiles.length > 0) {
|
|
24715
24927
|
this.warnings.push(
|
|
24716
|
-
|
|
24928
|
+
`.fernignore-protected file(s) excluded from patch for commit ${commit.sha.slice(0, 7)}: ${materialized.fernignoredFiles.join(", ")}. These files are managed by .fernignore, not Replay.`
|
|
24717
24929
|
);
|
|
24718
24930
|
}
|
|
24719
|
-
if (
|
|
24931
|
+
if (materialized.status === "unreachable") {
|
|
24720
24932
|
this.warnings.push(
|
|
24721
|
-
|
|
24933
|
+
`Could not generate patch for commit ${commit.sha.slice(0, 7)} \u2014 it may be unreachable in a shallow clone. Skipping.`
|
|
24722
24934
|
);
|
|
24723
|
-
}
|
|
24724
|
-
if (files.length === 0) {
|
|
24725
24935
|
continue;
|
|
24726
24936
|
}
|
|
24727
|
-
|
|
24728
|
-
|
|
24729
|
-
let patchContent;
|
|
24730
|
-
if (wasFiltered && parentSha) {
|
|
24731
|
-
try {
|
|
24732
|
-
patchContent = await this.git.exec(["diff", parentSha, commit.sha, "--", ...files]);
|
|
24733
|
-
} catch {
|
|
24734
|
-
continue;
|
|
24735
|
-
}
|
|
24736
|
-
if (!patchContent.trim()) continue;
|
|
24737
|
-
} else {
|
|
24738
|
-
try {
|
|
24739
|
-
patchContent = await this.git.formatPatch(commit.sha);
|
|
24740
|
-
} catch {
|
|
24741
|
-
this.warnings.push(
|
|
24742
|
-
`Could not generate patch for commit ${commit.sha.slice(0, 7)} \u2014 it may be unreachable in a shallow clone. Skipping.`
|
|
24743
|
-
);
|
|
24744
|
-
continue;
|
|
24745
|
-
}
|
|
24937
|
+
if (materialized.status === "empty") {
|
|
24938
|
+
continue;
|
|
24746
24939
|
}
|
|
24747
|
-
const contentHash =
|
|
24940
|
+
const { files, patchContent, contentHash } = materialized;
|
|
24748
24941
|
if (lock.patches.find((p2) => p2.content_hash === contentHash) || forgottenHashes.has(contentHash)) {
|
|
24749
24942
|
continue;
|
|
24750
24943
|
}
|
|
@@ -24821,6 +25014,63 @@ var init_dist3 = __esm({
|
|
|
24821
25014
|
const filteredPatches = survivingPatches.filter((_2, i2) => !revertIndicesToRemove.has(i2));
|
|
24822
25015
|
return { patches: filteredPatches, revertedPatchIds: [...revertedPatchIdSet] };
|
|
24823
25016
|
}
|
|
25017
|
+
/**
|
|
25018
|
+
* Materialize a commit into patch content exactly as detection does.
|
|
25019
|
+
*
|
|
25020
|
+
* Pipeline: `diff-tree --name-only` → filter infrastructure / sensitive /
|
|
25021
|
+
* `.fernignore`d files → scoped `git diff` when files were stripped,
|
|
25022
|
+
* otherwise full `git format-patch` → content hash.
|
|
25023
|
+
*
|
|
25024
|
+
* This is THE definition of a commit's re-emission identity: the content
|
|
25025
|
+
* hash this method returns is what `detectPatchesInRange` will compute if
|
|
25026
|
+
* the commit re-enters the scan range (e.g. after a regen PR is merged
|
|
25027
|
+
* with a merge commit). Callers that tombstone a dismissed patch must use
|
|
25028
|
+
* this hash — the stored `content_hash` drifts every time the patch is
|
|
25029
|
+
* carried forward, so it does not identify the commit on re-detection.
|
|
25030
|
+
*
|
|
25031
|
+
* Never throws; failures are reported through the `status` discriminant.
|
|
25032
|
+
*/
|
|
25033
|
+
async materializeCommitPatch(sha) {
|
|
25034
|
+
let parents;
|
|
25035
|
+
let filesOutput;
|
|
25036
|
+
try {
|
|
25037
|
+
parents = await this.git.getCommitParents(sha);
|
|
25038
|
+
filesOutput = await this.git.exec(["diff-tree", "--no-commit-id", "--name-only", "-r", sha]);
|
|
25039
|
+
} catch {
|
|
25040
|
+
return { status: "unreachable", sensitiveFiles: [], fernignoredFiles: [] };
|
|
25041
|
+
}
|
|
25042
|
+
const { files, sensitiveFiles, fernignoredFiles, infrastructureFiles } = filterInfrastructureAndSensitiveFiles(filesOutput, this.fernignorePatterns);
|
|
25043
|
+
if (files.length === 0) {
|
|
25044
|
+
return { status: "empty", sensitiveFiles, fernignoredFiles };
|
|
25045
|
+
}
|
|
25046
|
+
const wasFiltered = sensitiveFiles.length > 0 || fernignoredFiles.length > 0 || infrastructureFiles.length > 0;
|
|
25047
|
+
const parentSha = parents[0];
|
|
25048
|
+
let patchContent;
|
|
25049
|
+
if (wasFiltered && parentSha) {
|
|
25050
|
+
try {
|
|
25051
|
+
patchContent = await this.git.exec(["diff", parentSha, sha, "--", ...files]);
|
|
25052
|
+
} catch {
|
|
25053
|
+
return { status: "empty", sensitiveFiles, fernignoredFiles };
|
|
25054
|
+
}
|
|
25055
|
+
if (!patchContent.trim()) {
|
|
25056
|
+
return { status: "empty", sensitiveFiles, fernignoredFiles };
|
|
25057
|
+
}
|
|
25058
|
+
} else {
|
|
25059
|
+
try {
|
|
25060
|
+
patchContent = await this.git.formatPatch(sha);
|
|
25061
|
+
} catch {
|
|
25062
|
+
return { status: "unreachable", sensitiveFiles, fernignoredFiles };
|
|
25063
|
+
}
|
|
25064
|
+
}
|
|
25065
|
+
return {
|
|
25066
|
+
status: "ok",
|
|
25067
|
+
files,
|
|
25068
|
+
sensitiveFiles,
|
|
25069
|
+
fernignoredFiles,
|
|
25070
|
+
patchContent,
|
|
25071
|
+
contentHash: this.computeContentHash(patchContent)
|
|
25072
|
+
};
|
|
25073
|
+
}
|
|
24824
25074
|
/**
|
|
24825
25075
|
* Compute content hash for deduplication.
|
|
24826
25076
|
*
|
|
@@ -24925,6 +25175,13 @@ var init_dist3 = __esm({
|
|
|
24925
25175
|
async detectPatchesViaTreeDiff(lastGen, commitKnownMissing) {
|
|
24926
25176
|
const diffBase = await this.resolveDiffBase(lastGen, commitKnownMissing);
|
|
24927
25177
|
if (!diffBase) {
|
|
25178
|
+
this.warnings.push(
|
|
25179
|
+
`Neither the previous generation's commit (${lastGen.commit_sha.slice(0, 7)}) nor its recorded tree was reachable during this run. Falling back to a bounded commit scan, which cannot see customizations older than the clone window. Widen the clone window (e.g. \`git fetch --unshallow\`) and re-run replay to verify customizations were carried forward.`
|
|
25180
|
+
);
|
|
25181
|
+
this.degradedReasons.push({
|
|
25182
|
+
code: "generation-tree-unreachable",
|
|
25183
|
+
message: `The previous generation (${lastGen.commit_sha.slice(0, 7)}) was not reachable during this run \u2014 neither its commit nor its recorded tree. Customizations may not have been carried forward \u2014 review the result before merging, or widen the clone window and re-run replay.`
|
|
25184
|
+
});
|
|
24928
25185
|
return this.detectPatchesViaCommitScan();
|
|
24929
25186
|
}
|
|
24930
25187
|
const lockForGuard = this.lockManager.read();
|
|
@@ -25037,10 +25294,7 @@ var init_dist3 = __esm({
|
|
|
25037
25294
|
continue;
|
|
25038
25295
|
}
|
|
25039
25296
|
const filesOutput = await this.git.exec(["diff-tree", "--no-commit-id", "--name-only", "-r", commit.sha]);
|
|
25040
|
-
const { files, sensitiveFiles, fernignoredFiles } = filterInfrastructureAndSensitiveFiles(
|
|
25041
|
-
filesOutput,
|
|
25042
|
-
this.fernignorePatterns
|
|
25043
|
-
);
|
|
25297
|
+
const { files, sensitiveFiles, fernignoredFiles, infrastructureFiles } = filterInfrastructureAndSensitiveFiles(filesOutput, this.fernignorePatterns);
|
|
25044
25298
|
if (sensitiveFiles.length > 0) {
|
|
25045
25299
|
this.warnings.push(
|
|
25046
25300
|
`Sensitive file(s) excluded from patch for commit ${commit.sha.slice(0, 7)}: ${sensitiveFiles.join(", ")}. These files will not be tracked by replay.`
|
|
@@ -25051,7 +25305,8 @@ var init_dist3 = __esm({
|
|
|
25051
25305
|
`.fernignore-protected file(s) excluded from patch for commit ${commit.sha.slice(0, 7)}: ${fernignoredFiles.join(", ")}. These files are managed by .fernignore, not Replay.`
|
|
25052
25306
|
);
|
|
25053
25307
|
}
|
|
25054
|
-
|
|
25308
|
+
const wasFiltered = sensitiveFiles.length > 0 || fernignoredFiles.length > 0 || infrastructureFiles.length > 0;
|
|
25309
|
+
if (wasFiltered && files.length > 0) {
|
|
25055
25310
|
if (parents.length === 0) {
|
|
25056
25311
|
continue;
|
|
25057
25312
|
}
|
|
@@ -25869,6 +26124,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
25869
26124
|
patchesToApply: [],
|
|
25870
26125
|
newPatchIds: /* @__PURE__ */ new Set(),
|
|
25871
26126
|
detectorWarnings: [],
|
|
26127
|
+
detectorDegraded: [],
|
|
25872
26128
|
revertedCount: 0,
|
|
25873
26129
|
genSha: genRecord.commit_sha,
|
|
25874
26130
|
optionsSnapshot: options
|
|
@@ -25916,6 +26172,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
25916
26172
|
patchesToApply: [],
|
|
25917
26173
|
newPatchIds: /* @__PURE__ */ new Set(),
|
|
25918
26174
|
detectorWarnings: [],
|
|
26175
|
+
detectorDegraded: [],
|
|
25919
26176
|
revertedCount: 0,
|
|
25920
26177
|
genSha: genRecord.commit_sha,
|
|
25921
26178
|
optionsSnapshot: options
|
|
@@ -25951,8 +26208,10 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
25951
26208
|
const previousGenerationSha = preLock.current_generation ?? null;
|
|
25952
26209
|
let { patches: newPatches, revertedPatchIds } = await this.service.detector.detectNewPatches();
|
|
25953
26210
|
const detectorWarnings = [...this.service.detector.warnings];
|
|
26211
|
+
const detectorDegraded = [...this.service.detector.degradedReasons];
|
|
25954
26212
|
if (options?.dryRun) {
|
|
25955
26213
|
const dryRunWarnings = [...detectorWarnings, ...this.service.warnings];
|
|
26214
|
+
const dryRunDegraded = dedupeDegradedReasons([...detectorDegraded, ...this.service.degradedReasons]);
|
|
25956
26215
|
const preparedReport = {
|
|
25957
26216
|
flow: "no-patches",
|
|
25958
26217
|
patchesDetected: newPatches.length,
|
|
@@ -25962,7 +26221,9 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
25962
26221
|
patchesReverted: revertedPatchIds.length,
|
|
25963
26222
|
conflicts: [],
|
|
25964
26223
|
wouldApply: newPatches,
|
|
25965
|
-
warnings: dryRunWarnings.length > 0 ? dryRunWarnings : void 0
|
|
26224
|
+
warnings: dryRunWarnings.length > 0 ? dryRunWarnings : void 0,
|
|
26225
|
+
degraded: dryRunDegraded.length > 0 ? true : void 0,
|
|
26226
|
+
degradedReasons: dryRunDegraded.length > 0 ? dryRunDegraded : void 0
|
|
25966
26227
|
};
|
|
25967
26228
|
const headSha = await this.service.git.exec(["rev-parse", "HEAD"]).then((s) => s.trim()).catch(() => "");
|
|
25968
26229
|
return {
|
|
@@ -26016,6 +26277,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26016
26277
|
patchesToApply: newPatches,
|
|
26017
26278
|
newPatchIds: new Set(newPatches.map((p2) => p2.id)),
|
|
26018
26279
|
detectorWarnings,
|
|
26280
|
+
detectorDegraded,
|
|
26019
26281
|
revertedCount: revertedPatchIds.length,
|
|
26020
26282
|
genSha: genRecord.commit_sha,
|
|
26021
26283
|
optionsSnapshot: options
|
|
@@ -26059,6 +26321,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26059
26321
|
}
|
|
26060
26322
|
}
|
|
26061
26323
|
const warnings = [...detectorWarnings, ...this.service.warnings];
|
|
26324
|
+
const degradedReasons = [...prep._prepared.detectorDegraded, ...this.service.degradedReasons];
|
|
26062
26325
|
return this.service.buildReport(
|
|
26063
26326
|
"no-patches",
|
|
26064
26327
|
newPatches,
|
|
@@ -26067,7 +26330,8 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26067
26330
|
warnings,
|
|
26068
26331
|
rebaseCounts,
|
|
26069
26332
|
void 0,
|
|
26070
|
-
prep._prepared.revertedCount
|
|
26333
|
+
prep._prepared.revertedCount,
|
|
26334
|
+
degradedReasons
|
|
26071
26335
|
);
|
|
26072
26336
|
}
|
|
26073
26337
|
};
|
|
@@ -26082,6 +26346,10 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26082
26346
|
const existingPatches2 = this.service.lockManager.getPatches();
|
|
26083
26347
|
const { patches: newPatches2, revertedPatchIds: dryRunReverted } = await this.service.detector.detectNewPatches();
|
|
26084
26348
|
const warnings = [...this.service.detector.warnings, ...this.service.warnings];
|
|
26349
|
+
const dryRunDegraded = dedupeDegradedReasons([
|
|
26350
|
+
...this.service.detector.degradedReasons,
|
|
26351
|
+
...this.service.degradedReasons
|
|
26352
|
+
]);
|
|
26085
26353
|
const allPatches2 = [...existingPatches2, ...newPatches2];
|
|
26086
26354
|
const preparedReport = {
|
|
26087
26355
|
flow: "normal-regeneration",
|
|
@@ -26092,7 +26360,9 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26092
26360
|
patchesReverted: dryRunReverted.length,
|
|
26093
26361
|
conflicts: [],
|
|
26094
26362
|
wouldApply: allPatches2,
|
|
26095
|
-
warnings: warnings.length > 0 ? warnings : void 0
|
|
26363
|
+
warnings: warnings.length > 0 ? warnings : void 0,
|
|
26364
|
+
degraded: dryRunDegraded.length > 0 ? true : void 0,
|
|
26365
|
+
degradedReasons: dryRunDegraded.length > 0 ? dryRunDegraded : void 0
|
|
26096
26366
|
};
|
|
26097
26367
|
const headSha = await this.service.git.exec(["rev-parse", "HEAD"]).then((s) => s.trim()).catch(() => "");
|
|
26098
26368
|
return {
|
|
@@ -26131,6 +26401,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26131
26401
|
existingPatches = this.service.lockManager.getPatches();
|
|
26132
26402
|
let { patches: newPatches, revertedPatchIds } = await this.service.detector.detectNewPatches();
|
|
26133
26403
|
const detectorWarnings = [...this.service.detector.warnings];
|
|
26404
|
+
const detectorDegraded = [...this.service.detector.degradedReasons];
|
|
26134
26405
|
if (removedByPreRebase.length > 0) {
|
|
26135
26406
|
const removedOriginalCommits = new Set(removedByPreRebase.map((p2) => p2.original_commit));
|
|
26136
26407
|
const removedOriginalMessages = new Set(removedByPreRebase.map((p2) => p2.original_message));
|
|
@@ -26171,6 +26442,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26171
26442
|
newPatchIds: new Set(newPatches.map((p2) => p2.id)),
|
|
26172
26443
|
preRebaseCounts,
|
|
26173
26444
|
detectorWarnings,
|
|
26445
|
+
detectorDegraded,
|
|
26174
26446
|
revertedCount: revertedPatchIds.length,
|
|
26175
26447
|
genSha: genRecord.commit_sha,
|
|
26176
26448
|
optionsSnapshot: options
|
|
@@ -26219,6 +26491,7 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26219
26491
|
await this.service.committer.commitReplay(appliedCount, allPatches, void 0, { buckets });
|
|
26220
26492
|
}
|
|
26221
26493
|
const warnings = [...detectorWarnings, ...this.service.warnings];
|
|
26494
|
+
const degradedReasons = [...prep._prepared.detectorDegraded, ...this.service.degradedReasons];
|
|
26222
26495
|
return this.service.buildReport(
|
|
26223
26496
|
"normal-regeneration",
|
|
26224
26497
|
allPatches,
|
|
@@ -26227,7 +26500,8 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26227
26500
|
warnings,
|
|
26228
26501
|
rebaseCounts,
|
|
26229
26502
|
prep._prepared.preRebaseCounts,
|
|
26230
|
-
prep._prepared.revertedCount
|
|
26503
|
+
prep._prepared.revertedCount,
|
|
26504
|
+
degradedReasons
|
|
26231
26505
|
);
|
|
26232
26506
|
}
|
|
26233
26507
|
};
|
|
@@ -26258,6 +26532,16 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26258
26532
|
* @internal Used by Flow implementations in `src/flows/`.
|
|
26259
26533
|
*/
|
|
26260
26534
|
warnings = [];
|
|
26535
|
+
/**
|
|
26536
|
+
* Service-level structured degraded reasons, mirroring `warnings`.
|
|
26537
|
+
* Populated at apply time (e.g. `recordUnreachableBaseWarnings` when a
|
|
26538
|
+
* patch's base-generation tree is unreachable). Merged with
|
|
26539
|
+
* `detector.degradedReasons` into `ReplayReport.degradedReasons` by each
|
|
26540
|
+
* flow handler. Cleared at the top of `prepareReplay()`.
|
|
26541
|
+
*
|
|
26542
|
+
* @internal Used by Flow implementations in `src/flows/`.
|
|
26543
|
+
*/
|
|
26544
|
+
degradedReasons = [];
|
|
26261
26545
|
/**
|
|
26262
26546
|
* @internal Test-only accessor.
|
|
26263
26547
|
* Returns the ReplayApplicator instance used for the last run. Tests use this
|
|
@@ -26301,7 +26585,10 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26301
26585
|
async prepareReplay(options) {
|
|
26302
26586
|
this.warnings = [];
|
|
26303
26587
|
this.detector.warnings.length = 0;
|
|
26588
|
+
this.degradedReasons = [];
|
|
26589
|
+
this.detector.degradedReasons.length = 0;
|
|
26304
26590
|
this.cleanseLegacyFernignoreEntries();
|
|
26591
|
+
this.cleanseInfrastructureFileEntries();
|
|
26305
26592
|
return this.selectFlow(options).prepare(options);
|
|
26306
26593
|
}
|
|
26307
26594
|
/**
|
|
@@ -26355,6 +26642,50 @@ Patches absorbed by generator (${buckets.absorbed.length}):`;
|
|
|
26355
26642
|
this.lockManager.save();
|
|
26356
26643
|
}
|
|
26357
26644
|
}
|
|
26645
|
+
/**
|
|
26646
|
+
* Migration step: strips infrastructure file diffs (`.fernignore`, `.fern/*`)
|
|
26647
|
+
* from existing patches' `patch_content`. These diffs were bundled by older
|
|
26648
|
+
* detection logic that did not scope `git diff` when only infrastructure files
|
|
26649
|
+
* were stripped. Patches that end up with no surviving diff sections are
|
|
26650
|
+
* removed entirely.
|
|
26651
|
+
*
|
|
26652
|
+
* Idempotent: a second run is a no-op because the first run already removed
|
|
26653
|
+
* all infrastructure sections. Per-patch try/catch ensures isolation.
|
|
26654
|
+
*/
|
|
26655
|
+
cleanseInfrastructureFileEntries() {
|
|
26656
|
+
if (!this.lockManager.exists()) return;
|
|
26657
|
+
this.lockManager.read();
|
|
26658
|
+
let lockfileMutated = false;
|
|
26659
|
+
const patches = this.lockManager.getPatches();
|
|
26660
|
+
for (const patch of patches) {
|
|
26661
|
+
try {
|
|
26662
|
+
const result = computeInfrastructureFileCleanse(
|
|
26663
|
+
patch,
|
|
26664
|
+
(content) => this.detector.computeContentHash(content)
|
|
26665
|
+
);
|
|
26666
|
+
if (result.unchanged) continue;
|
|
26667
|
+
if (result.remove) {
|
|
26668
|
+
this.lockManager.removePatch(patch.id);
|
|
26669
|
+
this.warnings.push(
|
|
26670
|
+
`Stripped infrastructure file diffs from patch ${patch.id}: patch contained only infrastructure file changes (${result.strippedPaths.join(", ")}) \u2014 removed.`
|
|
26671
|
+
);
|
|
26672
|
+
} else {
|
|
26673
|
+
this.lockManager.updatePatch(patch.id, {
|
|
26674
|
+
patch_content: result.patch_content,
|
|
26675
|
+
content_hash: result.content_hash
|
|
26676
|
+
});
|
|
26677
|
+
this.warnings.push(
|
|
26678
|
+
`Stripped infrastructure file diffs from patch ${patch.id}: removed bundled diffs for ${result.strippedPaths.join(", ")}.`
|
|
26679
|
+
);
|
|
26680
|
+
}
|
|
26681
|
+
lockfileMutated = true;
|
|
26682
|
+
} catch {
|
|
26683
|
+
}
|
|
26684
|
+
}
|
|
26685
|
+
if (lockfileMutated) {
|
|
26686
|
+
this.lockManager.save();
|
|
26687
|
+
}
|
|
26688
|
+
}
|
|
26358
26689
|
/**
|
|
26359
26690
|
* Phase 2 of the two-phase replay flow. Applies patches, rebases them against
|
|
26360
26691
|
* the generation, saves the lockfile, and commits `[fern-replay]` (or stages
|
|
@@ -27127,6 +27458,12 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
|
|
|
27127
27458
|
);
|
|
27128
27459
|
}
|
|
27129
27460
|
}
|
|
27461
|
+
if (warned.size > 0) {
|
|
27462
|
+
this.degradedReasons.push({
|
|
27463
|
+
code: "patch-base-unreachable",
|
|
27464
|
+
message: `${warned.size} customization file(s) could not be checked against the generation they were made on because that generation's tree was not reachable during this run. Customizations may not have been carried forward \u2014 review the result before merging, or widen the clone window and re-run replay.`
|
|
27465
|
+
});
|
|
27466
|
+
}
|
|
27130
27467
|
}
|
|
27131
27468
|
/**
|
|
27132
27469
|
* After applyPatches(), strip conflict markers from conflicting files
|
|
@@ -27170,12 +27507,11 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
|
|
|
27170
27507
|
}
|
|
27171
27508
|
/** @internal Used by Flow implementations in `src/flows/`. */
|
|
27172
27509
|
readFernignorePatterns() {
|
|
27173
|
-
|
|
27174
|
-
if (!(0, import_fs7.existsSync)(fernignorePath)) return [];
|
|
27175
|
-
return (0, import_fs7.readFileSync)(fernignorePath, "utf-8").split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
27510
|
+
return readFernignorePatterns(this.outputDir);
|
|
27176
27511
|
}
|
|
27177
27512
|
/** @internal Used by Flow implementations in `src/flows/`. */
|
|
27178
|
-
buildReport(flow, patches, results, options, warnings, rebaseCounts, preRebaseCounts, patchesReverted) {
|
|
27513
|
+
buildReport(flow, patches, results, options, warnings, rebaseCounts, preRebaseCounts, patchesReverted, degradedReasons) {
|
|
27514
|
+
const degraded = dedupeDegradedReasons(degradedReasons ?? []);
|
|
27179
27515
|
const conflictResults = results.filter((r2) => r2.status === "conflict");
|
|
27180
27516
|
const conflictDetails = conflictResults.map((r2) => {
|
|
27181
27517
|
const conflictFiles = r2.fileResults?.filter((f) => f.status === "conflict") ?? [];
|
|
@@ -27215,7 +27551,9 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
|
|
|
27215
27551
|
conflictDetails: r2.fileResults?.filter((f) => f.status === "conflict") ?? []
|
|
27216
27552
|
})) : void 0,
|
|
27217
27553
|
wouldApply: options?.dryRun ? patches : void 0,
|
|
27218
|
-
warnings: warnings && warnings.length > 0 ? warnings : void 0
|
|
27554
|
+
warnings: warnings && warnings.length > 0 ? warnings : void 0,
|
|
27555
|
+
degraded: degraded.length > 0 ? true : void 0,
|
|
27556
|
+
degradedReasons: degraded.length > 0 ? degraded : void 0
|
|
27219
27557
|
};
|
|
27220
27558
|
}
|
|
27221
27559
|
};
|
|
@@ -27229,14 +27567,14 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
|
|
|
27229
27567
|
this.outputDir = outputDir;
|
|
27230
27568
|
}
|
|
27231
27569
|
fernignoreExists() {
|
|
27232
|
-
return (0,
|
|
27570
|
+
return (0, import_fs9.existsSync)((0, import_path16.join)(this.outputDir, ".fernignore"));
|
|
27233
27571
|
}
|
|
27234
27572
|
readFernignorePatterns() {
|
|
27235
|
-
const fernignorePath = (0,
|
|
27236
|
-
if (!(0,
|
|
27573
|
+
const fernignorePath = (0, import_path16.join)(this.outputDir, ".fernignore");
|
|
27574
|
+
if (!(0, import_fs9.existsSync)(fernignorePath)) {
|
|
27237
27575
|
return [];
|
|
27238
27576
|
}
|
|
27239
|
-
const content = (0,
|
|
27577
|
+
const content = (0, import_fs9.readFileSync)(fernignorePath, "utf-8");
|
|
27240
27578
|
return content.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
27241
27579
|
}
|
|
27242
27580
|
/** Analyze .fernignore patterns vs git history. Creates synthetic patches for files differing from pristine generation. */
|
|
@@ -27341,16 +27679,16 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
|
|
|
27341
27679
|
return results;
|
|
27342
27680
|
}
|
|
27343
27681
|
readFileContent(filePath) {
|
|
27344
|
-
const fullPath = (0,
|
|
27345
|
-
if (!(0,
|
|
27682
|
+
const fullPath = (0, import_path16.join)(this.outputDir, filePath);
|
|
27683
|
+
if (!(0, import_fs9.existsSync)(fullPath)) {
|
|
27346
27684
|
return null;
|
|
27347
27685
|
}
|
|
27348
27686
|
try {
|
|
27349
|
-
const stat2 = (0,
|
|
27687
|
+
const stat2 = (0, import_fs9.statSync)(fullPath);
|
|
27350
27688
|
if (stat2.isDirectory()) {
|
|
27351
27689
|
return null;
|
|
27352
27690
|
}
|
|
27353
|
-
return (0,
|
|
27691
|
+
return (0, import_fs9.readFileSync)(fullPath, "utf-8");
|
|
27354
27692
|
} catch {
|
|
27355
27693
|
return null;
|
|
27356
27694
|
}
|
|
@@ -27406,25 +27744,26 @@ If you want to keep these lines, restore them in a follow-up commit and re-run r
|
|
|
27406
27744
|
};
|
|
27407
27745
|
}
|
|
27408
27746
|
movePatternsToReplayYml(patterns) {
|
|
27409
|
-
const replayYmlPath = (0,
|
|
27747
|
+
const replayYmlPath = (0, import_path16.join)(this.outputDir, ".fern", "replay.yml");
|
|
27410
27748
|
let config = {};
|
|
27411
|
-
if ((0,
|
|
27412
|
-
const content = (0,
|
|
27749
|
+
if ((0, import_fs9.existsSync)(replayYmlPath)) {
|
|
27750
|
+
const content = (0, import_fs9.readFileSync)(replayYmlPath, "utf-8");
|
|
27413
27751
|
config = (0, import_yaml2.parse)(content) ?? {};
|
|
27414
27752
|
}
|
|
27415
27753
|
const existing = config.exclude ?? [];
|
|
27416
27754
|
const merged = [.../* @__PURE__ */ new Set([...existing, ...patterns])];
|
|
27417
27755
|
config.exclude = merged;
|
|
27418
|
-
const dir = (0,
|
|
27419
|
-
if (!(0,
|
|
27420
|
-
(0,
|
|
27756
|
+
const dir = (0, import_path16.dirname)(replayYmlPath);
|
|
27757
|
+
if (!(0, import_fs9.existsSync)(dir)) {
|
|
27758
|
+
(0, import_fs9.mkdirSync)(dir, { recursive: true });
|
|
27421
27759
|
}
|
|
27422
|
-
(0,
|
|
27760
|
+
(0, import_fs9.writeFileSync)(replayYmlPath, (0, import_yaml2.stringify)(config, { lineWidth: 0 }), "utf-8");
|
|
27423
27761
|
}
|
|
27424
27762
|
};
|
|
27425
27763
|
init_GitClient();
|
|
27426
27764
|
REPLAY_FERNIGNORE_ENTRIES = [".fern/replay.lock", ".fern/replay.yml", ".gitattributes"];
|
|
27427
27765
|
GITATTRIBUTES_ENTRIES = [".fern/replay.lock linguist-generated=true"];
|
|
27766
|
+
init_GitClient();
|
|
27428
27767
|
EMPTY_RESULT = {
|
|
27429
27768
|
initialized: false,
|
|
27430
27769
|
removed: [],
|
|
@@ -30020,9 +30359,9 @@ function resolve(...paths) {
|
|
|
30020
30359
|
}
|
|
30021
30360
|
|
|
30022
30361
|
// src/cli.ts
|
|
30023
|
-
var
|
|
30362
|
+
var import_fs17 = __toESM(require("fs"));
|
|
30024
30363
|
var import_promises18 = require("fs/promises");
|
|
30025
|
-
var
|
|
30364
|
+
var import_path26 = __toESM(require("path"));
|
|
30026
30365
|
|
|
30027
30366
|
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/yerror.js
|
|
30028
30367
|
var YError = class _YError extends Error {
|
|
@@ -39744,23 +40083,23 @@ async function githubPush(params) {
|
|
|
39744
40083
|
|
|
39745
40084
|
// src/replay/replay-forget.ts
|
|
39746
40085
|
init_dist3();
|
|
39747
|
-
function replayForget(params) {
|
|
40086
|
+
async function replayForget(params) {
|
|
39748
40087
|
return forget(params.outputDir, params.options);
|
|
39749
40088
|
}
|
|
39750
40089
|
|
|
39751
40090
|
// src/replay/replay-init.ts
|
|
39752
40091
|
init_dist3();
|
|
39753
|
-
var
|
|
39754
|
-
var
|
|
40092
|
+
var import_fs12 = require("fs");
|
|
40093
|
+
var import_path20 = require("path");
|
|
39755
40094
|
var import_tmp_promise2 = __toESM(require_tmp_promise());
|
|
39756
40095
|
|
|
39757
40096
|
// src/replay/fernignore.ts
|
|
39758
40097
|
var import_promises10 = require("fs/promises");
|
|
39759
|
-
var
|
|
40098
|
+
var import_path19 = require("path");
|
|
39760
40099
|
var REPLAY_FERNIGNORE_ENTRIES2 = [".fern/replay.lock", ".fern/replay.yml", ".gitattributes"];
|
|
39761
40100
|
var GITATTRIBUTES_ENTRIES2 = [".fern/replay.lock linguist-generated=true"];
|
|
39762
40101
|
async function ensureReplayFernignoreEntries(outputDir) {
|
|
39763
|
-
const fernignorePath = (0,
|
|
40102
|
+
const fernignorePath = (0, import_path19.join)(outputDir, ".fernignore");
|
|
39764
40103
|
let content = "";
|
|
39765
40104
|
try {
|
|
39766
40105
|
content = await (0, import_promises10.readFile)(fernignorePath, "utf-8");
|
|
@@ -39776,7 +40115,7 @@ async function ensureReplayFernignoreEntries(outputDir) {
|
|
|
39776
40115
|
return false;
|
|
39777
40116
|
}
|
|
39778
40117
|
async function ensureGitattributesEntries2(outputDir) {
|
|
39779
|
-
const gitattributesPath = (0,
|
|
40118
|
+
const gitattributesPath = (0, import_path19.join)(outputDir, ".gitattributes");
|
|
39780
40119
|
let content = "";
|
|
39781
40120
|
try {
|
|
39782
40121
|
content = await (0, import_promises10.readFile)(gitattributesPath, "utf-8");
|
|
@@ -39813,8 +40152,8 @@ async function replayInit(params) {
|
|
|
39813
40152
|
if (dryRun) {
|
|
39814
40153
|
return { bootstrap: bootstrapResult, fernignoreEntries: [], gitattributesEntries: [] };
|
|
39815
40154
|
}
|
|
39816
|
-
const lockfilePath = (0,
|
|
39817
|
-
const lockfileContent = (0,
|
|
40155
|
+
const lockfilePath = (0, import_path20.join)(repoPath, ".fern", "replay.lock");
|
|
40156
|
+
const lockfileContent = (0, import_fs12.existsSync)(lockfilePath) ? (0, import_fs12.readFileSync)(lockfilePath, "utf-8") : void 0;
|
|
39818
40157
|
return {
|
|
39819
40158
|
bootstrap: bootstrapResult,
|
|
39820
40159
|
lockfileContent,
|
|
@@ -39934,14 +40273,14 @@ init_dist3();
|
|
|
39934
40273
|
|
|
39935
40274
|
// src/replay/replay-run.ts
|
|
39936
40275
|
init_dist3();
|
|
39937
|
-
var
|
|
39938
|
-
var
|
|
40276
|
+
var import_fs13 = require("fs");
|
|
40277
|
+
var import_path21 = require("path");
|
|
39939
40278
|
async function replayPrepare(params, state) {
|
|
39940
40279
|
const { outputDir, cliVersion, generatorVersions, stageOnly = false, skipApplication, logger } = params;
|
|
39941
|
-
const lockfilePath = (0,
|
|
40280
|
+
const lockfilePath = (0, import_path21.join)(outputDir, ".fern", "replay.lock");
|
|
39942
40281
|
let autoBootstrapped = false;
|
|
39943
40282
|
let bootstrapAttempted = false;
|
|
39944
|
-
if (!(0,
|
|
40283
|
+
if (!(0, import_fs13.existsSync)(lockfilePath)) {
|
|
39945
40284
|
if (process.env.FERN_DISABLE_AUTO_BOOTSTRAP === "true" || process.env.FERN_DISABLE_AUTO_BOOTSTRAP === "1") {
|
|
39946
40285
|
return null;
|
|
39947
40286
|
}
|
|
@@ -39962,8 +40301,8 @@ async function replayPrepare(params, state) {
|
|
|
39962
40301
|
} catch (error) {
|
|
39963
40302
|
logger?.warn("Replay auto-bootstrap failed, continuing without replay: " + String(error));
|
|
39964
40303
|
try {
|
|
39965
|
-
if ((0,
|
|
39966
|
-
(0,
|
|
40304
|
+
if ((0, import_fs13.existsSync)(lockfilePath)) {
|
|
40305
|
+
(0, import_fs13.unlinkSync)(lockfilePath);
|
|
39967
40306
|
}
|
|
39968
40307
|
} catch {
|
|
39969
40308
|
}
|
|
@@ -40058,7 +40397,7 @@ var ReplayPrepareError = class extends Error {
|
|
|
40058
40397
|
if (Error.captureStackTrace) {
|
|
40059
40398
|
Error.captureStackTrace(this, this.constructor);
|
|
40060
40399
|
}
|
|
40061
|
-
this.name =
|
|
40400
|
+
this.name = "ReplayPrepareError";
|
|
40062
40401
|
this.reason = reason;
|
|
40063
40402
|
}
|
|
40064
40403
|
};
|
|
@@ -40118,9 +40457,9 @@ var FERN_BOT_LOGIN2 = "fern-api[bot]";
|
|
|
40118
40457
|
|
|
40119
40458
|
// src/pipeline/steps/AutoVersionStep.ts
|
|
40120
40459
|
var import_child_process4 = require("child_process");
|
|
40121
|
-
var
|
|
40460
|
+
var import_fs15 = require("fs");
|
|
40122
40461
|
var import_promises15 = require("fs/promises");
|
|
40123
|
-
var
|
|
40462
|
+
var import_path23 = require("path");
|
|
40124
40463
|
|
|
40125
40464
|
// ../commons/logging-execa/lib/loggingExeca.js
|
|
40126
40465
|
var import_execa = __toESM(require_execa(), 1);
|
|
@@ -40187,7 +40526,7 @@ var CliError = class _CliError extends Error {
|
|
|
40187
40526
|
if (Error.captureStackTrace) {
|
|
40188
40527
|
Error.captureStackTrace(this, this.constructor);
|
|
40189
40528
|
}
|
|
40190
|
-
this.name =
|
|
40529
|
+
this.name = "CliError";
|
|
40191
40530
|
this.code = code;
|
|
40192
40531
|
this.docsLink = docsLink;
|
|
40193
40532
|
}
|
|
@@ -40304,9 +40643,9 @@ function createLogger4(log) {
|
|
|
40304
40643
|
}
|
|
40305
40644
|
|
|
40306
40645
|
// src/autoversion/AutoVersioningService.ts
|
|
40307
|
-
var
|
|
40646
|
+
var import_fs14 = require("fs");
|
|
40308
40647
|
var import_promises14 = require("fs/promises");
|
|
40309
|
-
var
|
|
40648
|
+
var import_path22 = require("path");
|
|
40310
40649
|
var import_semver = __toESM(require_semver2());
|
|
40311
40650
|
var AutoVersioningException = class extends Error {
|
|
40312
40651
|
/**
|
|
@@ -41000,8 +41339,8 @@ var AutoVersioningService = class _AutoVersioningService {
|
|
|
41000
41339
|
);
|
|
41001
41340
|
return;
|
|
41002
41341
|
}
|
|
41003
|
-
const goModPath = (0,
|
|
41004
|
-
if (!(0,
|
|
41342
|
+
const goModPath = (0, import_path22.join)(workingDirectory, "go.mod");
|
|
41343
|
+
if (!(0, import_fs14.existsSync)(goModPath)) {
|
|
41005
41344
|
this.logger.debug(`No go.mod found in ${workingDirectory}, skipping Go module path update`);
|
|
41006
41345
|
return;
|
|
41007
41346
|
}
|
|
@@ -41070,7 +41409,7 @@ var AutoVersioningService = class _AutoVersioningService {
|
|
|
41070
41409
|
const results = [];
|
|
41071
41410
|
const entries2 = await (0, import_promises14.readdir)(dir);
|
|
41072
41411
|
for (const entry of entries2) {
|
|
41073
|
-
const fullPath = (0,
|
|
41412
|
+
const fullPath = (0, import_path22.join)(dir, entry);
|
|
41074
41413
|
const entryStat = await (0, import_promises14.stat)(fullPath);
|
|
41075
41414
|
if (entryStat.isDirectory()) {
|
|
41076
41415
|
if (entry === ".git" || entry === "vendor") {
|
|
@@ -41088,7 +41427,7 @@ var AutoVersioningService = class _AutoVersioningService {
|
|
|
41088
41427
|
* Adds a version suffix to import paths in all .go files in the repository.
|
|
41089
41428
|
*/
|
|
41090
41429
|
async addSuffixToGoFiles(repoRoot, modulePath, suffix) {
|
|
41091
|
-
const goFiles = await this.walkDirectory(repoRoot, (filePath) => (0,
|
|
41430
|
+
const goFiles = await this.walkDirectory(repoRoot, (filePath) => (0, import_path22.extname)(filePath) === ".go");
|
|
41092
41431
|
for (const filePath of goFiles) {
|
|
41093
41432
|
await this.addSuffixToGoFile(filePath, modulePath, suffix);
|
|
41094
41433
|
}
|
|
@@ -41763,7 +42102,7 @@ ${body}` : `${COMMIT_MARKER} ${subject}`;
|
|
|
41763
42102
|
}
|
|
41764
42103
|
async prependChangelogEntry(params) {
|
|
41765
42104
|
const { version: version2, entry } = params;
|
|
41766
|
-
const changelogPath = (0,
|
|
42105
|
+
const changelogPath = (0, import_path23.join)(this.outputDir, "changelog.md");
|
|
41767
42106
|
const now = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
41768
42107
|
const header = `## [${version2}] - ${now}
|
|
41769
42108
|
`;
|
|
@@ -41771,7 +42110,7 @@ ${body}` : `${COMMIT_MARKER} ${subject}`;
|
|
|
41771
42110
|
|
|
41772
42111
|
`;
|
|
41773
42112
|
let existing = "";
|
|
41774
|
-
if ((0,
|
|
42113
|
+
if ((0, import_fs15.existsSync)(changelogPath)) {
|
|
41775
42114
|
existing = await (0, import_promises15.readFile)(changelogPath, "utf-8");
|
|
41776
42115
|
}
|
|
41777
42116
|
let output;
|
|
@@ -42064,7 +42403,7 @@ function tryRevParse(cwd2, rev) {
|
|
|
42064
42403
|
|
|
42065
42404
|
// src/pipeline/steps/GithubStep.ts
|
|
42066
42405
|
var import_promises16 = require("fs/promises");
|
|
42067
|
-
var
|
|
42406
|
+
var import_path24 = require("path");
|
|
42068
42407
|
|
|
42069
42408
|
// src/pipeline/github/createReplayBranch.ts
|
|
42070
42409
|
async function createReplayBranch(repository, branchName, commitMessage, replayConflictInfo, logger) {
|
|
@@ -42226,16 +42565,14 @@ async function pushSignedCommit({
|
|
|
42226
42565
|
await repository.pushObjectToRef(localHeadSha, tempRef);
|
|
42227
42566
|
tempRefPushed = true;
|
|
42228
42567
|
for (let attempt2 = 0; attempt2 < MAX_CONCURRENT_PUSH_RETRIES; attempt2++) {
|
|
42229
|
-
const
|
|
42230
|
-
const committerField = author != null ? { committer: author } : {};
|
|
42568
|
+
const identityFields = author != null ? { author, committer: author } : {};
|
|
42231
42569
|
const { data: signedCommit } = await octokit.git.createCommit({
|
|
42232
42570
|
owner,
|
|
42233
42571
|
repo,
|
|
42234
42572
|
message,
|
|
42235
42573
|
tree: treeSha,
|
|
42236
42574
|
parents,
|
|
42237
|
-
|
|
42238
|
-
...committerField
|
|
42575
|
+
...identityFields
|
|
42239
42576
|
});
|
|
42240
42577
|
const signedSha = signedCommit.sha;
|
|
42241
42578
|
try {
|
|
@@ -42769,7 +43106,7 @@ var GithubStep = class extends BaseStep {
|
|
|
42769
43106
|
}
|
|
42770
43107
|
async ensureFernignore() {
|
|
42771
43108
|
this.logger.debug("Checking for .fernignore file...");
|
|
42772
|
-
const fernignorePath = (0,
|
|
43109
|
+
const fernignorePath = (0, import_path24.join)(this.outputDir, ".fernignore");
|
|
42773
43110
|
try {
|
|
42774
43111
|
await (0, import_promises16.access)(fernignorePath);
|
|
42775
43112
|
this.logger.debug(".fernignore already exists");
|
|
@@ -43017,9 +43354,10 @@ ${stderr}`);
|
|
|
43017
43354
|
throw e;
|
|
43018
43355
|
}
|
|
43019
43356
|
}
|
|
43020
|
-
async function execInContainer({ logger, containerId, command, runner, writeLogsToFile = true, reject = true }) {
|
|
43357
|
+
async function execInContainer({ logger, containerId, command, runner, envVars = {}, writeLogsToFile = true, reject = true }) {
|
|
43021
43358
|
const containerRunner = runner ?? "docker";
|
|
43022
|
-
const
|
|
43359
|
+
const envArgs = Object.entries(envVars).flatMap(([key, value]) => ["-e", `${key}=${value}`]);
|
|
43360
|
+
const { stdout, stderr, exitCode } = await loggingExeca(logger, containerRunner, ["exec", "--user", "root", ...envArgs, containerId, ...command], {
|
|
43023
43361
|
reject: false,
|
|
43024
43362
|
all: true,
|
|
43025
43363
|
doNotPipeOutput: true
|
|
@@ -43059,8 +43397,8 @@ async function stopContainer({ logger, containerId, runner }) {
|
|
|
43059
43397
|
}
|
|
43060
43398
|
|
|
43061
43399
|
// src/pipeline/steps/VerificationStep.ts
|
|
43062
|
-
var
|
|
43063
|
-
var
|
|
43400
|
+
var import_fs16 = require("fs");
|
|
43401
|
+
var import_path25 = require("path");
|
|
43064
43402
|
var CONTAINER_WORKSPACE_PATH = "/workspace";
|
|
43065
43403
|
var VERIFY_SCRIPT_RELATIVE_PATH = ".fern/verify.sh";
|
|
43066
43404
|
var VERIFY_SCRIPT_CONTAINER_PATH = `${CONTAINER_WORKSPACE_PATH}/${VERIFY_SCRIPT_RELATIVE_PATH}`;
|
|
@@ -43076,8 +43414,8 @@ var VerificationStep = class extends BaseStep {
|
|
|
43076
43414
|
generatorVersions;
|
|
43077
43415
|
name = "verify";
|
|
43078
43416
|
async execute(_context) {
|
|
43079
|
-
const verifyScriptHostPath = (0,
|
|
43080
|
-
if (!(0,
|
|
43417
|
+
const verifyScriptHostPath = (0, import_path25.join)(this.outputDir, VERIFY_SCRIPT_RELATIVE_PATH);
|
|
43418
|
+
if (!(0, import_fs16.existsSync)(verifyScriptHostPath)) {
|
|
43081
43419
|
return { executed: true, success: true, skipped: true };
|
|
43082
43420
|
}
|
|
43083
43421
|
const validatorImage = this.deriveValidatorImage();
|
|
@@ -43718,28 +44056,28 @@ Bootstrap complete! Lockfile saved to ${outputDir}/.fern/replay.lock
|
|
|
43718
44056
|
description: "Search pattern (file path, glob, or commit message substring)"
|
|
43719
44057
|
});
|
|
43720
44058
|
},
|
|
43721
|
-
(argv) => {
|
|
44059
|
+
async (argv) => {
|
|
43722
44060
|
try {
|
|
43723
44061
|
const outputDir = resolve(cwd(), ".");
|
|
43724
44062
|
const args = argv.args ?? [];
|
|
43725
44063
|
const dryRun = argv["dry-run"];
|
|
43726
44064
|
let result;
|
|
43727
44065
|
if (argv.all) {
|
|
43728
|
-
result = replayForget({ outputDir, options: { all: true, dryRun } });
|
|
44066
|
+
result = await replayForget({ outputDir, options: { all: true, dryRun } });
|
|
43729
44067
|
} else if (argv.pattern) {
|
|
43730
|
-
result = replayForget({ outputDir, options: { pattern: argv.pattern, dryRun } });
|
|
44068
|
+
result = await replayForget({ outputDir, options: { pattern: argv.pattern, dryRun } });
|
|
43731
44069
|
} else if (args.length > 0) {
|
|
43732
44070
|
const allPatchIds = args.every((a) => a.startsWith("patch-"));
|
|
43733
44071
|
if (allPatchIds) {
|
|
43734
|
-
result = replayForget({ outputDir, options: { patchIds: args, dryRun } });
|
|
44072
|
+
result = await replayForget({ outputDir, options: { patchIds: args, dryRun } });
|
|
43735
44073
|
} else {
|
|
43736
|
-
result = replayForget({
|
|
44074
|
+
result = await replayForget({
|
|
43737
44075
|
outputDir,
|
|
43738
44076
|
options: { pattern: args[0], dryRun }
|
|
43739
44077
|
});
|
|
43740
44078
|
}
|
|
43741
44079
|
} else {
|
|
43742
|
-
result = replayForget({ outputDir, options: { dryRun } });
|
|
44080
|
+
result = await replayForget({ outputDir, options: { dryRun } });
|
|
43743
44081
|
}
|
|
43744
44082
|
process.stdout.write(JSON.stringify(result, null, 2) + "\n");
|
|
43745
44083
|
process.exit(0);
|
|
@@ -43767,9 +44105,9 @@ async function createWriteStream(outputPath) {
|
|
|
43767
44105
|
}
|
|
43768
44106
|
async function createWriteStreamFromFile(filepath) {
|
|
43769
44107
|
if (!await doesPathExist(filepath)) {
|
|
43770
|
-
await (0, import_promises18.mkdir)(
|
|
44108
|
+
await (0, import_promises18.mkdir)(import_path26.default.dirname(filepath), { recursive: true });
|
|
43771
44109
|
}
|
|
43772
|
-
return
|
|
44110
|
+
return import_fs17.default.createWriteStream(filepath);
|
|
43773
44111
|
}
|
|
43774
44112
|
/*! Bundled license information:
|
|
43775
44113
|
|