helsingborg-stad / builder
Executes build commands and cleanup files
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Open Issues: 0
Type:composer-plugin
Requires
- php: >=7.4.0
- composer-plugin-api: ^2.3
Requires (Dev)
- composer/composer: ^2.3
- php-parallel-lint/php-parallel-lint: ~1.3.1
- phpunit/phpunit: ^9.5.0
- squizlabs/php_codesniffer: ^3.6
README
Builder
Composer builder plugin
Report Bug
ยท
Request Feature
Summary
This composer plugin will check for build and cleanup configuration on composer packages that is being installed from the same composer.json file. The intended usage for this is in build pipeline and local development environment.
Requirements
Install
composer require helsingborg-stad/builder
Build command
I any composer package that need to be built the below should be in composer.json file like this.
{ "extra": { "builder": { "commands": [ "npm ci", "npm run build", ] } } }
Cleanup
Any files that should be cleaned up after build in required packages should be in the composer.json file like this.
{ "extra": { "builder": { "removables": [ ".git", ".gitignore" ] } } }
Pipeline commands example
When running build for production the enable cleanup config should be enabled before install.
This should BE USED WITH CAUTION as it will delete files from your system and the setting should not be commited but added during build in a pipeline.
composer config extra.builder.cleanup true
composer install
This will be added in the composer.json
"extra": { "builder": { "cleanup": "true" } }
Run tests
composer install
composer run test
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License.