release-please 14.1.2 → 14.2.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/build/src/commit.d.ts +2 -1
  3. package/build/src/commit.js +2 -2
  4. package/build/src/github.d.ts +4 -0
  5. package/build/src/github.js +32 -29
  6. package/build/src/manifest.d.ts +3 -0
  7. package/build/src/manifest.js +66 -65
  8. package/build/src/plugin.d.ts +3 -1
  9. package/build/src/plugin.js +3 -1
  10. package/build/src/plugins/cargo-workspace.js +9 -10
  11. package/build/src/plugins/linked-versions.d.ts +2 -0
  12. package/build/src/plugins/linked-versions.js +5 -6
  13. package/build/src/plugins/maven-workspace.js +14 -14
  14. package/build/src/plugins/merge.js +1 -2
  15. package/build/src/plugins/node-workspace.js +11 -12
  16. package/build/src/plugins/workspace.d.ts +3 -1
  17. package/build/src/plugins/workspace.js +20 -20
  18. package/build/src/strategies/base.d.ts +3 -0
  19. package/build/src/strategies/base.js +26 -24
  20. package/build/src/strategies/dotnet-yoshi.js +2 -3
  21. package/build/src/strategies/go-yoshi.js +7 -8
  22. package/build/src/strategies/java-yoshi.js +1 -2
  23. package/build/src/strategies/java.js +9 -8
  24. package/build/src/strategies/php-yoshi.js +4 -5
  25. package/build/src/strategies/python.js +2 -3
  26. package/build/src/strategies/rust.js +8 -9
  27. package/build/src/update.d.ts +2 -1
  28. package/build/src/updaters/dart/pubspec-yaml.d.ts +2 -1
  29. package/build/src/updaters/dart/pubspec-yaml.js +4 -4
  30. package/build/src/updaters/dotnet/apis.d.ts +2 -1
  31. package/build/src/updaters/dotnet/apis.js +2 -2
  32. package/build/src/updaters/elixir/elixir-mix-exs.d.ts +2 -1
  33. package/build/src/updaters/elixir/elixir-mix-exs.js +2 -2
  34. package/build/src/updaters/generic-json.d.ts +2 -1
  35. package/build/src/updaters/generic-json.js +2 -2
  36. package/build/src/updaters/generic-yaml.d.ts +2 -1
  37. package/build/src/updaters/generic-yaml.js +3 -3
  38. package/build/src/updaters/generic.d.ts +2 -1
  39. package/build/src/updaters/generic.js +2 -2
  40. package/build/src/updaters/helm/chart-yaml.d.ts +2 -1
  41. package/build/src/updaters/helm/chart-yaml.js +2 -2
  42. package/build/src/updaters/java/java-update.d.ts +2 -1
  43. package/build/src/updaters/java/java-update.js +2 -2
  44. package/build/src/updaters/java/versions-manifest.d.ts +2 -1
  45. package/build/src/updaters/java/versions-manifest.js +2 -2
  46. package/build/src/updaters/krm/krm-blueprint-version.d.ts +2 -1
  47. package/build/src/updaters/krm/krm-blueprint-version.js +2 -2
  48. package/build/src/updaters/node/package-json.d.ts +2 -1
  49. package/build/src/updaters/node/package-json.js +2 -2
  50. package/build/src/updaters/node/package-lock-json.d.ts +2 -1
  51. package/build/src/updaters/node/package-lock-json.js +2 -2
  52. package/build/src/updaters/node/samples-package-json.d.ts +2 -1
  53. package/build/src/updaters/node/samples-package-json.js +2 -2
  54. package/build/src/updaters/ocaml/dune-project.d.ts +2 -1
  55. package/build/src/updaters/ocaml/dune-project.js +2 -2
  56. package/build/src/updaters/ocaml/esy-json.d.ts +2 -1
  57. package/build/src/updaters/ocaml/esy-json.js +2 -2
  58. package/build/src/updaters/ocaml/opam.d.ts +2 -1
  59. package/build/src/updaters/ocaml/opam.js +2 -2
  60. package/build/src/updaters/php/php-manifest.d.ts +2 -1
  61. package/build/src/updaters/php/php-manifest.js +3 -3
  62. package/build/src/updaters/php/root-composer-update-packages.d.ts +2 -1
  63. package/build/src/updaters/php/root-composer-update-packages.js +3 -3
  64. package/build/src/updaters/python/pyproject-toml.d.ts +2 -1
  65. package/build/src/updaters/python/pyproject-toml.js +2 -2
  66. package/build/src/updaters/rust/cargo-lock.d.ts +2 -1
  67. package/build/src/updaters/rust/cargo-lock.js +3 -3
  68. package/build/src/updaters/rust/cargo-toml.d.ts +2 -1
  69. package/build/src/updaters/rust/cargo-toml.js +7 -7
  70. package/build/src/updaters/terraform/module-version.d.ts +2 -1
  71. package/build/src/updaters/terraform/module-version.js +2 -2
  72. package/build/src/util/branch-name.d.ts +2 -1
  73. package/build/src/util/branch-name.js +2 -2
  74. package/build/src/util/pull-request-body.d.ts +2 -1
  75. package/build/src/util/pull-request-body.js +9 -9
  76. package/build/src/util/pull-request-title.d.ts +3 -2
  77. package/build/src/util/pull-request-title.js +8 -7
  78. package/build/src/versioning-strategies/default.d.ts +3 -0
  79. package/build/src/versioning-strategies/default.js +3 -1
  80. package/package.json +1 -1
