Create an extension
For an extension to be installable in TYPO3 it needs a file called
composer.json. You can read more about this file here:
composer.json.
A minimal composer.json to get the extension up and running
could look like this:
EXT:tea/composer.json
{
"name": "ttn/tea",
"description": "TYPO3 example extension for unit testing and best practices",
"type": "typo3-cms-extension",
"authors": [
{
"name": "Oliver Klee",
"email": "typo3-coding@oliverklee.de",
"homepage": "https://www.oliverklee.de",
"role": "maintainer"
},
{
"name": "Daniel Siepmann",
"email": "coding@daniel-siepmann.de",
"homepage": "https://daniel-siepmann.de/",
"role": "maintainer"
},
{
"name": "\u0141ukasz Uzna\u0144ski",
"email": "lukaszuznanski94@gmail.com",
"homepage": "https://uznanski.pl/",
"role": "maintainer"
}
],
"homepage": "https://extensions.typo3.org/extension/tea/",
"support": {
"issues": "https://github.com/FriendsOfTYPO3/tea/issues",
"source": "https://github.com/FriendsOfTYPO3/tea",
"docs": "https://docs.typo3.org/p/ttn/tea/main/en-us/"
},
"require": {
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"psr/http-message": "^1.0.1",
"typo3/cms-core": "^11.5.4 || ^12.4",
"typo3/cms-extbase": "^11.5.4 || ^12.4",
"typo3/cms-fluid": "^11.5.4 || ^12.4",
"typo3/cms-frontend": "^11.5.4 || ^12.4"
},
"prefer-stable": true,
"autoload": {
"psr-4": {
"TTN\\Tea\\": "Classes/"
}
},
"extra": {
"typo3/cms": {
"extension-key": "tea"
}
}
}
Copied!
With just the composer.json present,
you would be able to install the extension but it would not do anything.
Though not required it is considered best practice for an extension to have an
icon. This icon should have the format .svg or .png and has
to be located at EXT:tea/Resources/Public/Icons/Extension.svg.