evilstudio/composer-parser

Simple app for parse composer.json file from multiple repositories to one Excel spreadsheet

Maintainers

Package info

github.com/evilprophet/composer-parser

Type:project

pkg:composer/evilstudio/composer-parser

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v2.18.0 2026-03-20 07:53 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 modes

    • composerJson
    • composerJsonAndLock
    • composerFull (includes latest versions via composer outdated)
  • ๐ŸŒ Multiple providers

    • gitRepository
    • gitlabApiFiles
    • gitlabApiArchive
  • ๐Ÿ“ค Multiple output writers

    • xlsx
    • json
    • html
    • googleSheets
  • ๐Ÿงฉ 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.providerType
  • app.config.parserType
  • app.config.writerType (xlsx, json, html, googleSheets)
  • repository.config.repositoryList
  • writer.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.fileName
  • writer.config.local.fileDirectory
  • writer.config.shared.sheetName (required, used by xlsx and googleSheets)

Google Sheets writer (writerType: googleSheets) requires:

  • writer.config.googleSheets.spreadsheetId
  • writer.config.googleSheets.serviceAccountJsonPath

๐ŸŒ Google Sheets Setup

  1. Create/open a Google Cloud project.
  2. Enable Google Sheets API in that project.
  3. Create a Service Account and generate a JSON key.
  4. Share target spreadsheet with the Service Account email as Editor.
  5. Set in config:
  • app.config.writerType: googleSheets
  • writer.config.shared.sheetName
  • writer.config.googleSheets.spreadsheetId
  • writer.config.googleSheets.serviceAccountJsonPath

๐Ÿงญ Notes

  • Output file path is built from writer.config.local.fileDirectory + fileName.
  • {date} in fileName is replaced with current date (Y-m-d).
  • Errors are logged to var/log/error.log.
  • composerFull requires composer available in PATH.
  • gitRepository provider requires local git.
  • xlsx output requires PHP extensions ext-zip and ext-gd.

๐Ÿงช Testing

# Run all tests
./vendor/bin/phpunit --testdox