jakiboy/vanilleplugin-packager

Composer Namespaces Prefixer for WordPress Plugins

0.3.3 2023-12-19 16:08 UTC

This package is auto-updated.

Last update: 2024-04-19 16:50:28 UTC


README

VanillePlugin Packager is a Composer Namespaces Prefixer for WordPress Plugins, Used to prefix VanillePlugin WordPress Plugin Framework And other composer dependencies.
Resolve dependencies versions conflicts of WordPress plugins built using Composer, Without hardcoding.

Works also for non Composer plugins, By Wrapping your dependencies with your own custom namespace, in order to avoid conflicts with other plugins that are loading the same dependencies in different versions.

__      __         _ _ _      _____  _             _         _____           _                         
\ \    / /        (_| | |    |  __ \| |           (_)       |  __ \         | |                        
 \ \  / __ _ _ __  _| | | ___| |__) | |_   _  __ _ _ _ __   | |__) __ _  ___| | ____ _  __ _  ___ _ __ 
  \ \/ / _` | '_ \| | | |/ _ |  ___/| | | | |/ _` | | '_ \  |  ___/ _` |/ __| |/ / _` |/ _` |/ _ | '__|
   \  | (_| | | | | | | |  __| |    | | |_| | (_| | | | | | | |  | (_| | (__|   | (_| | (_| |  __| |   
    \/ \__,_|_| |_|_|_|_|\___|_|    |_|\__,_|\__, |_|_| |_| |_|   \__,_|\___|_|\_\__,_|\__, |\___|_|   
                                              __/ |                                     __/ |          
                                             |___/                                     |___/           

⚡ Installing:

composer global require --dev jakiboy/vanilleplugin-packager

🔧 Getting Started:

Display packager help:

vanilleplugin -h

Regenerate dependency namespaces:

vanilleplugin -regd -d "Foo/Bar/src" -l "FooBar" -p "prefix"

Regenerate dependency namespaces with disabled capitalization (StudlyCaps):

vanilleplugin -regd -d "Foo/Bar/src" -l "FooBar" -p "\!prefix"

Regenerate dependency namespaces using random prefix:

vanilleplugin -regd -d "Foo/Bar/src" -l "FooBar"

Regenerate VanillePlugin namespaces using random prefix:

vanilleplugin -reg

Regenerate VanillePlugin namespaces:

vanilleplugin -reg "prefix"

Regenerate VanillePlugin namespaces with disabled capitalization (StudlyCaps):

vanilleplugin -reg "\!prefix"

Test packaging prefixed namespaces with disabled capitalization (StudlyCaps):

vanilleplugin -test "\!prefix"

📋 Options:

-d dependency source path (inside vendor folder)
-l dependency librairy name (Used in Namespaces)
-p Custom prefix

📋 Commands:

-regd Regenerate dependency namespaces
-reg Regenerate VanillePlugin namespaces
-test Test custom prefix after process

Contributing:

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning:

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors:

  • Jihad Sinnaour - Jakiboy (Initial work)

See also the full list of contributors who participated in this project. Any suggestions (Pull requests) are welcome!

License:

This project is licensed under the MIT License - see the LICENSE file for details.

Todo:

  • Rebuild with symfony/console.
  • Add phpunit/phpunit.
  • Use .phar.
  • Use dynamic vendor directory.
  • Use dynamic system (Plugin) directory.
  • Use regex(i) instead of pathinfo().
  • Use Lexer/Parser

⭐ Support:

Please give it a Star if you like the project.

💡 Notice:

  • Tested with VanillePlugin & many composer dependencies (e.g. Twig), But use it at your own risk.