Ensure valid composer.json for extensions
Problem to solve
- Some extensions do not include a composer.json.
- Some extensions do not have a valid composer.json or include a composer.json with deprecations.
- Information about composer.json (for extensions) is not consistent and not regularly updated.
To further propagate use of Composer and use of best practices for composer.json and to ensure stressless installation and maintainance of TYPO3 sites, it might be useful to do some basic checks on extensions.
Example
bp_pagetree
$ composer validate
Deprecation warning: replace.bp_pagetree is invalid, it should have a vendor name, a forward slash, and a package name. The vendor and package name can be words separated by -, . or _. The complete name should match "[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*". Make sure you fix this as Composer 2.0 will error.
composer --version
Composer version 1.9.1 2019-11-01 17:20:17
composer.json:
"replace": {
"bp_pagetree": "self.version",
"typo3-ter/bp_pagetree": "self.version"
},
See also:
- Issue about deprecations in composer.json of core extensions: https://forge.typo3.org/issues/89392
- The patch drops the replace section entirely: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61944
Further details
long term goal:
- all TYPO3 extensions listed on extensions.typo3.org include valid composer.json
- documentation for extension authors is consistent and easily findable (beyond scope of this issue, should be handled in documentation)
Proposal
Regularly run composer validate
on extensions listed on extensions.typo3.org.
What does success look like, and how can we measure that?
Acceptence Criterias
-
Extension authors are regularly notified about problems (or possible improvements) with their extensions -
If problems are detected, the problems are listed for the extensions -
Best practices for composer.json are documented and regularly updated, e.g. on https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitecture/ComposerJson/Index.html and in Installation & Upgrade Guide
Related
- core issue: https://forge.typo3.org/issues/89392
- documentation issue: https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/issues/641
- documentation page for composer.json: https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ExtensionArchitecture/ComposerJson/Index.html