mediaessenz / diskusage
Extension to visualize disk usage of TYPO3 storages
Package info
gitlab.com/mediaessenz/diskusage
Type:typo3-cms-extension
pkg:composer/mediaessenz/diskusage
Requires
- php: ^8.2
- ext-pdo: *
- typo3/cms-backend: ^13 || ^14
- typo3/cms-core: ^13 || ^14
- typo3/cms-filelist: ^13 || ^14
Requires (Dev)
- phpunit/phpunit: ^11.2 || ^12.1
- typo3/testing-framework: ^9.7
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
What does it do?
Disk Usage visualizes the disk usage of the TYPO3 file storages. It adds a button to the file list module, which opens a treemap of the current folder. Files without references can be deleted directly from the chart.
JavaScript
The treemap is written in TypeScript (Resources/Private/TypeScript) and uses Apache ECharts.
It is built with Vite and vite-plugin-typo3 in the
mode target: 'extension' (see vite.config.ts, the entrypoints are listed in Build/ViteEntrypoints.json). The result
is committed to Resources/Public/JavaScript/diskusage.js and Resources/Public/Css/diskusage.css, so the extension
doesn't need EXT:vite_asset_collector or Node.js at runtime. The JavaScript is an ES module, which is loaded with the import
map of the TYPO3 backend (Configuration/JavaScriptModules.php) and imports the backend modules like @typo3/backend/modal.js.
npm ci
npm run build # type check and build
npm run watch # rebuild on changes
The CI job assets checks that the committed files match a build of the sources.
Running the tests
The unit tests live in Tests/Unit and use the TYPO3 testing framework. The development dependencies are installed
into .Build (ignored by git):
composer install
composer test:unit
In a DDEV project the commands can be executed in the extension directory:
ddev exec -d /var/www/html/vendor/mediaessenz/diskusage composer install
ddev exec -d /var/www/html/vendor/mediaessenz/diskusage composer test:unit
Releasing
A release is published to the TYPO3 Extension Repository (TER) by the GitLab CI (.gitlab-ci.yml).
- Raise the version in
ext_emconf.phpand incomposer.json(extra.typo3/cms.version). - Add the changelog entry
- v.<major>.<minor>.<patch>: <changes>toDocumentation/Changelog/Index.rst. - Commit, create an annotated tag and push it. The tag message is used as upload comment in the TER:
git tag -a v5.0.1 -m "Added unit tests and the TER release automation" git push origin v5.0.1 - The pipeline of the tag runs the tests and the job
release-checks(version of the tag equalsext_emconf.phpandcomposer.json, changelog entry exists), thenter-packagebuildsdiskusage_<version>.zip: the tag without the files listed in.gitattributes(e.g.Tests/,Build/). The package is available as job artifact. - Check the package, then start the manual job
ter-publish. A version published to the TER can't be changed or deleted. After the upload the jobgitlab-releasecreates the GitLab release of the tag.
Required setup in GitLab: the CI/CD variable TYPO3_API_TOKEN (a TER access token, see
typo3/tailor, flags masked and protected) and the protected tags v*.
The package can be built locally with sh Build/ci/build-ter-package.sh v5.0.1 /tmp (needs a committed tag).