renovate 44.115.2 → 44.115.4
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/dist/config/defaults.d.ts +2 -3
- package/dist/config/global.d.ts +1 -2
- package/dist/config/options/env-options.d.ts +3 -4
- package/dist/config/options/index.d.ts +1 -2
- package/dist/config/types.d.ts +63 -63
- package/dist/config/utils.d.ts +1 -2
- package/dist/config/validation-helpers/types.d.ts +2 -3
- package/dist/config-validator.d.ts +1 -0
- package/dist/constants/category.d.ts +2 -3
- package/dist/constants/error-messages.d.ts +57 -58
- package/dist/constants/platforms.d.ts +2 -3
- package/dist/instrumentation/types.d.ts +13 -14
- package/dist/logger/err-serializer.d.ts +1 -2
- package/dist/logger/index.d.ts +13 -14
- package/dist/logger/renovate-logger.d.ts +1 -2
- package/dist/logger/types.d.ts +7 -7
- package/dist/manager-list.generated.d.ts +2 -3
- package/dist/modules/datasource/common.d.ts +8 -9
- package/dist/modules/datasource/index.d.ts +9 -9
- package/dist/modules/datasource/npm/schema.d.ts +5 -6
- package/dist/modules/datasource/types.d.ts +12 -13
- package/dist/modules/manager/custom/jsonata/types.d.ts +2 -3
- package/dist/modules/manager/custom/regex/types.d.ts +2 -3
- package/dist/modules/manager/custom/types.d.ts +3 -4
- package/dist/modules/manager/fingerprint.generated.d.ts +1 -2
- package/dist/modules/manager/fingerprint.generated.js +1 -1
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/gomod/line-parser.js +2 -2
- package/dist/modules/manager/gomod/line-parser.js.map +1 -1
- package/dist/modules/manager/index.d.ts +12 -12
- package/dist/modules/manager/types.d.ts +26 -27
- package/dist/modules/platform/bitbucket/index.d.ts +28 -29
- package/dist/modules/platform/bitbucket-server/index.d.ts +33 -34
- package/dist/modules/platform/bitbucket-server/types.d.ts +1 -2
- package/dist/modules/platform/github/schema.d.ts +3 -4
- package/dist/modules/platform/gitlab/code-owners.d.ts +1 -2
- package/dist/modules/platform/gitlab/index.d.ts +37 -37
- package/dist/modules/platform/gitlab/types.d.ts +2 -3
- package/dist/modules/platform/index.d.ts +5 -5
- package/dist/modules/platform/scm-manager/index.js +1 -5
- package/dist/modules/platform/scm-manager/index.js.map +1 -1
- package/dist/modules/platform/types.d.ts +31 -34
- package/dist/modules/versioning/generic.d.ts +1 -2
- package/dist/modules/versioning/index.d.ts +5 -5
- package/dist/modules/versioning/semver-coerced/index.d.ts +7 -7
- package/dist/modules/versioning/types.d.ts +11 -12
- package/dist/modules/versioning/ubuntu/index.d.ts +6 -6
- package/dist/proxy.d.ts +2 -3
- package/dist/renovate.d.ts +1 -0
- package/dist/types/base.d.ts +2 -3
- package/dist/types/branch-status.d.ts +1 -2
- package/dist/types/commit-message-json.d.ts +1 -2
- package/dist/types/git.d.ts +2 -3
- package/dist/types/host-rules.d.ts +3 -4
- package/dist/types/index.d.ts +5 -5
- package/dist/types/pr-state.d.ts +1 -2
- package/dist/types/skip-reason.d.ts +2 -3
- package/dist/types/versioning.d.ts +1 -2
- package/dist/util/cache/package/backend.d.ts +9 -7
- package/dist/util/cache/package/index.d.ts +7 -8
- package/dist/util/cache/package/namespaces.d.ts +2 -3
- package/dist/util/cache/repository/types.d.ts +10 -11
- package/dist/util/compress.d.ts +4 -5
- package/dist/util/exec/common.d.ts +2 -3
- package/dist/util/exec/common.js +1 -1
- package/dist/util/exec/common.js.map +1 -1
- package/dist/util/exec/exec-error.d.ts +2 -3
- package/dist/util/exec/types.d.ts +30 -27
- package/dist/util/exec/types.js.map +1 -1
- package/dist/util/git/config.d.ts +1 -2
- package/dist/util/git/index.d.ts +56 -56
- package/dist/util/git/private-key.d.ts +1 -2
- package/dist/util/git/types.d.ts +13 -13
- package/dist/util/host-rules.d.ts +14 -15
- package/dist/util/http/cache/types.d.ts +1 -2
- package/dist/util/http/errors.d.ts +1 -2
- package/dist/util/http/github.d.ts +6 -7
- package/dist/util/http/gitlab.d.ts +3 -4
- package/dist/util/http/http.d.ts +3 -4
- package/dist/util/http/legacy.d.ts +1 -2
- package/dist/util/http/types.d.ts +20 -21
- package/dist/util/merge-confidence/common.d.ts +1 -2
- package/dist/util/merge-confidence/types.d.ts +1 -2
- package/dist/util/result.d.ts +2 -3
- package/dist/util/s3.d.ts +3 -4
- package/dist/util/schema-utils/git.d.ts +2 -3
- package/dist/util/string-match.d.ts +9 -10
- package/dist/util/timestamp.d.ts +4 -5
- package/dist/util/url.d.ts +18 -19
- package/dist/versioning-list.generated.d.ts +2 -3
- package/dist/workers/global/autodiscover.d.ts +2 -3
- package/dist/workers/global/config/parse/index.d.ts +2 -3
- package/dist/workers/repository/init/types.d.ts +3 -4
- package/dist/workers/repository/result.d.ts +4 -5
- package/dist/workers/repository/update/pr/changelog/types.d.ts +7 -8
- package/dist/workers/types.d.ts +17 -18
- package/package.json +4 -4
- package/renovate-schema.json +2 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region lib/util/cache/package/namespaces.d.ts
|
|
2
|
-
declare const packageCacheNamespaces: readonly ['_test-namespace', 'changelog-bitbucket-notes@v2', 'changelog-bitbucket-release', 'changelog-bitbucket-server-notes@v2', 'changelog-bitbucket-server-release', 'changelog-forgejo-notes@v2', 'changelog-forgejo-release', 'changelog-gitea-notes@v2', 'changelog-gitea-release', 'changelog-github-notes@v2', 'changelog-github-release', 'changelog-gitlab-notes@v2', 'changelog-gitlab-release', 'datasource-apk', 'datasource-artifactory', 'datasource-aws-machine-image', 'datasource-aws-rds', 'datasource-aws-eks-addon', 'datasource-azure-bicep-resource', 'datasource-azure-pipelines-tasks', 'datasource-azure-tags', 'datasource-bazel', 'datasource-bitbucket-tags', 'datasource-bitbucket-server-tags', 'datasource-bitrise', 'datasource-buildpacks-registry', 'datasource-cdnjs', 'datasource-conan', 'datasource-conda', 'datasource-cpan', 'datasource-crate-metadata', 'datasource-crate-registry-api', 'datasource-crate', 'datasource-deb', 'datasource-deno', 'datasource-docker-architecture', 'datasource-docker-hub-cache', 'datasource-docker-digest', 'datasource-docker-hub-tags', 'datasource-docker-imageconfig', 'datasource-docker-labels', 'datasource-docker-releases-v2', 'datasource-docker-tags', 'datasource-dotnet-version', 'datasource-elm-package', 'datasource-endoflife-date', 'datasource-galaxy-collection', 'datasource-galaxy', 'datasource-git-refs', 'datasource-git-tags', 'datasource-git', 'datasource-forgejo-releases', 'datasource-forgejo-tags', 'datasource-gitea-releases', 'datasource-gitea-tags', 'datasource-github-digest', 'datasource-github-release-attachments', 'datasource-gitlab-packages', 'datasource-gitlab-releases', 'datasource-gitlab-tags', 'datasource-glasskube-packages', 'datasource-go-direct', 'datasource-go-proxy-timestamps', 'datasource-go-proxy', 'datasource-go', 'datasource-golang-version', 'datasource-gradle-version', 'datasource-helm', 'datasource-hermit', 'datasource-hex', 'datasource-hexpm-bob', 'datasource-java-version', 'datasource-jenkins-plugins', 'datasource-jsr', 'datasource-maven:cache-provider', 'datasource-maven:metadata-not-found', 'datasource-maven:pom-cache-provider', 'datasource-maven:postprocess-reject', 'datasource-nextcloud', 'datasource-node-version', 'datasource-npm:cache-provider', 'datasource-nuget-v3', 'datasource-orb', 'datasource-packagist', 'datasource-pod', 'datasource-python-version', 'datasource-repology', 'datasource-rpm', 'datasource-ruby-version', 'datasource-rubygems', 'datasource-rust-version', 'datasource-sbt-package', 'datasource-terraform-module', 'datasource-terraform-provider', 'datasource-terraform', 'datasource-typst:cache-provider', 'datasource-typst:registry-releases', 'datasource-unity3d', 'datasource-unity3d-packages', 'github-branches-datasource-v1', 'github-releases-datasource-v2', 'github-tags-datasource-v2', 'merge-confidence', 'preset', 'terraform-provider-hash', 'url-sha256'];
|
|
3
|
-
type PackageCacheNamespace = (typeof packageCacheNamespaces)[number] | `datasource-releases-${string}`;
|
|
2
|
+
export declare const packageCacheNamespaces: readonly ['_test-namespace', 'changelog-bitbucket-notes@v2', 'changelog-bitbucket-release', 'changelog-bitbucket-server-notes@v2', 'changelog-bitbucket-server-release', 'changelog-forgejo-notes@v2', 'changelog-forgejo-release', 'changelog-gitea-notes@v2', 'changelog-gitea-release', 'changelog-github-notes@v2', 'changelog-github-release', 'changelog-gitlab-notes@v2', 'changelog-gitlab-release', 'datasource-apk', 'datasource-artifactory', 'datasource-aws-machine-image', 'datasource-aws-rds', 'datasource-aws-eks-addon', 'datasource-azure-bicep-resource', 'datasource-azure-pipelines-tasks', 'datasource-azure-tags', 'datasource-bazel', 'datasource-bitbucket-tags', 'datasource-bitbucket-server-tags', 'datasource-bitrise', 'datasource-buildpacks-registry', 'datasource-cdnjs', 'datasource-conan', 'datasource-conda', 'datasource-cpan', 'datasource-crate-metadata', 'datasource-crate-registry-api', 'datasource-crate', 'datasource-deb', 'datasource-deno', 'datasource-docker-architecture', 'datasource-docker-hub-cache', 'datasource-docker-digest', 'datasource-docker-hub-tags', 'datasource-docker-imageconfig', 'datasource-docker-labels', 'datasource-docker-releases-v2', 'datasource-docker-tags', 'datasource-dotnet-version', 'datasource-elm-package', 'datasource-endoflife-date', 'datasource-galaxy-collection', 'datasource-galaxy', 'datasource-git-refs', 'datasource-git-tags', 'datasource-git', 'datasource-forgejo-releases', 'datasource-forgejo-tags', 'datasource-gitea-releases', 'datasource-gitea-tags', 'datasource-github-digest', 'datasource-github-release-attachments', 'datasource-gitlab-packages', 'datasource-gitlab-releases', 'datasource-gitlab-tags', 'datasource-glasskube-packages', 'datasource-go-direct', 'datasource-go-proxy-timestamps', 'datasource-go-proxy', 'datasource-go', 'datasource-golang-version', 'datasource-gradle-version', 'datasource-helm', 'datasource-hermit', 'datasource-hex', 'datasource-hexpm-bob', 'datasource-java-version', 'datasource-jenkins-plugins', 'datasource-jsr', 'datasource-maven:cache-provider', 'datasource-maven:metadata-not-found', 'datasource-maven:pom-cache-provider', 'datasource-maven:postprocess-reject', 'datasource-nextcloud', 'datasource-node-version', 'datasource-npm:cache-provider', 'datasource-nuget-v3', 'datasource-orb', 'datasource-packagist', 'datasource-pod', 'datasource-python-version', 'datasource-repology', 'datasource-rpm', 'datasource-ruby-version', 'datasource-rubygems', 'datasource-rust-version', 'datasource-sbt-package', 'datasource-terraform-module', 'datasource-terraform-provider', 'datasource-terraform', 'datasource-typst:cache-provider', 'datasource-typst:registry-releases', 'datasource-unity3d', 'datasource-unity3d-packages', 'github-branches-datasource-v1', 'github-releases-datasource-v2', 'github-tags-datasource-v2', 'merge-confidence', 'preset', 'terraform-provider-hash', 'url-sha256'];
|
|
3
|
+
export type PackageCacheNamespace = (typeof packageCacheNamespaces)[number] | `datasource-releases-${string}`;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { PackageCacheNamespace, packageCacheNamespaces };
|
|
6
5
|
//# sourceMappingURL=namespaces.d.ts.map
|
|
@@ -3,14 +3,14 @@ import { PrBlockedBy } from "../../../workers/types.js";
|
|
|
3
3
|
import { PackageFile } from "../../../modules/manager/types.js";
|
|
4
4
|
import { RepositoryCacheConfig, RepositoryCacheType, UpdateType } from "../../../config/types.js";
|
|
5
5
|
//#region lib/util/cache/repository/types.d.ts
|
|
6
|
-
interface BaseBranchCache {
|
|
6
|
+
export interface BaseBranchCache {
|
|
7
7
|
revision?: number;
|
|
8
8
|
sha: string;
|
|
9
9
|
configHash: string;
|
|
10
10
|
extractionFingerprints: Record<string, string | undefined>;
|
|
11
11
|
packageFiles: Record<string, PackageFile[]>;
|
|
12
12
|
}
|
|
13
|
-
interface BranchUpgradeCache {
|
|
13
|
+
export interface BranchUpgradeCache {
|
|
14
14
|
currentDigest?: string;
|
|
15
15
|
currentValue?: string;
|
|
16
16
|
datasource?: string;
|
|
@@ -30,7 +30,7 @@ interface BranchUpgradeCache {
|
|
|
30
30
|
updateType?: UpdateType;
|
|
31
31
|
isVulnerabilityAlert?: boolean;
|
|
32
32
|
}
|
|
33
|
-
interface OnboardingBranchCache {
|
|
33
|
+
export interface OnboardingBranchCache {
|
|
34
34
|
defaultBranchSha: string;
|
|
35
35
|
onboardingBranchSha: string;
|
|
36
36
|
isConflicted: boolean;
|
|
@@ -38,14 +38,14 @@ interface OnboardingBranchCache {
|
|
|
38
38
|
configFileName?: string;
|
|
39
39
|
configFileParsed?: string;
|
|
40
40
|
}
|
|
41
|
-
interface ReconfigureBranchCache {
|
|
41
|
+
export interface ReconfigureBranchCache {
|
|
42
42
|
reconfigureBranchSha: string;
|
|
43
43
|
isConfigValid: boolean;
|
|
44
44
|
extractionSucceeded?: boolean;
|
|
45
45
|
/** @deprecated Written by earlier versions, migrated to `extractionSucceeded` when the cache is read. */
|
|
46
46
|
extractResult?: unknown;
|
|
47
47
|
}
|
|
48
|
-
interface PrCache {
|
|
48
|
+
export interface PrCache {
|
|
49
49
|
/**
|
|
50
50
|
* Fingerprint of the PR body
|
|
51
51
|
*/
|
|
@@ -56,7 +56,7 @@ interface PrCache {
|
|
|
56
56
|
*/
|
|
57
57
|
lastEdited: string;
|
|
58
58
|
}
|
|
59
|
-
interface BranchCache {
|
|
59
|
+
export interface BranchCache {
|
|
60
60
|
/**
|
|
61
61
|
* Whether this branch has automerge enabled
|
|
62
62
|
*/
|
|
@@ -125,14 +125,14 @@ interface BranchCache {
|
|
|
125
125
|
/**
|
|
126
126
|
* Repository cache shared by the platforms which speak the Gitea API.
|
|
127
127
|
*/
|
|
128
|
-
interface GiteaLikePlatformCache {
|
|
128
|
+
export interface GiteaLikePlatformCache {
|
|
129
129
|
/**
|
|
130
130
|
* To avoid circular dependency problem, we use `unknown` type here.
|
|
131
131
|
*/
|
|
132
132
|
pullRequestsCache?: unknown;
|
|
133
133
|
orgs?: Record<string, boolean>;
|
|
134
134
|
}
|
|
135
|
-
interface RepoCacheData {
|
|
135
|
+
export interface RepoCacheData {
|
|
136
136
|
configFileName?: string;
|
|
137
137
|
httpCache?: Record<string, unknown>;
|
|
138
138
|
httpCacheHead?: Record<string, unknown>;
|
|
@@ -166,18 +166,17 @@ interface RepoCacheData {
|
|
|
166
166
|
onboardingBranchCache?: OnboardingBranchCache;
|
|
167
167
|
reconfigureBranchCache?: ReconfigureBranchCache;
|
|
168
168
|
}
|
|
169
|
-
interface RepoCache {
|
|
169
|
+
export interface RepoCache {
|
|
170
170
|
load(): Promise<void>;
|
|
171
171
|
save(): Promise<void>;
|
|
172
172
|
getData(): RepoCacheData;
|
|
173
173
|
isModified(): boolean | undefined;
|
|
174
174
|
}
|
|
175
|
-
interface RepoCacheConfig {
|
|
175
|
+
export interface RepoCacheConfig {
|
|
176
176
|
repository?: string;
|
|
177
177
|
repositoryCache?: RepositoryCacheConfig;
|
|
178
178
|
repositoryCacheType?: RepositoryCacheType;
|
|
179
179
|
repoFingerprint: string;
|
|
180
180
|
}
|
|
181
181
|
//#endregion
|
|
182
|
-
export { BaseBranchCache, BranchCache, BranchUpgradeCache, GiteaLikePlatformCache, OnboardingBranchCache, PrCache, ReconfigureBranchCache, RepoCache, RepoCacheConfig, RepoCacheData };
|
|
183
182
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/util/compress.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
//#region lib/util/compress.d.ts
|
|
2
|
-
declare function compressToBuffer(input: string, quality?: number): Promise<Buffer>;
|
|
3
|
-
declare function decompressFromBuffer(input: Buffer): Promise<string>;
|
|
4
|
-
declare function compressToBase64(input: string): Promise<string>;
|
|
5
|
-
declare function decompressFromBase64(input: string): Promise<string>;
|
|
2
|
+
export declare function compressToBuffer(input: string, quality?: number): Promise<Buffer>;
|
|
3
|
+
export declare function decompressFromBuffer(input: Buffer): Promise<string>;
|
|
4
|
+
export declare function compressToBase64(input: string): Promise<string>;
|
|
5
|
+
export declare function decompressFromBase64(input: string): Promise<string>;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { compressToBase64, compressToBuffer, decompressFromBase64, decompressFromBuffer };
|
|
8
7
|
//# sourceMappingURL=compress.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CommandWithOptions, ExecResult, RawExecOptions } from "./types.js";
|
|
2
2
|
//#region lib/util/exec/common.d.ts
|
|
3
|
-
declare function exec(commandArgument: string | CommandWithOptions, opts: RawExecOptions): Promise<ExecResult>;
|
|
4
|
-
declare function rawExec(cmd: string | CommandWithOptions, opts: RawExecOptions): Promise<ExecResult>;
|
|
3
|
+
export declare function exec(commandArgument: string | CommandWithOptions, opts: RawExecOptions): Promise<ExecResult>;
|
|
4
|
+
export declare function rawExec(cmd: string | CommandWithOptions, opts: RawExecOptions): Promise<ExecResult>;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { exec, rawExec };
|
|
7
6
|
//# sourceMappingURL=common.d.ts.map
|
package/dist/util/exec/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","names":[],"sources":["../../../lib/util/exec/common.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process';\nimport type { Readable } from 'node:stream';\nimport { isNullOrUndefined } from '@sindresorhus/is';\nimport { execa } from 'execa';\nimport { join, split } from 'shlex';\nimport { instrument } from '../../instrumentation/index.ts';\nimport { logger } from '../../logger/index.ts';\nimport { getEnv } from '../env.ts';\nimport { sanitize } from '../sanitize.ts';\nimport type { ExecErrorData } from './exec-error.ts';\nimport { ExecError } from './exec-error.ts';\nimport type {\n CommandWithOptions,\n DataListener,\n ExecResult,\n OutputWriter,\n RawExecOptions,\n} from './types.ts';\nimport { asRawCommand, isCommandWithOptions } from './utils.ts';\n\n// https://man7.org/linux/man-pages/man7/signal.7.html#NAME\n// Non TERM/CORE signals\n// The following is step 3. in https://github.com/renovatebot/renovate/issues/16197#issuecomment-1171423890\nconst NONTERM = [\n 'SIGCHLD',\n 'SIGCLD',\n 'SIGCONT',\n 'SIGSTOP',\n 'SIGTSTP',\n 'SIGTTIN',\n 'SIGTTOU',\n 'SIGURG',\n 'SIGWINCH',\n];\n\nconst encoding = 'utf8';\n\nfunction stringify(list: Buffer[], writer: OutputWriter | undefined): string {\n return writer?.toString() ?? Buffer.concat(list).toString(encoding);\n}\n\nfunction initStreamListeners(\n cp: ChildProcess,\n opts: RawExecOptions & { maxBuffer: number },\n): [Buffer[], Buffer[]] {\n const stdout: Buffer[] = [];\n const stderr: Buffer[] = [];\n let stdoutLen = 0;\n let stderrLen = 0;\n\n registerDataListeners(cp.stdout, opts.outputListeners?.stdout);\n registerDataListeners(cp.stderr, opts.outputListeners?.stderr);\n\n cp.stdout?.on('data', (chunk: Buffer) => {\n // process.stdout.write(data.toString());\n if (opts.outputWriters?.stdout) {\n opts.outputWriters.stdout.write(chunk);\n return;\n }\n\n const len = Buffer.byteLength(chunk, encoding);\n stdoutLen += len;\n if (stdoutLen > opts.maxBuffer) {\n cp.emit('error', new Error('stdout maxBuffer exceeded'));\n } else {\n stdout.push(chunk);\n }\n });\n\n cp.stderr?.on('data', (chunk: Buffer) => {\n // process.stderr.write(data.toString());\n if (opts.outputWriters?.stderr) {\n opts.outputWriters.stderr.write(chunk);\n return;\n }\n\n const len = Buffer.byteLength(chunk, encoding);\n stderrLen += len;\n if (stderrLen > opts.maxBuffer) {\n cp.emit('error', new Error('stderr maxBuffer exceeded'));\n } else {\n stderr.push(chunk);\n }\n });\n return [stdout, stderr];\n}\n\nfunction registerDataListeners(\n readable: Readable | null,\n dataListeners: DataListener[] | undefined,\n): void {\n if (isNullOrUndefined(readable) || isNullOrUndefined(dataListeners)) {\n return;\n }\n\n for (const listener of dataListeners) {\n readable.on('data', listener);\n }\n}\n\nexport function exec(\n commandArgument: string | CommandWithOptions,\n opts: RawExecOptions,\n): Promise<ExecResult> {\n let theCmd = commandArgument;\n let ignoreFailure = false;\n if (isCommandWithOptions(commandArgument)) {\n theCmd = join(commandArgument.command);\n if (commandArgument.ignoreFailure !== undefined) {\n ignoreFailure = commandArgument.ignoreFailure;\n }\n }\n\n return new Promise((resolve, reject) => {\n let cmd = asRawCommand(theCmd);\n let args: string[] = [];\n const maxBuffer = opts.maxBuffer ?? 10 * 1024 * 1024; // Set default max buffer size to 10MB\n\n // don't use shell by default, as it leads to potential security issues\n let shell = opts.shell ?? false;\n if (\n isCommandWithOptions(commandArgument) &&\n commandArgument.shell !== undefined\n ) {\n shell = commandArgument.shell;\n }\n\n // if we're not in shell mode, we need to provide the command and arguments\n if (shell === false) {\n const parts = split(cmd);\n // v8 ignore else -- TODO: add test #40625\n if (parts) {\n cmd = parts[0];\n args = parts.slice(1);\n }\n }\n\n const cp = execa(cmd, args, {\n ...opts,\n // force detached on non WIN platforms\n // https://github.com/nodejs/node/issues/21825#issuecomment-611328888\n detached: process.platform !== 'win32',\n shell,\n extendEnv: false,\n // Suppress execa's internal promise rejection (e.g., from timeout).\n // We handle all exit scenarios via 'exit' and 'error' event listeners below,\n // so the promise rejection would otherwise surface as an unhandledRejection.\n // TODO: Refactor to await execa result (#45650)\n reject: false,\n });\n\n // handle streams\n const [stdout, stderr] = initStreamListeners(cp, {\n ...opts,\n maxBuffer,\n });\n\n // handle process events\n void cp.on('error', (error) => {\n kill(cp, 'SIGTERM');\n // rethrowing, use originally emitted error message\n reject(new ExecError(error.message, rejectInfo(), error));\n });\n\n void cp.on('exit', (code: number, signal: NodeJS.Signals) => {\n if (NONTERM.includes(signal)) {\n return;\n }\n if (signal) {\n kill(cp, signal);\n reject(\n new ExecError(\n `Command failed: ${cp.spawnargs.join(' ')}\\nInterrupted by ${signal}`,\n {\n ...rejectInfo(),\n signal,\n },\n ),\n );\n return;\n }\n if (code !== 0) {\n if (ignoreFailure === undefined || ignoreFailure === false) {\n reject(\n new ExecError(\n `Command failed: ${cp.spawnargs.join(' ')}\\n${stringify(stderr, opts.outputWriters?.stderr)}`,\n {\n ...rejectInfo(),\n exitCode: code,\n },\n ),\n );\n return;\n }\n\n logger.once.debug(\n {\n command: cp.spawnargs.join(' '),\n stdout: stringify(stdout, opts.outputWriters?.stdout),\n stderr: stringify(stderr, opts.outputWriters?.stderr),\n exitCode: code,\n },\n `Ignoring failure to execute comamnd \\`${cp.spawnargs.join(' ')}\\`, as ignoreFailure=true is set`,\n );\n\n resolve({\n stderr: stringify(stderr, opts.outputWriters?.stderr),\n stdout: stringify(stdout, opts.outputWriters?.stdout),\n exitCode: code,\n });\n return;\n }\n resolve({\n stderr: stringify(stderr, opts.outputWriters?.stderr),\n stdout: stringify(stdout, opts.outputWriters?.stdout),\n });\n });\n\n function rejectInfo(): ExecErrorData {\n return {\n cmd: cp.spawnargs.join(' '),\n options: opts,\n stdout: stringify(stdout, opts.outputWriters?.stdout),\n stderr: stringify(stderr, opts.outputWriters?.stderr),\n };\n }\n });\n}\n\nfunction kill(cp: ChildProcess, signal: NodeJS.Signals): boolean {\n try {\n if (cp.pid && getEnv().RENOVATE_X_EXEC_GPID_HANDLE) {\n /**\n * If `pid` is negative, but not `-1`, signal shall be sent to all processes\n * (excluding an unspecified set of system processes),\n * whose process group ID (pgid) is equal to the absolute value of pid,\n * and for which the process has permission to send a signal.\n */\n return process.kill(-cp.pid, signal);\n }\n // destroying stdio is needed for unref to work\n // https://nodejs.org/api/child_process.html#subprocessunref\n // https://github.com/nodejs/node/blob/4d5ff25a813fd18939c9f76b17e36291e3ea15c3/lib/child_process.js#L412-L426\n cp.stderr?.destroy();\n cp.stdout?.destroy();\n cp.unref();\n return cp.kill(signal);\n } catch {\n // cp is a single node tree, therefore -pid is invalid as there is no such pgid,\n return false;\n }\n}\n\nexport function rawExec(\n cmd: string | CommandWithOptions,\n opts: RawExecOptions,\n): Promise<ExecResult> {\n return instrument(`rawExec: ${sanitize(asRawCommand(cmd))}`, () =>\n exec(cmd, opts),\n );\n}\n"],"mappings":";;;;;;;;;;AAuBA,MAAM,UAAU;CACd;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,WAAW;AAEjB,SAAS,UAAU,MAAgB,QAA0C;CAC3E,OAAO,QAAQ,SAAS,KAAK,OAAO,OAAO,IAAI,CAAC,CAAC,SAAS,QAAQ;AACpE;AAEA,SAAS,oBACP,IACA,MACsB;CACtB,MAAM,SAAmB,CAAC;CAC1B,MAAM,SAAmB,CAAC;CAC1B,IAAI,YAAY;CAChB,IAAI,YAAY;CAEhB,sBAAsB,GAAG,QAAQ,KAAK,iBAAiB,MA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eAAe,MAAM;KACpD,UAAU;IACZ,CAAC;IACD;GACF;GACA,QAAQ;IACN,QAAQ,UAAU,QAAQ,KAAK,eAAe,MAAM;IACpD,QAAQ,UAAU,QAAQ,KAAK,eAAe,MAAM;GACtD,CAAC;EACH,CAAC;EAED,SAAS,aAA4B;GACnC,OAAO;IACL,KAAK,GAAG,UAAU,KAAK,GAAG;IAC1B,SAAS;IACT,QAAQ,UAAU,QAAQ,KAAK,eAAe,MAAM;IACpD,QAAQ,UAAU,QAAQ,KAAK,eAAe,MAAM;GACtD;EACF;CACF,CAAC;AACH;AAEA,SAAS,KAAK,IAAkB,QAAiC;CAC/D,IAAI;EACF,IAAI,GAAG,OAAO,OAAO,CAAC,CAAC;;;;;;;EAOrB,OAAO,QAAQ,KAAK,CAAC,GAAG,KAAK,MAAM;EAKrC,GAAG,QAAQ,QAAQ;EACnB,GAAG,QAAQ,QAAQ;EACnB,GAAG,MAAM;EACT,OAAO,GAAG,KAAK,MAAM;CACvB,QAAQ;EAEN,OAAO;CACT;AACF;AAEA,SAAgB,QACd,KACA,MACqB;CACrB,OAAO,WAAW,YAAY,SAAS,aAAa,GAAG,CAAC,WACtD,KAAK,KAAK,IAAI,CAChB;AACF"}
|
|
1
|
+
{"version":3,"file":"common.js","names":[],"sources":["../../../lib/util/exec/common.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process';\nimport type { Readable } from 'node:stream';\nimport { isNullOrUndefined } from '@sindresorhus/is';\nimport { execa } from 'execa';\nimport { join, split } from 'shlex';\nimport { instrument } from '../../instrumentation/index.ts';\nimport { logger } from '../../logger/index.ts';\nimport { getEnv } from '../env.ts';\nimport { sanitize } from '../sanitize.ts';\nimport type { ExecErrorData } from './exec-error.ts';\nimport { ExecError } from './exec-error.ts';\nimport type {\n CommandWithOptions,\n DataListener,\n ExecResult,\n OutputWriter,\n RawExecOptions,\n} from './types.ts';\nimport { asRawCommand, isCommandWithOptions } from './utils.ts';\n\n// https://man7.org/linux/man-pages/man7/signal.7.html#NAME\n// Non TERM/CORE signals\n// The following is step 3. in https://github.com/renovatebot/renovate/issues/16197#issuecomment-1171423890\nconst NONTERM = [\n 'SIGCHLD',\n 'SIGCLD',\n 'SIGCONT',\n 'SIGSTOP',\n 'SIGTSTP',\n 'SIGTTIN',\n 'SIGTTOU',\n 'SIGURG',\n 'SIGWINCH',\n];\n\nconst encoding = 'utf8';\n\nfunction stringify(list: Buffer[], writer: OutputWriter | undefined): string {\n return writer?.toString() ?? Buffer.concat(list).toString(encoding);\n}\n\nfunction initStreamListeners(\n cp: ChildProcess,\n opts: RawExecOptions & { maxBuffer: number },\n): [Buffer[], Buffer[]] {\n const stdout: Buffer[] = [];\n const stderr: Buffer[] = [];\n let stdoutLen = 0;\n let stderrLen = 0;\n\n registerDataListeners(cp.stdout, opts.outputListeners?.stdout);\n registerDataListeners(cp.stderr, opts.outputListeners?.stderr);\n\n cp.stdout?.on('data', (chunk: Buffer) => {\n // process.stdout.write(data.toString());\n if (opts.outputWriters?.stdout) {\n opts.outputWriters.stdout.write(chunk);\n return;\n }\n\n const len = Buffer.byteLength(chunk, encoding);\n stdoutLen += len;\n if (stdoutLen > opts.maxBuffer) {\n cp.emit('error', new Error('stdout maxBuffer exceeded'));\n } else {\n stdout.push(chunk);\n }\n });\n\n cp.stderr?.on('data', (chunk: Buffer) => {\n // process.stderr.write(data.toString());\n if (opts.outputWriters?.stderr) {\n opts.outputWriters.stderr.write(chunk);\n return;\n }\n\n const len = Buffer.byteLength(chunk, encoding);\n stderrLen += len;\n if (stderrLen > opts.maxBuffer) {\n cp.emit('error', new Error('stderr maxBuffer exceeded'));\n } else {\n stderr.push(chunk);\n }\n });\n return [stdout, stderr];\n}\n\nfunction registerDataListeners(\n readable: Readable | null,\n dataListeners: DataListener[] | undefined,\n): void {\n if (isNullOrUndefined(readable) || isNullOrUndefined(dataListeners)) {\n return;\n }\n\n for (const listener of dataListeners) {\n readable.on('data', listener);\n }\n}\n\nexport function exec(\n commandArgument: string | CommandWithOptions,\n opts: RawExecOptions,\n): Promise<ExecResult> {\n let theCmd = commandArgument;\n let ignoreFailure = false;\n if (isCommandWithOptions(commandArgument)) {\n theCmd = join(commandArgument.command);\n if (commandArgument.ignoreFailure !== undefined) {\n ignoreFailure = commandArgument.ignoreFailure;\n }\n }\n\n return new Promise((resolve, reject) => {\n let cmd = asRawCommand(theCmd);\n let args: string[] = [];\n const maxBuffer = opts.maxBuffer ?? 10 * 1024 * 1024; // Set default max buffer size to 10MB\n\n // don't use shell by default, as it leads to potential security issues\n let shell = opts.shell ?? false;\n if (\n isCommandWithOptions(commandArgument) &&\n commandArgument.shell !== undefined\n ) {\n shell = commandArgument.shell;\n }\n\n // if we're not in shell mode, we need to provide the command and arguments\n if (shell === false) {\n const parts = split(cmd);\n // v8 ignore else -- TODO: add test #40625\n if (parts) {\n cmd = parts[0];\n args = parts.slice(1);\n }\n }\n\n const subprocess = execa(cmd, args, {\n ...opts,\n // force detached on non WIN platforms\n // https://github.com/nodejs/node/issues/21825#issuecomment-611328888\n detached: process.platform !== 'win32',\n shell,\n extendEnv: false,\n // Suppress execa's internal promise rejection (e.g., from timeout).\n // We handle all exit scenarios via 'exit' and 'error' event listeners below,\n // so the promise rejection would otherwise surface as an unhandledRejection.\n // TODO: Refactor to await execa result (#45650)\n reject: false,\n });\n const cp = subprocess.nodeChildProcess;\n\n // handle streams\n const [stdout, stderr] = initStreamListeners(cp, {\n ...opts,\n maxBuffer,\n });\n\n // handle process events\n void cp.on('error', (error) => {\n kill(cp, 'SIGTERM');\n // rethrowing, use originally emitted error message\n reject(new ExecError(error.message, rejectInfo(), error));\n });\n\n void cp.on('exit', (code: number, signal: NodeJS.Signals) => {\n if (NONTERM.includes(signal)) {\n return;\n }\n if (signal) {\n kill(cp, signal);\n reject(\n new ExecError(\n `Command failed: ${cp.spawnargs.join(' ')}\\nInterrupted by ${signal}`,\n {\n ...rejectInfo(),\n signal,\n },\n ),\n );\n return;\n }\n if (code !== 0) {\n if (ignoreFailure === undefined || ignoreFailure === false) {\n reject(\n new ExecError(\n `Command failed: ${cp.spawnargs.join(' ')}\\n${stringify(stderr, opts.outputWriters?.stderr)}`,\n {\n ...rejectInfo(),\n exitCode: code,\n },\n ),\n );\n return;\n }\n\n logger.once.debug(\n {\n command: cp.spawnargs.join(' '),\n stdout: stringify(stdout, opts.outputWriters?.stdout),\n stderr: stringify(stderr, opts.outputWriters?.stderr),\n exitCode: code,\n },\n `Ignoring failure to execute comamnd \\`${cp.spawnargs.join(' ')}\\`, as ignoreFailure=true is set`,\n );\n\n resolve({\n stderr: stringify(stderr, opts.outputWriters?.stderr),\n stdout: stringify(stdout, opts.outputWriters?.stdout),\n exitCode: code,\n });\n return;\n }\n resolve({\n stderr: stringify(stderr, opts.outputWriters?.stderr),\n stdout: stringify(stdout, opts.outputWriters?.stdout),\n });\n });\n\n function rejectInfo(): ExecErrorData {\n return {\n cmd: cp.spawnargs.join(' '),\n options: opts,\n stdout: stringify(stdout, opts.outputWriters?.stdout),\n stderr: stringify(stderr, opts.outputWriters?.stderr),\n };\n }\n });\n}\n\nfunction kill(cp: ChildProcess, signal: NodeJS.Signals): boolean {\n try {\n if (cp.pid && getEnv().RENOVATE_X_EXEC_GPID_HANDLE) {\n /**\n * If `pid` is negative, but not `-1`, signal shall be sent to all processes\n * (excluding an unspecified set of system processes),\n * whose process group ID (pgid) is equal to the absolute value of pid,\n * and for which the process has permission to send a signal.\n */\n return process.kill(-cp.pid, signal);\n }\n // destroying stdio is needed for unref to work\n // https://nodejs.org/api/child_process.html#subprocessunref\n // https://github.com/nodejs/node/blob/4d5ff25a813fd18939c9f76b17e36291e3ea15c3/lib/child_process.js#L412-L426\n cp.stderr?.destroy();\n cp.stdout?.destroy();\n cp.unref();\n return cp.kill(signal);\n } catch {\n // cp is a single node tree, therefore -pid is invalid as there is no such pgid,\n return false;\n }\n}\n\nexport function rawExec(\n cmd: string | CommandWithOptions,\n opts: RawExecOptions,\n): Promise<ExecResult> {\n return instrument(`rawExec: ${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
1
1
|
import { RawExecOptions } from "./types.js";
|
|
2
2
|
//#region lib/util/exec/exec-error.d.ts
|
|
3
|
-
interface ExecErrorData {
|
|
3
|
+
export interface ExecErrorData {
|
|
4
4
|
cmd: string;
|
|
5
5
|
stderr: string;
|
|
6
6
|
stdout: string;
|
|
@@ -8,7 +8,7 @@ interface ExecErrorData {
|
|
|
8
8
|
exitCode?: number;
|
|
9
9
|
signal?: NodeJS.Signals;
|
|
10
10
|
}
|
|
11
|
-
declare class ExecError extends Error {
|
|
11
|
+
export declare class ExecError extends Error {
|
|
12
12
|
cmd: string;
|
|
13
13
|
stderr: string;
|
|
14
14
|
stdout: string;
|
|
@@ -19,5 +19,4 @@ declare class ExecError extends Error {
|
|
|
19
19
|
constructor(message: string, data: ExecErrorData, err?: Error);
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
|
-
export { ExecError, ExecErrorData };
|
|
23
22
|
//# sourceMappingURL=exec-error.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VersioningName } from "../../versioning-list.generated.js";
|
|
2
2
|
import { Options } from "execa";
|
|
3
3
|
//#region lib/util/exec/types.d.ts
|
|
4
|
-
interface ConstraintDefinition {
|
|
4
|
+
export interface ConstraintDefinition {
|
|
5
5
|
name: string;
|
|
6
6
|
description?: string;
|
|
7
7
|
}
|
|
@@ -10,7 +10,7 @@ interface ConstraintDefinition {
|
|
|
10
10
|
*
|
|
11
11
|
* TODO #41849 replace with upstream types
|
|
12
12
|
*/
|
|
13
|
-
declare const toolDefinitions: [{
|
|
13
|
+
export declare const toolDefinitions: [{
|
|
14
14
|
readonly name: 'apm';
|
|
15
15
|
}, {
|
|
16
16
|
readonly name: 'bazelisk';
|
|
@@ -109,16 +109,16 @@ declare const toolDefinitions: [{
|
|
|
109
109
|
/**
|
|
110
110
|
* A `tool` that Containerbase supports.
|
|
111
111
|
*/
|
|
112
|
-
type ToolName = (typeof toolDefinitions)[number]['name'];
|
|
112
|
+
export type ToolName = (typeof toolDefinitions)[number]['name'];
|
|
113
113
|
/**
|
|
114
114
|
* A `tool` that Containerbase supports.
|
|
115
115
|
*/
|
|
116
|
-
declare const toolNames: ToolName[];
|
|
117
|
-
declare function isToolName(value: unknown): value is ToolName;
|
|
116
|
+
export declare const toolNames: ToolName[];
|
|
117
|
+
export declare function isToolName(value: unknown): value is ToolName;
|
|
118
118
|
/**
|
|
119
119
|
* Additional constraints that can be specified for some Managers, but are **not** tools that Containerbase supports, with optional description.
|
|
120
120
|
*/
|
|
121
|
-
declare const additionalConstraintDefinitions: [{
|
|
121
|
+
export declare const additionalConstraintDefinitions: [{
|
|
122
122
|
readonly name: 'ghActionsLock';
|
|
123
123
|
readonly description: `Used in the \`github-actions\` manager to specify a release tag for the [\`github/gh-actions-lock\`](https://github.com/github/gh-actions-lock) \`gh\` CLI extension, which regenerates \`.github/workflows/actions.lock\`.
|
|
124
124
|
|
|
@@ -168,55 +168,59 @@ Must be prefixed with \`v\`.`;
|
|
|
168
168
|
/**
|
|
169
169
|
* Additional constraints that can be specified for some Managers, but are **not** tools that Containerbase supports.
|
|
170
170
|
*/
|
|
171
|
-
type AdditionalConstraintName = (typeof additionalConstraintDefinitions)[number]['name'];
|
|
171
|
+
export type AdditionalConstraintName = (typeof additionalConstraintDefinitions)[number]['name'];
|
|
172
172
|
/**
|
|
173
173
|
* Additional constraints that can be specified for some Managers, but are **not** tools that Containerbase supports.
|
|
174
174
|
*/
|
|
175
|
-
declare const additionalConstraintNames: AdditionalConstraintName[];
|
|
176
|
-
declare function isAdditionalConstraintName(value: unknown): value is AdditionalConstraintName;
|
|
175
|
+
export declare const additionalConstraintNames: AdditionalConstraintName[];
|
|
176
|
+
export declare function isAdditionalConstraintName(value: unknown): value is AdditionalConstraintName;
|
|
177
177
|
/**
|
|
178
178
|
* A name usable as a key in a `constraints` record, which may be tools that Containerbase supports.
|
|
179
179
|
*/
|
|
180
|
-
type ConstraintName = ToolName | AdditionalConstraintName;
|
|
181
|
-
declare function isConstraintName(value: unknown): value is ConstraintName;
|
|
182
|
-
interface ToolConstraint {
|
|
180
|
+
export type ConstraintName = ToolName | AdditionalConstraintName;
|
|
181
|
+
export declare function isConstraintName(value: unknown): value is ConstraintName;
|
|
182
|
+
export interface ToolConstraint {
|
|
183
183
|
toolName: ToolName;
|
|
184
184
|
constraint?: string | null;
|
|
185
185
|
}
|
|
186
|
-
interface ToolConfig {
|
|
186
|
+
export interface ToolConfig {
|
|
187
187
|
datasource: string;
|
|
188
188
|
extractVersion?: string;
|
|
189
189
|
packageName: string;
|
|
190
190
|
versioning: VersioningName;
|
|
191
191
|
}
|
|
192
|
-
type Opt<T> = T | null | undefined;
|
|
193
|
-
type VolumesPair = [string, string];
|
|
194
|
-
type VolumeOption = Opt<string | VolumesPair>;
|
|
195
|
-
interface DockerOptions {
|
|
192
|
+
export type Opt<T> = T | null | undefined;
|
|
193
|
+
export type VolumesPair = [string, string];
|
|
194
|
+
export type VolumeOption = Opt<string | VolumesPair>;
|
|
195
|
+
export interface DockerOptions {
|
|
196
196
|
volumes?: Opt<VolumeOption[]>;
|
|
197
197
|
envVars?: Opt<Opt<string>[]>;
|
|
198
198
|
cwd?: Opt<string>;
|
|
199
199
|
}
|
|
200
|
-
type DataListener = (chunk: any) => void;
|
|
201
|
-
interface OutputListeners {
|
|
200
|
+
export type DataListener = (chunk: any) => void;
|
|
201
|
+
export interface OutputListeners {
|
|
202
202
|
stdout?: DataListener[];
|
|
203
203
|
stderr?: DataListener[];
|
|
204
204
|
}
|
|
205
|
-
interface OutputWriter {
|
|
205
|
+
export interface OutputWriter {
|
|
206
206
|
write(chunk: Buffer): void;
|
|
207
207
|
toString(): string;
|
|
208
208
|
}
|
|
209
|
-
interface OutputWriters {
|
|
209
|
+
export interface OutputWriters {
|
|
210
210
|
stdout?: OutputWriter;
|
|
211
211
|
stderr?: OutputWriter;
|
|
212
212
|
}
|
|
213
|
-
|
|
213
|
+
/** execa options producing text output, which excludes the binary encodings */
|
|
214
|
+
type TextExecaOptions = Extract<Options, {
|
|
215
|
+
readonly encoding?: 'utf8' | 'utf16le';
|
|
216
|
+
}>;
|
|
217
|
+
export interface RawExecOptions extends TextExecaOptions {
|
|
214
218
|
maxBuffer?: number | undefined;
|
|
215
219
|
cwd?: string;
|
|
216
220
|
outputListeners?: OutputListeners;
|
|
217
221
|
outputWriters?: OutputWriters;
|
|
218
222
|
}
|
|
219
|
-
interface ExecResult {
|
|
223
|
+
export interface ExecResult {
|
|
220
224
|
stdout: string;
|
|
221
225
|
stderr: string;
|
|
222
226
|
/**
|
|
@@ -227,8 +231,8 @@ interface ExecResult {
|
|
|
227
231
|
*/
|
|
228
232
|
exitCode?: number;
|
|
229
233
|
}
|
|
230
|
-
type ExtraEnv<T = unknown> = Record<string, T>;
|
|
231
|
-
interface ExecOptions {
|
|
234
|
+
export type ExtraEnv<T = unknown> = Record<string, T>;
|
|
235
|
+
export interface ExecOptions {
|
|
232
236
|
cwd?: string;
|
|
233
237
|
cwdFile?: string;
|
|
234
238
|
env?: Opt<ExtraEnv>;
|
|
@@ -244,7 +248,7 @@ interface ExecOptions {
|
|
|
244
248
|
/**
|
|
245
249
|
* configuration that can be configured on a per-command basis, that doesn't make sense to be on the `RawExecOptions`
|
|
246
250
|
*/
|
|
247
|
-
interface CommandWithOptions {
|
|
251
|
+
export interface CommandWithOptions {
|
|
248
252
|
command: string[];
|
|
249
253
|
/** do not throw errors when a command fails, but do log that an error occurred */
|
|
250
254
|
ignoreFailure?: boolean;
|
|
@@ -256,5 +260,4 @@ interface CommandWithOptions {
|
|
|
256
260
|
shell?: boolean | string;
|
|
257
261
|
}
|
|
258
262
|
//#endregion
|
|
259
|
-
export { AdditionalConstraintName, CommandWithOptions, ConstraintDefinition, ConstraintName, DataListener, DockerOptions, ExecOptions, ExecResult, ExtraEnv, Opt, OutputListeners, OutputWriter, OutputWriters, RawExecOptions, ToolConfig, ToolConstraint, ToolName, VolumeOption, VolumesPair, additionalConstraintDefinitions, additionalConstraintNames, isAdditionalConstraintName, isConstraintName, isToolName, toolDefinitions, toolNames };
|
|
260
263
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../lib/util/exec/types.ts"],"sourcesContent":["import { isString } from '@sindresorhus/is';\nimport type { Options as ExecaOptions } from 'execa';\nimport type { VersioningName } from '../../versioning-list.generated.ts';\n\nexport interface ConstraintDefinition {\n name: string;\n description?: string;\n}\n\n/**\n * A `tool` that Containerbase supports.\n *\n * TODO #41849 replace with upstream types\n */\nexport const toolDefinitions = [\n {\n name: 'apm',\n },\n {\n name: 'bazelisk',\n },\n {\n name: 'bun',\n },\n {\n name: 'bundler',\n },\n {\n name: 'cocoapods',\n },\n {\n name: 'composer',\n },\n {\n name: 'conan',\n },\n {\n name: 'copier',\n },\n {\n name: 'corepack',\n },\n {\n name: 'deno',\n },\n {\n name: 'devbox',\n },\n {\n name: 'dotnet',\n },\n {\n name: 'erlang',\n },\n {\n name: 'elixir',\n },\n {\n name: 'flux',\n },\n {\n name: 'gh',\n },\n {\n name: 'gleam',\n },\n {\n name: 'golang',\n },\n {\n name: 'gradle',\n },\n {\n name: 'hashin',\n },\n {\n name: 'helm',\n },\n {\n name: 'helmfile',\n },\n {\n name: 'java',\n },\n {\n name: 'java-maven',\n },\n {\n name: 'jb',\n },\n {\n name: 'kustomize',\n },\n {\n name: 'maven',\n },\n {\n name: 'mise',\n },\n {\n name: 'nix',\n },\n {\n name: 'node',\n },\n {\n name: 'npm',\n },\n {\n name: 'pdm',\n },\n {\n name: 'php',\n },\n {\n name: 'pip-tools',\n },\n {\n name: 'pipenv',\n },\n {\n name: 'pnpm',\n },\n {\n name: 'pixi',\n },\n {\n name: 'poetry',\n },\n {\n name: 'python',\n },\n {\n name: 'ruby',\n description: 'Also used in the `rubygems` Datasource',\n },\n {\n name: 'rust',\n },\n {\n name: 'uv',\n },\n {\n name: 'yarn',\n },\n {\n name: 'yarn-slim',\n },\n {\n name: 'dart',\n },\n {\n name: 'flutter',\n },\n {\n name: 'vendir',\n },\n] as const satisfies ConstraintDefinition[];\n\n/**\n * A `tool` that Containerbase supports.\n */\nexport type ToolName = (typeof toolDefinitions)[number]['name'];\n\n/**\n * A `tool` that Containerbase supports.\n */\nexport const toolNames: ToolName[] = toolDefinitions.map((t) => t.name);\n\nexport function isToolName(value: unknown): value is ToolName {\n return isString(value) && (toolNames as readonly string[]).includes(value);\n}\n\n/**\n * Additional constraints that can be specified for some Managers, but are **not** tools that Containerbase supports, with optional description.\n */\nexport const additionalConstraintDefinitions = [\n {\n name: 'ghActionsLock',\n description: `Used in the \\`github-actions\\` manager to specify a release tag for the [\\`github/gh-actions-lock\\`](https://github.com/github/gh-actions-lock) \\`gh\\` CLI extension, which regenerates \\`.github/workflows/actions.lock\\`.\n\nMust be a full release tag, prefixed with \\`v\\`, such as \\`v0.1.7\\`. Set it to an empty string to always install the latest release.`,\n },\n /**\n * @deprecated TODO remove in #42600\n */\n {\n name: 'go',\n description: `Used in the \\`gomod\\` manager to specify the version of the Go toolchain to use.\n\nIn precedence order:\n\n1. config: \\`constraints.go\\`\n1. \\`go.mod\\`: \\`toolchain\\` directive\n1. \\`go.mod\\`: \\`go\\` directive\n\nNOTE that the \\`constraints.golang\\` is not used (https://github.com/renovatebot/renovate/issues/42601)\n `,\n },\n {\n name: 'gomodMod',\n description: `Used in the \\`gomod\\` manager to specify a tag for [\\`github.com/marwan-at-work/mod\\`](https://github.com/marwan-at-work/mod).\n\nMust be prefixed with \\`v\\`.`,\n },\n {\n name: 'jenkins',\n description:\n 'Used in the `jenkins-plugins` datasource to specify a minimum version of Jenkins that a plugin must support.',\n },\n {\n name: 'pipTools',\n description:\n 'Used in the `pip-compile` manager to specify a version of `pip-tools` to use. @deprecated TODO remove in #42599',\n },\n {\n name: 'platform',\n description:\n 'Used in the `rubygems` datasource to specify the `platform` that the Gem dependency supports.',\n },\n {\n name: 'rubygems',\n description:\n 'Used in the `rubygems` datasource to specify the version of the `rubygems` tool that is needed to use this Gem.',\n },\n {\n name: 'vscode',\n description:\n 'Used in the `npm` manager to track the version of VSCode that the package is compatible with.',\n },\n {\n name: 'dotnet-sdk',\n description:\n 'Used in the `nuget` manager to track .NET SDK version required.',\n },\n {\n name: 'perl',\n description:\n 'Used in the `cpanfile` manager to track Perl version required.',\n },\n {\n name: '%goMod',\n description:\n 'Used in the `gomod` manager to determine the [minimum version of Go required to use this module](https://go.dev/ref/mod#go-mod-file-go).\\n\\nNote that this is prefixed with a `%` to explicitly note that this is not a tool that Containerbase knows.',\n },\n] as const satisfies ConstraintDefinition[];\n\n/**\n * Additional constraints that can be specified for some Managers, but are **not** tools that Containerbase supports.\n */\nexport type AdditionalConstraintName =\n (typeof additionalConstraintDefinitions)[number]['name'];\n\n/**\n * Additional constraints that can be specified for some Managers, but are **not** tools that Containerbase supports.\n */\nexport const additionalConstraintNames: AdditionalConstraintName[] =\n additionalConstraintDefinitions.map((c) => c.name);\n\nexport function isAdditionalConstraintName(\n value: unknown,\n): value is AdditionalConstraintName {\n return (\n isString(value) &&\n (additionalConstraintNames as readonly string[]).includes(value)\n );\n}\n\n/**\n * A name usable as a key in a `constraints` record, which may be tools that Containerbase supports.\n */\nexport type ConstraintName = ToolName | AdditionalConstraintName;\n\nexport function isConstraintName(value: unknown): value is ConstraintName {\n return isToolName(value) || isAdditionalConstraintName(value);\n}\n\nexport interface ToolConstraint {\n toolName: ToolName;\n constraint?: string | null;\n}\n\nexport interface ToolConfig {\n datasource: string;\n extractVersion?: string;\n packageName: string;\n versioning: VersioningName;\n}\n\nexport type Opt<T> = T | null | undefined;\n\nexport type VolumesPair = [string, string];\nexport type VolumeOption = Opt<string | VolumesPair>;\n\nexport interface DockerOptions {\n volumes?: Opt<VolumeOption[]>;\n envVars?: Opt<Opt<string>[]>;\n cwd?: Opt<string>;\n}\n\nexport type DataListener = (chunk: any) => void;\nexport interface OutputListeners {\n stdout?: DataListener[];\n stderr?: DataListener[];\n}\n\nexport interface OutputWriter {\n write(chunk: Buffer): void;\n toString(): string;\n}\n\nexport interface OutputWriters {\n stdout?: OutputWriter;\n stderr?: OutputWriter;\n}\n\nexport interface RawExecOptions extends ExecaOptions {\n maxBuffer?: number | undefined;\n cwd?: string;\n outputListeners?: OutputListeners;\n outputWriters?: OutputWriters;\n}\n\nexport interface ExecResult {\n stdout: string;\n stderr: string;\n /**\n * The process' exit code in the case of a failure.\n *\n * This is only set if using `ignoreFailure` when executing a command\n *\n */\n exitCode?: number;\n}\n\nexport type ExtraEnv<T = unknown> = Record<string, T>;\n\nexport interface ExecOptions {\n cwd?: string;\n cwdFile?: string;\n env?: Opt<ExtraEnv>;\n extraEnv?: Opt<ExtraEnv>;\n docker?: Opt<DockerOptions>;\n toolConstraints?: Opt<ToolConstraint[]>;\n preCommands?: Opt<string[]>;\n ignoreStdout?: boolean;\n // Following are pass-through to child process\n maxBuffer?: number | undefined;\n timeout?: number | undefined;\n shell?: boolean | string | undefined;\n}\n\n/**\n * configuration that can be configured on a per-command basis, that doesn't make sense to be on the `RawExecOptions`\n */\nexport interface CommandWithOptions {\n command: string[];\n\n /** do not throw errors when a command fails, but do log that an error occurred */\n ignoreFailure?: boolean;\n\n /**\n * Execute the `command` within a shell\n *\n * WARNING this can result in security issues if this includes user-controlled commands\n * **/\n shell?: boolean | string;\n}\n"],"mappings":";;;;;;;AAcA,MAAa,kBAAkB;CAC7B,EACE,MAAM,MACR;CACA,EACE,MAAM,WACR;CACA,EACE,MAAM,MACR;CACA,EACE,MAAM,UACR;CACA,EACE,MAAM,YACR;CACA,EACE,MAAM,WACR;CACA,EACE,MAAM,QACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,WACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,KACR;CACA,EACE,MAAM,QACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,WACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,aACR;CACA,EACE,MAAM,KACR;CACA,EACE,MAAM,YACR;CACA,EACE,MAAM,QACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,MACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,MACR;CACA,EACE,MAAM,MACR;CACA,EACE,MAAM,MACR;CACA,EACE,MAAM,YACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA;EACE,MAAM;EACN,aAAa;CACf;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,KACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,YACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,UACR;CACA,EACE,MAAM,SACR;AACF;;;;AAUA,MAAa,YAAwB,gBAAgB,KAAK,MAAM,EAAE,IAAI;AAEtE,SAAgB,WAAW,OAAmC;CAC5D,OAAO,SAAS,KAAK,KAAM,UAAgC,SAAS,KAAK;AAC3E;;;;AAKA,MAAa,kCAAkC;CAC7C;EACE,MAAM;EACN,aAAa;;;CAGf;;;;;CAIA;EACE,MAAM;EACN,aAAa;;;;;;;;;;CAUf;CACA;EACE,MAAM;EACN,aAAa;;;CAGf;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;AACF;;;;AAWA,MAAa,4BACX,gCAAgC,KAAK,MAAM,EAAE,IAAI;AAEnD,SAAgB,2BACd,OACmC;CACnC,OACE,SAAS,KAAK,KACb,0BAAgD,SAAS,KAAK;AAEnE;AAOA,SAAgB,iBAAiB,OAAyC;CACxE,OAAO,WAAW,KAAK,KAAK,2BAA2B,KAAK;AAC9D"}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../lib/util/exec/types.ts"],"sourcesContent":["import { isString } from '@sindresorhus/is';\nimport type { Options as ExecaOptions } from 'execa';\nimport type { VersioningName } from '../../versioning-list.generated.ts';\n\nexport interface ConstraintDefinition {\n name: string;\n description?: string;\n}\n\n/**\n * A `tool` that Containerbase supports.\n *\n * TODO #41849 replace with upstream types\n */\nexport const toolDefinitions = [\n {\n name: 'apm',\n },\n {\n name: 'bazelisk',\n },\n {\n name: 'bun',\n },\n {\n name: 'bundler',\n },\n {\n name: 'cocoapods',\n },\n {\n name: 'composer',\n },\n {\n name: 'conan',\n },\n {\n name: 'copier',\n },\n {\n name: 'corepack',\n },\n {\n name: 'deno',\n },\n {\n name: 'devbox',\n },\n {\n name: 'dotnet',\n },\n {\n name: 'erlang',\n },\n {\n name: 'elixir',\n },\n {\n name: 'flux',\n },\n {\n name: 'gh',\n },\n {\n name: 'gleam',\n },\n {\n name: 'golang',\n },\n {\n name: 'gradle',\n },\n {\n name: 'hashin',\n },\n {\n name: 'helm',\n },\n {\n name: 'helmfile',\n },\n {\n name: 'java',\n },\n {\n name: 'java-maven',\n },\n {\n name: 'jb',\n },\n {\n name: 'kustomize',\n },\n {\n name: 'maven',\n },\n {\n name: 'mise',\n },\n {\n name: 'nix',\n },\n {\n name: 'node',\n },\n {\n name: 'npm',\n },\n {\n name: 'pdm',\n },\n {\n name: 'php',\n },\n {\n name: 'pip-tools',\n },\n {\n name: 'pipenv',\n },\n {\n name: 'pnpm',\n },\n {\n name: 'pixi',\n },\n {\n name: 'poetry',\n },\n {\n name: 'python',\n },\n {\n name: 'ruby',\n description: 'Also used in the `rubygems` Datasource',\n },\n {\n name: 'rust',\n },\n {\n name: 'uv',\n },\n {\n name: 'yarn',\n },\n {\n name: 'yarn-slim',\n },\n {\n name: 'dart',\n },\n {\n name: 'flutter',\n },\n {\n name: 'vendir',\n },\n] as const satisfies ConstraintDefinition[];\n\n/**\n * A `tool` that Containerbase supports.\n */\nexport type ToolName = (typeof toolDefinitions)[number]['name'];\n\n/**\n * A `tool` that Containerbase supports.\n */\nexport const toolNames: ToolName[] = toolDefinitions.map((t) => t.name);\n\nexport function isToolName(value: unknown): value is ToolName {\n return isString(value) && (toolNames as readonly string[]).includes(value);\n}\n\n/**\n * Additional constraints that can be specified for some Managers, but are **not** tools that Containerbase supports, with optional description.\n */\nexport const additionalConstraintDefinitions = [\n {\n name: 'ghActionsLock',\n description: `Used in the \\`github-actions\\` manager to specify a release tag for the [\\`github/gh-actions-lock\\`](https://github.com/github/gh-actions-lock) \\`gh\\` CLI extension, which regenerates \\`.github/workflows/actions.lock\\`.\n\nMust be a full release tag, prefixed with \\`v\\`, such as \\`v0.1.7\\`. Set it to an empty string to always install the latest release.`,\n },\n /**\n * @deprecated TODO remove in #42600\n */\n {\n name: 'go',\n description: `Used in the \\`gomod\\` manager to specify the version of the Go toolchain to use.\n\nIn precedence order:\n\n1. config: \\`constraints.go\\`\n1. \\`go.mod\\`: \\`toolchain\\` directive\n1. \\`go.mod\\`: \\`go\\` directive\n\nNOTE that the \\`constraints.golang\\` is not used (https://github.com/renovatebot/renovate/issues/42601)\n `,\n },\n {\n name: 'gomodMod',\n description: `Used in the \\`gomod\\` manager to specify a tag for [\\`github.com/marwan-at-work/mod\\`](https://github.com/marwan-at-work/mod).\n\nMust be prefixed with \\`v\\`.`,\n },\n {\n name: 'jenkins',\n description:\n 'Used in the `jenkins-plugins` datasource to specify a minimum version of Jenkins that a plugin must support.',\n },\n {\n name: 'pipTools',\n description:\n 'Used in the `pip-compile` manager to specify a version of `pip-tools` to use. @deprecated TODO remove in #42599',\n },\n {\n name: 'platform',\n description:\n 'Used in the `rubygems` datasource to specify the `platform` that the Gem dependency supports.',\n },\n {\n name: 'rubygems',\n description:\n 'Used in the `rubygems` datasource to specify the version of the `rubygems` tool that is needed to use this Gem.',\n },\n {\n name: 'vscode',\n description:\n 'Used in the `npm` manager to track the version of VSCode that the package is compatible with.',\n },\n {\n name: 'dotnet-sdk',\n description:\n 'Used in the `nuget` manager to track .NET SDK version required.',\n },\n {\n name: 'perl',\n description:\n 'Used in the `cpanfile` manager to track Perl version required.',\n },\n {\n name: '%goMod',\n description:\n 'Used in the `gomod` manager to determine the [minimum version of Go required to use this module](https://go.dev/ref/mod#go-mod-file-go).\\n\\nNote that this is prefixed with a `%` to explicitly note that this is not a tool that Containerbase knows.',\n },\n] as const satisfies ConstraintDefinition[];\n\n/**\n * Additional constraints that can be specified for some Managers, but are **not** tools that Containerbase supports.\n */\nexport type AdditionalConstraintName =\n (typeof additionalConstraintDefinitions)[number]['name'];\n\n/**\n * Additional constraints that can be specified for some Managers, but are **not** tools that Containerbase supports.\n */\nexport const additionalConstraintNames: AdditionalConstraintName[] =\n additionalConstraintDefinitions.map((c) => c.name);\n\nexport function isAdditionalConstraintName(\n value: unknown,\n): value is AdditionalConstraintName {\n return (\n isString(value) &&\n (additionalConstraintNames as readonly string[]).includes(value)\n );\n}\n\n/**\n * A name usable as a key in a `constraints` record, which may be tools that Containerbase supports.\n */\nexport type ConstraintName = ToolName | AdditionalConstraintName;\n\nexport function isConstraintName(value: unknown): value is ConstraintName {\n return isToolName(value) || isAdditionalConstraintName(value);\n}\n\nexport interface ToolConstraint {\n toolName: ToolName;\n constraint?: string | null;\n}\n\nexport interface ToolConfig {\n datasource: string;\n extractVersion?: string;\n packageName: string;\n versioning: VersioningName;\n}\n\nexport type Opt<T> = T | null | undefined;\n\nexport type VolumesPair = [string, string];\nexport type VolumeOption = Opt<string | VolumesPair>;\n\nexport interface DockerOptions {\n volumes?: Opt<VolumeOption[]>;\n envVars?: Opt<Opt<string>[]>;\n cwd?: Opt<string>;\n}\n\nexport type DataListener = (chunk: any) => void;\nexport interface OutputListeners {\n stdout?: DataListener[];\n stderr?: DataListener[];\n}\n\nexport interface OutputWriter {\n write(chunk: Buffer): void;\n toString(): string;\n}\n\nexport interface OutputWriters {\n stdout?: OutputWriter;\n stderr?: OutputWriter;\n}\n\n/** execa options producing text output, which excludes the binary encodings */\ntype TextExecaOptions = Extract<\n ExecaOptions,\n { readonly encoding?: 'utf8' | 'utf16le' }\n>;\n\nexport interface RawExecOptions extends TextExecaOptions {\n maxBuffer?: number | undefined;\n cwd?: string;\n outputListeners?: OutputListeners;\n outputWriters?: OutputWriters;\n}\n\nexport interface ExecResult {\n stdout: string;\n stderr: string;\n /**\n * The process' exit code in the case of a failure.\n *\n * This is only set if using `ignoreFailure` when executing a command\n *\n */\n exitCode?: number;\n}\n\nexport type ExtraEnv<T = unknown> = Record<string, T>;\n\nexport interface ExecOptions {\n cwd?: string;\n cwdFile?: string;\n env?: Opt<ExtraEnv>;\n extraEnv?: Opt<ExtraEnv>;\n docker?: Opt<DockerOptions>;\n toolConstraints?: Opt<ToolConstraint[]>;\n preCommands?: Opt<string[]>;\n ignoreStdout?: boolean;\n // Following are pass-through to child process\n maxBuffer?: number | undefined;\n timeout?: number | undefined;\n shell?: boolean | string | undefined;\n}\n\n/**\n * configuration that can be configured on a per-command basis, that doesn't make sense to be on the `RawExecOptions`\n */\nexport interface CommandWithOptions {\n command: string[];\n\n /** do not throw errors when a command fails, but do log that an error occurred */\n ignoreFailure?: boolean;\n\n /**\n * Execute the `command` within a shell\n *\n * WARNING this can result in security issues if this includes user-controlled commands\n * **/\n shell?: boolean | string;\n}\n"],"mappings":";;;;;;;AAcA,MAAa,kBAAkB;CAC7B,EACE,MAAM,MACR;CACA,EACE,MAAM,WACR;CACA,EACE,MAAM,MACR;CACA,EACE,MAAM,UACR;CACA,EACE,MAAM,YACR;CACA,EACE,MAAM,WACR;CACA,EACE,MAAM,QACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,WACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,KACR;CACA,EACE,MAAM,QACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,WACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,aACR;CACA,EACE,MAAM,KACR;CACA,EACE,MAAM,YACR;CACA,EACE,MAAM,QACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,MACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,MACR;CACA,EACE,MAAM,MACR;CACA,EACE,MAAM,MACR;CACA,EACE,MAAM,YACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,SACR;CACA,EACE,MAAM,SACR;CACA;EACE,MAAM;EACN,aAAa;CACf;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,KACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,YACR;CACA,EACE,MAAM,OACR;CACA,EACE,MAAM,UACR;CACA,EACE,MAAM,SACR;AACF;;;;AAUA,MAAa,YAAwB,gBAAgB,KAAK,MAAM,EAAE,IAAI;AAEtE,SAAgB,WAAW,OAAmC;CAC5D,OAAO,SAAS,KAAK,KAAM,UAAgC,SAAS,KAAK;AAC3E;;;;AAKA,MAAa,kCAAkC;CAC7C;EACE,MAAM;EACN,aAAa;;;CAGf;;;;;CAIA;EACE,MAAM;EACN,aAAa;;;;;;;;;;CAUf;CACA;EACE,MAAM;EACN,aAAa;;;CAGf;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;CACA;EACE,MAAM;EACN,aACE;CACJ;AACF;;;;AAWA,MAAa,4BACX,gCAAgC,KAAK,MAAM,EAAE,IAAI;AAEnD,SAAgB,2BACd,OACmC;CACnC,OACE,SAAS,KAAK,KACb,0BAAgD,SAAS,KAAK;AAEnE;AAOA,SAAgB,iBAAiB,OAAyC;CACxE,OAAO,WAAW,KAAK,KAAK,2BAA2B,KAAK;AAC9D"}
|
|
@@ -2,7 +2,6 @@ import { GitNoVerifyOption } from "./types.js";
|
|
|
2
2
|
import "../exec/utils.js";
|
|
3
3
|
import { SimpleGitOptions } from "simple-git";
|
|
4
4
|
//#region lib/util/git/config.d.ts
|
|
5
|
-
declare function setNoVerify(value: GitNoVerifyOption[]): void;
|
|
5
|
+
export declare function setNoVerify(value: GitNoVerifyOption[]): void;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { setNoVerify };
|
|
8
7
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/util/git/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { setPrivateKey } from "./private-key.js";
|
|
|
8
8
|
import { DateTime } from "luxon";
|
|
9
9
|
import { SimpleGit, SimpleGitOptions } from "simple-git";
|
|
10
10
|
//#region lib/util/git/index.d.ts
|
|
11
|
-
declare const RENOVATE_FORK_UPSTREAM = "renovate-fork-upstream";
|
|
11
|
+
export declare const RENOVATE_FORK_UPSTREAM = "renovate-fork-upstream";
|
|
12
12
|
interface CreateSimpleGitOptions {
|
|
13
13
|
config?: Partial<SimpleGitOptions>;
|
|
14
14
|
env?: ExtraEnv;
|
|
@@ -16,40 +16,40 @@ interface CreateSimpleGitOptions {
|
|
|
16
16
|
hostTypes?: readonly string[];
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
declare function createSimpleGit({ config, env, authentication }?: CreateSimpleGitOptions): SimpleGit;
|
|
20
|
-
declare function gitRetry<T>(gitFunc: () => Promise<T>): Promise<T>;
|
|
21
|
-
declare const GIT_MINIMUM_VERSION = "2.33.0";
|
|
22
|
-
declare function validateGitVersion(): Promise<boolean>;
|
|
23
|
-
declare function fetchRevSpec(...revSpec: string[]): Promise<void>;
|
|
24
|
-
declare function initRepo(args: StorageConfig): Promise<void>;
|
|
25
|
-
declare function resetToCommit(commit: LongCommitSha): Promise<void>;
|
|
26
|
-
declare function setGitAuthor(gitAuthor: string | undefined): void;
|
|
27
|
-
declare function writeGitAuthor(): Promise<void>;
|
|
28
|
-
declare function setUserRepoConfig({ gitIgnoredAuthors, gitAuthor }: RenovateConfig): void;
|
|
29
|
-
declare function setPlatformIgnoredAuthors(emails?: string[]): void;
|
|
19
|
+
export declare function createSimpleGit({ config, env, authentication }?: CreateSimpleGitOptions): SimpleGit;
|
|
20
|
+
export declare function gitRetry<T>(gitFunc: () => Promise<T>): Promise<T>;
|
|
21
|
+
export declare const GIT_MINIMUM_VERSION = "2.33.0";
|
|
22
|
+
export declare function validateGitVersion(): Promise<boolean>;
|
|
23
|
+
export declare function fetchRevSpec(...revSpec: string[]): Promise<void>;
|
|
24
|
+
export declare function initRepo(args: StorageConfig): Promise<void>;
|
|
25
|
+
export declare function resetToCommit(commit: LongCommitSha): Promise<void>;
|
|
26
|
+
export declare function setGitAuthor(gitAuthor: string | undefined): void;
|
|
27
|
+
export declare function writeGitAuthor(): Promise<void>;
|
|
28
|
+
export declare function setUserRepoConfig({ gitIgnoredAuthors, gitAuthor }: RenovateConfig): void;
|
|
29
|
+
export declare function setPlatformIgnoredAuthors(emails?: string[]): void;
|
|
30
30
|
/**
|
|
31
31
|
* Clears the in-memory `isBranchModified()` results.
|
|
32
32
|
*
|
|
33
33
|
* @internal Test helper, so read-only tests can share one `initRepo()`.
|
|
34
34
|
*/
|
|
35
|
-
declare function clearBranchIsModifiedCache(): void;
|
|
36
|
-
declare function getSubmodules(): Promise<string[]>;
|
|
37
|
-
declare function cloneSubmodules(shouldClone: boolean, cloneSubmodulesFilter: string[] | undefined): Promise<void>;
|
|
38
|
-
declare function isCloned(): boolean;
|
|
39
|
-
declare function isFileModeEnabled(): Promise<boolean>;
|
|
40
|
-
declare const syncGit: () => Promise<void>;
|
|
41
|
-
declare function getRepoStatus(path?: string): Promise<StatusResult>;
|
|
42
|
-
declare function branchExists(branchName: string): boolean;
|
|
43
|
-
declare function getBranchCommit(branchName: string): LongCommitSha | null;
|
|
44
|
-
declare function getBranchUpdateDate(branchName: string): Promise<DateTime | null>;
|
|
45
|
-
declare function getAllBranchUpdateDates(): Promise<Record<string, DateTime>>;
|
|
46
|
-
declare function getCommitMessages(): Promise<string[]>;
|
|
47
|
-
declare function checkoutBranch(branchName: string): Promise<LongCommitSha>;
|
|
48
|
-
declare function checkoutBranchFromRemote(branchName: string, remoteName: string): Promise<LongCommitSha>;
|
|
35
|
+
export declare function clearBranchIsModifiedCache(): void;
|
|
36
|
+
export declare function getSubmodules(): Promise<string[]>;
|
|
37
|
+
export declare function cloneSubmodules(shouldClone: boolean, cloneSubmodulesFilter: string[] | undefined): Promise<void>;
|
|
38
|
+
export declare function isCloned(): boolean;
|
|
39
|
+
export declare function isFileModeEnabled(): Promise<boolean>;
|
|
40
|
+
export declare const syncGit: () => Promise<void>;
|
|
41
|
+
export declare function getRepoStatus(path?: string): Promise<StatusResult>;
|
|
42
|
+
export declare function branchExists(branchName: string): boolean;
|
|
43
|
+
export declare function getBranchCommit(branchName: string): LongCommitSha | null;
|
|
44
|
+
export declare function getBranchUpdateDate(branchName: string): Promise<DateTime | null>;
|
|
45
|
+
export declare function getAllBranchUpdateDates(): Promise<Record<string, DateTime>>;
|
|
46
|
+
export declare function getCommitMessages(): Promise<string[]>;
|
|
47
|
+
export declare function checkoutBranch(branchName: string): Promise<LongCommitSha>;
|
|
48
|
+
export declare function checkoutBranchFromRemote(branchName: string, remoteName: string): Promise<LongCommitSha>;
|
|
49
49
|
/**
|
|
50
50
|
* Returns the remote-tracking ref path for a virtual branch.
|
|
51
51
|
*/
|
|
52
|
-
declare function remoteBranchRef(branchName: string): string;
|
|
52
|
+
export declare function remoteBranchRef(branchName: string): string;
|
|
53
53
|
/**
|
|
54
54
|
* Set a virtual branch's remote-tracking ref and add it to the
|
|
55
55
|
* virtual-branch registry (config.virtualBranches).
|
|
@@ -61,23 +61,23 @@ declare function remoteBranchRef(branchName: string): string;
|
|
|
61
61
|
* @param ref The ref this virtual branch is fetched from (e.g., 'refs/changes/34/1234/1')
|
|
62
62
|
* @param commitSha The commit SHA the virtual branch points to.
|
|
63
63
|
*/
|
|
64
|
-
declare function setVirtualBranch(branchName: string, ref: string, commitSha: LongCommitSha): Promise<void>;
|
|
65
|
-
declare function resetHardFromRemote(remoteAndBranch: string): Promise<void>;
|
|
66
|
-
declare function forcePushToRemote(branchName: string, remote: string): Promise<void>;
|
|
67
|
-
declare function getFileList(): Promise<string[]>;
|
|
68
|
-
declare function getBranchList(): string[];
|
|
69
|
-
declare function isBranchBehindBase(branchName: string, baseBranch: string): Promise<boolean>;
|
|
70
|
-
declare function isBranchModified(branchName: string, baseBranch: string): Promise<boolean>;
|
|
71
|
-
declare function isBranchConflicted(baseBranch: string, branch: string): Promise<boolean>;
|
|
72
|
-
declare function deleteBranch(branchName: string): Promise<void>;
|
|
73
|
-
declare function mergeToLocal(branchName: string): Promise<void>;
|
|
74
|
-
declare function mergeBranch(branchName: string): Promise<void>;
|
|
75
|
-
declare function getBranchLastCommitTime(branchName: string): Promise<Date>;
|
|
76
|
-
declare function getBranchFiles(branchName: string): Promise<string[] | null>;
|
|
77
|
-
declare function getBranchFilesFromCommit(referenceCommit: LongCommitSha): Promise<string[] | null>;
|
|
78
|
-
declare function getFile(filePath: string, branchName?: string): Promise<string | null>;
|
|
79
|
-
declare function getFiles(fileNames: string[]): Promise<Record<string, string | null>>;
|
|
80
|
-
declare function hasDiff(sourceRef: string, targetRef: string): Promise<boolean>;
|
|
64
|
+
export declare function setVirtualBranch(branchName: string, ref: string, commitSha: LongCommitSha): Promise<void>;
|
|
65
|
+
export declare function resetHardFromRemote(remoteAndBranch: string): Promise<void>;
|
|
66
|
+
export declare function forcePushToRemote(branchName: string, remote: string): Promise<void>;
|
|
67
|
+
export declare function getFileList(): Promise<string[]>;
|
|
68
|
+
export declare function getBranchList(): string[];
|
|
69
|
+
export declare function isBranchBehindBase(branchName: string, baseBranch: string): Promise<boolean>;
|
|
70
|
+
export declare function isBranchModified(branchName: string, baseBranch: string): Promise<boolean>;
|
|
71
|
+
export declare function isBranchConflicted(baseBranch: string, branch: string): Promise<boolean>;
|
|
72
|
+
export declare function deleteBranch(branchName: string): Promise<void>;
|
|
73
|
+
export declare function mergeToLocal(branchName: string): Promise<void>;
|
|
74
|
+
export declare function mergeBranch(branchName: string): Promise<void>;
|
|
75
|
+
export declare function getBranchLastCommitTime(branchName: string): Promise<Date>;
|
|
76
|
+
export declare function getBranchFiles(branchName: string): Promise<string[] | null>;
|
|
77
|
+
export declare function getBranchFilesFromCommit(referenceCommit: LongCommitSha): Promise<string[] | null>;
|
|
78
|
+
export declare function getFile(filePath: string, branchName?: string): Promise<string | null>;
|
|
79
|
+
export declare function getFiles(fileNames: string[]): Promise<Record<string, string | null>>;
|
|
80
|
+
export declare function hasDiff(sourceRef: string, targetRef: string): Promise<boolean>;
|
|
81
81
|
/**
|
|
82
82
|
*
|
|
83
83
|
* Prepare local branch with commit
|
|
@@ -90,11 +90,11 @@ declare function hasDiff(sourceRef: string, targetRef: string): Promise<boolean>
|
|
|
90
90
|
* 5. If not empty, return commit info for further processing
|
|
91
91
|
*
|
|
92
92
|
*/
|
|
93
|
-
declare function prepareCommit({ branchName, files, message, trailers, force }: CommitFilesConfig): Promise<CommitResult | null>;
|
|
94
|
-
declare function pushCommit({ sourceRef, targetRef, files, pushOptions }: PushFilesConfig): Promise<boolean>;
|
|
95
|
-
declare function fetchBranch(branchName: string): Promise<LongCommitSha | null>;
|
|
96
|
-
declare function commitFiles(commitConfig: CommitFilesConfig): Promise<LongCommitSha | null>;
|
|
97
|
-
declare function getUrl({ protocol, auth, hostname, host, repository }: {
|
|
93
|
+
export declare function prepareCommit({ branchName, files, message, trailers, force }: CommitFilesConfig): Promise<CommitResult | null>;
|
|
94
|
+
export declare function pushCommit({ sourceRef, targetRef, files, pushOptions }: PushFilesConfig): Promise<boolean>;
|
|
95
|
+
export declare function fetchBranch(branchName: string): Promise<LongCommitSha | null>;
|
|
96
|
+
export declare function commitFiles(commitConfig: CommitFilesConfig): Promise<LongCommitSha | null>;
|
|
97
|
+
export declare function getUrl({ protocol, auth, hostname, host, repository }: {
|
|
98
98
|
protocol?: GitProtocol;
|
|
99
99
|
auth?: string;
|
|
100
100
|
hostname?: string;
|
|
@@ -109,7 +109,7 @@ declare function getUrl({ protocol, auth, hostname, host, repository }: {
|
|
|
109
109
|
* @see https://stackoverflow.com/questions/63866947/pushing-git-non-branch-references-to-a-remote/63868286
|
|
110
110
|
*
|
|
111
111
|
*/
|
|
112
|
-
declare function pushCommitToRenovateRef(commitSha: string, refName: string): Promise<void>;
|
|
112
|
+
export declare function pushCommitToRenovateRef(commitSha: string, refName: string): Promise<void>;
|
|
113
113
|
/**
|
|
114
114
|
*
|
|
115
115
|
* Removes all remote "refs/renovate/branches/*" refs in two steps:
|
|
@@ -133,16 +133,16 @@ declare function pushCommitToRenovateRef(commitSha: string, refName: string): Pr
|
|
|
133
133
|
* $ git push --delete origin refs/renovate/branches/bar
|
|
134
134
|
* $ git push --delete origin refs/renovate/branches/baz
|
|
135
135
|
*/
|
|
136
|
-
declare function clearRenovateRefs(): Promise<void>;
|
|
136
|
+
export declare function clearRenovateRefs(): Promise<void>;
|
|
137
137
|
/**
|
|
138
138
|
* Get the tree SHA for a commit.
|
|
139
139
|
*/
|
|
140
|
-
declare function getCommitTreeSha(commitSha: LongCommitSha): Promise<LongCommitSha>;
|
|
140
|
+
export declare function getCommitTreeSha(commitSha: LongCommitSha): Promise<LongCommitSha>;
|
|
141
141
|
/**
|
|
142
142
|
* Return only the files that changed between two commits.
|
|
143
143
|
* Deletions have `sha: null` (for use with GitHub's `base_tree` API).
|
|
144
144
|
*/
|
|
145
|
-
declare function diffCommitTree(parentCommitSha: LongCommitSha, commitSha: LongCommitSha): Promise<DiffTreeItem[]>;
|
|
145
|
+
export declare function diffCommitTree(parentCommitSha: LongCommitSha, commitSha: LongCommitSha): Promise<DiffTreeItem[]>;
|
|
146
146
|
/**
|
|
147
147
|
* Synchronize a forked branch with its upstream counterpart.
|
|
148
148
|
*
|
|
@@ -157,8 +157,8 @@ declare function diffCommitTree(parentCommitSha: LongCommitSha, commitSha: LongC
|
|
|
157
157
|
* @param {string} branchName - The name of the branch to synchronize.
|
|
158
158
|
* @returns A promise that resolves to True if the synchronization is successful, or `false` if an error occurs.
|
|
159
159
|
*/
|
|
160
|
-
declare function syncForkWithUpstream(branchName: string): Promise<void>;
|
|
161
|
-
declare function getRemotes(): Promise<string[]>;
|
|
160
|
+
export declare function syncForkWithUpstream(branchName: string): Promise<void>;
|
|
161
|
+
export declare function getRemotes(): Promise<string[]>;
|
|
162
162
|
//#endregion
|
|
163
|
-
export {
|
|
163
|
+
export { setNoVerify, setPrivateKey };
|
|
164
164
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region lib/util/git/private-key.d.ts
|
|
2
|
-
declare function setPrivateKey(key: string | undefined, passphrase: string | undefined): void;
|
|
2
|
+
export declare function setPrivateKey(key: string | undefined, passphrase: string | undefined): void;
|
|
3
3
|
//#endregion
|
|
4
|
-
export { setPrivateKey };
|
|
5
4
|
//# sourceMappingURL=private-key.d.ts.map
|