release-please 13.16.5 → 13.17.1

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 (44) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/build/src/bin/release-please.js +14 -13
  3. package/build/src/commit.js +1 -1
  4. package/build/src/factories/plugin-factory.js +2 -0
  5. package/build/src/factory.js +8 -4
  6. package/build/src/github.js +7 -6
  7. package/build/src/index.js +1 -0
  8. package/build/src/manifest.js +7 -5
  9. package/build/src/plugins/cargo-workspace.js +15 -53
  10. package/build/src/plugins/linked-versions.js +1 -1
  11. package/build/src/plugins/maven-workspace.d.ts +28 -0
  12. package/build/src/plugins/maven-workspace.js +253 -0
  13. package/build/src/plugins/merge.js +1 -1
  14. package/build/src/plugins/node-workspace.js +12 -50
  15. package/build/src/plugins/workspace.d.ts +3 -2
  16. package/build/src/plugins/workspace.js +42 -1
  17. package/build/src/strategies/base.js +2 -2
  18. package/build/src/strategies/dotnet-yoshi.js +2 -1
  19. package/build/src/strategies/go-yoshi.js +1 -1
  20. package/build/src/strategies/java.js +1 -1
  21. package/build/src/strategies/php-yoshi.js +1 -1
  22. package/build/src/strategies/python.js +1 -1
  23. package/build/src/strategies/ruby-yoshi.js +4 -4
  24. package/build/src/strategies/ruby.js +1 -1
  25. package/build/src/strategies/rust.js +2 -2
  26. package/build/src/updaters/dotnet/apis.js +1 -1
  27. package/build/src/updaters/generic-json.js +1 -1
  28. package/build/src/updaters/java/pom-xml.d.ts +17 -2
  29. package/build/src/updaters/java/pom-xml.js +90 -7
  30. package/build/src/updaters/node/package-json.js +1 -1
  31. package/build/src/updaters/node/package-lock-json.js +1 -1
  32. package/build/src/updaters/node/samples-package-json.js +1 -1
  33. package/build/src/updaters/ocaml/esy-json.js +1 -1
  34. package/build/src/updaters/php/php-manifest.js +1 -1
  35. package/build/src/updaters/php/root-composer-update-packages.js +1 -1
  36. package/build/src/updaters/python/pyproject-toml.js +1 -1
  37. package/build/src/updaters/release-please-config.js +1 -1
  38. package/build/src/updaters/release-please-manifest.js +1 -1
  39. package/build/src/updaters/rust/cargo-lock.js +2 -2
  40. package/build/src/updaters/rust/cargo-toml.js +4 -4
  41. package/build/src/util/coerce-option.js +2 -2
  42. package/build/src/util/pull-request-body.js +1 -1
  43. package/build/src/util/pull-request-title.js +5 -3
  44. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -4,6 +4,29 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ### [13.17.1](https://github.com/googleapis/release-please/compare/v13.17.0...v13.17.1) (2022-05-27)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **deps:** headings are now always H2 ([#1454](https://github.com/googleapis/release-please/issues/1454)) ([32a2fe4](https://github.com/googleapis/release-please/commit/32a2fe497b51be7def2646c1aceebd9c5c6a167e)), closes [#1389](https://github.com/googleapis/release-please/issues/1389)
