Skip to content

Commit 39a66cb

Browse files
lcharetteCopilot
andcommitted
Fix issues #160, #161, #162: database, CLI and Vite docs accuracy
Fixes #160 Fixes #161 Fixes #162 Chapter 11 - Database (#160): - Migration namespace: V400 → v400 (lowercase, case-sensitive on Linux) - users.id column type: string → int (auto-increment) - System tables path: remove UF4/5 app/system/ path, reference Core sprinkle instead - Sprunje: add note explaining ->like() / ->orLike() are UF-specific builder methods Chapter 14 - CLI (#161): - assets:build: remove stale aliases (webpack, build-assets); rewrite description for Vite-first behavior - assets:webpack: fix npm script names (dev/build/watch → webpack:dev/webpack:build/webpack:watch); add --server option - assets:install / assets:update: packages.lock → package-lock.json - bake: remove create:admin-user from built-in list (added by Account sprinkle event listener) Chapter 15 - Assets/Vite (#162): - vite:build script: vite build → vue-tsc && vite build (TypeScript type-check runs before build) - coverage script: vitest --coverage → vitest run --coverage (prevents hanging watch mode in CI) - Add prose explaining vue-tsc type-check step Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 82ef895 commit 39a66cb

5 files changed

Lines changed: 24 additions & 18 deletions

File tree

app/pages/6.0/11.database/02.default-tables/docs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: UserFrosting's installer creates a number of tables by default. He
55

66
When you install UserFrosting with the [Bakery CLI](/cli), a number of tables will automatically added to your database. These tables are required for UserFrosting's built-in features, such as user accounts, request throttling, persistent sessions, and access control.
77

