release-please 15.1.2 → 15.3.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 +20 -0
- package/README.md +1 -0
- package/build/src/bin/release-please.d.ts +4 -19
- package/build/src/bin/release-please.js +22 -0
- package/build/src/factory.js +4 -0
- package/build/src/index.d.ts +1 -0
- package/build/src/plugins/maven-workspace.js +7 -1
- package/build/src/plugins/node-workspace.js +10 -4
- package/build/src/strategies/base.d.ts +1 -0
- package/build/src/strategies/base.js +1 -0
- package/build/src/strategies/java-yoshi-mono-repo.d.ts +22 -0
- package/build/src/strategies/java-yoshi-mono-repo.js +273 -0
- package/build/src/strategies/java.js +1 -0
- package/build/src/strategies/node.js +21 -0
- package/build/src/strategies/php-yoshi.js +1 -0
- package/build/src/strategies/salesforce.d.ts +9 -0
- package/build/src/strategies/salesforce.js +66 -0
- package/build/src/updaters/changelog-json.d.ts +29 -0
- package/build/src/updaters/changelog-json.js +82 -0
- package/build/src/updaters/salesforce/sfdx-project-json.d.ts +21 -0
- package/build/src/updaters/salesforce/sfdx-project-json.js +41 -0
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [15.3.0](https://github.com/googleapis/release-please/compare/v15.2.0...v15.3.0) (2023-01-25)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* Add Salesforce strategy ([#1815](https://github.com/googleapis/release-please/issues/1815)) ([25b518f](https://github.com/googleapis/release-please/commit/25b518f4f34afcd749968d021f4eed99222a328a))
|
|
13
|
+
* Add support for yarn workspace versions ([#1819](https://github.com/googleapis/release-please/issues/1819)) ([8b0cc7d](https://github.com/googleapis/release-please/commit/8b0cc7d7d203609c95e9e7cfbef4f0faedd3f46d))
|
|
14
|
+
* **java-monorepo:** Switch to using .repo-metadata.json ([#1820](https://github.com/googleapis/release-please/issues/1820)) ([6cc85db](https://github.com/googleapis/release-please/commit/6cc85dbb95ade1c38c354a567a02b8a41d729a72))
|
|
15
|
+
* **node:** Add support for changelog.json in Node ([#1823](https://github.com/googleapis/release-please/issues/1823)) ([d3e3bd3](https://github.com/googleapis/release-please/commit/d3e3bd3b102195befb051457f9a837ff47388157))
|
|
16
|
+
|
|
17
|
+
## [15.2.0](https://github.com/googleapis/release-please/compare/v15.1.2...v15.2.0) (2023-01-23)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **cli:** Add ability to dynamically load release-please plugin ([#1811](https://github.com/googleapis/release-please/issues/1811)) ([609383b](https://github.com/googleapis/release-please/commit/609383be5a05bb0107b489314b4bcd7615ddafd9))
|
|
23
|
+
* Export Strategy interface so external packages can implement ([609383b](https://github.com/googleapis/release-please/commit/609383be5a05bb0107b489314b4bcd7615ddafd9))
|
|
24
|
+
* Introduce ChangelogJson updater ([#1808](https://github.com/googleapis/release-please/issues/1808)) ([fe3a979](https://github.com/googleapis/release-please/commit/fe3a979a1c228610612aa2d6c303d408be956e2e))
|
|
25
|
+
* Introduce JavaYoshiMonoRepo strategy ([#1810](https://github.com/googleapis/release-please/issues/1810)) ([2d14307](https://github.com/googleapis/release-please/commit/2d143077a545b92e1d9de923ab81ae1e12b7a468))
|
|
26
|
+
|
|
7
27
|
## [15.1.2](https://github.com/googleapis/release-please/compare/v15.1.1...v15.1.2) (2023-01-17)
|
|
8
28
|
|
|
9
29
|
|
package/README.md
CHANGED
|
@@ -150,6 +150,7 @@ Release Please automates releases for the following flavors of repositories:
|
|
|
150
150
|
| `python` | [A Python repository, with a setup.py, setup.cfg, CHANGELOG.md](https://github.com/googleapis/python-storage) and optionally a pyproject.toml and a <project>/\_\_init\_\_.py |
|
|
151
151
|
| `ruby` | A repository with a version.rb and a CHANGELOG.md |
|
|
152
152
|
| `rust` | A Rust repository, with a Cargo.toml (either as a crate or workspace) and a CHANGELOG.md |
|
|
153
|
+
| `salesforce` | A repository with a sfdx-project.json and a CHANGELOG.md |
|
|
153
154
|
| `simple` | [A repository with a version.txt and a CHANGELOG.md](https://github.com/googleapis/gapic-generator) |
|
|
154
155
|
| `terraform-module` | [A terraform module, with a version in the README.md, and a CHANGELOG.md](https://github.com/terraform-google-modules/terraform-google-project-factory) |
|
|
155
156
|
|
|
@@ -6,27 +6,12 @@ interface ErrorObject {
|
|
|
6
6
|
message: string;
|
|
7
7
|
stack: string;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
dryRun?: boolean;
|
|
11
|
-
trace?: boolean;
|
|
12
|
-
repoUrl?: string;
|
|
13
|
-
token?: string;
|
|
14
|
-
apiUrl?: string;
|
|
15
|
-
graphqlUrl?: string;
|
|
16
|
-
fork?: boolean;
|
|
17
|
-
defaultBranch?: string;
|
|
18
|
-
targetBranch?: string;
|
|
19
|
-
}
|
|
20
|
-
interface ManifestArgs {
|
|
21
|
-
configFile?: string;
|
|
22
|
-
manifestFile?: string;
|
|
23
|
-
}
|
|
24
|
-
interface DebugConfigArgs extends GitHubArgs, ManifestArgs {
|
|
25
|
-
}
|
|
26
|
-
export declare const parser: yargs.Argv<yargs.Omit<DebugConfigArgs & {
|
|
9
|
+
export declare const parser: yargs.Argv<{
|
|
27
10
|
debug: boolean;
|
|
28
|
-
}
|
|
11
|
+
} & {
|
|
29
12
|
trace: boolean;
|
|
13
|
+
} & {
|
|
14
|
+
plugin: (string | number)[] | never[];
|
|
30
15
|
}>;
|
|
31
16
|
interface HandleError {
|
|
32
17
|
(err: ErrorObject): void;
|
|
@@ -570,6 +570,28 @@ exports.parser = yargs
|
|
|
570
570
|
else if (argv.debug) {
|
|
571
571
|
(0, logger_1.setLogger)(new logger_1.CheckpointLogger(true));
|
|
572
572
|
}
|
|
573
|
+
})
|
|
574
|
+
.option('plugin', {
|
|
575
|
+
describe: 'load plugin named release-please-<plugin-name>',
|
|
576
|
+
type: 'array',
|
|
577
|
+
default: [],
|
|
578
|
+
})
|
|
579
|
+
.middleware(argv => {
|
|
580
|
+
for (const pluginName of argv.plugin) {
|
|
581
|
+
console.log(`requiring plugin: ${pluginName}`);
|
|
582
|
+
try {
|
|
583
|
+
const plugin = require(pluginName.toString());
|
|
584
|
+
if (plugin === null || plugin === void 0 ? void 0 : plugin.init) {
|
|
585
|
+
console.log(`loading plugin: ${pluginName}`);
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
console.warn(`plugin: ${pluginName} did not have an init() function.`);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
catch (e) {
|
|
592
|
+
console.warn(`failed to require plugin: ${pluginName}:`, e);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
573
595
|
})
|
|
574
596
|
.demandCommand(1)
|
|
575
597
|
.strict(true)
|
package/build/src/factory.js
CHANGED
|
@@ -31,6 +31,7 @@ exports.getReleaserTypes = exports.unregisterReleaseType = exports.registerRelea
|
|
|
31
31
|
const go_1 = require("./strategies/go");
|
|
32
32
|
const go_yoshi_1 = require("./strategies/go-yoshi");
|
|
33
33
|
const java_yoshi_1 = require("./strategies/java-yoshi");
|
|
34
|
+
const java_yoshi_mono_repo_1 = require("./strategies/java-yoshi-mono-repo");
|
|
34
35
|
const krm_blueprint_1 = require("./strategies/krm-blueprint");
|
|
35
36
|
const ocaml_1 = require("./strategies/ocaml");
|
|
36
37
|
const php_1 = require("./strategies/php");
|
|
@@ -39,6 +40,7 @@ const python_1 = require("./strategies/python");
|
|
|
39
40
|
const ruby_1 = require("./strategies/ruby");
|
|
40
41
|
const ruby_yoshi_1 = require("./strategies/ruby-yoshi");
|
|
41
42
|
const rust_1 = require("./strategies/rust");
|
|
43
|
+
const salesforce_1 = require("./strategies/salesforce");
|
|
42
44
|
const simple_1 = require("./strategies/simple");
|
|
43
45
|
const terraform_module_1 = require("./strategies/terraform-module");
|
|
44
46
|
const helm_1 = require("./strategies/helm");
|
|
@@ -65,6 +67,7 @@ const releasers = {
|
|
|
65
67
|
java: options => new java_1.Java(options),
|
|
66
68
|
maven: options => new maven_1.Maven(options),
|
|
67
69
|
'java-yoshi': options => new java_yoshi_1.JavaYoshi(options),
|
|
70
|
+
'java-yoshi-mono-repo': options => new java_yoshi_mono_repo_1.JavaYoshiMonoRepo(options),
|
|
68
71
|
'java-backport': options => new java_yoshi_1.JavaYoshi({
|
|
69
72
|
...options,
|
|
70
73
|
versioningStrategy: new always_bump_patch_1.AlwaysBumpPatch(),
|
|
@@ -90,6 +93,7 @@ const releasers = {
|
|
|
90
93
|
ruby: options => new ruby_1.Ruby(options),
|
|
91
94
|
'ruby-yoshi': options => new ruby_yoshi_1.RubyYoshi(options),
|
|
92
95
|
rust: options => new rust_1.Rust(options),
|
|
96
|
+
salesforce: options => new salesforce_1.Salesforce(options),
|
|
93
97
|
simple: options => new simple_1.Simple(options),
|
|
94
98
|
'terraform-module': options => new terraform_module_1.TerraformModule(options),
|
|
95
99
|
helm: options => new helm_1.Helm(options),
|
package/build/src/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as Errors from './errors';
|
|
2
2
|
export { Manifest, ReleaserConfig, ManifestOptions, PluginType, } from './manifest';
|
|
3
3
|
export { Commit, ConventionalCommit } from './commit';
|
|
4
|
+
export { Strategy } from './strategy';
|
|
4
5
|
export { BaseStrategyOptions, BuildUpdatesOptions } from './strategies/base';
|
|
5
6
|
export { ReleaseBuilder, ReleaseType, getReleaserTypes, registerReleaseType, } from './factory';
|
|
6
7
|
export { ChangelogNotesBuilder, ChangelogNotesFactoryOptions, ChangelogNotesType, getChangelogTypes, registerChangelogNotes, } from './factories/changelog-notes-factory';
|
|
@@ -28,7 +28,13 @@ const logger_1 = require("../util/logger");
|
|
|
28
28
|
const java_snapshot_1 = require("../versioning-strategies/java-snapshot");
|
|
29
29
|
const always_bump_patch_1 = require("../versioning-strategies/always-bump-patch");
|
|
30
30
|
const composite_1 = require("../updaters/composite");
|
|
31
|
-
const JAVA_RELEASE_TYPES = new Set([
|
|
31
|
+
const JAVA_RELEASE_TYPES = new Set([
|
|
32
|
+
'java',
|
|
33
|
+
'java-bom',
|
|
34
|
+
'java-yoshi',
|
|
35
|
+
'java-yoshi-mono-repo',
|
|
36
|
+
'maven',
|
|
37
|
+
]);
|
|
32
38
|
const XPATH_PROJECT_GROUP = '/*[local-name()="project"]/*[local-name()="groupId"]';
|
|
33
39
|
const XPATH_PROJECT_ARTIFACT = '/*[local-name()="project"]/*[local-name()="artifactId"]';
|
|
34
40
|
const XPATH_PROJECT_VERSION = '/*[local-name()="project"]/*[local-name()="version"]';
|
|
@@ -118,7 +118,7 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
118
118
|
this.logger.info(`${pkg.name}.${depName} updated to ${prefix}${depVersion.toString()}`);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
const dependencyNotes = getChangelogDepsNotes(pkg, updatedPackage);
|
|
121
|
+
const dependencyNotes = getChangelogDepsNotes(pkg, updatedPackage, updatedVersions);
|
|
122
122
|
existingCandidate.pullRequest.updates =
|
|
123
123
|
existingCandidate.pullRequest.updates.map(update => {
|
|
124
124
|
if (update.path === (0, workspace_1.addPath)(existingCandidate.path, 'package.json')) {
|
|
@@ -172,7 +172,7 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
172
172
|
this.logger.info(`${pkg.name}.${depName} updated to ${prefix}${depVersion.toString()}`);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
const dependencyNotes = getChangelogDepsNotes(pkg, updatedPackage);
|
|
175
|
+
const dependencyNotes = getChangelogDepsNotes(pkg, updatedPackage, updatedVersions);
|
|
176
176
|
const packageJson = updatedPackage.toJSON();
|
|
177
177
|
const version = version_1.Version.parse(packageJson.version);
|
|
178
178
|
const pullRequest = {
|
|
@@ -260,8 +260,8 @@ var SUPPORTED_RANGE_PREFIXES;
|
|
|
260
260
|
SUPPORTED_RANGE_PREFIXES["EQUAL_OR_GREATER_THAN"] = ">=";
|
|
261
261
|
SUPPORTED_RANGE_PREFIXES["EQUAL_OR_LESS_THAN"] = "<=";
|
|
262
262
|
})(SUPPORTED_RANGE_PREFIXES || (SUPPORTED_RANGE_PREFIXES = {}));
|
|
263
|
-
function getChangelogDepsNotes(original, updated) {
|
|
264
|
-
var _a;
|
|
263
|
+
function getChangelogDepsNotes(original, updated, updateVersions) {
|
|
264
|
+
var _a, _b;
|
|
265
265
|
let depUpdateNotes = '';
|
|
266
266
|
const depTypes = [
|
|
267
267
|
'dependencies',
|
|
@@ -280,6 +280,12 @@ function getChangelogDepsNotes(original, updated) {
|
|
|
280
280
|
const origDepVer = (_a = original[depType]) === null || _a === void 0 ? void 0 : _a[depName];
|
|
281
281
|
if (currentDepVer !== origDepVer) {
|
|
282
282
|
depUpdates.push(`\n * ${depName} bumped from ${origDepVer} to ${currentDepVer}`);
|
|
283
|
+
//handle case when "workspace:" version is used
|
|
284
|
+
}
|
|
285
|
+
else if (currentDepVer.startsWith('workspace:') &&
|
|
286
|
+
updateVersions.get(depName) !== undefined) {
|
|
287
|
+
depUpdates.push(`\n * ${depName} bumped to ${(_b = updateVersions
|
|
288
|
+
.get(depName)) === null || _b === void 0 ? void 0 : _b.toString()}`);
|
|
283
289
|
}
|
|
284
290
|
}
|
|
285
291
|
if (depUpdates.length > 0) {
|
|
@@ -15,6 +15,7 @@ import { PullRequestBody } from '../util/pull-request-body';
|
|
|
15
15
|
import { PullRequest } from '../pull-request';
|
|
16
16
|
export interface BuildUpdatesOptions {
|
|
17
17
|
changelogEntry: string;
|
|
18
|
+
commits?: ConventionalCommit[];
|
|
18
19
|
newVersion: Version;
|
|
19
20
|
versionsMap: VersionsMap;
|
|
20
21
|
latestVersion?: Version;
|
|
@@ -165,6 +165,7 @@ class BaseStrategy {
|
|
|
165
165
|
newVersion,
|
|
166
166
|
versionsMap,
|
|
167
167
|
latestVersion: latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag.version,
|
|
168
|
+
commits: conventionalCommits,
|
|
168
169
|
});
|
|
169
170
|
const updatesWithExtras = (0, composite_1.mergeUpdates)(updates.concat(...(await this.extraFileUpdates(newVersion, versionsMap))));
|
|
170
171
|
const pullRequestBody = await this.buildPullRequestBody(component, newVersion, releaseNotesBody, conventionalCommits, latestRelease, this.pullRequestHeader);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Update } from '../update';
|
|
2
|
+
import { Version, VersionsMap } from '../version';
|
|
3
|
+
import { GitHubFileContents } from '@google-automations/git-file-utils';
|
|
4
|
+
import { ConventionalCommit } from '../commit';
|
|
5
|
+
import { Java, JavaBuildUpdatesOption } from './java';
|
|
6
|
+
export declare class JavaYoshiMonoRepo extends Java {
|
|
7
|
+
private versionsContent?;
|
|
8
|
+
/**
|
|
9
|
+
* Override this method to post process commits
|
|
10
|
+
* @param {ConventionalCommit[]} commits parsed commits
|
|
11
|
+
* @returns {ConventionalCommit[]} modified commits
|
|
12
|
+
*/
|
|
13
|
+
protected postProcessCommits(commits: ConventionalCommit[]): Promise<ConventionalCommit[]>;
|
|
14
|
+
protected needsSnapshot(): Promise<boolean>;
|
|
15
|
+
protected buildVersionsMap(): Promise<VersionsMap>;
|
|
16
|
+
protected getVersionsContent(): Promise<GitHubFileContents>;
|
|
17
|
+
protected buildUpdates(options: JavaBuildUpdatesOption): Promise<Update[]>;
|
|
18
|
+
private hasChangelogJson;
|
|
19
|
+
private getRepoMetadata;
|
|
20
|
+
protected updateVersionsMap(versionsMap: VersionsMap, conventionalCommits: ConventionalCommit[]): Promise<VersionsMap>;
|
|
21
|
+
protected initialReleaseVersion(): Version;
|
|
22
|
+
}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2023 Google LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.JavaYoshiMonoRepo = void 0;
|
|
17
|
+
const versions_manifest_1 = require("../updaters/java/versions-manifest");
|
|
18
|
+
const version_1 = require("../version");
|
|
19
|
+
const changelog_1 = require("../updaters/changelog");
|
|
20
|
+
const changelog_json_1 = require("../updaters/changelog-json");
|
|
21
|
+
const commit_split_1 = require("../util/commit-split");
|
|
22
|
+
const composite_1 = require("../updaters/composite");
|
|
23
|
+
const errors_1 = require("../errors");
|
|
24
|
+
const java_1 = require("./java");
|
|
25
|
+
const java_update_1 = require("../updaters/java/java-update");
|
|
26
|
+
const BREAKING_CHANGE_NOTE = 'BREAKING CHANGE';
|
|
27
|
+
class JavaYoshiMonoRepo extends java_1.Java {
|
|
28
|
+
/**
|
|
29
|
+
* Override this method to post process commits
|
|
30
|
+
* @param {ConventionalCommit[]} commits parsed commits
|
|
31
|
+
* @returns {ConventionalCommit[]} modified commits
|
|
32
|
+
*/
|
|
33
|
+
async postProcessCommits(commits) {
|
|
34
|
+
if (commits.length === 0) {
|
|
35
|
+
// For Java commits, push a fake commit so we force a
|
|
36
|
+
// SNAPSHOT release
|
|
37
|
+
commits.push({
|
|
38
|
+
type: 'fake',
|
|
39
|
+
bareMessage: 'fake commit',
|
|
40
|
+
message: 'fake commit',
|
|
41
|
+
breaking: false,
|
|
42
|
+
scope: null,
|
|
43
|
+
notes: [],
|
|
44
|
+
files: [],
|
|
45
|
+
references: [],
|
|
46
|
+
sha: 'fake',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return commits;
|
|
50
|
+
}
|
|
51
|
+
async needsSnapshot() {
|
|
52
|
+
return versions_manifest_1.VersionsManifest.needsSnapshot((await this.getVersionsContent()).parsedContent);
|
|
53
|
+
}
|
|
54
|
+
async buildVersionsMap() {
|
|
55
|
+
this.versionsContent = await this.getVersionsContent();
|
|
56
|
+
return versions_manifest_1.VersionsManifest.parseVersions(this.versionsContent.parsedContent);
|
|
57
|
+
}
|
|
58
|
+
async getVersionsContent() {
|
|
59
|
+
if (!this.versionsContent) {
|
|
60
|
+
try {
|
|
61
|
+
this.versionsContent = await this.github.getFileContentsOnBranch(this.addPath('versions.txt'), this.targetBranch);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
if (err instanceof errors_1.GitHubAPIError) {
|
|
65
|
+
throw new errors_1.MissingRequiredFileError(this.addPath('versions.txt'), JavaYoshiMonoRepo.name, `${this.repository.owner}/${this.repository.repo}`);
|
|
66
|
+
}
|
|
67
|
+
throw err;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return this.versionsContent;
|
|
71
|
+
}
|
|
72
|
+
async buildUpdates(options) {
|
|
73
|
+
const updates = [];
|
|
74
|
+
const version = options.newVersion;
|
|
75
|
+
const versionsMap = options.versionsMap;
|
|
76
|
+
updates.push({
|
|
77
|
+
path: this.addPath('versions.txt'),
|
|
78
|
+
createIfMissing: false,
|
|
79
|
+
cachedFileContents: this.versionsContent,
|
|
80
|
+
updater: new versions_manifest_1.VersionsManifest({
|
|
81
|
+
version,
|
|
82
|
+
versionsMap,
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
const pomFilesSearch = this.github.findFilesByFilenameAndRef('pom.xml', this.targetBranch, this.path);
|
|
86
|
+
const buildFilesSearch = this.github.findFilesByFilenameAndRef('build.gradle', this.targetBranch, this.path);
|
|
87
|
+
const dependenciesSearch = this.github.findFilesByFilenameAndRef('dependencies.properties', this.targetBranch, this.path);
|
|
88
|
+
const pomFiles = await pomFilesSearch;
|
|
89
|
+
pomFiles.forEach(path => {
|
|
90
|
+
updates.push({
|
|
91
|
+
path: this.addPath(path),
|
|
92
|
+
createIfMissing: false,
|
|
93
|
+
updater: new java_update_1.JavaUpdate({
|
|
94
|
+
version,
|
|
95
|
+
versionsMap,
|
|
96
|
+
isSnapshot: options.isSnapshot,
|
|
97
|
+
}),
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
const buildFiles = await buildFilesSearch;
|
|
101
|
+
buildFiles.forEach(path => {
|
|
102
|
+
updates.push({
|
|
103
|
+
path: this.addPath(path),
|
|
104
|
+
createIfMissing: false,
|
|
105
|
+
updater: new java_update_1.JavaUpdate({
|
|
106
|
+
version,
|
|
107
|
+
versionsMap,
|
|
108
|
+
isSnapshot: options.isSnapshot,
|
|
109
|
+
}),
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
const dependenciesFiles = await dependenciesSearch;
|
|
113
|
+
dependenciesFiles.forEach(path => {
|
|
114
|
+
updates.push({
|
|
115
|
+
path: this.addPath(path),
|
|
116
|
+
createIfMissing: false,
|
|
117
|
+
updater: new java_update_1.JavaUpdate({
|
|
118
|
+
version,
|
|
119
|
+
versionsMap,
|
|
120
|
+
isSnapshot: options.isSnapshot,
|
|
121
|
+
}),
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
this.extraFiles.forEach(extraFile => {
|
|
125
|
+
if (typeof extraFile === 'object') {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
updates.push({
|
|
129
|
+
path: extraFile,
|
|
130
|
+
createIfMissing: false,
|
|
131
|
+
updater: new java_update_1.JavaUpdate({
|
|
132
|
+
version,
|
|
133
|
+
versionsMap,
|
|
134
|
+
isSnapshot: options.isSnapshot,
|
|
135
|
+
}),
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
if (!options.isSnapshot) {
|
|
139
|
+
updates.push({
|
|
140
|
+
path: this.addPath(this.changelogPath),
|
|
141
|
+
createIfMissing: true,
|
|
142
|
+
updater: new changelog_1.Changelog({
|
|
143
|
+
version,
|
|
144
|
+
changelogEntry: options.changelogEntry,
|
|
145
|
+
}),
|
|
146
|
+
});
|
|
147
|
+
// Bail early if the repository has no root changelog.json.
|
|
148
|
+
// This file is used to opt into machine readable commits.
|
|
149
|
+
const hasChangelogJson = await this.hasChangelogJson();
|
|
150
|
+
if (hasChangelogJson && options.commits) {
|
|
151
|
+
const changelogUpdates = [];
|
|
152
|
+
const cs = new commit_split_1.CommitSplit({
|
|
153
|
+
includeEmpty: false,
|
|
154
|
+
});
|
|
155
|
+
const splitCommits = cs.split(options.commits.filter(commit => {
|
|
156
|
+
const isBreaking = commit.notes.find(note => {
|
|
157
|
+
return note.title === BREAKING_CHANGE_NOTE;
|
|
158
|
+
});
|
|
159
|
+
return commit.type !== 'chore' || isBreaking;
|
|
160
|
+
}));
|
|
161
|
+
for (const path of Object.keys(splitCommits)) {
|
|
162
|
+
const repoMetadata = await this.getRepoMetadata(path);
|
|
163
|
+
const artifactName = repoMetadata
|
|
164
|
+
? repoMetadata['distribution_name']
|
|
165
|
+
: null;
|
|
166
|
+
if (repoMetadata && artifactName) {
|
|
167
|
+
this.logger.info(`Found artifact ${artifactName} for ${path}`);
|
|
168
|
+
changelogUpdates.push(new changelog_json_1.ChangelogJson({
|
|
169
|
+
artifactName,
|
|
170
|
+
version,
|
|
171
|
+
// We filter out "chore:" commits, to reduce noise in the upstream
|
|
172
|
+
// release notes. We will only show a product release note entry
|
|
173
|
+
// if there has been a substantial change, such as a fix or feature.
|
|
174
|
+
commits: splitCommits[path],
|
|
175
|
+
language: 'JAVA',
|
|
176
|
+
}));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
updates.push({
|
|
180
|
+
path: 'changelog.json',
|
|
181
|
+
createIfMissing: false,
|
|
182
|
+
updater: new composite_1.CompositeUpdater(...changelogUpdates),
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return updates;
|
|
187
|
+
}
|
|
188
|
+
async hasChangelogJson() {
|
|
189
|
+
try {
|
|
190
|
+
const content = await this.github.getFileContentsOnBranch('changelog.json', this.targetBranch);
|
|
191
|
+
return !!content;
|
|
192
|
+
}
|
|
193
|
+
catch (e) {
|
|
194
|
+
if (e instanceof errors_1.FileNotFoundError)
|
|
195
|
+
return false;
|
|
196
|
+
else
|
|
197
|
+
throw e;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
async getRepoMetadata(path) {
|
|
201
|
+
try {
|
|
202
|
+
const content = await this.github.getFileContentsOnBranch(this.addPath(`${path}/.repo-metadata.json`), this.targetBranch);
|
|
203
|
+
return content ? JSON.parse(content.parsedContent) : null;
|
|
204
|
+
}
|
|
205
|
+
catch (e) {
|
|
206
|
+
if (e instanceof errors_1.FileNotFoundError)
|
|
207
|
+
return null;
|
|
208
|
+
else
|
|
209
|
+
throw e;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async updateVersionsMap(versionsMap, conventionalCommits) {
|
|
213
|
+
let isPromotion = false;
|
|
214
|
+
const modifiedCommits = [];
|
|
215
|
+
for (const commit of conventionalCommits) {
|
|
216
|
+
if (isPromotionCommit(commit)) {
|
|
217
|
+
isPromotion = true;
|
|
218
|
+
modifiedCommits.push({
|
|
219
|
+
...commit,
|
|
220
|
+
notes: commit.notes.filter(note => !isPromotionNote(note)),
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
modifiedCommits.push(commit);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
for (const versionKey of versionsMap.keys()) {
|
|
228
|
+
const version = versionsMap.get(versionKey);
|
|
229
|
+
if (!version) {
|
|
230
|
+
this.logger.warn(`didn't find version for ${versionKey}`);
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
if (isPromotion && isStableArtifact(versionKey)) {
|
|
234
|
+
versionsMap.set(versionKey, version_1.Version.parse('1.0.0'));
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
const newVersion = await this.versioningStrategy.bump(version, modifiedCommits);
|
|
238
|
+
versionsMap.set(versionKey, newVersion);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return versionsMap;
|
|
242
|
+
}
|
|
243
|
+
initialReleaseVersion() {
|
|
244
|
+
return version_1.Version.parse('0.1.0');
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
exports.JavaYoshiMonoRepo = JavaYoshiMonoRepo;
|
|
248
|
+
const VERSIONED_ARTIFACT_REGEX = /^.*-(v\d+[^-]*)$/;
|
|
249
|
+
const VERSION_REGEX = /^v\d+(.*)$/;
|
|
250
|
+
/**
|
|
251
|
+
* Returns true if the artifact should be considered stable
|
|
252
|
+
* @param artifact name of the artifact to check
|
|
253
|
+
*/
|
|
254
|
+
function isStableArtifact(artifact) {
|
|
255
|
+
const match = artifact.match(VERSIONED_ARTIFACT_REGEX);
|
|
256
|
+
if (!match) {
|
|
257
|
+
// The artifact does not have a version qualifier at the end
|
|
258
|
+
return true;
|
|
259
|
+
}
|
|
260
|
+
const versionMatch = match[1].match(VERSION_REGEX);
|
|
261
|
+
if (versionMatch && versionMatch[1]) {
|
|
262
|
+
// The version is not stable (probably alpha/beta/rc)
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
function isPromotionCommit(commit) {
|
|
268
|
+
return commit.notes.some(isPromotionNote);
|
|
269
|
+
}
|
|
270
|
+
function isPromotionNote(note) {
|
|
271
|
+
return note.title === 'RELEASE AS' && note.text === '1.0.0';
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=java-yoshi-mono-repo.js.map
|
|
@@ -93,6 +93,7 @@ class Java extends base_1.BaseStrategy {
|
|
|
93
93
|
versionsMap,
|
|
94
94
|
changelogEntry: notes,
|
|
95
95
|
isSnapshot: true,
|
|
96
|
+
commits: [],
|
|
96
97
|
});
|
|
97
98
|
const updatesWithExtras = (0, composite_1.mergeUpdates)(updates.concat(...(await this.extraFileUpdates(newVersion, versionsMap))));
|
|
98
99
|
return {
|
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.Node = void 0;
|
|
17
17
|
const base_1 = require("./base");
|
|
18
|
+
const changelog_json_1 = require("../updaters/changelog-json");
|
|
18
19
|
const package_lock_json_1 = require("../updaters/node/package-lock-json");
|
|
19
20
|
const samples_package_json_1 = require("../updaters/node/samples-package-json");
|
|
20
21
|
const changelog_1 = require("../updaters/changelog");
|
|
21
22
|
const package_json_1 = require("../updaters/node/package-json");
|
|
22
23
|
const errors_1 = require("../errors");
|
|
24
|
+
const BREAKING_CHANGE_NOTE = 'BREAKING CHANGE';
|
|
23
25
|
class Node extends base_1.BaseStrategy {
|
|
24
26
|
async buildUpdates(options) {
|
|
25
27
|
var _a;
|
|
@@ -60,6 +62,25 @@ class Node extends base_1.BaseStrategy {
|
|
|
60
62
|
version,
|
|
61
63
|
}),
|
|
62
64
|
});
|
|
65
|
+
// If a machine readable changelog.json exists update it:
|
|
66
|
+
if (options.commits && packageName) {
|
|
67
|
+
const commits = options.commits.filter(commit => {
|
|
68
|
+
const isBreaking = commit.notes.find(note => {
|
|
69
|
+
return note.title === BREAKING_CHANGE_NOTE;
|
|
70
|
+
});
|
|
71
|
+
return commit.type !== 'chore' || isBreaking;
|
|
72
|
+
});
|
|
73
|
+
updates.push({
|
|
74
|
+
path: 'changelog.json',
|
|
75
|
+
createIfMissing: false,
|
|
76
|
+
updater: new changelog_json_1.ChangelogJson({
|
|
77
|
+
artifactName: packageName,
|
|
78
|
+
version,
|
|
79
|
+
commits,
|
|
80
|
+
language: 'JAVASCRIPT',
|
|
81
|
+
}),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
63
84
|
return updates;
|
|
64
85
|
}
|
|
65
86
|
async getDefaultPackageName() {
|
|
@@ -110,6 +110,7 @@ class PHPYoshi extends base_1.BaseStrategy {
|
|
|
110
110
|
newVersion,
|
|
111
111
|
versionsMap,
|
|
112
112
|
latestVersion: latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag.version,
|
|
113
|
+
commits: conventionalCommits, // TODO(@bcoe): these commits will need to be divided into multiple changelog.json updates.
|
|
113
114
|
});
|
|
114
115
|
for (const directory in directoryVersionContents) {
|
|
115
116
|
const componentInfo = directoryVersionContents[directory];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseStrategy, BuildUpdatesOptions } from './base';
|
|
2
|
+
import { Update } from '../update';
|
|
3
|
+
import { GitHubFileContents } from '@google-automations/git-file-utils';
|
|
4
|
+
export declare class Salesforce extends BaseStrategy {
|
|
5
|
+
private sfdxProjectJsonContents?;
|
|
6
|
+
protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
|
|
7
|
+
getDefaultPackageName(): Promise<string | undefined>;
|
|
8
|
+
protected getSfdxProjectJsonContents(): Promise<GitHubFileContents>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2023 Google LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.Salesforce = void 0;
|
|
17
|
+
const base_1 = require("./base");
|
|
18
|
+
const changelog_1 = require("../updaters/changelog");
|
|
19
|
+
const errors_1 = require("../errors");
|
|
20
|
+
const sfdx_project_json_1 = require("../updaters/salesforce/sfdx-project-json");
|
|
21
|
+
const sfdxProjectJsonFileName = 'sfdx-project.json';
|
|
22
|
+
class Salesforce extends base_1.BaseStrategy {
|
|
23
|
+
async buildUpdates(options) {
|
|
24
|
+
const updates = [];
|
|
25
|
+
const version = options.newVersion;
|
|
26
|
+
updates.push({
|
|
27
|
+
path: this.addPath(this.changelogPath),
|
|
28
|
+
createIfMissing: true,
|
|
29
|
+
updater: new changelog_1.Changelog({
|
|
30
|
+
version,
|
|
31
|
+
changelogEntry: options.changelogEntry,
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
updates.push({
|
|
35
|
+
path: this.addPath(sfdxProjectJsonFileName),
|
|
36
|
+
createIfMissing: false,
|
|
37
|
+
cachedFileContents: this.sfdxProjectJsonContents,
|
|
38
|
+
updater: new sfdx_project_json_1.SfdxProjectJson({
|
|
39
|
+
version,
|
|
40
|
+
}),
|
|
41
|
+
});
|
|
42
|
+
return updates;
|
|
43
|
+
}
|
|
44
|
+
async getDefaultPackageName() {
|
|
45
|
+
const pkgJsonContents = await this.getSfdxProjectJsonContents();
|
|
46
|
+
const pkg = JSON.parse(pkgJsonContents.parsedContent);
|
|
47
|
+
return pkg.name;
|
|
48
|
+
}
|
|
49
|
+
async getSfdxProjectJsonContents() {
|
|
50
|
+
if (!this.sfdxProjectJsonContents) {
|
|
51
|
+
try {
|
|
52
|
+
this.sfdxProjectJsonContents =
|
|
53
|
+
await this.github.getFileContentsOnBranch(this.addPath(sfdxProjectJsonFileName), this.targetBranch);
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
if (e instanceof errors_1.FileNotFoundError) {
|
|
57
|
+
throw new errors_1.MissingRequiredFileError(this.addPath(sfdxProjectJsonFileName), 'salesforce', `${this.repository.owner}/${this.repository.repo}`);
|
|
58
|
+
}
|
|
59
|
+
throw e;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return this.sfdxProjectJsonContents;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.Salesforce = Salesforce;
|
|
66
|
+
//# sourceMappingURL=salesforce.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ConventionalCommit } from '../commit';
|
|
2
|
+
import { Logger } from '../util/logger';
|
|
3
|
+
import { DefaultUpdater, UpdateOptions } from './default';
|
|
4
|
+
interface ChangelogJsonOptions extends UpdateOptions {
|
|
5
|
+
artifactName: string;
|
|
6
|
+
language: string;
|
|
7
|
+
commits: ConventionalCommit[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Maintians a machine readable CHANGELOG in chnagelog.json.
|
|
11
|
+
* See: https://gist.github.com/bcoe/50ef0a0024bbf107cd5bc0adbdc04758
|
|
12
|
+
*/
|
|
13
|
+
export declare class ChangelogJson extends DefaultUpdater {
|
|
14
|
+
artifactName: string;
|
|
15
|
+
language: string;
|
|
16
|
+
commits: ConventionalCommit[];
|
|
17
|
+
/**
|
|
18
|
+
* Instantiate a new SamplesPackageJson updater
|
|
19
|
+
* @param options
|
|
20
|
+
*/
|
|
21
|
+
constructor(options: ChangelogJsonOptions);
|
|
22
|
+
/**
|
|
23
|
+
* Given initial file contents, return updated contents.
|
|
24
|
+
* @param {string} content The initial content
|
|
25
|
+
* @returns {string} The updated content
|
|
26
|
+
*/
|
|
27
|
+
updateContent(content: string, logger?: Logger): string;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2023 Google LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.ChangelogJson = void 0;
|
|
17
|
+
const logger_1 = require("../util/logger");
|
|
18
|
+
const default_1 = require("./default");
|
|
19
|
+
const crypto_1 = require("crypto");
|
|
20
|
+
const BREAKING_CHANGE_TITLE = 'BREAKING CHANGE';
|
|
21
|
+
const COMMIT_PREFIX = /^[^:]+: ?/;
|
|
22
|
+
/**
|
|
23
|
+
* Maintians a machine readable CHANGELOG in chnagelog.json.
|
|
24
|
+
* See: https://gist.github.com/bcoe/50ef0a0024bbf107cd5bc0adbdc04758
|
|
25
|
+
*/
|
|
26
|
+
class ChangelogJson extends default_1.DefaultUpdater {
|
|
27
|
+
/**
|
|
28
|
+
* Instantiate a new SamplesPackageJson updater
|
|
29
|
+
* @param options
|
|
30
|
+
*/
|
|
31
|
+
constructor(options) {
|
|
32
|
+
super(options);
|
|
33
|
+
this.language = options.language;
|
|
34
|
+
this.artifactName = options.artifactName;
|
|
35
|
+
this.commits = options.commits;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Given initial file contents, return updated contents.
|
|
39
|
+
* @param {string} content The initial content
|
|
40
|
+
* @returns {string} The updated content
|
|
41
|
+
*/
|
|
42
|
+
updateContent(content, logger = logger_1.logger) {
|
|
43
|
+
const parsed = JSON.parse(content);
|
|
44
|
+
logger.info(`adding release ${this.version} for ${this.artifactName}`);
|
|
45
|
+
const changes = [];
|
|
46
|
+
for (const commit of this.commits) {
|
|
47
|
+
// The commit.message field contains the type/scope prefix.
|
|
48
|
+
const message = commit.message.replace(COMMIT_PREFIX, '');
|
|
49
|
+
const change = {
|
|
50
|
+
type: commit.type,
|
|
51
|
+
sha: commit.sha,
|
|
52
|
+
message: message,
|
|
53
|
+
};
|
|
54
|
+
if (commit.scope)
|
|
55
|
+
change.scope = commit.scope;
|
|
56
|
+
for (const note of commit.notes) {
|
|
57
|
+
if (note.title === BREAKING_CHANGE_TITLE) {
|
|
58
|
+
change.breakingChangeNote = note.text;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
changes.push(change);
|
|
62
|
+
}
|
|
63
|
+
// If all commits were ignored, simply return the original changelog.json.
|
|
64
|
+
if (changes.length === 0) {
|
|
65
|
+
return content;
|
|
66
|
+
}
|
|
67
|
+
const time = new Date().toISOString();
|
|
68
|
+
const release = {
|
|
69
|
+
changes,
|
|
70
|
+
version: this.version.toString(),
|
|
71
|
+
language: this.language,
|
|
72
|
+
artifactName: this.artifactName,
|
|
73
|
+
id: (0, crypto_1.randomUUID)(),
|
|
74
|
+
createTime: time,
|
|
75
|
+
};
|
|
76
|
+
parsed.entries.unshift(release);
|
|
77
|
+
parsed.updateTime = time;
|
|
78
|
+
return JSON.stringify(parsed, null, 2);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.ChangelogJson = ChangelogJson;
|
|
82
|
+
//# sourceMappingURL=changelog-json.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Logger } from '../../util/logger';
|
|
2
|
+
import { DefaultUpdater } from '../default';
|
|
3
|
+
export type PackageDirectory = {
|
|
4
|
+
versionNumber: string;
|
|
5
|
+
default: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type SfdxProjectFile = {
|
|
8
|
+
packageDirectories: PackageDirectory[];
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* This updates a Salesfore sfdx-project.json file's main version.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SfdxProjectJson extends DefaultUpdater {
|
|
15
|
+
/**
|
|
16
|
+
* Given initial file contents, return updated contents.
|
|
17
|
+
* @param {string} content The initial content
|
|
18
|
+
* @returns {string} The updated content
|
|
19
|
+
*/
|
|
20
|
+
updateContent(content: string, logger?: Logger): string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2023 Google LLC
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.SfdxProjectJson = void 0;
|
|
17
|
+
const json_stringify_1 = require("../../util/json-stringify");
|
|
18
|
+
const logger_1 = require("../../util/logger");
|
|
19
|
+
const default_1 = require("../default");
|
|
20
|
+
/**
|
|
21
|
+
* This updates a Salesfore sfdx-project.json file's main version.
|
|
22
|
+
*/
|
|
23
|
+
class SfdxProjectJson extends default_1.DefaultUpdater {
|
|
24
|
+
/**
|
|
25
|
+
* Given initial file contents, return updated contents.
|
|
26
|
+
* @param {string} content The initial content
|
|
27
|
+
* @returns {string} The updated content
|
|
28
|
+
*/
|
|
29
|
+
updateContent(content, logger = logger_1.logger) {
|
|
30
|
+
const parsed = JSON.parse(content);
|
|
31
|
+
for (const packDir of parsed.packageDirectories) {
|
|
32
|
+
if (packDir.default) {
|
|
33
|
+
logger.info(`updating from ${packDir.versionNumber} to ${this.version}`);
|
|
34
|
+
packDir.versionNumber = `${this.version.toString()}.NEXT`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.SfdxProjectJson = SfdxProjectJson;
|
|
41
|
+
//# sourceMappingURL=sfdx-project-json.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.3.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",
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@octokit/types": "^
|
|
41
|
+
"@octokit/types": "^9.0.0",
|
|
42
42
|
"@types/chai": "^4.1.7",
|
|
43
43
|
"@types/diff": "^5.0.2",
|
|
44
44
|
"@types/iarna__toml": "^2.0.1",
|
|
45
45
|
"@types/js-yaml": "^4.0.0",
|
|
46
46
|
"@types/jsonpath": "^0.2.0",
|
|
47
|
-
"@types/lerna__collect-updates": "^5.
|
|
48
|
-
"@types/lerna__package": "^5.
|
|
49
|
-
"@types/lerna__package-graph": "^5.
|
|
50
|
-
"@types/lerna__run-topologically": "^5.
|
|
47
|
+
"@types/lerna__collect-updates": "^5.1.0",
|
|
48
|
+
"@types/lerna__package": "^5.1.0",
|
|
49
|
+
"@types/lerna__package-graph": "^5.1.0",
|
|
50
|
+
"@types/lerna__run-topologically": "^5.1.0",
|
|
51
51
|
"@types/mocha": "^9.0.0",
|
|
52
52
|
"@types/node": "^18.0.0",
|
|
53
53
|
"@types/pino": "^7.0.0",
|
|
@@ -70,10 +70,10 @@
|
|
|
70
70
|
"@conventional-commits/parser": "^0.4.1",
|
|
71
71
|
"@google-automations/git-file-utils": "^1.2.5",
|
|
72
72
|
"@iarna/toml": "^2.2.5",
|
|
73
|
-
"@lerna/collect-updates": "^4.
|
|
74
|
-
"@lerna/package": "^4.
|
|
75
|
-
"@lerna/package-graph": "^4.
|
|
76
|
-
"@lerna/run-topologically": "^4.
|
|
73
|
+
"@lerna/collect-updates": "^6.4.1",
|
|
74
|
+
"@lerna/package": "^6.4.1",
|
|
75
|
+
"@lerna/package-graph": "^6.4.1",
|
|
76
|
+
"@lerna/run-topologically": "^6.4.1",
|
|
77
77
|
"@octokit/graphql": "^5.0.0",
|
|
78
78
|
"@octokit/request": "^6.0.0",
|
|
79
79
|
"@octokit/request-error": "^3.0.0",
|