renovate 43.103.0 → 43.104.1
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { regEx } from "../regex.js";
|
|
1
2
|
import { logger } from "../../logger/index.js";
|
|
2
3
|
import { getCache } from "../cache/repository/index.js";
|
|
3
4
|
import { getCommitMessages } from "./index.js";
|
|
4
|
-
import conventionalCommitsDetector from "conventional-commits-detector";
|
|
5
5
|
//#region lib/util/git/semantic.ts
|
|
6
6
|
async function detectSemanticCommits() {
|
|
7
7
|
logger.debug("detectSemanticCommits()");
|
|
@@ -12,9 +12,9 @@ async function detectSemanticCommits() {
|
|
|
12
12
|
}
|
|
13
13
|
const commitMessages = await getCommitMessages();
|
|
14
14
|
logger.trace(`commitMessages=${JSON.stringify(commitMessages)}`);
|
|
15
|
-
const
|
|
16
|
-
logger.debug(`semanticCommits:
|
|
17
|
-
if (
|
|
15
|
+
const score = detectSemanticCommitScore(commitMessages);
|
|
16
|
+
logger.debug(`semanticCommits: score=${score}`);
|
|
17
|
+
if (score > 0) {
|
|
18
18
|
logger.debug(`semanticCommits: enabled`);
|
|
19
19
|
cache.semanticCommits = "enabled";
|
|
20
20
|
} else {
|
|
@@ -23,6 +23,21 @@ async function detectSemanticCommits() {
|
|
|
23
23
|
}
|
|
24
24
|
return cache.semanticCommits;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Detect semantic commits by counting the number of commit messages that match the Angular convention and comparing it to the number of commit messages that do not match the convention.
|
|
28
|
+
* The Angular convention is defined as: `<type>(<scope>): <description>`, where `<type>` is a word, `<scope>` is an optional word, and `<description>` is a string.
|
|
29
|
+
*
|
|
30
|
+
* @see Inspired by {@link https://github.com/conventional-changelog/conventional-commits-detector|conventional-commits-detector} and {@link https://www.conventionalcommits.org|conventional commits specification}.
|
|
31
|
+
* @param commitMessages commit messages to check
|
|
32
|
+
* @returns A number greater than zero if more semantic commits than non-semantic commits, less than zero if more non-semantic commits than semantic commits, or zero if equal number of semantic and non-semantic commits
|
|
33
|
+
*/
|
|
34
|
+
function detectSemanticCommitScore(commitMessages) {
|
|
35
|
+
const angular = regEx(/^(\w*)(?:\((.*)\))?!?: (.*)$/);
|
|
36
|
+
return commitMessages.reduce((count, message) => {
|
|
37
|
+
if (angular.test(message)) return count + 1;
|
|
38
|
+
return count - 1;
|
|
39
|
+
}, 0);
|
|
40
|
+
}
|
|
26
41
|
//#endregion
|
|
27
42
|
export { detectSemanticCommits };
|
|
28
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semantic.js","names":[],"sources":["../../../lib/util/git/semantic.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"semantic.js","names":[],"sources":["../../../lib/util/git/semantic.ts"],"sourcesContent":["import { logger } from '../../logger/index.ts';\nimport { getCache } from '../../util/cache/repository/index.ts';\nimport { regEx } from '../regex.ts';\nimport { getCommitMessages } from './index.ts';\n\ntype DetectedSemanticCommit = 'enabled' | 'disabled';\n\nexport async function detectSemanticCommits(): Promise<DetectedSemanticCommit> {\n logger.debug('detectSemanticCommits()');\n const cache = getCache();\n if (cache.semanticCommits) {\n logger.debug(\n `semanticCommits: returning \"${cache.semanticCommits}\" from cache`,\n );\n return cache.semanticCommits;\n }\n const commitMessages = await getCommitMessages();\n logger.trace(`commitMessages=${JSON.stringify(commitMessages)}`);\n const score = detectSemanticCommitScore(commitMessages);\n logger.debug(`semanticCommits: score=${score}`);\n if (score > 0) {\n logger.debug(`semanticCommits: enabled`);\n cache.semanticCommits = 'enabled';\n } else {\n logger.debug(`semanticCommits: disabled`);\n cache.semanticCommits = 'disabled';\n }\n return cache.semanticCommits;\n}\n\n/**\n * Detect semantic commits by counting the number of commit messages that match the Angular convention and comparing it to the number of commit messages that do not match the convention.\n * The Angular convention is defined as: `<type>(<scope>): <description>`, where `<type>` is a word, `<scope>` is an optional word, and `<description>` is a string.\n *\n * @see Inspired by {@link https://github.com/conventional-changelog/conventional-commits-detector|conventional-commits-detector} and {@link https://www.conventionalcommits.org|conventional commits specification}.\n * @param commitMessages commit messages to check\n * @returns A number greater than zero if more semantic commits than non-semantic commits, less than zero if more non-semantic commits than semantic commits, or zero if equal number of semantic and non-semantic commits\n */\nfunction detectSemanticCommitScore(commitMessages: string[]): number {\n const angular = regEx(/^(\\w*)(?:\\((.*)\\))?!?: (.*)$/);\n\n return commitMessages.reduce((count, message) => {\n if (angular.test(message)) {\n return count + 1;\n }\n return count - 1;\n }, 0);\n}\n"],"mappings":";;;;;AAOA,eAAsB,wBAAyD;AAC7E,QAAO,MAAM,0BAA0B;CACvC,MAAM,QAAQ,UAAU;AACxB,KAAI,MAAM,iBAAiB;AACzB,SAAO,MACL,+BAA+B,MAAM,gBAAgB,cACtD;AACD,SAAO,MAAM;;CAEf,MAAM,iBAAiB,MAAM,mBAAmB;AAChD,QAAO,MAAM,kBAAkB,KAAK,UAAU,eAAe,GAAG;CAChE,MAAM,QAAQ,0BAA0B,eAAe;AACvD,QAAO,MAAM,0BAA0B,QAAQ;AAC/C,KAAI,QAAQ,GAAG;AACb,SAAO,MAAM,2BAA2B;AACxC,QAAM,kBAAkB;QACnB;AACL,SAAO,MAAM,4BAA4B;AACzC,QAAM,kBAAkB;;AAE1B,QAAO,MAAM;;;;;;;;;;AAWf,SAAS,0BAA0B,gBAAkC;CACnE,MAAM,UAAU,MAAM,+BAA+B;AAErD,QAAO,eAAe,QAAQ,OAAO,YAAY;AAC/C,MAAI,QAAQ,KAAK,QAAQ,CACvB,QAAO,QAAQ;AAEjB,SAAO,QAAQ;IACd,EAAE"}
|
|
@@ -30,11 +30,20 @@ function createProgram() {
|
|
|
30
30
|
}
|
|
31
31
|
return program.version(pkg.version, "-v, --version").on("--help", helpConsole);
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Massage migrated configuration keys.
|
|
35
|
+
* This must run before any Commander parse call so that
|
|
36
|
+
* deprecated/bare flags like `--dry-run` (no value) are rewritten
|
|
37
|
+
* before Commander tries to consume them.
|
|
38
|
+
*/
|
|
39
|
+
function migrateArgs(input) {
|
|
40
|
+
return input.map((a) => a.replace("--allow-post-upgrade-command-templating", "--allow-command-templating").replace("--allowed-post-upgrade-commands", "--allowed-commands").replace("--endpoints=", "--host-rules=").replace("--expose-env=true", "--trust-level=high").replace("--expose-env", "--trust-level=high").replace("--renovate-fork", "--include-forks").replace("\"platform\":\"", "\"hostType\":\"").replace("\"endpoint\":\"", "\"matchHost\":\"").replace("\"host\":\"", "\"matchHost\":\"").replace("--azure-auto-complete", "--platform-automerge").replace("--git-lab-automerge", "--platform-automerge").replace(/^--dry-run$/, "--dry-run=true").replace(/^--require-config$/, "--require-config=true").replace("--aliases", "--registry-aliases").replace("--include-forks=true", "--fork-processing=enabled").replace("--include-forks", "--fork-processing=enabled").replace("--recreate-closed=false", "--recreate-when=auto").replace("--recreate-closed=true", "--recreate-when=always").replace("--recreate-closed", "--recreate-when=always")).filter((a) => !a.startsWith("--git-fs"));
|
|
41
|
+
}
|
|
33
42
|
function parseEarlyFlags(input = process.argv) {
|
|
34
|
-
createProgram().allowUnknownOption().allowExcessArguments().parse(input);
|
|
43
|
+
createProgram().allowUnknownOption().allowExcessArguments().parse(migrateArgs(input));
|
|
35
44
|
}
|
|
36
45
|
function getConfig(input) {
|
|
37
|
-
const argv = input
|
|
46
|
+
const argv = migrateArgs(input);
|
|
38
47
|
const options = getOptions();
|
|
39
48
|
const config = {};
|
|
40
49
|
createProgram().action((repositories, opts) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["../../../../../lib/workers/global/config/parse/cli.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { getOptions } from '../../../../config/options/index.ts';\nimport type { AllConfig } from '../../../../config/types.ts';\nimport { pkg } from '../../../../expose.ts';\nimport { logger } from '../../../../logger/index.ts';\nimport { regEx } from '../../../../util/regex.ts';\nimport { coersions } from './coersions.ts';\nimport type { ParseConfigOptions } from './types.ts';\n\nexport function getCliName(option: ParseConfigOptions): string {\n if (option.cli === false) {\n return '';\n }\n const nameWithHyphens = option.name.replace(regEx(/([A-Z])/g), '-$1');\n return `--${nameWithHyphens.toLowerCase()}`;\n}\n\nfunction createProgram(): Command<[string[]]> {\n const options = getOptions();\n\n let program = new Command().arguments('[repositories...]');\n\n options.forEach((option) => {\n if (option.cli !== false) {\n const param = `<${option.type}>`.replace('<boolean>', '[boolean]');\n const optionString = `${getCliName(option)} ${param}`;\n program = program.option(\n optionString,\n option.description,\n coersions[option.type],\n );\n }\n });\n\n /* oxlint-disable no-console -- intentional: CLI help output */\n /* istanbul ignore next */\n function helpConsole(): void {\n console.log(' Examples:');\n console.log('');\n console.log(' $ renovate --token 123test singapore/lint-condo');\n console.log(\n ' $ LOG_LEVEL=debug renovate --labels=renovate,dependency --ignore-unstable=false singapore/lint-condo',\n );\n console.log(' $ renovate singapore/lint-condo singapore/package-test');\n console.log(\n ` $ renovate singapore/lint-condo --onboarding-config='{\"extends\":[\"config:recommended\"]}'`,\n );\n /* oxlint-enable no-console */\n }\n\n return program\n .version(pkg.version, '-v, --version')\n .on('--help', helpConsole);\n}\n\
|
|
1
|
+
{"version":3,"file":"cli.js","names":[],"sources":["../../../../../lib/workers/global/config/parse/cli.ts"],"sourcesContent":["import { Command } from 'commander';\nimport { getOptions } from '../../../../config/options/index.ts';\nimport type { AllConfig } from '../../../../config/types.ts';\nimport { pkg } from '../../../../expose.ts';\nimport { logger } from '../../../../logger/index.ts';\nimport { regEx } from '../../../../util/regex.ts';\nimport { coersions } from './coersions.ts';\nimport type { ParseConfigOptions } from './types.ts';\n\nexport function getCliName(option: ParseConfigOptions): string {\n if (option.cli === false) {\n return '';\n }\n const nameWithHyphens = option.name.replace(regEx(/([A-Z])/g), '-$1');\n return `--${nameWithHyphens.toLowerCase()}`;\n}\n\nfunction createProgram(): Command<[string[]]> {\n const options = getOptions();\n\n let program = new Command().arguments('[repositories...]');\n\n options.forEach((option) => {\n if (option.cli !== false) {\n const param = `<${option.type}>`.replace('<boolean>', '[boolean]');\n const optionString = `${getCliName(option)} ${param}`;\n program = program.option(\n optionString,\n option.description,\n coersions[option.type],\n );\n }\n });\n\n /* oxlint-disable no-console -- intentional: CLI help output */\n /* istanbul ignore next */\n function helpConsole(): void {\n console.log(' Examples:');\n console.log('');\n console.log(' $ renovate --token 123test singapore/lint-condo');\n console.log(\n ' $ LOG_LEVEL=debug renovate --labels=renovate,dependency --ignore-unstable=false singapore/lint-condo',\n );\n console.log(' $ renovate singapore/lint-condo singapore/package-test');\n console.log(\n ` $ renovate singapore/lint-condo --onboarding-config='{\"extends\":[\"config:recommended\"]}'`,\n );\n /* oxlint-enable no-console */\n }\n\n return program\n .version(pkg.version, '-v, --version')\n .on('--help', helpConsole);\n}\n\n/**\n * Massage migrated configuration keys.\n * This must run before any Commander parse call so that\n * deprecated/bare flags like `--dry-run` (no value) are rewritten\n * before Commander tries to consume them.\n */\nfunction migrateArgs(input: string[]): string[] {\n return input\n .map((a) =>\n a\n .replace(\n '--allow-post-upgrade-command-templating',\n '--allow-command-templating',\n )\n .replace('--allowed-post-upgrade-commands', '--allowed-commands')\n .replace('--endpoints=', '--host-rules=')\n .replace('--expose-env=true', '--trust-level=high')\n .replace('--expose-env', '--trust-level=high')\n .replace('--renovate-fork', '--include-forks')\n .replace('\"platform\":\"', '\"hostType\":\"')\n .replace('\"endpoint\":\"', '\"matchHost\":\"')\n .replace('\"host\":\"', '\"matchHost\":\"')\n .replace('--azure-auto-complete', '--platform-automerge') // migrate: azureAutoComplete\n .replace('--git-lab-automerge', '--platform-automerge') // migrate: gitLabAutomerge\n .replace(/^--dry-run$/, '--dry-run=true')\n .replace(/^--require-config$/, '--require-config=true')\n .replace('--aliases', '--registry-aliases')\n .replace('--include-forks=true', '--fork-processing=enabled')\n .replace('--include-forks', '--fork-processing=enabled')\n .replace('--recreate-closed=false', '--recreate-when=auto')\n .replace('--recreate-closed=true', '--recreate-when=always')\n .replace('--recreate-closed', '--recreate-when=always'),\n )\n .filter((a) => !a.startsWith('--git-fs'));\n}\n\nexport function parseEarlyFlags(input: string[] = process.argv): void {\n createProgram()\n .allowUnknownOption()\n .allowExcessArguments()\n .parse(migrateArgs(input));\n}\n\nexport function getConfig(input: string[]): AllConfig {\n const argv = migrateArgs(input);\n const options = getOptions();\n\n const config: Record<string, any> = {};\n\n createProgram()\n .action((repositories: string[], opts: Record<string, unknown>) => {\n if (repositories?.length) {\n config.repositories = repositories;\n }\n\n for (const option of options) {\n if (option.cli !== false) {\n if (opts[option.name] !== undefined) {\n config[option.name] = opts[option.name];\n if (option.name === 'dryRun') {\n if (config[option.name] === 'true') {\n logger.warn(\n 'cli config dryRun property has been changed to full',\n );\n config[option.name] = 'full';\n } else if (config[option.name] === 'false') {\n logger.warn(\n 'cli config dryRun property has been changed to null',\n );\n config[option.name] = null;\n } else if (config[option.name] === 'null') {\n config[option.name] = null;\n }\n }\n if (option.name === 'requireConfig') {\n if (config[option.name] === 'true') {\n logger.warn(\n 'cli config requireConfig property has been changed to required',\n );\n config[option.name] = 'required';\n } else if (config[option.name] === 'false') {\n logger.warn(\n 'cli config requireConfig property has been changed to optional',\n );\n config[option.name] = 'optional';\n }\n }\n }\n }\n }\n })\n .parse(argv);\n\n return config;\n}\n"],"mappings":";;;;;;;AASA,SAAgB,WAAW,QAAoC;AAC7D,KAAI,OAAO,QAAQ,MACjB,QAAO;AAGT,QAAO,KADiB,OAAO,KAAK,QAAQ,MAAM,WAAW,EAAE,MAAM,CACzC,aAAa;;AAG3C,SAAS,gBAAqC;CAC5C,MAAM,UAAU,YAAY;CAE5B,IAAI,UAAU,IAAI,SAAS,CAAC,UAAU,oBAAoB;AAE1D,SAAQ,SAAS,WAAW;AAC1B,MAAI,OAAO,QAAQ,OAAO;GACxB,MAAM,QAAQ,IAAI,OAAO,KAAK,GAAG,QAAQ,aAAa,YAAY;GAClE,MAAM,eAAe,GAAG,WAAW,OAAO,CAAC,GA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,gBAAe,CACZ,QAAQ,cAAwB,SAAkC;AACjE,MAAI,cAAc,OAChB,QAAO,eAAe;AAGxB,OAAK,MAAM,UAAU,QACnB,KAAI,OAAO,QAAQ;OACb,KAAK,OAAO,UAAU,KAAA,GAAW;AACnC,WAAO,OAAO,QAAQ,KAAK,OAAO;AAClC,QAAI,OAAO,SAAS;SACd,OAAO,OAAO,UAAU,QAAQ;AAClC,aAAO,KACL,sDACD;AACD,aAAO,OAAO,QAAQ;gBACb,OAAO,OAAO,UAAU,SAAS;AAC1C,aAAO,KACL,sDACD;AACD,aAAO,OAAO,QAAQ;gBACb,OAAO,OAAO,UAAU,OACjC,QAAO,OAAO,QAAQ;;AAG1B,QAAI,OAAO,SAAS;SACd,OAAO,OAAO,UAAU,QAAQ;AAClC,aAAO,KACL,iEACD;AACD,aAAO,OAAO,QAAQ;gBACb,OAAO,OAAO,UAAU,SAAS;AAC1C,aAAO,KACL,iEACD;AACD,aAAO,OAAO,QAAQ;;;;;GAMhC,CACD,MAAM,KAAK;AAEd,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "renovate",
|
|
3
3
|
"description": "Automated dependency updates. Flexible so you don't need to be.",
|
|
4
|
-
"version": "43.
|
|
4
|
+
"version": "43.104.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"renovate": "dist/renovate.js",
|
|
@@ -138,7 +138,6 @@
|
|
|
138
138
|
"changelog-filename-regex": "2.0.1",
|
|
139
139
|
"clean-git-ref": "2.0.1",
|
|
140
140
|
"commander": "14.0.3",
|
|
141
|
-
"conventional-commits-detector": "1.0.3",
|
|
142
141
|
"croner": "10.0.1",
|
|
143
142
|
"cronstrue": "3.14.0",
|
|
144
143
|
"deepmerge": "4.3.1",
|
|
@@ -234,7 +233,6 @@
|
|
|
234
233
|
"@types/changelog-filename-regex": "2.0.2",
|
|
235
234
|
"@types/clean-git-ref": "2.0.2",
|
|
236
235
|
"@types/common-tags": "1.8.4",
|
|
237
|
-
"@types/conventional-commits-detector": "1.0.2",
|
|
238
236
|
"@types/eslint-config-prettier": "6.11.3",
|
|
239
237
|
"@types/fs-extra": "11.0.4",
|
|
240
238
|
"@types/github-url-from-git": "1.5.3",
|
|
@@ -259,7 +257,7 @@
|
|
|
259
257
|
"@types/semver-utils": "1.1.3",
|
|
260
258
|
"@types/tmp": "0.2.6",
|
|
261
259
|
"@types/validate-npm-package-name": "4.0.2",
|
|
262
|
-
"@vitest/coverage-v8": "4.1.
|
|
260
|
+
"@vitest/coverage-v8": "4.1.2",
|
|
263
261
|
"ajv": "8.18.0",
|
|
264
262
|
"ajv-formats": "3.0.1",
|
|
265
263
|
"aws-sdk-client-mock": "4.1.0",
|
|
@@ -297,7 +295,7 @@
|
|
|
297
295
|
"unified": "11.0.5",
|
|
298
296
|
"vite": "8.0.0-beta.18",
|
|
299
297
|
"vite-tsconfig-paths": "6.1.1",
|
|
300
|
-
"vitest": "4.1.
|
|
298
|
+
"vitest": "4.1.2",
|
|
301
299
|
"vitest-mock-extended": "3.1.0"
|
|
302
300
|
},
|
|
303
301
|
"files": [
|
package/renovate-schema.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$id": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
-
"title": "JSON schema for Renovate 43.
|
|
3
|
+
"title": "JSON schema for Renovate 43.104.1 config files (https://renovatebot.com/)",
|
|
4
4
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
-
"x-renovate-version": "43.
|
|
5
|
+
"x-renovate-version": "43.104.1",
|
|
6
6
|
"allowComments": true,
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|