Removes whitelisted unnecessary files (like tests/docs etc.) from vendor directory

Overview

Latest Version on Packagist Total Downloads

Composer vendor cleanup

This is a simple script for the Composer to remove unnecessary files (documentation/examples/tests etc.) from included vendor packages. Therefore it's a script it can be easily used as part of a deploy script.

In my projects it saves about 20-30% of vendor size.

It uses predefined whitelist (rules.json) to remove files. So the risk of not working on included packages is reduced. Script is based on rules from barryvdh's package https://github.com/barryvdh/composer-cleanup-plugin .

Feel free to submit pull requests with new rules or features.

Installation

Add to composer:

composer require 0xch/composer-vendor-cleanup

Then add to your composer.json:

"scripts": {
    "cleanVendor": [
        "Oxch\\Composer\\CleanupScript::cleanVendor"
    ]
}

(optional) Copy rules.json to custom dir and modify for your case and pass filename as argument to composer.

Usage

Once installed just run command (defined in Installation step):

composer cleanVendor    #use default rules config file
composer cleanVendor customRules.json    #use custom rules config file    

It will go via all installed packages which are on the whitelist and remove unnecessary files.

Look for big files

You can use this command to display possible unnecessary files which can be deleted by adding to your custom rules config file.

du -hd 5 vendor/ | sort -h | grep -Pi "/(tests?|examples?|samples?)$"
You might also like...
Chrome extension to generate Laravel integration tests while using your app.

Laravel TestTools Check out the introduction post about the chrome extension. Installation git clone [email protected]:mpociot/laravel-testtools.git # i

Laravel-veneer - A suite of mocked services to use in your Laravel tests.

Laravel Veneer A suite of fixture data and methods to help make mocking 3rd party services easier. Overview Laravel Veneer aims to solve two problems

Generator-hedley - Scaffold a headless Drupal backend, Angular app client, and Behat tests

generator-hedley Scaffold a headless Drupal backend, Angular app client, and Behat tests Hedley is a yeoman generator that scaffolds a headless Drupal

Testbench Component is the de-facto package that has been designed to help you write tests for your Laravel package

Laravel Testing Helper for Packages Development Testbench Component is the de-facto package that has been designed to help you write tests for your La

This package provides a trait to run your tests against a MinIO S3 server.

Laravel MinIO Testing Tools This package provides a trait to run your tests against a MinIO S3 server. 📝 Blog post: https://protone.media/en/blog/how

A laravel package to generate class files from stub files.

Laravel Stub Generator A php laravel package to generate useable php files from given stub files . Installation Require the package using composer: co

A Laravel package that allows you to use multiple
A Laravel package that allows you to use multiple ".env" files in a precedent manner. Use ".env" files per domain (multi-tentant)!

Laravel Multi ENVs Use multiple .envs files and have a chain of precedence for the environment variables in these different .envs files. Use the .env

A simple Laravel package for generating download links with options such as expire time, IP restrictions, etc.

Generate download links in your Laravel applications This package allows you to generate download links for files. Once installed you can do stuff lik

The list of all Algerian provinces and cities according to the official division in different formats: csv, xlsx, php, json, etc.

algeria-cities This repository contains the list of all the administrative provinces and cities in Algeria. The data is up-to-date according to the of

Releases(v1.1.0)
Owner
Chris
Chris
This package allows you to render livewire components like a blade component, giving it attributes, slots etc

X-livewire This package allows you to render livewire components like a blade component, giving it attributes, slots etc. Assuming you wanted to creat

null 7 Nov 15, 2022
Locust are malware that can delete all folders, files, etc. on the system; I

Locust are malware that can delete all folders, files, etc. on the system; It was originally designed for web systems.

Md. Ridwanul Islam Muntakim 21 Dec 9, 2022
PHP phonebook with map (Active Directory, LDAP -> MySQL, PHP)

LDAP phonebook ???? ???? Development ветка Вопросы предпочтительнее задавать в Issues, а не по почте Корпоративный телефонный справочник с отображение

null 47 Nov 30, 2022
Eloquent Befriended brings social media-like features like following, blocking and filtering content based on following or blocked models.

Laravel Befriended Eloquent Befriended brings social media-like features like following, blocking and filtering content based on following or blocked

Renoki Co. 720 Jan 3, 2023
📦 Adds Laravel Packages Support to Lumen and Vendor Publish Artisan Command.

Laravel Package Support for Lumen: Makes Lumen compatible with Laravel Packages. You can use any Laravel Packages in Lumen by installing Larasupport Package.

Irfaq Syed 127 Dec 17, 2022
An easy way to get vendor and package data from Packagist via API calls

Laravel Packagist Laravel Packagist (LaravelPackagist) is a package for Laravel 5 to interact with the packagist api quickly and easily. Table of cont

Jeremy Kenedy 5 Jul 18, 2022
A simple pure PHP RADIUS client supporting Standard and Vendor-Specific Attributes in single file

BlockBox-Radius A simple pure PHP RADIUS client supporting Standard and Vendor-Specific Attributes in single file Author: Daren Yeh [email protected]

null 2 Oct 2, 2022
Laravel Package - Files to S3 Like Cloud Storage

This is a Laravel package that handles and make easy the upload, overwrite, delete, cdn purge of files and directories on AWS S3 like cloud storages. It supports a form uploaded file (UploadedFile) or a base64 file string

André G. Inocenti Lobo Viana 3 Jun 17, 2022
Perform Self-Diagnosis Tests On Your Laravel Application

Perform Self-Diagnosis Tests On Your Laravel Application This package allows you to run self-diagnosis tests on your Laravel application. It comes wit

Beyond Code 1.4k Dec 13, 2022
Fully customizable and tests supported Laravel admin dashboard for developers.

Laravel Admin dashboard Like Laravel Jetstream but built with Hotwire Turbo + additional perks. Tools used: tailwindcomponents/dashboard Hotwire Turbo

null 12 Nov 1, 2022