Installing using Composer
When installing the package via composer, all the Rust codes and even the .github folder are downloaded. It might be worth configuring .gitattributes or moving the code for downloading binaries to a separate repository.
By the way, there is now also the option to download the mago binary using the dload utility like this:
composer require --dev internal/dload
vendor/bin/dload get mago:1.*@beta
Thanks for opening the issue!
I don't remember exactly why we did not add .github/rust code to .gitattributes before 🤔 but i remember there was a reason lol.
By the way, there is now also the option to download the mago binary using the dload utility like this:
That looks amazing! i did not know about it.
@roxblnfk can you send a PR to add dload instructions to docs/guide/?
👌 Sure, will do.
I tried adding a section to the documentation, but it seemed to me that it wouldn't simplify the process.
Let's discuss another way.
Since, for some reason, you can't add Rust code to gitattributes, consider this option: create a repository that contains only the files necessary for Composer installation. Let's say it's called mago-composer-downloader. In the composer.json of the current repository, specify that this is a meta-package. In this case, composer will download nothing but composer.json, where you specify mago-composer-downloader. This way, you get all the benefits:
- No fragmentation of GitHub stars
- The meta-package will be versioned with the sources
- The project's source code won't be loaded into users' projects and caches
@roxblnfk I'm not sure if its worth it. If dload can install mago correctly, i would be more in favor of removing the composer package completely, and recommand dload.
The reason why DLoad currently falls short of the mago installer is the extra steps needed to update to the latest Mago version.
Let me explain: right now, if a new version of Mago is released, it updates via composer with the command composer up.
Auto-updating with DLoad requires an additional action from the user (adding a script to trigger the update). I'm just in favor of not requiring the user to take extra steps.
However, if you separate the mago download script from the main repository (as I mentioned earlier), you can implement any method for downloading mago there: your own script, or dload as a dependency, or DLoad as a PHAR archive like PHP-CS-Fixer/shim.