@reelout/core 0.5.0 → 0.5.2
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/README.md +35 -0
- package/dist/analyzer.js +2 -3
- package/dist/builder.js +3 -4
- package/dist/changelog.js +3 -4
- package/dist/{formatError-BXNdyRfu.js → formatError-BMsun8Wi.js} +2 -3
- package/dist/{formatError-BXNdyRfu.js.map → formatError-BMsun8Wi.js.map} +1 -1
- package/dist/index.js +11 -20
- package/dist/index.js.map +1 -1
- package/dist/{workflow-CroJ6v4g.js → workflow-9iNWXQsA.js} +98 -184
- package/dist/workflow-9iNWXQsA.js.map +1 -0
- package/package.json +8 -8
- package/src/workflow/analysis/deriveTransitionReleases.ts +7 -10
- package/dist/workflow-CroJ6v4g.js.map +0 -1
|
@@ -14,7 +14,7 @@ import assert from "node:assert";
|
|
|
14
14
|
import createPreset from "conventional-changelog-conventionalcommits";
|
|
15
15
|
import { writeChangelogString } from "conventional-changelog-writer";
|
|
16
16
|
import { toMarkdown } from "mdast-util-to-markdown";
|
|
17
|
-
|
|
17
|
+
// src/workflow/versioning/extractVersionQualifier.ts
|
|
18
18
|
/**
|
|
19
19
|
* Extract the version qualifier string from a parsed `SemVer` instance.
|
|
20
20
|
*
|
|
@@ -31,8 +31,7 @@ function extractVersionQualifier(version) {
|
|
|
31
31
|
return prerelease.join(".");
|
|
32
32
|
} else return;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
//#region src/workflow/versioning/bumpVersion.ts
|
|
34
|
+
// src/workflow/versioning/bumpVersion.ts
|
|
36
35
|
/**
|
|
37
36
|
* Bump a semantic version string based on release and transition rules.
|
|
38
37
|
*
|
|
@@ -66,8 +65,7 @@ function bumpVersion(options) {
|
|
|
66
65
|
}
|
|
67
66
|
return semver.inc(parsed, release, { loose: false }, identifier, "0");
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
//#region src/workflow/versioning/determineReleaseType.ts
|
|
68
|
+
// src/workflow/versioning/determineReleaseType.ts
|
|
71
69
|
/**
|
|
72
70
|
* Determine the release type for a single commit.
|
|
73
71
|
*
|
|
@@ -89,8 +87,7 @@ function determineReleaseType(classifier, commit) {
|
|
|
89
87
|
}
|
|
90
88
|
return null;
|
|
91
89
|
}
|
|
92
|
-
|
|
93
|
-
//#region src/workflow/versioning/pickPriorityReleaseType.ts
|
|
90
|
+
// src/workflow/versioning/pickPriorityReleaseType.ts
|
|
94
91
|
/**
|
|
95
92
|
* Determine the highest-priority release type between two candidates.
|
|
96
93
|
*
|
|
@@ -109,8 +106,7 @@ function pickPriorityReleaseType(curr, next) {
|
|
|
109
106
|
]) if (curr === type || next === type) return type;
|
|
110
107
|
return null;
|
|
111
108
|
}
|
|
112
|
-
|
|
113
|
-
//#region src/workflow/versioning/deriveReleaseType.ts
|
|
109
|
+
// src/workflow/versioning/deriveReleaseType.ts
|
|
114
110
|
/**
|
|
115
111
|
* Derive the combined release type from a commit history collection.
|
|
116
112
|
*
|
|
@@ -127,8 +123,7 @@ function deriveReleaseType(classifier, history) {
|
|
|
127
123
|
for (const commit of history) releaseType = pickPriorityReleaseType(releaseType, determineReleaseType(classifier, commit));
|
|
128
124
|
return releaseType;
|
|
129
125
|
}
|
|
130
|
-
|
|
131
|
-
//#region src/workflow/versioning/isSameReleaseCycle.ts
|
|
126
|
+
// src/workflow/versioning/isSameReleaseCycle.ts
|
|
132
127
|
/**
|
|
133
128
|
* Determine whether two semantic version strings or objects belong to the same release cycle.
|
|
134
129
|
*
|
|
@@ -148,8 +143,7 @@ function isSameReleaseCycle(currentVersion, nextVersion) {
|
|
|
148
143
|
if (current.compareMain(next) === 0) return true;
|
|
149
144
|
return current.major === 0 && (current.minor > 0 || current.patch > 0) && next.major === 1 && next.minor === 0 && next.patch === 0;
|
|
150
145
|
}
|
|
151
|
-
|
|
152
|
-
//#region src/workflow/versioning/isStableVersion.ts
|
|
146
|
+
// src/workflow/versioning/isStableVersion.ts
|
|
153
147
|
/**
|
|
154
148
|
* Determine whether a version string represents a stable SemVer release.
|
|
155
149
|
*
|
|
@@ -169,8 +163,7 @@ function isStableVersion(version) {
|
|
|
169
163
|
if (!parsed) throw new Error(`The version "${colors.bold(version)}" is not a valid SemVer.`);
|
|
170
164
|
return parsed.major > 0 && parsed.prerelease.length === 0;
|
|
171
165
|
}
|
|
172
|
-
|
|
173
|
-
//#region src/config/const.ts
|
|
166
|
+
// src/config/const.ts
|
|
174
167
|
var ALL_FILES = "**/*";
|
|
175
168
|
var DEFAULT_CHANGELOG_FILE = "CHANGELOG.md";
|
|
176
169
|
var GIT_TRAILER_RELEASE_AGENT = "Release-Agent";
|
|
@@ -235,8 +228,7 @@ var RELEASE_HOOK_NAMES = [
|
|
|
235
228
|
"publish",
|
|
236
229
|
"finalize"
|
|
237
230
|
];
|
|
238
|
-
|
|
239
|
-
//#region src/util/buildTrailerPattern.ts
|
|
231
|
+
// src/util/buildTrailerPattern.ts
|
|
240
232
|
/**
|
|
241
233
|
* Build a regular expression to match trailer lines using custom markers.
|
|
242
234
|
*
|
|
@@ -249,8 +241,7 @@ var RELEASE_HOOK_NAMES = [
|
|
|
249
241
|
function buildTrailerPattern(markers = []) {
|
|
250
242
|
return new RegExp(`^(${markers.map(RegExp.escape).concat("[A-Za-z0-9_-]+").join("|")})[ \\t]*:[ \\t]*(.*)$`);
|
|
251
243
|
}
|
|
252
|
-
|
|
253
|
-
//#region src/util/isDefined.ts
|
|
244
|
+
// src/util/isDefined.ts
|
|
254
245
|
/**
|
|
255
246
|
* Type guard that asserts a value is neither `null` nor `undefined`.
|
|
256
247
|
*
|
|
@@ -260,8 +251,7 @@ function buildTrailerPattern(markers = []) {
|
|
|
260
251
|
function isDefined(value) {
|
|
261
252
|
return value != null;
|
|
262
253
|
}
|
|
263
|
-
|
|
264
|
-
//#region src/util/compact.ts
|
|
254
|
+
// src/util/compact.ts
|
|
265
255
|
/**
|
|
266
256
|
* Remove `null` and `undefined` values from an array.
|
|
267
257
|
*
|
|
@@ -271,8 +261,7 @@ function isDefined(value) {
|
|
|
271
261
|
function compact(array) {
|
|
272
262
|
return array.filter(isDefined);
|
|
273
263
|
}
|
|
274
|
-
|
|
275
|
-
//#region src/util/execCommand.ts
|
|
264
|
+
// src/util/execCommand.ts
|
|
276
265
|
/**
|
|
277
266
|
* Execute a system command with arguments as a child process.
|
|
278
267
|
*
|
|
@@ -377,8 +366,7 @@ function quoteCommandForMessage(command) {
|
|
|
377
366
|
if (!command.includes("\"")) return `"${command}"`;
|
|
378
367
|
return JSON.stringify(command);
|
|
379
368
|
}
|
|
380
|
-
|
|
381
|
-
//#region src/util/execGit.ts
|
|
369
|
+
// src/util/execGit.ts
|
|
382
370
|
/**
|
|
383
371
|
* Execute a Git command inside a target directory.
|
|
384
372
|
*
|
|
@@ -396,8 +384,7 @@ function execGit(cwd, args, options) {
|
|
|
396
384
|
cwd
|
|
397
385
|
});
|
|
398
386
|
}
|
|
399
|
-
|
|
400
|
-
//#region src/util/formatFile.ts
|
|
387
|
+
// src/util/formatFile.ts
|
|
401
388
|
/**
|
|
402
389
|
* Format `content` for `filePath` using Prettier when possible.
|
|
403
390
|
*
|
|
@@ -422,8 +409,7 @@ async function formatFile(filePath, content) {
|
|
|
422
409
|
return content;
|
|
423
410
|
}
|
|
424
411
|
}
|
|
425
|
-
|
|
426
|
-
//#region src/util/interpolate.ts
|
|
412
|
+
// src/util/interpolate.ts
|
|
427
413
|
var BACKSLASH = "\\";
|
|
428
414
|
var LEFT_BRACE = "{";
|
|
429
415
|
var RIGHT_BRACE = "}";
|
|
@@ -522,8 +508,7 @@ function interpolate(template, data) {
|
|
|
522
508
|
}
|
|
523
509
|
return result;
|
|
524
510
|
}
|
|
525
|
-
|
|
526
|
-
//#region src/util/isClass.ts
|
|
511
|
+
// src/util/isClass.ts
|
|
527
512
|
/**
|
|
528
513
|
* Determine whether a given value is a constructible class.
|
|
529
514
|
*
|
|
@@ -545,8 +530,7 @@ function isClass(func) {
|
|
|
545
530
|
if (!descriptor || descriptor.writable) return false;
|
|
546
531
|
return /^class\s/.test(Function.prototype.toString.call(func));
|
|
547
532
|
}
|
|
548
|
-
|
|
549
|
-
//#region src/util/isMatch.ts
|
|
533
|
+
// src/util/isMatch.ts
|
|
550
534
|
/**
|
|
551
535
|
* Determine whether a target string matches glob patterns.
|
|
552
536
|
*
|
|
@@ -568,8 +552,7 @@ function isMatch(target, patterns) {
|
|
|
568
552
|
else positives.push(pattern);
|
|
569
553
|
return positives.some((pattern) => minimatch(target, pattern, { dot: true })) && negatives.every((pattern) => minimatch(target, pattern, { dot: true }));
|
|
570
554
|
}
|
|
571
|
-
|
|
572
|
-
//#region src/util/readJson.ts
|
|
555
|
+
// src/util/readJson.ts
|
|
573
556
|
/**
|
|
574
557
|
* Read and parse a JSON file.
|
|
575
558
|
*
|
|
@@ -596,8 +579,7 @@ async function readJson(filePath) {
|
|
|
596
579
|
if (typeof json !== "object" || json === null) throw new Error(`JSON file at "${colors.bold(filePath)}" does not contain a valid object.`);
|
|
597
580
|
return json;
|
|
598
581
|
}
|
|
599
|
-
|
|
600
|
-
//#region src/util/writeJson.ts
|
|
582
|
+
// src/util/writeJson.ts
|
|
601
583
|
/**
|
|
602
584
|
* Write a JSON `payload` to `filePath`, formatting the content first.
|
|
603
585
|
*
|
|
@@ -613,8 +595,7 @@ async function writeJson(filePath, payload) {
|
|
|
613
595
|
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
614
596
|
await fs.writeFile(filePath, content);
|
|
615
597
|
}
|
|
616
|
-
|
|
617
|
-
//#region src/config/createPlugin.ts
|
|
598
|
+
// src/config/createPlugin.ts
|
|
618
599
|
/**
|
|
619
600
|
* Instantiate or invoke a plugin factory to produce a release plugin instance.
|
|
620
601
|
*
|
|
@@ -633,8 +614,7 @@ async function createPlugin(plugin) {
|
|
|
633
614
|
if (plugin != null && typeof plugin === "object" && Object.hasOwn(plugin, "name") && typeof plugin.name === "string") return plugin;
|
|
634
615
|
return null;
|
|
635
616
|
}
|
|
636
|
-
|
|
637
|
-
//#region src/config/findReleaseRule.ts
|
|
617
|
+
// src/config/findReleaseRule.ts
|
|
638
618
|
/**
|
|
639
619
|
* Find the first release rule matching a release reference.
|
|
640
620
|
*
|
|
@@ -649,8 +629,7 @@ function findReleaseRule(ref, rules) {
|
|
|
649
629
|
return (rule.type == null || rule.type === ref.type) && isMatch(ref.name, rule.pattern);
|
|
650
630
|
});
|
|
651
631
|
}
|
|
652
|
-
|
|
653
|
-
//#region src/config/isSemVer.ts
|
|
632
|
+
// src/config/isSemVer.ts
|
|
654
633
|
/**
|
|
655
634
|
* Determine whether a value is a valid Semantic Versioning string.
|
|
656
635
|
*
|
|
@@ -666,8 +645,7 @@ function isSemVer(version) {
|
|
|
666
645
|
if (version.startsWith("v")) return false;
|
|
667
646
|
return semver.parse(version) != null;
|
|
668
647
|
}
|
|
669
|
-
|
|
670
|
-
//#region src/config/isSemVerGitTag.ts
|
|
648
|
+
// src/config/isSemVerGitTag.ts
|
|
671
649
|
/**
|
|
672
650
|
* Determine whether a tag string is a valid SemVer-style Git tag.
|
|
673
651
|
*
|
|
@@ -684,8 +662,7 @@ function isSemVerGitTag(tag) {
|
|
|
684
662
|
const hasVersionPrefix = tag.startsWith("v");
|
|
685
663
|
return isScopedPackage || hasVersionPrefix;
|
|
686
664
|
}
|
|
687
|
-
|
|
688
|
-
//#region src/config/sanitizePrereleaseLabel.ts
|
|
665
|
+
// src/config/sanitizePrereleaseLabel.ts
|
|
689
666
|
/**
|
|
690
667
|
* Sanitize a string into a safe, SemVer-compliant prerelease label.
|
|
691
668
|
*
|
|
@@ -698,8 +675,7 @@ function isSemVerGitTag(tag) {
|
|
|
698
675
|
function sanitizePrereleaseLabel(label) {
|
|
699
676
|
return label.replace(/[^a-zA-Z0-9]+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
700
677
|
}
|
|
701
|
-
|
|
702
|
-
//#region src/config/resolveReleaseChannel.ts
|
|
678
|
+
// src/config/resolveReleaseChannel.ts
|
|
703
679
|
/**
|
|
704
680
|
* Resolve the release channel for a release context.
|
|
705
681
|
*
|
|
@@ -720,8 +696,7 @@ function resolveReleaseChannel(options) {
|
|
|
720
696
|
if (typeof resolved === "string") resolved = interpolate(resolved, templateParams);
|
|
721
697
|
return resolved;
|
|
722
698
|
}
|
|
723
|
-
|
|
724
|
-
//#region src/config/resolveVersionQualifier.ts
|
|
699
|
+
// src/config/resolveVersionQualifier.ts
|
|
725
700
|
/**
|
|
726
701
|
* Resolve the version qualifier for a release context.
|
|
727
702
|
*
|
|
@@ -744,8 +719,7 @@ function resolveVersionQualifier(options) {
|
|
|
744
719
|
if (resolved && !isSemVer(`1.0.0-${resolved}.1`)) throw new Error(`The resolved version qualifier "${resolved}" is not a valid SemVer prerelease identifier.`);
|
|
745
720
|
return resolved;
|
|
746
721
|
}
|
|
747
|
-
|
|
748
|
-
//#region src/workflow/analysis/isCommitForPackage.ts
|
|
722
|
+
// src/workflow/analysis/isCommitForPackage.ts
|
|
749
723
|
/**
|
|
750
724
|
* Test whether a commit modifies files in a package.
|
|
751
725
|
*
|
|
@@ -759,8 +733,7 @@ function isCommitForPackage(pkg, commit) {
|
|
|
759
733
|
return isMatch(file, pkg.files || path.join(location, "**/*"));
|
|
760
734
|
});
|
|
761
735
|
}
|
|
762
|
-
|
|
763
|
-
//#region src/workflow/analysis/deriveChangeReleases.ts
|
|
736
|
+
// src/workflow/analysis/deriveChangeReleases.ts
|
|
764
737
|
/**
|
|
765
738
|
* Analyze commit history to update release plans for packages.
|
|
766
739
|
*
|
|
@@ -804,15 +777,19 @@ async function deriveChangeReleases(hint, classifier, plans, history) {
|
|
|
804
777
|
};
|
|
805
778
|
});
|
|
806
779
|
}
|
|
807
|
-
|
|
808
|
-
//#region src/workflow/analysis/deriveTransitionReleases.ts
|
|
780
|
+
// src/workflow/analysis/deriveTransitionReleases.ts
|
|
809
781
|
/**
|
|
810
782
|
* Derive transition release types for release plans based on version qualifiers.
|
|
811
783
|
*
|
|
812
784
|
* Evaluates unreleased `plans` by parsing package `semver` strings and checking
|
|
813
785
|
* prerelease tags. Compares parsed version qualifiers against
|
|
814
786
|
* `versionQualifier` and assigns `major`, `minor`, or `patch` release types
|
|
815
|
-
* according to `hint`.
|
|
787
|
+
* according to `hint`. When `hint` is `patch`, every package receives an
|
|
788
|
+
* update: stable packages are assigned a patch release even without a
|
|
789
|
+
* `versionQualifier`, and prerelease packages (pre-major, pre-minor, and
|
|
790
|
+
* pre-patch cycles) continue their cycle with an incremented counter,
|
|
791
|
+
* redirect to `versionQualifier` when it differs, or release their stable
|
|
792
|
+
* base when no `versionQualifier` is set.
|
|
816
793
|
*
|
|
817
794
|
* @param hint Release type override hint to guide release classification
|
|
818
795
|
* @param versionQualifier Optional qualifier string to compare against prerelease tags
|
|
@@ -841,9 +818,7 @@ function deriveTransitionReleases(hint, versionQualifier, plans) {
|
|
|
841
818
|
} else if (minor > 0 && patch === 0 && parsedVersionQualifier !== versionQualifier) releaseType = "minor";
|
|
842
819
|
break;
|
|
843
820
|
case "patch":
|
|
844
|
-
|
|
845
|
-
if (typeof versionQualifier === "string") releaseType = "patch";
|
|
846
|
-
} else if (patch > 0 && parsedVersionQualifier !== versionQualifier) releaseType = "patch";
|
|
821
|
+
releaseType = "patch";
|
|
847
822
|
break;
|
|
848
823
|
default: if (parsed.prerelease.length === 0) {
|
|
849
824
|
if (major === 0 && (minor > 0 || patch > 0)) releaseType = "major";
|
|
@@ -863,8 +838,7 @@ function deriveTransitionReleases(hint, versionQualifier, plans) {
|
|
|
863
838
|
};
|
|
864
839
|
});
|
|
865
840
|
}
|
|
866
|
-
|
|
867
|
-
//#region src/workflow/analysis/promotePrereleaseVersions.ts
|
|
841
|
+
// src/workflow/analysis/promotePrereleaseVersions.ts
|
|
868
842
|
/**
|
|
869
843
|
* Promote prerelease versions when they have no explicit release type.
|
|
870
844
|
*
|
|
@@ -899,8 +873,7 @@ async function promotePrereleaseVersions(plans) {
|
|
|
899
873
|
return plan;
|
|
900
874
|
});
|
|
901
875
|
}
|
|
902
|
-
|
|
903
|
-
//#region src/git/branch/getCurrentGitBranch.ts
|
|
876
|
+
// src/git/branch/getCurrentGitBranch.ts
|
|
904
877
|
/**
|
|
905
878
|
* Get the current Git branch name.
|
|
906
879
|
*
|
|
@@ -919,8 +892,7 @@ async function getCurrentGitBranch(cwd) {
|
|
|
919
892
|
"HEAD"
|
|
920
893
|
])).trim();
|
|
921
894
|
}
|
|
922
|
-
|
|
923
|
-
//#region src/git/commit/createGitCommit.ts
|
|
895
|
+
// src/git/commit/createGitCommit.ts
|
|
924
896
|
/**
|
|
925
897
|
* Stage all changes and create a git commit with the specified message.
|
|
926
898
|
*
|
|
@@ -941,8 +913,7 @@ async function createGitCommit(cwd, message) {
|
|
|
941
913
|
message
|
|
942
914
|
]);
|
|
943
915
|
}
|
|
944
|
-
|
|
945
|
-
//#region src/git/commit/extractMentions.ts
|
|
916
|
+
// src/git/commit/extractMentions.ts
|
|
946
917
|
var ALPHANUMERIC = "[a-zA-Z0-9]";
|
|
947
918
|
var SEPARATOR = "[-_]";
|
|
948
919
|
var USERNAME = `${ALPHANUMERIC}+(?:${SEPARATOR}+${ALPHANUMERIC}+)*`;
|
|
@@ -966,8 +937,7 @@ function extractMentions(text) {
|
|
|
966
937
|
const mentions = new Set(matches.map((match) => match[1]));
|
|
967
938
|
return Array.from(mentions);
|
|
968
939
|
}
|
|
969
|
-
|
|
970
|
-
//#region src/cache/TTLCache.ts
|
|
940
|
+
// src/cache/TTLCache.ts
|
|
971
941
|
/**
|
|
972
942
|
* A simple time-to-live cache that automatically evicts entries after a TTL.
|
|
973
943
|
*
|
|
@@ -1046,8 +1016,7 @@ var TTLCache = class {
|
|
|
1046
1016
|
this.cache.clear();
|
|
1047
1017
|
}
|
|
1048
1018
|
};
|
|
1049
|
-
|
|
1050
|
-
//#region src/git/commit/parseGitCommit.ts
|
|
1019
|
+
// src/git/commit/parseGitCommit.ts
|
|
1051
1020
|
var BREAKING_HEADER_REGEX = /^([\w-]+)(?:\(([^)]+)\))?!: (.*)$/;
|
|
1052
1021
|
var BREAKING_MARKERS = ["BREAKING CHANGE", "BREAKING-CHANGE"];
|
|
1053
1022
|
/**
|
|
@@ -1107,8 +1076,7 @@ async function parseGitCommit(entry, markers = []) {
|
|
|
1107
1076
|
files: entry.files
|
|
1108
1077
|
};
|
|
1109
1078
|
}
|
|
1110
|
-
|
|
1111
|
-
//#region src/git/commit/parseGitPrettyFormat.ts
|
|
1079
|
+
// src/git/commit/parseGitPrettyFormat.ts
|
|
1112
1080
|
/**
|
|
1113
1081
|
* Field separator used in the git pretty format to produce a single-line
|
|
1114
1082
|
*, machine-parseable record.
|
|
@@ -1169,8 +1137,7 @@ function parseGitPrettyFormat(raw) {
|
|
|
1169
1137
|
files: files ? files.split("\n") : []
|
|
1170
1138
|
};
|
|
1171
1139
|
}
|
|
1172
|
-
|
|
1173
|
-
//#region src/git/commit/getParsedGitCommit.ts
|
|
1140
|
+
// src/git/commit/getParsedGitCommit.ts
|
|
1174
1141
|
var cache = new TTLCache();
|
|
1175
1142
|
/**
|
|
1176
1143
|
* Retrieve and parse a git commit by its reference.
|
|
@@ -1198,8 +1165,7 @@ async function getParsedGitCommit(cwd, ref, markers = []) {
|
|
|
1198
1165
|
cache.set(key, parsed);
|
|
1199
1166
|
return parsed;
|
|
1200
1167
|
}
|
|
1201
|
-
|
|
1202
|
-
//#region src/git/commit/getCurrentGitCommit.ts
|
|
1168
|
+
// src/git/commit/getCurrentGitCommit.ts
|
|
1203
1169
|
/**
|
|
1204
1170
|
* Resolve the current `HEAD` commit in the repository.
|
|
1205
1171
|
*
|
|
@@ -1210,8 +1176,7 @@ async function getParsedGitCommit(cwd, ref, markers = []) {
|
|
|
1210
1176
|
function getCurrentGitCommit(cwd, markers = []) {
|
|
1211
1177
|
return getParsedGitCommit(cwd, "HEAD", markers);
|
|
1212
1178
|
}
|
|
1213
|
-
|
|
1214
|
-
//#region src/git/history/countGitHistory.ts
|
|
1179
|
+
// src/git/history/countGitHistory.ts
|
|
1215
1180
|
/**
|
|
1216
1181
|
* Count mainline commits reachable from a given reference.
|
|
1217
1182
|
*
|
|
@@ -1231,8 +1196,7 @@ async function countGitHistory(cwd, ref = "HEAD") {
|
|
|
1231
1196
|
]);
|
|
1232
1197
|
return Number.parseInt(stdout.trim(), 10);
|
|
1233
1198
|
}
|
|
1234
|
-
|
|
1235
|
-
//#region src/git/repository/isGitShallowRepository.ts
|
|
1199
|
+
// src/git/repository/isGitShallowRepository.ts
|
|
1236
1200
|
/**
|
|
1237
1201
|
* Determine whether the repository at `cwd` is a shallow clone.
|
|
1238
1202
|
*
|
|
@@ -1245,8 +1209,7 @@ async function countGitHistory(cwd, ref = "HEAD") {
|
|
|
1245
1209
|
async function isGitShallowRepository(cwd) {
|
|
1246
1210
|
return (await execGit(cwd, ["rev-parse", "--is-shallow-repository"])).trim() === "true";
|
|
1247
1211
|
}
|
|
1248
|
-
|
|
1249
|
-
//#region src/git/repository/withShallowLock.ts
|
|
1212
|
+
// src/git/repository/withShallowLock.ts
|
|
1250
1213
|
var lockQueue = /* @__PURE__ */ new Map();
|
|
1251
1214
|
var context = new AsyncLocalStorage();
|
|
1252
1215
|
/**
|
|
@@ -1278,8 +1241,7 @@ async function withShallowLock(cwd, callback) {
|
|
|
1278
1241
|
if (lockQueue.get(cwd) === queued) lockQueue.delete(cwd);
|
|
1279
1242
|
}
|
|
1280
1243
|
}
|
|
1281
|
-
|
|
1282
|
-
//#region src/git/revision/isGitAncestor.ts
|
|
1244
|
+
// src/git/revision/isGitAncestor.ts
|
|
1283
1245
|
/**
|
|
1284
1246
|
* Determine whether `ancestor` is an ancestor of `descendant`.
|
|
1285
1247
|
*
|
|
@@ -1304,8 +1266,7 @@ function isGitAncestor(cwd, ancestor, descendant) {
|
|
|
1304
1266
|
throw err;
|
|
1305
1267
|
});
|
|
1306
1268
|
}
|
|
1307
|
-
|
|
1308
|
-
//#region src/git/revision/resolveGitRevision.ts
|
|
1269
|
+
// src/git/revision/resolveGitRevision.ts
|
|
1309
1270
|
/**
|
|
1310
1271
|
* Resolve a Git revision or commit-ish expression to its full commit hash.
|
|
1311
1272
|
*
|
|
@@ -1323,8 +1284,7 @@ async function resolveGitRevision(cwd, revision) {
|
|
|
1323
1284
|
`${revision}^{commit}`
|
|
1324
1285
|
])).trim();
|
|
1325
1286
|
}
|
|
1326
|
-
|
|
1327
|
-
//#region src/git/history/expandGitHistory.ts
|
|
1287
|
+
// src/git/history/expandGitHistory.ts
|
|
1328
1288
|
/**
|
|
1329
1289
|
* Deepen a shallow clone so additional commits become available.
|
|
1330
1290
|
*
|
|
@@ -1388,8 +1348,7 @@ async function expandGitHistory(cwd, options = {}) {
|
|
|
1388
1348
|
}
|
|
1389
1349
|
});
|
|
1390
1350
|
}
|
|
1391
|
-
|
|
1392
|
-
//#region src/git/revision/detectGitRelationship.ts
|
|
1351
|
+
// src/git/revision/detectGitRelationship.ts
|
|
1393
1352
|
var GIT_REL_FLAGS = {
|
|
1394
1353
|
NONE: 0,
|
|
1395
1354
|
IS_ANCESTOR: 1,
|
|
@@ -1415,8 +1374,7 @@ async function detectGitRelationship(cwd, refA, refB) {
|
|
|
1415
1374
|
if (bIsAncestor) flags |= GIT_REL_FLAGS.IS_DESCENDANT;
|
|
1416
1375
|
return flags;
|
|
1417
1376
|
}
|
|
1418
|
-
|
|
1419
|
-
//#region src/git/history/mergeGitHistory.ts
|
|
1377
|
+
// src/git/history/mergeGitHistory.ts
|
|
1420
1378
|
/**
|
|
1421
1379
|
* Merge two newest-first commit lists into a single deduplicated newest-first list.
|
|
1422
1380
|
*
|
|
@@ -1460,8 +1418,7 @@ async function mergeGitHistory(cwd, a, b) {
|
|
|
1460
1418
|
if (j) merged.push(j);
|
|
1461
1419
|
return merged.concat(a2).concat(b2);
|
|
1462
1420
|
}
|
|
1463
|
-
|
|
1464
|
-
//#region src/git/history/restoreFullGitHistory.ts
|
|
1421
|
+
// src/git/history/restoreFullGitHistory.ts
|
|
1465
1422
|
/**
|
|
1466
1423
|
* Convert a shallow clone into a full clone by fetching additional history.
|
|
1467
1424
|
*
|
|
@@ -1474,8 +1431,7 @@ async function mergeGitHistory(cwd, a, b) {
|
|
|
1474
1431
|
function restoreFullGitHistory(cwd) {
|
|
1475
1432
|
return execGit(cwd, ["fetch", "--unshallow"]).then(() => true).catch(() => false);
|
|
1476
1433
|
}
|
|
1477
|
-
|
|
1478
|
-
//#region src/git/history/showGitHistory.ts
|
|
1434
|
+
// src/git/history/showGitHistory.ts
|
|
1479
1435
|
/**
|
|
1480
1436
|
* Yield commit SHAs from repository history in paginated order.
|
|
1481
1437
|
*
|
|
@@ -1518,8 +1474,7 @@ async function* showGitHistory(cwd, options = {}) {
|
|
|
1518
1474
|
}
|
|
1519
1475
|
} catch {}
|
|
1520
1476
|
}
|
|
1521
|
-
|
|
1522
|
-
//#region src/git/history/showParsedGitHistory.ts
|
|
1477
|
+
// src/git/history/showParsedGitHistory.ts
|
|
1523
1478
|
/**
|
|
1524
1479
|
* Yield parsed commits sequentially from repository history.
|
|
1525
1480
|
*
|
|
@@ -1536,8 +1491,7 @@ async function* showParsedGitHistory(cwd, options) {
|
|
|
1536
1491
|
yield await getParsedGitCommit(cwd, commit);
|
|
1537
1492
|
} catch {}
|
|
1538
1493
|
}
|
|
1539
|
-
|
|
1540
|
-
//#region src/git/repository/getGitConfigValue.ts
|
|
1494
|
+
// src/git/repository/getGitConfigValue.ts
|
|
1541
1495
|
/**
|
|
1542
1496
|
* Get a local git configuration value for `key` in the repository at `cwd`.
|
|
1543
1497
|
*
|
|
@@ -1560,8 +1514,7 @@ async function getGitConfigValue(cwd, key) {
|
|
|
1560
1514
|
return;
|
|
1561
1515
|
}
|
|
1562
1516
|
}
|
|
1563
|
-
|
|
1564
|
-
//#region src/git/repository/ensureGitUserConfig.ts
|
|
1517
|
+
// src/git/repository/ensureGitUserConfig.ts
|
|
1565
1518
|
/**
|
|
1566
1519
|
* Ensure Git user configuration is set and return a cleanup handle.
|
|
1567
1520
|
*
|
|
@@ -1611,8 +1564,7 @@ async function ensureGitUserConfig(cwd, user) {
|
|
|
1611
1564
|
]);
|
|
1612
1565
|
} };
|
|
1613
1566
|
}
|
|
1614
|
-
|
|
1615
|
-
//#region src/git/repository/getGitRemote.ts
|
|
1567
|
+
// src/git/repository/getGitRemote.ts
|
|
1616
1568
|
/**
|
|
1617
1569
|
* Get the URL for the named remote (defaults to `origin`).
|
|
1618
1570
|
*
|
|
@@ -1627,8 +1579,7 @@ function getGitRemote(cwd, remoteName = "origin") {
|
|
|
1627
1579
|
remoteName
|
|
1628
1580
|
]).then((stdout) => stdout.trim()).catch(() => null);
|
|
1629
1581
|
}
|
|
1630
|
-
|
|
1631
|
-
//#region src/git/repository/pushGitChanges.ts
|
|
1582
|
+
// src/git/repository/pushGitChanges.ts
|
|
1632
1583
|
/**
|
|
1633
1584
|
* Push a branch and optional tags to the `origin` remote using an atomic push.
|
|
1634
1585
|
*
|
|
@@ -1646,8 +1597,7 @@ async function pushGitChanges(cwd, branch, ...additionalTags) {
|
|
|
1646
1597
|
"--no-verify"
|
|
1647
1598
|
]);
|
|
1648
1599
|
}
|
|
1649
|
-
|
|
1650
|
-
//#region src/git/repository/resolveGitRepository.ts
|
|
1600
|
+
// src/git/repository/resolveGitRepository.ts
|
|
1651
1601
|
/**
|
|
1652
1602
|
* Resolve Git repository host, owner, and project metadata from the `origin` remote URL.
|
|
1653
1603
|
*
|
|
@@ -1666,8 +1616,7 @@ async function resolveGitRepository(cwd) {
|
|
|
1666
1616
|
};
|
|
1667
1617
|
return null;
|
|
1668
1618
|
}
|
|
1669
|
-
|
|
1670
|
-
//#region src/git/revision/readGitFile.ts
|
|
1619
|
+
// src/git/revision/readGitFile.ts
|
|
1671
1620
|
/**
|
|
1672
1621
|
* Read a file's contents from a specific Git revision.
|
|
1673
1622
|
*
|
|
@@ -1688,8 +1637,7 @@ async function resolveGitRepository(cwd) {
|
|
|
1688
1637
|
function readGitFile(cwd, ref, filePath) {
|
|
1689
1638
|
return execGit(cwd, ["show", `${ref}:${filePath}`]).catch(() => null);
|
|
1690
1639
|
}
|
|
1691
|
-
|
|
1692
|
-
//#region src/git/tag/createGitTag.ts
|
|
1640
|
+
// src/git/tag/createGitTag.ts
|
|
1693
1641
|
/**
|
|
1694
1642
|
* Create a git tag in the repository at `cwd`.
|
|
1695
1643
|
*
|
|
@@ -1709,8 +1657,7 @@ async function createGitTag(cwd, tag, message) {
|
|
|
1709
1657
|
"--cleanup=whitespace"
|
|
1710
1658
|
] : [tag]]);
|
|
1711
1659
|
}
|
|
1712
|
-
|
|
1713
|
-
//#region src/git/tag/deleteGitTag.ts
|
|
1660
|
+
// src/git/tag/deleteGitTag.ts
|
|
1714
1661
|
/**
|
|
1715
1662
|
* Delete a local git tag in the repository at `cwd`.
|
|
1716
1663
|
*
|
|
@@ -1725,8 +1672,7 @@ function deleteGitTag(cwd, tag) {
|
|
|
1725
1672
|
tag
|
|
1726
1673
|
]).then(() => true).catch(() => false);
|
|
1727
1674
|
}
|
|
1728
|
-
|
|
1729
|
-
//#region src/git/tag/isGitTagPresent.ts
|
|
1675
|
+
// src/git/tag/isGitTagPresent.ts
|
|
1730
1676
|
/**
|
|
1731
1677
|
* Determine whether a specific git tag exists locally in the repository.
|
|
1732
1678
|
*
|
|
@@ -1737,8 +1683,7 @@ function deleteGitTag(cwd, tag) {
|
|
|
1737
1683
|
function isGitTagPresent(cwd, tag) {
|
|
1738
1684
|
return resolveGitRevision(cwd, `refs/tags/${tag}`).then(() => true).catch(() => false);
|
|
1739
1685
|
}
|
|
1740
|
-
|
|
1741
|
-
//#region src/git/tag/ensureGitTag.ts
|
|
1686
|
+
// src/git/tag/ensureGitTag.ts
|
|
1742
1687
|
var MIN_HISTORY_DEPTH = 2;
|
|
1743
1688
|
var ORIGIN_NOT_REPO = `fatal: 'origin' does not appear to be a git repository`;
|
|
1744
1689
|
var REMOTE_REF_NOT_FOUND = `fatal: couldn't find remote ref`;
|
|
@@ -1777,16 +1722,14 @@ function ensureGitTag(cwd, tag) {
|
|
|
1777
1722
|
return false;
|
|
1778
1723
|
});
|
|
1779
1724
|
}
|
|
1780
|
-
|
|
1781
|
-
//#region src/git/tag/generateGitTagName.ts
|
|
1725
|
+
// src/git/tag/generateGitTagName.ts
|
|
1782
1726
|
function generateGitTagName(entry, name, version) {
|
|
1783
1727
|
if (!version) return null;
|
|
1784
1728
|
if (entry) return `v${version}`;
|
|
1785
1729
|
if (!name) throw new Error("Package name is required to build a tag name.");
|
|
1786
1730
|
return `${name}@${version}`;
|
|
1787
1731
|
}
|
|
1788
|
-
|
|
1789
|
-
//#region src/git/tag/getCurrentGitTag.ts
|
|
1732
|
+
// src/git/tag/getCurrentGitTag.ts
|
|
1790
1733
|
/**
|
|
1791
1734
|
* Get the tag name that exactly matches the current `HEAD`, if any.
|
|
1792
1735
|
*
|
|
@@ -1806,8 +1749,7 @@ async function getCurrentGitTag(cwd) {
|
|
|
1806
1749
|
return null;
|
|
1807
1750
|
}
|
|
1808
1751
|
}
|
|
1809
|
-
|
|
1810
|
-
//#region src/git/tag/getGitTagMessage.ts
|
|
1752
|
+
// src/git/tag/getGitTagMessage.ts
|
|
1811
1753
|
/**
|
|
1812
1754
|
* Get the message of an annotated git tag in the repository at `cwd`.
|
|
1813
1755
|
*
|
|
@@ -1829,8 +1771,7 @@ async function getGitTagMessage(cwd, tag) {
|
|
|
1829
1771
|
return;
|
|
1830
1772
|
}
|
|
1831
1773
|
}
|
|
1832
|
-
|
|
1833
|
-
//#region src/git/tag/getLatestGitTag.ts
|
|
1774
|
+
// src/git/tag/getLatestGitTag.ts
|
|
1834
1775
|
/**
|
|
1835
1776
|
* Get the most recent tag reachable from `HEAD`.
|
|
1836
1777
|
*
|
|
@@ -1850,8 +1791,7 @@ async function getLatestGitTag(cwd) {
|
|
|
1850
1791
|
return null;
|
|
1851
1792
|
}
|
|
1852
1793
|
}
|
|
1853
|
-
|
|
1854
|
-
//#region src/git/tag/isGitTagConnected.ts
|
|
1794
|
+
// src/git/tag/isGitTagConnected.ts
|
|
1855
1795
|
/**
|
|
1856
1796
|
* Determine whether a specific git tag commit is reachable from the current HEAD.
|
|
1857
1797
|
*
|
|
@@ -1876,8 +1816,7 @@ async function isGitTagConnected(cwd, tag) {
|
|
|
1876
1816
|
return false;
|
|
1877
1817
|
}
|
|
1878
1818
|
}
|
|
1879
|
-
|
|
1880
|
-
//#region src/git/tag/isGitTagPointed.ts
|
|
1819
|
+
// src/git/tag/isGitTagPointed.ts
|
|
1881
1820
|
/**
|
|
1882
1821
|
* Check whether a given tag points to the provided commit.
|
|
1883
1822
|
*
|
|
@@ -1905,8 +1844,7 @@ async function isGitTagPointed(cwd, tag, commit) {
|
|
|
1905
1844
|
return false;
|
|
1906
1845
|
}
|
|
1907
1846
|
}
|
|
1908
|
-
|
|
1909
|
-
//#region src/workflow/discovery/buildDependencyGraph.ts
|
|
1847
|
+
// src/workflow/discovery/buildDependencyGraph.ts
|
|
1910
1848
|
/**
|
|
1911
1849
|
* Build a dependency graph mapping package names to dependent release plans.
|
|
1912
1850
|
*
|
|
@@ -1926,8 +1864,7 @@ function buildDependencyGraph(plans) {
|
|
|
1926
1864
|
}
|
|
1927
1865
|
return graph;
|
|
1928
1866
|
}
|
|
1929
|
-
|
|
1930
|
-
//#region src/workflow/changelog/extractPlainText.ts
|
|
1867
|
+
// src/workflow/changelog/extractPlainText.ts
|
|
1931
1868
|
/**
|
|
1932
1869
|
* Extract trimmed plain text from a Heading, Paragraph, or PhrasingContent node.
|
|
1933
1870
|
*
|
|
@@ -1949,8 +1886,7 @@ function extractPlainText(node) {
|
|
|
1949
1886
|
}
|
|
1950
1887
|
return result.trim() || null;
|
|
1951
1888
|
}
|
|
1952
|
-
|
|
1953
|
-
//#region src/workflow/changelog/extractSemVer.ts
|
|
1889
|
+
// src/workflow/changelog/extractSemVer.ts
|
|
1954
1890
|
var ANCHORED_SEMVER_REGEX = new RegExp(`^${SEMVER_REGEX.source}$`);
|
|
1955
1891
|
var BRACKETED_SEMVER_REGEX = new RegExp(`\\[${SEMVER_REGEX.source}\\]`);
|
|
1956
1892
|
/**
|
|
@@ -1970,8 +1906,7 @@ function extractSemVer(line) {
|
|
|
1970
1906
|
return (ANCHORED_SEMVER_REGEX.exec(token) ?? BRACKETED_SEMVER_REGEX.exec(token))?.at(2);
|
|
1971
1907
|
}));
|
|
1972
1908
|
}
|
|
1973
|
-
|
|
1974
|
-
//#region src/workflow/changelog/iterateChangelogVersions.ts
|
|
1909
|
+
// src/workflow/changelog/iterateChangelogVersions.ts
|
|
1975
1910
|
var SENTENCE_TERMINAL_REGEX = /\p{Sentence_Terminal}$/u;
|
|
1976
1911
|
/**
|
|
1977
1912
|
* Iterate over Semantic Version strings extracted from a Markdown changelog.
|
|
@@ -2007,8 +1942,7 @@ function* iterateChangelogVersions(changelogContent) {
|
|
|
2007
1942
|
if (isVersionFound) return;
|
|
2008
1943
|
}
|
|
2009
1944
|
}
|
|
2010
|
-
|
|
2011
|
-
//#region src/workflow/changelog/extractLatestVersion.ts
|
|
1945
|
+
// src/workflow/changelog/extractLatestVersion.ts
|
|
2012
1946
|
/**
|
|
2013
1947
|
* Find the highest semantic version from the first version-bearing element.
|
|
2014
1948
|
*
|
|
@@ -2023,8 +1957,7 @@ function extractLatestVersion(changelogContent) {
|
|
|
2023
1957
|
for (const version of iterateChangelogVersions(changelogContent)) return version;
|
|
2024
1958
|
return null;
|
|
2025
1959
|
}
|
|
2026
|
-
|
|
2027
|
-
//#region src/workflow/discovery/verifyPackageTag.ts
|
|
1960
|
+
// src/workflow/discovery/verifyPackageTag.ts
|
|
2028
1961
|
/**
|
|
2029
1962
|
* Verify a Git tag against package specifications and repository history.
|
|
2030
1963
|
*
|
|
@@ -2050,8 +1983,7 @@ async function verifyPackageTag(cwd, pkg, tagName) {
|
|
|
2050
1983
|
await expandGitHistory(cwd, { until: tagRef });
|
|
2051
1984
|
return isGitTagConnected(cwd, tagName);
|
|
2052
1985
|
}
|
|
2053
|
-
|
|
2054
|
-
//#region src/workflow/discovery/discoverPackageTag.ts
|
|
1986
|
+
// src/workflow/discovery/discoverPackageTag.ts
|
|
2055
1987
|
/**
|
|
2056
1988
|
* Discover and validate the Git tag for a package.
|
|
2057
1989
|
*
|
|
@@ -2090,8 +2022,7 @@ async function discoverPackageTag(cwd, pkg) {
|
|
|
2090
2022
|
message: await getGitTagMessage(cwd, expectedTagName)
|
|
2091
2023
|
};
|
|
2092
2024
|
}
|
|
2093
|
-
|
|
2094
|
-
//#region src/workflow/discovery/resolvePackageStableTag.ts
|
|
2025
|
+
// src/workflow/discovery/resolvePackageStableTag.ts
|
|
2095
2026
|
/**
|
|
2096
2027
|
* Resolve the latest stable Git tag for a package.
|
|
2097
2028
|
*
|
|
@@ -2134,8 +2065,7 @@ async function resolvePackageStableTag(cwd, pkg) {
|
|
|
2134
2065
|
}
|
|
2135
2066
|
return null;
|
|
2136
2067
|
}
|
|
2137
|
-
|
|
2138
|
-
//#region src/workflow/discovery/resolvePackageTag.ts
|
|
2068
|
+
// src/workflow/discovery/resolvePackageTag.ts
|
|
2139
2069
|
/**
|
|
2140
2070
|
* Resolve the release tag for a single package version.
|
|
2141
2071
|
*
|
|
@@ -2160,8 +2090,7 @@ async function resolvePackageTag(cwd, pkg) {
|
|
|
2160
2090
|
};
|
|
2161
2091
|
return null;
|
|
2162
2092
|
}
|
|
2163
|
-
|
|
2164
|
-
//#region src/workflow/analysis/propagateDependencyUpdates.ts
|
|
2093
|
+
// src/workflow/analysis/propagateDependencyUpdates.ts
|
|
2165
2094
|
/**
|
|
2166
2095
|
* Propagate release updates through package dependencies.
|
|
2167
2096
|
*
|
|
@@ -2199,8 +2128,7 @@ async function propagateDependencyUpdates(cwd, plans) {
|
|
|
2199
2128
|
return plan;
|
|
2200
2129
|
});
|
|
2201
2130
|
}
|
|
2202
|
-
|
|
2203
|
-
//#region src/workflow/committing/isReleaseCommit.ts
|
|
2131
|
+
// src/workflow/committing/isReleaseCommit.ts
|
|
2204
2132
|
/**
|
|
2205
2133
|
* Determine whether a commit represents a release or matches a release marker.
|
|
2206
2134
|
*
|
|
@@ -2229,8 +2157,7 @@ async function isReleaseCommit(cwd, commit, marker = GIT_TRAILER_RELEASE_AGENT)
|
|
|
2229
2157
|
commit.hash
|
|
2230
2158
|
]).then(() => true).catch(() => false);
|
|
2231
2159
|
}
|
|
2232
|
-
|
|
2233
|
-
//#region src/workflow/analysis/sliceUnreleased.ts
|
|
2160
|
+
// src/workflow/analysis/sliceUnreleased.ts
|
|
2234
2161
|
/**
|
|
2235
2162
|
* Yield parsed commits from the workspace until a release commit is found.
|
|
2236
2163
|
*
|
|
@@ -2247,8 +2174,7 @@ async function* sliceUnreleased(cwd, options) {
|
|
|
2247
2174
|
yield commit;
|
|
2248
2175
|
}
|
|
2249
2176
|
}
|
|
2250
|
-
|
|
2251
|
-
//#region src/workflow/analysis/streamPackageCommits.ts
|
|
2177
|
+
// src/workflow/analysis/streamPackageCommits.ts
|
|
2252
2178
|
/**
|
|
2253
2179
|
* Yield commits from git history associated with a package.
|
|
2254
2180
|
*
|
|
@@ -2267,8 +2193,7 @@ async function* streamPackageCommits(cwd, pkg, options = {}) {
|
|
|
2267
2193
|
};
|
|
2268
2194
|
for await (const commit of showParsedGitHistory(cwd, options)) if (isCommitForPackage(pkg, commit)) yield commit;
|
|
2269
2195
|
}
|
|
2270
|
-
|
|
2271
|
-
//#region src/workflow/changelog/buildChangelog.ts
|
|
2196
|
+
// src/workflow/changelog/buildChangelog.ts
|
|
2272
2197
|
var preset = await createPreset();
|
|
2273
2198
|
var headerPartial = (context) => {
|
|
2274
2199
|
return context.version ? preset.writer.headerPartial?.(context) : void 0;
|
|
@@ -2303,8 +2228,7 @@ async function buildChangelog(context, history, options = {}) {
|
|
|
2303
2228
|
headerPartial
|
|
2304
2229
|
}, preset.writer));
|
|
2305
2230
|
}
|
|
2306
|
-
|
|
2307
|
-
//#region src/workflow/changelog/buildReleaseNotes.ts
|
|
2231
|
+
// src/workflow/changelog/buildReleaseNotes.ts
|
|
2308
2232
|
/**
|
|
2309
2233
|
* Build release notes from a release context and commit history.
|
|
2310
2234
|
*
|
|
@@ -2331,8 +2255,7 @@ async function buildReleaseNotes(context, history) {
|
|
|
2331
2255
|
});
|
|
2332
2256
|
return formatFile(path.join(context.cwd, DEFAULT_CHANGELOG_FILE), toMarkdown(root));
|
|
2333
2257
|
}
|
|
2334
|
-
|
|
2335
|
-
//#region src/workflow/changelog/extractPreviousVersion.ts
|
|
2258
|
+
// src/workflow/changelog/extractPreviousVersion.ts
|
|
2336
2259
|
/**
|
|
2337
2260
|
* Find the latest stable version that precedes the current version.
|
|
2338
2261
|
*
|
|
@@ -2371,8 +2294,7 @@ async function extractPreviousVersion(currentVersion, changelogContent) {
|
|
|
2371
2294
|
}
|
|
2372
2295
|
return null;
|
|
2373
2296
|
}
|
|
2374
|
-
|
|
2375
|
-
//#region src/workflow/changelog/prependChangelog.ts
|
|
2297
|
+
// src/workflow/changelog/prependChangelog.ts
|
|
2376
2298
|
var defaultChangelogTitle = "Changelog";
|
|
2377
2299
|
/**
|
|
2378
2300
|
* Prepend changelog content to a markdown file, creating it if necessary.
|
|
@@ -2410,8 +2332,7 @@ async function prependChangelog(filePath, revision) {
|
|
|
2410
2332
|
content = await formatFile(filePath, content);
|
|
2411
2333
|
await fs.writeFile(filePath, content);
|
|
2412
2334
|
}
|
|
2413
|
-
|
|
2414
|
-
//#region src/workflow/changelog/writeChangelog.ts
|
|
2335
|
+
// src/workflow/changelog/writeChangelog.ts
|
|
2415
2336
|
/**
|
|
2416
2337
|
* Write changelog content to the file system based on the release plan.
|
|
2417
2338
|
*
|
|
@@ -2425,11 +2346,9 @@ async function writeChangelog(cwd, plan) {
|
|
|
2425
2346
|
await prependChangelog(path.join(cwd, plan.package.location, changelogFile), plan.release.changelog);
|
|
2426
2347
|
}
|
|
2427
2348
|
}
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
//#endregion
|
|
2432
|
-
//#region src/workflow/committing/generateReleaseCommitMessage.ts
|
|
2349
|
+
// package.json
|
|
2350
|
+
var version = "0.5.1";
|
|
2351
|
+
// src/workflow/committing/generateReleaseCommitMessage.ts
|
|
2433
2352
|
var NOTABLE_TYPES = [
|
|
2434
2353
|
"feat",
|
|
2435
2354
|
"fix",
|
|
@@ -2496,8 +2415,7 @@ async function generateReleaseCommitMessage(cwd, plans, trailers = {}) {
|
|
|
2496
2415
|
Object.entries(trailers).map(([key, value]) => key && value != null ? `${key}: ${value}` : "").filter(Boolean).join("\n")
|
|
2497
2416
|
].filter(Boolean).join("\n\n");
|
|
2498
2417
|
}
|
|
2499
|
-
|
|
2500
|
-
//#region src/plugin/HookManager.ts
|
|
2418
|
+
// src/plugin/HookManager.ts
|
|
2501
2419
|
var HookPriority = {
|
|
2502
2420
|
High: 50,
|
|
2503
2421
|
Normal: 0,
|
|
@@ -2572,8 +2490,7 @@ var HookManager = class {
|
|
|
2572
2490
|
return await dispatch(0, context);
|
|
2573
2491
|
}
|
|
2574
2492
|
};
|
|
2575
|
-
|
|
2576
|
-
//#region src/workflow/report/generateReleaseReport.ts
|
|
2493
|
+
// src/workflow/report/generateReleaseReport.ts
|
|
2577
2494
|
/**
|
|
2578
2495
|
* Generate a structured release report from the current workflow state.
|
|
2579
2496
|
*
|
|
@@ -2615,8 +2532,7 @@ function generateReleaseReport(context) {
|
|
|
2615
2532
|
}))
|
|
2616
2533
|
};
|
|
2617
2534
|
}
|
|
2618
|
-
|
|
2619
|
-
//#region src/workflow/report/printReleaseReport.ts
|
|
2535
|
+
// src/workflow/report/printReleaseReport.ts
|
|
2620
2536
|
/**
|
|
2621
2537
|
* Print a formatted release report to the logger.
|
|
2622
2538
|
*
|
|
@@ -2657,8 +2573,7 @@ function printReleaseReport(logger, report) {
|
|
|
2657
2573
|
}).join("\n\n");
|
|
2658
2574
|
logger.info(`${header}\n\n${list}\n`);
|
|
2659
2575
|
}
|
|
2660
|
-
|
|
2661
|
-
//#region src/workflow/executeReleaseWorkflow.ts
|
|
2576
|
+
// src/workflow/executeReleaseWorkflow.ts
|
|
2662
2577
|
/**
|
|
2663
2578
|
* Execute the complete release workflow across all configured plugins.
|
|
2664
2579
|
*
|
|
@@ -2730,7 +2645,6 @@ async function executeReleaseWorkflow(context, plugins) {
|
|
|
2730
2645
|
printReleaseReport(context.logger, generateReleaseReport(context));
|
|
2731
2646
|
}
|
|
2732
2647
|
}
|
|
2733
|
-
//#endregion
|
|
2734
2648
|
export { countGitHistory as $, getCurrentGitTag as A, isDefined as At, ensureGitUserConfig as B, deriveReleaseType as Bt, extractSemVer as C, isMatch as Ct, isGitTagConnected as D, execGit as Dt, isGitTagPointed as E, formatFile as Et, createGitTag as F, GIT_TRAILER_RELEASE_AGENT as Ft, mergeGitHistory as G, showParsedGitHistory as H, determineReleaseType as Ht, readGitFile as I, RELEASE_HOOK_NAMES as It, expandGitHistory as J, GIT_REL_FLAGS as K, resolveGitRepository as L, SEMVER_REGEX as Lt, ensureGitTag as M, ALL_FILES as Mt, isGitTagPresent as N, DEFAULT_CHANGELOG_FILE as Nt, getLatestGitTag as O, execCommand as Ot, deleteGitTag as P, DEV_NULL as Pt, isGitShallowRepository as Q, pushGitChanges as R, isStableVersion as Rt, iterateChangelogVersions as S, readJson as St, buildDependencyGraph as T, interpolate as Tt, showGitHistory as U, bumpVersion as Ut, getGitConfigValue as V, pickPriorityReleaseType as Vt, restoreFullGitHistory as W, extractVersionQualifier as Wt, isGitAncestor as X, resolveGitRevision as Y, withShallowLock as Z, resolvePackageTag as _, isSemVerGitTag as _t, HookPriority as a, parseGitCommit as at, verifyPackageTag as b, createPlugin as bt, writeChangelog as c, createGitCommit as ct, buildReleaseNotes as d, deriveTransitionReleases as dt, getCurrentGitCommit as et, buildChangelog as f, deriveChangeReleases as ft, propagateDependencyUpdates as g, sanitizePrereleaseLabel as gt, isReleaseCommit as h, resolveReleaseChannel as ht, HookManager as i, parseGitPrettyFormat as it, generateGitTagName as j, buildTrailerPattern as jt, getGitTagMessage as k, compact as kt, prependChangelog as l, getCurrentGitBranch as lt, sliceUnreleased as m, resolveVersionQualifier as mt, printReleaseReport as n, GIT_PRETTY_FIELD_SEPARATOR as nt, generateReleaseCommitMessage as o, TTLCache as ot, streamPackageCommits as p, isCommitForPackage as pt, detectGitRelationship as q, generateReleaseReport as r, GIT_PRETTY_FORMAT as rt, version as s, extractMentions as st, executeReleaseWorkflow as t, getParsedGitCommit as tt, extractPreviousVersion as u, promotePrereleaseVersions as ut, resolvePackageStableTag as v, isSemVer as vt, extractPlainText as w, isClass as wt, extractLatestVersion as x, writeJson as xt, discoverPackageTag as y, findReleaseRule as yt, getGitRemote as z, isSameReleaseCycle as zt };
|
|
2735
2649
|
|
|
2736
|
-
//# sourceMappingURL=workflow-
|
|
2650
|
+
//# sourceMappingURL=workflow-9iNWXQsA.js.map
|