release-please 14.17.5 → 15.1.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 +29 -0
- package/build/src/manifest.js +7 -9
- package/build/src/plugin.d.ts +2 -2
- package/build/src/plugin.js +0 -2
- package/build/src/plugins/linked-versions.js +2 -1
- package/build/src/plugins/sentence-case.d.ts +2 -2
- package/build/src/plugins/sentence-case.js +3 -0
- package/build/src/strategies/base.d.ts +8 -1
- package/build/src/strategies/base.js +14 -2
- package/build/src/strategies/java-yoshi.js +1 -1
- package/build/src/strategies/java.d.ts +3 -3
- package/build/src/strategies/ruby.js +9 -0
- package/build/src/strategy.d.ts +7 -0
- package/build/src/updaters/ruby/common.d.ts +17 -0
- package/build/src/updaters/ruby/common.js +46 -0
- package/build/src/updaters/ruby/gemfile-lock.d.ts +24 -0
- package/build/src/updaters/ruby/gemfile-lock.js +50 -0
- package/build/src/updaters/ruby/version-rb.js +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,35 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [15.1.0](https://github.com/googleapis/release-please/compare/v15.0.0...v15.1.0) (2023-01-05)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **ruby:** Add Gemfile.Lock updater ([#1790](https://github.com/googleapis/release-please/issues/1790)) ([9baf736](https://github.com/googleapis/release-please/commit/9baf736aa424bf3dcf0f05009e5cf8c9ef05fd69))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **java-yoshi:** Throw MissingRequiredFile error if no versions.txt found ([#1794](https://github.com/googleapis/release-please/issues/1794)) ([542d412](https://github.com/googleapis/release-please/commit/542d412307ea8d6350908aeb7efaf9db9e3d03f9))
|
|
18
|
+
|
|
19
|
+
## [15.0.0](https://github.com/googleapis/release-please/compare/v14.17.5...v15.0.0) (2022-12-12)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### ⚠ BREAKING CHANGES
|
|
23
|
+
|
|
24
|
+
* Strategies can parse multiple releases from single release PR ([#1775](https://github.com/googleapis/release-please/issues/1775))
|
|
25
|
+
* Parse conventional commits in manifest ([#1772](https://github.com/googleapis/release-please/issues/1772))
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* Strategies can parse multiple releases from single release PR ([#1775](https://github.com/googleapis/release-please/issues/1775)) ([b565f85](https://github.com/googleapis/release-please/commit/b565f85b64a431be1d62f8e682c183c4c1f1c631))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Code Refactoring
|
|
33
|
+
|
|
34
|
+
* Parse conventional commits in manifest ([#1772](https://github.com/googleapis/release-please/issues/1772)) ([3391d3b](https://github.com/googleapis/release-please/commit/3391d3bc916ad07102bbb3873b93aeac6e13977c))
|
|
35
|
+
|
|
7
36
|
## [14.17.5](https://github.com/googleapis/release-please/compare/v14.17.4...v14.17.5) (2022-12-08)
|
|
8
37
|
|
|
9
38
|
|
package/build/src/manifest.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.Manifest = exports.MANIFEST_PULL_REQUEST_TITLE_PATTERN = exports.SNOOZE_LABEL = exports.DEFAULT_SNAPSHOT_LABELS = exports.DEFAULT_RELEASE_LABELS = exports.DEFAULT_LABELS = exports.DEFAULT_COMPONENT_NAME = exports.ROOT_PROJECT_PATH = exports.DEFAULT_RELEASE_PLEASE_MANIFEST = exports.DEFAULT_RELEASE_PLEASE_CONFIG = void 0;
|
|
17
17
|
const version_1 = require("./version");
|
|
18
|
+
const commit_1 = require("./commit");
|
|
18
19
|
const logger_1 = require("./util/logger");
|
|
19
20
|
const commit_split_1 = require("./util/commit-split");
|
|
20
21
|
const tag_name_1 = require("./util/tag-name");
|
|
@@ -329,7 +330,7 @@ class Manifest {
|
|
|
329
330
|
this.logger.info(`Building candidate release pull request for path: ${path}`);
|
|
330
331
|
this.logger.debug(`type: ${config.releaseType}`);
|
|
331
332
|
this.logger.debug(`targetBranch: ${this.targetBranch}`);
|
|
332
|
-
let pathCommits = commitsPerPath[path];
|
|
333
|
+
let pathCommits = (0, commit_1.parseConventionalCommits)(commitsPerPath[path], this.logger);
|
|
333
334
|
// The processCommits hook can be implemented by plugins to
|
|
334
335
|
// post-process commits. This can be used to perform cleanup, e.g,, sentence
|
|
335
336
|
// casing all commit messages:
|
|
@@ -579,7 +580,7 @@ class Manifest {
|
|
|
579
580
|
const strategiesByPath = await this.getStrategiesByPath();
|
|
580
581
|
// Find merged release pull requests
|
|
581
582
|
const generator = await this.findMergedReleasePullRequests();
|
|
582
|
-
const
|
|
583
|
+
const candidateReleases = [];
|
|
583
584
|
for await (const pullRequest of generator) {
|
|
584
585
|
for (const path in this.repositoryConfig) {
|
|
585
586
|
const config = this.repositoryConfig[path];
|
|
@@ -587,11 +588,11 @@ class Manifest {
|
|
|
587
588
|
this.logger.debug(`type: ${config.releaseType}`);
|
|
588
589
|
this.logger.debug(`targetBranch: ${this.targetBranch}`);
|
|
589
590
|
const strategy = strategiesByPath[path];
|
|
590
|
-
const
|
|
591
|
+
const releases = await strategy.buildReleases(pullRequest, {
|
|
591
592
|
groupPullRequestTitlePattern: this.groupPullRequestTitlePattern,
|
|
592
593
|
});
|
|
593
|
-
|
|
594
|
-
|
|
594
|
+
for (const release of releases) {
|
|
595
|
+
candidateReleases.push({
|
|
595
596
|
...release,
|
|
596
597
|
path,
|
|
597
598
|
pullRequest,
|
|
@@ -601,12 +602,9 @@ class Manifest {
|
|
|
601
602
|
release.tag.version.major === 0),
|
|
602
603
|
});
|
|
603
604
|
}
|
|
604
|
-
else {
|
|
605
|
-
this.logger.info(`No release necessary for path: ${path}`);
|
|
606
|
-
}
|
|
607
605
|
}
|
|
608
606
|
}
|
|
609
|
-
return
|
|
607
|
+
return candidateReleases;
|
|
610
608
|
}
|
|
611
609
|
/**
|
|
612
610
|
* Find merged, untagged releases. For each release, create a GitHub release,
|
package/build/src/plugin.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GitHub } from './github';
|
|
2
2
|
import { CandidateReleasePullRequest, RepositoryConfig } from './manifest';
|
|
3
3
|
import { Strategy } from './strategy';
|
|
4
|
-
import { Commit } from './commit';
|
|
4
|
+
import { Commit, ConventionalCommit } from './commit';
|
|
5
5
|
import { Release } from './release';
|
|
6
6
|
import { Logger } from './util/logger';
|
|
7
7
|
/**
|
|
@@ -21,7 +21,7 @@ export declare abstract class ManifestPlugin {
|
|
|
21
21
|
* @param {Commit[]} commits The set of commits that will feed into release pull request.
|
|
22
22
|
* @returns {Commit[]} The modified commit objects.
|
|
23
23
|
*/
|
|
24
|
-
processCommits(commits:
|
|
24
|
+
processCommits(commits: ConventionalCommit[]): ConventionalCommit[];
|
|
25
25
|
/**
|
|
26
26
|
* Post-process candidate pull requests.
|
|
27
27
|
* @param {CandidateReleasePullRequest[]} pullRequests Candidate pull requests
|
package/build/src/plugin.js
CHANGED
|
@@ -33,8 +33,6 @@ class ManifestPlugin {
|
|
|
33
33
|
* @param {Commit[]} commits The set of commits that will feed into release pull request.
|
|
34
34
|
* @returns {Commit[]} The modified commit objects.
|
|
35
35
|
*/
|
|
36
|
-
// TODO: for next major version, let's run the default conventional commit parser earlier
|
|
37
|
-
// (outside of the strategy classes) and pass in the ConventionalCommit[] objects in.
|
|
38
36
|
processCommits(commits) {
|
|
39
37
|
return commits;
|
|
40
38
|
}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.LinkedVersions = void 0;
|
|
17
17
|
const plugin_1 = require("../plugin");
|
|
18
|
+
const commit_1 = require("../commit");
|
|
18
19
|
const factory_1 = require("../factory");
|
|
19
20
|
const merge_1 = require("./merge");
|
|
20
21
|
/**
|
|
@@ -55,7 +56,7 @@ class LinkedVersions extends plugin_1.ManifestPlugin {
|
|
|
55
56
|
for (const path in groupStrategies) {
|
|
56
57
|
const strategy = groupStrategies[path];
|
|
57
58
|
const latestRelease = releasesByPath[path];
|
|
58
|
-
const releasePullRequest = await strategy.buildReleasePullRequest(commitsByPath[path], latestRelease);
|
|
59
|
+
const releasePullRequest = await strategy.buildReleasePullRequest((0, commit_1.parseConventionalCommits)(commitsByPath[path], this.logger), latestRelease);
|
|
59
60
|
if (releasePullRequest === null || releasePullRequest === void 0 ? void 0 : releasePullRequest.version) {
|
|
60
61
|
groupVersions[path] = releasePullRequest.version;
|
|
61
62
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ManifestPlugin } from '../plugin';
|
|
2
2
|
import { GitHub } from '../github';
|
|
3
3
|
import { RepositoryConfig } from '../manifest';
|
|
4
|
-
import {
|
|
4
|
+
import { ConventionalCommit } from '../commit';
|
|
5
5
|
/**
|
|
6
6
|
* This plugin converts commit messages to sentence case, for the benefit
|
|
7
7
|
* of the generated CHANGELOG.
|
|
@@ -14,6 +14,6 @@ export declare class SentenceCase extends ManifestPlugin {
|
|
|
14
14
|
* @param {Commit[]} commits The set of commits that will feed into release pull request.
|
|
15
15
|
* @returns {Commit[]} The modified commit objects.
|
|
16
16
|
*/
|
|
17
|
-
processCommits(commits:
|
|
17
|
+
processCommits(commits: ConventionalCommit[]): ConventionalCommit[];
|
|
18
18
|
toUpperCase(word: string): string;
|
|
19
19
|
}
|
|
@@ -34,6 +34,9 @@ class SentenceCase extends plugin_1.ManifestPlugin {
|
|
|
34
34
|
processCommits(commits) {
|
|
35
35
|
this.logger.info(`SentenceCase processing ${commits.length} commits`);
|
|
36
36
|
for (const commit of commits) {
|
|
37
|
+
// The parsed conventional commit message, without the type:
|
|
38
|
+
console.info(commit.bareMessage);
|
|
39
|
+
commit.bareMessage = this.toUpperCase(commit.bareMessage);
|
|
37
40
|
// Check whether commit is in conventional commit format, if it is
|
|
38
41
|
// we'll split the string by type and description:
|
|
39
42
|
if (commit.message.includes(':')) {
|
|
@@ -112,7 +112,7 @@ export declare abstract class BaseStrategy implements Strategy {
|
|
|
112
112
|
* open for this path/component. Returns undefined if we should not
|
|
113
113
|
* open a pull request.
|
|
114
114
|
*/
|
|
115
|
-
buildReleasePullRequest(commits:
|
|
115
|
+
buildReleasePullRequest(commits: ConventionalCommit[], latestRelease?: Release, draft?: boolean, labels?: string[]): Promise<ReleasePullRequest | undefined>;
|
|
116
116
|
private extraFilePaths;
|
|
117
117
|
protected extraFileUpdates(version: Version, versionsMap: VersionsMap): Promise<Update[]>;
|
|
118
118
|
protected changelogEmpty(changelogEntry: string): boolean;
|
|
@@ -124,8 +124,15 @@ export declare abstract class BaseStrategy implements Strategy {
|
|
|
124
124
|
* Given a merged pull request, build the candidate release.
|
|
125
125
|
* @param {PullRequest} mergedPullRequest The merged release pull request.
|
|
126
126
|
* @returns {Release} The candidate release.
|
|
127
|
+
* @deprecated Use buildReleases() instead.
|
|
127
128
|
*/
|
|
128
129
|
buildRelease(mergedPullRequest: PullRequest, options?: BuildReleaseOptions): Promise<Release | undefined>;
|
|
130
|
+
/**
|
|
131
|
+
* Given a merged pull request, build the candidate releases.
|
|
132
|
+
* @param {PullRequest} mergedPullRequest The merged release pull request.
|
|
133
|
+
* @returns {Release} The candidate release.
|
|
134
|
+
*/
|
|
135
|
+
buildReleases(mergedPullRequest: PullRequest, options?: BuildReleaseOptions): Promise<Release[]>;
|
|
129
136
|
isPublishedVersion(_version: Version): boolean;
|
|
130
137
|
/**
|
|
131
138
|
* Override this to handle the initial version of a new library.
|
|
@@ -17,7 +17,6 @@ exports.BaseStrategy = void 0;
|
|
|
17
17
|
const manifest_1 = require("../manifest");
|
|
18
18
|
const default_1 = require("../versioning-strategies/default");
|
|
19
19
|
const default_2 = require("../changelog-notes/default");
|
|
20
|
-
const commit_1 = require("../commit");
|
|
21
20
|
const version_1 = require("../version");
|
|
22
21
|
const tag_name_1 = require("../util/tag-name");
|
|
23
22
|
const logger_1 = require("../util/logger");
|
|
@@ -139,7 +138,7 @@ class BaseStrategy {
|
|
|
139
138
|
* open a pull request.
|
|
140
139
|
*/
|
|
141
140
|
async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
|
|
142
|
-
const conventionalCommits = await this.postProcessCommits(
|
|
141
|
+
const conventionalCommits = await this.postProcessCommits(commits);
|
|
143
142
|
this.logger.info(`Considering: ${conventionalCommits.length} commits`);
|
|
144
143
|
if (conventionalCommits.length === 0) {
|
|
145
144
|
this.logger.info(`No commits for path: ${this.path}, skipping`);
|
|
@@ -287,6 +286,7 @@ class BaseStrategy {
|
|
|
287
286
|
* Given a merged pull request, build the candidate release.
|
|
288
287
|
* @param {PullRequest} mergedPullRequest The merged release pull request.
|
|
289
288
|
* @returns {Release} The candidate release.
|
|
289
|
+
* @deprecated Use buildReleases() instead.
|
|
290
290
|
*/
|
|
291
291
|
async buildRelease(mergedPullRequest, options) {
|
|
292
292
|
var _a;
|
|
@@ -365,6 +365,18 @@ class BaseStrategy {
|
|
|
365
365
|
sha: mergedPullRequest.sha,
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* Given a merged pull request, build the candidate releases.
|
|
370
|
+
* @param {PullRequest} mergedPullRequest The merged release pull request.
|
|
371
|
+
* @returns {Release} The candidate release.
|
|
372
|
+
*/
|
|
373
|
+
async buildReleases(mergedPullRequest, options) {
|
|
374
|
+
const release = await this.buildRelease(mergedPullRequest, options);
|
|
375
|
+
if (release) {
|
|
376
|
+
return [release];
|
|
377
|
+
}
|
|
378
|
+
return [];
|
|
379
|
+
}
|
|
368
380
|
isPublishedVersion(_version) {
|
|
369
381
|
return true;
|
|
370
382
|
}
|
|
@@ -57,7 +57,7 @@ class JavaYoshi extends java_1.Java {
|
|
|
57
57
|
this.versionsContent = await this.github.getFileContentsOnBranch(this.addPath('versions.txt'), this.targetBranch);
|
|
58
58
|
}
|
|
59
59
|
catch (err) {
|
|
60
|
-
if (err instanceof errors_1.
|
|
60
|
+
if (err instanceof errors_1.FileNotFoundError) {
|
|
61
61
|
throw new errors_1.MissingRequiredFileError(this.addPath('versions.txt'), JavaYoshi.name, `${this.repository.owner}/${this.repository.repo}`);
|
|
62
62
|
}
|
|
63
63
|
throw err;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Update } from '../update';
|
|
2
2
|
import { Version } from '../version';
|
|
3
3
|
import { BaseStrategy, BaseStrategyOptions, BuildUpdatesOptions } from './base';
|
|
4
|
-
import {
|
|
4
|
+
import { ConventionalCommit } from '../commit';
|
|
5
5
|
import { Release } from '../release';
|
|
6
6
|
import { ReleasePullRequest } from '../release-pull-request';
|
|
7
7
|
import { VersioningStrategy } from '../versioning-strategy';
|
|
@@ -18,9 +18,9 @@ export declare class Java extends BaseStrategy {
|
|
|
18
18
|
protected readonly snapshotLabels: string[];
|
|
19
19
|
readonly skipSnapshot: boolean;
|
|
20
20
|
constructor(options: BaseStrategyOptions);
|
|
21
|
-
buildReleasePullRequest(commits:
|
|
21
|
+
buildReleasePullRequest(commits: ConventionalCommit[], latestRelease?: Release, draft?: boolean, labels?: string[]): Promise<ReleasePullRequest | undefined>;
|
|
22
22
|
protected buildSnapshotPullRequest(latestRelease?: Release, draft?: boolean, labels?: string[]): Promise<ReleasePullRequest>;
|
|
23
23
|
isPublishedVersion(version: Version): boolean;
|
|
24
|
-
protected needsSnapshot(commits:
|
|
24
|
+
protected needsSnapshot(commits: ConventionalCommit[], latestRelease?: Release): Promise<boolean>;
|
|
25
25
|
protected buildUpdates(options: JavaBuildUpdatesOption): Promise<Update[]>;
|
|
26
26
|
}
|
|
@@ -19,6 +19,7 @@ const indent_commit_1 = require("../util/indent-commit");
|
|
|
19
19
|
const changelog_1 = require("../updaters/changelog");
|
|
20
20
|
// Ruby
|
|
21
21
|
const version_rb_1 = require("../updaters/ruby/version-rb");
|
|
22
|
+
const gemfile_lock_1 = require("../updaters/ruby/gemfile-lock");
|
|
22
23
|
const base_1 = require("./base");
|
|
23
24
|
class Ruby extends base_1.BaseStrategy {
|
|
24
25
|
constructor(options) {
|
|
@@ -48,6 +49,14 @@ class Ruby extends base_1.BaseStrategy {
|
|
|
48
49
|
version,
|
|
49
50
|
}),
|
|
50
51
|
});
|
|
52
|
+
updates.push({
|
|
53
|
+
path: this.addPath('Gemfile.lock'),
|
|
54
|
+
createIfMissing: false,
|
|
55
|
+
updater: new gemfile_lock_1.GemfileLock({
|
|
56
|
+
version,
|
|
57
|
+
gemName: this.component || '',
|
|
58
|
+
}),
|
|
59
|
+
});
|
|
51
60
|
return updates;
|
|
52
61
|
}
|
|
53
62
|
async postProcessCommits(commits) {
|
package/build/src/strategy.d.ts
CHANGED
|
@@ -32,8 +32,15 @@ export interface Strategy {
|
|
|
32
32
|
* Given a merged pull request, build the candidate release.
|
|
33
33
|
* @param {PullRequest} mergedPullRequest The merged release pull request.
|
|
34
34
|
* @returns {Release} The candidate release.
|
|
35
|
+
* @deprecated Use buildReleases() instead.
|
|
35
36
|
*/
|
|
36
37
|
buildRelease(mergedPullRequest: PullRequest, options?: BuildReleaseOptions): Promise<Release | undefined>;
|
|
38
|
+
/**
|
|
39
|
+
* Given a merged pull request, build the candidate releases.
|
|
40
|
+
* @param {PullRequest} mergedPullRequest The merged release pull request.
|
|
41
|
+
* @returns {Release} The candidate release.
|
|
42
|
+
*/
|
|
43
|
+
buildReleases(mergedPullRequest: PullRequest, options?: BuildReleaseOptions): Promise<Release[]>;
|
|
37
44
|
/**
|
|
38
45
|
* Return the component for this strategy. This may be a computed field.
|
|
39
46
|
* @returns {string}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Version } from '../../version';
|
|
2
|
+
export declare const RUBY_VERSION_REGEX: RegExp;
|
|
3
|
+
/**
|
|
4
|
+
* Stringify a version to a ruby compatible version string
|
|
5
|
+
*
|
|
6
|
+
* @param version The version to stringify
|
|
7
|
+
* @param useDotPrePreleaseSeperator Use a `.` seperator for prereleases rather then `-`
|
|
8
|
+
* @returns a ruby compatible version string
|
|
9
|
+
*/
|
|
10
|
+
export declare function stringifyRubyVersion(version: Version, useDotPrePreleaseSeperator?: boolean): string;
|
|
11
|
+
/**
|
|
12
|
+
* This function mimics Gem::Version parsing of version semver strings
|
|
13
|
+
*
|
|
14
|
+
* @param versionString The version string to resolve
|
|
15
|
+
* @returns A Gem::Version compatible version string
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveRubyGemfileLockVersion(versionString: string): string;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2022 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.resolveRubyGemfileLockVersion = exports.stringifyRubyVersion = exports.RUBY_VERSION_REGEX = void 0;
|
|
17
|
+
// Ruby gem semver strings using `.` seperator for prereleases rather then `-`
|
|
18
|
+
// See https://guides.rubygems.org/patterns/
|
|
19
|
+
exports.RUBY_VERSION_REGEX = /((\d+).(\d)+.(\d+)(.\w+.*)?)/g;
|
|
20
|
+
/**
|
|
21
|
+
* Stringify a version to a ruby compatible version string
|
|
22
|
+
*
|
|
23
|
+
* @param version The version to stringify
|
|
24
|
+
* @param useDotPrePreleaseSeperator Use a `.` seperator for prereleases rather then `-`
|
|
25
|
+
* @returns a ruby compatible version string
|
|
26
|
+
*/
|
|
27
|
+
function stringifyRubyVersion(version, useDotPrePreleaseSeperator = false) {
|
|
28
|
+
if (!useDotPrePreleaseSeperator) {
|
|
29
|
+
return version.toString();
|
|
30
|
+
}
|
|
31
|
+
return `${version.major}.${version.minor}.${version.patch}${version.preRelease ? `.${version.preRelease}` : ''}`;
|
|
32
|
+
}
|
|
33
|
+
exports.stringifyRubyVersion = stringifyRubyVersion;
|
|
34
|
+
/**
|
|
35
|
+
* This function mimics Gem::Version parsing of version semver strings
|
|
36
|
+
*
|
|
37
|
+
* @param versionString The version string to resolve
|
|
38
|
+
* @returns A Gem::Version compatible version string
|
|
39
|
+
*/
|
|
40
|
+
function resolveRubyGemfileLockVersion(versionString) {
|
|
41
|
+
// Replace `-` with `.pre.` as per ruby gem parsing
|
|
42
|
+
// See https://github.com/rubygems/rubygems/blob/master/lib/rubygems/version.rb#L229
|
|
43
|
+
return versionString.replace(/-/g, '.pre.');
|
|
44
|
+
}
|
|
45
|
+
exports.resolveRubyGemfileLockVersion = resolveRubyGemfileLockVersion;
|
|
46
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DefaultUpdater, UpdateOptions } from '../default';
|
|
2
|
+
export interface GemfileLockOptions extends UpdateOptions {
|
|
3
|
+
gemName: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Builds a regex matching a gem version in a Gemfile.lock file.
|
|
7
|
+
* @example
|
|
8
|
+
* rails (7.0.1)
|
|
9
|
+
* rails (7.0.1.alpha1)
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildGemfileLockVersionRegex(gemName: string): RegExp;
|
|
12
|
+
/**
|
|
13
|
+
* Updates a Gemfile.lock files which is expected to have a local path version string.
|
|
14
|
+
*/
|
|
15
|
+
export declare class GemfileLock extends DefaultUpdater {
|
|
16
|
+
gemName: string;
|
|
17
|
+
constructor(options: GemfileLockOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Given initial file contents, return updated contents.
|
|
20
|
+
* @param {string} content The initial content
|
|
21
|
+
* @returns {string} The updated content
|
|
22
|
+
*/
|
|
23
|
+
updateContent(content: string): string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2022 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.GemfileLock = exports.buildGemfileLockVersionRegex = void 0;
|
|
17
|
+
const default_1 = require("../default");
|
|
18
|
+
const common_1 = require("./common");
|
|
19
|
+
/**
|
|
20
|
+
* Builds a regex matching a gem version in a Gemfile.lock file.
|
|
21
|
+
* @example
|
|
22
|
+
* rails (7.0.1)
|
|
23
|
+
* rails (7.0.1.alpha1)
|
|
24
|
+
*/
|
|
25
|
+
function buildGemfileLockVersionRegex(gemName) {
|
|
26
|
+
return new RegExp(`s*${gemName} \\(${common_1.RUBY_VERSION_REGEX.source}\\)`);
|
|
27
|
+
}
|
|
28
|
+
exports.buildGemfileLockVersionRegex = buildGemfileLockVersionRegex;
|
|
29
|
+
/**
|
|
30
|
+
* Updates a Gemfile.lock files which is expected to have a local path version string.
|
|
31
|
+
*/
|
|
32
|
+
class GemfileLock extends default_1.DefaultUpdater {
|
|
33
|
+
constructor(options) {
|
|
34
|
+
super(options);
|
|
35
|
+
this.gemName = options.gemName;
|
|
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) {
|
|
43
|
+
// Bundler will convert 1.0.0-alpha1 to 1.0.0.pre.alpha1, so we need to
|
|
44
|
+
// do the same here.
|
|
45
|
+
const versionString = (0, common_1.resolveRubyGemfileLockVersion)(this.version.toString());
|
|
46
|
+
return content.replace(buildGemfileLockVersionRegex(this.gemName), `${this.gemName} (${versionString})`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.GemfileLock = GemfileLock;
|
|
50
|
+
//# sourceMappingURL=gemfile-lock.js.map
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.VersionRB = void 0;
|
|
17
17
|
const default_1 = require("../default");
|
|
18
|
+
const common_1 = require("./common");
|
|
19
|
+
const RUBY_VERSION_RB_REGEX = new RegExp(`(["'])(${common_1.RUBY_VERSION_REGEX.source})(["'])`);
|
|
18
20
|
/**
|
|
19
21
|
* Updates a versions.rb file which is expected to have a version string.
|
|
20
22
|
*/
|
|
@@ -25,7 +27,7 @@ class VersionRB extends default_1.DefaultUpdater {
|
|
|
25
27
|
* @returns {string} The updated content
|
|
26
28
|
*/
|
|
27
29
|
updateContent(content) {
|
|
28
|
-
return content.replace(
|
|
30
|
+
return content.replace(RUBY_VERSION_RB_REGEX, `$1${(0, common_1.stringifyRubyVersion)(this.version)}$1`);
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
exports.VersionRB = VersionRB;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.1.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",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"gts": "^3.1.0",
|
|
64
64
|
"mocha": "^9.2.2",
|
|
65
65
|
"nock": "^13.0.0",
|
|
66
|
-
"sinon": "15.0.
|
|
66
|
+
"sinon": "15.0.1",
|
|
67
67
|
"snap-shot-it": "^7.0.0"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|