rman 2.40.3 → 2.41.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.
|
@@ -104,8 +104,10 @@ const config = {
|
|
|
104
104
|
},
|
|
105
105
|
commitMessage: {
|
|
106
106
|
target: 'config',
|
|
107
|
-
describe: 'The commit message for each group this run commits - "{version}"
|
|
108
|
-
'commit
|
|
107
|
+
describe: 'The commit message for each group this run commits - "{version}" and "{name}" (the ' +
|
|
108
|
+
"packages' names, comma-separated) are substituted when a commit's own group shares one " +
|
|
109
|
+
'version. Default "chore(release): v{version}" with one version line, and ' +
|
|
110
|
+
'"chore(release): <name>@<version>, ..." with several.',
|
|
109
111
|
type: 'string',
|
|
110
112
|
},
|
|
111
113
|
cascade: {
|
package/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.
|
|
1
|
+
export const version = '2.41.0';
|
package/package.json
CHANGED
|
@@ -109,8 +109,12 @@ function escapeRegExp(value) {
|
|
|
109
109
|
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
110
110
|
}
|
|
111
111
|
/** Turns a `version.commitMessage` template into a matcher for the commits it produces: every
|
|
112
|
-
* literal part escaped, each `{version}` placeholder standing in for any semver
|
|
112
|
+
* literal part escaped, each `{version}` placeholder standing in for any semver and each `{name}`
|
|
113
|
+
* for any non-empty text (package names, comma-separated). */
|
|
113
114
|
function templatePattern(template) {
|
|
114
|
-
const source = template
|
|
115
|
+
const source = template
|
|
116
|
+
.split('{version}')
|
|
117
|
+
.map(part => part.split('{name}').map(escapeRegExp).join('.+?'))
|
|
118
|
+
.join(SEMVER_SOURCE);
|
|
115
119
|
return new RegExp(`^${source}$`);
|
|
116
120
|
}
|
|
@@ -85,10 +85,15 @@ export declare namespace VersionService {
|
|
|
85
85
|
/** True for the repository's own release tag, which belongs to no single package. */
|
|
86
86
|
release?: boolean;
|
|
87
87
|
}
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
88
|
+
/**
|
|
89
|
+
* The message of one group's release commit.
|
|
90
|
+
*
|
|
91
|
+
* `.rmanrc version.commitMessage` (root-level) when it is set and every package in the commit
|
|
92
|
+
* shares one version - `{version}` is that version, `{name}` the packages' names, comma-separated.
|
|
93
|
+
* Unset, `chore(release): v{version}` while the repository releases along one version line, and
|
|
94
|
+
* `chore(release): <name>@<version>, ...` once it releases along several, so each commit says what
|
|
95
|
+
* it released. A commit spanning different versions always takes that listing form.
|
|
96
|
+
*/
|
|
92
97
|
function buildCommitMessage(repository: Repository, entries: VersionPlanService.Entry[], messageOverride?: string): string;
|
|
93
98
|
/**
|
|
94
99
|
* A `version.<slot>` value: one step, or several to run in sequence - the same shape, and now the
|
|
@@ -6,7 +6,7 @@ import { Manifest } from '../core/interfaces/manifest.js';
|
|
|
6
6
|
import { GitHelper } from '../utils/git.js';
|
|
7
7
|
import { ROOT_SELECTOR } from '../utils/package-filter.js';
|
|
8
8
|
import { expandReleaseTag, isCalendarVersion } from '../utils/release-version.js';
|
|
9
|
-
import { groupKeyOf } from '../utils/version-group.js';
|
|
9
|
+
import { groupKeyOf, versionLineCount } from '../utils/version-group.js';
|
|
10
10
|
import { stampVersionLabel } from '../utils/version-stamp.js';
|
|
11
11
|
import { ChangeHashService } from './change-hash.service.js';
|
|
12
12
|
import { changelogGroupBy } from './changelog.service.js';
|
|
@@ -301,22 +301,39 @@ export class VersionService extends Service {
|
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
(function (VersionService) {
|
|
304
|
-
/**
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
304
|
+
/**
|
|
305
|
+
* The message of one group's release commit.
|
|
306
|
+
*
|
|
307
|
+
* `.rmanrc version.commitMessage` (root-level) when it is set and every package in the commit
|
|
308
|
+
* shares one version - `{version}` is that version, `{name}` the packages' names, comma-separated.
|
|
309
|
+
* Unset, `chore(release): v{version}` while the repository releases along one version line, and
|
|
310
|
+
* `chore(release): <name>@<version>, ...` once it releases along several, so each commit says what
|
|
311
|
+
* it released. A commit spanning different versions always takes that listing form.
|
|
312
|
+
*/
|
|
313
|
+
/* **The listing once there is more than one line, because one message per commit cannot then name
|
|
314
|
+
* a release.** Reported from `syncbridge-io/syncbridge-extensions`: nine packages, each its own
|
|
315
|
+
* line, and every release left nine commits reading `chore(release): v2.1.0` - `git log` could not
|
|
316
|
+
* say which commit released which package. One line keeps the old message, so a repository whose
|
|
317
|
+
* packages move together sees no change; the test is `versionLineCount`, the same structural
|
|
318
|
+
* question that makes the tag pattern `{name}@*`, so the commit and its tag name the same thing.
|
|
319
|
+
*
|
|
320
|
+
* Both forms are ones `ConventionalCommitsService.isReleaseCommit` already recognizes - the listing
|
|
321
|
+
* is the cross-group-ripple shape - so no history needed a new matcher. */
|
|
308
322
|
function buildCommitMessage(repository, entries, messageOverride) {
|
|
309
323
|
const versions = new Set(entries.map(e => e.to));
|
|
324
|
+
const listing = `chore(release): ${entries.map(e => `${e.package.name}@${e.to}`).join(', ')}`;
|
|
310
325
|
if (versions.size === 1) {
|
|
311
326
|
const template = messageOverride ?? repository.rootPackage.config?.version?.commitMessage;
|
|
312
327
|
const version = entries[0].to;
|
|
313
|
-
if (typeof template === 'string' && template)
|
|
314
|
-
|
|
315
|
-
|
|
328
|
+
if (typeof template === 'string' && template) {
|
|
329
|
+
const names = entries.map(e => e.package.name).join(', ');
|
|
330
|
+
return template.replace(/\{version\}/g, version).replace(/\{name\}/g, names);
|
|
331
|
+
}
|
|
332
|
+
return versionLineCount(entries[0].package) > 1 ? listing : `chore(release): v${version}`;
|
|
316
333
|
}
|
|
317
334
|
if (messageOverride)
|
|
318
335
|
return messageOverride;
|
|
319
|
-
return
|
|
336
|
+
return listing;
|
|
320
337
|
}
|
|
321
338
|
VersionService.buildCommitMessage = buildCommitMessage;
|
|
322
339
|
/**
|