A tool to help in developing composer-based PHP packages
Please note: This has only been tested by myself on a Linux machine. It has never touched a Mac or a Windows machine. If you’d like to help test in those environments, I’d love that 🙂
You will need composer installed globally on your local machine.
Git is optional but recommended.
When running the
init command, the package creation will attempt to use
git to try and determine your git username and email. It does this by accessing your git global config. If values are found, they will be used as the defaults for those values when manuscript asks you to enter them.
You can still enter new values if you don’t wish to use the defaults.
Github Personal Access Token
When running the
init --type=spatie command, part of the process sends a request to your GitHub account to create a new repository from the Spatie Laravel Package Template.
As a minimum, you should select the following scopes when generating your token: “admin:org”, “repo”.
Once you’ve entered your token during the
init command, it will be saved for future use in a
.manuscript file in your home directory.
Installation (Tested on Linux only)
Install this package globally. 🙂
composer global require davidpeach/composer-manuscript:^4.0
Creating a new package
Create a composer package
This command is essentially a wrapper around `composer init`.
manuscript init # Follow the terminal instructions
Create a Laravel package (using Spatie’s skeleton template)
It will then clone it to your local machine and begin Spatie’s configure script.
manuscript init --type=spatie # Follow the terminal instructions
Create a local Laravel installation “playground” for testing and playing.
--play command when creating your package (or in a pre-existing package), will tell manuscript to download your chosen version of Laravel and install your local package into it, using the composer path repository setting.
This will symlink your local package into that Laravel installation. Meaning you can develop your package and see the changes updated live in a full Laravel application.
Create a Laravel playground during basic init
manuscript init --play # Follow the terminal instructions
Create a Laravel playground during Spatie skeleton package init
manuscript init --type=spatie --play # Follow the terminal instructions
Create a Laravel playground for an existing composer package
cd /existing/composer/package/root manuscript play # Follow the terminal instructions
composer global remove davidpeach/composer-manuscript