mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
refactor: composer managerData (#9226)
This commit is contained in:
parent
eb1f645e69
commit
11454b547e
5 changed files with 18 additions and 6 deletions
|
@ -6,7 +6,12 @@ import { SkipReason } from '../../types';
|
|||
import { readLocalFile } from '../../util/fs';
|
||||
import { api as semverComposer } from '../../versioning/composer';
|
||||
import type { PackageDependency, PackageFile } from '../types';
|
||||
import type { ComposerConfig, ComposerLock, Repo } from './types';
|
||||
import type {
|
||||
ComposerConfig,
|
||||
ComposerLock,
|
||||
ComposerManagerData,
|
||||
Repo,
|
||||
} from './types';
|
||||
import { extractContraints } from './utils';
|
||||
|
||||
/**
|
||||
|
@ -176,8 +181,11 @@ export async function extractPackageFile(
|
|||
return null;
|
||||
}
|
||||
res.deps = deps;
|
||||
if (composerJson.type) {
|
||||
res.managerData = { composerJsonType: composerJson.type };
|
||||
if (is.string(composerJson.type)) {
|
||||
const managerData: ComposerManagerData = {
|
||||
composerJsonType: composerJson.type,
|
||||
};
|
||||
res.managerData = managerData;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { logger } from '../../logger';
|
||||
import type { RangeStrategy } from '../../types';
|
||||
import type { RangeConfig } from '../types';
|
||||
import { ComposerManagerData } from './types';
|
||||
|
||||
export function getRangeStrategy(config: RangeConfig): RangeStrategy {
|
||||
const {
|
||||
|
@ -10,7 +11,7 @@ export function getRangeStrategy(config: RangeConfig): RangeStrategy {
|
|||
currentValue,
|
||||
rangeStrategy,
|
||||
} = config;
|
||||
const { composerJsonType } = managerData;
|
||||
const { composerJsonType } = managerData as ComposerManagerData;
|
||||
const isComplexRange = currentValue?.includes(' || ');
|
||||
if (rangeStrategy === 'bump' && isComplexRange) {
|
||||
logger.debug(
|
||||
|
|
|
@ -30,3 +30,7 @@ export interface ComposerLock {
|
|||
packages?: ComposerLockPackage[];
|
||||
'packages-dev'?: ComposerLockPackage[];
|
||||
}
|
||||
|
||||
export interface ComposerManagerData {
|
||||
composerJsonType?: string;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,6 @@ export interface PackageUpdateConfig {
|
|||
}
|
||||
|
||||
export interface RangeConfig<T = Record<string, any>> extends ManagerData<T> {
|
||||
composerJsonType?: 'composer-plugin' | 'library' | 'metapackage' | 'project';
|
||||
currentValue?: string;
|
||||
depName?: string;
|
||||
depType?: string;
|
||||
|
|
2
lib/util/cache/repository/index.ts
vendored
2
lib/util/cache/repository/index.ts
vendored
|
@ -9,7 +9,7 @@ import type { PackageFile } from '../../../manager/types';
|
|||
import type { RepoInitConfig } from '../../../workers/repository/init/common';
|
||||
|
||||
// Increment this whenever there could be incompatibilities between old and new cache structure
|
||||
export const CACHE_REVISION = 5;
|
||||
export const CACHE_REVISION = 6;
|
||||
|
||||
export interface BaseBranchCache {
|
||||
sha: string; // branch commit sha
|
||||
|
|
Loading…
Reference in a new issue