release-please 12.6.1 → 12.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +1 -1
  3. package/build/src/bootstrapper.d.ts +0 -12
  4. package/build/src/bootstrapper.js +0 -60
  5. package/build/src/changelog-notes/default.d.ts +0 -15
  6. package/build/src/changelog-notes/default.js +0 -71
  7. package/build/src/changelog-notes/github.d.ts +0 -8
  8. package/build/src/changelog-notes/github.js +0 -26
  9. package/build/src/changelog-notes.d.ts +0 -19
  10. package/build/src/changelog-notes.js +0 -16
  11. package/build/src/commit.d.ts +0 -26
  12. package/build/src/commit.js +0 -316
  13. package/build/src/plugin.d.ts +0 -20
  14. package/build/src/plugin.js +0 -31
  15. package/build/src/plugins/merge.d.ts +0 -11
  16. package/build/src/plugins/merge.js +0 -83
  17. package/build/src/plugins/workspace.d.ts +0 -102
  18. package/build/src/plugins/workspace.js +0 -170
  19. package/build/src/pull-request.d.ts +0 -10
  20. package/build/src/pull-request.js +0 -16
  21. package/build/src/release-notes.d.ts +0 -29
  22. package/build/src/release-notes.js +0 -71
  23. package/build/src/release-pull-request.d.ts +0 -13
  24. package/build/src/release-pull-request.js +0 -16
  25. package/build/src/release.d.ts +0 -6
  26. package/build/src/release.js +0 -16
  27. package/build/src/repository.d.ts +0 -5
  28. package/build/src/repository.js +0 -16
  29. package/build/src/strategies/dart.d.ts +0 -8
  30. package/build/src/strategies/dart.js +0 -63
  31. package/build/src/strategies/elixir.d.ts +0 -5
  32. package/build/src/strategies/elixir.js +0 -45
  33. package/build/src/strategies/go-yoshi.d.ts +0 -13
  34. package/build/src/strategies/go-yoshi.js +0 -114
  35. package/build/src/strategies/go.d.ts +0 -5
  36. package/build/src/strategies/go.js +0 -36
  37. package/build/src/strategies/helm.d.ts +0 -8
  38. package/build/src/strategies/helm.js +0 -63
  39. package/build/src/strategies/java-yoshi.d.ts +0 -25
  40. package/build/src/strategies/java-yoshi.js +0 -259
  41. package/build/src/strategies/krm-blueprint.d.ts +0 -7
  42. package/build/src/strategies/krm-blueprint.js +0 -64
  43. package/build/src/strategies/node.d.ts +0 -9
  44. package/build/src/strategies/node.js +0 -82
  45. package/build/src/strategies/ocaml.d.ts +0 -5
  46. package/build/src/strategies/ocaml.js +0 -75
  47. package/build/src/strategies/php-yoshi.d.ts +0 -10
  48. package/build/src/strategies/php-yoshi.js +0 -214
  49. package/build/src/strategies/php.d.ts +0 -6
  50. package/build/src/strategies/php.js +0 -67
  51. package/build/src/strategies/python.d.ts +0 -8
  52. package/build/src/strategies/python.js +0 -117
  53. package/build/src/strategies/ruby-yoshi.d.ts +0 -17
  54. package/build/src/strategies/ruby-yoshi.js +0 -116
  55. package/build/src/strategies/ruby.d.ts +0 -13
  56. package/build/src/strategies/ruby.js +0 -61
  57. package/build/src/strategies/rust.d.ts +0 -20
  58. package/build/src/strategies/rust.js +0 -120
  59. package/build/src/strategies/simple.d.ts +0 -5
  60. package/build/src/strategies/simple.js +0 -45
  61. package/build/src/strategies/terraform-module.d.ts +0 -7
  62. package/build/src/strategies/terraform-module.js +0 -72
  63. package/build/src/strategy.d.ts +0 -103
  64. package/build/src/strategy.js +0 -249
  65. package/build/src/update.d.ts +0 -23
  66. package/build/src/update.js +0 -16
  67. package/build/src/updaters/composite.d.ts +0 -19
  68. package/build/src/updaters/composite.js +0 -42
  69. package/build/src/updaters/dart/pubspec-yaml.d.ts +0 -12
  70. package/build/src/updaters/dart/pubspec-yaml.js +0 -45
  71. package/build/src/updaters/default.d.ts +0 -21
  72. package/build/src/updaters/default.js +0 -36
  73. package/build/src/updaters/dotnet/csproj.d.ts +0 -12
  74. package/build/src/updaters/dotnet/csproj.js +0 -33
  75. package/build/src/updaters/elixir/elixir-mix-exs.d.ts +0 -12
  76. package/build/src/updaters/elixir/elixir-mix-exs.js +0 -37
  77. package/build/src/updaters/go/version-go.d.ts +0 -4
  78. package/build/src/updaters/go/version-go.js +0 -24
  79. package/build/src/updaters/java/java-update.d.ts +0 -14
  80. package/build/src/updaters/java/java-update.js +0 -76
  81. package/build/src/updaters/node/package-json.d.ts +0 -12
  82. package/build/src/updaters/node/package-json.js +0 -37
  83. package/build/src/updaters/node/package-lock-json.d.ts +0 -8
  84. package/build/src/updaters/node/package-lock-json.js +0 -36
  85. package/build/src/updaters/node/samples-package-json.d.ts +0 -23
  86. package/build/src/updaters/node/samples-package-json.js +0 -49
  87. package/build/src/updaters/php/php-client-version.d.ts +0 -12
  88. package/build/src/updaters/php/php-client-version.js +0 -32
  89. package/build/src/updaters/php/php-manifest.d.ts +0 -13
  90. package/build/src/updaters/php/php-manifest.js +0 -55
  91. package/build/src/updaters/php/root-composer-update-packages.d.ts +0 -12
  92. package/build/src/updaters/php/root-composer-update-packages.js +0 -47
  93. package/build/src/updaters/raw-content.d.ts +0 -19
  94. package/build/src/updaters/raw-content.js +0 -39
  95. package/build/src/updaters/release-please-config.d.ts +0 -8
  96. package/build/src/updaters/release-please-config.js +0 -41
  97. package/build/src/updaters/ruby/version-rb.d.ts +0 -12
  98. package/build/src/updaters/ruby/version-rb.js +0 -32
  99. package/build/src/util/commit-split.d.ts +0 -11
  100. package/build/src/util/commit-split.js +0 -94
  101. package/build/src/util/pull-request-body.d.ts +0 -20
  102. package/build/src/util/pull-request-body.js +0 -129
  103. package/build/src/util/tag-name.d.ts +0 -9
  104. package/build/src/util/tag-name.js +0 -41
  105. package/build/src/util/toml-edit.d.ts +0 -8
  106. package/build/src/util/toml-edit.js +0 -125
  107. package/build/src/version.d.ts +0 -11
  108. package/build/src/version.js +0 -45
  109. package/build/src/versioning-strategies/always-bump-patch.d.ts +0 -7
  110. package/build/src/versioning-strategies/always-bump-patch.js +0 -25
  111. package/build/src/versioning-strategies/default.d.ts +0 -15
  112. package/build/src/versioning-strategies/default.js +0 -67
  113. package/build/src/versioning-strategies/dependency-manifest.d.ts +0 -7
  114. package/build/src/versioning-strategies/dependency-manifest.js +0 -90
  115. package/build/src/versioning-strategies/java-add-snapshot.d.ts +0 -9
  116. package/build/src/versioning-strategies/java-add-snapshot.js +0 -53
  117. package/build/src/versioning-strategies/java-snapshot.d.ts +0 -9
  118. package/build/src/versioning-strategies/java-snapshot.js +0 -67
  119. package/build/src/versioning-strategies/service-pack.d.ts +0 -7
  120. package/build/src/versioning-strategies/service-pack.js +0 -40
  121. package/build/src/versioning-strategy.d.ts +0 -28
  122. package/build/src/versioning-strategy.js +0 -55
