feat(composer): Default to 'widen' rangeStrategy for TYPO3 extensions (#14175)

This commit is contained in:
LeoniePhiline 2022-02-11 17:12:55 +01:00 committed by GitHub
parent d9caa4afb2
commit 32f7988493
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -41,4 +41,14 @@ describe('manager/composer/range', () => {
const config: RangeConfig = { rangeStrategy: 'auto', depType: 'require' };
expect(getRangeStrategy(config)).toBe('replace');
});
it('defaults to widen for TYPO3 extensions', () => {
const config: RangeConfig = {
managerData: {
composerJsonType: 'typo3-cms-extension',
},
rangeStrategy: 'auto',
depType: 'require',
};
expect(getRangeStrategy(config)).toBe('widen');
});
});

View file

@ -42,7 +42,7 @@ export function getRangeStrategy(config: RangeConfig): RangeStrategy {
logger.trace({ dependency: depName }, 'Pinning app require');
return 'pin';
}
if (isComplexRange) {
if (isComplexRange || ['typo3-cms-extension'].includes(composerJsonType)) {
return 'widen';
}
return 'replace';