mandrel 2.109.0 → 2.110.0
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.
|
@@ -23,11 +23,14 @@ const RECORD_SEP = '\u0000';
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Whole messages (bodies carry the breaking footer), oldest-first for the
|
|
26
|
-
* type tie-break.
|
|
26
|
+
* type tie-break. Merge commits are included (a delivery trailer can sit on
|
|
27
|
+
* one) unless `scope` narrows the read. A failed read returns `[]`,
|
|
28
|
+
* degrading to safe defaults.
|
|
27
29
|
*
|
|
28
30
|
* @param {{
|
|
29
31
|
* storyBranch: string,
|
|
30
32
|
* baseBranch: string,
|
|
33
|
+
* scope?: string[],
|
|
31
34
|
* cwd?: string,
|
|
32
35
|
* gitSpawn?: typeof defaultGitSpawn,
|
|
33
36
|
* logger?: { warn?: Function },
|
|
@@ -37,6 +40,7 @@ const RECORD_SEP = '\u0000';
|
|
|
37
40
|
function readBranchCommits({
|
|
38
41
|
storyBranch,
|
|
39
42
|
baseBranch,
|
|
43
|
+
scope = [],
|
|
40
44
|
cwd = process.cwd(),
|
|
41
45
|
gitSpawn = defaultGitSpawn,
|
|
42
46
|
logger = DefaultLogger,
|
|
@@ -47,7 +51,7 @@ function readBranchCommits({
|
|
|
47
51
|
const result = gitSpawn(
|
|
48
52
|
cwd,
|
|
49
53
|
'log',
|
|
50
|
-
|
|
54
|
+
...scope,
|
|
51
55
|
'--reverse',
|
|
52
56
|
'--format=%B%x00',
|
|
53
57
|
range,
|
|
@@ -72,6 +76,14 @@ function readBranchCommits({
|
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
|
|
79
|
+
/** The Story's own first-parent commits: merged-in history must not pick the type. */
|
|
80
|
+
function readOwnCommits(read) {
|
|
81
|
+
return readBranchCommits({
|
|
82
|
+
...read,
|
|
83
|
+
scope: ['--first-parent', '--no-merges'],
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
75
87
|
/**
|
|
76
88
|
* A conventional title is kept verbatim; prose is synthesized as
|
|
77
89
|
* `<derivedType>: <shaped title>`. Either gets `(#<id>)` and, if breaking, `!`.
|
|
@@ -80,6 +92,7 @@ function readBranchCommits({
|
|
|
80
92
|
* storyTitle: string,
|
|
81
93
|
* storyId: number|string,
|
|
82
94
|
* commitMessages?: string[],
|
|
95
|
+
* ownCommitMessages?: string[],
|
|
83
96
|
* storyBody?: string,
|
|
84
97
|
* }} args
|
|
85
98
|
* @returns {{ title: string, breaking: boolean, breakingNotes: string[] }}
|
|
@@ -88,6 +101,7 @@ function normalizePrTitle({
|
|
|
88
101
|
storyTitle,
|
|
89
102
|
storyId,
|
|
90
103
|
commitMessages = [],
|
|
104
|
+
ownCommitMessages = commitMessages,
|
|
91
105
|
storyBody = '',
|
|
92
106
|
}) {
|
|
93
107
|
const idSuffix = `(#${storyId})`;
|
|
@@ -99,7 +113,11 @@ function normalizePrTitle({
|
|
|
99
113
|
|
|
100
114
|
const subject = isConventionalSubject(trimmed)
|
|
101
115
|
? trimmed
|
|
102
|
-
: synthesizeSubject({
|
|
116
|
+
: synthesizeSubject({
|
|
117
|
+
description: trimmed,
|
|
118
|
+
storyId,
|
|
119
|
+
commitMessages: ownCommitMessages,
|
|
120
|
+
});
|
|
103
121
|
|
|
104
122
|
const marked = breaking ? markBreaking(subject) : subject;
|
|
105
123
|
return { title: `${marked} ${idSuffix}`, breaking, breakingNotes: notes };
|
|
@@ -171,16 +189,13 @@ export function buildPullRequestFields({
|
|
|
171
189
|
config,
|
|
172
190
|
progress = () => {},
|
|
173
191
|
}) {
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
baseBranch,
|
|
177
|
-
cwd,
|
|
178
|
-
gitSpawn,
|
|
179
|
-
});
|
|
192
|
+
const read = { storyBranch, baseBranch, cwd, gitSpawn };
|
|
193
|
+
const commitMessages = readBranchCommits(read);
|
|
180
194
|
const { title, breaking, breakingNotes } = normalizePrTitle({
|
|
181
195
|
storyTitle,
|
|
182
196
|
storyId,
|
|
183
197
|
commitMessages,
|
|
198
|
+
ownCommitMessages: readOwnCommits(read),
|
|
184
199
|
storyBody,
|
|
185
200
|
});
|
|
186
201
|
if (breaking) announceBreaking(breakingNotes, progress);
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,13 @@ All notable changes to this project will be documented in this file.
|
|
|
15
15
|
-->
|
|
16
16
|
<!-- markdownlint-disable-file MD004 MD012 MD037 -->
|
|
17
17
|
|
|
18
|
+
## [2.110.0](https://github.com/dsj1984/mandrel/compare/mandrel-v2.109.0...mandrel-v2.110.0) (2026-11-05)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
* close lifts PR-body trailers from merge commits and takes the PR type from the Story branch's own commits ([#5942](https://github.com/dsj1984/mandrel/issues/5942)) ([#5943](https://github.com/dsj1984/mandrel/issues/5943)) ([adbc4f6](https://github.com/dsj1984/mandrel/commit/adbc4f6d608a43ba79beeeb2b217ee494a8b1ead))
|
|
24
|
+
|
|
18
25
|
## [2.109.0](https://github.com/dsj1984/mandrel/compare/mandrel-v2.108.0...mandrel-v2.109.0) (2026-10-30)
|
|
19
26
|
|
|
20
27
|
|
package/package.json
CHANGED