evilstudio / composer-parser
Simple app for parse composer.json file from multiple repositories to one Excel spreadsheet
Package info
github.com/evilprophet/composer-parser
Type:project
pkg:composer/evilstudio/composer-parser
Requires
- php: >=8.3
- ext-gd: *
- ext-json: *
- ext-zip: *
- czproject/git-php: ^4.6
- daniel-ness/ansible-vault: ^0.0.3
- google/apiclient: ^2.18
- mikehaertl/php-shellcommand: ^1.7
- monolog/monolog: ^3.9
- php-curl-class/php-curl-class: ^12.0.4
- phpoffice/phpspreadsheet: ^5.4.0
- symfony/config: ^7.4
- symfony/console: ^7.4
- symfony/dependency-injection: ^7.4
- symfony/expression-language: ^7.4
- symfony/filesystem: ^7.4
- symfony/yaml: ^7.4
Requires (Dev)
- phpunit/phpunit: ^12.4
This package is auto-updated.
Last update: 2026-03-20 07:54:55 UTC
README
Introduction
Composer Parser is a CLI tool for comparing Composer dependencies across multiple repositories.
It collects composer.json (optionally composer.lock), groups packages by configurable rules, and exports a consolidated report.
โจ Key Features
-
๐ Multi-repository parsing- Reads dependency data from many repositories into one report.
-
๐ง Multiple parser modescomposerJsoncomposerJsonAndLockcomposerFull(includes latest versions viacomposer outdated)
-
๐ Multiple providersgitRepositorygitlabApiFilesgitlabApiArchive
-
๐ค Multiple output writersxlsxjsonhtmlgoogleSheets
-
๐งฉ Configurable grouping and styling- Regex-based package groups
- Version-based cell styling (used in XLSX and HTML)
๐ Project Structure
.
โโโ bin/ # CLI entrypoint
โโโ config/ # Parameters and service configuration
โโโ src/ # Application source code
โ โโโ Api/ # Contracts
โ โโโ Command/ # CLI commands
โ โโโ Exception/ # Domain exceptions
โ โโโ Model/ # Data models
โ โโโ Service/ # App use-cases, parsers, providers, writers, config/report/log services
โโโ tests/ # Unit and integration tests
โโโ var/ # Working data (repositories, results, logs)
๐ Quick Start
1. Clone and install
git clone https://github.com/evilstudio/composer-parser.git
cd composer-parser
composer install
2. Prepare configuration
cp config/parameters.yaml.template config/parameters.yaml
Set at least:
app.config.providerTypeapp.config.parserTypeapp.config.writerType(xlsx,json,html,googleSheets)repository.config.repositoryListwriter.config.shared.sheetName(required)
3. Run parser
bin/console app:run
bin/console app:run -p config/parameters.custom.yaml #To use custom parameters file
4. Cleanup downloaded repositories
bin/console app:cleanup
bin/console app:cleanup -p config/parameters.custom.yaml #To use custom parameters file
๐ป Commands
| Command | Description |
|---|---|
app:run |
Fetches data from configured repositories and writes report |
app:cleanup |
Removes downloaded repositories |
โ๏ธ Writer Configuration
Common local writer fields:
writer.config.local.fileNamewriter.config.local.fileDirectorywriter.config.shared.sheetName(required, used byxlsxandgoogleSheets)
Google Sheets writer (writerType: googleSheets) requires:
writer.config.googleSheets.spreadsheetIdwriter.config.googleSheets.serviceAccountJsonPath
๐ Google Sheets Setup
- Create/open a Google Cloud project.
- Enable
Google Sheets APIin that project. - Create a Service Account and generate a JSON key.
- Share target spreadsheet with the Service Account email as
Editor. - Set in config:
app.config.writerType: googleSheetswriter.config.shared.sheetNamewriter.config.googleSheets.spreadsheetIdwriter.config.googleSheets.serviceAccountJsonPath
๐งญ Notes
- Output file path is built from
writer.config.local.fileDirectory+fileName. {date}infileNameis replaced with current date (Y-m-d).- Errors are logged to
var/log/error.log. composerFullrequirescomposeravailable in PATH.gitRepositoryprovider requires localgit.xlsxoutput requires PHP extensionsext-zipandext-gd.
๐งช Testing
# Run all tests
./vendor/bin/phpunit --testdox