13
+
14
+ ## [13.17.0](https://github.com/googleapis/release-please/compare/v13.16.6...v13.17.0) (2022-05-24)
15
+
16
+
17
+ ### Features
18
+
19
+ * add maven-workspace plugin ([#1446](https://github.com/googleapis/release-please/issues/1446)) ([ef4d728](https://github.com/googleapis/release-please/commit/ef4d7283143d6ca70c3b894322975a9a2852dfaa))
20
+ * PomXml updater can update dependency versions ([ef4d728](https://github.com/googleapis/release-please/commit/ef4d7283143d6ca70c3b894322975a9a2852dfaa))
21
+
22
+ ### [13.16.6](https://github.com/googleapis/release-please/compare/v13.16.5...v13.16.6) (2022-05-24)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * allow brackets in custom pull request title ([#1445](https://github.com/googleapis/release-please/issues/1445)) ([5cdbc5b](https://github.com/googleapis/release-please/commit/5cdbc5b6735392a64ae93d578e287b27c0b34d05)), closes [#1444](https://github.com/googleapis/release-please/issues/1444)
28
+ * **deps:** update dependency code-suggester to v3 ([#1441](https://github.com/googleapis/release-please/issues/1441)) ([8473c99](https://github.com/googleapis/release-please/commit/8473c99e12311b9a65441ff11d46990a1a494c6a))
29
+
7
30
  ### [13.16.5](https://github.com/googleapis/release-please/compare/v13.16.4...v13.16.5) (2022-05-18)
8
31
 
9
32
 
@@ -62,11 +62,11 @@ function gitHubOptions(yargs) {
62
62
  // allow secrets to be loaded from file path
63
63
  // rather than being passed directly to the bin.
64
64
  if (argv.token)
65
- argv.token = coerce_option_1.coerceOption(argv.token);
65
+ argv.token = (0, coerce_option_1.coerceOption)(argv.token);
66
66
  if (argv.apiUrl)
67
- argv.apiUrl = coerce_option_1.coerceOption(argv.apiUrl);
67
+ argv.apiUrl = (0, coerce_option_1.coerceOption)(argv.apiUrl);
68
68
  if (argv.graphqlUrl)
69
- argv.graphqlUrl = coerce_option_1.coerceOption(argv.graphqlUrl);
69
+ argv.graphqlUrl = (0, coerce_option_1.coerceOption)(argv.graphqlUrl);
70
70
  });
71
71
  }
72
72
  function releaseOptions(yargs) {
@@ -164,7 +164,7 @@ function pullRequestStrategyOptions(yargs) {
164
164
  })
165
165
  .option('versioning-strategy', {
166
166
  describe: 'strategy used for bumping versions',
167
- choices: factory_1.getVersioningStrategyTypes(),
167
+ choices: (0, factory_1.getVersioningStrategyTypes)(),
168
168
  default: 'default',
169
169
  })
170
170
  .option('changelog-path', {
@@ -174,14 +174,14 @@ function pullRequestStrategyOptions(yargs) {
174
174
  })
175
175
  .option('changelog-type', {
176
176
  describe: 'type of changelog to build',
177
- choices: factory_1.getChangelogTypes(),
177
+ choices: (0, factory_1.getChangelogTypes)(),
178
178
  })
179
179
  .option('changelog-sections', {
180
180
  describe: 'comma-separated list of scopes to include in the changelog',
181
181
  type: 'string',
182
182
  coerce: (arg) => {
183
183
  if (arg) {
184
- return changelog_notes_1.buildChangelogSections(arg.split(','));
184
+ return (0, changelog_notes_1.buildChangelogSections)(arg.split(','));
185
185
  }
186
186
  return arg;
187
187
  },
@@ -236,7 +236,7 @@ function manifestConfigOptions(yargs, defaultType) {
236
236
  })
237
237
  .option('release-type', {
238
238
  describe: 'what type of repo is a release being created for?',
239
- choices: factory_1.getReleaserTypes(),
239
+ choices: (0, factory_1.getReleaserTypes)(),
240
240
  default: defaultType,
241
241
  });
242
242
  }
@@ -321,7 +321,7 @@ const createReleasePullRequestCommand = {
321
321
  if (argv.trace) {
322
322
  const change = changes.get(update.path);
323
323
  if (change) {
324
- const patch = diff_1.createPatch(update.path, change.originalContent || '', change.content || '');
324
+ const patch = (0, diff_1.createPatch)(update.path, change.originalContent || '', change.content || '');
325
325
  console.log(patch);
326
326
  }
327
327
  else {
@@ -513,10 +513,10 @@ exports.parser = yargs
513
513
  })
514
514
  .middleware(argv => {
515
515
  if (argv.trace) {
516
- logger_1.setLogger(new logger_1.CheckpointLogger(true, true));
516
+ (0, logger_1.setLogger)(new logger_1.CheckpointLogger(true, true));
517
517
  }
518
518
  else if (argv.debug) {
519
- logger_1.setLogger(new logger_1.CheckpointLogger(true));
519
+ (0, logger_1.setLogger)(new logger_1.CheckpointLogger(true));
520
520
  }
521
521
  })
522
522
  .demandCommand(1)
@@ -558,7 +558,7 @@ function extractManifestOptions(argv) {
558
558
  // leak. For this reason, we capture exceptions and print
559
559
  // a less verbose error message (run with --debug to output
560
560
  // the request object, don't do this in CI/CD).
561
- exports.handleError = (err) => {
561
+ const handleError = (err) => {
562
562
  var _a, _b;
563
563
  let status = '';
564
564
  if (exports.handleError.yargsArgs === undefined) {
@@ -577,6 +577,7 @@ exports.handleError = (err) => {
577
577
  }
578
578
  process.exitCode = 1;
579
579
  };
580
+ exports.handleError = handleError;
580
581
  // Only run parser if executed with node bin, this allows
581
582
  // for the parser to be easily tested:
582
583
  let argv;
@@ -585,10 +586,10 @@ if (require.main === module) {
585
586
  argv = await exports.parser.parseAsync();
586
587
  exports.handleError.yargsArgs = argv;
587
588
  process.on('unhandledRejection', err => {
588
- exports.handleError(err);
589
+ (0, exports.handleError)(err);
589
590
  });
590
591
  process.on('uncaughtException', err => {
591
- exports.handleError(err);
592
+ (0, exports.handleError)(err);
592
593
  });
593
594
  })();
594
595
  }
@@ -89,7 +89,7 @@ function toConventionalChangelogFormat(ast) {
89
89
  // summary, body, or footer:
90
90
  const breaking = {
91
91
  title: 'BREAKING CHANGE',
92
- text: '',
92
+ text: '', // "text" will be populated if a BREAKING CHANGE token is parsed.
93
93
  };
94
94
  visitWithAncestors(ast, ['breaking-change'], (node, ancestors) => {
95
95
  let parent = ancestors.pop();
@@ -17,10 +17,12 @@ exports.getPluginTypes = exports.unregisterPlugin = exports.registerPlugin = exp
17
17
  const linked_versions_1 = require("../plugins/linked-versions");
18
18
  const cargo_workspace_1 = require("../plugins/cargo-workspace");
19
19
  const node_workspace_1 = require("../plugins/node-workspace");
20
+ const maven_workspace_1 = require("../plugins/maven-workspace");
20
21
  const pluginFactories = {
21
22
  'linked-versions': options => new linked_versions_1.LinkedVersions(options.github, options.targetBranch, options.repositoryConfig, options.type.groupName, options.type.components),
22
23
  'cargo-workspace': options => new cargo_workspace_1.CargoWorkspace(options.github, options.targetBranch, options.repositoryConfig, options),
23
24
  'node-workspace': options => new node_workspace_1.NodeWorkspace(options.github, options.targetBranch, options.repositoryConfig, options),
25
+ 'maven-workspace': options => new maven_workspace_1.MavenWorkspace(options.github, options.targetBranch, options.repositoryConfig, options),
24
26
  };
25
27
  function buildPlugin(options) {
26
28
  if (typeof options.type === 'object') {
@@ -14,13 +14,17 @@
14
14
  // limitations under the License.
15
15
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
16
  if (k2 === undefined) k2 = k;
17
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
18
22
  }) : (function(o, m, k, k2) {
19
23
  if (k2 === undefined) k2 = k;
20
24
  o[k2] = m[k];
21
25
  }));
22
26
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
23
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
24
28
  };
25
29
  Object.defineProperty(exports, "__esModule", { value: true });
26
30
  exports.getReleaserTypes = exports.unregisterReleaseType = exports.registerReleaseType = exports.buildStrategy = void 0;
@@ -92,12 +96,12 @@ const releasers = {
92
96
  async function buildStrategy(options) {
93
97
  var _a;
94
98
  const targetBranch = (_a = options.targetBranch) !== null && _a !== void 0 ? _a : options.github.repository.defaultBranch;
95
- const versioningStrategy = versioning_strategy_factory_1.buildVersioningStrategy({
99
+ const versioningStrategy = (0, versioning_strategy_factory_1.buildVersioningStrategy)({
96
100
  type: options.versioning,
97
101
  bumpMinorPreMajor: options.bumpMinorPreMajor,
98
102
  bumpPatchForMinorPreMajor: options.bumpPatchForMinorPreMajor,
99
103
  });
100
- const changelogNotes = changelog_notes_factory_1.buildChangelogNotes({
104
+ const changelogNotes = (0, changelog_notes_factory_1.buildChangelogNotes)({
101
105
  type: options.changelogType || 'default',
102
106
  github: options.github,
103
107
  changelogSections: options.changelogSections,
@@ -128,7 +128,7 @@ class GitHub {
128
128
  this.createPullRequest = wrapAsync(async (pullRequest, targetBranch, message, updates, options) => {
129
129
  // Update the files for the release if not already supplied
130
130
  const changes = await this.buildChangeSet(updates, targetBranch);
131
- const prNumber = await code_suggester_1.createPullRequest(this.octokit, changes, {
131
+ const prNumber = await (0, code_suggester_1.createPullRequest)(this.octokit, changes, {
132
132
  upstreamOwner: this.repository.owner,
133
133
  upstreamRepo: this.repository.repo,
134
134
  title: pullRequest.title,
@@ -178,13 +178,13 @@ class GitHub {
178
178
  const changes = await this.buildChangeSet(releasePullRequest.updates, targetBranch);
179
179
  let message = releasePullRequest.title.toString();
180
180
  if (options === null || options === void 0 ? void 0 : options.signoffUser) {
181
- message = signoff_commit_message_1.signoffCommitMessage(message, options.signoffUser);
181
+ message = (0, signoff_commit_message_1.signoffCommitMessage)(message, options.signoffUser);
182
182
  }
183
183
  const title = releasePullRequest.title.toString();
184
184
  const body = releasePullRequest.body
185
185
  .toString()
186
186
  .slice(0, MAX_ISSUE_BODY_SIZE);
187
- const prNumber = await code_suggester_1.createPullRequest(this.octokit, changes, {
187
+ const prNumber = await (0, code_suggester_1.createPullRequest)(this.octokit, changes, {
188
188
  upstreamOwner: this.repository.owner,
189
189
  upstreamRepo: this.repository.repo,
190
190
  title,
@@ -542,7 +542,7 @@ class GitHub {
542
542
  repo: this.repository.repo,
543
543
  num: 25,
544
544
  targetBranch,
545
- maxFilesChanged: 100,
545
+ maxFilesChanged: 100, // max is 100
546
546
  });
547
547
  // if the branch does exist, return null
548
548
  if (!response.repository.ref) {
@@ -868,9 +868,10 @@ class GitHub {
868
868
  async createReleasePullRequest(releasePullRequest, targetBranch, options) {
869
869
  let message = releasePullRequest.title.toString();
870
870
  if (options === null || options === void 0 ? void 0 : options.signoffUser) {
871
- message = signoff_commit_message_1.signoffCommitMessage(message, options.signoffUser);
871
+ message = (0, signoff_commit_message_1.signoffCommitMessage)(message, options.signoffUser);
872
872
  }
873
- const pullRequestLabels = (options === null || options === void 0 ? void 0 : options.skipLabeling) ? []
873
+ const pullRequestLabels = (options === null || options === void 0 ? void 0 : options.skipLabeling)
874
+ ? []
874
875
  : releasePullRequest.labels;
875
876
  return await this.createPullRequest({
876
877
  headBranchName: releasePullRequest.headRefName,
@@ -13,6 +13,7 @@
13
13
  // See the License for the specific language governing permissions and
14
14
  // limitations under the License.
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.GitHub = exports.setLogger = exports.registerVersioningStrategy = exports.getVersioningStrategyTypes = exports.registerPlugin = exports.getPluginTypes = exports.registerChangelogNotes = exports.getChangelogTypes = exports.registerReleaseType = exports.getReleaserTypes = exports.Manifest = exports.Errors = void 0;
16
17
  exports.Errors = require("./errors");
17
18
  var manifest_1 = require("./manifest");
18
19
  Object.defineProperty(exports, "Manifest", { enumerable: true, get: function () { return manifest_1.Manifest; } });
@@ -71,7 +71,8 @@ class Manifest {
71
71
  this.releasedVersions = releasedVersions;
72
72
  this.manifestPath =
73
73
  (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.manifestPath) || exports.DEFAULT_RELEASE_PLEASE_MANIFEST;
74
- this.separatePullRequests = (_a = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.separatePullRequests) !== null && _a !== void 0 ? _a : Object.keys(repositoryConfig).length === 1;
74
+ this.separatePullRequests =
75
+ (_a = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.separatePullRequests) !== null && _a !== void 0 ? _a : Object.keys(repositoryConfig).length === 1;
75
76
  this.plugins = (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.plugins) || [];
76
77
  this.fork = (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.fork) || false;
77
78
  this.signoffUser = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.signoff;
@@ -86,7 +87,8 @@ class Manifest {
86
87
  this.lastReleaseSha = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.lastReleaseSha;
87
88
  this.draft = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.draft;
88
89
  this.draftPullRequest = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.draftPullRequest;
89
- this.groupPullRequestTitlePattern = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.groupPullRequestTitlePattern;
90
+ this.groupPullRequestTitlePattern =
91
+ manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.groupPullRequestTitlePattern;
90
92
  this.releaseSearchDepth =
91
93
  (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.releaseSearchDepth) || DEFAULT_RELEASE_SEARCH_DEPTH;
92
94
  this.commitSearchDepth =
@@ -141,7 +143,7 @@ class Manifest {
141
143
  static async fromConfig(github, targetBranch, config, manifestOptions, path = exports.ROOT_PROJECT_PATH) {
142
144
  const repositoryConfig = {};
143
145
  repositoryConfig[path] = config;
144
- const strategy = await factory_1.buildStrategy({
146
+ const strategy = await (0, factory_1.buildStrategy)({
145
147
  github,
146
148
  ...config,
147
149
  });
@@ -309,7 +311,7 @@ class Manifest {
309
311
  }
310
312
  }
311
313
  // Build plugins
312
- const plugins = this.plugins.map(pluginType => factory_1.buildPlugin({
314
+ const plugins = this.plugins.map(pluginType => (0, factory_1.buildPlugin)({
313
315
  type: pluginType,
314
316
  github: this.github,
315
317
  targetBranch: this.targetBranch,
@@ -669,7 +671,7 @@ class Manifest {
669
671
  for (const path in this.repositoryConfig) {
670
672
  const config = this.repositoryConfig[path];
671
673
  logger_1.logger.debug(`${path}: ${config.releaseType}`);
672
- const strategy = await factory_1.buildStrategy({
674
+ const strategy = await (0, factory_1.buildStrategy)({
673
675
  ...config,
674
676
  github: this.github,
675
677
  path,
@@ -38,7 +38,7 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
38
38
  async buildAllPackages(candidates) {
39
39
  var _a, _b, _c, _d;
40
40
  const cargoManifestContent = await this.github.getFileContentsOnBranch('Cargo.toml', this.targetBranch);
41
- const cargoManifest = common_1.parseCargoManifest(cargoManifestContent.parsedContent);
41
+ const cargoManifest = (0, common_1.parseCargoManifest)(cargoManifestContent.parsedContent);
42
42
  if (!((_a = cargoManifest.workspace) === null || _a === void 0 ? void 0 : _a.members)) {
43
43
  logger_1.logger.warn("cargo-workspace plugin used, but top-level Cargo.toml isn't a cargo workspace");
44
44
  return { allPackages: [], candidatesByPackage: {} };
@@ -48,13 +48,13 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
48
48
  const members = cargoManifest.workspace.members;
49
49
  members.push(manifest_1.ROOT_PROJECT_PATH);
50
50
  for (const path of members) {
51
- const manifestPath = addPath(path, 'Cargo.toml');
51
+ const manifestPath = (0, workspace_1.addPath)(path, 'Cargo.toml');
52
52
  logger_1.logger.info(`looking for candidate with path: ${path}`);
53
53
  const candidate = candidates.find(c => c.path === path);
54
54
  // get original content of the crate
55
55
  const manifestContent = ((_b = candidate === null || candidate === void 0 ? void 0 : candidate.pullRequest.updates.find(update => update.path === manifestPath)) === null || _b === void 0 ? void 0 : _b.cachedFileContents) ||
56
56
  (await this.github.getFileContentsOnBranch(manifestPath, this.targetBranch));
57
- const manifest = common_1.parseCargoManifest(manifestContent.parsedContent);
57
+ const manifest = (0, common_1.parseCargoManifest)(manifestContent.parsedContent);
58
58
  const packageName = (_c = manifest.package) === null || _c === void 0 ? void 0 : _c.name;
59
59
  if (!packageName) {
60
60
  logger_1.logger.warn(`package manifest at ${manifestPath} is missing [package.name]`);
@@ -95,18 +95,18 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
95
95
  versionsMap: updatedVersions,
96
96
  });
97
97
  const updatedContent = updater.updateContent(pkg.manifestContent);
98
- const originalManifest = common_1.parseCargoManifest(pkg.manifestContent);
99
- const updatedManifest = common_1.parseCargoManifest(updatedContent);
98
+ const originalManifest = (0, common_1.parseCargoManifest)(pkg.manifestContent);
99
+ const updatedManifest = (0, common_1.parseCargoManifest)(updatedContent);
100
100
  const dependencyNotes = getChangelogDepsNotes(originalManifest, updatedManifest);
101
101
  existingCandidate.pullRequest.updates =
102
102
  existingCandidate.pullRequest.updates.map(update => {
103
- if (update.path === addPath(existingCandidate.path, 'Cargo.toml')) {
103
+ if (update.path === (0, workspace_1.addPath)(existingCandidate.path, 'Cargo.toml')) {
104
104
  update.updater = new raw_content_1.RawContent(updatedContent);
105
105
  }
106
106
  else if (update.updater instanceof changelog_1.Changelog && dependencyNotes) {
107
- update.updater.changelogEntry = appendDependenciesSectionToChangelog(update.updater.changelogEntry, dependencyNotes);
107
+ update.updater.changelogEntry = (0, workspace_1.appendDependenciesSectionToChangelog)(update.updater.changelogEntry, dependencyNotes);
108
108
  }
109
- else if (update.path === addPath(existingCandidate.path, 'Cargo.lock')) {
109
+ else if (update.path === (0, workspace_1.addPath)(existingCandidate.path, 'Cargo.lock')) {
110
110
  update.updater = new cargo_lock_1.CargoLock(updatedVersions);
111
111
  }
112
112
  return update;
@@ -115,13 +115,13 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
115
115
  if (dependencyNotes) {
116
116
  if (existingCandidate.pullRequest.body.releaseData.length > 0) {
117
117
  existingCandidate.pullRequest.body.releaseData[0].notes =
118
- appendDependenciesSectionToChangelog(existingCandidate.pullRequest.body.releaseData[0].notes, dependencyNotes);
118
+ (0, workspace_1.appendDependenciesSectionToChangelog)(existingCandidate.pullRequest.body.releaseData[0].notes, dependencyNotes);
119
119
  }
120
120
  else {
121
121
  existingCandidate.pullRequest.body.releaseData.push({
122
122
  component: pkg.name,
123
123
  version: existingCandidate.pullRequest.version,
124
- notes: appendDependenciesSectionToChangelog('', dependencyNotes),
124
+ notes: (0, workspace_1.appendDependenciesSectionToChangelog)('', dependencyNotes),
125
125
  });
126
126
  }
127
127
  }
@@ -137,8 +137,8 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
137
137
  versionsMap: updatedVersions,
138
138
  });
139
139
  const updatedContent = updater.updateContent(pkg.manifestContent);
140
- const originalManifest = common_1.parseCargoManifest(pkg.manifestContent);
141
- const updatedManifest = common_1.parseCargoManifest(updatedContent);
140
+ const originalManifest = (0, common_1.parseCargoManifest)(pkg.manifestContent);
141
+ const updatedManifest = (0, common_1.parseCargoManifest)(updatedContent);
142
142
  const dependencyNotes = getChangelogDepsNotes(originalManifest, updatedManifest);
143
143
  const pullRequest = {
144
144
  title: pull_request_title_1.PullRequestTitle.ofTargetBranch(this.targetBranch),
@@ -146,17 +146,17 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
146
146
  {
147
147
  component: pkg.name,
148
148
  version,
149
- notes: appendDependenciesSectionToChangelog('', dependencyNotes),
149
+ notes: (0, workspace_1.appendDependenciesSectionToChangelog)('', dependencyNotes),
150
150
  },
151
151
  ]),
152
152
  updates: [
153
153
  {
154
- path: addPath(pkg.path, 'Cargo.toml'),
154
+ path: (0, workspace_1.addPath)(pkg.path, 'Cargo.toml'),
155
155
  createIfMissing: false,
156
156
  updater: new raw_content_1.RawContent(updatedContent),
157
157
  },
158
158
  {
159
- path: addPath(pkg.path, 'CHANGELOG.md'),
159
+ path: (0, workspace_1.addPath)(pkg.path, 'CHANGELOG.md'),
160
160
  createIfMissing: false,
161
161
  updater: new changelog_1.Changelog({
162
162
  version,
@@ -275,42 +275,4 @@ function getChangelogDepsNotes(originalManifest, updatedManifest) {
275
275
  }
276
276
  return '';
277
277
  }
278
- const DEPENDENCY_HEADER = new RegExp('### Dependencies');
279
- function appendDependenciesSectionToChangelog(changelog, notes) {
280
- if (!changelog) {
281
- return `### Dependencies\n\n${notes}`;
282
- }
283
- const newLines = [];
284
- let seenDependenciesSection = false;
285
- let seenDependencySectionSpacer = false;
286
- let injected = false;
287
- for (const line of changelog.split('\n')) {
288
- if (seenDependenciesSection) {
289
- const trimmedLine = line.trim();
290
- if (seenDependencySectionSpacer &&
291
- !injected &&
292
- !trimmedLine.startsWith('*')) {
293
- newLines.push(changelog);
294
- injected = true;
295
- }
296
- if (trimmedLine === '') {
297
- seenDependencySectionSpacer = true;
298
- }
299
- }
300
- if (line.match(DEPENDENCY_HEADER)) {
301
- seenDependenciesSection = true;
302
- }
303
- newLines.push(line);
304
- }
305
- if (injected) {
306
- return newLines.join('\n');
307
- }
308
- if (seenDependenciesSection) {
309
- return `${changelog}\n${notes}`;
310
- }
311
- return `${changelog}\n\n\n### Dependencies\n\n${notes}`;
312
- }
313
- function addPath(path, file) {
314
- return path === manifest_1.ROOT_PROJECT_PATH ? file : `${path}/${file}`;
315
- }
316
278
  //# sourceMappingURL=cargo-workspace.js.map
@@ -72,7 +72,7 @@ class LinkedVersions extends plugin_1.ManifestPlugin {
72
72
  if (path in groupStrategies) {
73
73
  const component = await strategiesByPath[path].getComponent();
74
74
  logger_1.logger.info(`Replacing strategy for path ${path} with forced version: ${primaryVersion}`);
75
- newStrategies[path] = await factory_1.buildStrategy({
75
+ newStrategies[path] = await (0, factory_1.buildStrategy)({
76
76
  ...this.repositoryConfig[path],
77
77
  github: this.github,
78
78
  path,
@@ -0,0 +1,28 @@
1
+ import { WorkspacePlugin, AllPackages, DependencyGraph } from './workspace';
2
+ import { Version, VersionsMap } from '../version';
3
+ import { CandidateReleasePullRequest } from '../manifest';
4
+ interface Gav {
5
+ groupId: string;
6
+ artifactId: string;
7
+ version: string;
8
+ }
9
+ interface MavenArtifact extends Gav {
10
+ path: string;
11
+ name: string;
12
+ dependencies: Gav[];
13
+ testDependencies: Gav[];
14
+ pomContent: string;
15
+ }
16
+ export declare class MavenWorkspace extends WorkspacePlugin<MavenArtifact> {
17
+ private fetchPom;
18
+ protected buildAllPackages(candidates: CandidateReleasePullRequest[]): Promise<AllPackages<MavenArtifact>>;
19
+ protected buildGraph(allPackages: MavenArtifact[]): Promise<DependencyGraph<MavenArtifact>>;
20
+ protected bumpVersion(artifact: MavenArtifact): Version;
21
+ protected updateCandidate(existingCandidate: CandidateReleasePullRequest, artifact: MavenArtifact, updatedVersions: VersionsMap): CandidateReleasePullRequest;
22
+ protected newCandidate(artifact: MavenArtifact, updatedVersions: VersionsMap): CandidateReleasePullRequest;
23
+ protected inScope(candidate: CandidateReleasePullRequest): boolean;
24
+ protected packageNameFromPackage(artifact: MavenArtifact): string;
25
+ protected pathFromPackage(artifact: MavenArtifact): string;
26
+ protected postProcessCandidates(candidates: CandidateReleasePullRequest[], _updatedVersions: VersionsMap): CandidateReleasePullRequest[];
27
+ }
28
+ export {};