Skip to content

Commit cf31006

Browse files
committed
Add docs for CLI tools
1 parent c347ffd commit cf31006

File tree

1 file changed

+54
-8
lines changed

1 file changed

+54
-8
lines changed

docs/development/local-setup.md

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,60 @@ Then restart the Docker containers with:
8989

9090
You should now be able to access the application at [http://solidtime.test](http://solidtime.test) and the Vite server at [http://vite.solidtime.test](http://vite.solidtime.test).
9191

92+
## CLI tools
93+
94+
### Code formatting
95+
96+
You can format the PHP code with the following command:
97+
98+
```bash
99+
./vendor/bin/sail composer fix
100+
```
101+
102+
The frontend code can be formatted with:
103+
104+
```bash
105+
./vendor/bin/sail npm run lint:fix
106+
```
107+
108+
### Static code analysis
109+
110+
You can run the static code analysis for the PHP code with:
111+
112+
```bash
113+
./vendor/bin/sail composer analyse
114+
```
115+
116+
### Unit tests
117+
118+
You can run the unit tests with the following command:
119+
120+
```bash
121+
./vendor/bin/sail php artisan test
122+
```
123+
124+
If you want to run only some test you can use the `--filter` option:
125+
126+
```bash
127+
./vendor/bin/sail php artisan test --filter SomeTestName
128+
```
129+
130+
If you want to run all test as fast as possible, for example right before a commit, you can use this command:
131+
132+
```bash
133+
./vendor/bin/sail composer ptest
134+
```
135+
136+
### Generate ZOD Client
137+
138+
The Zodius HTTP client is generated using the following command:
139+
140+
```bash
141+
npm run zod:generate
142+
```
143+
144+
## E2E Tests
145+
92146
### Running E2E Tests
93147

94148
`./vendor/bin/sail up -d ` will automatically start a Playwright UI server that you can access at `https://playwright.solidtime.test`.
@@ -107,11 +161,3 @@ npx playwright codegen solidtime.test
107161

108162
If E2E tests are not working at all, make sure you do not have the Vite server running and just run `npm run build` to update the version.
109163
If the E2E tests are not working consistently and fail with a timeout during the authentication, you might want to delete the `test-results/.auth` directory to force new test accounts to be created.
110-
111-
### Generate ZOD Client
112-
113-
The Zodius HTTP client is generated using the following command:
114-
115-
```bash
116-
npm run zod:generate
117-
```

0 commit comments

Comments
 (0)