renovate 44.87.1 → 44.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/data/java-version-lts.js +12 -0
  2. package/dist/data/java-version-lts.js.map +1 -0
  3. package/dist/modules/datasource/java-version/schema.js +1 -0
  4. package/dist/modules/datasource/java-version/schema.js.map +1 -1
  5. package/dist/modules/manager/fingerprint.generated.js +2 -2
  6. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  7. package/dist/modules/manager/github-actions/known-actions.js +20 -0
  8. package/dist/modules/manager/github-actions/known-actions.js.map +1 -1
  9. package/dist/modules/manager/maven-wrapper/extract.js +1 -1
  10. package/dist/modules/manager/maven-wrapper/extract.js.map +1 -1
  11. package/dist/modules/manager/mise/artifacts.js +9 -7
  12. package/dist/modules/manager/mise/artifacts.js.map +1 -1
  13. package/dist/modules/manager/mise/extract.js +84 -16
  14. package/dist/modules/manager/mise/extract.js.map +1 -1
  15. package/dist/modules/manager/mise/lockfile.js +9 -2
  16. package/dist/modules/manager/mise/lockfile.js.map +1 -1
  17. package/dist/modules/manager/mise/schema.js.map +1 -1
  18. package/dist/modules/manager/mise/update-locked.js +55 -3
  19. package/dist/modules/manager/mise/update-locked.js.map +1 -1
  20. package/dist/modules/manager/types.d.ts +13 -0
  21. package/dist/util/toml.js +5 -3
  22. package/dist/util/toml.js.map +1 -1
  23. package/dist/workers/repository/process/lookup/generate.js +3 -2
  24. package/dist/workers/repository/process/lookup/generate.js.map +1 -1
  25. package/dist/workers/repository/process/lookup/index.js +7 -4
  26. package/dist/workers/repository/process/lookup/index.js.map +1 -1
  27. package/dist/workers/repository/update/branch/get-updated.js +41 -0
  28. package/dist/workers/repository/update/branch/get-updated.js.map +1 -1
  29. package/package.json +2 -1
  30. package/renovate-schema.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"extract.js","names":[],"sources":["../../../../lib/modules/manager/mise/extract.ts"],"sourcesContent":["import {\n isArray,\n isFunction,\n isNonEmptyObject,\n isNonEmptyString,\n isObject,\n isString,\n} from '@sindresorhus/is';\nimport { logger } from '../../../logger/index.ts';\nimport { readLocalFile } from '../../../util/fs/index.ts';\nimport { coerceObject } from '../../../util/object.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport type { StaticTooling } from '../asdf/types.ts';\nimport type { PackageDependency, PackageFileContent } from '../types.ts';\nimport {\n createAquaToolConfig,\n createCargoToolConfig,\n createDotnetToolConfig,\n createGemToolConfig,\n createGithubToolConfig,\n createGitlabToolConfig,\n createGoToolConfig,\n createNpmToolConfig,\n createPipxToolConfig,\n createSpmToolConfig,\n createUbiToolConfig,\n} from './backends.ts';\nimport { getLockFileName, getLockedVersion } from './lockfile.ts';\nimport type { MiseTool, MiseToolOptions } from './schema.ts';\nimport { MiseLockFile } from './schema.ts';\nimport type { BackendToolingConfig, ToolingDefinition } from './types.ts';\nimport {\n asdfTooling,\n getOrderedMiseRegistryBackends,\n miseTooling,\n} from './upgradeable-tooling.ts';\nimport { parseTomlFile } from './utils.ts';\n\n// Tool names can have options in the tool name\n// e.g. ubi:tamasfe/taplo[matching=full,exe=taplo]\nconst optionInToolNameRegex = regEx(/^(?<name>.+?)(?:\\[(?<options>.+)\\])?$/);\n\n/**\n * Extracts mise tool dependencies from a mise configuration file.\n * Supports various backends (core, asdf, aqua, cargo, etc.) and\n * extracts locked versions when a corresponding lock file exists.\n */\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n): Promise<PackageFileContent | null> {\n logger.trace(`mise.extractPackageFile(${packageFile})`);\n\n const misefile = parseTomlFile(content, packageFile);\n if (!misefile) {\n return null;\n }\n\n const deps: PackageDependency[] = [];\n\n for (const [name, toolData] of Object.entries(misefile.tools)) {\n deps.push(extractToolEntry(name, toolData, 'tools'));\n }\n\n for (const [taskName, taskData] of Object.entries(misefile.tasks)) {\n for (const [name, toolData] of Object.entries(\n coerceObject(taskData.tools),\n )) {\n deps.push(extractToolEntry(name, toolData, `task-${taskName}-tools`));\n }\n }\n\n if (!deps.length) {\n return null;\n }\n\n const result: PackageFileContent = { deps };\n\n const lockFileName = getLockFileName(packageFile);\n const lockFileContent = await readLocalFile(lockFileName, 'utf8');\n\n if (lockFileContent) {\n const lockFileParsed = MiseLockFile.safeParse(lockFileContent);\n if (lockFileParsed.success) {\n result.lockFiles = [lockFileName];\n for (const dep of deps) {\n const lockedVersion = getLockedVersion(\n lockFileParsed.data,\n dep.depName!,\n );\n if (lockedVersion) {\n dep.lockedVersion = lockedVersion;\n }\n }\n } else {\n logger.debug(\n { lockFileName, err: lockFileParsed.error },\n 'Failed to parse mise lock file',\n );\n }\n }\n\n return result;\n}\n\nfunction parseVersion(toolData: MiseTool): string | null {\n if (isNonEmptyString(toolData)) {\n // Handle the string case\n // e.g. 'erlang = \"23.3\"'\n return toolData;\n }\n if (isArray(toolData, isString)) {\n // Handle the array case\n // e.g. 'erlang = [\"23.3\", \"24.0\"]'\n return toolData.length ? toolData[0] : null; // Get the first version in the array\n }\n if (isObject(toolData) && isNonEmptyString(toolData.version)) {\n // Handle the object case with a string version\n // e.g. 'python = { version = \"3.11.2\" }'\n return toolData.version;\n }\n return null; // Return null if no version is found\n}\n\nfunction parseOptions(\n optionsInName: string,\n toolOptions: MiseToolOptions,\n): MiseToolOptions {\n const options = isNonEmptyString(optionsInName)\n ? Object.fromEntries(\n optionsInName.split(',').map((option) => option.split('=', 2)),\n )\n : {};\n // Options in toolOptions will override options in the tool name\n return {\n ...options,\n ...toolOptions,\n };\n}\n\nfunction getToolConfig(\n backend: string,\n toolName: string,\n version: string,\n toolOptions: MiseToolOptions,\n): StaticTooling | BackendToolingConfig | null {\n switch (backend) {\n case '': {\n // If the tool name does not specify a backend, it should be a short name or an alias defined by users\n const staticResult = getRegistryToolConfig(toolName, version);\n if (staticResult) {\n return staticResult;\n }\n\n // Otherwise, see if we have any known short tool names that are in the `mise-registry.json` data file\n const backends = getOrderedMiseRegistryBackends(toolName);\n\n // prioritise the github backend as the best source for data\n if (backends.github) {\n const result = getToolConfig(\n 'github',\n backends.github,\n version,\n toolOptions,\n );\n // v8 ignore else -- TODO: add test #40625\n if (result !== null) {\n return result;\n }\n }\n\n for (const [backendType, backendName] of Object.entries(backends)) {\n const result = getToolConfig(\n backendType,\n backendName,\n version,\n toolOptions,\n );\n // v8 ignore else -- TODO: add test #40625\n if (result !== null) {\n return result;\n }\n }\n return null;\n }\n // We can specify core, asdf, vfox, aqua backends for tools in the default registry\n // e.g. 'core:rust', 'asdf:rust', 'vfox:clang', 'aqua:act'\n case 'core':\n return getConfigFromTooling(miseTooling, toolName, version);\n case 'asdf':\n return getConfigFromTooling(asdfTooling, toolName, version);\n case 'vfox':\n return getRegistryToolConfig(toolName, version);\n case 'aqua':\n return (\n getRegistryToolConfig(toolName, version) ??\n createAquaToolConfig(toolName, version)\n );\n case 'cargo':\n return createCargoToolConfig(toolName, version);\n case 'dotnet':\n return createDotnetToolConfig(toolName);\n case 'gem':\n return createGemToolConfig(toolName);\n case 'github':\n return createGithubToolConfig(toolName, version, toolOptions);\n case 'gitlab':\n return createGitlabToolConfig(toolName, version, toolOptions);\n case 'go':\n return createGoToolConfig(toolName);\n case 'npm':\n return createNpmToolConfig(toolName);\n case 'pipx':\n return createPipxToolConfig(toolName);\n case 'spm':\n return createSpmToolConfig(toolName);\n case 'ubi':\n return createUbiToolConfig(toolName, version, toolOptions);\n default:\n // Unsupported backend\n return null;\n }\n}\n\n/**\n * Get the tooling config for a short name defined in the default registry\n * @link https://mise.jdx.dev/registry.html\n */\nfunction getRegistryToolConfig(\n short: string,\n version: string,\n): StaticTooling | null {\n // Try to get the config from miseTooling first, then asdfTooling\n return (\n getConfigFromTooling(miseTooling, short, version) ??\n getConfigFromTooling(asdfTooling, short, version)\n );\n}\n\nfunction getConfigFromTooling(\n toolingSource: Record<string, ToolingDefinition>,\n name: string,\n version: string,\n): StaticTooling | null {\n const toolDefinition = toolingSource[name];\n if (!toolDefinition) {\n return null;\n } // Return null if no toolDefinition is found\n\n return (\n (isFunction(toolDefinition.config)\n ? toolDefinition.config(version)\n : toolDefinition.config) ?? null\n ); // Ensure null is returned instead of undefined\n}\n\nfunction extractToolEntry(\n name: string,\n toolData: MiseTool,\n depType: string,\n): PackageDependency {\n const version = parseVersion(toolData);\n const { name: depName, options: optionsInName } = optionInToolNameRegex.exec(\n name.trim(),\n )!.groups!;\n const delimiterIndex = depName.indexOf(':');\n const backend = depName.substring(0, delimiterIndex);\n const toolName = depName.substring(delimiterIndex + 1);\n const options = parseOptions(\n optionsInName,\n isNonEmptyObject(toolData) ? toolData : {},\n );\n const toolConfig =\n version === null\n ? null\n : getToolConfig(backend, toolName, version, options);\n return createDependency(depName, version, toolConfig, depType);\n}\n\nfunction createDependency(\n name: string,\n version: string | null,\n config: StaticTooling | BackendToolingConfig | null,\n depType: string,\n): PackageDependency {\n if (version === null) {\n return {\n depName: name,\n depType,\n skipReason: 'unspecified-version',\n };\n }\n if (config === null) {\n return {\n depName: name,\n depType,\n skipReason: 'unsupported-datasource',\n };\n }\n\n return {\n depName: name,\n depType,\n currentValue: version,\n // Spread the config last to override other properties\n ...config,\n };\n}\n"],"mappings":";;;;;;;;;;;AAwCA,MAAM,wBAAwB,MAAM,uCAAuC;;;;;;AAO3E,eAAsB,mBACpB,SACA,aACoC;CACpC,OAAO,MAAM,2BAA2B,YAAY,EAAE;CAEtD,MAAM,WAAW,cAAc,SAAS,WAAW;CACnD,IAAI,CAAC,UACH,OAAO;CAGT,MAAM,OAA4B,CAAC;CAEnC,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,SAAS,KAAK,GAC1D,KAAK,KAAK,iBAAiB,MAAM,UAAU,OAAO,CAAC;CAGrD,KAAK,MAAM,CAAC,UAAU,aAAa,OAAO,QAAQ,SAAS,KAAK,GAC9D,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QACpC,aAAa,SAAS,KAAK,CAC7B,GACE,KAAK,KAAK,iBAAiB,MAAM,UAAU,QAAQ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AiB,QAAQ,QAAQ,GAAG;CAC1C,MAAM,UAAU,QAAQ,UAAU,GAAG,cAAc;CACnD,MAAM,WAAW,QAAQ,UAAU,iBAAiB,CAAC;CACrD,MAAM,UAAU,aACd,eACA,iBAAiB,QAAQ,IAAI,WAAW,CAAC,CAC3C;CAKA,OAAO,iBAAiB,SAAS,SAH/B,YAAY,OACR,OACA,cAAc,SAAS,UAAU,SAAS,OAAO,GACD,OAAO;AAC/D;AAEA,SAAS,iBACP,MACA,SACA,QACA,SACmB;CACnB,IAAI,YAAY,MACd,OAAO;EACL,SAAS;EACT;EACA,YAAY;CACd;CAEF,IAAI,WAAW,MACb,OAAO;EACL,SAAS;EACT;EACA,YAAY;CACd;CAGF,OAAO;EACL,SAAS;EACT;EACA,cAAc;EAEd,GAAG;CACL;AACF"}
