release-please 14.5.0 → 14.6.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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [14.6.0](https://github.com/googleapis/release-please/compare/v14.5.0...v14.6.0) (2022-09-15)
8
+
9
+
10
+ ### Features
11
+
12
+ * Allow nesting multiple commits that are parsed independently ([#1566](https://github.com/googleapis/release-please/issues/1566)) ([21ed59a](https://github.com/googleapis/release-please/commit/21ed59a1db32c6b9593931519bfa3b1eb456a4a7))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **deps:** Update dependency node-html-parser to v6 ([#1633](https://github.com/googleapis/release-please/issues/1633)) ([af213c4](https://github.com/googleapis/release-please/commit/af213c404a87754747bc3becab6b5759320d7508))
18
+
7
19
  ## [14.5.0](https://github.com/googleapis/release-please/compare/v14.4.0...v14.5.0) (2022-09-07)
8
20
 
9
21
 
@@ -283,6 +283,21 @@ function hasExtendedContext(line) {
283
283
  function parseCommits(message) {
284
284
  return conventionalCommitsFilter(toConventionalChangelogFormat(parser.parser(message))).map(postProcessCommits);
285
285
  }
286
+ // If someone wishes to aggregate multiple, complex commit messages into a
287
+ // single commit, they can include one or more `BEGIN_NESTED_COMMIT`/`END_NESTED_COMMIT`
288
+ // blocks into the body of the commit
289
+ function splitMessages(message) {
290
+ const parts = message.split('BEGIN_NESTED_COMMIT');
291
+ const messages = [parts.shift()];
292
+ for (const part of parts) {
293
+ const [newMessage, ...rest] = part.split('END_NESTED_COMMIT');
294
+ messages.push(newMessage);
295
+ // anthing outside of the BEGIN/END annotations are added to the original
296
+ // commit
297
+ messages[0] = messages[0] + rest.join();
298
+ }
299
+ return messages;
300
+ }
286
301
  /**
287
302
  * Given a list of raw commits, parse and expand into conventional commits.
288
303
  *
@@ -295,27 +310,28 @@ function parseCommits(message) {
295
310
  function parseConventionalCommits(commits, logger = logger_1.logger) {
296
311
  const conventionalCommits = [];
297
312
  for (const commit of commits) {
298
- const commitMessage = preprocessCommitMessage(commit);
299
- try {
300
- for (const parsedCommit of parseCommits(commitMessage)) {
301
- const breaking = parsedCommit.notes.filter(note => note.title === 'BREAKING CHANGE')
302
- .length > 0;
303
- conventionalCommits.push({
304
- sha: commit.sha,
305
- message: parsedCommit.header,
306
- files: commit.files,
307
- pullRequest: commit.pullRequest,
308
- type: parsedCommit.type,
309
- scope: parsedCommit.scope,
310
- bareMessage: parsedCommit.subject,
311
- notes: parsedCommit.notes,
312
- references: parsedCommit.references,
313
- breaking,
314
- });
313
+ for (const commitMessage of splitMessages(preprocessCommitMessage(commit))) {
314
+ try {
315
+ for (const parsedCommit of parseCommits(commitMessage)) {
316
+ const breaking = parsedCommit.notes.filter(note => note.title === 'BREAKING CHANGE')
317
+ .length > 0;
318
+ conventionalCommits.push({
319
+ sha: commit.sha,
320
+ message: parsedCommit.header,
321
+ files: commit.files,
322
+ pullRequest: commit.pullRequest,
323
+ type: parsedCommit.type,
324
+ scope: parsedCommit.scope,
325
+ bareMessage: parsedCommit.subject,
326
+ notes: parsedCommit.notes,
327
+ references: parsedCommit.references,
328
+ breaking,
329
+ });
330
+ }
331
+ }
332
+ catch (_err) {
333
+ logger.debug(`commit could not be parsed: ${commit.sha} ${commit.message.split('\n')[0]}`);
315
334
  }
316
- }
317
- catch (_err) {
318
- logger.debug(`commit could not be parsed: ${commit.sha} ${commit.message.split('\n')[0]}`);
319
335
  }
320
336
  }
321
337
  return conventionalCommits;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "14.5.0",
3
+ "version": "14.6.0",
4
4
  "description": "generate release PRs based on the conventionalcommits.org spec",
5
5
  "main": "./build/src/index.js",
6
6
  "bin": "./build/src/bin/release-please.js",
@@ -90,7 +90,7 @@
90
90
  "figures": "^3.0.0",
91
91
  "js-yaml": "^4.0.0",
92
92
  "jsonpath": "^1.1.1",
93
- "node-html-parser": "^5.0.0",
93
+ "node-html-parser": "^6.0.0",
94
94
  "parse-github-repo-url": "^1.4.1",
95
95
  "semver": "^7.0.0",
96
96
  "type-fest": "^2.0.0",