@release-please-oss/release-please 0.0.0 → 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 +280 -0
- 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 +113 -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,46 @@
|
|
|
1
|
+
import { Logger } from '../../util/logger';
|
|
2
|
+
import { Version, VersionsMap } from '../../version';
|
|
3
|
+
import { DefaultUpdater, UpdateOptions } from '../default';
|
|
4
|
+
export type PackageJsonDescriptor = {
|
|
5
|
+
name?: string;
|
|
6
|
+
resolved?: string;
|
|
7
|
+
link?: boolean;
|
|
8
|
+
version: string;
|
|
9
|
+
dependencies?: Record<string, string>;
|
|
10
|
+
devDependencies?: Record<string, string>;
|
|
11
|
+
peerDependencies?: Record<string, string>;
|
|
12
|
+
optionalDependencies?: Record<string, string>;
|
|
13
|
+
};
|
|
14
|
+
export interface PackageJsonOptions extends UpdateOptions {
|
|
15
|
+
updatePeerDependencies?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* This updates a Node.js package.json file's main version.
|
|
19
|
+
*/
|
|
20
|
+
export declare class PackageJson extends DefaultUpdater {
|
|
21
|
+
private updatePeerDependencies;
|
|
22
|
+
constructor(options: PackageJsonOptions);
|
|
23
|
+
/**
|
|
24
|
+
* Given initial file contents, return updated contents.
|
|
25
|
+
* @param {string} content The initial content
|
|
26
|
+
* @param logger
|
|
27
|
+
* @returns {string} The updated content
|
|
28
|
+
*/
|
|
29
|
+
updateContent(content: string, logger?: Logger): string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Helper to coerce a new version value into a version range that preserves the
|
|
33
|
+
* version range prefix of the original version.
|
|
34
|
+
* @param {string} oldVersion Old semver with range
|
|
35
|
+
* @param {Version} newVersion The new version to update with
|
|
36
|
+
*/
|
|
37
|
+
export declare function newVersionWithRange(oldVersion: string, newVersion: Version): string;
|
|
38
|
+
export declare const NPM_PROTOCOL_REGEXP: RegExp;
|
|
39
|
+
/**
|
|
40
|
+
* Helper function to update dependency versions for all new versions specified
|
|
41
|
+
* in the updated versions map. Note that this mutates the existing input.
|
|
42
|
+
* @param {Record<string, string>} dependencies Entries in package.json dependencies
|
|
43
|
+
* where the key is the dependency name and the value is the dependency range
|
|
44
|
+
* @param {VersionsMap} updatedVersions Map of new versions (without dependency range prefixes)
|
|
45
|
+
*/
|
|
46
|
+
export declare function updateDependencies(dependencies: Record<string, string>, updatedVersions: VersionsMap): void;
|
|
@@ -0,0 +1,106 @@
|
|
|
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.updateDependencies = exports.NPM_PROTOCOL_REGEXP = exports.newVersionWithRange = exports.PackageJson = void 0;
|
|
17
|
+
const json_stringify_1 = require("../../util/json-stringify");
|
|
18
|
+
const logger_1 = require("../../util/logger");
|
|
19
|
+
const default_1 = require("../default");
|
|
20
|
+
/**
|
|
21
|
+
* This updates a Node.js package.json file's main version.
|
|
22
|
+
*/
|
|
23
|
+
class PackageJson extends default_1.DefaultUpdater {
|
|
24
|
+
constructor(options) {
|
|
25
|
+
super(options);
|
|
26
|
+
this.updatePeerDependencies = false;
|
|
27
|
+
this.updatePeerDependencies = options.updatePeerDependencies || false;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Given initial file contents, return updated contents.
|
|
31
|
+
* @param {string} content The initial content
|
|
32
|
+
* @param logger
|
|
33
|
+
* @returns {string} The updated content
|
|
34
|
+
*/
|
|
35
|
+
updateContent(content, logger = logger_1.logger) {
|
|
36
|
+
const parsed = JSON.parse(content);
|
|
37
|
+
logger.info(`updating from ${parsed.version} to ${this.version}`);
|
|
38
|
+
parsed.version = this.version.toString();
|
|
39
|
+
// If additional dependency versions specified, then update dependency versions
|
|
40
|
+
// while preserving any valid version range prefixes.
|
|
41
|
+
if (this.versionsMap) {
|
|
42
|
+
if (parsed.dependencies) {
|
|
43
|
+
updateDependencies(parsed.dependencies, this.versionsMap);
|
|
44
|
+
}
|
|
45
|
+
if (parsed.devDependencies) {
|
|
46
|
+
updateDependencies(parsed.devDependencies, this.versionsMap);
|
|
47
|
+
}
|
|
48
|
+
if (parsed.peerDependencies && this.updatePeerDependencies) {
|
|
49
|
+
updateDependencies(parsed.peerDependencies, this.versionsMap);
|
|
50
|
+
}
|
|
51
|
+
if (parsed.optionalDependencies) {
|
|
52
|
+
updateDependencies(parsed.optionalDependencies, this.versionsMap);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.PackageJson = PackageJson;
|
|
59
|
+
var SUPPORTED_RANGE_PREFIXES;
|
|
60
|
+
(function (SUPPORTED_RANGE_PREFIXES) {
|
|
61
|
+
SUPPORTED_RANGE_PREFIXES["CARET"] = "^";
|
|
62
|
+
SUPPORTED_RANGE_PREFIXES["TILDE"] = "~";
|
|
63
|
+
SUPPORTED_RANGE_PREFIXES["EQUAL_OR_GREATER_THAN"] = ">=";
|
|
64
|
+
SUPPORTED_RANGE_PREFIXES["EQUAL_OR_LESS_THAN"] = "<=";
|
|
65
|
+
SUPPORTED_RANGE_PREFIXES["GREATER_THAN"] = ">";
|
|
66
|
+
SUPPORTED_RANGE_PREFIXES["LESS_THAN"] = "<";
|
|
67
|
+
})(SUPPORTED_RANGE_PREFIXES || (SUPPORTED_RANGE_PREFIXES = {}));
|
|
68
|
+
function detectRangePrefix(version) {
|
|
69
|
+
return (Object.values(SUPPORTED_RANGE_PREFIXES).find(supportedRangePrefix => version.startsWith(supportedRangePrefix)) || '');
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Helper to coerce a new version value into a version range that preserves the
|
|
73
|
+
* version range prefix of the original version.
|
|
74
|
+
* @param {string} oldVersion Old semver with range
|
|
75
|
+
* @param {Version} newVersion The new version to update with
|
|
76
|
+
*/
|
|
77
|
+
function newVersionWithRange(oldVersion, newVersion) {
|
|
78
|
+
const prefix = detectRangePrefix(oldVersion);
|
|
79
|
+
if (prefix) {
|
|
80
|
+
return `${prefix}${newVersion}`;
|
|
81
|
+
}
|
|
82
|
+
return newVersion.toString();
|
|
83
|
+
}
|
|
84
|
+
exports.newVersionWithRange = newVersionWithRange;
|
|
85
|
+
exports.NPM_PROTOCOL_REGEXP = /^[a-z]+:/;
|
|
86
|
+
/**
|
|
87
|
+
* Helper function to update dependency versions for all new versions specified
|
|
88
|
+
* in the updated versions map. Note that this mutates the existing input.
|
|
89
|
+
* @param {Record<string, string>} dependencies Entries in package.json dependencies
|
|
90
|
+
* where the key is the dependency name and the value is the dependency range
|
|
91
|
+
* @param {VersionsMap} updatedVersions Map of new versions (without dependency range prefixes)
|
|
92
|
+
*/
|
|
93
|
+
function updateDependencies(dependencies, updatedVersions) {
|
|
94
|
+
for (const depName of Object.keys(dependencies)) {
|
|
95
|
+
const oldVersion = dependencies[depName];
|
|
96
|
+
if (exports.NPM_PROTOCOL_REGEXP.test(oldVersion)) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const newVersion = updatedVersions.get(depName);
|
|
100
|
+
if (newVersion) {
|
|
101
|
+
dependencies[depName] = newVersionWithRange(oldVersion, newVersion);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.updateDependencies = updateDependencies;
|
|
106
|
+
//# sourceMappingURL=package-json.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Updater } from '../../update';
|
|
2
|
+
import { Logger } from '../../util/logger';
|
|
3
|
+
import { Version, VersionsMap } from '../../version';
|
|
4
|
+
import { UpdateOptions } from '../default';
|
|
5
|
+
/**
|
|
6
|
+
* Updates a Node.js package-lock.json file's version and '' package
|
|
7
|
+
* version (for a v2 lock file).
|
|
8
|
+
*/
|
|
9
|
+
export declare class PackageLockJson implements Updater {
|
|
10
|
+
version?: Version;
|
|
11
|
+
versionsMap?: VersionsMap;
|
|
12
|
+
constructor(options: Partial<UpdateOptions>);
|
|
13
|
+
updateContent(content: string, logger?: Logger): string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
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.PackageLockJson = void 0;
|
|
17
|
+
const json_stringify_1 = require("../../util/json-stringify");
|
|
18
|
+
const logger_1 = require("../../util/logger");
|
|
19
|
+
const package_json_1 = require("./package-json");
|
|
20
|
+
/**
|
|
21
|
+
* Updates a Node.js package-lock.json file's version and '' package
|
|
22
|
+
* version (for a v2 lock file).
|
|
23
|
+
*/
|
|
24
|
+
class PackageLockJson {
|
|
25
|
+
constructor(options) {
|
|
26
|
+
this.version = options.version;
|
|
27
|
+
this.versionsMap = options.versionsMap;
|
|
28
|
+
}
|
|
29
|
+
updateContent(content, logger = logger_1.logger) {
|
|
30
|
+
const parsed = JSON.parse(content);
|
|
31
|
+
if (this.version) {
|
|
32
|
+
logger.info(`updating from ${parsed.version} to ${this.version}`);
|
|
33
|
+
parsed.version = this.version.toString();
|
|
34
|
+
}
|
|
35
|
+
if (parsed.lockfileVersion === 2 || parsed.lockfileVersion === 3) {
|
|
36
|
+
if (this.version) {
|
|
37
|
+
parsed.packages[''].version = this.version.toString();
|
|
38
|
+
}
|
|
39
|
+
if (this.versionsMap) {
|
|
40
|
+
this.versionsMap.forEach((version, name) => {
|
|
41
|
+
let pkg = parsed.packages['node_modules/' + name];
|
|
42
|
+
if (!pkg) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
// @see https://docs.npmjs.com/cli/v10/configuring-npm/package-lock-json#packages
|
|
46
|
+
if (pkg.link && pkg.resolved) {
|
|
47
|
+
pkg = parsed.packages[pkg.resolved];
|
|
48
|
+
if (!pkg) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
pkg.version = version.toString();
|
|
53
|
+
if (pkg.dependencies) {
|
|
54
|
+
(0, package_json_1.updateDependencies)(pkg.dependencies, this.versionsMap);
|
|
55
|
+
}
|
|
56
|
+
if (pkg.devDependencies) {
|
|
57
|
+
(0, package_json_1.updateDependencies)(pkg.devDependencies, this.versionsMap);
|
|
58
|
+
}
|
|
59
|
+
if (pkg.peerDependencies) {
|
|
60
|
+
(0, package_json_1.updateDependencies)(pkg.peerDependencies, this.versionsMap);
|
|
61
|
+
}
|
|
62
|
+
if (pkg.optionalDependencies) {
|
|
63
|
+
(0, package_json_1.updateDependencies)(pkg.optionalDependencies, this.versionsMap);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (this.versionsMap) {
|
|
69
|
+
for (const [, obj] of Object.entries(parsed.packages)) {
|
|
70
|
+
if (!obj.name) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const ver = this.versionsMap.get(obj.name);
|
|
74
|
+
if (ver) {
|
|
75
|
+
obj.version = ver.toString();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.PackageLockJson = PackageLockJson;
|
|
83
|
+
//# sourceMappingURL=package-lock-json.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Logger } from '../../util/logger';
|
|
2
|
+
import { DefaultUpdater, UpdateOptions } from '../default';
|
|
3
|
+
interface SamplesPackageJsonOptions extends UpdateOptions {
|
|
4
|
+
packageName: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Updates the a Node.js package.json file with the library in the
|
|
8
|
+
* dependencies section.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SamplesPackageJson extends DefaultUpdater {
|
|
11
|
+
packageName: string;
|
|
12
|
+
/**
|
|
13
|
+
* Instantiate a new SamplesPackageJson updater
|
|
14
|
+
* @param options
|
|
15
|
+
*/
|
|
16
|
+
constructor(options: SamplesPackageJsonOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Given initial file contents, return updated contents.
|
|
19
|
+
* @param {string} content The initial content
|
|
20
|
+
* @returns {string} The updated content
|
|
21
|
+
*/
|
|
22
|
+
updateContent(content: string, logger?: Logger): string;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
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.SamplesPackageJson = void 0;
|
|
17
|
+
const logger_1 = require("../../util/logger");
|
|
18
|
+
const json_stringify_1 = require("../../util/json-stringify");
|
|
19
|
+
const default_1 = require("../default");
|
|
20
|
+
/**
|
|
21
|
+
* Updates the a Node.js package.json file with the library in the
|
|
22
|
+
* dependencies section.
|
|
23
|
+
*/
|
|
24
|
+
class SamplesPackageJson extends default_1.DefaultUpdater {
|
|
25
|
+
/**
|
|
26
|
+
* Instantiate a new SamplesPackageJson updater
|
|
27
|
+
* @param options
|
|
28
|
+
*/
|
|
29
|
+
constructor(options) {
|
|
30
|
+
super(options);
|
|
31
|
+
this.packageName = options.packageName;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Given initial file contents, return updated contents.
|
|
35
|
+
* @param {string} content The initial content
|
|
36
|
+
* @returns {string} The updated content
|
|
37
|
+
*/
|
|
38
|
+
updateContent(content, logger = logger_1.logger) {
|
|
39
|
+
const parsed = JSON.parse(content);
|
|
40
|
+
if (!parsed.dependencies || !parsed.dependencies[this.packageName]) {
|
|
41
|
+
return content;
|
|
42
|
+
}
|
|
43
|
+
logger.info(`updating ${this.packageName} dependency from ${parsed.dependencies[this.packageName]} to ^${this.version}`);
|
|
44
|
+
parsed.dependencies[this.packageName] = `^${this.version}`;
|
|
45
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.SamplesPackageJson = SamplesPackageJson;
|
|
49
|
+
//# sourceMappingURL=samples-package-json.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Logger } from '../../util/logger';
|
|
2
|
+
import { DefaultUpdater } from '../default';
|
|
3
|
+
/**
|
|
4
|
+
* Updates an OCaml dune-project file.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DuneProject extends DefaultUpdater {
|
|
7
|
+
/**
|
|
8
|
+
* Given initial file contents, return updated contents.
|
|
9
|
+
* @param {string} content The initial content
|
|
10
|
+
* @returns {string} The updated content
|
|
11
|
+
*/
|
|
12
|
+
updateContent(content: string, logger?: Logger): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.DuneProject = void 0;
|
|
17
|
+
const logger_1 = require("../../util/logger");
|
|
18
|
+
const default_1 = require("../default");
|
|
19
|
+
/**
|
|
20
|
+
* Updates an OCaml dune-project file.
|
|
21
|
+
*/
|
|
22
|
+
class DuneProject extends default_1.DefaultUpdater {
|
|
23
|
+
/**
|
|
24
|
+
* Given initial file contents, return updated contents.
|
|
25
|
+
* @param {string} content The initial content
|
|
26
|
+
* @returns {string} The updated content
|
|
27
|
+
*/
|
|
28
|
+
updateContent(content, logger = logger_1.logger) {
|
|
29
|
+
const oldVersion = content.match(/^\(version ([A-Za-z0-9_\-+.~]+)\)$/m);
|
|
30
|
+
if (oldVersion) {
|
|
31
|
+
logger.info(`updating from ${oldVersion[1]} to ${this.version}`);
|
|
32
|
+
}
|
|
33
|
+
return content.replace(/^\(version ([A-Za-z0-9_\-+.~]+)\)$/m, `(version ${this.version})`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.DuneProject = DuneProject;
|
|
37
|
+
//# sourceMappingURL=dune-project.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Logger } from '../../util/logger';
|
|
2
|
+
import { DefaultUpdater } from '../default';
|
|
3
|
+
/**
|
|
4
|
+
* Updates an OCaml esy.json file.
|
|
5
|
+
*/
|
|
6
|
+
export declare class EsyJson extends DefaultUpdater {
|
|
7
|
+
/**
|
|
8
|
+
* Given initial file contents, return updated contents.
|
|
9
|
+
* @param {string} content The initial content
|
|
10
|
+
* @returns {string} The updated content
|
|
11
|
+
*/
|
|
12
|
+
updateContent(content: string, logger?: Logger): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.EsyJson = void 0;
|
|
17
|
+
const logger_1 = require("../../util/logger");
|
|
18
|
+
const json_stringify_1 = require("../../util/json-stringify");
|
|
19
|
+
const default_1 = require("../default");
|
|
20
|
+
/**
|
|
21
|
+
* Updates an OCaml esy.json file.
|
|
22
|
+
*/
|
|
23
|
+
class EsyJson extends default_1.DefaultUpdater {
|
|
24
|
+
/**
|
|
25
|
+
* Given initial file contents, return updated contents.
|
|
26
|
+
* @param {string} content The initial content
|
|
27
|
+
* @returns {string} The updated content
|
|
28
|
+
*/
|
|
29
|
+
updateContent(content, logger = logger_1.logger) {
|
|
30
|
+
const parsed = JSON.parse(content);
|
|
31
|
+
logger.info(`updating from ${parsed.version} to ${this.version}`);
|
|
32
|
+
parsed.version = this.version.toString();
|
|
33
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.EsyJson = EsyJson;
|
|
37
|
+
//# sourceMappingURL=esy-json.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Logger } from '../../util/logger';
|
|
2
|
+
import { DefaultUpdater } from '../default';
|
|
3
|
+
/**
|
|
4
|
+
* Updates an OCaml .opam file
|
|
5
|
+
*/
|
|
6
|
+
export declare class Opam extends DefaultUpdater {
|
|
7
|
+
/**
|
|
8
|
+
* Given initial file contents, return updated contents.
|
|
9
|
+
* @param {string} content The initial content
|
|
10
|
+
* @returns {string} The updated content
|
|
11
|
+
*/
|
|
12
|
+
updateContent(content: string, logger?: Logger): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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.Opam = void 0;
|
|
17
|
+
const logger_1 = require("../../util/logger");
|
|
18
|
+
const default_1 = require("../default");
|
|
19
|
+
/**
|
|
20
|
+
* Updates an OCaml .opam file
|
|
21
|
+
*/
|
|
22
|
+
class Opam extends default_1.DefaultUpdater {
|
|
23
|
+
/**
|
|
24
|
+
* Given initial file contents, return updated contents.
|
|
25
|
+
* @param {string} content The initial content
|
|
26
|
+
* @returns {string} The updated content
|
|
27
|
+
*/
|
|
28
|
+
updateContent(content, logger = logger_1.logger) {
|
|
29
|
+
const oldVersion = content.match(/^version: "([A-Za-z0-9_\-+.~]+)"$/m);
|
|
30
|
+
if (oldVersion) {
|
|
31
|
+
logger.info(`updating from ${oldVersion[1]} to ${this.version}`);
|
|
32
|
+
}
|
|
33
|
+
return content.replace(/^version: "[A-Za-z0-9_\-+.~]+"$/m, `version: "${this.version}"`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.Opam = Opam;
|
|
37
|
+
//# sourceMappingURL=opam.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DefaultUpdater } from '../default';
|
|
2
|
+
/**
|
|
3
|
+
* Updates a php file that has a constant VERSION defined.
|
|
4
|
+
*/
|
|
5
|
+
export declare class PHPClientVersion 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.PHPClientVersion = void 0;
|
|
17
|
+
const default_1 = require("../default");
|
|
18
|
+
/**
|
|
19
|
+
* Updates a php file that has a constant VERSION defined.
|
|
20
|
+
*/
|
|
21
|
+
class PHPClientVersion 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(/const VERSION = '[0-9]+\.[0-9]+\.[0-9]+'/, `const VERSION = '${this.version}'`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.PHPClientVersion = PHPClientVersion;
|
|
32
|
+
//# sourceMappingURL=php-client-version.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Logger } from '../../util/logger';
|
|
2
|
+
import { DefaultUpdater } from '../default';
|
|
3
|
+
/**
|
|
4
|
+
* Updates a root composer.json
|
|
5
|
+
*/
|
|
6
|
+
export declare class RootComposerUpdatePackages extends DefaultUpdater {
|
|
7
|
+
/**
|
|
8
|
+
* Given initial file contents, return updated contents.
|
|
9
|
+
* @param {string} content The initial content
|
|
10
|
+
* @returns {string} The updated content
|
|
11
|
+
*/
|
|
12
|
+
updateContent(content: string, logger?: Logger): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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.RootComposerUpdatePackages = void 0;
|
|
17
|
+
const logger_1 = require("../../util/logger");
|
|
18
|
+
const json_stringify_1 = require("../../util/json-stringify");
|
|
19
|
+
const default_1 = require("../default");
|
|
20
|
+
/**
|
|
21
|
+
* Updates a root composer.json
|
|
22
|
+
*/
|
|
23
|
+
class RootComposerUpdatePackages extends default_1.DefaultUpdater {
|
|
24
|
+
/**
|
|
25
|
+
* Given initial file contents, return updated contents.
|
|
26
|
+
* @param {string} content The initial content
|
|
27
|
+
* @returns {string} The updated content
|
|
28
|
+
*/
|
|
29
|
+
updateContent(content, logger = logger_1.logger) {
|
|
30
|
+
if (!this.version && (!this.versionsMap || this.versionsMap.size === 0)) {
|
|
31
|
+
logger.info('no updates necessary');
|
|
32
|
+
return content;
|
|
33
|
+
}
|
|
34
|
+
const parsed = JSON.parse(content);
|
|
35
|
+
if (parsed['version']) {
|
|
36
|
+
const fromVersion = parsed['version'];
|
|
37
|
+
const toVersion = this.version.toString() || '1.0.0';
|
|
38
|
+
parsed['version'] = toVersion;
|
|
39
|
+
logger.info(`updating "version" from ${fromVersion} to ${toVersion}`);
|
|
40
|
+
}
|
|
41
|
+
if (this.versionsMap) {
|
|
42
|
+
for (const [key, version] of this.versionsMap.entries()) {
|
|
43
|
+
const toVersion = version.toString() || '1.0.0';
|
|
44
|
+
let fromVersion;
|
|
45
|
+
if (parsed.replace) {
|
|
46
|
+
fromVersion = parsed.replace[key];
|
|
47
|
+
parsed.replace[key] = toVersion;
|
|
48
|
+
}
|
|
49
|
+
if (parsed[key]) {
|
|
50
|
+
fromVersion !== null && fromVersion !== void 0 ? fromVersion : (fromVersion = parsed[key]);
|
|
51
|
+
parsed[key] = toVersion;
|
|
52
|
+
}
|
|
53
|
+
logger.info(`updating ${key} from ${fromVersion} to ${toVersion}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.RootComposerUpdatePackages = RootComposerUpdatePackages;
|
|
60
|
+
//# sourceMappingURL=root-composer-update-packages.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Logger } from '../../util/logger';
|
|
2
|
+
import { DefaultUpdater } from '../default';
|
|
3
|
+
interface PyProjectContent {
|
|
4
|
+
name: string;
|
|
5
|
+
version: string;
|
|
6
|
+
dynamic?: string[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A subset of the contents of a `pyproject.toml`
|
|
10
|
+
*/
|
|
11
|
+
export interface PyProject {
|
|
12
|
+
project?: PyProjectContent;
|
|
13
|
+
tool?: {
|
|
14
|
+
poetry?: PyProjectContent;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare function parsePyProject(content: string): PyProject;
|
|
18
|
+
/**
|
|
19
|
+
* Updates a pyproject.toml file
|
|
20
|
+
*/
|
|
21
|
+
export declare class PyProjectToml extends 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: string, logger?: Logger): string;
|
|
28
|
+
}
|
|
29
|
+
export {};
|