mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-31 01:37:24 +00:00
930cf6633c
fix: Additional vi.mock path corrections and prettier formatting
37 lines
911 B
TypeScript
37 lines
911 B
TypeScript
import type { Category } from '../../../constants/index.ts';
|
|
import { NpmDatasource } from '../../datasource/npm/index.ts';
|
|
import { id, isValid } from '../../versioning/npm/index.ts';
|
|
|
|
import type { PackageDependency, PackageFileContent } from '../types.ts';
|
|
|
|
export const categories: Category[] = ['js'];
|
|
|
|
export const defaultConfig = {
|
|
managerFilePatterns: ['/(^|/)\\.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] };
|
|
}
|