1
+ {"version":3,"file":"extract.js","names":[],"sources":["../../../../lib/modules/manager/mise/extract.ts"],"sourcesContent":["import {\n isArray,\n isFunction,\n isNonEmptyObject,\n isNonEmptyString,\n isObject,\n isString,\n} from '@sindresorhus/is';\nimport javaLtsVersions from '../../../data/java-version-lts.json' with { type: 'json' };\nimport { logger } from '../../../logger/index.ts';\nimport { readLocalFile } from '../../../util/fs/index.ts';\nimport { coerceObject } from '../../../util/object.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases/index.ts';\nimport { JavaVersionDatasource } from '../../datasource/java-version/index.ts';\nimport { NodeVersionDatasource } from '../../datasource/node-version/index.ts';\nimport type { StaticTooling } from '../asdf/types.ts';\nimport type { PackageDependency, PackageFileContent } from '../types.ts';\nimport {\n createAquaToolConfig,\n createCargoToolConfig,\n createDotnetToolConfig,\n createGemToolConfig,\n createGithubToolConfig,\n createGitlabToolConfig,\n createGoToolConfig,\n createNpmToolConfig,\n createPipxToolConfig,\n createSpmToolConfig,\n createUbiToolConfig,\n} from './backends.ts';\nimport { getLockFileName, getLockedVersion } from './lockfile.ts';\nimport type { MiseTool, MiseToolOptions } from './schema.ts';\nimport { MiseLockFile } from './schema.ts';\nimport type { BackendToolingConfig, ToolingDefinition } from './types.ts';\nimport {\n asdfTooling,\n getOrderedMiseRegistryBackends,\n miseTooling,\n} from './upgradeable-tooling.ts';\nimport { parseTomlFile } from './utils.ts';\n\n// Tool names can have options in the tool name\n// e.g. ubi:tamasfe/taplo[matching=full,exe=taplo]\nconst optionInToolNameRegex = regEx(/^(?<name>.+?)(?:\\[(?<options>.+)\\])?$/);\nconst nonVersionSelectorRegex = regEx(/^(?:ref:|path:|sub-\\d+(?::|$))/);\nconst partialSelectorRegex = regEx(\n /^(?<prefix>[^\\d]*)(?<major>\\d+)(?:\\.(?<minor>\\d+))?$/,\n);\nconst versionPrefixRegex = regEx(/^(?<prefix>[^\\d]*)\\d/);\n\ntype MiseDependency = PackageDependency & { depName: string };\n\ninterface MiseSelectorConfig {\n allowedVersions?: string;\n ignoreUnstable?: boolean;\n}\n\n/**\n * Extracts mise tool dependencies from a mise configuration file.\n * Supports various backends (core, asdf, aqua, cargo, etc.) and\n * extracts locked versions when a corresponding lock file exists.\n */\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n): Promise<PackageFileContent | null> {\n logger.trace(`mise.extractPackageFile(${packageFile})`);\n\n const misefile = parseTomlFile(content, packageFile);\n if (!misefile) {\n return null;\n }\n\n const toolEntries: [string, MiseTool, string][] = [];\n\n for (const [name, toolData] of Object.entries(misefile.tools)) {\n toolEntries.push([name, toolData, 'tools']);\n }\n\n for (const [taskName, taskData] of Object.entries(misefile.tasks)) {\n for (const [name, toolData] of Object.entries(\n coerceObject(taskData.tools),\n )) {\n toolEntries.push([name, toolData, `task-${taskName}-tools`]);\n }\n }\n\n if (!toolEntries.length) {\n return null;\n }\n\n const lockFileName = getLockFileName(packageFile);\n const lockFileContent = await readLocalFile(lockFileName, 'utf8');\n let lockFileData: MiseLockFile | undefined;\n if (lockFileContent) {\n const lockFileParsed = MiseLockFile.safeParse(lockFileContent);\n if (lockFileParsed.success) {\n lockFileData = lockFileParsed.data;\n } else {\n logger.debug(\n { lockFileName, err: lockFileParsed.error },\n 'Failed to parse mise lock file',\n );\n }\n }\n\n const deps = toolEntries.map(([name, toolData, depType]) =>\n extractToolEntry(name, toolData, depType, lockFileData),\n );\n const result: PackageFileContent = { deps };\n\n if (lockFileData) {\n result.lockFiles = [lockFileName];\n }\n\n return result;\n}\n\nfunction parseVersion(toolData: MiseTool): string | null {\n if (isNonEmptyString(toolData)) {\n // Handle the string case\n // e.g. 'erlang = \"23.3\"'\n return toolData;\n }\n if (isArray(toolData, isString)) {\n // Handle the array case\n // e.g. 'erlang = [\"23.3\", \"24.0\"]'\n return toolData.length ? toolData[0] : null; // Get the first version in the array\n }\n if (isObject(toolData) && isNonEmptyString(toolData.version)) {\n // Handle the object case with a string version\n // e.g. 'python = { version = \"3.11.2\" }'\n return toolData.version;\n }\n return null; // Return null if no version is found\n}\n\nfunction parseOptions(\n optionsInName: string,\n toolOptions: MiseToolOptions,\n): MiseToolOptions {\n const options = isNonEmptyString(optionsInName)\n ? Object.fromEntries(\n optionsInName.split(',').map((option) => option.split('=', 2)),\n )\n : {};\n // Options in toolOptions will override options in the tool name\n return {\n ...options,\n ...toolOptions,\n };\n}\n\nfunction getToolConfig(\n backend: string,\n toolName: string,\n version: string,\n toolOptions: MiseToolOptions,\n): StaticTooling | BackendToolingConfig | null {\n switch (backend) {\n case '': {\n // If the tool name does not specify a backend, it should be a short name or an alias defined by users\n const staticResult = getRegistryToolConfig(toolName, version);\n if (staticResult) {\n return staticResult;\n }\n\n // Otherwise, see if we have any known short tool names that are in the `mise-registry.json` data file\n const backends = getOrderedMiseRegistryBackends(toolName);\n\n // prioritise the github backend as the best source for data\n if (backends.github) {\n const result = getToolConfig(\n 'github',\n backends.github,\n version,\n toolOptions,\n );\n // v8 ignore else -- TODO: add test #40625\n if (result !== null) {\n return result;\n }\n }\n\n for (const [backendType, backendName] of Object.entries(backends)) {\n const result = getToolConfig(\n backendType,\n backendName,\n version,\n toolOptions,\n );\n // v8 ignore else -- TODO: add test #40625\n if (result !== null) {\n return result;\n }\n }\n return null;\n }\n // We can specify core, asdf, vfox, aqua backends for tools in the default registry\n // e.g. 'core:rust', 'asdf:rust', 'vfox:clang', 'aqua:act'\n case 'core':\n return getConfigFromTooling(miseTooling, toolName, version);\n case 'asdf':\n return getConfigFromTooling(asdfTooling, toolName, version);\n case 'vfox':\n return getRegistryToolConfig(toolName, version);\n case 'aqua':\n return (\n getRegistryToolConfig(toolName, version) ??\n createAquaToolConfig(toolName, version)\n );\n case 'cargo':\n return createCargoToolConfig(toolName, version);\n case 'dotnet':\n return createDotnetToolConfig(toolName);\n case 'gem':\n return createGemToolConfig(toolName);\n case 'github':\n return createGithubToolConfig(toolName, version, toolOptions);\n case 'gitlab':\n return createGitlabToolConfig(toolName, version, toolOptions);\n case 'go':\n return createGoToolConfig(toolName);\n case 'npm':\n return createNpmToolConfig(toolName);\n case 'pipx':\n return createPipxToolConfig(toolName);\n case 'spm':\n return createSpmToolConfig(toolName);\n case 'ubi':\n return createUbiToolConfig(toolName, version, toolOptions);\n default:\n // Unsupported backend\n return null;\n }\n}\n\n/**\n * Get the tooling config for a short name defined in the default registry\n * @link https://mise.jdx.dev/registry.html\n */\nfunction getRegistryToolConfig(\n short: string,\n version: string,\n): StaticTooling | null {\n // Try to get the config from miseTooling first, then asdfTooling\n return (\n getConfigFromTooling(miseTooling, short, version) ??\n getConfigFromTooling(asdfTooling, short, version)\n );\n}\n\nfunction getConfigFromTooling(\n toolingSource: Record<string, ToolingDefinition>,\n name: string,\n version: string,\n): StaticTooling | null {\n const toolDefinition = toolingSource[name];\n if (!toolDefinition) {\n return null;\n } // Return null if no toolDefinition is found\n\n return (\n (isFunction(toolDefinition.config)\n ? toolDefinition.config(version)\n : toolDefinition.config) ?? null\n ); // Ensure null is returned instead of undefined\n}\n\nfunction getLtsDatasource(\n backend: string,\n toolName: string,\n datasource: string | undefined,\n): string | undefined {\n if (datasource) {\n return datasource;\n }\n if ((backend === '' || backend === 'core') && toolName === 'java') {\n return JavaVersionDatasource.id;\n }\n return undefined;\n}\n\nfunction getSelectorConfig(\n version: string,\n backend: string,\n toolName: string,\n datasource: string | undefined,\n lockedVersion: string,\n): MiseSelectorConfig | null {\n if (version === 'latest') {\n return {};\n }\n\n if (version === 'lts') {\n const ltsDatasource = getLtsDatasource(backend, toolName, datasource);\n if (ltsDatasource === NodeVersionDatasource.id) {\n return { ignoreUnstable: true };\n }\n if (ltsDatasource === JavaVersionDatasource.id) {\n return {\n allowedVersions: `/^(?:${javaLtsVersions.join('|')})(?:\\\\.|-|\\\\+|$)/`,\n ignoreUnstable: true,\n };\n }\n return null;\n }\n\n if (nonVersionSelectorRegex.test(version)) {\n return null;\n }\n\n const match = partialSelectorRegex.exec(version);\n if (!match?.groups || lockedVersion === version) {\n return null;\n }\n\n const { prefix, major, minor } = match.groups;\n const lockedPrefix = versionPrefixRegex.exec(lockedVersion)?.groups?.prefix;\n const effectivePrefix = prefix || lockedPrefix;\n let prefixPattern = '';\n if (effectivePrefix) {\n prefixPattern = `(?:${RegExp.escape(effectivePrefix)})?`;\n } else if (\n datasource === GithubReleasesDatasource.id ||\n datasource === NodeVersionDatasource.id\n ) {\n prefixPattern = `(?:${RegExp.escape('v')})?`;\n }\n const precisionPattern = minor\n ? `\\\\.${minor}(?:\\\\.|-|\\\\+|$)`\n : `(?:\\\\.|-|\\\\+|$)`;\n return {\n allowedVersions: `/^${prefixPattern}${major}${precisionPattern}/`,\n };\n}\n\nfunction extractSelectorLockedDependency(\n depName: string,\n version: string,\n backend: string,\n toolName: string,\n options: MiseToolOptions,\n toolConfig: StaticTooling | BackendToolingConfig | null,\n lockedVersion: string,\n depType: string,\n): PackageDependency | null {\n const selectorConfig = getSelectorConfig(\n version,\n backend,\n toolName,\n toolConfig?.datasource,\n lockedVersion,\n );\n if (!selectorConfig) {\n return null;\n }\n\n const resolvedToolConfig = getToolConfig(\n backend,\n toolName,\n lockedVersion,\n options,\n );\n if (!resolvedToolConfig) {\n return null;\n }\n\n const comparableLockedVersion =\n resolvedToolConfig.currentValue ?? lockedVersion;\n return {\n ...createDependency(depName, version, resolvedToolConfig, depType),\n currentValue: version,\n lockedVersion: comparableLockedVersion,\n rangeStrategy: 'update-lockfile',\n isLockfileOnly: true,\n ...selectorConfig,\n };\n}\n\nfunction extractToolEntry(\n name: string,\n toolData: MiseTool,\n depType: string,\n lockFileData?: MiseLockFile,\n): PackageDependency {\n const version = parseVersion(toolData);\n const { name: depName, options: optionsInName } = optionInToolNameRegex.exec(\n name.trim(),\n )!.groups!;\n const delimiterIndex = depName.indexOf(':');\n const backend = depName.substring(0, delimiterIndex);\n const toolName = depName.substring(delimiterIndex + 1);\n const options = parseOptions(\n optionsInName,\n isNonEmptyObject(toolData) ? toolData : {},\n );\n const toolConfig =\n version === null\n ? null\n : getToolConfig(backend, toolName, version, options);\n const dependency = createDependency(depName, version, toolConfig, depType);\n const lockedVersion = lockFileData\n ? getLockedVersion(lockFileData, dependency.depName)\n : undefined;\n\n if (version !== null && lockedVersion) {\n const selectorDependency = extractSelectorLockedDependency(\n depName,\n version,\n backend,\n toolName,\n options,\n toolConfig,\n lockedVersion,\n depType,\n );\n if (selectorDependency) {\n return selectorDependency;\n }\n }\n\n if (lockedVersion) {\n return { ...dependency, lockedVersion };\n }\n return dependency;\n}\n\nfunction getConfiguredDepName(\n config: StaticTooling | BackendToolingConfig,\n): string | undefined {\n if ('depName' in config) {\n return config.depName;\n }\n return undefined;\n}\n\nfunction createDependency(\n name: string,\n version: string | null,\n config: StaticTooling | BackendToolingConfig | null,\n depType: string,\n): MiseDependency {\n if (version === null) {\n return {\n depName: name,\n depType,\n skipReason: 'unspecified-version',\n };\n }\n if (config === null) {\n return {\n depName: name,\n depType,\n skipReason: 'unsupported-datasource',\n };\n }\n\n return {\n depType,\n currentValue: version,\n ...config,\n // Allow tooling definitions to override the parsed mise tool name.\n depName: getConfiguredDepName(config) ?? name,\n };\n}\n"],"mappings":";;;;;;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OACF;EACA,IAAI,oBACF,OAAO;CAEX;CAEA,IAAI,eACF,OAAO;EAAE,GAAG;EAAY;CAAc;CAExC,OAAO;AACT;AAEA,SAAS,qBACP,QACoB;CACpB,IAAI,aAAa,QACf,OAAO,OAAO;AAGlB;AAEA,SAAS,iBACP,MACA,SACA,QACA,SACgB;CAChB,IAAI,YAAY,MACd,OAAO;EACL,SAAS;EACT;EACA,YAAY;CACd;CAEF,IAAI,WAAW,MACb,OAAO;EACL,SAAS;EACT;EACA,YAAY;CACd;CAGF,OAAO;EACL;EACA,cAAc;EACd,GAAG;EAEH,SAAS,qBAAqB,MAAM,KAAK;CAC3C;AACF"}
@@ -59,6 +59,13 @@ function getLockFileName(configPath) {
59
59
  * doesn't couple lock file parsing to Renovate's registry coverage.
60
60
  */
61
61
  function getLockedVersion(lockFileData, depName) {
62
+ return getLockedTool(lockFileData, depName)?.[0]?.version;
63
+ }
64
+ /**
65
+ * Returns the lockfile entries for a dependency, using the same backend-name
66
+ * fallback as getLockedVersion().
67
+ */
68
+ function getLockedTool(lockFileData, depName) {
62
69
  let lockedTools = lockFileData.tools[depName];
63
70
  if (!lockedTools) {
64
71
  const delimiterIndex = depName.indexOf(":");
@@ -67,9 +74,9 @@ function getLockedVersion(lockFileData, depName) {
67
74
  lockedTools = lockFileData.tools[shortName];
68
75
  }
69
76
  }
70
- return lockedTools?.[0]?.version;
77
+ return lockedTools;
71
78
  }
72
79
  //#endregion
73
- export { getConfigType, getLockFileName, getLockedVersion };
80
+ export { getConfigType, getLockFileName, getLockedTool, getLockedVersion };
74
81
 
75
82
  //# sourceMappingURL=lockfile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"lockfile.js","names":[],"sources":["../../../../lib/modules/manager/mise/lockfile.ts"],"sourcesContent":["import upath from 'upath';\nimport { regEx } from '../../../util/regex.ts';\nimport type { MiseLockFile } from './schema.ts';\nimport type { MiseConfigType } from './types.ts';\n\n/**\n * Parses the config file name to determine its type (local, env-specific, or default).\n * Used to derive the correct lock file name and `mise lock` flags.\n */\nexport function getConfigType(configPath: string): MiseConfigType {\n const filename = upath.basename(configPath);\n const isLocal = filename.endsWith('.local.toml');\n // Patterns: mise.{env}.toml, mise.{env}.local.toml, .mise.{env}.toml, config.{env}.toml\n const envMatch = regEx(\n /^(?:\\.?mise|config)\\.(?<env>[^.]+)(?:\\.local)?\\.toml$/,\n ).exec(filename);\n const env =\n envMatch?.groups?.env === 'local' ? undefined : envMatch?.groups?.env;\n return { isLocal, env };\n}\n\n/**\n * Derives the lock file path from a mise config file path.\n * Matches mise's lockfile_path_for_config() logic from src/lockfile.rs\n */\nexport function getLockFileName(configPath: string): string {\n const dirname = upath.dirname(configPath);\n const parentDirname = upath.basename(dirname);\n\n // For conf.d files, lock file goes in parent directory\n const lockDir = parentDirname === 'conf.d' ? upath.dirname(dirname) : dirname;\n\n const { isLocal, env } = getConfigType(configPath);\n\n let lockFileName: string;\n if (env && isLocal) {\n lockFileName = `mise.${env}.local.lock`;\n } else if (env) {\n lockFileName = `mise.${env}.lock`;\n } else if (isLocal) {\n lockFileName = 'mise.local.lock';\n } else {\n lockFileName = 'mise.lock';\n }\n\n return upath.join(lockDir, lockFileName);\n}\n\n/**\n * Get the locked version for a dependency from the parsed lock file.\n *\n * Mise lock files use different key formats depending on whether a tool is in\n * the mise registry:\n * - Registry tools (e.g., node, python): key is the short name (\"node\")\n * - Non-registry tools (e.g., ubi:owner/repo): key is the full name (\"ubi:owner/repo\")\n *\n * When a user specifies \"core:node\" in their config, mise resolves it to the\n * registry short name \"node\" in the lock file. But \"aqua:cli/cli\" (not in\n * registry) stays as \"aqua:cli/cli\" in the lock file.\n *\n * We use a fallback approach (Option A) rather than checking the registry (Option B):\n *\n * Option A (implemented): Try full depName first, then try stripped short name.\n * Pros: Simple, no registry dependency, works even if Renovate's registry\n * is out of sync with mise's registry.\n * Cons: Theoretical collision risk if both \"foo\" and \"backend:foo\" exist\n * in the same lock file (practically impossible - mise wouldn't generate this).\n *\n * Option B (not implemented): Check miseTooling/asdfTooling to determine if\n * the tool is in the registry, then use short name or full name accordingly.\n * Pros: Matches mise's exact logic.\n * Cons: More complex, requires passing registry data, fails if Renovate's\n * registry doesn't include a tool that mise's registry does.\n *\n * Option A is preferred because it's simpler, has no practical downsides, and\n * doesn't couple lock file parsing to Renovate's registry coverage.\n */\nexport function getLockedVersion(\n lockFileData: MiseLockFile,\n depName: string,\n): string | undefined {\n // Try full name first (for non-registry tools like ubi:, aqua:)\n let lockedTools = lockFileData.tools[depName];\n\n // If not found and has backend prefix, try stripped name (for registry tools)\n if (!lockedTools) {\n const delimiterIndex = depName.indexOf(':');\n if (delimiterIndex !== -1) {\n const shortName = depName.substring(delimiterIndex + 1);\n lockedTools = lockFileData.tools[shortName];\n }\n }\n\n return lockedTools?.[0]?.version;\n}\n"],"mappings":";;;;;;;AASA,SAAgB,cAAc,YAAoC;CAChE,MAAM,WAAW,MAAM,SAAS,UAAU;CAC1C,MAAM,UAAU,SAAS,SAAS,aAAa;CAE/C,MAAM,WAAW,MACf,uDACF,CAAC,CAAC,KAAK,QAAQ;CAGf,OAAO;EAAE;EAAS,KADhB,UAAU,QAAQ,QAAQ,UAAU,KAAA,IAAY,UAAU,QAAQ;CAC9C;AACxB;;;;;AAMA,SAAgB,gBAAgB,YAA4B;CAC1D,MAAM,UAAU,MAAM,QAAQ,UAAU;CAIxC,MAAM,UAHgB,MAAM,SAAS,OAGT,MAAM,WAAW,MAAM,QAAQ,OAAO,IAAI;CAEtE,MAAM,EAAE,SAAS,QAAQ,cAAc,UAAU;CAEjD,IAAI;CACJ,IAAI,OAAO,SACT,eAAe,QAAQ,IAAI;MACtB,IAAI,KACT,eAAe,QAAQ,IAAI;MACtB,IAAI,SACT,eAAe;MAEf,eAAe;CAGjB,OAAO,MAAM,KAAK,SAAS,YAAY;AACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,iBACd,cACA,SACoB;CAEpB,IAAI,cAAc,aAAa,MAAM;CAGrC,IAAI,CAAC,aAAa;EAChB,MAAM,iBAAiB,QAAQ,QAAQ,GAAG;EAC1C,IAAI,mBAAmB,IAAI;GACzB,MAAM,YAAY,QAAQ,UAAU,iBAAiB,CAAC;GACtD,cAAc,aAAa,MAAM;EACnC;CACF;CAEA,OAAO,cAAc,EAAE,EAAE;AAC3B"}
1
+ {"version":3,"file":"lockfile.js","names":[],"sources":["../../../../lib/modules/manager/mise/lockfile.ts"],"sourcesContent":["import upath from 'upath';\nimport { regEx } from '../../../util/regex.ts';\nimport type { MiseLockFile, MiseLockTool } from './schema.ts';\nimport type { MiseConfigType } from './types.ts';\n\n/**\n * Parses the config file name to determine its type (local, env-specific, or default).\n * Used to derive the correct lock file name and `mise lock` flags.\n */\nexport function getConfigType(configPath: string): MiseConfigType {\n const filename = upath.basename(configPath);\n const isLocal = filename.endsWith('.local.toml');\n // Patterns: mise.{env}.toml, mise.{env}.local.toml, .mise.{env}.toml, config.{env}.toml\n const envMatch = regEx(\n /^(?:\\.?mise|config)\\.(?<env>[^.]+)(?:\\.local)?\\.toml$/,\n ).exec(filename);\n const env =\n envMatch?.groups?.env === 'local' ? undefined : envMatch?.groups?.env;\n return { isLocal, env };\n}\n\n/**\n * Derives the lock file path from a mise config file path.\n * Matches mise's lockfile_path_for_config() logic from src/lockfile.rs\n */\nexport function getLockFileName(configPath: string): string {\n const dirname = upath.dirname(configPath);\n const parentDirname = upath.basename(dirname);\n\n // For conf.d files, lock file goes in parent directory\n const lockDir = parentDirname === 'conf.d' ? upath.dirname(dirname) : dirname;\n\n const { isLocal, env } = getConfigType(configPath);\n\n let lockFileName: string;\n if (env && isLocal) {\n lockFileName = `mise.${env}.local.lock`;\n } else if (env) {\n lockFileName = `mise.${env}.lock`;\n } else if (isLocal) {\n lockFileName = 'mise.local.lock';\n } else {\n lockFileName = 'mise.lock';\n }\n\n return upath.join(lockDir, lockFileName);\n}\n\n/**\n * Get the locked version for a dependency from the parsed lock file.\n *\n * Mise lock files use different key formats depending on whether a tool is in\n * the mise registry:\n * - Registry tools (e.g., node, python): key is the short name (\"node\")\n * - Non-registry tools (e.g., ubi:owner/repo): key is the full name (\"ubi:owner/repo\")\n *\n * When a user specifies \"core:node\" in their config, mise resolves it to the\n * registry short name \"node\" in the lock file. But \"aqua:cli/cli\" (not in\n * registry) stays as \"aqua:cli/cli\" in the lock file.\n *\n * We use a fallback approach (Option A) rather than checking the registry (Option B):\n *\n * Option A (implemented): Try full depName first, then try stripped short name.\n * Pros: Simple, no registry dependency, works even if Renovate's registry\n * is out of sync with mise's registry.\n * Cons: Theoretical collision risk if both \"foo\" and \"backend:foo\" exist\n * in the same lock file (practically impossible - mise wouldn't generate this).\n *\n * Option B (not implemented): Check miseTooling/asdfTooling to determine if\n * the tool is in the registry, then use short name or full name accordingly.\n * Pros: Matches mise's exact logic.\n * Cons: More complex, requires passing registry data, fails if Renovate's\n * registry doesn't include a tool that mise's registry does.\n *\n * Option A is preferred because it's simpler, has no practical downsides, and\n * doesn't couple lock file parsing to Renovate's registry coverage.\n */\nexport function getLockedVersion(\n lockFileData: MiseLockFile,\n depName: string,\n): string | undefined {\n return getLockedTool(lockFileData, depName)?.[0]?.version;\n}\n\n/**\n * Returns the lockfile entries for a dependency, using the same backend-name\n * fallback as getLockedVersion().\n */\nexport function getLockedTool(\n lockFileData: MiseLockFile,\n depName: string,\n): MiseLockTool[] | undefined {\n // Try full name first (for non-registry tools like ubi:, aqua:)\n let lockedTools = lockFileData.tools[depName];\n\n // If not found and has backend prefix, try stripped name (for registry tools)\n if (!lockedTools) {\n const delimiterIndex = depName.indexOf(':');\n if (delimiterIndex !== -1) {\n const shortName = depName.substring(delimiterIndex + 1);\n lockedTools = lockFileData.tools[shortName];\n }\n }\n\n return lockedTools;\n}\n"],"mappings":";;;;;;;AASA,SAAgB,cAAc,YAAoC;CAChE,MAAM,WAAW,MAAM,SAAS,UAAU;CAC1C,MAAM,UAAU,SAAS,SAAS,aAAa;CAE/C,MAAM,WAAW,MACf,uDACF,CAAC,CAAC,KAAK,QAAQ;CAGf,OAAO;EAAE;EAAS,KADhB,UAAU,QAAQ,QAAQ,UAAU,KAAA,IAAY,UAAU,QAAQ;CAC9C;AACxB;;;;;AAMA,SAAgB,gBAAgB,YAA4B;CAC1D,MAAM,UAAU,MAAM,QAAQ,UAAU;CAIxC,MAAM,UAHgB,MAAM,SAAS,OAGT,MAAM,WAAW,MAAM,QAAQ,OAAO,IAAI;CAEtE,MAAM,EAAE,SAAS,QAAQ,cAAc,UAAU;CAEjD,IAAI;CACJ,IAAI,OAAO,SACT,eAAe,QAAQ,IAAI;MACtB,IAAI,KACT,eAAe,QAAQ,IAAI;MACtB,IAAI,SACT,eAAe;MAEf,eAAe;CAGjB,OAAO,MAAM,KAAK,SAAS,YAAY;AACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,iBACd,cACA,SACoB;CACpB,OAAO,cAAc,cAAc,OAAO,CAAC,GAAG,EAAE,EAAE;AACpD;;;;;AAMA,SAAgB,cACd,cACA,SAC4B;CAE5B,IAAI,cAAc,aAAa,MAAM;CAGrC,IAAI,CAAC,aAAa;EAChB,MAAM,iBAAiB,QAAQ,QAAQ,GAAG;EAC1C,IAAI,mBAAmB,IAAI;GACzB,MAAM,YAAY,QAAQ,UAAU,iBAAiB,CAAC;GACtD,cAAc,aAAa,MAAM;EACnC;CACF;CAEA,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/manager/mise/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { Toml } from '../../../util/schema-utils/index.ts';\n\nexport const MiseRegistryJson = z.object({\n meta: z.object({\n version: z.string(),\n }),\n tools: z.record(z.string(), z.record(z.string(), z.string())),\n});\n\nconst MiseToolOptions = z.object({\n // ubi backend only\n tag_regex: z.string().optional(),\n // github and gitlab backends\n version_prefix: z.string().optional(),\n});\nexport type MiseToolOptions = z.infer<typeof MiseToolOptions>;\n\nconst MiseTool = z.union([\n z.string(),\n MiseToolOptions.extend({\n version: z.string().optional(),\n }),\n z.array(z.string()),\n]);\nexport type MiseTool = z.infer<typeof MiseTool>;\n\nconst MiseTask = z\n .object({\n tools: z.record(z.string(), MiseTool).optional(),\n })\n .passthrough()\n .catch({});\n\nexport const MiseFile = Toml.pipe(\n z.object({\n tools: z.record(z.string(), MiseTool).default({}),\n tasks: z.record(z.string(), MiseTask).default({}),\n }),\n);\nexport type MiseFile = z.infer<typeof MiseFile>;\n\nconst MiseLockTool = z.object({\n version: z.string(),\n backend: z.string().optional(),\n options: z.record(z.string(), z.string()).optional(),\n platforms: z\n .record(\n z.string(),\n z.object({\n checksum: z.string().optional(),\n size: z.number().optional(),\n url: z.string().optional(),\n }),\n )\n .optional(),\n});\n\nexport const MiseLockFile = Toml.pipe(\n z.object({\n tools: z.record(z.string(), z.array(MiseLockTool)),\n }),\n);\nexport type MiseLockFile = z.infer<typeof MiseLockFile>;\n"],"mappings":";;;AAGA,MAAa,mBAAmB,EAAE,OAAO;CACvC,MAAM,EAAE,OAAO,EACb,SAAS,EAAE,OAAO,EACpB,CAAC;CACD,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,kBAAkB,EAAE,OAAO;CAE/B,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAE/B,gBAAgB,EAAE,OAAO,CAAC,CAAC,SAAS;AACtC,CAAC;AAGD,MAAM,WAAW,EAAE,MAAM;CACvB,EAAE,OAAO;CACT,gBAAgB,OAAO,EACrB,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,EAC/B,CAAC;CACD,EAAE,MAAM,EAAE,OAAO,CAAC;AACpB,CAAC;AAGD,MAAM,WAAW,EACd,OAAO,EACN,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC,SAAS,EACjD,CAAC,CAAC,CACD,YAAY,CAAC,CACb,MAAM,CAAC,CAAC;AAEX,MAAa,WAAW,KAAK,KAC3B,EAAE,OAAO;CACP,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;CAChD,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;AAClD,CAAC,CACH;AAGA,MAAM,eAAe,EAAE,OAAO;CAC5B,SAAS,EAAE,OAAO;CAClB,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;CAC7B,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;CACnD,WAAW,EACR,OACC,EAAE,OAAO,GACT,EAAE,OAAO;EACP,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;EAC9B,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;EAC1B,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,CAAC,CACH,CAAC,CACA,SAAS;AACd,CAAC;AAED,MAAa,eAAe,KAAK,KAC/B,EAAE,OAAO,EACP,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,MAAM,YAAY,CAAC,EACnD,CAAC,CACH"}
1
+ {"version":3,"file":"schema.js","names":[],"sources":["../../../../lib/modules/manager/mise/schema.ts"],"sourcesContent":["import { z } from 'zod/v4';\nimport { Toml } from '../../../util/schema-utils/index.ts';\n\nexport const MiseRegistryJson = z.object({\n meta: z.object({\n version: z.string(),\n }),\n tools: z.record(z.string(), z.record(z.string(), z.string())),\n});\n\nconst MiseToolOptions = z.object({\n // ubi backend only\n tag_regex: z.string().optional(),\n // github and gitlab backends\n version_prefix: z.string().optional(),\n});\nexport type MiseToolOptions = z.infer<typeof MiseToolOptions>;\n\nconst MiseTool = z.union([\n z.string(),\n MiseToolOptions.extend({\n version: z.string().optional(),\n }),\n z.array(z.string()),\n]);\nexport type MiseTool = z.infer<typeof MiseTool>;\n\nconst MiseTask = z\n .object({\n tools: z.record(z.string(), MiseTool).optional(),\n })\n .passthrough()\n .catch({});\n\nexport const MiseFile = Toml.pipe(\n z.object({\n tools: z.record(z.string(), MiseTool).default({}),\n tasks: z.record(z.string(), MiseTask).default({}),\n }),\n);\nexport type MiseFile = z.infer<typeof MiseFile>;\n\nconst MiseLockTool = z.object({\n version: z.string(),\n backend: z.string().optional(),\n options: z.record(z.string(), z.string()).optional(),\n platforms: z\n .record(\n z.string(),\n z.object({\n checksum: z.string().optional(),\n size: z.number().optional(),\n url: z.string().optional(),\n }),\n )\n .optional(),\n});\nexport type MiseLockTool = z.infer<typeof MiseLockTool>;\n\nexport const MiseLockFile = Toml.pipe(\n z.object({\n tools: z.record(z.string(), z.array(MiseLockTool)),\n }),\n);\nexport type MiseLockFile = z.infer<typeof MiseLockFile>;\n"],"mappings":";;;AAGA,MAAa,mBAAmB,EAAE,OAAO;CACvC,MAAM,EAAE,OAAO,EACb,SAAS,EAAE,OAAO,EACpB,CAAC;CACD,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,kBAAkB,EAAE,OAAO;CAE/B,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAE/B,gBAAgB,EAAE,OAAO,CAAC,CAAC,SAAS;AACtC,CAAC;AAGD,MAAM,WAAW,EAAE,MAAM;CACvB,EAAE,OAAO;CACT,gBAAgB,OAAO,EACrB,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS,EAC/B,CAAC;CACD,EAAE,MAAM,EAAE,OAAO,CAAC;AACpB,CAAC;AAGD,MAAM,WAAW,EACd,OAAO,EACN,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC,SAAS,EACjD,CAAC,CAAC,CACD,YAAY,CAAC,CACb,MAAM,CAAC,CAAC;AAEX,MAAa,WAAW,KAAK,KAC3B,EAAE,OAAO;CACP,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;CAChD,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;AAClD,CAAC,CACH;AAGA,MAAM,eAAe,EAAE,OAAO;CAC5B,SAAS,EAAE,OAAO;CAClB,SAAS,EAAE,OAAO,CAAC,CAAC,SAAS;CAC7B,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;CACnD,WAAW,EACR,OACC,EAAE,OAAO,GACT,EAAE,OAAO;EACP,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;EAC9B,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;EAC1B,KAAK,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,CAAC,CACH,CAAC,CACA,SAAS;AACd,CAAC;AAGD,MAAa,eAAe,KAAK,KAC/B,EAAE,OAAO,EACP,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,MAAM,YAAY,CAAC,EACnD,CAAC,CACH"}
@@ -1,7 +1,48 @@
1
+ import { regEx } from "../../../util/regex.js";
2
+ import { safeStringify } from "../../../util/stringify.js";
1
3
  import { logger } from "../../../logger/index.js";