@@ -22,9 +22,9 @@ const default_1 = require("../default");
22
22
  * version (for a v2 lock file).
23
23
  */
24
24
  class PackageLockJson extends default_1.DefaultUpdater {
25
- updateContent(content) {
25
+ updateContent(content, logger = logger_1.logger) {
26
26
  const parsed = JSON.parse(content);
27
- logger_1.logger.info(`updating from ${parsed.version} to ${this.version}`);
27
+ logger.info(`updating from ${parsed.version} to ${this.version}`);
28
28
  parsed.version = this.version.toString();
29
29
  if (parsed.lockfileVersion === 2) {
30
30
  parsed.packages[''].version = this.version.toString();
@@ -1,3 +1,4 @@
1
+ import { Logger } from '../../util/logger';
1
2
  import { DefaultUpdater, UpdateOptions } from '../default';
2
3
  interface SamplesPackageJsonOptions extends UpdateOptions {
3
4
  packageName: string;
@@ -18,6 +19,6 @@ export declare class SamplesPackageJson extends DefaultUpdater {
18
19
  * @param {string} content The initial content
19
20
  * @returns {string} The updated content
20
21
  */
21
- updateContent(content: string): string;
22
+ updateContent(content: string, logger?: Logger): string;
22
23
  }
23
24
  export {};
@@ -35,12 +35,12 @@ class SamplesPackageJson extends default_1.DefaultUpdater {
35
35
  * @param {string} content The initial content
36
36
  * @returns {string} The updated content
37
37
  */
38
- updateContent(content) {
38
+ updateContent(content, logger = logger_1.logger) {
39
39
  const parsed = JSON.parse(content);
40
40
  if (!parsed.dependencies || !parsed.dependencies[this.packageName]) {
41
41
  return content;
42
42
  }
43
- logger_1.logger.info(`updating ${this.packageName} dependency from ${parsed.dependencies[this.packageName]} to ^${this.version}`);
43
+ logger.info(`updating ${this.packageName} dependency from ${parsed.dependencies[this.packageName]} to ^${this.version}`);
44
44
  parsed.dependencies[this.packageName] = `^${this.version}`;
45
45
  return (0, json_stringify_1.jsonStringify)(parsed, content);
46
46
  }
@@ -1,3 +1,4 @@
1
+ import { Logger } from '../../util/logger';
1
2
  import { DefaultUpdater } from '../default';
2
3
  /**
3
4
  * Updates an OCaml dune-project file.
@@ -8,5 +9,5 @@ export declare class DuneProject extends DefaultUpdater {
8
9
  * @param {string} content The initial content
9
10
  * @returns {string} The updated content
10
11
  */
11
- updateContent(content: string): string;
12
+ updateContent(content: string, logger?: Logger): string;
12
13
  }
@@ -25,10 +25,10 @@ class DuneProject extends default_1.DefaultUpdater {
25
25
  * @param {string} content The initial content
26
26
  * @returns {string} The updated content
27
27
  */
28
- updateContent(content) {
28
+ updateContent(content, logger = logger_1.logger) {
29
29
  const oldVersion = content.match(/^\(version ([A-Za-z0-9_\-+.~]+)\)$/m);
30
30
  if (oldVersion) {
31
- logger_1.logger.info(`updating from ${oldVersion[1]} to ${this.version}`);
31
+ logger.info(`updating from ${oldVersion[1]} to ${this.version}`);
32
32
  }
33
33
  return content.replace(/^\(version ([A-Za-z0-9_\-+.~]+)\)$/m, `(version ${this.version})`);
34
34
  }
@@ -1,3 +1,4 @@
1
+ import { Logger } from '../../util/logger';
1
2
  import { DefaultUpdater } from '../default';
2
3
  /**
3
4
  * Updates an OCaml esy.json file.
@@ -8,5 +9,5 @@ export declare class EsyJson extends DefaultUpdater {
8
9
  * @param {string} content The initial content
9
10
  * @returns {string} The updated content
10
11
  */
11
- updateContent(content: string): string;
12
+ updateContent(content: string, logger?: Logger): string;
12
13
  }
@@ -26,9 +26,9 @@ class EsyJson extends default_1.DefaultUpdater {
26
26
  * @param {string} content The initial content
27
27
  * @returns {string} The updated content
28
28
  */
29
- updateContent(content) {
29
+ updateContent(content, logger = logger_1.logger) {
30
30
  const parsed = JSON.parse(content);
31
- logger_1.logger.info(`updating from ${parsed.version} to ${this.version}`);
31
+ logger.info(`updating from ${parsed.version} to ${this.version}`);
32
32
  parsed.version = this.version.toString();
33
33
  return (0, json_stringify_1.jsonStringify)(parsed, content);
34
34
  }
@@ -1,3 +1,4 @@
1
+ import { Logger } from '../../util/logger';
1
2
  import { DefaultUpdater } from '../default';
2
3
  /**
3
4
  * Updates an OCaml .opam file
@@ -8,5 +9,5 @@ export declare class Opam extends DefaultUpdater {
8
9
  * @param {string} content The initial content
9
10
  * @returns {string} The updated content
10
11
  */
11
- updateContent(content: string): string;
12
+ updateContent(content: string, logger?: Logger): string;
12
13
  }
@@ -25,10 +25,10 @@ class Opam extends default_1.DefaultUpdater {
25
25
  * @param {string} content The initial content
26
26
  * @returns {string} The updated content
27
27
  */
28
- updateContent(content) {
28
+ updateContent(content, logger = logger_1.logger) {
29
29
  const oldVersion = content.match(/^version: "([A-Za-z0-9_\-+.~]+)"$/m);
30
30
  if (oldVersion) {
31
- logger_1.logger.info(`updating from ${oldVersion[1]} to ${this.version}`);
31
+ logger.info(`updating from ${oldVersion[1]} to ${this.version}`);
32
32
  }
33
33
  return content.replace(/^version: "[A-Za-z0-9_\-+.~]+"$/m, `version: "${this.version}"`);
34
34
  }
@@ -1,3 +1,4 @@
1
+ import { Logger } from '../../util/logger';
1
2
  import { DefaultUpdater } from '../default';
2
3
  /**
3
4
  * Updates a manifest.json file.
@@ -9,5 +10,5 @@ export declare class PHPManifest extends DefaultUpdater {
9
10
  * @param {string} content The initial content
10
11
  * @returns {string} The updated content
11
12
  */
12
- updateContent(content: string): string;
13
+ updateContent(content: string, logger?: Logger): string;
13
14
  }
@@ -27,9 +27,9 @@ class PHPManifest extends default_1.DefaultUpdater {
27
27
  * @param {string} content The initial content
28
28
  * @returns {string} The updated content
29
29
  */
30
- updateContent(content) {
30
+ updateContent(content, logger = logger_1.logger) {
31
31
  if (!this.versionsMap || this.versionsMap.size === 0) {
32
- logger_1.logger.info('no updates necessary');
32
+ logger.info('no updates necessary');
33
33
  return content;
34
34
  }
35
35
  const parsed = JSON.parse(content);
@@ -38,7 +38,7 @@ class PHPManifest extends default_1.DefaultUpdater {
38
38
  return;
39
39
  for (const [key, version] of this.versionsMap) {
40
40
  if (module.name === key) {
41
- logger_1.logger.info(`adding ${key}@${version} to manifest`);
41
+ logger.info(`adding ${key}@${version} to manifest`);
42
42
  module.versions.unshift(`v${version}`);
43
43
  }
44
44
  }
@@ -1,3 +1,4 @@
1
+ import { Logger } from '../../util/logger';
1
2
  import { DefaultUpdater } from '../default';
2
3
  /**
3
4
  * Updates a root composer.json
@@ -8,5 +9,5 @@ export declare class RootComposerUpdatePackages extends DefaultUpdater {
8
9
  * @param {string} content The initial content
9
10
  * @returns {string} The updated content
10
11
  */
11
- updateContent(content: string): string;
12
+ updateContent(content: string, logger?: Logger): string;
12
13
  }
@@ -26,9 +26,9 @@ class RootComposerUpdatePackages extends default_1.DefaultUpdater {
26
26
  * @param {string} content The initial content
27
27
  * @returns {string} The updated content
28
28
  */
29
- updateContent(content) {
29
+ updateContent(content, logger = logger_1.logger) {
30
30
  if (!this.versionsMap || this.versionsMap.size === 0) {
31
- logger_1.logger.info('no updates necessary');
31
+ logger.info('no updates necessary');
32
32
  return content;
33
33
  }
34
34
  const parsed = JSON.parse(content);
@@ -44,7 +44,7 @@ class RootComposerUpdatePackages extends default_1.DefaultUpdater {
44
44
  fromVersion !== null && fromVersion !== void 0 ? fromVersion : (fromVersion = parsed[key]);
45
45
  parsed[key] = toVersion;
46
46
  }
47
- logger_1.logger.info(`updating ${key} from ${fromVersion} to ${toVersion}`);
47
+ logger.info(`updating ${key} from ${fromVersion} to ${toVersion}`);
48
48
  }
49
49
  }
50
50
  return (0, json_stringify_1.jsonStringify)(parsed, content);
@@ -1,3 +1,4 @@
1
+ import { Logger } from '../../util/logger';
1
2
  import { DefaultUpdater } from '../default';
2
3
  interface PyProjectContent {
3
4
  name: string;
@@ -22,6 +23,6 @@ export declare class PyProjectToml extends DefaultUpdater {
22
23
  * @param {string} content The initial content
23
24
  * @returns {string} The updated content
24
25
  */
25
- updateContent(content: string): string;
26
+ updateContent(content: string, logger?: Logger): string;
26
27
  }
27
28
  export {};
@@ -31,13 +31,13 @@ class PyProjectToml extends default_1.DefaultUpdater {
31
31
  * @param {string} content The initial content
32
32
  * @returns {string} The updated content
33
33
  */
34
- updateContent(content) {
34
+ updateContent(content, logger = logger_1.logger) {
35
35
  var _a;
36
36
  const parsed = parsePyProject(content);
37
37
  const project = parsed.project || ((_a = parsed.tool) === null || _a === void 0 ? void 0 : _a.poetry);
38
38
  if (!(project === null || project === void 0 ? void 0 : project.version)) {
39
39
  const msg = 'invalid file';
40
- logger_1.logger.error(msg);
40
+ logger.error(msg);
41
41
  throw new Error(msg);
42
42
  }
43
43
  return (0, toml_edit_1.replaceTomlValue)(content, (parsed.project ? ['project'] : ['tool', 'poetry']).concat('version'), this.version.toString());
@@ -1,3 +1,4 @@
1
+ import { Logger } from '../../util/logger';
1
2
  import { Updater } from '../../update';
2
3
  import { VersionsMap } from '../../version';
3
4
  /**
@@ -11,5 +12,5 @@ export declare class CargoLock implements Updater {
11
12
  * @param {string} content The initial content
12
13
  * @returns {string} The updated content
13
14
  */
14
- updateContent(content: string): string;
15
+ updateContent(content: string, logger?: Logger): string;
15
16
  }
@@ -29,11 +29,11 @@ class CargoLock {
29
29
  * @param {string} content The initial content
30
30
  * @returns {string} The updated content
31
31
  */
32
- updateContent(content) {
32
+ updateContent(content, logger = logger_1.logger) {
33
33
  let payload = content;
34
34
  const parsed = (0, common_1.parseCargoLockfile)(payload);
35
35
  if (!parsed.package) {
36
- logger_1.logger.error('is not a Cargo lockfile');
36
+ logger.error('is not a Cargo lockfile');
37
37
  throw new Error('is not a Cargo lockfile');
38
38
  }
39
39
  // n.b for `replaceTomlString`, we need to keep track of the index
@@ -54,7 +54,7 @@ class CargoLock {
54
54
  // which is lucky because `replaceTomlString` expect "all strings" in its
55
55
  // `path` argument.
56
56
  const packageIndex = i.toString();
57
- logger_1.logger.info(`updating ${pkg.name} in`);
57
+ logger.info(`updating ${pkg.name} in`);
58
58
  payload = (0, toml_edit_1.replaceTomlValue)(payload, ['package', packageIndex, 'version'], nextVersion.toString());
59
59
  }
60
60
  return payload;
@@ -1,3 +1,4 @@
1
+ import { Logger } from '../../util/logger';
1
2
  import { DefaultUpdater } from '../default';
2
3
  /**
3
4
  * Updates `Cargo.toml` manifests, preserving formatting and comments.
@@ -8,5 +9,5 @@ export declare class CargoToml extends DefaultUpdater {
8
9
  * @param {string} content The initial content
9
10
  * @returns {string} The updated content
10
11
  */
11
- updateContent(content: string): string;
12
+ updateContent(content: string, logger?: Logger): string;
12
13
  }
@@ -27,7 +27,7 @@ class CargoToml extends default_1.DefaultUpdater {
27
27
  * @param {string} content The initial content
28
28
  * @returns {string} The updated content
29
29
  */
30
- updateContent(content) {
30
+ updateContent(content, logger = logger_1.logger) {
31
31
  let payload = content;
32
32
  if (!this.versionsMap) {
33
33
  throw new Error('updateContent called with no versions');
@@ -35,7 +35,7 @@ class CargoToml extends default_1.DefaultUpdater {
35
35
  const parsed = (0, common_1.parseCargoManifest)(payload);
36
36
  if (!parsed.package) {
37
37
  const msg = 'is not a package manifest (might be a cargo workspace)';
38
- logger_1.logger.error(msg);
38
+ logger.error(msg);
39
39
  throw new Error(msg);
40
40
  }
41
41
  payload = (0, toml_edit_1.replaceTomlValue)(payload, ['package', 'version'], this.version.toString());
@@ -50,14 +50,14 @@ class CargoToml extends default_1.DefaultUpdater {
50
50
  }
51
51
  const dep = deps[pkgName];
52
52
  if (typeof dep === 'string' || typeof dep.path === 'undefined') {
53
- logger_1.logger.info(`skipping ${depKind}.${pkgName} (no path set)`);
53
+ logger.info(`skipping ${depKind}.${pkgName} (no path set)`);
54
54
  continue; // to next depKind
55
55
  }
56
56
  if (typeof dep.version === 'undefined') {
57
- logger_1.logger.info(`skipping ${depKind}.${pkgName} (no version set)`);
57
+ logger.info(`skipping ${depKind}.${pkgName} (no version set)`);
58
58
  continue; // to next depKind
59
59
  }
60
- logger_1.logger.info(`updating ${depKind}.${pkgName} from ${dep.version} to ${pkgVersion}`);
60
+ logger.info(`updating ${depKind}.${pkgName} from ${dep.version} to ${pkgVersion}`);
61
61
  payload = (0, toml_edit_1.replaceTomlValue)(payload, [depKind, pkgName, 'version'], pkgVersion.toString());
62
62
  }
63
63
  // Update platform-specific dependencies
@@ -73,10 +73,10 @@ class CargoToml extends default_1.DefaultUpdater {
73
73
  }
74
74
  const dep = deps[pkgName];
75
75
  if (typeof dep === 'string' || typeof dep.path === 'undefined') {
76
- logger_1.logger.info(`skipping target.${targetName}.${depKind}.${pkgName} in`);
76
+ logger.info(`skipping target.${targetName}.${depKind}.${pkgName} in`);
77
77
  continue; // to next depKind
78
78
  }
79
- logger_1.logger.info(`updating target.${targetName}.${depKind}.${pkgName} from ${dep.version} to ${pkgVersion}`);
79
+ logger.info(`updating target.${targetName}.${depKind}.${pkgName} from ${dep.version} to ${pkgVersion}`);
80
80
  payload = (0, toml_edit_1.replaceTomlValue)(payload, ['target', targetName, depKind, pkgName, 'version'], pkgVersion.toString());
81
81
  }
82
82
  }
@@ -1,3 +1,4 @@
1
+ import { Logger } from '../../util/logger';
1
2
  import { DefaultUpdater } from '../default';
2
3
  /**
3
4
  * Updates a Terraform Module versions.tf file.
@@ -8,5 +9,5 @@ export declare class ModuleVersion extends DefaultUpdater {
8
9
  * @param {string} content The initial content
9
10
  * @returns {string} The updated content
10
11
  */
11
- updateContent(content: string): string;
12
+ updateContent(content: string, logger?: Logger): string;
12
13
  }
@@ -25,10 +25,10 @@ class ModuleVersion extends default_1.DefaultUpdater {
25
25
  * @param {string} content The initial content
26
26
  * @returns {string} The updated content
27
27
  */
28
- updateContent(content) {
28
+ updateContent(content, logger = logger_1.logger) {
29
29
  const oldVersion = content.match(/v[0-9]+\.[0-9]+\.[0-9]+(-\w+)?/);
30
30
  if (oldVersion) {
31
- logger_1.logger.info(`updating from ${oldVersion} to v${this.version}`);
31
+ logger.info(`updating from ${oldVersion} to v${this.version}`);
32
32
  }
33
33
  return content.replace(/v[0-9]+\.[0-9]+\.[0-9]+(-\w+)?/g, `v${this.version}`);
34
34
  }
@@ -1,9 +1,10 @@
1
1
  import { Version } from '../version';
2
+ import { Logger } from './logger';
2
3
  export declare class BranchName {
3
4
  component?: string;
4
5
  targetBranch?: string;
5
6
  version?: Version;
6
- static parse(branchName: string): BranchName | undefined;
7
+ static parse(branchName: string, logger?: Logger): BranchName | undefined;
7
8
  static ofComponentVersion(branchPrefix: string, version: Version): BranchName;
8
9
  static ofVersion(version: Version): BranchName;
9
10
  static ofTargetBranch(targetBranch: string): BranchName;
@@ -32,7 +32,7 @@ function getAllResourceNames() {
32
32
  }
33
33
  class BranchName {
34
34
  constructor(_branchName) { }
35
- static parse(branchName) {
35
+ static parse(branchName, logger = logger_1.logger) {
36
36
  try {
37
37
  const branchNameClass = getAllResourceNames().find(clazz => {
38
38
  return clazz.matches(branchName);
@@ -43,7 +43,7 @@ class BranchName {
43
43
  return new branchNameClass(branchName);
44
44
  }
45
45
  catch (e) {
46
- logger_1.logger.warn(`Error parsing branch name: ${branchName}`, e);
46
+ logger.warn(`Error parsing branch name: ${branchName}`, e);
47
47
  return undefined;
48
48
  }
49
49
  }
@@ -1,3 +1,4 @@
1
+ import { Logger } from './logger';
1
2
  import { Version } from '../version';
2
3
  interface PullRequestBodyOptions {
3
4
  header?: string;
@@ -12,7 +13,7 @@ export declare class PullRequestBody {
12
13
  releaseData: ReleaseData[];
13
14
  useComponents: boolean;
14
15
  constructor(releaseData: ReleaseData[], options?: PullRequestBodyOptions);
15
- static parse(body: string): PullRequestBody | undefined;
16
+ static parse(body: string, logger?: Logger): PullRequestBody | undefined;
16
17
  notes(): string;
17
18
  toString(): string;
18
19
  }
@@ -29,17 +29,17 @@ class PullRequestBody {
29
29
  this.releaseData = releaseData;
30
30
  this.useComponents = (_a = options === null || options === void 0 ? void 0 : options.useComponents) !== null && _a !== void 0 ? _a : this.releaseData.length > 1;
31
31
  }
32
- static parse(body) {
32
+ static parse(body, logger = logger_1.logger) {
33
33
  const parts = splitBody(body);
34
34
  if (!parts) {
35
- logger_1.logger.error('Pull request body did not match');
35
+ logger.error('Pull request body did not match');
36
36
  return undefined;
37
37
  }
38
- let data = extractMultipleReleases(parts.content);
38
+ let data = extractMultipleReleases(parts.content, logger);
39
39
  if (data.length === 0) {
40
- data = extractSingleRelease(parts.content);
40
+ data = extractSingleRelease(parts.content, logger);
41
41
  if (data.length === 0) {
42
- logger_1.logger.warn('Failed to parse releases.');
42
+ logger.warn('Failed to parse releases.');
43
43
  }
44
44
  }
45
45
  return new PullRequestBody(data, {
@@ -92,7 +92,7 @@ function splitBody(body) {
92
92
  }
93
93
  const SUMMARY_PATTERN = /^(?<component>.*[^:]):? (?<version>\d+\.\d+\.\d+.*)$/;
94
94
  const COMPONENTLESS_SUMMARY_PATTERN = /^(?<version>\d+\.\d+\.\d+.*)$/;
95
- function extractMultipleReleases(notes) {
95
+ function extractMultipleReleases(notes, logger) {
96
96
  const data = [];
97
97
  const root = (0, node_html_parser_1.parse)(notes);
98
98
  for (const detail of root.getElementsByTagName('details')) {
@@ -111,7 +111,7 @@ function extractMultipleReleases(notes) {
111
111
  else {
112
112
  const componentlessMatch = summary.match(COMPONENTLESS_SUMMARY_PATTERN);
113
113
  if (!(componentlessMatch === null || componentlessMatch === void 0 ? void 0 : componentlessMatch.groups)) {
114
- logger_1.logger.warn(`Summary: ${summary} did not match the expected pattern`);
114
+ logger.warn(`Summary: ${summary} did not match the expected pattern`);
115
115
  continue;
116
116
  }
117
117
  detail.removeChild(summaryNode);
@@ -125,13 +125,13 @@ function extractMultipleReleases(notes) {
125
125
  return data;
126
126
  }
127
127
  const COMPARE_REGEX = /^#{2,} \[?(?<version>\d+\.\d+\.\d+.*)\]?/;
128
- function extractSingleRelease(body) {
128
+ function extractSingleRelease(body, logger) {
129
129
  var _a;
130
130
  body = body.trim();
131
131
  const match = body.match(COMPARE_REGEX);
132
132
  const versionString = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.version;
133
133
  if (!versionString) {
134
- logger_1.logger.warn('Failed to find version in release notes');
134
+ logger.warn('Failed to find version in release notes');
135
135
  return [];
136
136
  }
137
137
  return [
@@ -1,5 +1,6 @@
1
+ import { Logger } from './logger';
1
2
  import { Version } from '../version';
2
- export declare function generateMatchPattern(pullRequestTitlePattern?: string): RegExp;
3
+ export declare function generateMatchPattern(pullRequestTitlePattern?: string, logger?: Logger): RegExp;
3
4
  export declare class PullRequestTitle {
4
5
  component?: string;
5
6
  targetBranch?: string;
@@ -7,7 +8,7 @@ export declare class PullRequestTitle {
7
8
  pullRequestTitlePattern: string;
8
9
  matchPattern: RegExp;
9
10
  private constructor();
10
- static parse(title: string, pullRequestTitlePattern?: string): PullRequestTitle | undefined;
11
+ static parse(title: string, pullRequestTitlePattern?: string, logger?: Logger): PullRequestTitle | undefined;
11
12
  static ofComponentVersion(component: string, version: Version, pullRequestTitlePattern?: string): PullRequestTitle;
12
13
  static ofVersion(version: Version, pullRequestTitlePattern?: string): PullRequestTitle;
13
14
  static ofTargetBranchVersion(targetBranch: string, version: Version, pullRequestTitlePattern?: string): PullRequestTitle;
@@ -20,16 +20,16 @@ const version_1 = require("../version");
20
20
  // at the script level are undefined, they are only defined inside function
21
21
  // or instance methods/properties.
22
22
  const DEFAULT_PR_TITLE_PATTERN = 'chore${scope}: release${component} ${version}';
23
- function generateMatchPattern(pullRequestTitlePattern) {
23
+ function generateMatchPattern(pullRequestTitlePattern, logger = logger_1.logger) {
24
24
  if (pullRequestTitlePattern &&
25
25
  pullRequestTitlePattern.search(/\$\{scope\}/) === -1)
26
- logger_1.logger.warn("pullRequestTitlePattern miss the part of '${scope}'");
26
+ logger.warn("pullRequestTitlePattern miss the part of '${scope}'");
27
27
  if (pullRequestTitlePattern &&
28
28
  pullRequestTitlePattern.search(/\$\{component\}/) === -1)
29
- logger_1.logger.warn("pullRequestTitlePattern miss the part of '${component}'");
29
+ logger.warn("pullRequestTitlePattern miss the part of '${component}'");
30
30
  if (pullRequestTitlePattern &&
31
31
  pullRequestTitlePattern.search(/\$\{version\}/) === -1)
32
- logger_1.logger.warn("pullRequestTitlePattern miss the part of '${version}'");
32
+ logger.warn("pullRequestTitlePattern miss the part of '${version}'");
33
33
  return new RegExp(`^${(pullRequestTitlePattern || DEFAULT_PR_TITLE_PATTERN)
34
34
  .replace('[', '\\[') // TODO: handle all regex escaping
35
35
  .replace(']', '\\]')
@@ -46,10 +46,10 @@ class PullRequestTitle {
46
46
  this.targetBranch = opts.targetBranch;
47
47
  this.pullRequestTitlePattern =
48
48
  opts.pullRequestTitlePattern || DEFAULT_PR_TITLE_PATTERN;
49
- this.matchPattern = generateMatchPattern(this.pullRequestTitlePattern);
49
+ this.matchPattern = generateMatchPattern(this.pullRequestTitlePattern, opts.logger);
50
50
  }
51
- static parse(title, pullRequestTitlePattern) {
52
- const matchPattern = generateMatchPattern(pullRequestTitlePattern);
51
+ static parse(title, pullRequestTitlePattern, logger = logger_1.logger) {
52
+ const matchPattern = generateMatchPattern(pullRequestTitlePattern, logger);
53
53
  const match = title.match(matchPattern);
54
54
  if (match === null || match === void 0 ? void 0 : match.groups) {
55
55
  return new PullRequestTitle({
@@ -59,6 +59,7 @@ class PullRequestTitle {
59
59
  component: match.groups['component'],
60
60
  targetBranch: match.groups['branch'],
61
61
  pullRequestTitlePattern,
62
+ logger,
62
63
  });
63
64
  }
64
65
  return undefined;
@@ -1,9 +1,11 @@
1
1
  import { VersioningStrategy, VersionUpdater } from '../versioning-strategy';
2
2
  import { ConventionalCommit } from '../commit';
3
3
  import { Version } from '../version';
4
+ import { Logger } from '../util/logger';
4
5
  interface DefaultVersioningStrategyOptions {
5
6
  bumpMinorPreMajor?: boolean;
6
7
  bumpPatchForMinorPreMajor?: boolean;
8
+ logger?: Logger;
7
9
  }
8
10
  /**
9
11
  * This is the default VersioningStrategy for release-please. Breaking
@@ -13,6 +15,7 @@ interface DefaultVersioningStrategyOptions {
13
15
  export declare class DefaultVersioningStrategy implements VersioningStrategy {
14
16
  readonly bumpMinorPreMajor: boolean;
15
17
  readonly bumpPatchForMinorPreMajor: boolean;
18
+ protected logger: Logger;
16
19
  /**
17
20
  * Create a new DefaultVersioningStrategy
18
21
  * @param {DefaultVersioningStrategyOptions} options Configuration options
@@ -32,8 +32,10 @@ class DefaultVersioningStrategy {
32
32
  * 1.0.0, then bump the patch version for features
33
33
  */
34
34
  constructor(options = {}) {
35
+ var _a;
35
36
  this.bumpMinorPreMajor = options.bumpMinorPreMajor === true;
36
37
  this.bumpPatchForMinorPreMajor = options.bumpPatchForMinorPreMajor === true;
38
+ this.logger = (_a = options.logger) !== null && _a !== void 0 ? _a : logger_1.logger;
37
39
  }
38
40
  /**
39
41
  * Given the current version of an artifact and a list of commits,
@@ -53,7 +55,7 @@ class DefaultVersioningStrategy {
53
55
  const releaseAs = commit.notes.find(note => note.title === 'RELEASE AS');
54
56
  if (releaseAs) {
55
57
  // commits are handled newest to oldest, so take the first one (newest) found
56
- logger_1.logger.debug(`found Release-As: ${releaseAs.text}, forcing version`);
58
+ this.logger.debug(`found Release-As: ${releaseAs.text}, forcing version`);
57
59
  return new versioning_strategy_1.CustomVersionUpdate(version_1.Version.parse(releaseAs.text).toString());
58
60
  }
59
61
  if (commit.breaking) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "14.1.2",
3
+ "version": "14.2.2",
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",