@@ -1,94 +0,0 @@
1
- "use strict";
2
- // Copyright 2019 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.CommitSplit = void 0;
17
- const manifest_1 = require("../manifest");
18
- class CommitSplit {
19
- constructor(opts) {
20
- opts = opts || {};
21
- this.includeEmpty = !!opts.includeEmpty;
22
- if (opts.packagePaths) {
23
- const paths = [];
24
- for (let newPath of opts.packagePaths) {
25
- // The special "." path, representing the root of the module, should be
26
- // ignored by commit-split as it is assigned all commits in manifest.ts
27
- if (newPath === manifest_1.ROOT_PROJECT_PATH) {
28
- continue;
29
- }
30
- // normalize so that all paths have leading and trailing slashes for
31
- // non-overlap validation.
32
- // NOTE: GitHub API always returns paths using the `/` separator,
33
- // regardless of what platform the client code is running on
34
- newPath = newPath.replace(/\/$/, '');
35
- newPath = newPath.replace(/^\//, '');
36
- newPath = newPath.replace(/$/, '/');
37
- newPath = newPath.replace(/^/, '/');
38
- for (let exPath of paths) {
39
- exPath = exPath.replace(/$/, '/');
40
- exPath = exPath.replace(/^/, '/');
41
- if (newPath.indexOf(exPath) >= 0 || exPath.indexOf(newPath) >= 0) {
42
- throw new Error(`Path prefixes must be unique: ${newPath}, ${exPath}`);
43
- }
44
- }
45
- // store them with leading and trailing slashes removed.
46
- newPath = newPath.replace(/\/$/, '');
47
- newPath = newPath.replace(/^\//, '');
48
- paths.push(newPath);
49
- }
50
- this.packagePaths = paths;
51
- }
52
- }
53
- // split(commits: Commit[]): Record<string, Commit[]>
54
- split(commits) {
55
- const splitCommits = {};
56
- commits.forEach(commit => {
57
- const dedupe = new Set();
58
- for (let i = 0; i < commit.files.length; i++) {
59
- const file = commit.files[i];
60
- // NOTE: GitHub API always returns paths using the `/` separator,
61
- // regardless of what platform the client code is running on
62
- const splitPath = file.split('/');
63
- // indicates that we have a top-level file and not a folder
64
- // in this edge-case we should not attempt to update the path.
65
- if (splitPath.length === 1)
66
- continue;
67
- let pkgName;
68
- if (this.packagePaths) {
69
- // only track paths under this.packagePaths
70
- pkgName = this.packagePaths.find(p => file.indexOf(`${p}/`) === 0);
71
- }
72
- else {
73
- // track paths by top level folder
74
- pkgName = splitPath[0];
75
- }
76
- if (!pkgName || dedupe.has(pkgName))
77
- continue;
78
- else
79
- dedupe.add(pkgName);
80
- if (!splitCommits[pkgName])
81
- splitCommits[pkgName] = [];
82
- splitCommits[pkgName].push(commit);
83
- }
84
- if (commit.files.length === 0 && this.includeEmpty) {
85
- for (const pkgName in splitCommits) {
86
- splitCommits[pkgName].push(commit);
87
- }
88
- }
89
- });
90
- return splitCommits;
91
- }
92
- }
93
- exports.CommitSplit = CommitSplit;
94
- //# sourceMappingURL=commit-split.js.map
@@ -1,20 +0,0 @@
1
- import { Version } from '../version';
2
- interface PullRequestBodyOptions {
3
- header?: string;
4
- footer?: string;
5
- }
6
- export declare class PullRequestBody {
7
- header: string;
8
- footer: string;
9
- releaseData: ReleaseData[];
10
- constructor(releaseData: ReleaseData[], options?: PullRequestBodyOptions);
11
- static parse(body: string): PullRequestBody | undefined;
12
- notes(): string;
13
- toString(): string;
14
- }
15
- export interface ReleaseData {
16
- component?: string;
17
- version?: Version;
18
- notes: string;
19
- }
20
- export {};
@@ -1,129 +0,0 @@
1
- "use strict";
2
- // Copyright 2021 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.PullRequestBody = void 0;
17
- const logger_1 = require("./logger");
18
- const node_html_parser_1 = require("node-html-parser");
19
- const version_1 = require("../version");
20
- const DEFAULT_HEADER = ':robot: I have created a release *beep* *boop*';
21
- const DEFAULT_FOOTER = 'This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).';
22
- const NOTES_DELIMITER = '---';
23
- class PullRequestBody {
24
- constructor(releaseData, options) {
25
- this.header = (options === null || options === void 0 ? void 0 : options.header) || DEFAULT_HEADER;
26
- this.footer = (options === null || options === void 0 ? void 0 : options.footer) || DEFAULT_FOOTER;
27
- this.releaseData = releaseData;
28
- }
29
- static parse(body) {
30
- const parts = splitBody(body);
31
- if (!parts) {
32
- logger_1.logger.error('Pull request body did not match');
33
- return undefined;
34
- }
35
- let data = extractMultipleReleases(parts.content);
36
- if (data.length === 0) {
37
- data = extractSingleRelease(parts.content);
38
- if (data.length === 0) {
39
- logger_1.logger.warn('Failed to parse releases.');
40
- }
41
- }
42
- return new PullRequestBody(data, {
43
- header: parts.header,
44
- footer: parts.footer,
45
- });
46
- }
47
- notes() {
48
- if (this.releaseData.length > 1) {
49
- return this.releaseData
50
- .map(release => {
51
- var _a;
52
- return `<details><summary>${release.component}: ${(_a = release.version) === null || _a === void 0 ? void 0 : _a.toString()}</summary>\n\n${release.notes}\n</details>`;
53
- })
54
- .join('\n\n');
55
- }
56
- return this.releaseData.map(release => release.notes).join('\n\n');
57
- }
58
- toString() {
59
- const notes = this.notes();
60
- return `${this.header}
61
- ${NOTES_DELIMITER}
62
-
63
-
64
- ${notes}
65
-
66
- ${NOTES_DELIMITER}
67
- ${this.footer}`;
68
- }
69
- }
70
- exports.PullRequestBody = PullRequestBody;
71
- function splitBody(body) {
72
- const lines = body.trim().split('\n');
73
- const index = lines.indexOf(NOTES_DELIMITER);
74
- if (index === -1) {
75
- return undefined;
76
- }
77
- let lastIndex = lines.lastIndexOf(NOTES_DELIMITER);
78
- if (lastIndex === index) {
79
- lastIndex = lines.length - 1;
80
- }
81
- const header = lines.slice(0, index).join('\n').trim();
82
- const content = lines.slice(index + 1, lastIndex).join('\n');
83
- const footer = lines.slice(lastIndex + 1).join('\n');
84
- return {
85
- header,
86
- footer,
87
- content,
88
- };
89
- }
90
- const SUMMARY_PATTERN = /^(?<component>.*): (?<version>\d+\.\d+\.\d+.*)$/;
91
- function extractMultipleReleases(notes) {
92
- const data = [];
93
- const root = node_html_parser_1.parse(notes);
94
- for (const detail of root.getElementsByTagName('details')) {
95
- const summaryNode = detail.getElementsByTagName('summary')[0];
96
- const summary = summaryNode === null || summaryNode === void 0 ? void 0 : summaryNode.textContent;
97
- const match = summary.match(SUMMARY_PATTERN);
98
- if (!(match === null || match === void 0 ? void 0 : match.groups)) {
99
- logger_1.logger.warn(`Summary: ${summary} did not match the expected pattern`);
100
- continue;
101
- }
102
- detail.removeChild(summaryNode);
103
- const notes = detail.textContent.trim();
104
- data.push({
105
- component: match.groups.component,
106
- version: version_1.Version.parse(match.groups.version),
107
- notes,
108
- });
109
- }
110
- return data;
111
- }
112
- const COMPARE_REGEX = /^#{2,} \[(?<version>\d+\.\d+\.\d+.*)\]/;
113
- function extractSingleRelease(body) {
114
- var _a;
115
- body = body.trim();
116
- const match = body.match(COMPARE_REGEX);
117
- const versionString = (_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.version;
118
- if (!versionString) {
119
- logger_1.logger.warn('Failed to find version in release notes');
120
- return [];
121
- }
122
- return [
123
- {
124
- version: version_1.Version.parse(versionString),
125
- notes: body,
126
- },
127
- ];
128
- }
129
- //# sourceMappingURL=pull-request-body.js.map
@@ -1,9 +0,0 @@
1
- import { Version } from '../version';
2
- export declare class TagName {
3
- component?: string;
4
- version: Version;
5
- separator: string;
6
- constructor(version: Version, component?: string, separator?: string);
7
- static parse(tagName: string): TagName | undefined;
8
- toString(): string;
9
- }
@@ -1,41 +0,0 @@
1
- "use strict";
2
- // Copyright 2021 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.TagName = void 0;
17
- const version_1 = require("../version");
18
- const TAG_PATTERN = /^((?<component>.*)(?<separator>[^a-zA-Z]))?v(?<version>\d+\.\d+\.\d+.*)$/;
19
- const DEFAULT_SEPARATOR = '-';
20
- class TagName {
21
- constructor(version, component, separator = DEFAULT_SEPARATOR) {
22
- this.version = version;
23
- this.component = component;
24
- this.separator = separator;
25
- }
26
- static parse(tagName) {
27
- const match = tagName.match(TAG_PATTERN);
28
- if (match === null || match === void 0 ? void 0 : match.groups) {
29
- return new TagName(version_1.Version.parse(match.groups.version), match.groups.component, match.groups.separator);
30
- }
31
- return;
32
- }
33
- toString() {
34
- if (this.component) {
35
- return `${this.component}${this.separator}v${this.version.toString()}`;
36
- }
37
- return `v${this.version.toString()}`;
38
- }
39
- }
40
- exports.TagName = TagName;
41
- //# sourceMappingURL=tag-name.js.map
@@ -1,8 +0,0 @@
1
- /**
2
- * Given TOML input and a path to a value, attempt to replace
3
- * that value without modifying the formatting.
4
- * @param input A string that's valid TOML
5
- * @param path Path to a value to replace. When replacing 'deps.tokio.version', pass ['deps', 'tokio', 'version']. The value must already exist.
6
- * @param newValue The value to replace the value at `path` with. Is passed through `JSON.stringify()` when replacing: strings will end up being double-quoted strings, properly escaped. Numbers will be numbers.
7
- */
8
- export declare function replaceTomlValue(input: string, path: string[], newValue: string): string;
@@ -1,125 +0,0 @@
1
- "use strict";
2
- // Copyright 2021 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.replaceTomlValue = void 0;
17
- const TOMLParser = require("@iarna/toml/lib/toml-parser");
18
- const taggedValueMarker = Symbol('__TAGGED_VALUE');
19
- /**
20
- * A custom variant of `TOMLParser` that replaces all values with a tagged
21
- * variant that includes their start and end positions, allowing them to be
22
- * replaced.
23
- */
24
- class TaggedTOMLParser extends TOMLParser {
25
- parseValue() {
26
- // Remember the start position of the value.
27
- //
28
- // Off-by-one correctness: by this point, `this.pos` points one character
29
- // *after* the first character of the value, which is in `this.char`
30
- this.state.__TAGGED_START = this.pos - 1;
31
- return super.parseValue();
32
- }
33
- next(fn) {
34
- const prevState = this.state;
35
- super.next(fn); // `next` returns void
36
- // Carry over the start position. If it wasn't set, (say, if we were parsing
37
- // something other than a value), we're just assigning `undefined` here.
38
- this.state.__TAGGED_START = prevState.__TAGGED_START;
39
- }
40
- return(value) {
41
- const prevState = this.state;
42
- super.return(value); // `return` returns void
43
- if (prevState.__TAGGED_START && typeof this.state.returned !== 'object') {
44
- // If the parser we just returned from remembered a start position,
45
- // tag the returned value with "start" and "end".
46
- // Note that we don't tag objects to avoid encountering multiple tagged
47
- // values when replacing later on.
48
- const taggedValue = {
49
- [taggedValueMarker]: true,
50
- start: prevState.__TAGGED_START,
51
- end: this.pos,
52
- value: this.state.returned,
53
- };
54
- this.state.returned = taggedValue;
55
- }
56
- }
57
- }
58
- /**
59
- * Parses input as TOML with the given parser
60
- * @param input A string
61
- * @param parserType The TOML parser to use (might be custom)
62
- */
63
- function parseWith(input, parserType) {
64
- const parser = new parserType();
65
- parser.parse(input);
66
- return parser.finish();
67
- }
68
- function isTaggedValue(x) {
69
- if (!x) {
70
- return false;
71
- }
72
- if (typeof x !== 'object') {
73
- return false;
74
- }
75
- const ts = x;
76
- return ts[taggedValueMarker] === true;
77
- }
78
- /**
79
- * Given TOML input and a path to a value, attempt to replace
80
- * that value without modifying the formatting.
81
- * @param input A string that's valid TOML
82
- * @param path Path to a value to replace. When replacing 'deps.tokio.version', pass ['deps', 'tokio', 'version']. The value must already exist.
83
- * @param newValue The value to replace the value at `path` with. Is passed through `JSON.stringify()` when replacing: strings will end up being double-quoted strings, properly escaped. Numbers will be numbers.
84
- */
85
- function replaceTomlValue(input, path, newValue) {
86
- // our pointer into the object "tree", initially points to the root.
87
- let current = parseWith(input, TaggedTOMLParser);
88
- // navigate down the object tree, following the path, expecting only objects.
89
- // Note that tagged strings (generated by `TaggedTOMLParser`) are also objects.
90
- for (let i = 0; i < path.length; i++) {
91
- const key = path[i];
92
- // // We may encounter tagged values when descending through the object tree
93
- // if (isTaggedValue(current)) {
94
- // if (!current.value || typeof current.value !== 'object') {
95
- // const msg = `partial path does not lead to table: ${path
96
- // .slice(0, i)
97
- // .join('.')}`;
98
- // throw new Error(msg);
99
- // }
100
- // current = current.value as Record<string, unknown>;
101
- // }
102
- const next = current[key];
103
- if (typeof next !== 'object') {
104
- const msg = `path not found in object: ${path.slice(0, i + 1).join('.')}`;
105
- throw new Error(msg);
106
- }
107
- current = next;
108
- }
109
- if (!isTaggedValue(current)) {
110
- const msg = `value at path ${path.join('.')} is not tagged`;
111
- throw new Error(msg);
112
- }
113
- const before = input.slice(0, current.start);
114
- const after = input.slice(current.end);
115
- const output = before + JSON.stringify(newValue) + after;
116
- try {
117
- parseWith(output, TOMLParser);
118
- }
119
- catch (e) {
120
- throw new Error(`After replacing value, result is not valid TOML: ${e}`);
121
- }
122
- return output;
123
- }
124
- exports.replaceTomlValue = replaceTomlValue;
125
- //# sourceMappingURL=toml-edit.js.map
@@ -1,11 +0,0 @@
1
- export declare class Version {
2
- major: number;
3
- minor: number;
4
- patch: number;
5
- preRelease?: string;
6
- build?: string;
7
- constructor(major: number, minor: number, patch: number, preRelease?: string, build?: string);
8
- static parse(versionString: string): Version;
9
- toString(): string;
10
- }
11
- export declare type VersionsMap = Map<string, Version>;
@@ -1,45 +0,0 @@
1
- "use strict";
2
- // Copyright 2021 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.Version = void 0;
17
- const VERSION_REGEX = /(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(-(?<preRelease>[^+]+))?(\+(?<build>.*))?/;
18
- class Version {
19
- constructor(major, minor, patch, preRelease, build) {
20
- this.major = major;
21
- this.minor = minor;
22
- this.patch = patch;
23
- this.preRelease = preRelease;
24
- this.build = build;
25
- }
26
- static parse(versionString) {
27
- const match = versionString.match(VERSION_REGEX);
28
- if (!(match === null || match === void 0 ? void 0 : match.groups)) {
29
- throw Error(`unable to parse version string: ${versionString}`);
30
- }
31
- const major = Number(match.groups.major);
32
- const minor = Number(match.groups.minor);
33
- const patch = Number(match.groups.patch);
34
- const preRelease = match.groups.preRelease;
35
- const build = match.groups.build;
36
- return new Version(major, minor, patch, preRelease, build);
37
- }
38
- toString() {
39
- const preReleasePart = this.preRelease ? `-${this.preRelease}` : '';
40
- const buildPart = this.build ? `+${this.build}` : '';
41
- return `${this.major}.${this.minor}.${this.patch}${preReleasePart}${buildPart}`;
42
- }
43
- }
44
- exports.Version = Version;
45
- //# sourceMappingURL=version.js.map
@@ -1,7 +0,0 @@
1
- import { Version } from '../version';
2
- import { ConventionalCommit } from '../commit';
3
- import { DefaultVersioningStrategy } from './default';
4
- import { VersionUpdater } from '../versioning-strategy';
5
- export declare class AlwaysBumpPatch extends DefaultVersioningStrategy {
6
- determineReleaseType(_version: Version, _commits: ConventionalCommit[]): VersionUpdater;
7
- }
@@ -1,25 +0,0 @@
1
- "use strict";
2
- // Copyright 2021 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.AlwaysBumpPatch = void 0;
17
- const default_1 = require("./default");
18
- const versioning_strategy_1 = require("../versioning-strategy");
19
- class AlwaysBumpPatch extends default_1.DefaultVersioningStrategy {
20
- determineReleaseType(_version, _commits) {
21
- return new versioning_strategy_1.PatchVersionUpdate();
22
- }
23
- }
24
- exports.AlwaysBumpPatch = AlwaysBumpPatch;
25
- //# sourceMappingURL=always-bump-patch.js.map
@@ -1,15 +0,0 @@
1
- import { VersioningStrategy, VersionUpdater } from '../versioning-strategy';
2
- import { ConventionalCommit } from '../commit';
3
- import { Version } from '../version';
4
- interface DefaultVersioningStrategyOptions {
5
- bumpMinorPreMajor?: boolean;
6
- bumpPatchForMinorPreMajor?: boolean;
7
- }
8
- export declare class DefaultVersioningStrategy implements VersioningStrategy {
9
- readonly bumpMinorPreMajor: boolean;
10
- readonly bumpPatchForMinorPreMajor: boolean;
11
- constructor(options?: DefaultVersioningStrategyOptions);
12
- determineReleaseType(version: Version, commits: ConventionalCommit[]): VersionUpdater;
13
- bump(version: Version, commits: ConventionalCommit[]): Version;
14
- }
15
- export {};
@@ -1,67 +0,0 @@
1
- "use strict";
2
- // Copyright 2021 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.DefaultVersioningStrategy = void 0;
17
- const versioning_strategy_1 = require("../versioning-strategy");
18
- const version_1 = require("../version");
19
- class DefaultVersioningStrategy {
20
- constructor(options = {}) {
21
- this.bumpMinorPreMajor = options.bumpMinorPreMajor === true;
22
- this.bumpPatchForMinorPreMajor = options.bumpPatchForMinorPreMajor === true;
23
- }
24
- determineReleaseType(version, commits) {
25
- // iterate through list of commits and find biggest commit type
26
- let breaking = 0;
27
- let features = 0;
28
- let customVersion;
29
- for (const commit of commits) {
30
- const releaseAs = commit.notes.find(note => note.title === 'RELEASE AS');
31
- if (releaseAs) {
32
- customVersion = version_1.Version.parse(releaseAs.text);
33
- }
34
- if (commit.breaking) {
35
- breaking++;
36
- }
37
- else if (commit.type === 'feat' || commit.type === 'feature') {
38
- features++;
39
- }
40
- }
41
- if (customVersion) {
42
- return new versioning_strategy_1.CustomVersionUpdate(customVersion.toString());
43
- }
44
- if (breaking > 0) {
45
- if (version.major < 1 && this.bumpMinorPreMajor) {
46
- return new versioning_strategy_1.MinorVersionUpdate();
47
- }
48
- else {
49
- return new versioning_strategy_1.MajorVersionUpdate();
50
- }
51
- }
52
- else if (features > 0) {
53
- if (version.major < 1 && this.bumpPatchForMinorPreMajor) {
54
- return new versioning_strategy_1.PatchVersionUpdate();
55
- }
56
- else {
57
- return new versioning_strategy_1.MinorVersionUpdate();
58
- }
59
- }
60
- return new versioning_strategy_1.PatchVersionUpdate();
61
- }
62
- bump(version, commits) {
63
- return this.determineReleaseType(version, commits).bump(version);
64
- }
65
- }
66
- exports.DefaultVersioningStrategy = DefaultVersioningStrategy;
67
- //# sourceMappingURL=default.js.map
@@ -1,7 +0,0 @@
1
- import { Version } from '../version';
2
- import { ConventionalCommit } from '../commit';
3
- import { DefaultVersioningStrategy } from './default';
4
- import { VersionUpdater } from '../versioning-strategy';
5
- export declare class DependencyManifest extends DefaultVersioningStrategy {
6
- determineReleaseType(version: Version, commits: ConventionalCommit[]): VersionUpdater;
7
- }