mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 13:38:32 +00:00
397ab49ef3
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
37 lines
869 B
TypeScript
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] };
|
|
}
|