BrianHenryIE / strauss

Prefix PHP namespaces and classnames to allow multiple versions of libraries to exist without conflict.

Home Page:https://brianhenryie.github.io/strauss/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Good idea to set `target_directory`to 'vendor'?

evrpress opened this issue · comments

commented

Thanks for the tool, like it so far!

I wonder if it's ok to set the output directory to 'vendor' to not have 'vendor_prefix' or simliar.

Currently I run rm -rf vendor;mv vendor_prefix vendor after the strauss command to only have one vendor folder which is also in my .gitignore.

Also I like to keep brianhenryie/strauss dependency in the 'require-dev' but that would bot work if running composer update --no-dev for the production build. What's the expected approach here?

Thanks!

Hey,

I think the easiest answer is to change your default vendor directory using your composer.json's config/vendor-dir key to something else, e.g. vendor-real, and then set the Strauss target_directory to vendor.

As a more pure/correct way, there is a branch started for setting the target_directory to vendor so changes are made in-situ without copying files, but I haven't written tests against it or really used it myself. It might be working fine, give it a try: #34 (comment)

And you can download and use the .phar file to avoid the need to install Strauss via Composer. There's a suggested issue to distribute through Phive, but I've yet to use that myself so it's not yet done: #6 . The README describes downloading and using the Phar.

Unfortunately, until the in-situ branch is tested and merged, those two solutions are mutually exclusive!