- Notifications
You must be signed in to change notification settings - Fork3
tighten/mise
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Warning
This tool is in alpha.
A CLI tool to automatically apply preset steps to new Laravel applications, using concepts like composable recipes built from individual steps.
Use cases:
- Individual dev runs pre-made Mise recipes to kick off their app development
- Individual dev or agency creates a recipe they use for all their new apps, and applies with Mise
- Starter kit creator distributes their kit as a Mise recipe
- Starter kit creator automates the building of their new repo-based (
laravel new
style) starter kit using a Mise recipe that runs and pushes afresh every time there's a new version of Laravel available
Once Mise is installed globally with Composer, you'll install a new Laravel app:
laravel new money-makercd money-maker
Then you can use Mise to apply recipes:
mise apply preset1 preset2 preset3
Or you can use it interactively, where Prompts will let you choose which you want to apply:
mise apply
Mise comes with predefined "steps"; for example, a step namedduster/install
takes the following steps:
composer require-dev tightenco/duster
git add . && git commit -m "Install Duster"
./vendor/bin/duster fix
git add . && git commit -m "Run Duster"
Recipes are a list of steps, along with optional conditional logic around which steps to run.
Recipes are defined in the Mise codebase for now. In the future, you'll be able to have your own local recipes, and also pull them from a Mise SaaS.
We're also considering allowing you to set a default recipe to run, so you can maybe runmise default
on every new project.
Steps are individual PHP files. Here's what the above Duster install step looks like:
namespace Steps/Duster;class Installextends Step{publicfunction__invoke() {$this->composer->requireDev('tightenco/duster');$this->git->addAndCommit('Install Duster');$this->vendorExec('duster fix');$this->git->addAndCommit('Run Duster'); }}
We're working on building even more tooling to make common startup steps easy.
Let's imagine we have a recipe for creating a new Tighten SaaS. What steps do we want to take afterlaravel new
?
class Tightenextends Recipe{publicfunction__invoke() {$this->step('duster/install');$this->step('duster/ci'); }}
We can also take user input:
class Tightenextends Recipe{publicfunction__invoke() {$this->step('duster/install');$this->step('duster/ci');if (confirm(label:'Do you want to install our frontend tooling?')) {$this->step('tighten/prettier'); } }}
If you'd like to build your own recipe, you can!
Build a class that extendsApp/Recipe
and place it in~/.mise/Recipes
. It'll just show up!
Here's an example:
// ~/.mise/Recipes/EchoDate.php<?phpnamespaceApp\Recipes;class EchoDateextends Recipe{publicstring$key ='echo-date';publicfunction__invoke():void {echo"Today's date is" .date('Y-m-j'); }publicfunctiondescription():string {return'Echo the date.'; }publicfunctionname():string {return'Echo date'; }}
- Valet
- Lambo, especially this PR:tighten/lambo#185
- Josh Manders announced a toolSkeletor while I was plotting this; his tool is primarily hooking around
Composer
so I'll consider it a cousin :)
About
Tool for running pre-defined "recipes" on new Laravel applications.
Resources
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.