mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 15:06:27 +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 { readLocalFile } from '../../util/fs';
|
||||||
import { api as semverComposer } from '../../versioning/composer';
|
import { api as semverComposer } from '../../versioning/composer';
|
||||||
import type { PackageDependency, PackageFile } from '../types';
|
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';
|
import { extractContraints } from './utils';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -176,8 +181,11 @@ export async function extractPackageFile(
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
res.deps = deps;
|
res.deps = deps;
|
||||||
if (composerJson.type) {
|
if (is.string(composerJson.type)) {
|
||||||
res.managerData = { composerJsonType: composerJson.type };
|
const managerData: ComposerManagerData = {
|
||||||
|
composerJsonType: composerJson.type,
|
||||||
|
};
|
||||||
|
res.managerData = managerData;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { logger } from '../../logger';
|
import { logger } from '../../logger';
|
||||||
import type { RangeStrategy } from '../../types';
|
import type { RangeStrategy } from '../../types';
|
||||||
import type { RangeConfig } from '../types';
|
import type { RangeConfig } from '../types';
|
||||||
|
import { ComposerManagerData } from './types';
|
||||||
|
|
||||||
export function getRangeStrategy(config: RangeConfig): RangeStrategy {
|
export function getRangeStrategy(config: RangeConfig): RangeStrategy {
|
||||||
const {
|
const {
|
||||||
|
@ -10,7 +11,7 @@ export function getRangeStrategy(config: RangeConfig): RangeStrategy {
|
||||||
currentValue,
|
currentValue,
|
||||||
rangeStrategy,
|
rangeStrategy,
|
||||||
} = config;
|
} = config;
|
||||||
const { composerJsonType } = managerData;
|
const { composerJsonType } = managerData as ComposerManagerData;
|
||||||
const isComplexRange = currentValue?.includes(' || ');
|
const isComplexRange = currentValue?.includes(' || ');
|
||||||
if (rangeStrategy === 'bump' && isComplexRange) {
|
if (rangeStrategy === 'bump' && isComplexRange) {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|
|
@ -30,3 +30,7 @@ export interface ComposerLock {
|
||||||
packages?: ComposerLockPackage[];
|
packages?: ComposerLockPackage[];
|
||||||
'packages-dev'?: 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> {
|
export interface RangeConfig<T = Record<string, any>> extends ManagerData<T> {
|
||||||
composerJsonType?: 'composer-plugin' | 'library' | 'metapackage' | 'project';
|
|
||||||
currentValue?: string;
|
currentValue?: string;
|
||||||
depName?: string;
|
depName?: string;
|
||||||
depType?: 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';
|
import type { RepoInitConfig } from '../../../workers/repository/init/common';
|
||||||
|
|
||||||
// Increment this whenever there could be incompatibilities between old and new cache structure
|
// 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 {
|
export interface BaseBranchCache {
|
||||||
sha: string; // branch commit sha
|
sha: string; // branch commit sha
|
||||||
|
|
Loading…
Reference in a new issue