cabloy 5.1.53 → 5.1.54
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/.github/workflows/docs-pages.yml +1 -1
- package/.github/workflows/vona-cov-pg.yml +1 -1
- package/.github/workflows/vona-test-crud.yml +1 -1
- package/.github/workflows/vona-test-mysql.yml +1 -1
- package/.github/workflows/vona-test-pg.yml +1 -1
- package/.github/workflows/vona-test-sqlite3.yml +1 -1
- package/.github/workflows/vona-tsc.yml +1 -1
- package/.github/workflows/zova-ui.yml +1 -1
- package/CHANGELOG.md +16 -0
- package/README.md +8 -8
- package/cabloy-docs/backend/model-guide.md +7 -0
- package/cabloy-docs/backend/orm-mutation-guide.md +10 -0
- package/cabloy-docs/backend/orm-select-guide.md +7 -6
- package/cabloy-docs/backend/quickstart.md +8 -8
- package/cabloy-docs/fullstack/quickstart.md +8 -8
- package/cabloy-docs/pnpm-workspace.yaml +2 -0
- package/cabloy-docs/reference/cli-reference.md +65 -20
- package/package.json +3 -3
- package/scripts/init.ts +18 -0
- package/vona/README.md +5 -5
- package/vona/README.zh-CN.md +5 -5
- package/vona/package.original.json +1 -6
- package/vona/packages-cli/cabloy-cli/package.json +2 -2
- package/vona/packages-cli/cli/README.md +56 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli/src/bin/vona.ts +0 -26
- package/vona/packages-cli/cli-set-api/README.md +48 -0
- package/vona/packages-cli/cli-set-api/cli/templates/create/module/boilerplate/_package.json +1 -1
- package/vona/packages-cli/cli-set-api/package.json +2 -2
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.bin.test.ts +16 -5
- package/vona/packages-cli/cli-set-api/src/lib/command/bin.build.ts +2 -2
- package/vona/packages-cli/cli-set-api/src/lib/command/bin.buildGeneral.ts +1 -1
- package/vona/packages-cli/cli-set-api/src/lib/command/bin.buildModule.ts +1 -1
- package/vona/packages-cli/cli-set-api/src/lib/command/bin.play.ts +2 -1
- package/vona/packages-cli/cli-set-api/src/lib/command/bin.test.ts +1 -1
- package/vona/packages-utils/cascade-extend/package.json +2 -2
- package/vona/packages-utils/compose/package.json +2 -2
- package/vona/packages-utils/deps/package.json +2 -2
- package/vona/packages-utils/dotenv/package.json +2 -2
- package/vona/packages-utils/extend/package.json +2 -2
- package/vona/packages-utils/json5/package.json +2 -2
- package/vona/packages-utils/lint/package.json +1 -1
- package/vona/packages-utils/lint/src/oxc/lint.ts +1 -4
- package/vona/packages-utils/lint/src/oxc/lintVue.ts +1 -4
- package/vona/packages-utils/localeutil/package.json +2 -2
- package/vona/packages-utils/module-glob/package.json +2 -2
- package/vona/packages-utils/module-info-pro/package.json +2 -2
- package/vona/packages-utils/password-hash-salt/package.json +2 -2
- package/vona/packages-utils/process-helper/package.json +2 -2
- package/vona/packages-utils/socket/package.json +2 -2
- package/vona/packages-utils/table-identity/package.json +2 -2
- package/vona/packages-utils/utils/package.json +2 -2
- package/vona/packages-utils/zod-errors-custom/package.json +2 -2
- package/vona/packages-utils/zod-openapi/package.json +2 -2
- package/vona/packages-utils/zod-query/package.json +2 -2
- package/vona/packages-vona/vona/package.json +2 -2
- package/vona/packages-vona/vona-core/package.json +2 -2
- package/vona/packages-vona/vona-mock/package.json +2 -2
- package/vona/packages-vona/vona-shared/package.json +2 -2
- package/vona/pnpm-lock.yaml +1520 -1826
- package/vona/pnpm-workspace.yaml +28 -7
- package/vona/src/suite/a-demo/modules/demo-basic/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-base/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-index/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-user/package.json +1 -1
- package/vona/src/suite/cabloy-basic/modules/basic-siteadmin/package.json +1 -1
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/package.json +1 -1
- package/vona/src/suite-vendor/a-auth/modules/a-auth/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/modules/auth-oauth/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/modules/auth-simple/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-cabloy/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasharding/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasource/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-socket/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssrhmr/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-status/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/package.json +1 -1
- package/vona/src/suite-vendor/a-captcha/modules/a-captcha/package.json +2 -2
- package/vona/src/suite-vendor/a-captcha/modules/captcha-simple/package.json +2 -2
- package/vona/src/suite-vendor/a-captcha/package.json +1 -1
- package/vona/src/suite-vendor/a-paypal/modules/a-paypal/package.json +2 -2
- package/vona/src/suite-vendor/a-paypal/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-aspect/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-aspectutils/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-bean/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-beanmutate/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-body/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-broadcast/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-cache/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-caching/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-election/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-error/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-event/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-executor/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-hmr/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-hmrbase/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-index/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-instance/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-jwt/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-locale/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-logger/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-mail/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-menu/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-meta/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-onion/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapischema/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/common/buildWhere.ts +8 -9
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/bean.model/bean.model_cache.ts +15 -9
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelWhere.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-ormutils/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-play/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-printtip/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-queue/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-redis/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-redlock/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-runtime/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-schedule/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-security/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-serialization/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-startup/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-static/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-summer/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-swagger/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-upload/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-user/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-validation/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-version/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-vona/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-web/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-worker/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-zod/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/package.original.json +2 -15
- package/zova/packages-cli/cli/README.md +58 -0
- package/zova/packages-cli/cli/package.json +4 -4
- package/zova/packages-cli/cli/src/bin/zova.ts +0 -25
- package/zova/packages-cli/cli-set-front/README.md +50 -0
- package/zova/packages-cli/cli-set-front/cli/templates/create/module/boilerplate/_package.json +1 -1
- package/zova/packages-cli/cli-set-front/package.json +7 -7
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.bin.buildRest.ts +49 -15
- package/zova/packages-cli/cli-set-front/src/lib/beans.ts +0 -4
- package/zova/packages-cli/cli-set-front/src/lib/command/bin.buildModule.ts +1 -1
- package/zova/packages-cli/cli-set-front/src/lib/command/bin.buildRest.ts +1 -1
- package/zova/packages-utils/logger/package.json +3 -3
- package/zova/packages-utils/zova-jsx/package.json +6 -6
- package/zova/packages-utils/zova-openapi/package.json +2 -2
- package/zova/packages-utils/zova-vite/package.json +5 -5
- package/zova/packages-zova/zova/package.json +4 -4
- package/zova/packages-zova/zova-core/package.json +12 -12
- package/zova/pnpm-lock.yaml +264 -212
- package/zova/pnpm-workspace.yaml +21 -0
- package/zova/src/suite/a-demo/modules/demo-basic/package.json +1 -1
- package/zova/src/suite/a-demo/modules/demo-todo/package.json +1 -1
- package/zova/src/suite/a-devui/modules/devui-adapter/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-api/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-base/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-icon/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-indexadmin/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-indexweb/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutadmin/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutempty/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutweb/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-login/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-passport/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-theme/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-adapter/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-captcha/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-commands/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-commandssync/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-currency/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-date/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-form/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-input/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-page/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-select/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-table/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-text/package.json +1 -1
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/package.json +2 -2
- package/zova/src/suite-vendor/a-cabloy/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-api/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-app/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-bean/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-behavior/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-behaviors/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-boundary/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-command/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-fetch/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-icon/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-interceptor/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-logger/package.json +3 -3
- package/zova/src/suite-vendor/a-zova/modules/a-meta/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-model/package.json +3 -3
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-router/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-routerstack/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-routertabs/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssrhmr/package.json +3 -3
- package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-style/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-zod/package.json +5 -5
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +9 -9
- package/zova/src/suite-vendor/a-zova/package.json +26 -26
- package/zova/packages-cli/cli-set-front/src/lib/command/init.legacy.ts +0 -10
- package/zova/packages-cli/cli-set-front/src/lib/command/refactor.componentEmits.ts +0 -33
- package/zova/packages-cli/cli-set-front/src/lib/command/refactor.componentSlots.ts +0 -33
|
@@ -29,7 +29,7 @@ jobs:
|
|
|
29
29
|
node-version: ${{ matrix.node-version }}
|
|
30
30
|
- uses: pnpm/action-setup@v5
|
|
31
31
|
with:
|
|
32
|
-
version:
|
|
32
|
+
version: 11.5.2
|
|
33
33
|
- name: init
|
|
34
34
|
run: npm run init
|
|
35
35
|
- run: DATABASE_DEFAULT_CLIENT=mysql DATABASE_CLIENT_MYSQL_HOST=127.0.0.1 DATABASE_CLIENT_MYSQL_PASSWORD=root npm run test
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.1.54
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- Add a set of incremental feature updates across the codebase to expand supported functionality and behavior.
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- Support `src/module` test targets.
|
|
12
|
+
- Support module-relative test targets.
|
|
13
|
+
|
|
14
|
+
### Improvements
|
|
15
|
+
|
|
16
|
+
- Clarify ORM omit semantics in tests and documentation.
|
|
17
|
+
- Refine query and model-related internals, including updates to post handling, `where` building, and model cache behavior.
|
|
18
|
+
|
|
3
19
|
## 5.1.53
|
|
4
20
|
|
|
5
21
|
### Features
|
package/README.md
CHANGED
|
@@ -20,14 +20,14 @@ With Vona, Zova, suite-based modules, and CLI-first workflows, Cabloy turns comm
|
|
|
20
20
|
|
|
21
21
|
Before creating a new Cabloy project, make sure your environment has:
|
|
22
22
|
|
|
23
|
-
| Name | Version
|
|
24
|
-
| ---------- |
|
|
25
|
-
| pnpm | `>=
|
|
26
|
-
| Node.js | `>=24.4.0`
|
|
27
|
-
| Redis | `>=7.2.6`
|
|
28
|
-
| SQLite3 | `Built-in`
|
|
29
|
-
| MySQL | `>=8`
|
|
30
|
-
| PostgreSQL | `>=16`
|
|
23
|
+
| Name | Version |
|
|
24
|
+
| ---------- | ---------- |
|
|
25
|
+
| pnpm | `>=11.5.2` |
|
|
26
|
+
| Node.js | `>=24.4.0` |
|
|
27
|
+
| Redis | `>=7.2.6` |
|
|
28
|
+
| SQLite3 | `Built-in` |
|
|
29
|
+
| MySQL | `>=8` |
|
|
30
|
+
| PostgreSQL | `>=16` |
|
|
31
31
|
|
|
32
32
|
- `Redis`: powers queue, schedule, startup, broadcast, caching, two-layer cache, and redlock
|
|
33
33
|
- `SQLite3`: if you use `better-sqlite3`, set up `node-gyp` before installing dependencies
|
|
@@ -105,6 +105,13 @@ return await this.scope.model.student.deleteById(id);
|
|
|
105
105
|
|
|
106
106
|
These methods are also part of the generated CRUD thread; see [CRUD Workflow](/backend/crud-workflow).
|
|
107
107
|
|
|
108
|
+
When using magic methods, keep one semantic detail in mind:
|
|
109
|
+
|
|
110
|
+
- default `eq` methods can treat an omitted argument as `null`
|
|
111
|
+
- non-`eq` methods require an explicit argument
|
|
112
|
+
|
|
113
|
+
For omission inside structured `where` objects, prefer `Op.omit`; for SQL null checks, use `null`.
|
|
114
|
+
|
|
108
115
|
## Query-builder support
|
|
109
116
|
|
|
110
117
|
Vona models are built on Knex, so the model layer also supports lower-level query builder access when needed.
|
|
@@ -180,6 +180,16 @@ The important rule is:
|
|
|
180
180
|
- the underlying write semantics still come from the standard ORM mutation surface
|
|
181
181
|
- custom model methods take precedence when business-specific behavior is needed
|
|
182
182
|
|
|
183
|
+
There is also a useful argument-handling rule to remember:
|
|
184
|
+
|
|
185
|
+
- default `eq` magic methods such as `getByName()` or `selectByName()` treat an omitted argument as `null`
|
|
186
|
+
- non-`eq` magic methods such as `getByNameEqI()` require an explicit value and throw if the argument is omitted
|
|
187
|
+
|
|
188
|
+
This aligns magic-method behavior with the current ORM `where` semantics:
|
|
189
|
+
|
|
190
|
+
- `Op.omit` means omit a condition explicitly
|
|
191
|
+
- `null` means SQL `IS NULL`
|
|
192
|
+
|
|
183
193
|
That means mutation should stay conceptually grounded in the standard model methods even when convenience wrappers are present.
|
|
184
194
|
|
|
185
195
|
## Implementation checks for ORM mutation changes
|
|
@@ -110,7 +110,6 @@ The operator model is broad and includes examples like:
|
|
|
110
110
|
- `_includes_`
|
|
111
111
|
- case-insensitive variants
|
|
112
112
|
- `_ref_`
|
|
113
|
-
- `_skip_`
|
|
114
113
|
|
|
115
114
|
That operator vocabulary is part of the Cabloy data language and should be reused consistently.
|
|
116
115
|
|
|
@@ -121,15 +120,17 @@ A practical operator-family reading is:
|
|
|
121
120
|
- null checks: `_is_`, `_isNot_`
|
|
122
121
|
- string matching: `_startsWith_`, `_endsWith_`, `_includes_`, and case-insensitive variants
|
|
123
122
|
- composition/subquery: `_and_`, `_or_`, `_not_`, `_exists_`, `_notExists_`
|
|
124
|
-
- identifier
|
|
123
|
+
- identifier helper: `_ref_`
|
|
125
124
|
|
|
126
|
-
### `
|
|
125
|
+
### Omitting a condition with `Op.omit`
|
|
127
126
|
|
|
128
|
-
`
|
|
127
|
+
Use `Op.omit` when you want to express omission explicitly at the call site. `Op.omit` is defined as `undefined`, but using the named constant makes the business meaning of the query object clearer.
|
|
129
128
|
|
|
130
129
|
Representative pattern:
|
|
131
130
|
|
|
132
131
|
```typescript
|
|
132
|
+
import { Op } from 'vona-module-a-orm';
|
|
133
|
+
|
|
133
134
|
const where = {
|
|
134
135
|
title: { _includes_: 'ai' },
|
|
135
136
|
stars: { _gt_: 20 },
|
|
@@ -138,12 +139,12 @@ const where = {
|
|
|
138
139
|
await this.scope.model.post.select({
|
|
139
140
|
where: {
|
|
140
141
|
...where,
|
|
141
|
-
stars:
|
|
142
|
+
stars: Op.omit,
|
|
142
143
|
},
|
|
143
144
|
});
|
|
144
145
|
```
|
|
145
146
|
|
|
146
|
-
This lets a query builder remove one condition cleanly without rebuilding the whole `where` object by hand.
|
|
147
|
+
This lets a query builder remove one condition cleanly without rebuilding the whole `where` object by hand, while `null` remains available for SQL `IS NULL` semantics.
|
|
147
148
|
|
|
148
149
|
## Joint operators and subqueries
|
|
149
150
|
|
|
@@ -16,14 +16,14 @@ Use this page when you are contributing backend work in the framework repository
|
|
|
16
16
|
|
|
17
17
|
## Prerequisites
|
|
18
18
|
|
|
19
|
-
| Name | Version
|
|
20
|
-
| ---------- |
|
|
21
|
-
| pnpm | >=
|
|
22
|
-
| Node.js | >=24.8.0
|
|
23
|
-
| Redis | >=7.2.6
|
|
24
|
-
| Sqlite3 | Built-in
|
|
25
|
-
| MySQL | >=8
|
|
26
|
-
| Postgresql | >=16
|
|
19
|
+
| Name | Version |
|
|
20
|
+
| ---------- | -------- |
|
|
21
|
+
| pnpm | >=11.5.2 |
|
|
22
|
+
| Node.js | >=24.8.0 |
|
|
23
|
+
| Redis | >=7.2.6 |
|
|
24
|
+
| Sqlite3 | Built-in |
|
|
25
|
+
| MySQL | >=8 |
|
|
26
|
+
| Postgresql | >=16 |
|
|
27
27
|
|
|
28
28
|
Notes:
|
|
29
29
|
|
|
@@ -6,14 +6,14 @@ This guide explains the fastest way to start a Cabloy fullstack project.
|
|
|
6
6
|
|
|
7
7
|
Before creating a new Cabloy project, make sure your environment has:
|
|
8
8
|
|
|
9
|
-
| Name | Version
|
|
10
|
-
| ------------ |
|
|
11
|
-
| `pnpm` | `>=
|
|
12
|
-
| `Node.js` | `>=24.4.0`
|
|
13
|
-
| `Redis` | `>=7.2.6`
|
|
14
|
-
| `SQLite3` | `Built-in`
|
|
15
|
-
| `MySQL` | `>=8`
|
|
16
|
-
| `PostgreSQL` | `>=16`
|
|
9
|
+
| Name | Version |
|
|
10
|
+
| ------------ | ---------- |
|
|
11
|
+
| `pnpm` | `>=11.5.2` |
|
|
12
|
+
| `Node.js` | `>=24.4.0` |
|
|
13
|
+
| `Redis` | `>=7.2.6` |
|
|
14
|
+
| `SQLite3` | `Built-in` |
|
|
15
|
+
| `MySQL` | `>=8` |
|
|
16
|
+
| `PostgreSQL` | `>=16` |
|
|
17
17
|
|
|
18
18
|
- `Redis`: powers queue, schedule, startup, broadcast, caching, two-layer cache, and redlock
|
|
19
19
|
- `SQLite3`: if you use `better-sqlite3`, set up `node-gyp` before installing dependencies
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# CLI Reference
|
|
2
2
|
|
|
3
|
-
This page is the
|
|
3
|
+
This page is the fast orientation map for the two main Cabloy CLI entrypoints. Use it first when you need to answer three questions quickly:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
1. Should this workflow use Vona or Zova?
|
|
6
|
+
2. Which command families already exist?
|
|
7
|
+
3. Where is the authoritative command definition for a specific command?
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
## Quick routing
|
|
10
|
+
|
|
11
|
+
### Use Vona for backend workflows
|
|
12
|
+
|
|
13
|
+
Run from the repo root:
|
|
8
14
|
|
|
9
15
|
```bash
|
|
10
16
|
npm run vona :
|
|
@@ -12,38 +18,77 @@ npm run vona :create
|
|
|
12
18
|
npm run vona :tools
|
|
13
19
|
```
|
|
14
20
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- `bin:*`
|
|
18
|
-
- `create:*`
|
|
19
|
-
- `init:*`
|
|
20
|
-
- `tools:*`
|
|
21
|
+
Choose Vona for backend-oriented work such as suites, modules, beans, metadata, runtime assets, tests, and backend build or dev tasks.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
### Use Zova for frontend workflows
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
Run from the repo root:
|
|
25
26
|
|
|
26
27
|
```bash
|
|
27
28
|
npm run zova :
|
|
28
29
|
npm run zova :create
|
|
29
30
|
npm run zova :refactor
|
|
31
|
+
npm run zova :openapi
|
|
30
32
|
```
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
Choose Zova for frontend-oriented work such as pages, components, frontend beans, refactors, generated frontend metadata, and OpenAPI-to-SDK generation.
|
|
35
|
+
|
|
36
|
+
## Source of truth
|
|
37
|
+
|
|
38
|
+
The shared root scripts live in `package.json`:
|
|
39
|
+
|
|
40
|
+
- `npm run vona`
|
|
41
|
+
- `npm run zova`
|
|
42
|
+
|
|
43
|
+
Those scripts enter thin CLI launchers and then hand off to the real command catalogs:
|
|
44
|
+
|
|
45
|
+
- Vona entrypoint: `vona/packages-cli/cli/src/bin/vona.ts`
|
|
46
|
+
- Zova entrypoint: `zova/packages-cli/cli/src/bin/zova.ts`
|
|
47
|
+
- Vona command registry: `vona/packages-cli/cli-set-api/src/lib/commands.ts`
|
|
48
|
+
- Zova command registry: `zova/packages-cli/cli-set-front/src/lib/commands.ts`
|
|
49
|
+
|
|
50
|
+
When you need the authoritative command-family map, inspect the two `commands.ts` files first.
|
|
51
|
+
|
|
52
|
+
## Command families
|
|
33
53
|
|
|
34
|
-
|
|
35
|
-
- `create:*`
|
|
36
|
-
- `init:*`
|
|
37
|
-
- `refactor:*`
|
|
38
|
-
- `tools:*`
|
|
39
|
-
- `openapi:*`
|
|
54
|
+
### Vona families
|
|
40
55
|
|
|
41
|
-
|
|
56
|
+
- `bin:*` — backend runtime and build tasks
|
|
57
|
+
- `create:*` — create suites, modules, beans, and tests
|
|
58
|
+
- `init:*` — initialize backend source artifacts
|
|
59
|
+
- `tools:*` — metadata, dependency, and CRUD-related tools
|
|
42
60
|
|
|
43
|
-
|
|
61
|
+
### Zova families
|
|
62
|
+
|
|
63
|
+
- `bin:*` — frontend build tasks
|
|
64
|
+
- `create:*` — create suites, modules, pages, components, mocks, and beans
|
|
65
|
+
- `init:*` — initialize frontend source artifacts
|
|
66
|
+
- `refactor:*` — frontend refactor workflows
|
|
67
|
+
- `tools:*` — metadata and dependency tools
|
|
68
|
+
- `openapi:*` — OpenAPI config and SDK generation workflows
|
|
69
|
+
|
|
70
|
+
## Fast path to a specific command
|
|
71
|
+
|
|
72
|
+
For a specific command, use this navigation path:
|
|
73
|
+
|
|
74
|
+
1. choose `npm run vona` or `npm run zova`
|
|
75
|
+
2. inspect the relevant `commands.ts` registry
|
|
76
|
+
3. open the matching command module in `src/lib/command/`
|
|
77
|
+
4. read `info.title`, `info.usage`, and `options`
|
|
78
|
+
|
|
79
|
+
Representative command modules:
|
|
80
|
+
|
|
81
|
+
- `vona/packages-cli/cli-set-api/src/lib/command/bin.play.ts`
|
|
82
|
+
- `zova/packages-cli/cli-set-front/src/lib/command/tools.metadata.ts`
|
|
83
|
+
|
|
84
|
+
This is the preferred path for both humans and AI agents because it follows the real registration flow instead of relying on scattered examples.
|
|
85
|
+
|
|
86
|
+
## Related guides
|
|
44
87
|
|
|
45
88
|
Use this page together with:
|
|
46
89
|
|
|
47
90
|
- [Backend Quickstart](/backend/quickstart)
|
|
48
91
|
- [Frontend (Zova)](/frontend/introduction)
|
|
49
92
|
- [Backend OpenAPI to Frontend SDK](/fullstack/openapi-to-sdk)
|
|
93
|
+
|
|
94
|
+
If the public CLI surface is enough, prefer it over file-level implementation details. Drop to the source files only when you need the authoritative registry or per-command metadata.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cabloy",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.54",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "A Node.js fullstack framework",
|
|
6
6
|
"keywords": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"type": "module",
|
|
23
23
|
"scripts": {
|
|
24
|
-
"init": "
|
|
24
|
+
"init": "node scripts/init.ts",
|
|
25
25
|
"upgrade": "node scripts/upgrade.ts",
|
|
26
26
|
"upgrade:dry-run": "node scripts/upgrade.ts --dry-run",
|
|
27
27
|
"vona": "node ./vona/packages-cli/cli/src/bin/vona.ts --projectPath=vona",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"engines": {
|
|
78
78
|
"node": ">=24.4.0"
|
|
79
79
|
},
|
|
80
|
-
"packageManager": "pnpm@
|
|
80
|
+
"packageManager": "pnpm@11.5.2"
|
|
81
81
|
}
|
package/scripts/init.ts
CHANGED
|
@@ -18,6 +18,7 @@ const ROOT_DIR = resolve(__dirname, '..');
|
|
|
18
18
|
const VONA_DIR = resolve(ROOT_DIR, 'vona');
|
|
19
19
|
const ZOVA_DIR = resolve(ROOT_DIR, 'zova');
|
|
20
20
|
const CABLOY_DOCS_DIR = resolve(ROOT_DIR, 'cabloy-docs');
|
|
21
|
+
const PNPM_VERSION = '11.5.2';
|
|
21
22
|
|
|
22
23
|
// --- Helpers ---
|
|
23
24
|
|
|
@@ -39,6 +40,21 @@ function exec(cmd: string, cwd = ROOT_DIR): void {
|
|
|
39
40
|
execSync(cmd, { stdio: 'inherit', cwd });
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
function execQuiet(cmd: string, cwd = ROOT_DIR): string {
|
|
44
|
+
return execSync(cmd, { stdio: 'pipe', cwd }).toString();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function checkPnpm(): void {
|
|
48
|
+
const version = execQuiet('pnpm --version').trimEnd();
|
|
49
|
+
const [major, minor, patch] = version.split('.').map(item => Number.parseInt(item, 10) || 0);
|
|
50
|
+
const lowerMajor = major < 11;
|
|
51
|
+
const lowerMinor = major === 11 && minor < 5;
|
|
52
|
+
const lowerPatch = major === 11 && minor === 5 && patch < 2;
|
|
53
|
+
if (lowerMajor || lowerMinor || lowerPatch) {
|
|
54
|
+
throw new Error(`pnpm should >= ${PNPM_VERSION}, current: ${version}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
42
58
|
function deleteGitkeepFiles(dir: string): void {
|
|
43
59
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
44
60
|
const fullPath = resolve(dir, entry.name);
|
|
@@ -215,6 +231,8 @@ function initCabloyDocs(): void {
|
|
|
215
231
|
|
|
216
232
|
// --- Main ---
|
|
217
233
|
|
|
234
|
+
checkPnpm();
|
|
235
|
+
exec('pnpm install --no-frozen-lockfile');
|
|
218
236
|
setAppName();
|
|
219
237
|
generateEnvProdLocal();
|
|
220
238
|
generateEnvProdDockerLocal();
|
package/vona/README.md
CHANGED
|
@@ -52,11 +52,11 @@ The Web and Admin of Cabloy Store are built by one codebase
|
|
|
52
52
|
|
|
53
53
|
### General
|
|
54
54
|
|
|
55
|
-
| Name | Version
|
|
56
|
-
| ---------- |
|
|
57
|
-
| pnpm | >=
|
|
58
|
-
| Nodejs | >=24.8.0
|
|
59
|
-
| Typescript | >=5.9.3
|
|
55
|
+
| Name | Version |
|
|
56
|
+
| ---------- | -------- |
|
|
57
|
+
| pnpm | >=11.5.2 |
|
|
58
|
+
| Nodejs | >=24.8.0 |
|
|
59
|
+
| Typescript | >=5.9.3 |
|
|
60
60
|
|
|
61
61
|
### Backend(Vona)
|
|
62
62
|
|
package/vona/README.zh-CN.md
CHANGED
|
@@ -52,11 +52,11 @@ Vona 采用前后端分离的架构。前端使用 Zova 框架,将构建生成
|
|
|
52
52
|
|
|
53
53
|
### 通用
|
|
54
54
|
|
|
55
|
-
| 名称 | 版本
|
|
56
|
-
| ---------- |
|
|
57
|
-
| pnpm | >=
|
|
58
|
-
| Nodejs | >=24.8.0
|
|
59
|
-
| Typescript | >=5.9.3
|
|
55
|
+
| 名称 | 版本 |
|
|
56
|
+
| ---------- | -------- |
|
|
57
|
+
| pnpm | >=11.5.2 |
|
|
58
|
+
| Nodejs | >=24.8.0 |
|
|
59
|
+
| Typescript | >=5.9.3 |
|
|
60
60
|
|
|
61
61
|
### 后端(Vona)
|
|
62
62
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "vona",
|
|
3
3
|
"private": true,
|
|
4
4
|
"type": "module",
|
|
5
|
-
"packageManager": "pnpm@
|
|
5
|
+
"packageManager": "pnpm@11.5.2",
|
|
6
6
|
"description": "Vona is an intuitive, elegant and powerful Node.js framework for rapidly developing enterprise applications of any size",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -50,10 +50,5 @@
|
|
|
50
50
|
"textlint-rule-period-in-list-item": "^1.0.1",
|
|
51
51
|
"oxfmt": "^0.45.0",
|
|
52
52
|
"oxlint": "^1.65.0"
|
|
53
|
-
},
|
|
54
|
-
"pnpm": {
|
|
55
|
-
"overrides": {
|
|
56
|
-
"zod": "npm:@cabloy/zod@4.3.6"
|
|
57
|
-
}
|
|
58
53
|
}
|
|
59
54
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabloy/cli",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.17",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "@cabloy/cli",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
32
|
-
"tsc:publish": "npm run clean && vona :bin:buildGeneral && tsc",
|
|
32
|
+
"tsc:publish": "npm run clean && node ../cli/src/bin/vona.ts :bin:buildGeneral && tsc",
|
|
33
33
|
"prepublishOnly": "npm run tsc:publish",
|
|
34
34
|
"prepack": "clean-package",
|
|
35
35
|
"postpack": "clean-package restore"
|
|
@@ -1 +1,57 @@
|
|
|
1
1
|
# vona-cli
|
|
2
|
+
|
|
3
|
+
This package is the thin Vona CLI entrypoint.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
From the monorepo root, `npm run vona` resolves to this package and launches the backend-oriented CLI flow.
|
|
8
|
+
|
|
9
|
+
Primary entrypoint:
|
|
10
|
+
|
|
11
|
+
- `src/bin/vona.ts`
|
|
12
|
+
|
|
13
|
+
This entrypoint stays intentionally small. It handles top-level argument parsing, the special `play` dispatch path, and handoff to the Vona command runtime.
|
|
14
|
+
|
|
15
|
+
## Source of truth
|
|
16
|
+
|
|
17
|
+
Do not treat this package as the full command catalog. The authoritative Vona command-family registry lives in:
|
|
18
|
+
|
|
19
|
+
- `../../packages-cli/cli-set-api/src/lib/commands.ts`
|
|
20
|
+
|
|
21
|
+
Inspect that file first when you need to know:
|
|
22
|
+
|
|
23
|
+
- which command families exist
|
|
24
|
+
- which command names are registered
|
|
25
|
+
- which command module implements each entry
|
|
26
|
+
|
|
27
|
+
Current top-level families include:
|
|
28
|
+
|
|
29
|
+
- `bin`
|
|
30
|
+
- `create`
|
|
31
|
+
- `init`
|
|
32
|
+
- `tools`
|
|
33
|
+
|
|
34
|
+
## Where command details live
|
|
35
|
+
|
|
36
|
+
Each command module in `../../packages-cli/cli-set-api/src/lib/command/` provides the main CLI-facing metadata, including:
|
|
37
|
+
|
|
38
|
+
- `info.title`
|
|
39
|
+
- `info.usage`
|
|
40
|
+
- `options`
|
|
41
|
+
|
|
42
|
+
Representative example:
|
|
43
|
+
|
|
44
|
+
- `../../packages-cli/cli-set-api/src/lib/command/bin.play.ts`
|
|
45
|
+
|
|
46
|
+
## Recommended navigation path
|
|
47
|
+
|
|
48
|
+
1. start from `npm run vona`
|
|
49
|
+
2. inspect `src/bin/vona.ts` only for top-level dispatch behavior
|
|
50
|
+
3. inspect `cli-set-api/src/lib/commands.ts` for the authoritative catalog
|
|
51
|
+
4. inspect the specific command module for usage and options
|
|
52
|
+
|
|
53
|
+
## Canonical public reference
|
|
54
|
+
|
|
55
|
+
For the compact top-level overview shared across Vona and Zova, start with:
|
|
56
|
+
|
|
57
|
+
- `../../../cabloy-docs/reference/cli-reference.md`
|
|
@@ -1,36 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { parseProjectPath } from '@cabloy/cli';
|
|
4
|
-
import { ProcessHelper } from '@cabloy/process-helper';
|
|
5
4
|
import mri from 'mri';
|
|
6
|
-
import semver from 'semver';
|
|
7
5
|
|
|
8
6
|
import { playAttach } from '../play.ts';
|
|
9
7
|
import { VonaCommand } from '../start.ts';
|
|
10
8
|
|
|
11
|
-
const pnpm_version = '10.19.0';
|
|
12
|
-
|
|
13
|
-
const processHelper = new ProcessHelper(process.cwd());
|
|
14
|
-
|
|
15
9
|
main();
|
|
16
10
|
|
|
17
|
-
async function checkPnpm() {
|
|
18
|
-
const res = await processHelper.spawnCmd({
|
|
19
|
-
cmd: 'pnpm',
|
|
20
|
-
args: ['--version'],
|
|
21
|
-
options: {
|
|
22
|
-
stdio: 'pipe',
|
|
23
|
-
shell: true,
|
|
24
|
-
dummy: true,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
const version = res.trimEnd();
|
|
28
|
-
const lt = semver.lt(version, pnpm_version);
|
|
29
|
-
if (lt) {
|
|
30
|
-
throw new Error(`pnpm should >= ${pnpm_version}, current: ${version}`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
11
|
async function main() {
|
|
35
12
|
const rawArgv = process.argv.slice(2);
|
|
36
13
|
const _args = mri(rawArgv, {
|
|
@@ -58,9 +35,6 @@ async function main() {
|
|
|
58
35
|
if (isPlayAttach) {
|
|
59
36
|
await playAttach(projectPath, args);
|
|
60
37
|
} else {
|
|
61
|
-
if (!isPlay) {
|
|
62
|
-
await checkPnpm();
|
|
63
|
-
}
|
|
64
38
|
new VonaCommand(args).start();
|
|
65
39
|
}
|
|
66
40
|
}
|