@release-please-oss/release-please 0.0.0-stage → 17.11.3
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/LICENSE +202 -0
- package/README.md +279 -2
- package/build/src/bin/release-please.d.ts +22 -0
- package/build/src/bin/release-please.js +727 -0
- package/build/src/bootstrapper.d.ts +18 -0
- package/build/src/bootstrapper.js +64 -0
- package/build/src/changelog-notes/default.d.ts +15 -0
- package/build/src/changelog-notes/default.js +96 -0
- package/build/src/changelog-notes/github.d.ts +8 -0
- package/build/src/changelog-notes/github.js +29 -0
- package/build/src/changelog-notes.d.ts +22 -0
- package/build/src/changelog-notes.js +40 -0
- package/build/src/commit.d.ts +33 -0
- package/build/src/commit.js +422 -0
- package/build/src/errors/index.d.ts +36 -0
- package/build/src/errors/index.js +77 -0
- package/build/src/factories/changelog-notes-factory.d.ts +16 -0
- package/build/src/factories/changelog-notes-factory.js +44 -0
- package/build/src/factories/plugin-factory.d.ts +23 -0
- package/build/src/factories/plugin-factory.js +94 -0
- package/build/src/factories/versioning-strategy-factory.d.ts +16 -0
- package/build/src/factories/versioning-strategy-factory.js +52 -0
- package/build/src/factory.d.ts +18 -0
- package/build/src/factory.js +161 -0
- package/build/src/github-api.d.ts +260 -0
- package/build/src/github-api.js +714 -0
- package/build/src/github.d.ts +306 -0
- package/build/src/github.js +769 -0
- package/build/src/index.d.ts +17 -0
- package/build/src/index.js +41 -0
- package/build/src/local-github.d.ts +270 -0
- package/build/src/local-github.js +756 -0
- package/build/src/manifest.d.ts +370 -0
- package/build/src/manifest.js +1142 -0
- package/build/src/plugin.d.ts +37 -0
- package/build/src/plugin.js +57 -0
- package/build/src/plugins/cargo-workspace.d.ts +58 -0
- package/build/src/plugins/cargo-workspace.js +339 -0
- package/build/src/plugins/group-priority.d.ts +29 -0
- package/build/src/plugins/group-priority.js +82 -0
- package/build/src/plugins/linked-versions.d.ts +36 -0
- package/build/src/plugins/linked-versions.js +137 -0
- package/build/src/plugins/maven-workspace.d.ts +81 -0
- package/build/src/plugins/maven-workspace.js +431 -0
- package/build/src/plugins/merge.d.ts +27 -0
- package/build/src/plugins/merge.js +99 -0
- package/build/src/plugins/node-workspace.d.ts +50 -0
- package/build/src/plugins/node-workspace.js +352 -0
- package/build/src/plugins/sentence-case.d.ts +19 -0
- package/build/src/plugins/sentence-case.js +80 -0
- package/build/src/plugins/workspace.d.ts +173 -0
- package/build/src/plugins/workspace.js +308 -0
- package/build/src/pull-request.d.ts +11 -0
- package/build/src/pull-request.js +16 -0
- package/build/src/release-pull-request.d.ts +14 -0
- package/build/src/release-pull-request.js +16 -0
- package/build/src/release.d.ts +7 -0
- package/build/src/release.js +16 -0
- package/build/src/repository.d.ts +5 -0
- package/build/src/repository.js +16 -0
- package/build/src/scm.d.ts +80 -0
- package/build/src/scm.js +16 -0
- package/build/src/strategies/base.d.ts +162 -0
- package/build/src/strategies/base.js +494 -0
- package/build/src/strategies/bazel.d.ts +7 -0
- package/build/src/strategies/bazel.js +49 -0
- package/build/src/strategies/dart.d.ts +8 -0
- package/build/src/strategies/dart.js +73 -0
- package/build/src/strategies/dotnet-yoshi.d.ts +13 -0
- package/build/src/strategies/dotnet-yoshi.js +109 -0
- package/build/src/strategies/elixir.d.ts +5 -0
- package/build/src/strategies/elixir.js +46 -0
- package/build/src/strategies/expo.d.ts +15 -0
- package/build/src/strategies/expo.js +51 -0
- package/build/src/strategies/go-librarian.d.ts +11 -0
- package/build/src/strategies/go-librarian.js +84 -0
- package/build/src/strategies/go-yoshi.d.ts +14 -0
- package/build/src/strategies/go-yoshi.js +168 -0
- package/build/src/strategies/go.d.ts +7 -0
- package/build/src/strategies/go.js +53 -0
- package/build/src/strategies/helm.d.ts +8 -0
- package/build/src/strategies/helm.js +73 -0
- package/build/src/strategies/java-yoshi-mono-repo.d.ts +22 -0
- package/build/src/strategies/java-yoshi-mono-repo.js +308 -0
- package/build/src/strategies/java-yoshi.d.ts +20 -0
- package/build/src/strategies/java-yoshi.js +210 -0
- package/build/src/strategies/java.d.ts +28 -0
- package/build/src/strategies/java.js +176 -0
- package/build/src/strategies/krm-blueprint.d.ts +7 -0
- package/build/src/strategies/krm-blueprint.js +65 -0
- package/build/src/strategies/maven.d.ts +9 -0
- package/build/src/strategies/maven.js +56 -0
- package/build/src/strategies/node-librarian.d.ts +10 -0
- package/build/src/strategies/node-librarian.js +121 -0
- package/build/src/strategies/node.d.ts +10 -0
- package/build/src/strategies/node.js +111 -0
- package/build/src/strategies/ocaml.d.ts +5 -0
- package/build/src/strategies/ocaml.js +86 -0
- package/build/src/strategies/php-librarian.d.ts +6 -0
- package/build/src/strategies/php-librarian.js +35 -0
- package/build/src/strategies/php-yoshi.d.ts +13 -0
- package/build/src/strategies/php-yoshi.js +255 -0
- package/build/src/strategies/php.d.ts +6 -0
- package/build/src/strategies/php.js +76 -0
- package/build/src/strategies/python-librarian.d.ts +6 -0
- package/build/src/strategies/python-librarian.js +35 -0
- package/build/src/strategies/python.d.ts +11 -0
- package/build/src/strategies/python.js +175 -0
- package/build/src/strategies/r.d.ts +8 -0
- package/build/src/strategies/r.js +67 -0
- package/build/src/strategies/ruby-librarian.d.ts +6 -0
- package/build/src/strategies/ruby-librarian.js +35 -0
- package/build/src/strategies/ruby-yoshi.d.ts +13 -0
- package/build/src/strategies/ruby-yoshi.js +97 -0
- package/build/src/strategies/ruby.d.ts +9 -0
- package/build/src/strategies/ruby.js +71 -0
- package/build/src/strategies/rust.d.ts +17 -0
- package/build/src/strategies/rust.js +149 -0
- package/build/src/strategies/sfdx.d.ts +9 -0
- package/build/src/strategies/sfdx.js +67 -0
- package/build/src/strategies/simple.d.ts +7 -0
- package/build/src/strategies/simple.js +51 -0
- package/build/src/strategies/terraform-module.d.ts +7 -0
- package/build/src/strategies/terraform-module.js +90 -0
- package/build/src/strategy.d.ts +68 -0
- package/build/src/strategy.js +16 -0
- package/build/src/update.d.ts +24 -0
- package/build/src/update.js +16 -0
- package/build/src/updaters/base-xml.d.ts +19 -0
- package/build/src/updaters/base-xml.js +43 -0
- package/build/src/updaters/bazel/module-bazel.d.ts +7 -0
- package/build/src/updaters/bazel/module-bazel.js +33 -0
- package/build/src/updaters/changelog-json.d.ts +29 -0
- package/build/src/updaters/changelog-json.js +100 -0
- package/build/src/updaters/changelog.d.ts +13 -0
- package/build/src/updaters/changelog.js +55 -0
- package/build/src/updaters/composite.d.ts +20 -0
- package/build/src/updaters/composite.js +65 -0
- package/build/src/updaters/dart/pubspec-yaml.d.ts +13 -0
- package/build/src/updaters/dart/pubspec-yaml.js +50 -0
- package/build/src/updaters/default.d.ts +21 -0
- package/build/src/updaters/default.js +36 -0
- package/build/src/updaters/dotnet/apis.d.ts +18 -0
- package/build/src/updaters/dotnet/apis.js +45 -0
- package/build/src/updaters/dotnet/csproj.d.ts +12 -0
- package/build/src/updaters/dotnet/csproj.js +33 -0
- package/build/src/updaters/elixir/elixir-mix-exs.d.ts +13 -0
- package/build/src/updaters/elixir/elixir-mix-exs.js +42 -0
- package/build/src/updaters/expo/app-json.d.ts +31 -0
- package/build/src/updaters/expo/app-json.js +67 -0
- package/build/src/updaters/generic-json.d.ts +14 -0
- package/build/src/updaters/generic-json.js +54 -0
- package/build/src/updaters/generic-toml.d.ts +21 -0
- package/build/src/updaters/generic-toml.js +66 -0
- package/build/src/updaters/generic-xml.d.ts +8 -0
- package/build/src/updaters/generic-xml.js +38 -0
- package/build/src/updaters/generic-yaml.d.ts +23 -0
- package/build/src/updaters/generic-yaml.js +85 -0
- package/build/src/updaters/generic.d.ts +54 -0
- package/build/src/updaters/generic.js +187 -0
- package/build/src/updaters/go/version-go.d.ts +4 -0
- package/build/src/updaters/go/version-go.js +24 -0
- package/build/src/updaters/helm/chart-yaml.d.ts +13 -0
- package/build/src/updaters/helm/chart-yaml.js +41 -0
- package/build/src/updaters/java/java-released.d.ts +28 -0
- package/build/src/updaters/java/java-released.js +59 -0
- package/build/src/updaters/java/java-update.d.ts +21 -0
- package/build/src/updaters/java/java-update.js +80 -0
- package/build/src/updaters/java/pom-xml.d.ts +29 -0
- package/build/src/updaters/java/pom-xml.js +135 -0
- package/build/src/updaters/java/versions-manifest.d.ts +19 -0
- package/build/src/updaters/java/versions-manifest.js +71 -0
- package/build/src/updaters/krm/krm-blueprint-version.d.ts +13 -0
- package/build/src/updaters/krm/krm-blueprint-version.js +46 -0
- package/build/src/updaters/librarian-yaml.d.ts +45 -0
- package/build/src/updaters/librarian-yaml.js +149 -0
- package/build/src/updaters/node/package-json.d.ts +46 -0
- package/build/src/updaters/node/package-json.js +106 -0
- package/build/src/updaters/node/package-lock-json.d.ts +14 -0
- package/build/src/updaters/node/package-lock-json.js +83 -0
- package/build/src/updaters/node/samples-package-json.d.ts +24 -0
- package/build/src/updaters/node/samples-package-json.js +49 -0
- package/build/src/updaters/ocaml/dune-project.d.ts +13 -0
- package/build/src/updaters/ocaml/dune-project.js +37 -0
- package/build/src/updaters/ocaml/esy-json.d.ts +13 -0
- package/build/src/updaters/ocaml/esy-json.js +37 -0
- package/build/src/updaters/ocaml/opam.d.ts +13 -0
- package/build/src/updaters/ocaml/opam.js +37 -0
- package/build/src/updaters/php/php-client-version.d.ts +12 -0
- package/build/src/updaters/php/php-client-version.js +32 -0
- package/build/src/updaters/php/root-composer-update-packages.d.ts +13 -0
- package/build/src/updaters/php/root-composer-update-packages.js +60 -0
- package/build/src/updaters/python/pyproject-toml.d.ts +29 -0
- package/build/src/updaters/python/pyproject-toml.js +53 -0
- package/build/src/updaters/python/python-file-with-version.d.ts +12 -0
- package/build/src/updaters/python/python-file-with-version.js +32 -0
- package/build/src/updaters/python/setup-cfg.d.ts +12 -0
- package/build/src/updaters/python/setup-cfg.js +32 -0
- package/build/src/updaters/python/setup-py.d.ts +12 -0
- package/build/src/updaters/python/setup-py.js +32 -0
- package/build/src/updaters/r/description.d.ts +12 -0
- package/build/src/updaters/r/description.js +32 -0
- package/build/src/updaters/r/news.d.ts +12 -0
- package/build/src/updaters/r/news.js +49 -0
- package/build/src/updaters/raw-content.d.ts +19 -0
- package/build/src/updaters/raw-content.js +39 -0
- package/build/src/updaters/release-please-config.d.ts +8 -0
- package/build/src/updaters/release-please-config.js +80 -0
- package/build/src/updaters/release-please-manifest.d.ts +4 -0
- package/build/src/updaters/release-please-manifest.js +34 -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 +53 -0
- package/build/src/updaters/ruby/version-rb.d.ts +12 -0
- package/build/src/updaters/ruby/version-rb.js +34 -0
- package/build/src/updaters/rust/cargo-lock.d.ts +16 -0
- package/build/src/updaters/rust/cargo-lock.js +64 -0
- package/build/src/updaters/rust/cargo-toml.d.ts +13 -0
- package/build/src/updaters/rust/cargo-toml.js +89 -0
- package/build/src/updaters/rust/common.d.ts +54 -0
- package/build/src/updaters/rust/common.js +35 -0
- package/build/src/updaters/sfdx/sfdx-project-json.d.ts +21 -0
- package/build/src/updaters/sfdx/sfdx-project-json.js +41 -0
- package/build/src/updaters/terraform/metadata-version.d.ts +13 -0
- package/build/src/updaters/terraform/metadata-version.js +37 -0
- package/build/src/updaters/terraform/module-version.d.ts +13 -0
- package/build/src/updaters/terraform/module-version.js +37 -0
- package/build/src/updaters/terraform/readme.d.ts +12 -0
- package/build/src/updaters/terraform/readme.js +32 -0
- package/build/src/util/branch-name.d.ts +20 -0
- package/build/src/util/branch-name.js +225 -0
- package/build/src/util/code-suggester/default-options-handler.d.ts +10 -0
- package/build/src/util/code-suggester/default-options-handler.js +45 -0
- package/build/src/util/code-suggester/errors.d.ts +4 -0
- package/build/src/util/code-suggester/errors.js +24 -0
- package/build/src/util/code-suggester/github/branch.d.ts +45 -0
- package/build/src/util/code-suggester/github/branch.js +118 -0
- package/build/src/util/code-suggester/github/commit-and-push.d.ts +51 -0
- package/build/src/util/code-suggester/github/commit-and-push.js +141 -0
- package/build/src/util/code-suggester/github/create-commit.d.ts +20 -0
- package/build/src/util/code-suggester/github/create-commit.js +60 -0
- package/build/src/util/code-suggester/github/fork.d.ts +15 -0
- package/build/src/util/code-suggester/github/fork.js +48 -0
- package/build/src/util/code-suggester/github/labels.d.ts +14 -0
- package/build/src/util/code-suggester/github/labels.js +42 -0
- package/build/src/util/code-suggester/github/open-pull-request.d.ts +16 -0
- package/build/src/util/code-suggester/github/open-pull-request.js +56 -0
- package/build/src/util/code-suggester/index.d.ts +28 -0
- package/build/src/util/code-suggester/index.js +110 -0
- package/build/src/util/code-suggester/logger.d.ts +4 -0
- package/build/src/util/code-suggester/logger.js +37 -0
- package/build/src/util/code-suggester/types.d.ts +109 -0
- package/build/src/util/code-suggester/types.js +30 -0
- package/build/src/util/coerce-option.d.ts +1 -0
- package/build/src/util/coerce-option.js +40 -0
- package/build/src/util/commit-exclude.d.ts +10 -0
- package/build/src/util/commit-exclude.js +49 -0
- package/build/src/util/commit-split.d.ts +26 -0
- package/build/src/util/commit-split.js +100 -0
- package/build/src/util/commit-utils.d.ts +1 -0
- package/build/src/util/commit-utils.js +34 -0
- package/build/src/util/filter-commits.d.ts +12 -0
- package/build/src/util/filter-commits.js +59 -0
- package/build/src/util/indent-commit.d.ts +2 -0
- package/build/src/util/indent-commit.js +39 -0
- package/build/src/util/json-stringify.d.ts +1 -0
- package/build/src/util/json-stringify.js +22 -0
- package/build/src/util/logger.d.ts +24 -0
- package/build/src/util/logger.js +54 -0
- package/build/src/util/pull-request-body.d.ts +25 -0
- package/build/src/util/pull-request-body.js +147 -0
- package/build/src/util/pull-request-overflow-handler.d.ts +54 -0
- package/build/src/util/pull-request-overflow-handler.js +78 -0
- package/build/src/util/pull-request-title.d.ts +22 -0
- package/build/src/util/pull-request-title.js +146 -0
- package/build/src/util/signoff-commit-message.d.ts +1 -0
- package/build/src/util/signoff-commit-message.js +35 -0
- package/build/src/util/tag-name.d.ts +10 -0
- package/build/src/util/tag-name.js +42 -0
- package/build/src/util/toml-edit.d.ts +16 -0
- package/build/src/util/toml-edit.js +126 -0
- package/build/src/version.d.ts +35 -0
- package/build/src/version.js +74 -0
- package/build/src/versioning-strategies/always-bump-major.d.ts +10 -0
- package/build/src/versioning-strategies/always-bump-major.js +28 -0
- package/build/src/versioning-strategies/always-bump-minor.d.ts +10 -0
- package/build/src/versioning-strategies/always-bump-minor.js +28 -0
- package/build/src/versioning-strategies/always-bump-patch.d.ts +11 -0
- package/build/src/versioning-strategies/always-bump-patch.js +29 -0
- package/build/src/versioning-strategies/default.d.ts +48 -0
- package/build/src/versioning-strategies/default.js +102 -0
- package/build/src/versioning-strategies/dependency-manifest.d.ts +15 -0
- package/build/src/versioning-strategies/dependency-manifest.js +103 -0
- package/build/src/versioning-strategies/java-add-snapshot.d.ts +13 -0
- package/build/src/versioning-strategies/java-add-snapshot.js +54 -0
- package/build/src/versioning-strategies/java-snapshot.d.ts +13 -0
- package/build/src/versioning-strategies/java-snapshot.js +70 -0
- package/build/src/versioning-strategies/prerelease.d.ts +20 -0
- package/build/src/versioning-strategies/prerelease.js +163 -0
- package/build/src/versioning-strategies/service-pack.d.ts +12 -0
- package/build/src/versioning-strategies/service-pack.js +47 -0
- package/build/src/versioning-strategy.d.ts +90 -0
- package/build/src/versioning-strategy.js +82 -0
- package/package.json +114 -4
- package/schemas/config.json +513 -0
- package/schemas/manifest.json +9 -0
- package/templates/commit.hbs +2 -0
- package/templates/header.hbs +9 -0
- package/templates/template.hbs +19 -0
|
@@ -0,0 +1,53 @@
|
|
|
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.PyProjectToml = exports.parsePyProject = void 0;
|
|
17
|
+
const TOML = require("@iarna/toml");
|
|
18
|
+
const logger_1 = require("../../util/logger");
|
|
19
|
+
const toml_edit_1 = require("../../util/toml-edit");
|
|
20
|
+
const default_1 = require("../default");
|
|
21
|
+
function parsePyProject(content) {
|
|
22
|
+
return TOML.parse(content);
|
|
23
|
+
}
|
|
24
|
+
exports.parsePyProject = parsePyProject;
|
|
25
|
+
/**
|
|
26
|
+
* Updates a pyproject.toml file
|
|
27
|
+
*/
|
|
28
|
+
class PyProjectToml extends default_1.DefaultUpdater {
|
|
29
|
+
/**
|
|
30
|
+
* Given initial file contents, return updated contents.
|
|
31
|
+
* @param {string} content The initial content
|
|
32
|
+
* @returns {string} The updated content
|
|
33
|
+
*/
|
|
34
|
+
updateContent(content, logger = logger_1.logger) {
|
|
35
|
+
var _a;
|
|
36
|
+
const parsed = parsePyProject(content);
|
|
37
|
+
const project = parsed.project || ((_a = parsed.tool) === null || _a === void 0 ? void 0 : _a.poetry);
|
|
38
|
+
if (!(project === null || project === void 0 ? void 0 : project.version)) {
|
|
39
|
+
// Throw warning if the version is dynamically generated.
|
|
40
|
+
if ((project === null || project === void 0 ? void 0 : project.dynamic) && project.dynamic.includes('version')) {
|
|
41
|
+
const msg = "dynamic version found in 'pyproject.toml'. Skipping update.";
|
|
42
|
+
logger.warn(msg);
|
|
43
|
+
return content;
|
|
44
|
+
}
|
|
45
|
+
const msg = 'invalid file';
|
|
46
|
+
logger.error(msg);
|
|
47
|
+
throw new Error(msg);
|
|
48
|
+
}
|
|
49
|
+
return (0, toml_edit_1.replaceTomlValue)(content, (parsed.project ? ['project'] : ['tool', 'poetry']).concat('version'), this.version.toString());
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.PyProjectToml = PyProjectToml;
|
|
53
|
+
//# sourceMappingURL=pyproject-toml.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DefaultUpdater } from '../default';
|
|
2
|
+
/**
|
|
3
|
+
* Python file with a __version__ property (or attribute, or whatever).
|
|
4
|
+
*/
|
|
5
|
+
export declare class PythonFileWithVersion extends DefaultUpdater {
|
|
6
|
+
/**
|
|
7
|
+
* Given initial file contents, return updated contents.
|
|
8
|
+
* @param {string} content The initial content
|
|
9
|
+
* @returns {string} The updated content
|
|
10
|
+
*/
|
|
11
|
+
updateContent(content: string): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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.PythonFileWithVersion = void 0;
|
|
17
|
+
const default_1 = require("../default");
|
|
18
|
+
/**
|
|
19
|
+
* Python file with a __version__ property (or attribute, or whatever).
|
|
20
|
+
*/
|
|
21
|
+
class PythonFileWithVersion extends default_1.DefaultUpdater {
|
|
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) {
|
|
28
|
+
return content.replace(/(__version__ ?= ?["'])[0-9]+\.[0-9]+\.[0-9]+(?:-\w+)?(["'])/, `$1${this.version}$2`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.PythonFileWithVersion = PythonFileWithVersion;
|
|
32
|
+
//# sourceMappingURL=python-file-with-version.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DefaultUpdater } from '../default';
|
|
2
|
+
/**
|
|
3
|
+
* Updates a setup.cfg file
|
|
4
|
+
*/
|
|
5
|
+
export declare class SetupCfg extends DefaultUpdater {
|
|
6
|
+
/**
|
|
7
|
+
* Given initial file contents, return updated contents.
|
|
8
|
+
* @param {string} content The initial content
|
|
9
|
+
* @returns {string} The updated content
|
|
10
|
+
*/
|
|
11
|
+
updateContent(content: string): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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.SetupCfg = void 0;
|
|
17
|
+
const default_1 = require("../default");
|
|
18
|
+
/**
|
|
19
|
+
* Updates a setup.cfg file
|
|
20
|
+
*/
|
|
21
|
+
class SetupCfg extends default_1.DefaultUpdater {
|
|
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) {
|
|
28
|
+
return content.replace(/(version ?= ?)[0-9]+\.[0-9]+\.[0-9]+(?:-\w+)?/, `$1${this.version}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.SetupCfg = SetupCfg;
|
|
32
|
+
//# sourceMappingURL=setup-cfg.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DefaultUpdater } from '../default';
|
|
2
|
+
/**
|
|
3
|
+
* Updates a setup.py file.
|
|
4
|
+
*/
|
|
5
|
+
export declare class SetupPy extends DefaultUpdater {
|
|
6
|
+
/**
|
|
7
|
+
* Given initial file contents, return updated contents.
|
|
8
|
+
* @param {string} content The initial content
|
|
9
|
+
* @returns {string} The updated content
|
|
10
|
+
*/
|
|
11
|
+
updateContent(content: string): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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.SetupPy = void 0;
|
|
17
|
+
const default_1 = require("../default");
|
|
18
|
+
/**
|
|
19
|
+
* Updates a setup.py file.
|
|
20
|
+
*/
|
|
21
|
+
class SetupPy extends default_1.DefaultUpdater {
|
|
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) {
|
|
28
|
+
return content.replace(/(version ?= ?["'])[0-9]+\.[0-9]+\.[0-9]+(?:-\w+)?(["'])/, `$1${this.version}$2`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.SetupPy = SetupPy;
|
|
32
|
+
//# sourceMappingURL=setup-py.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DefaultUpdater } from '../default';
|
|
2
|
+
/**
|
|
3
|
+
* Updates the DESCRIPTION file of an R package.
|
|
4
|
+
*/
|
|
5
|
+
export declare class DescriptionUpdater extends DefaultUpdater {
|
|
6
|
+
/**
|
|
7
|
+
* Given initial file contents, return updated contents.
|
|
8
|
+
* @param {string} content The initial content
|
|
9
|
+
* @returns {string} The updated content
|
|
10
|
+
*/
|
|
11
|
+
updateContent(content: string): string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2025 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.DescriptionUpdater = void 0;
|
|
17
|
+
const default_1 = require("../default");
|
|
18
|
+
/**
|
|
19
|
+
* Updates the DESCRIPTION file of an R package.
|
|
20
|
+
*/
|
|
21
|
+
class DescriptionUpdater extends default_1.DefaultUpdater {
|
|
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) {
|
|
28
|
+
return content.replace(/^Version:\s*[0-9]+\.[0-9]+\.[0-9]+(?:\.[0-9]+)?\s*$/m, `Version: ${this.version}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.DescriptionUpdater = DescriptionUpdater;
|
|
32
|
+
//# sourceMappingURL=description.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DefaultUpdater, UpdateOptions } from '../default';
|
|
2
|
+
interface ChangelogOptions extends UpdateOptions {
|
|
3
|
+
changelogEntry: string;
|
|
4
|
+
versionHeaderRegex?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class News extends DefaultUpdater {
|
|
7
|
+
changelogEntry: string;
|
|
8
|
+
readonly versionHeaderRegex: RegExp;
|
|
9
|
+
constructor(options: ChangelogOptions);
|
|
10
|
+
updateContent(content: string | undefined): string;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2025 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.News = void 0;
|
|
17
|
+
const default_1 = require("../default");
|
|
18
|
+
const DEFAULT_VERSION_HEADER_REGEX = '\n### v?[0-9[]';
|
|
19
|
+
class News extends default_1.DefaultUpdater {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
var _a;
|
|
22
|
+
super(options);
|
|
23
|
+
this.changelogEntry = options.changelogEntry;
|
|
24
|
+
this.versionHeaderRegex = new RegExp((_a = options.versionHeaderRegex) !== null && _a !== void 0 ? _a : DEFAULT_VERSION_HEADER_REGEX, 's');
|
|
25
|
+
}
|
|
26
|
+
updateContent(content) {
|
|
27
|
+
content = content || '';
|
|
28
|
+
const lastEntryIndex = content.search(this.versionHeaderRegex);
|
|
29
|
+
if (lastEntryIndex === -1) {
|
|
30
|
+
if (content) {
|
|
31
|
+
return `${this.changelogEntry}\n\n${adjustHeaders(content).trim()}\n`;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return `${this.changelogEntry}\n`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const before = content.slice(0, lastEntryIndex);
|
|
39
|
+
const after = content.slice(lastEntryIndex);
|
|
40
|
+
return `${before}\n${this.changelogEntry}\n${after}`.trim() + '\n';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.News = News;
|
|
45
|
+
// Helper to increase markdown H1 headers to H2
|
|
46
|
+
function adjustHeaders(content) {
|
|
47
|
+
return content.replace(/^#(\s)/gm, '##$1');
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=news.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Updater } from '../update';
|
|
2
|
+
/**
|
|
3
|
+
* This updater ignores previous content and writes the provided
|
|
4
|
+
* content verbatim.
|
|
5
|
+
*/
|
|
6
|
+
export declare class RawContent implements Updater {
|
|
7
|
+
rawContent: string;
|
|
8
|
+
/**
|
|
9
|
+
* Create a new RawContent instance
|
|
10
|
+
* @param {string} rawContent The raw content to set as the contents.
|
|
11
|
+
*/
|
|
12
|
+
constructor(rawContent: string);
|
|
13
|
+
/**
|
|
14
|
+
* Given initial file contents, return updated contents.
|
|
15
|
+
* @param {string} content The initial content
|
|
16
|
+
* @returns {string} The updated content
|
|
17
|
+
*/
|
|
18
|
+
updateContent(_content: string | undefined): string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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.RawContent = void 0;
|
|
17
|
+
/**
|
|
18
|
+
* This updater ignores previous content and writes the provided
|
|
19
|
+
* content verbatim.
|
|
20
|
+
*/
|
|
21
|
+
class RawContent {
|
|
22
|
+
/**
|
|
23
|
+
* Create a new RawContent instance
|
|
24
|
+
* @param {string} rawContent The raw content to set as the contents.
|
|
25
|
+
*/
|
|
26
|
+
constructor(rawContent) {
|
|
27
|
+
this.rawContent = rawContent;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Given initial file contents, return updated contents.
|
|
31
|
+
* @param {string} content The initial content
|
|
32
|
+
* @returns {string} The updated content
|
|
33
|
+
*/
|
|
34
|
+
updateContent(_content) {
|
|
35
|
+
return this.rawContent;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.RawContent = RawContent;
|
|
39
|
+
//# sourceMappingURL=raw-content.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Updater } from '../update';
|
|
2
|
+
import { ReleaserConfig } from '../manifest';
|
|
3
|
+
export declare class ReleasePleaseConfig implements Updater {
|
|
4
|
+
path: string;
|
|
5
|
+
config: ReleaserConfig;
|
|
6
|
+
constructor(path: string, config: ReleaserConfig);
|
|
7
|
+
updateContent(content: string): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
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.ReleasePleaseConfig = void 0;
|
|
17
|
+
const json_stringify_1 = require("../util/json-stringify");
|
|
18
|
+
const SCHEMA_URL = 'https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json';
|
|
19
|
+
class ReleasePleaseConfig {
|
|
20
|
+
constructor(path, config) {
|
|
21
|
+
this.path = path;
|
|
22
|
+
this.config = config;
|
|
23
|
+
}
|
|
24
|
+
updateContent(content) {
|
|
25
|
+
var _a;
|
|
26
|
+
let parsed;
|
|
27
|
+
if (content) {
|
|
28
|
+
parsed = JSON.parse(content);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
parsed = { packages: {} };
|
|
32
|
+
}
|
|
33
|
+
parsed['$schema'] = (_a = parsed['$schema']) !== null && _a !== void 0 ? _a : SCHEMA_URL;
|
|
34
|
+
parsed.packages[this.path] = releaserConfigToJsonConfig(this.config);
|
|
35
|
+
if (content) {
|
|
36
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
return JSON.stringify(parsed, null, 2);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.ReleasePleaseConfig = ReleasePleaseConfig;
|
|
44
|
+
function releaserConfigToJsonConfig(config) {
|
|
45
|
+
var _a, _b, _c;
|
|
46
|
+
const jsonConfig = {
|
|
47
|
+
'package-name': config.packageName,
|
|
48
|
+
component: config.component,
|
|
49
|
+
'changelog-path': config.changelogPath,
|
|
50
|
+
'release-type': config.releaseType,
|
|
51
|
+
'bump-minor-pre-major': config.bumpMinorPreMajor,
|
|
52
|
+
'bump-patch-for-minor-pre-major': config.bumpPatchForMinorPreMajor,
|
|
53
|
+
'changelog-sections': config.changelogSections,
|
|
54
|
+
'release-as': config.releaseAs,
|
|
55
|
+
'skip-github-release': config.skipGithubRelease,
|
|
56
|
+
'skip-changelog': config.skipChangelog,
|
|
57
|
+
draft: config.draft,
|
|
58
|
+
prerelease: config.prerelease,
|
|
59
|
+
'draft-pull-request': config.draftPullRequest,
|
|
60
|
+
label: (_a = config.labels) === null || _a === void 0 ? void 0 : _a.join(','),
|
|
61
|
+
'release-label': (_b = config.releaseLabels) === null || _b === void 0 ? void 0 : _b.join(','),
|
|
62
|
+
'include-component-in-tag': config.includeComponentInTag,
|
|
63
|
+
'include-v-in-tag': config.includeVInTag,
|
|
64
|
+
'include-v-in-release-name': config.includeVInReleaseName,
|
|
65
|
+
'changelog-type': config.changelogType,
|
|
66
|
+
'changelog-host': config.changelogHost,
|
|
67
|
+
'pull-request-title-pattern': config.pullRequestTitlePattern,
|
|
68
|
+
'pull-request-header': config.pullRequestHeader,
|
|
69
|
+
'pull-request-footer': config.pullRequestFooter,
|
|
70
|
+
'component-no-space': config.componentNoSpace,
|
|
71
|
+
'separate-pull-requests': config.separatePullRequests,
|
|
72
|
+
'tag-separator': config.tagSeparator,
|
|
73
|
+
'extra-files': config.extraFiles,
|
|
74
|
+
'version-file': config.versionFile,
|
|
75
|
+
'snapshot-label': (_c = config.snapshotLabels) === null || _c === void 0 ? void 0 : _c.join(','),
|
|
76
|
+
'date-format': config.dateFormat,
|
|
77
|
+
};
|
|
78
|
+
return jsonConfig;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=release-please-config.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
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.ReleasePleaseManifest = void 0;
|
|
17
|
+
const json_stringify_1 = require("../util/json-stringify");
|
|
18
|
+
const default_1 = require("./default");
|
|
19
|
+
class ReleasePleaseManifest extends default_1.DefaultUpdater {
|
|
20
|
+
updateContent(content) {
|
|
21
|
+
const parsed = content ? JSON.parse(content) : {};
|
|
22
|
+
for (const [path, version] of this.versionsMap) {
|
|
23
|
+
parsed[path] = version.toString();
|
|
24
|
+
}
|
|
25
|
+
if (content) {
|
|
26
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return JSON.stringify(parsed, null, 2);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.ReleasePleaseManifest = ReleasePleaseManifest;
|
|
34
|
+
//# sourceMappingURL=release-please-manifest.js.map
|
|
@@ -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,53 @@
|
|
|
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
|
+
if (!this.gemName) {
|
|
44
|
+
return content;
|
|
45
|
+
}
|
|
46
|
+
// Bundler will convert 1.0.0-alpha1 to 1.0.0.pre.alpha1, so we need to
|
|
47
|
+
// do the same here.
|
|
48
|
+
const versionString = (0, common_1.resolveRubyGemfileLockVersion)(this.version.toString());
|
|
49
|
+
return content.replace(buildGemfileLockVersionRegex(this.gemName), `${this.gemName} (${versionString})`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.GemfileLock = GemfileLock;
|
|
53
|
+
//# sourceMappingURL=gemfile-lock.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DefaultUpdater } from '../default';
|
|
2
|
+
/**
|
|
3
|
+
* Updates a versions.rb file which is expected to have a version string.
|
|
4
|
+
*/
|
|
5
|
+
export declare class VersionRB extends DefaultUpdater {
|
|
6
|
+
/**
|
|
7
|
+
* Given initial file contents, return updated contents.
|
|
8
|
+
* @param {string} content The initial content
|
|
9
|
+
* @returns {string} The updated content
|
|
10
|
+
*/
|
|
11
|
+
updateContent(content: string): string;
|
|
12
|
+
}
|