diff --git a/lib/manager/composer/extract.ts b/lib/manager/composer/extract.ts index b9666c3c30..e0faa9fed4 100644 --- a/lib/manager/composer/extract.ts +++ b/lib/manager/composer/extract.ts @@ -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; } diff --git a/lib/manager/composer/range.ts b/lib/manager/composer/range.ts index 7b53302ef9..65212e27cd 100644 --- a/lib/manager/composer/range.ts +++ b/lib/manager/composer/range.ts @@ -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( diff --git a/lib/manager/composer/types.ts b/lib/manager/composer/types.ts index 599bbb8693..2b421f7edc 100644 --- a/lib/manager/composer/types.ts +++ b/lib/manager/composer/types.ts @@ -30,3 +30,7 @@ export interface ComposerLock { packages?: ComposerLockPackage[]; 'packages-dev'?: ComposerLockPackage[]; } + +export interface ComposerManagerData { + composerJsonType?: string; +} diff --git a/lib/manager/types.ts b/lib/manager/types.ts index 0a6deff94e..94ad3a8ed5 100644 --- a/lib/manager/types.ts +++ b/lib/manager/types.ts @@ -59,7 +59,6 @@ export interface PackageUpdateConfig { } export interface RangeConfig> extends ManagerData { - composerJsonType?: 'composer-plugin' | 'library' | 'metapackage' | 'project'; currentValue?: string; depName?: string; depType?: string; diff --git a/lib/util/cache/repository/index.ts b/lib/util/cache/repository/index.ts index ab07f46d9e..830d4a57b4 100644 --- a/lib/util/cache/repository/index.ts +++ b/lib/util/cache/repository/index.ts @@ -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