Skip to content

Commit 33951d4

Browse files
committed
Improve development docs
Add note about composer native:dev command
1 parent 1283ebc commit 33951d4

File tree

1 file changed

+40
-25
lines changed

1 file changed

+40
-25
lines changed

resources/views/docs/1/getting-started/development.md

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,7 @@ build environment. This means that changes you make to your application code _wi
3535
application until you restart it.
3636

3737
You can stop the `native:serve` command by pressing `Ctrl-C` on your keyboard in the terminal window it's running in.
38-
39-
Alternatively, you can use hot reloading.
40-
41-
### App Icon
42-
43-
The `native:serve` and `native:build` commands look for the following icon files when building your application:
44-
45-
- `public/icon.png` - your main icon, used on the Desktop, Dock and app switcher.
46-
- `public/IconTemplate.png` - used in the Menu Bar on non-retina displays.
47-
- `public/[email protected]` - used in the Menu Bar on retina displays.
48-
49-
If any of these files exist, they will be moved into the relevant location to be used as your application's icons.
50-
You simply need to follow the naming convention.
51-
52-
Your main icon should be at least 512x512 pixels.
38+
It will also terminate when you quit your application.
5339

5440
## Hot Reloading
5541

@@ -73,24 +59,53 @@ Now changes you make to files in your source code will cause a hot reload in you
7359

7460
Which files trigger reloads will depend on your Vite configuration.
7561

62+
## `composer native:dev`
63+
64+
You may find the `native:dev` script convenient. By default, it is setup to run both `native:serve` and `npm run dev`
65+
concurrently in a single command:
66+
67+
```shell
68+
composer native:dev
69+
```
70+
71+
You may modify this script to suit your needs. Simply edit the command in your `composer.json` scripts section.
72+
7673
## First run
7774

7875
When your application runs for the first time, a number of things occur.
7976

8077
NativePHP will:
8178

82-
1. Create the `appdata` folder - where this is created depends which platform you're developing on. It is named
83-
according to your `nativephp.app_id` config value (which is based on the `NATIVEPHP_APP_ID` env variable).
84-
2. Create a SQLite database
85-
3. Migrate the database
79+
1. Create the `appdata` folder - where this is created depends which platform you're developing on. In development, it
80+
is named according to your `APP_NAME`.
81+
2. Create a `nativephp.sqlite` SQLite database in your `database` folder.
82+
3. Migrate this database.
8683

87-
This is identical to what will happen when a new user runs a production build of your app for the first time on their
88-
device.
84+
The `appdata` structure is identical to that created by _production_ builds of your app, but when running in
85+
development, the database created there is _not_ migrated.
8986

90-
**If you change your `app_id`, a new `appdata` folder may need to be created and all of these steps will need to run
91-
again. No previous files will be deleted.**
87+
**If you change your `APP_NAME`, a new `appdata` folder will be created. No previous files will be deleted.**
9288

9389
## Subsequent runs
9490

95-
Every time your application boots, NativePHP checks that these files exist and creates them if they don't. It also tries
96-
to run your migrations. This is done with the `--force` flag so that it is fully automated even in production.
91+
In development, your application will not run migrations of the `nativephp.sqlite` database for you. You must do this
92+
manually:
93+
94+
```shell
95+
php artisan native:migrate
96+
```
97+
98+
For more details, see the [Databases](/docs/digging-deeper/databases) section.
99+
100+
## App Icon
101+
102+
The `native:serve` and `native:build` commands look for the following icon files when building your application:
103+
104+
- `public/icon.png` - your main icon, used on the Desktop, Dock and app switcher.
105+
- `public/IconTemplate.png` - used in the Menu Bar on non-retina displays.
106+
- `public/[email protected]` - used in the Menu Bar on retina displays.
107+
108+
If any of these files exist, they will be moved into the relevant location to be used as your application's icons.
109+
You simply need to follow the naming convention.
110+
111+
Your main icon should be at least 512x512 pixels.

0 commit comments

Comments
 (0)