create-zerotal 1.1.0 → 1.4.0

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/CHANGELOG.md CHANGED
@@ -8,6 +8,16 @@ follows the Zerotal monorepo's unified versioning.
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [1.3.0] — 2026-08-09
12
+
13
+ ### Changed
14
+
15
+ - **Scaffolded models use the new composition idiom.** Templates now generate
16
+ `class User extends Model.using(Authenticatable)` instead of
17
+ `class User extends BaseModelWith(Authenticatable)`, and plain models extend `Model` rather than
18
+ `BaseModel` — following the base-class rename in `@zerotal/orm`. Affects the `admin`, `api`,
19
+ `flow`, `react` and `vue` templates.
20
+
11
21
  ## [1.1.0] — 2026-08-08
12
22
 
13
23
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-zerotal",
3
- "version": "1.1.0",
3
+ "version": "1.4.0",
4
4
  "description": "Create a new Zerotal application",
5
5
  "license": "MIT",
6
6
  "maturity": "stable",
package/src/scaffold.ts CHANGED
@@ -13,7 +13,7 @@ export type Template = 'minimal' | 'api' | 'admin' | 'flow' | 'react' | 'vue';
13
13
  // "^1.1.0" found for specifier "zerotal"` — the first thing anyone trying the
14
14
  // framework saw. `scaffold.test.ts` now asserts the two agree, so CI fails rather
15
15
  // than the user's install.
16
- export const ZT_VERSION = '^1.1.0';
16
+ export const ZT_VERSION = '^1.4.0';
17
17
 
18
18
  export interface ScaffoldOptions {
19
19
  name: string;
@@ -1,11 +1,11 @@
1
- import { BaseModel, column, table } from "zerotal/orm";
1
+ import { Model, column, table } from "zerotal/orm";
2
2
 
3
3
  /**
4
4
  * Something the shop sells. Soft-deleted, so a discontinued product can be
5
5
  * restored rather than lost.
6
6
  */
7
7
  @table("products")
8
- export class Product extends BaseModel {
8
+ export class Product extends Model {
9
9
  static override softDeletes = true;
10
10
  static override fillable = ["name", "sku", "description", "price", "stock", "status", "featured"];
11
11
 
@@ -1,11 +1,11 @@
1
- import { BaseModel, column, table } from "zerotal/orm";
1
+ import { Model, column, table } from "zerotal/orm";
2
2
 
3
3
  /**
4
4
  * Site-wide configuration — exactly one row, edited through a singular resource
5
5
  * rather than a list. See `app/admin/SettingsResource.ts`.
6
6
  */
7
7
  @table("settings")
8
- export class Setting extends BaseModel {
8
+ export class Setting extends Model {
9
9
  static override fillable = ["siteName", "supportEmail", "ordersOpen"];
10
10
 
11
11
  @column() siteName!: string;
@@ -1,4 +1,4 @@
1
- import { BaseModelWith, column, table } from "zerotal/orm";
1
+ import { Model, column, table } from "zerotal/orm";
2
2
  import { Authenticatable } from "zerotal/auth";
3
3
 
4
4
  /**
@@ -6,7 +6,7 @@ import { Authenticatable } from "zerotal/auth";
6
6
  * belong to a user.
7
7
  */
8
8
  @table("users")
9
- export class User extends BaseModelWith(Authenticatable) {
9
+ export class User extends Model.using(Authenticatable) {
10
10
  static override hidden = ["password"];
11
11
  static override fillable = ["name", "email", "password", "roles", "avatarUrl"];
12
12
 
@@ -1,7 +1,7 @@
1
- import { BaseModel, column, table } from 'zerotal/orm';
1
+ import { Model, column, table } from 'zerotal/orm';
2
2
 
3
3
  @table('users')
4
- export class User extends BaseModel {
4
+ export class User extends Model {
5
5
  // Models guard every attribute by default. List the columns that may be
6
6
  // mass-assigned from user input — note `role` is deliberately excluded so a
7
7
  // request body cannot escalate privileges via `User.create(ctx.body())`.
@@ -1,8 +1,8 @@
1
- import { BaseModelWith, column, table } from "zerotal/orm";
1
+ import { Model, column, table } from "zerotal/orm";
2
2
  import { Authenticatable } from "zerotal/auth";
3
3
 
4
4
  /**
5
- * `BaseModelWith(Authenticatable)`, not a plain `BaseModel`.
5
+ * `Model.using(Authenticatable)`, not a plain `Model`.
6
6
  *
7
7
  * The mixin is what brands the class so `authUserModel()` can find it. Without
8
8
  * the brand nothing errors and nothing warns — the model saves, queries and
@@ -14,7 +14,7 @@ import { Authenticatable } from "zerotal/auth";
14
14
  * reads, and registers the `rememberToken` column that "remember me" needs.
15
15
  */
16
16
  @table("users")
17
- export class User extends BaseModelWith(Authenticatable) {
17
+ export class User extends Model.using(Authenticatable) {
18
18
  // Models guard every attribute by default. Only these may be mass-assigned
19
19
  // from a request body — `role` is deliberately absent, so no amount of extra
20
20
  // fields in a form post can promote the account that submitted it.
@@ -111,7 +111,7 @@ describe('auth', () => {
111
111
 
112
112
  test('the User model is resolvable by the auth layer', () => {
113
113
  // The root cause, asserted directly: `Auth.attempt` finds the user model
114
- // through this brand, so a plain `BaseModel` makes every login fail.
114
+ // through this brand, so a plain `Model` makes every login fail.
115
115
  expect(isAuthenticatable(User)).toBe(true);
116
116
  });
117
117
 
@@ -1,8 +1,8 @@
1
- import { BaseModelWith, column, table } from "zerotal/orm";
1
+ import { Model, column, table } from "zerotal/orm";
2
2
  import { Authenticatable } from "zerotal/auth";
3
3
 
4
4
  /**
5
- * `BaseModelWith(Authenticatable)`, not a plain `BaseModel`.
5
+ * `Model.using(Authenticatable)`, not a plain `Model`.
6
6
  *
7
7
  * The mixin is what brands the class so `authUserModel()` can find it. Without
8
8
  * the brand nothing errors and nothing warns — the model saves, queries and
@@ -14,7 +14,7 @@ import { Authenticatable } from "zerotal/auth";
14
14
  * reads, and registers the `rememberToken` column that "remember me" needs.
15
15
  */
16
16
  @table("users")
17
- export class User extends BaseModelWith(Authenticatable) {
17
+ export class User extends Model.using(Authenticatable) {
18
18
  // Models guard every attribute by default. Only these may be mass-assigned
19
19
  // from a request body — `role` is deliberately absent, so no amount of extra
20
20
  // fields in a form post can promote the account that submitted it.
@@ -1,7 +1,7 @@
1
- import { BaseModel, column, table } from "zerotal/orm";
1
+ import { Model, column, table } from "zerotal/orm";
2
2
 
3
3
  @table("users")
4
- export class User extends BaseModel {
4
+ export class User extends Model {
5
5
  // Models guard every attribute by default. Only these may be mass-assigned
6
6
  // from a request body — `role` is deliberately absent, so no amount of extra
7
7
  // fields in a form post can promote the account that submitted it.