Skip to content

Commit fb10f8b

Browse files
author
neo
committed
first commit
0 parents  commit fb10f8b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2832
-0
lines changed

.gitkeep

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+

README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# LaravelPlus Installer
2+
3+
[![Packagist Version](https://img.shields.io/packagist/v/laravelplus/installer.svg?style=for-the-badge)](https://packagist.org/packages/laravelplus/installer)
4+
[![Downloads](https://img.shields.io/packagist/dt/laravelplus/installer.svg?style=for-the-badge)](https://packagist.org/packages/laravelplus/installer)
5+
![PHP](https://img.shields.io/packagist/php-v/laravelplus/installer.svg?style=for-the-badge)
6+
![Laravel](https://img.shields.io/badge/Laravel-12-red?style=for-the-badge)
7+
![License](https://img.shields.io/github/license/LaravelPlus/installer?style=for-the-badge)
8+
9+
[![CI](https://img.shields.io/github/actions/workflow/status/LaravelPlus/installer/ci.yml?style=for-the-badge&label=CI)](https://github.com/LaravelPlus/installer/actions)
10+
![Pint](https://img.shields.io/badge/Code%20Style-Pint-2ea44f?style=for-the-badge)
11+
![PHPStan](https://img.shields.io/badge/Static%20Analysis-PHPStan-blue?style=for-the-badge)
12+
13+
A professional, pattern-driven installer to bootstrap Laravel + Inertia + Vue apps with an excellent developer experience. It features a composable workflow, interactive multi-selects for optional packages, composer-aware choices, and clean architecture for easy extension.
14+
15+
## Quickstart
16+
17+
```bash
18+
composer require laravelplus/installer --dev
19+
php artisan laravelplus:install
20+
```
21+
22+
Non-interactive examples:
23+
```bash
24+
# Production, skip audit and build, keep existing vendor/node_modules
25+
php artisan laravelplus:install --mode=prod --yes --no-audit --no-build --no-clean
26+
27+
# Dry run (prints exact plan)
28+
php artisan laravelplus:install --dry
29+
```
30+
31+
Start dev environment:
32+
```bash
33+
composer run dev
34+
```
35+
36+
## Features
37+
- Pattern-driven architecture: Workflow orchestrator, Steps, Strategies, Reporters
38+
- Interactive UX: multi-select optional packages (Official, LaravelPlus, 3rd‑party)
39+
- Composer-aware selection: already installed packages are detected and skipped
40+
- Profiles: save and reuse previous selections
41+
- Per-step elapsed time; clean progress output and final recap
42+
- Events: `StepStarting`, `StepSucceeded`, `StepFailed`, `WorkflowCompleted`
43+
- Extensible via container‑tagged steps with priorities
44+
45+
## Configuration
46+
`packages/laravelplus/installer/config/laravelplus_installer.php`:
47+
```php
48+
return [
49+
'clean_dependencies_by_default' => false,
50+
'official_package_options' => [
51+
['key' => 'cashier', 'label' => 'Laravel Cashier', 'composer' => 'laravel/cashier', 'dev' => false],
52+
// ...
53+
],
54+
'laravelplus_package_options' => [
55+
['key' => 'fortress', 'label' => 'LaravelPlus Fortress', 'composer' => 'laravelplus/fortress', 'dev' => false],
56+
// ...
57+
],
58+
'third_party_package_options' => [
59+
['key' => 'pint', 'label' => 'laravel/pint', 'composer' => 'laravel/pint', 'dev' => true],
60+
// ...
61+
],
62+
// Controls order of tagged steps
63+
'step_priorities' => [ /* class => priority */ ],
64+
];
65+
```
66+
67+
## Extending the Installer
68+
Bind your step and tag it `laravelplus.installer.step`:
69+
```php
70+
$this->app->bind(MyCustomStep::class, fn ($app) => new MyCustomStep(/* deps */));
71+
$this->app->tag([MyCustomStep::class], 'laravelplus.installer.step');
72+
```
73+
Optionally set priority in `step_priorities` to position it.
74+
75+
## Troubleshooting
76+
- Composer auth issues: run `composer config -g github-oauth.github.com <token>`
77+
- npm audit failures: the installer treats audit as non‑fatal; use `--no-audit` to skip
78+
- Memory limit: `COMPOSER_MEMORY_LIMIT=-1 composer install`
79+
80+
## Contributing
81+
PRs are welcome. Please run Pint and PHPStan before submitting.
82+
83+
## License
84+
MIT © LaravelPlus

composer.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "https://getcomposer.org/schema.json",
3+
"name": "laravelplus/installer",
4+
"description": "LaravelPlus Installer: artisan command to bootstrap Laravel+Inertia apps",
5+
"type": "library",
6+
"license": "MIT",
7+
"require": {
8+
"php": "^8.4",
9+
"laravel/framework": "^12.28.1",
10+
"symfony/process": "^7.1"
11+
},
12+
"autoload": {
13+
"psr-4": {
14+
"LaravelPlus\\Installer\\": "src/"
15+
}
16+
},
17+
"extra": {
18+
"laravel": {
19+
"providers": [
20+
"LaravelPlus\\Installer\\InstallerServiceProvider"
21+
]
22+
}
23+
}
24+
}
25+
26+

config/laravelplus_installer.php

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
return [
5+
'clean_dependencies_by_default' => false,
6+
'official_package_options' => [
7+
[
8+
'key' => 'cashier',
9+
'label' => 'Laravel Cashier (composer)',
10+
'composer' => 'laravel/cashier',
11+
'dev' => false,
12+
],
13+
[
14+
'key' => 'boost',
15+
'label' => 'Laravel Boost (composer, dev)',
16+
'composer' => 'laravel/boost',
17+
'dev' => true,
18+
],
19+
[
20+
'key' => 'nightwatch',
21+
'label' => 'Laravel Nightwatch (composer, dev)',
22+
'composer' => 'laravel/nightwatch',
23+
'dev' => true,
24+
],
25+
],
26+
'laravelplus_package_options' => [
27+
[
28+
'key' => 'fortress',
29+
'label' => 'LaravelPlus Fortress (composer)',
30+
'composer' => 'laravelplus/fortress',
31+
'dev' => false,
32+
],
33+
[
34+
'key' => 'updater',
35+
'label' => 'LaravelPlus Updater (composer)',
36+
'composer' => 'laravelplus/laravel-updater',
37+
'dev' => false,
38+
],
39+
],
40+
'third_party_package_options' => [
41+
[
42+
'key' => 'debugbar',
43+
'label' => 'barryvdh/laravel-debugbar (composer, dev)',
44+
'composer' => 'barryvdh/laravel-debugbar',
45+
'dev' => true,
46+
],
47+
[
48+
'key' => 'spatie-permissions',
49+
'label' => 'spatie/laravel-permission (composer)',
50+
'composer' => 'spatie/laravel-permission',
51+
'dev' => false,
52+
],
53+
[
54+
'key' => 'pint',
55+
'label' => 'laravel/pint (composer, dev)',
56+
'composer' => 'laravel/pint',
57+
'dev' => true,
58+
],
59+
[
60+
'key' => 'pest',
61+
'label' => 'pestphp/pest (composer, dev)',
62+
'composer' => 'pestphp/pest',
63+
'dev' => true,
64+
],
65+
[
66+
'key' => 'phpstan',
67+
'label' => 'phpstan/phpstan (composer, dev)',
68+
'composer' => 'phpstan/phpstan',
69+
'dev' => true,
70+
],
71+
[
72+
'key' => 'rector',
73+
'label' => 'rector/rector (composer, dev)',
74+
'composer' => 'rector/rector',
75+
'dev' => true,
76+
],
77+
],
78+
'presets' => [
79+
'blade' => \LaravelPlus\Installer\Support\Presets\BladePresetInstaller::class,
80+
'inertia-vue' => \LaravelPlus\Installer\Support\Presets\InertiaVuePresetInstaller::class,
81+
'inertia-react' => \LaravelPlus\Installer\Support\Presets\InertiaReactPresetInstaller::class,
82+
'livewire' => \LaravelPlus\Installer\Support\Presets\LivewirePresetInstaller::class,
83+
],
84+
'step_priorities' => [
85+
\LaravelPlus\Installer\Workflow\Steps\PreflightChecks::class => 10,
86+
\LaravelPlus\Installer\Workflow\Steps\PrepareEnvironment::class => 20,
87+
\LaravelPlus\Installer\Workflow\Steps\EnsureDatabase::class => 30,
88+
\LaravelPlus\Installer\Workflow\Steps\SetPermissions::class => 40,
89+
\LaravelPlus\Installer\Workflow\Steps\InstallPhpDependencies::class => 50,
90+
\LaravelPlus\Installer\Workflow\Steps\Optional\InstallSelectedPackages::class => 60,
91+
\LaravelPlus\Installer\Workflow\Steps\InstallNodeDependencies::class => 70,
92+
\LaravelPlus\Installer\Workflow\Steps\GenerateAppKey::class => 80,
93+
\LaravelPlus\Installer\Workflow\Steps\RunMigrations::class => 90,
94+
\LaravelPlus\Installer\Workflow\Steps\OptimizeIfProd::class => 100,
95+
],
96+
'retries' => 1,
97+
'retry_sleep_ms' => 500,
98+
];
99+
100+

0 commit comments

Comments
 (0)