release-please 17.4.0 → 17.5.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/build/src/bin/release-please.js +39 -10
- package/build/src/bootstrapper.d.ts +2 -2
- package/build/src/changelog-notes/default.js +9 -1
- package/build/src/changelog-notes/github.d.ts +2 -2
- package/build/src/changelog-notes.d.ts +1 -0
- package/build/src/commit.d.ts +6 -0
- package/build/src/factories/changelog-notes-factory.d.ts +2 -2
- package/build/src/factories/plugin-factory.d.ts +2 -2
- package/build/src/factories/versioning-strategy-factory.d.ts +2 -2
- package/build/src/factory.d.ts +2 -2
- package/build/src/github-api.d.ts +260 -0
- package/build/src/github-api.js +701 -0
- package/build/src/github.d.ts +21 -171
- package/build/src/github.js +154 -687
- package/build/src/index.d.ts +2 -2
- package/build/src/index.js +1 -1
- package/build/src/local-github.d.ts +271 -0
- package/build/src/local-github.js +776 -0
- package/build/src/manifest.d.ts +7 -5
- package/build/src/manifest.js +28 -26
- package/build/src/plugin.d.ts +3 -3
- package/build/src/plugins/group-priority.d.ts +2 -2
- package/build/src/plugins/linked-versions.d.ts +2 -2
- package/build/src/plugins/maven-workspace.d.ts +2 -2
- package/build/src/plugins/merge.d.ts +2 -2
- package/build/src/plugins/node-workspace.d.ts +2 -2
- package/build/src/plugins/sentence-case.d.ts +2 -2
- package/build/src/plugins/workspace.d.ts +2 -2
- package/build/src/scm.d.ts +80 -0
- package/build/src/scm.js +16 -0
- package/build/src/strategies/base.d.ts +5 -3
- package/build/src/strategies/base.js +2 -0
- package/build/src/util/pull-request-overflow-handler.d.ts +2 -2
- package/package.json +3 -3
package/build/src/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * as Errors from './errors';
|
|
|
2
2
|
export { Manifest, ReleaserConfig, ManifestOptions, PluginType, CandidateRelease, CreatedRelease, } from './manifest';
|
|
3
3
|
export { ReleasePullRequest } from './release-pull-request';
|
|
4
4
|
export { PullRequest } from './pull-request';
|
|
5
|
-
export { Commit, ConventionalCommit } from './commit';
|
|
5
|
+
export { Commit, CommitAuthor, ConventionalCommit } from './commit';
|
|
6
6
|
export { Strategy } from './strategy';
|
|
7
7
|
export { BaseStrategyOptions, BuildUpdatesOptions } from './strategies/base';
|
|
8
8
|
export { ReleaseBuilder, ReleaseType, getReleaserTypes, registerReleaseType, } from './factory';
|
|
@@ -14,4 +14,4 @@ export { Logger, setLogger } from './util/logger';
|
|
|
14
14
|
export { GitHub } from './github';
|
|
15
15
|
export declare const configSchema: any;
|
|
16
16
|
export declare const manifestSchema: any;
|
|
17
|
-
export declare const VERSION = "17.
|
|
17
|
+
export declare const VERSION = "17.5.0";
|
package/build/src/index.js
CHANGED
|
@@ -36,6 +36,6 @@ Object.defineProperty(exports, "GitHub", { enumerable: true, get: function () {
|
|
|
36
36
|
exports.configSchema = require('../../schemas/config.json');
|
|
37
37
|
exports.manifestSchema = require('../../schemas/manifest.json');
|
|
38
38
|
// x-release-please-start-version
|
|
39
|
-
exports.VERSION = '17.
|
|
39
|
+
exports.VERSION = '17.5.0';
|
|
40
40
|
// x-release-please-end
|
|
41
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { Scm, ScmRelease, ScmTag, ScmCommitIteratorOptions, ScmReleaseIteratorOptions, ScmTagIteratorOptions, ScmCreatePullRequestOptions, ScmUpdatePullRequestOptions, ScmReleaseOptions, ScmChangeSet } from './scm';
|
|
2
|
+
import { Repository } from './repository';
|
|
3
|
+
import { Commit } from './commit';
|
|
4
|
+
import { PullRequest } from './pull-request';
|
|
5
|
+
import { ReleasePullRequest } from './release-pull-request';
|
|
6
|
+
import { Update } from './update';
|
|
7
|
+
import { Release } from './release';
|
|
8
|
+
import { GitHubFileContents } from '@google-automations/git-file-utils';
|
|
9
|
+
import { GitHubApi, GitHubCreateOptions } from './github-api';
|
|
10
|
+
import { Logger } from 'code-suggester/build/src/types';
|
|
11
|
+
export interface LocalGitHubCreateOptions extends GitHubCreateOptions {
|
|
12
|
+
cloneDepth?: number;
|
|
13
|
+
localRepoPath?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* LocalGitHub implements the Scm interface using a local git clone
|
|
17
|
+
* where possible, and falling back to the GitHub API for other operations.
|
|
18
|
+
*/
|
|
19
|
+
export declare class LocalGitHub implements Scm {
|
|
20
|
+
readonly repository: Repository;
|
|
21
|
+
private cloneDir;
|
|
22
|
+
private gitHubApi;
|
|
23
|
+
private logger;
|
|
24
|
+
constructor(repository: Repository, gitHubApi: GitHubApi, cloneDir: string, options?: {
|
|
25
|
+
logger?: Logger;
|
|
26
|
+
});
|
|
27
|
+
static create(options: LocalGitHubCreateOptions): Promise<LocalGitHub>;
|
|
28
|
+
/**
|
|
29
|
+
* Fetch the contents of a file from the configured branch
|
|
30
|
+
*
|
|
31
|
+
* @param {string} path The path to the file in the repository
|
|
32
|
+
* @returns {GitHubFileContents}
|
|
33
|
+
* @throws {GitHubAPIError} on other API errors
|
|
34
|
+
*/
|
|
35
|
+
getFileContents(path: string): Promise<GitHubFileContents>;
|
|
36
|
+
private execGitStream;
|
|
37
|
+
private ensureRef;
|
|
38
|
+
/**
|
|
39
|
+
* Fetch the contents of a file
|
|
40
|
+
*
|
|
41
|
+
* @param {string} path The path to the file in the repository
|
|
42
|
+
* @param {string} branch The branch to fetch from
|
|
43
|
+
* @returns {GitHubFileContents}
|
|
44
|
+
* @throws {FileNotFoundError} if the file cannot be found
|
|
45
|
+
* @throws {GitHubAPIError} on other API errors
|
|
46
|
+
*/
|
|
47
|
+
getFileContentsOnBranch(path: string, branch: string): Promise<GitHubFileContents>;
|
|
48
|
+
getFileJson<T>(path: string, branch: string): Promise<T>;
|
|
49
|
+
/**
|
|
50
|
+
* Returns a list of paths to all files with a given name.
|
|
51
|
+
*
|
|
52
|
+
* If a prefix is specified, only return paths that match
|
|
53
|
+
* the provided prefix.
|
|
54
|
+
*
|
|
55
|
+
* @param filename The name of the file to find
|
|
56
|
+
* @param prefix Optional path prefix used to filter results
|
|
57
|
+
* @returns {string[]} List of file paths
|
|
58
|
+
* @throws {GitHubAPIError} on an API error
|
|
59
|
+
*/
|
|
60
|
+
findFilesByFilename(filename: string, prefix?: string): Promise<string[]>;
|
|
61
|
+
/**
|
|
62
|
+
* Returns a list of paths to all files with a given name.
|
|
63
|
+
*
|
|
64
|
+
* If a prefix is specified, only return paths that match
|
|
65
|
+
* the provided prefix.
|
|
66
|
+
*
|
|
67
|
+
* @param filename The name of the file to find
|
|
68
|
+
* @param ref Git reference to search files in
|
|
69
|
+
* @param prefix Optional path prefix used to filter results
|
|
70
|
+
* @throws {GitHubAPIError} on an API error
|
|
71
|
+
*/
|
|
72
|
+
findFilesByFilenameAndRef(filename: string, ref: string, prefix?: string): Promise<string[]>;
|
|
73
|
+
/**
|
|
74
|
+
* Returns a list of paths to all files matching a glob pattern.
|
|
75
|
+
*
|
|
76
|
+
* If a prefix is specified, only return paths that match
|
|
77
|
+
* the provided prefix.
|
|
78
|
+
*
|
|
79
|
+
* @param glob The glob to match
|
|
80
|
+
* @param prefix Optional path prefix used to filter results
|
|
81
|
+
* @returns {string[]} List of file paths
|
|
82
|
+
* @throws {GitHubAPIError} on an API error
|
|
83
|
+
*/
|
|
84
|
+
findFilesByGlob(glob: string, prefix?: string): Promise<string[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Returns a list of paths to all files matching a glob pattern.
|
|
87
|
+
*
|
|
88
|
+
* If a prefix is specified, only return paths that match
|
|
89
|
+
* the provided prefix.
|
|
90
|
+
*
|
|
91
|
+
* @param glob The glob to match
|
|
92
|
+
* @param ref Git reference to search files in
|
|
93
|
+
* @param prefix Optional path prefix used to filter results
|
|
94
|
+
* @throws {GitHubAPIError} on an API error
|
|
95
|
+
*/
|
|
96
|
+
findFilesByGlobAndRef(glob: string, ref: string, prefix?: string): Promise<string[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Returns a list of paths to all files with a given file
|
|
99
|
+
* extension.
|
|
100
|
+
*
|
|
101
|
+
* If a prefix is specified, only return paths that match
|
|
102
|
+
* the provided prefix.
|
|
103
|
+
*
|
|
104
|
+
* @param extension The file extension used to filter results.
|
|
105
|
+
* Example: `js`, `java`
|
|
106
|
+
* @param prefix Optional path prefix used to filter results
|
|
107
|
+
* @returns {string[]} List of file paths
|
|
108
|
+
* @throws {GitHubAPIError} on an API error
|
|
109
|
+
*/
|
|
110
|
+
findFilesByExtension(extension: string, prefix?: string): Promise<string[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Returns a list of paths to all files with a given file
|
|
113
|
+
* extension.
|
|
114
|
+
*
|
|
115
|
+
* If a prefix is specified, only return paths that match
|
|
116
|
+
* the provided prefix.
|
|
117
|
+
*
|
|
118
|
+
* @param extension The file extension used to filter results.
|
|
119
|
+
* Example: `js`, `java`
|
|
120
|
+
* @param ref Git reference to search files in
|
|
121
|
+
* @param prefix Optional path prefix used to filter results
|
|
122
|
+
* @returns {string[]} List of file paths
|
|
123
|
+
* @throws {GitHubAPIError} on an API error
|
|
124
|
+
*/
|
|
125
|
+
findFilesByExtensionAndRef(extension: string, ref: string, prefix?: string): Promise<string[]>;
|
|
126
|
+
/**
|
|
127
|
+
* Returns the list of commits to the default branch after the provided filter
|
|
128
|
+
* query has been satified.
|
|
129
|
+
*
|
|
130
|
+
* @param {string} targetBranch Target branch of commit
|
|
131
|
+
* @param {CommitFilter} filter Callback function that returns whether a
|
|
132
|
+
* commit/pull request matches certain criteria
|
|
133
|
+
* @param {CommitIteratorOptions} options Query options
|
|
134
|
+
* @param {number} options.maxResults Limit the number of results searched.
|
|
135
|
+
* Defaults to unlimited.
|
|
136
|
+
* @param {boolean} options.backfillFiles If set, use the REST API for
|
|
137
|
+
* fetching the list of touched files in this commit. Defaults to `false`.
|
|
138
|
+
* @returns {Commit[]} List of commits to current branch
|
|
139
|
+
* @throws {GitHubAPIError} on an API error
|
|
140
|
+
*/
|
|
141
|
+
commitsSince(targetBranch: string, filter: (commit: Commit) => boolean, options?: ScmCommitIteratorOptions): Promise<Commit[]>;
|
|
142
|
+
/**
|
|
143
|
+
* Iterate through commit history with a max number of results scanned.
|
|
144
|
+
*
|
|
145
|
+
* @param {string} targetBranch target branch of commit
|
|
146
|
+
* @param {CommitIteratorOptions} options Query options
|
|
147
|
+
* @param {number} options.maxResults Limit the number of results searched.
|
|
148
|
+
* Defaults to unlimited.
|
|
149
|
+
* @param {boolean} options.backfillFiles If set, use the REST API for
|
|
150
|
+
* fetching the list of touched files in this commit. Defaults to `false`.
|
|
151
|
+
* @yields {Commit}
|
|
152
|
+
* @throws {GitHubAPIError} on an API error
|
|
153
|
+
*/
|
|
154
|
+
mergeCommitIterator(targetBranch: string, options?: ScmCommitIteratorOptions): AsyncGenerator<Commit, void, void>;
|
|
155
|
+
/**
|
|
156
|
+
* Iterate through merged pull requests with a max number of results scanned.
|
|
157
|
+
*
|
|
158
|
+
* @param {string} targetBranch The base branch of the pull request
|
|
159
|
+
* @param {string} status The status of the pull request
|
|
160
|
+
* @param {number} maxResults Limit the number of results searched. Defaults to
|
|
161
|
+
* unlimited.
|
|
162
|
+
* @param {boolean} includeFiles Whether to fetch the list of files included in
|
|
163
|
+
* the pull request. Defaults to `true`.
|
|
164
|
+
* @yields {PullRequest}
|
|
165
|
+
* @throws {GitHubAPIError} on an API error
|
|
166
|
+
*/
|
|
167
|
+
pullRequestIterator(targetBranch: string, status?: 'OPEN' | 'CLOSED' | 'MERGED', maxResults?: number, includeFiles?: boolean): AsyncGenerator<PullRequest, void, void>;
|
|
168
|
+
/**
|
|
169
|
+
* Iterate through releases with a max number of results scanned.
|
|
170
|
+
*
|
|
171
|
+
* @param {ReleaseIteratorOptions} options Query options
|
|
172
|
+
* @param {number} options.maxResults Limit the number of results searched.
|
|
173
|
+
* Defaults to unlimited.
|
|
174
|
+
* @yields {GitHubRelease}
|
|
175
|
+
* @throws {GitHubAPIError} on an API error
|
|
176
|
+
*/
|
|
177
|
+
releaseIterator(options?: ScmReleaseIteratorOptions): AsyncGenerator<ScmRelease, void, void>;
|
|
178
|
+
/**
|
|
179
|
+
* Iterate through tags with a max number of results scanned.
|
|
180
|
+
*
|
|
181
|
+
* @param {TagIteratorOptions} options Query options
|
|
182
|
+
* @param {number} options.maxResults Limit the number of results searched.
|
|
183
|
+
* Defaults to unlimited.
|
|
184
|
+
* @yields {GitHubTag}
|
|
185
|
+
* @throws {GitHubAPIError} on an API error
|
|
186
|
+
*/
|
|
187
|
+
tagIterator(options?: ScmTagIteratorOptions): AsyncGenerator<ScmTag, void, void>;
|
|
188
|
+
private applyEditsAndPush;
|
|
189
|
+
/**
|
|
190
|
+
* Open a pull request
|
|
191
|
+
*
|
|
192
|
+
* @param {PullRequest} pullRequest Pull request data to update
|
|
193
|
+
* @param {string} targetBranch The base branch of the pull request
|
|
194
|
+
* @param {string} message The commit message for the commit
|
|
195
|
+
* @param {Update[]} updates The files to update
|
|
196
|
+
* @param {CreatePullRequestOptions} options The pull request options
|
|
197
|
+
* @throws {GitHubAPIError} on an API error
|
|
198
|
+
*/
|
|
199
|
+
createPullRequest(pullRequest: PullRequest, targetBranch: string, message: string, updates: Update[], options?: ScmCreatePullRequestOptions): Promise<PullRequest>;
|
|
200
|
+
/**
|
|
201
|
+
* Update a pull request's title and body.
|
|
202
|
+
* @param {number} number The pull request number
|
|
203
|
+
* @param {ReleasePullRequest} releasePullRequest Pull request data to update
|
|
204
|
+
* @param {string} targetBranch The target branch of the pull request
|
|
205
|
+
* @param {string} options.signoffUser Optional. Commit signoff message
|
|
206
|
+
* @param {boolean} options.fork Optional. Whether to open the pull request from
|
|
207
|
+
* a fork or not. Defaults to `false`
|
|
208
|
+
* @param {PullRequestOverflowHandler} options.pullRequestOverflowHandler Optional.
|
|
209
|
+
* Handles extra large pull request body messages.
|
|
210
|
+
*/
|
|
211
|
+
updatePullRequest(number: number, pullRequest: ReleasePullRequest, targetBranch: string, options?: ScmUpdatePullRequestOptions): Promise<PullRequest>;
|
|
212
|
+
getPullRequest(number: number): Promise<PullRequest>;
|
|
213
|
+
/**
|
|
214
|
+
* Create a GitHub release
|
|
215
|
+
*
|
|
216
|
+
* @param {Release} release Release parameters
|
|
217
|
+
* @param {ReleaseOptions} options Release option parameters
|
|
218
|
+
* @throws {DuplicateReleaseError} if the release tag already exists
|
|
219
|
+
* @throws {GitHubAPIError} on other API errors
|
|
220
|
+
*/
|
|
221
|
+
createRelease(release: Release, options?: ScmReleaseOptions): Promise<ScmRelease>;
|
|
222
|
+
/**
|
|
223
|
+
* Makes a comment on a issue/pull request.
|
|
224
|
+
*
|
|
225
|
+
* @param {string} comment - The body of the comment to post.
|
|
226
|
+
* @param {number} number - The issue or pull request number.
|
|
227
|
+
* @throws {GitHubAPIError} on an API error
|
|
228
|
+
*/
|
|
229
|
+
commentOnIssue(comment: string, number: number): Promise<string>;
|
|
230
|
+
/**
|
|
231
|
+
* Removes labels from an issue/pull request.
|
|
232
|
+
*
|
|
233
|
+
* @param {string[]} labels The labels to remove.
|
|
234
|
+
* @param {number} number The issue/pull request number.
|
|
235
|
+
*/
|
|
236
|
+
removeIssueLabels(labels: string[], number: number): Promise<void>;
|
|
237
|
+
/**
|
|
238
|
+
* Adds label to an issue/pull request.
|
|
239
|
+
*
|
|
240
|
+
* @param {string[]} labels The labels to add.
|
|
241
|
+
* @param {number} number The issue/pull request number.
|
|
242
|
+
*/
|
|
243
|
+
addIssueLabels(labels: string[], number: number): Promise<void>;
|
|
244
|
+
/**
|
|
245
|
+
* Generate release notes from GitHub at tag
|
|
246
|
+
* @param {string} tagName Name of new release tag
|
|
247
|
+
* @param {string} targetCommitish Target commitish for new tag
|
|
248
|
+
* @param {string} previousTag Optional. Name of previous tag to analyze commits since
|
|
249
|
+
*/
|
|
250
|
+
generateReleaseNotes(tagName: string, targetCommitish: string, previousTag?: string): Promise<string>;
|
|
251
|
+
/**
|
|
252
|
+
* Create a single file on a new branch based on an existing
|
|
253
|
+
* branch. This will force-push to that branch.
|
|
254
|
+
* @param {string} filename Filename with path in the repository
|
|
255
|
+
* @param {string} contents Contents of the file
|
|
256
|
+
* @param {string} newBranchName Name of the new branch
|
|
257
|
+
* @param {string} baseBranchName Name of the base branch (where
|
|
258
|
+
* new branch is forked from)
|
|
259
|
+
* @returns {string} HTML URL of the new file
|
|
260
|
+
*/
|
|
261
|
+
createFileOnNewBranch(filename: string, contents: string, newBranchName: string, baseBranchName: string): Promise<string>;
|
|
262
|
+
/**
|
|
263
|
+
* Given a set of proposed updates, build a changeset to suggest.
|
|
264
|
+
*
|
|
265
|
+
* @param {Update[]} updates The proposed updates
|
|
266
|
+
* @param {string} defaultBranch The target branch
|
|
267
|
+
* @return {Changes} The changeset to suggest.
|
|
268
|
+
* @throws {GitHubAPIError} on an API error
|
|
269
|
+
*/
|
|
270
|
+
buildChangeSet(updates: Update[], defaultBranch: string): Promise<ScmChangeSet>;
|
|
271
|
+
}
|