8-
The [migrations](/database/migrations) for most tables can be found in the `src/Database/Migrations` directory of the Sprinkle that depends on it. The exceptions are the system tables, which are located in `app/system/Database/Migrations`.
8+
The [migrations](/database/migrations) for most tables can be found in the `src/Database/Migrations` directory of the Sprinkle that depends on it. The exceptions are the system tables, which are located in the [Core sprinkle](/structure/sprinkles#core-sprinkle).
99

1010
## System tables
1111

@@ -62,7 +62,7 @@ This table contains records for each user.
6262

6363
| Column | Type | Description |
6464
| ------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
65-
| `id` | `string` | The unique identifier for the user. |
65+
| `id` | `int` (auto-increment) | The unique identifier for the user. |
6666
| `user_name` | `string(50)` | A unique text identifier for the user. Only `[a-zA-Z0-9_-]` characters are allowed. |
6767
| `email` | `string(255)` | The email address of the user. Must be unique. |
6868
| `first_name` | `string(20)` | The user's first name. Optional. |

app/pages/6.0/11.database/03.migrations/docs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ namespace UserFrosting\Sprinkle\MySprinkle\Database\Migrations;
180180

181181
use Illuminate\Database\Schema\Blueprint;
182182
use UserFrosting\Sprinkle\Core\Database\Migration;
183-
use UserFrosting\Sprinkle\Account\Database\Migrations\V400\UsersTable;
184-
use UserFrosting\Sprinkle\Account\Database\Migrations\V400\RolesTable;
185-
use UserFrosting\Sprinkle\Account\Database\Migrations\V400\RoleUsersTable;
183+
use UserFrosting\Sprinkle\Account\Database\Migrations\v400\UsersTable;
184+
use UserFrosting\Sprinkle\Account\Database\Migrations\v400\RolesTable;
185+
use UserFrosting\Sprinkle\Account\Database\Migrations\v400\RoleUsersTable;
186186

187187
class MembersTable extends Migration
188188
{

app/pages/6.0/11.database/05.data-sprunjing/docs.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ To do this, you can define custom methods in your Sprunje:
211211
}
212212
```
213213

214+
> [!NOTE]
215+
> `->like()` and `->orLike()` are UserFrosting-specific query builder methods defined in `UserFrosting\Sprinkle\Core\Database\Builder`. They generate `LIKE '%value%'` clauses. You can alternatively use standard Eloquent syntax: `$query->where('genus', 'LIKE', "%{$value}%")->orWhere('species', 'LIKE', "%{$value}%")`.
216+
214217
The method name should consist of the field name (converted to StudlyCase), prefixed with `filter` or `sort`.
215218

216219
Thus, in this example a request parameter of `filters[scientific_name]=mega` will invoke the `filterScientificName` method in your Sprunje.

app/pages/6.0/14.cli/01.commands/docs.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $ php bakery help
3636

3737
### assets:build
3838

39-
The `assets:build` (alias : `webpack` & `build-assets`) command is the general assets building command. It combines `assets:install` and `assets:webpack` into a single command:
39+
The `assets:build` command is the general assets building command. It installs frontend dependencies and triggers a production build. The exact commands run depend on your configured bundler. For Vite (the default), it runs `assets:install` and `assets:vite` depending on the environment:
4040

4141
```bash
4242
$ php bakery assets:build [options]
@@ -54,21 +54,22 @@ See the [Asset Management](/assets-vite) chapter for more information about asse
5454

5555
### assets:install
5656

57-
The `assets:install` command is an alias for the **NPM** scripts used to install all required frontend dependencies locally, based on `packages.lock`. The versions defined in the lock file will be downloaded. Behind the scene, it's an alias for the `npm install` npm command.
57+
The `assets:install` command is an alias for the **NPM** scripts used to install all required frontend dependencies locally, based on `package-lock.json`. The versions defined in the lock file will be downloaded. Behind the scene, it's an alias for the `npm install` npm command.
5858

5959
### assets:update
6060

61-
The `assets:update` command is an alias for the **NPM** scripts used to update all frontend dependencies, ignoring the versions defined in `packages.lock`. Behind the scenes, it's an alias for the `npm update` npm command.
61+
The `assets:update` command is an alias for the **NPM** scripts used to update all frontend dependencies, ignoring the versions defined in `package-lock.json`. Behind the scenes, it's an alias for the `npm update` npm command.
6262

6363
### assets:webpack
6464

65-
The `assets:webpack` command is an alias for the **Webpack Encore** scripts used to compile frontend dependencies to `/public/assets`. Behind the scenes, it's an alias for the npm commands `npm run dev`, `npm run build` and `npm run watch`. See the table below for more information.
65+
The `assets:webpack` command is an alias for the **Webpack Encore** scripts used to compile frontend dependencies to `/public/assets`. Behind the scenes, it's an alias for the npm commands `npm run webpack:dev`, `npm run webpack:build` and `npm run webpack:watch`. See the table below for more information.
6666

67-
| Option | Description | Alias of |
68-
|------------------|-------------------------------------------------------------------------------------------|-----------------|
69-
| _no options_ | Compile the assets for development environment | `npm run dev` |
70-
| -p, --production | Compile the assets for production environment | `npm run build` |
71-
| -w, --watch | Watch for changes and recompile automatically. Only available in development environment. | `npm run watch` |
67+
| Option | Description | Alias of |
68+
|------------------|-------------------------------------------------------------------------------------------|--------------------------|
69+
| _no options_ | Compile the assets for development environment | `npm run webpack:dev` |
70+
| -p, --production | Compile the assets for production environment | `npm run webpack:build` |
71+
| -w, --watch | Watch for changes and recompile automatically. Only available in development environment. | `npm run webpack:watch` |
72+
| -s, --server | Start the HMR development server. | `npm run webpack:server` |
7273

7374
> [!NOTE]
7475
> The `production` option is automatically applied when the [environment mode](/configuration/config-files#environment-modes) is set to `production`.
@@ -101,7 +102,7 @@ See the [Asset Management](/assets-vite) chapter for more information about Vite
101102

102103
### bake
103104

104-
Bake is the general installation command. It combines `setup:db`, `setup:mail`, `debug`, `migrate`, `create:admin-user`, `assets:build` and `clear-cache` into a single command:
105+
Bake is the general installation command. It combines `setup:db`, `setup:mail`, `debug`, `migrate`, `assets:build` and `clear-cache` into a single command:
105106

106107
```bash
107108
$ php bakery bake

app/pages/6.0/15.assets-vite/04.build-workflow/docs.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,13 @@ This launches Vite in development mode with:
5353

5454
When running, your browser loads assets directly from Vite's dev server for the fastest possible feedback loop.
5555

56-
**`npm run vite:build`** - Creates an optimized production build
56+
**`npm run vite:build`** - Type-checks TypeScript then creates an optimized production build
5757
```json
58-
"vite:build": "vite build"
58+
"vite:build": "vue-tsc && vite build"
5959
```
6060

61+
The `vue-tsc` prefix runs a full TypeScript type-check before building. If there are any type errors, the build will abort. This ensures type safety is enforced in CI as well as locally.
62+
6163
This generates production-ready assets with:
6264
- **Code minification** - Removes whitespace and shortens variable names
6365
- **Tree shaking** - Eliminates unused code from bundles
@@ -96,7 +98,7 @@ Executes your test suite using [Vitest](https://vitest.dev/), a fast testing fra
9698

9799
**`npm run coverage`** - Generates a test coverage report
98100
```json
99-
"coverage": "vitest --coverage"
101+
"coverage": "vitest run --coverage"
100102
```
101103

102104
Creates a detailed report showing which parts of your code are tested.

0 commit comments

Comments
 (0)