create-nevela 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -55
- package/index.mjs +405 -418
- package/package.json +1 -1
- package/packagist.mjs +34 -25
- package/template/laravel/README.md +1 -0
- package/template/laravel/config/nevela.php +7 -0
- package/template/laravel/src/Console/DevCommand.php +104 -0
- package/template/laravel/src/Console/GenerateCommand.php +107 -77
- package/template/laravel/src/Console/MakeResourceCommand.php +17 -2
- package/template/laravel/src/Console/StatusCommand.php +172 -0
- package/template/laravel/src/Console/UpdateCommand.php +303 -0
- package/template/laravel/src/Console/VersionCommand.php +20 -0
- package/template/laravel/src/Generator/GeneratedFile.php +11 -2
- package/template/laravel/src/Generator/ResourceGenerator.php +719 -639
- package/template/laravel/src/Nevela.php +161 -151
- package/template/laravel/src/NevelaServiceProvider.php +79 -65
- package/template/laravel/src/Support/DashboardUpdate.php +110 -0
- package/template/laravel/src/Support/Releases.php +45 -0
- package/template/web/app/auth-actions.ts +12 -4
- package/template/web/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,55 +1,64 @@
|
|
|
1
|
-
# create-nevela
|
|
2
|
-
|
|
3
|
-
Create a new [Nevela](https://nevela-docs.vercel.app) app: a Laravel API and a Next.js dashboard, generated from one resource description.
|
|
4
|
-
|
|
5
|
-
```sh
|
|
6
|
-
pnpm create nevela my-app
|
|
7
|
-
# or
|
|
8
|
-
npm create nevela@latest my-app
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
You need PHP 8.3 or newer, Composer, and Node.js 20 or newer.
|
|
12
|
-
|
|
13
|
-
## What you get
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
my-app/
|
|
17
|
-
├─ apps/api/ a Laravel app with Sanctum and Nevela installed
|
|
18
|
-
├─ apps/web/ the Next.js dashboard, pointed at the API
|
|
19
|
-
└─
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Then:
|
|
23
|
-
|
|
24
|
-
```sh
|
|
25
|
-
cd my-app
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Open http://localhost:3000/sign-in and sign in as `admin@example.com` with the password `password`. That starter account is in your local database only; add your own with `php artisan nevela:user`.
|
|
30
|
-
|
|
31
|
-
Add your first resource from
|
|
32
|
-
|
|
33
|
-
```sh
|
|
34
|
-
php
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
`
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
# create-nevela
|
|
2
|
+
|
|
3
|
+
Create a new [Nevela](https://nevela-docs.vercel.app) app: a Laravel API and a Next.js dashboard, generated from one resource description.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm create nevela my-app
|
|
7
|
+
# or
|
|
8
|
+
npm create nevela@latest my-app
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
You need PHP 8.3 or newer, Composer, and Node.js 20 or newer.
|
|
12
|
+
|
|
13
|
+
## What you get
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
my-app/
|
|
17
|
+
├─ apps/api/ a Laravel app with Sanctum and Nevela installed
|
|
18
|
+
├─ apps/web/ the Next.js dashboard, pointed at the API
|
|
19
|
+
└─ nevela every command, from this folder: php nevela
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Then:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
cd my-app
|
|
26
|
+
php nevela dev
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Open http://localhost:3000/sign-in and sign in as `admin@example.com` with the password `password`. That starter account is in your local database only; add your own with `php artisan nevela:user`.
|
|
30
|
+
|
|
31
|
+
Add your first resource, from the same folder:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
php nevela resource Product --fields="name:string, sku:string!, price:money"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
That writes the Laravel code and the dashboard pages, and creates the table. `php nevela` lists everything else.
|
|
38
|
+
|
|
39
|
+
## Updating an app later
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
php nevela update
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
That updates the Laravel package, regenerates, and updates the dashboard files you have not changed. See https://nevela-docs.vercel.app/guides/updating/.
|
|
46
|
+
|
|
47
|
+
## Options
|
|
48
|
+
|
|
49
|
+
| Option | Meaning |
|
|
50
|
+
|---|---|
|
|
51
|
+
| `--pm <pnpm\|npm\|yarn\|bun>` | Package manager for the dashboard. Default: the one you ran this with. |
|
|
52
|
+
| `--no-install` | Don't install the dashboard's dependencies. |
|
|
53
|
+
| `--no-user` | Don't create the starter account. |
|
|
54
|
+
| `--no-git` | Don't run `git init`. |
|
|
55
|
+
| `--bundled-package` | Use the copy of `nevela/laravel` inside this installer instead of the release on Packagist. |
|
|
56
|
+
| `-y`, `--yes` | Ask nothing. Only the app name is ever asked for. |
|
|
57
|
+
|
|
58
|
+
With npm, put options after `--`: `npm create nevela@latest my-app -- --no-install`.
|
|
59
|
+
|
|
60
|
+
## How it installs the Laravel package
|
|
61
|
+
|
|
62
|
+
`nevela/laravel` is installed from [Packagist](https://packagist.org/packages/nevela/laravel), at the release that matches this installer's version.
|
|
63
|
+
|
|
64
|
+
If Packagist has no matching release, or you pass `--bundled-package`, the copy that travels inside this installer is placed in `my-app/packages/nevela-laravel` and Composer installs it from there. That is how Nevela's own CI tests a change to the package before it is released.
|