Files
renovate/lib/modules/manager/pixi/artifacts.ts
Niels Pardon 533bc62eb4 refactor(manager/pixi): extract shared pixi.lock update helper (#44941)
* refactor(manager/pixi): extract shared pixi.lock update helper

* test(manager/pixi): cover shared pixi.lock helper directly

Add a dedicated lockfile.spec.ts that exercises updatePixiLockfile
directly (gate, package-file write branch, lockfile maintenance,
unchanged, constraint pass-through, and error handling), and slim the
pixi and pep621 call-site specs down to their own behavior: how each
derives the pixi constraint and that they delegate to the shared helper.
2026-07-29 11:30:25 +00:00

26 lines
814 B
TypeScript

import { logger } from '../../../logger/index.ts';
import type { UpdateArtifact, UpdateArtifactsResult } from '../types.ts';
import { getUserPixiConfig } from './extract.ts';
import { updatePixiLockfile } from './lockfile.ts';
export async function updateArtifacts({
packageFileName,
updatedDeps,
newPackageFileContent,
config,
}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {
logger.debug(`pixi.updateArtifacts(${packageFileName})`);
const pixiConfig = getUserPixiConfig(newPackageFileContent, packageFileName);
const constraint =
config.constraints?.pixi ?? pixiConfig?.project['requires-pixi'];
return await updatePixiLockfile({
packageFileName,
updatedDeps,
isLockFileMaintenance: config.isLockFileMaintenance,
constraint,
newPackageFileContent,
});
}