2
- import { getLockedVersion } from "./lockfile.js";
4
+ import { parseTOMLDocument } from "../../../util/toml.js";
5
+ import { getLockedTool } from "./lockfile.js";
3
6
  import { MiseLockFile } from "./schema.js";
7
+ import { isNullOrUndefined } from "@sindresorhus/is";
4
8
  //#region lib/modules/manager/mise/update-locked.ts
9
+ const versionPrefixRegex = regEx(/^(?<prefix>[^\d]*)\d/);
10
+ function getToolName(depName, lockFileData) {
11
+ if (lockFileData.tools[depName]) return depName;
12
+ const delimiterIndex = depName.indexOf(":");
13
+ if (delimiterIndex !== -1) {
14
+ const shortName = depName.substring(delimiterIndex + 1);
15
+ if (lockFileData.tools[shortName]) return shortName;
16
+ }
17
+ return "";
18
+ }
19
+ function formatLockedVersion(currentVersion, newVersion) {
20
+ const currentPrefix = versionPrefixRegex.exec(currentVersion)?.groups?.prefix ?? "";
21
+ const newPrefix = versionPrefixRegex.exec(newVersion)?.groups?.prefix;
22
+ if (newPrefix !== void 0) return `${currentPrefix}${newVersion.slice(newPrefix.length)}`;
23
+ return newVersion;
24
+ }
25
+ function getVersionKeyValue(key) {
26
+ if (key.keys.length !== 1) return;
27
+ const [part] = key.keys;
28
+ return part.type === "TOMLBare" ? part.name : part.value;
29
+ }
30
+ function getVersionValueNode(content, depName, lockFileData, currentVersion, newVersion) {
31
+ const toolName = getToolName(depName, lockFileData);
32
+ const lockedTools = getLockedTool(lockFileData, depName);
33
+ if (!toolName || !lockedTools?.length) return;
34
+ const toolIndex = lockedTools.length === 1 ? 0 : lockedTools.findIndex(({ version }) => version === currentVersion || formatLockedVersion(version, currentVersion) === version || version === newVersion || formatLockedVersion(version, newVersion) === version);
35
+ if (toolIndex === -1) return;
36
+ const versionKeyValue = astTableForTool(content, toolName, toolIndex)?.body.find((keyValue) => getVersionKeyValue(keyValue.key) === "version");
37
+ if (versionKeyValue?.value.type !== "TOMLValue") return;
38
+ return {
39
+ currentLockedVersion: lockedTools[toolIndex].version,
40
+ versionNode: versionKeyValue.value
41
+ };
42
+ }
43
+ function astTableForTool(content, toolName, toolIndex) {
44
+ return parseTOMLDocument(content).body[0]?.body.find((node) => node.type === "TOMLTable" && node.kind === "array" && node.resolvedKey.length === 3 && node.resolvedKey[0] === "tools" && node.resolvedKey[1] === toolName && node.resolvedKey[2] === toolIndex);
45
+ }
5
46
  function updateLockedDependency(config) {
6
47
  const { depName, newVersion, lockFile, lockFileContent } = config;
7
48
  logger.debug(`mise.updateLockedDependency: ${depName} -> ${newVersion} [${lockFile}]`);
@@ -9,8 +50,19 @@ function updateLockedDependency(config) {
9
50
  try {
10
51
  const parsed = MiseLockFile.safeParse(lockFileContent);
11
52
  if (!parsed.success) return { status: "unsupported" };
12
- if (getLockedVersion(parsed.data, depName) === newVersion) return { status: "already-updated" };
13
- return { status: "unsupported" };
53
+ const lockedVersion = getVersionValueNode(lockFileContent, depName, parsed.data, config.currentVersion, newVersion);
54
+ if (!lockedVersion) return { status: "unsupported" };
55
+ const { currentLockedVersion: currentVersionValue, versionNode } = lockedVersion;
56
+ const currentLockedVersion = lockFileContent.slice(versionNode.range[0], versionNode.range[1]);
57
+ const updatedVersion = formatLockedVersion(currentVersionValue, newVersion);
58
+ if (currentVersionValue === updatedVersion) return { status: "already-updated" };
59
+ const replacement = (currentLockedVersion.startsWith("'") ? "'" : "\"") === "'" ? `'${updatedVersion}'` : safeStringify(updatedVersion);
60
+ const files = { [lockFile]: lockFileContent.slice(0, versionNode.range[0]) + replacement + lockFileContent.slice(versionNode.range[1]) };
61
+ if (!isNullOrUndefined(config.packageFileContent)) files[config.packageFile] = config.packageFileContent;
62
+ return {
63
+ status: "updated",
64
+ files
65
+ };
14
66
  } catch (err) {
15
67
  logger.debug({ err }, "mise.updateLockedDependency() error");
16
68
  return { status: "update-failed" };
@@ -1 +1 @@
1
- {"version":3,"file":"update-locked.js","names":["lockfile.getLockedVersion"],"sources":["../../../../lib/modules/manager/mise/update-locked.ts"],"sourcesContent":["import { logger } from '../../../logger/index.ts';\nimport type { UpdateLockedConfig, UpdateLockedResult } from '../types.ts';\nimport * as lockfile from './lockfile.ts';\nimport { MiseLockFile } from './schema.ts';\n\nexport function updateLockedDependency(\n config: UpdateLockedConfig,\n): UpdateLockedResult {\n const { depName, newVersion, lockFile, lockFileContent } = config;\n logger.debug(\n `mise.updateLockedDependency: ${depName} -> ${newVersion} [${lockFile}]`,\n );\n\n if (!depName || !lockFileContent) {\n return { status: 'unsupported' };\n }\n\n try {\n const parsed = MiseLockFile.safeParse(lockFileContent);\n if (!parsed.success) {\n return { status: 'unsupported' };\n }\n\n if (lockfile.getLockedVersion(parsed.data, depName) === newVersion) {\n return { status: 'already-updated' };\n }\n\n return { status: 'unsupported' };\n } catch (err) {\n logger.debug({ err }, 'mise.updateLockedDependency() error');\n return { status: 'update-failed' };\n }\n}\n"],"mappings":";;;;AAKA,SAAgB,uBACd,QACoB;CACpB,MAAM,EAAE,SAAS,YAAY,UAAU,oBAAoB;CAC3D,OAAO,MACL,gCAAgC,QAAQ,MAAM,WAAW,IAAI,SAAS,EACxE;CAEA,IAAI,CAAC,WAAW,CAAC,iBACf,OAAO,EAAE,QAAQ,cAAc;CAGjC,IAAI;EACF,MAAM,SAAS,aAAa,UAAU,eAAe;EACrD,IAAI,CAAC,OAAO,SACV,OAAO,EAAE,QAAQ,cAAc;EAGjC,IAAIA,iBAA0B,OAAO,MAAM,OAAO,MAAM,YACtD,OAAO,EAAE,QAAQ,kBAAkB;EAGrC,OAAO,EAAE,QAAQ,cAAc;CACjC,SAAS,KAAK;EACZ,OAAO,MAAM,EAAE,IAAI,GAAG,qCAAqC;EAC3D,OAAO,EAAE,QAAQ,gBAAgB;CACnC;AACF"}
1
+ {"version":3,"file":"update-locked.js","names":["lockfile.getLockedTool"],"sources":["../../../../lib/modules/manager/mise/update-locked.ts"],"sourcesContent":["import { isNullOrUndefined } from '@sindresorhus/is';\nimport type { AST } from 'toml-eslint-parser';\nimport { logger } from '../../../logger/index.ts';\nimport { regEx } from '../../../util/regex.ts';\nimport { safeStringify } from '../../../util/stringify.ts';\nimport { parseTOMLDocument } from '../../../util/toml.ts';\nimport type { UpdateLockedConfig, UpdateLockedResult } from '../types.ts';\nimport * as lockfile from './lockfile.ts';\nimport { MiseLockFile } from './schema.ts';\n\nconst versionPrefixRegex = regEx(/^(?<prefix>[^\\d]*)\\d/);\n\nfunction getToolName(depName: string, lockFileData: MiseLockFile): string {\n if (lockFileData.tools[depName]) {\n return depName;\n }\n\n const delimiterIndex = depName.indexOf(':');\n if (delimiterIndex !== -1) {\n const shortName = depName.substring(delimiterIndex + 1);\n if (lockFileData.tools[shortName]) {\n return shortName;\n }\n }\n\n return '';\n}\n\nfunction formatLockedVersion(\n currentVersion: string,\n newVersion: string,\n): string {\n const currentPrefix =\n versionPrefixRegex.exec(currentVersion)?.groups?.prefix ?? '';\n const newPrefix = versionPrefixRegex.exec(newVersion)?.groups?.prefix;\n if (newPrefix !== undefined) {\n return `${currentPrefix}${newVersion.slice(newPrefix.length)}`;\n }\n return newVersion;\n}\n\nfunction getVersionKeyValue(key: AST.TOMLKey): string | undefined {\n if (key.keys.length !== 1) {\n return undefined;\n }\n\n const [part] = key.keys;\n return part.type === 'TOMLBare' ? part.name : part.value;\n}\n\nfunction getVersionValueNode(\n content: string,\n depName: string,\n lockFileData: MiseLockFile,\n currentVersion: string,\n newVersion: string,\n): { currentLockedVersion: string; versionNode: AST.TOMLValue } | undefined {\n const toolName = getToolName(depName, lockFileData);\n const lockedTools = lockfile.getLockedTool(lockFileData, depName);\n if (!toolName || !lockedTools?.length) {\n return undefined;\n }\n\n const toolIndex =\n lockedTools.length === 1\n ? 0\n : lockedTools.findIndex(\n ({ version }) =>\n version === currentVersion ||\n formatLockedVersion(version, currentVersion) === version ||\n version === newVersion ||\n formatLockedVersion(version, newVersion) === version,\n );\n if (toolIndex === -1) {\n return undefined;\n }\n\n const table = astTableForTool(content, toolName, toolIndex);\n const versionKeyValue = table?.body.find(\n (keyValue) => getVersionKeyValue(keyValue.key) === 'version',\n );\n if (versionKeyValue?.value.type !== 'TOMLValue') {\n return undefined;\n }\n return {\n currentLockedVersion: lockedTools[toolIndex].version,\n versionNode: versionKeyValue.value,\n };\n}\n\nfunction astTableForTool(\n content: string,\n toolName: string,\n toolIndex: number,\n): AST.TOMLTable | undefined {\n const ast = parseTOMLDocument(content);\n return ast.body[0]?.body.find(\n (node): node is AST.TOMLTable =>\n node.type === 'TOMLTable' &&\n node.kind === 'array' &&\n node.resolvedKey.length === 3 &&\n node.resolvedKey[0] === 'tools' &&\n node.resolvedKey[1] === toolName &&\n node.resolvedKey[2] === toolIndex,\n );\n}\n\nexport function updateLockedDependency(\n config: UpdateLockedConfig,\n): UpdateLockedResult {\n const { depName, newVersion, lockFile, lockFileContent } = config;\n logger.debug(\n `mise.updateLockedDependency: ${depName} -> ${newVersion} [${lockFile}]`,\n );\n\n if (!depName || !lockFileContent) {\n return { status: 'unsupported' };\n }\n\n try {\n const parsed = MiseLockFile.safeParse(lockFileContent);\n if (!parsed.success) {\n return { status: 'unsupported' };\n }\n\n const lockedVersion = getVersionValueNode(\n lockFileContent,\n depName,\n parsed.data,\n config.currentVersion,\n newVersion,\n );\n if (!lockedVersion) {\n return { status: 'unsupported' };\n }\n const { currentLockedVersion: currentVersionValue, versionNode } =\n lockedVersion;\n\n const currentLockedVersion = lockFileContent.slice(\n versionNode.range[0],\n versionNode.range[1],\n );\n const updatedVersion = formatLockedVersion(currentVersionValue, newVersion);\n if (currentVersionValue === updatedVersion) {\n return { status: 'already-updated' };\n }\n\n const quote = currentLockedVersion.startsWith(\"'\") ? \"'\" : '\"';\n const replacement =\n quote === \"'\" ? `'${updatedVersion}'` : safeStringify(updatedVersion);\n const files = {\n [lockFile]:\n lockFileContent.slice(0, versionNode.range[0]) +\n replacement +\n lockFileContent.slice(versionNode.range[1]),\n };\n if (!isNullOrUndefined(config.packageFileContent)) {\n // Keep the package file in the update set so mise's artifact refresh runs\n // for selector lockfile updates and regenerates platform metadata.\n files[config.packageFile] = config.packageFileContent;\n }\n return { status: 'updated', files };\n } catch (err) {\n logger.debug({ err }, 'mise.updateLockedDependency() error');\n return { status: 'update-failed' };\n }\n}\n"],"mappings":";;;;;;;;AAUA,MAAM,qBAAqB,MAAM,sBAAsB;AAEvD,SAAS,YAAY,SAAiB,cAAoC;CACxE,IAAI,aAAa,MAAM,UACrB,OAAO;CAGT,MAAM,iBAAiB,QAAQ,QAAQ,GAAG;CAC1C,IAAI,mBAAmB,IAAI;EACzB,MAAM,YAAY,QAAQ,UAAU,iBAAiB,CAAC;EACtD,IAAI,aAAa,MAAM,YACrB,OAAO;CAEX;CAEA,OAAO;AACT;AAEA,SAAS,oBACP,gBACA,YACQ;CACR,MAAM,gBACJ,mBAAmB,KAA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gCAAgC,QAAQ,MAAM,WAAW,IAAI,SAAS,EACxE;CAEA,IAAI,CAAC,WAAW,CAAC,iBACf,OAAO,EAAE,QAAQ,cAAc;CAGjC,IAAI;EACF,MAAM,SAAS,aAAa,UAAU,eAAe;EACrD,IAAI,CAAC,OAAO,SACV,OAAO,EAAE,QAAQ,cAAc;EAGjC,MAAM,gBAAgB,oBACpB,iBACA,SACA,OAAO,MACP,OAAO,gBACP,UACF;EACA,IAAI,CAAC,eACH,OAAO,EAAE,QAAQ,cAAc;EAEjC,MAAM,EAAE,sBAAsB,qBAAqB,gBACjD;EAEF,MAAM,uBAAuB,gBAAgB,MAC3C,YAAY,MAAM,IAClB,YAAY,MAAM,EACpB;EACA,MAAM,iBAAiB,oBAAoB,qBAAqB,UAAU;EAC1E,IAAI,wBAAwB,gBAC1B,OAAO,EAAE,QAAQ,kBAAkB;EAIrC,MAAM,eADQ,qBAAqB,WAAW,GAAG,IAAI,MAAM,UAE/C,MAAM,IAAI,eAAe,KAAK,cAAc,cAAc;EACtE,MAAM,QAAQ,GACX,WACC,gBAAgB,MAAM,GAAG,YAAY,MAAM,EAAE,IAC7C,cACA,gBAAgB,MAAM,YAAY,MAAM,EAAE,EAC9C;EACA,IAAI,CAAC,kBAAkB,OAAO,kBAAkB,GAG9C,MAAM,OAAO,eAAe,OAAO;EAErC,OAAO;GAAE,QAAQ;GAAW;EAAM;CACpC,SAAS,KAAK;EACZ,OAAO,MAAM,EAAE,IAAI,GAAG,qCAAqC;EAC3D,OAAO,EAAE,QAAQ,gBAAgB;CACnC;AACF"}
@@ -165,6 +165,17 @@ interface PackageDependency<T = Record<string, any>, DepType extends string = st
165
165
  sourceUrl?: string | null;
166
166
  pinDigests?: boolean;
167
167
  currentRawValue?: string;
168
+ /**
169
+ * Restrict extracted dependencies to a version range.
170
+ *
171
+ * Managers can use this for native selectors which are not Renovate
172
+ * version ranges but still describe a set of compatible versions.
173
+ */
174
+ allowedVersions?: string;
175
+ /** Whether unstable releases should be excluded from update candidates. */
176
+ ignoreUnstable?: boolean;
177
+ /** True when the dependency should only be updated in the lockfile, and the source file should remain untouched. */
178
+ isLockfileOnly?: boolean;
168
179
  major?: {
169
180
  enabled?: boolean;
170
181
  };
@@ -265,6 +276,8 @@ interface UpdateArtifact<T = Record<string, unknown>> {
265
276
  packageFileName: string;
266
277
  updatedDeps: Upgrade<T>[];
267
278
  newPackageFileContent: string;
279
+ /** Updated lockfile content that is not yet present on disk. */
280
+ newLockFileContent?: string;
268
281
  config: UpdateArtifactsConfig;
269
282
  }
270
283
  interface UpdateDependencyConfig<T = Record<string, any>> {
package/dist/util/toml.js CHANGED
@@ -2,14 +2,16 @@ import { regEx } from "./regex.js";
2
2
  import { stripTemplates } from "./string.js";
3
3
  import { getStaticTOMLValue, parseTOML } from "toml-eslint-parser";
4
4
  //#region lib/util/toml.ts
5
+ function parseTOMLDocument(input) {
6
+ return parseTOML(input, { tomlVersion: "1.1" });
7
+ }
5
8
  function parse(input) {
6
- const ast = parseTOML(input, { tomlVersion: "1.1" });
7
- return getStaticTOMLValue(ast);
9
+ return getStaticTOMLValue(parseTOMLDocument(input));
8
10
  }
9
11
  function massage(input) {
10
12
  return stripTemplates(input.replace(regEx(/^\s*{{.+?}}\s*=.*$/gm), ""));
11
13
  }
12
14
  //#endregion
13
- export { massage, parse };
15
+ export { massage, parse, parseTOMLDocument };
14
16
 
15
17
  //# sourceMappingURL=toml.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toml.js","names":[],"sources":["../../lib/util/toml.ts"],"sourcesContent":["import { getStaticTOMLValue, parseTOML } from 'toml-eslint-parser';\nimport { regEx } from './regex.ts';\nimport { stripTemplates } from './string.ts';\n\nexport function parse(input: string): unknown {\n const ast = parseTOML(input, { tomlVersion: '1.1' });\n return getStaticTOMLValue(ast);\n}\n\nexport function massage(input: string): string {\n return stripTemplates(input.replace(regEx(/^\\s*{{.+?}}\\s*=.*$/gm), ''));\n}\n"],"mappings":";;;;AAIA,SAAgB,MAAM,OAAwB;CAC5C,MAAM,MAAM,UAAU,OAAO,EAAE,aAAa,MAAM,CAAC;CACnD,OAAO,mBAAmB,GAAG;AAC/B;AAEA,SAAgB,QAAQ,OAAuB;CAC7C,OAAO,eAAe,MAAM,QAAQ,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACxE"}
1
+ {"version":3,"file":"toml.js","names":[],"sources":["../../lib/util/toml.ts"],"sourcesContent":["import { type AST, getStaticTOMLValue, parseTOML } from 'toml-eslint-parser';\nimport { regEx } from './regex.ts';\nimport { stripTemplates } from './string.ts';\n\nexport function parseTOMLDocument(input: string): AST.TOMLProgram {\n return parseTOML(input, { tomlVersion: '1.1' });\n}\n\nexport function parse(input: string): unknown {\n return getStaticTOMLValue(parseTOMLDocument(input));\n}\n\nexport function massage(input: string): string {\n return stripTemplates(input.replace(regEx(/^\\s*{{.+?}}\\s*=.*$/gm), ''));\n}\n"],"mappings":";;;;AAIA,SAAgB,kBAAkB,OAAgC;CAChE,OAAO,UAAU,OAAO,EAAE,aAAa,MAAM,CAAC;AAChD;AAEA,SAAgB,MAAM,OAAwB;CAC5C,OAAO,mBAAmB,kBAAkB,KAAK,CAAC;AACpD;AAEA,SAAgB,QAAQ,OAAuB;CAC7C,OAAO,eAAe,MAAM,QAAQ,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACxE"}
@@ -27,7 +27,8 @@ async function generateUpdate(config, currentValue, versioningApi, rangeStrategy
27
27
  */
28
28
  update.registryUrl = release.registryUrl;
29
29
  if (currentValue) try {
30
- update.newValue = versioningApi.getNewValue({
30
+ if (config.isLockfileOnly) update.newValue = currentValue;
31
+ else update.newValue = versioningApi.getNewValue({
31
32
  currentValue,
32
33
  rangeStrategy,
33
34
  currentVersion,
@@ -59,7 +60,7 @@ async function generateUpdate(config, currentValue, versioningApi, rangeStrategy
59
60
  const { datasource, packageName, packageRules } = config;
60
61
  if (packageRules?.some((pr) => isNonEmptyArray(pr.matchConfidence))) update.mergeConfidenceLevel = await getMergeConfidenceLevel(datasource, packageName, currentVersion, newVersion, update.updateType);
61
62
  if (!versioningApi.isVersion(update.newValue)) update.isRange = true;
62
- if (rangeStrategy === "update-lockfile" && currentValue === update.newValue) update.isLockfileUpdate = true;
63
+ if ((config.isLockfileOnly || rangeStrategy === "update-lockfile") && currentValue === update.newValue) update.isLockfileUpdate = true;
63
64
  if (rangeStrategy === "bump" && versioningApi.matches(newVersion, currentValue)) update.isBump = true;
64
65
  return update;
65
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","names":[],"sources":["../../../../../lib/workers/repository/process/lookup/generate.ts"],"sourcesContent":["import { isNonEmptyArray } from '@sindresorhus/is';\nimport { logger } from '../../../../logger/index.ts';\nimport type { Release } from '../../../../modules/datasource/index.ts';\nimport type { LookupUpdate } from '../../../../modules/manager/types.ts';\nimport type { VersioningApi } from '../../../../modules/versioning/index.ts';\nimport type { RangeStrategy } from '../../../../types/index.ts';\nimport { getElapsedDays } from '../../../../util/date.ts';\nimport { getMergeConfidenceLevel } from '../../../../util/merge-confidence/index.ts';\nimport type { LookupUpdateConfig } from './types.ts';\nimport { getUpdateType } from './update-type.ts';\n\nexport async function generateUpdate(\n config: LookupUpdateConfig,\n currentValue: string | undefined,\n versioningApi: VersioningApi,\n rangeStrategy: RangeStrategy,\n currentVersion: string,\n bucket: string,\n release: Release,\n allVersions: Set<string>,\n): Promise<LookupUpdate> {\n const newVersion = release.version;\n const update: LookupUpdate = {\n bucket,\n newVersion,\n newValue: null!,\n hasAttestation: release.attestation,\n };\n\n if (release.checksumUrl !== undefined) {\n update.checksumUrl = release.checksumUrl;\n }\n if (release.downloadUrl !== undefined) {\n update.downloadUrl = release.downloadUrl;\n }\n if (release.newDigest !== undefined) {\n update.newDigest = release.newDigest;\n }\n if (release.releaseTimestamp) {\n update.releaseTimestamp = release.releaseTimestamp;\n update.newVersionAgeInDays = getElapsedDays(release.releaseTimestamp);\n }\n if (release.registryUrl !== undefined) {\n /**\n * This means:\n * - registry strategy is set to merge\n * - releases were fetched from multiple registry urls\n */\n update.registryUrl = release.registryUrl;\n }\n\n if (currentValue) {\n try {\n update.newValue = versioningApi.getNewValue({\n currentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n allVersions,\n })!;\n } catch (err) {\n logger.warn(\n { err, currentValue, rangeStrategy, currentVersion, newVersion },\n 'getNewValue error',\n );\n update.newValue = currentValue;\n }\n } else {\n update.newValue = currentValue;\n }\n update.newMajor = versioningApi.getMajor(newVersion)!;\n update.newMinor = versioningApi.getMinor(newVersion)!;\n update.newPatch = versioningApi.getPatch(newVersion)!;\n if (!update.updateType && !currentVersion) {\n logger.debug({ update }, 'Update has no currentVersion');\n update.newValue = currentValue!;\n return update;\n }\n update.updateType =\n update.updateType ??\n getUpdateType(config, versioningApi, currentVersion, newVersion);\n if (versioningApi.isBreaking) {\n // This versioning scheme has breaking awareness\n update.isBreaking = versioningApi.isBreaking(currentVersion, newVersion);\n } else {\n // This versioning scheme does not have breaking awareness - assume only major updates are breaking\n // Updates from, or to, unstable releases should be treated as breaking too.\n // But we should not add that as default behavior until we stop treating non-LTS versions as unstable first\n update.isBreaking = update.updateType === 'major';\n }\n const { datasource, packageName, packageRules } = config;\n if (packageRules?.some((pr) => isNonEmptyArray(pr.matchConfidence))) {\n update.mergeConfidenceLevel = await getMergeConfidenceLevel(\n datasource,\n packageName,\n currentVersion,\n newVersion,\n update.updateType,\n );\n }\n if (!versioningApi.isVersion(update.newValue)) {\n update.isRange = true;\n }\n if (rangeStrategy === 'update-lockfile' && currentValue === update.newValue) {\n update.isLockfileUpdate = true;\n }\n if (\n rangeStrategy === 'bump' &&\n // TODO #22198\n versioningApi.matches(newVersion, currentValue!)\n ) {\n update.isBump = true;\n }\n return update;\n}\n"],"mappings":";;;;;;AAWA,eAAsB,eACpB,QACA,cACA,eACA,eACA,gBACA,QACA,SACA,aACuB;CACvB,MAAM,aAAa,QAAQ;CAC3B,MAAM,SAAuB;EAC3B;EACA;EACA,UAAU;EACV,gBAAgB,QAA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,UACjE,OAAO,mBAAmB;CAE5B,IACE,kBAAkB,UAElB,cAAc,QAAQ,YAAY,YAAa,GAE/C,OAAO,SAAS;CAElB,OAAO;AACT"}
1
+ {"version":3,"file":"generate.js","names":[],"sources":["../../../../../lib/workers/repository/process/lookup/generate.ts"],"sourcesContent":["import { isNonEmptyArray } from '@sindresorhus/is';\nimport { logger } from '../../../../logger/index.ts';\nimport type { Release } from '../../../../modules/datasource/index.ts';\nimport type { LookupUpdate } from '../../../../modules/manager/types.ts';\nimport type { VersioningApi } from '../../../../modules/versioning/index.ts';\nimport type { RangeStrategy } from '../../../../types/index.ts';\nimport { getElapsedDays } from '../../../../util/date.ts';\nimport { getMergeConfidenceLevel } from '../../../../util/merge-confidence/index.ts';\nimport type { LookupUpdateConfig } from './types.ts';\nimport { getUpdateType } from './update-type.ts';\n\nexport async function generateUpdate(\n config: LookupUpdateConfig,\n currentValue: string | undefined,\n versioningApi: VersioningApi,\n rangeStrategy: RangeStrategy,\n currentVersion: string,\n bucket: string,\n release: Release,\n allVersions: Set<string>,\n): Promise<LookupUpdate> {\n const newVersion = release.version;\n const update: LookupUpdate = {\n bucket,\n newVersion,\n newValue: null!,\n hasAttestation: release.attestation,\n };\n\n if (release.checksumUrl !== undefined) {\n update.checksumUrl = release.checksumUrl;\n }\n if (release.downloadUrl !== undefined) {\n update.downloadUrl = release.downloadUrl;\n }\n if (release.newDigest !== undefined) {\n update.newDigest = release.newDigest;\n }\n if (release.releaseTimestamp) {\n update.releaseTimestamp = release.releaseTimestamp;\n update.newVersionAgeInDays = getElapsedDays(release.releaseTimestamp);\n }\n if (release.registryUrl !== undefined) {\n /**\n * This means:\n * - registry strategy is set to merge\n * - releases were fetched from multiple registry urls\n */\n update.registryUrl = release.registryUrl;\n }\n\n if (currentValue) {\n try {\n if (config.isLockfileOnly) {\n update.newValue = currentValue;\n } else {\n update.newValue = versioningApi.getNewValue({\n currentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n allVersions,\n })!;\n }\n } catch (err) {\n logger.warn(\n { err, currentValue, rangeStrategy, currentVersion, newVersion },\n 'getNewValue error',\n );\n update.newValue = currentValue;\n }\n } else {\n update.newValue = currentValue;\n }\n update.newMajor = versioningApi.getMajor(newVersion)!;\n update.newMinor = versioningApi.getMinor(newVersion)!;\n update.newPatch = versioningApi.getPatch(newVersion)!;\n if (!update.updateType && !currentVersion) {\n logger.debug({ update }, 'Update has no currentVersion');\n update.newValue = currentValue!;\n return update;\n }\n update.updateType =\n update.updateType ??\n getUpdateType(config, versioningApi, currentVersion, newVersion);\n if (versioningApi.isBreaking) {\n // This versioning scheme has breaking awareness\n update.isBreaking = versioningApi.isBreaking(currentVersion, newVersion);\n } else {\n // This versioning scheme does not have breaking awareness - assume only major updates are breaking\n // Updates from, or to, unstable releases should be treated as breaking too.\n // But we should not add that as default behavior until we stop treating non-LTS versions as unstable first\n update.isBreaking = update.updateType === 'major';\n }\n const { datasource, packageName, packageRules } = config;\n if (packageRules?.some((pr) => isNonEmptyArray(pr.matchConfidence))) {\n update.mergeConfidenceLevel = await getMergeConfidenceLevel(\n datasource,\n packageName,\n currentVersion,\n newVersion,\n update.updateType,\n );\n }\n if (!versioningApi.isVersion(update.newValue)) {\n update.isRange = true;\n }\n if (\n (config.isLockfileOnly || rangeStrategy === 'update-lockfile') &&\n currentValue === update.newValue\n ) {\n update.isLockfileUpdate = true;\n }\n if (\n rangeStrategy === 'bump' &&\n // TODO #22198\n versioningApi.matches(newVersion, currentValue!)\n ) {\n update.isBump = true;\n }\n return update;\n}\n"],"mappings":";;;;;;AAWA,eAAsB,eACpB,QACA,cACA,eACA,eACA,gBACA,QACA,SACA,aACuB;CACvB,MAAM,aAAa,QAAQ;CAC3B,MAAM,SAAuB;EAC3B;EACA;EACA,UAAU;EACV,gBAAgB,QAAQ;CAC1B;CAEA,IAAI,QAAQ,gBAAgB,KAAA,GAC1B,OAAO,cAAc,QAAQ;CAE/B,IAAI,QAAQ,gBAAgB,KAAA,GAC1B,OAAO,c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Aa,GAE/C,OAAO,SAAS;CAElB,OAAO;AACT"}
@@ -108,7 +108,7 @@ async function lookupUpdates(inconfig) {
108
108
  res.skipReason = "invalid-config";
109
109
  return Result.ok(res);
110
110
  }
111
- let compareValue = config.currentValue;
111
+ let compareValue = config.isLockfileOnly && config.lockedVersion ? config.lockedVersion : config.currentValue;
112
112
  if (isString(config.currentValue) && isString(config.versionCompatibility)) {
113
113
  const regexMatch = regEx(config.versionCompatibility).exec(config.currentValue);
114
114
  if (regexMatch?.groups) {
@@ -130,7 +130,7 @@ async function lookupUpdates(inconfig) {
130
130
  const isValid = isString(compareValue) && versioningApi.isValid(compareValue);
131
131
  const unconstrainedValue = !!config.lockedVersion && isUndefined(config.currentValue);
132
132
  if (isValid || unconstrainedValue) {
133
- if (!config.updatePinnedDependencies && versioningApi.isSingleVersion(compareValue)) {
133
+ if (!config.updatePinnedDependencies && !config.isLockfileOnly && versioningApi.isSingleVersion(compareValue)) {
134
134
  res.skipReason = "is-pinned";
135
135
  return Result.ok(res);
136
136
  }
@@ -253,7 +253,10 @@ async function lookupUpdates(inconfig) {
253
253
  res.skipReason = "invalid-version";
254
254
  return Result.ok(res);
255
255
  }
256
- let filteredReleases = filterVersions(config, currentVersion, latestVersion, inRangeOnlyStrategy ? allSatisfyingVersions : allVersions, versioningApi).filter((v) => unconstrainedValue || versioningApi.isCompatible(v.version, compareValue));
256
+ let filteredReleases = filterVersions(config, currentVersion, latestVersion, inRangeOnlyStrategy ? allSatisfyingVersions : allVersions, versioningApi).filter((v) => {
257
+ if (config.isLockfileOnly) return true;
258
+ return unconstrainedValue || versioningApi.isCompatible(v.version, compareValue);
259
+ });
257
260
  let shrinkedViaVulnerability = false;
258
261
  if (config.isVulnerabilityAlert) {
259
262
  if (config.vulnerabilityFixVersion) {
@@ -297,7 +300,7 @@ async function lookupUpdates(inconfig) {
297
300
  // istanbul ignore next
298
301
  if (!release) return Result.ok(res);
299
302
  const newVersion = release.version;
300
- const update = await generateUpdate(config, compareValue, versioningApi, rangeStrategy, config.lockedVersion ?? currentVersion, bucket, release, allReleaseVersions);
303
+ const update = await generateUpdate(config, config.isLockfileOnly ? config.currentValue : compareValue, versioningApi, rangeStrategy, config.lockedVersion ?? currentVersion, bucket, release, allReleaseVersions);
301
304
  if (config.manager === "gomod" && compareValue?.startsWith("v0.0.0-") && update.newValue?.startsWith("v0.0.0-") && config.currentDigest !== update.newDigest) {
302
305
  update.updateType = "digest";
303
306
  await applyMinimumReleaseAgeToDigestUpdate(update, config, res, true, release.releaseTimestamp);