0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 13:38:32 +00:00
renovatebot_renovate/lib/modules/manager/bun-version/index.ts
Risu 397ab49ef3
docs(managers): add missing url and displayName (#32621)
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
2024-12-01 08:47:27 +00:00

37 lines
869 B
TypeScript

import type { Category } from '../../../constants';
import { NpmDatasource } from '../../datasource/npm';
import { id, isValid } from '../../versioning/npm';
import type { PackageDependency, PackageFileContent } from '../types';
export const categories: Category[] = ['js'];
export const defaultConfig = {
fileMatch: ['(^|/)\\.bun-version$'],
versioning: id,
};
export const supportedDatasources = [NpmDatasource.id];
export function extractPackageFile(content: string): PackageFileContent | null {
if (!content) {
return null;
}
if (content.split('\n').length > 2) {
return null;
}
const dep: PackageDependency = {
depName: 'Bun',
packageName: 'bun',
currentValue: content.trim(),
datasource: NpmDatasource.id,
};
if (!isValid(content.trim())) {
dep.skipReason = 'invalid-version';
}
return { deps: [dep] };
}