cabloy 5.1.50 → 5.1.51
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/.claude/skills/cabloy-backend-scaffold/SKILL.md +207 -0
- package/.claude/skills/cabloy-backend-scaffold/evals/evals.json +29 -0
- package/.claude/skills/cabloy-backend-scaffold/references/backend-thread-map.md +52 -0
- package/.claude/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +39 -0
- package/.claude/skills/cabloy-contract-loop/SKILL.md +201 -0
- package/.claude/skills/cabloy-contract-loop/evals/evals.json +29 -0
- package/.claude/skills/cabloy-contract-loop/references/contract-loop-map.md +47 -0
- package/.claude/skills/cabloy-contract-loop/references/verification-checklist.md +32 -0
- package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +230 -0
- package/.claude/skills/cabloy-frontend-scaffold/evals/evals.json +35 -0
- package/.claude/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md +41 -0
- package/.claude/skills/cabloy-frontend-scaffold/references/frontend-thread-map.md +54 -0
- package/.claude/skills/cabloy-workflow/SKILL.md +288 -0
- package/.claude/skills/cabloy-workflow/evals/evals.json +35 -0
- package/.claude/skills/cabloy-workflow/references/cli-strategy.md +39 -0
- package/.claude/skills/cabloy-workflow/references/edition-detection.md +29 -0
- package/.github/workflows/docs-pages.yml +54 -0
- package/.gitignore +1 -0
- package/CHANGELOG.md +29 -0
- package/CLAUDE.md +59 -0
- package/README.md +137 -0
- package/cabloy-docs/.vitepress/config.mjs +222 -0
- package/cabloy-docs/.vitepress/public/CNAME +1 -0
- package/cabloy-docs/.vitepress/theme/custom.css +64 -0
- package/cabloy-docs/.vitepress/theme/edition-badges.md +5 -0
- package/cabloy-docs/.vitepress/theme/index.js +5 -0
- package/cabloy-docs/ai/class-placement-rule.md +138 -0
- package/cabloy-docs/ai/cli-for-agents.md +56 -0
- package/cabloy-docs/ai/cli-to-skill-map.md +165 -0
- package/cabloy-docs/ai/docs-skills-rules-mapping.md +167 -0
- package/cabloy-docs/ai/edition-detection.md +30 -0
- package/cabloy-docs/ai/future-skill-roadmap.md +135 -0
- package/cabloy-docs/ai/global-bean-lookup.md +157 -0
- package/cabloy-docs/ai/introduction.md +62 -0
- package/cabloy-docs/ai/playbook-backend-module.md +111 -0
- package/cabloy-docs/ai/playbook-contract-regeneration.md +100 -0
- package/cabloy-docs/ai/playbook-frontend-page.md +99 -0
- package/cabloy-docs/ai/playbook-metadata-refresh.md +67 -0
- package/cabloy-docs/ai/repo-guidance.md +58 -0
- package/cabloy-docs/ai/rules-and-config.md +29 -0
- package/cabloy-docs/ai/skills.md +35 -0
- package/cabloy-docs/ai/verification.md +30 -0
- package/cabloy-docs/backend/aop-overview.md +128 -0
- package/cabloy-docs/backend/auth-guide.md +151 -0
- package/cabloy-docs/backend/backend-essentials.md +128 -0
- package/cabloy-docs/backend/broadcast-guide.md +138 -0
- package/cabloy-docs/backend/cache-guide.md +70 -0
- package/cabloy-docs/backend/captcha-guide.md +162 -0
- package/cabloy-docs/backend/cli.md +173 -0
- package/cabloy-docs/backend/config-guide.md +249 -0
- package/cabloy-docs/backend/controller-aop-guide.md +270 -0
- package/cabloy-docs/backend/controller-guide.md +347 -0
- package/cabloy-docs/backend/crud-workflow.md +118 -0
- package/cabloy-docs/backend/dto-guide.md +161 -0
- package/cabloy-docs/backend/dto-infer-generation.md +153 -0
- package/cabloy-docs/backend/dynamic-datasource-guide.md +70 -0
- package/cabloy-docs/backend/election-guide.md +141 -0
- package/cabloy-docs/backend/entity-guide.md +150 -0
- package/cabloy-docs/backend/error-guide.md +108 -0
- package/cabloy-docs/backend/event-guide.md +183 -0
- package/cabloy-docs/backend/external-aop-guide.md +149 -0
- package/cabloy-docs/backend/field-indexes.md +79 -0
- package/cabloy-docs/backend/foundation.md +281 -0
- package/cabloy-docs/backend/i18n-guide.md +211 -0
- package/cabloy-docs/backend/internal-aop-guide.md +181 -0
- package/cabloy-docs/backend/introduction.md +95 -0
- package/cabloy-docs/backend/jwt-guide.md +276 -0
- package/cabloy-docs/backend/logger-guide.md +223 -0
- package/cabloy-docs/backend/mail-guide.md +189 -0
- package/cabloy-docs/backend/menu-guide.md +80 -0
- package/cabloy-docs/backend/migration-and-changes.md +192 -0
- package/cabloy-docs/backend/model-guide.md +274 -0
- package/cabloy-docs/backend/multi-database-datasource.md +171 -0
- package/cabloy-docs/backend/multi-instance-and-instance-resolution.md +196 -0
- package/cabloy-docs/backend/openapi-guide.md +118 -0
- package/cabloy-docs/backend/orm-aggregate-group-guide.md +210 -0
- package/cabloy-docs/backend/orm-configuration-guide.md +165 -0
- package/cabloy-docs/backend/orm-guide.md +109 -0
- package/cabloy-docs/backend/orm-mutation-guide.md +195 -0
- package/cabloy-docs/backend/orm-select-guide.md +243 -0
- package/cabloy-docs/backend/queue-guide.md +271 -0
- package/cabloy-docs/backend/quickstart.md +141 -0
- package/cabloy-docs/backend/redis-guide.md +70 -0
- package/cabloy-docs/backend/redlock-guide.md +60 -0
- package/cabloy-docs/backend/relations-guide.md +250 -0
- package/cabloy-docs/backend/runtime-and-flavors.md +304 -0
- package/cabloy-docs/backend/schedule-guide.md +81 -0
- package/cabloy-docs/backend/scripts.md +116 -0
- package/cabloy-docs/backend/serialization-guide.md +192 -0
- package/cabloy-docs/backend/service-guide.md +166 -0
- package/cabloy-docs/backend/sharding-guide.md +49 -0
- package/cabloy-docs/backend/startup-guide.md +326 -0
- package/cabloy-docs/backend/transaction-guide.md +82 -0
- package/cabloy-docs/backend/unit-testing.md +209 -0
- package/cabloy-docs/backend/upload-guide.md +160 -0
- package/cabloy-docs/backend/user-access-guide.md +157 -0
- package/cabloy-docs/backend/validation-guide.md +80 -0
- package/cabloy-docs/backend/worker-guide.md +59 -0
- package/cabloy-docs/editions/cabloy-basic.md +25 -0
- package/cabloy-docs/editions/cabloy-start.md +24 -0
- package/cabloy-docs/editions/detection.md +31 -0
- package/cabloy-docs/editions/overview.md +44 -0
- package/cabloy-docs/frontend/api-guide.md +93 -0
- package/cabloy-docs/frontend/api-schema-guide.md +43 -0
- package/cabloy-docs/frontend/app-startup-guide.md +185 -0
- package/cabloy-docs/frontend/cli.md +78 -0
- package/cabloy-docs/frontend/component-guide.md +105 -0
- package/cabloy-docs/frontend/component-props-guide.md +97 -0
- package/cabloy-docs/frontend/component-v-model-guide.md +110 -0
- package/cabloy-docs/frontend/css-in-js-guide.md +151 -0
- package/cabloy-docs/frontend/design-principles.md +55 -0
- package/cabloy-docs/frontend/environment-config-guide.md +250 -0
- package/cabloy-docs/frontend/foundation.md +57 -0
- package/cabloy-docs/frontend/generic-component-guide.md +35 -0
- package/cabloy-docs/frontend/icon-engine-guide.md +88 -0
- package/cabloy-docs/frontend/introduction.md +32 -0
- package/cabloy-docs/frontend/ioc-and-beans.md +211 -0
- package/cabloy-docs/frontend/mock-guide.md +109 -0
- package/cabloy-docs/frontend/model-architecture.md +87 -0
- package/cabloy-docs/frontend/model-state-guide.md +70 -0
- package/cabloy-docs/frontend/module-scope.md +168 -0
- package/cabloy-docs/frontend/modules-and-suites.md +179 -0
- package/cabloy-docs/frontend/navigation-guards-guide.md +68 -0
- package/cabloy-docs/frontend/openapi-sdk-guide.md +102 -0
- package/cabloy-docs/frontend/page-guide.md +223 -0
- package/cabloy-docs/frontend/page-params-guide.md +87 -0
- package/cabloy-docs/frontend/page-query-guide.md +96 -0
- package/cabloy-docs/frontend/page-route-guide.md +147 -0
- package/cabloy-docs/frontend/quickstart.md +201 -0
- package/cabloy-docs/frontend/route-alias-guide.md +61 -0
- package/cabloy-docs/frontend/scripts.md +86 -0
- package/cabloy-docs/frontend/sdk-guide.md +45 -0
- package/cabloy-docs/frontend/server-data.md +74 -0
- package/cabloy-docs/frontend/ssr-client-only.md +40 -0
- package/cabloy-docs/frontend/ssr-env.md +51 -0
- package/cabloy-docs/frontend/ssr-init-data.md +46 -0
- package/cabloy-docs/frontend/ssr-overview.md +48 -0
- package/cabloy-docs/frontend/ssr-seo-meta.md +52 -0
- package/cabloy-docs/frontend/system-startup-guide.md +186 -0
- package/cabloy-docs/frontend/theme-guide.md +154 -0
- package/cabloy-docs/frontend/zod-guide.md +161 -0
- package/cabloy-docs/fullstack/edition-collaboration-differences.md +61 -0
- package/cabloy-docs/fullstack/frontend-metadata-to-backend.md +64 -0
- package/cabloy-docs/fullstack/introduction.md +69 -0
- package/cabloy-docs/fullstack/openapi-to-sdk.md +116 -0
- package/cabloy-docs/fullstack/quickstart.md +86 -0
- package/cabloy-docs/fullstack/vona-zova-integration.md +86 -0
- package/cabloy-docs/index.md +73 -0
- package/cabloy-docs/package.json +16 -0
- package/cabloy-docs/pnpm-lock.yaml +1607 -0
- package/cabloy-docs/reference/backend-directory-structure.md +88 -0
- package/cabloy-docs/reference/cli-reference.md +49 -0
- package/cabloy-docs/reference/glossary.md +38 -0
- package/cabloy-docs/reference/package-map.md +105 -0
- package/cabloy-docs/reference/repo-scripts.md +36 -0
- package/package.json +4 -1
- package/scripts/init.ts +12 -0
- package/scripts/upgrade.ts +31 -3
- package/vona/README.md +3 -3
- package/vona/README.zh-CN.md +4 -4
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasharding/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasharding/src/bean/summerCache.datasourceWrite.ts +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 +1 -1
- package/vona/src/suite-vendor/a-captcha/modules/a-captcha/src/bean/cacheRedis.captcha.ts +2 -2
- package/vona/src/suite-vendor/a-captcha/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-bean/cli/bean/metadata/generate.ts +5 -6
- package/vona/src/suite-vendor/a-vona/modules/a-bean/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-cache/cli/cacheMem/boilerplate/{{sceneName}}.{{beanName}}.ts_ +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-cache/cli/cacheRedis/boilerplate/{{sceneName}}.{{beanName}}.ts_ +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-cache/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-cache/src/.metadata/index.ts +13 -2
- package/vona/src/suite-vendor/a-vona/modules/a-cache/src/bean/bean.cache.ts +6 -7
- package/vona/src/suite-vendor/a-vona/modules/a-cache/src/{bean/bean.cacheMemBase.ts → service/cacheMemBase_.ts} +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-cache/src/{bean/bean.cacheRedisBase.ts → service/cacheRedisBase_.ts} +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/bean/cacheRedis.emailConfirm.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/bean/cacheRedis.passwordReset.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/src/bean/summerCache.json.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/cli/databaseDialect/boilerplate/{{sceneName}}.{{beanName}}.ts_ +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/.metadata/index.ts +4 -3
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/bean/bean.database.ts +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/bean/bean.model.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/bean/schedule.softDeletionPrune.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/common/utils.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/index.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_cache.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_meta.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.modelBase.ts +0 -5
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoAggregate.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoCreate.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoGet.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoGroup.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoMutate.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoSelectAndCount.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoUpdate.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/index.ts +1 -0
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/modelCacheBase.ts +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/relations.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/relationsDynamic.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/relationsMutate.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/relationsStatic.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/cacheEntity_.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/cacheQuery_.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/database.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean/bean.databaseDialectBase.ts → service/databaseDialectBase_.ts} +38 -41
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/db_.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/relations_.ts +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/database.ts +0 -5
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/dto/dtoGet.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/dto/dtoMutate.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/dto/dtoSelectAndCount.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/model.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelAggr.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelCount.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelGeneral.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelGroup.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelIncrement.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relations.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsColumns.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsDef.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsDefDynamic.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsDefMutate.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsMutate.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsTables.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/src/bean/databaseDialect.betterSqlite3.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/src/bean/databaseDialect.mysql.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/src/bean/databaseDialect.pg.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/bean.permission.ts +109 -40
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/summerCache.permission.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-startup/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-startup/src/bean/cacheRedis.startupDebounce.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-summer/cli/boilerplate/{{sceneName}}.{{beanName}}.ts_ +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-summer/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-summer/src/.metadata/index.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-summer/src/bean/bean.summer.ts +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-summer/src/service/localMem_.ts +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-summer/src/service/localRedis_.ts +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-summer/src/{bean/bean.summerCacheBase.ts → service/summerCacheBase_.ts} +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-swagger/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-swagger/src/bean/summerCache.rapidoc.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-swagger/src/bean/summerCache.swagger.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-user/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/bean/cacheRedis.authToken.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-worker/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-worker/src/bean/cacheRedis.workerAlive.ts +2 -2
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/README.md +4 -4
- package/zova/README.zh-CN.md +4 -4
- /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_crud.ts +0 -0
- /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_crud_inner.ts +0 -0
- /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_crud_table.ts +0 -0
- /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_knex.ts +0 -0
- /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_utils.ts +0 -0
- /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_view.ts +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Cabloy Start
|
|
2
|
+
|
|
3
|
+
Cabloy Start is a sibling private repository that shares the Cabloy fullstack direction while intentionally differing from Cabloy Basic.
|
|
4
|
+
|
|
5
|
+
## Repository marker
|
|
6
|
+
|
|
7
|
+
The Cabloy Start root contains:
|
|
8
|
+
|
|
9
|
+
- `__CABLOY_START__`
|
|
10
|
+
|
|
11
|
+
Use that marker before choosing examples, UI assumptions, or automation behavior.
|
|
12
|
+
|
|
13
|
+
## Typical role
|
|
14
|
+
|
|
15
|
+
Use Cabloy Start as the edition-aware target when work depends on:
|
|
16
|
+
|
|
17
|
+
- Vuetify-specific frontend workflows
|
|
18
|
+
- Cabloy Start flavor names in frontend scripts
|
|
19
|
+
- modules that exist in the private Start repository but not in Basic
|
|
20
|
+
- private value-add project composition
|
|
21
|
+
|
|
22
|
+
## Relationship to this docs site
|
|
23
|
+
|
|
24
|
+
This unified docs site treats Cabloy Start as a supported edition, not as a clone of Cabloy Basic. Shared architecture should remain shared, but any Start-specific script, module path, or UI workflow must be labeled explicitly.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Edition Detection
|
|
2
|
+
|
|
3
|
+
Edition detection is a first-class requirement for documentation, rules, and skills.
|
|
4
|
+
|
|
5
|
+
## Repository markers
|
|
6
|
+
|
|
7
|
+
Use these root markers:
|
|
8
|
+
|
|
9
|
+
- `__CABLOY_BASIC__` → Cabloy Basic
|
|
10
|
+
- `__CABLOY_START__` → Cabloy Start
|
|
11
|
+
|
|
12
|
+
## Why this matters
|
|
13
|
+
|
|
14
|
+
The two editions share many concepts but differ in important operational details, especially around:
|
|
15
|
+
|
|
16
|
+
- frontend UI library assumptions
|
|
17
|
+
- flavor-specific frontend scripts
|
|
18
|
+
- module availability
|
|
19
|
+
- value-add project content in the private Start repository
|
|
20
|
+
|
|
21
|
+
If an agent skips edition detection, it may generate the wrong instructions, recommend the wrong module, or use the wrong UI stack.
|
|
22
|
+
|
|
23
|
+
## Recommended rule for skills and repo guidance
|
|
24
|
+
|
|
25
|
+
Before suggesting a cross-stack implementation path:
|
|
26
|
+
|
|
27
|
+
1. check the repository marker
|
|
28
|
+
2. verify the relevant root scripts or package scripts
|
|
29
|
+
3. only then choose the edition-specific example or workflow branch
|
|
30
|
+
|
|
31
|
+
When neither marker is present, fall back to code inspection and ask the user before making a strong edition-specific assumption.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Editions Overview
|
|
2
|
+
|
|
3
|
+
Cabloy currently needs to support two related but distinct repositories:
|
|
4
|
+
|
|
5
|
+
- **Cabloy Basic**
|
|
6
|
+
- **Cabloy Start**
|
|
7
|
+
|
|
8
|
+
They share the same core architectural direction, but they are not interchangeable.
|
|
9
|
+
|
|
10
|
+
## Shared core
|
|
11
|
+
|
|
12
|
+
Both editions use the Cabloy fullstack model built around:
|
|
13
|
+
|
|
14
|
+
- Vona as the backend framework
|
|
15
|
+
- Zova as the frontend framework
|
|
16
|
+
- root-level `npm run vona` and `npm run zova` entrypoints
|
|
17
|
+
- CLI-backed workflows for generation, refactoring, metadata, and verification
|
|
18
|
+
|
|
19
|
+
## Why the editions differ
|
|
20
|
+
|
|
21
|
+
The editions exist to support different product and distribution goals.
|
|
22
|
+
|
|
23
|
+
### Cabloy Basic
|
|
24
|
+
|
|
25
|
+
- public repository
|
|
26
|
+
- baseline fullstack reference implementation
|
|
27
|
+
- current default examples in this public monorepo
|
|
28
|
+
|
|
29
|
+
### Cabloy Start
|
|
30
|
+
|
|
31
|
+
- sibling private repository
|
|
32
|
+
- created from `npm create cabloy`
|
|
33
|
+
- uses a different UI strategy centered on Vuetify
|
|
34
|
+
- contains different Vona/Zova modules and value-add project structure
|
|
35
|
+
|
|
36
|
+
## Documentation rule
|
|
37
|
+
|
|
38
|
+
Write shared explanations once. Only split or annotate when a workflow changes because of:
|
|
39
|
+
|
|
40
|
+
- UI library assumptions
|
|
41
|
+
- frontend flavor names
|
|
42
|
+
- different modules or assets
|
|
43
|
+
- private-value product boundaries
|
|
44
|
+
- edition-specific scripts or generated outputs
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# API Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how `$api` works in Zova within the Cabloy monorepo.
|
|
4
|
+
|
|
5
|
+
## What `$api` is for
|
|
6
|
+
|
|
7
|
+
Zova provides business-oriented API services on top of lower-level request access.
|
|
8
|
+
|
|
9
|
+
That means frontend code does not need to scatter raw request details everywhere. Instead, API calls can be encapsulated into named services that match business intent.
|
|
10
|
+
|
|
11
|
+
## Create an API service
|
|
12
|
+
|
|
13
|
+
Example: create an API service named `menu` in module `demo-student`.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm run zova :create:bean api menu -- --module=demo-student
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## API definition
|
|
20
|
+
|
|
21
|
+
Representative pattern:
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
export interface ApiMenuRetrieveMenusResult {
|
|
25
|
+
title: string;
|
|
26
|
+
link: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Api()
|
|
30
|
+
export class ApiMenu extends BeanApiBase {
|
|
31
|
+
retrieveMenus() {
|
|
32
|
+
return this.$fetch.get<any, ApiMenuRetrieveMenusResult>('/home/base/menu/');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This shows the intended layering clearly:
|
|
38
|
+
|
|
39
|
+
- `$fetch` handles the lower-level request
|
|
40
|
+
- the API service exposes a business-oriented method such as `retrieveMenus()`
|
|
41
|
+
|
|
42
|
+
API is also one of the core module-scope resource categories; see [Module Scope](/frontend/module-scope).
|
|
43
|
+
|
|
44
|
+
## Using the API through module scope
|
|
45
|
+
|
|
46
|
+
Typical pattern:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
class ControllerTest {
|
|
50
|
+
async retrieveMenus() {
|
|
51
|
+
const menus = await this.scope.api.menu.retrieveMenus();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Cross-module API access
|
|
57
|
+
|
|
58
|
+
Cross-module usage is also supported through scope injection.
|
|
59
|
+
|
|
60
|
+
Representative pattern:
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
@UseScope()
|
|
64
|
+
$$scopeDemoStudent: ScopeModuleDemoStudent;
|
|
65
|
+
|
|
66
|
+
const menus = await this.$$scopeDemoStudent.api.menu.retrieveMenus();
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Built-in `$api` access
|
|
70
|
+
|
|
71
|
+
The framework also supports accessing certain API services through `this.$api` on bean instances.
|
|
72
|
+
|
|
73
|
+
Representative pattern:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
const menus = await this.$api.homeBaseMenu.retrieveMenus({
|
|
77
|
+
params: { publicPath: '' },
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Implementation checks for frontend data-access changes
|
|
82
|
+
|
|
83
|
+
When adding frontend data access, avoid jumping straight from UI code to ad hoc request logic.
|
|
84
|
+
|
|
85
|
+
A better default is:
|
|
86
|
+
|
|
87
|
+
1. decide whether the request belongs in a named API service
|
|
88
|
+
2. create or reuse that API service
|
|
89
|
+
3. let pages, components, or models consume the API service instead of duplicating request details
|
|
90
|
+
|
|
91
|
+
That keeps the frontend code more business-oriented and easier to evolve.
|
|
92
|
+
|
|
93
|
+
When the backend contract is not ready yet, a temporary frontend-side mock route may be the right bridge; see [Mock Guide](/frontend/mock-guide).
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# API Schema Guide
|
|
2
|
+
|
|
3
|
+
This page expands the legacy `$apiSchema` placeholder into a practical guidance page for the new docs site.
|
|
4
|
+
|
|
5
|
+
## What `$apiSchema` represents
|
|
6
|
+
|
|
7
|
+
`$apiSchema` is the schema-oriented layer of the server-data model.
|
|
8
|
+
|
|
9
|
+
While `$api` and generated SDKs focus on calling backend operations, `$apiSchema` focuses on the API metadata itself.
|
|
10
|
+
|
|
11
|
+
That matters when frontend behavior needs to be driven by schema, not just by returned values.
|
|
12
|
+
|
|
13
|
+
## Why schema access matters
|
|
14
|
+
|
|
15
|
+
In the Cabloy/Zova model, schema metadata can support higher-level frontend behavior such as:
|
|
16
|
+
|
|
17
|
+
- validation
|
|
18
|
+
- automatic form rendering
|
|
19
|
+
- automatic field behavior
|
|
20
|
+
- metadata-driven UI logic
|
|
21
|
+
|
|
22
|
+
This is one reason the server-data thread in Zova is more powerful than a plain request library.
|
|
23
|
+
|
|
24
|
+
## How to think about `$apiSchema`
|
|
25
|
+
|
|
26
|
+
Use `$apiSchema` when the frontend needs to inspect what the backend contract says, not just call the backend endpoint.
|
|
27
|
+
|
|
28
|
+
That usually means the problem is shifting from “fetch data” to “use metadata to drive behavior.”
|
|
29
|
+
|
|
30
|
+
## Read together with
|
|
31
|
+
|
|
32
|
+
Use this page together with:
|
|
33
|
+
|
|
34
|
+
- [Server Data](/frontend/server-data)
|
|
35
|
+
- [OpenAPI SDK Guide](/frontend/openapi-sdk-guide)
|
|
36
|
+
- [Backend OpenAPI to Frontend SDK](/fullstack/openapi-to-sdk)
|
|
37
|
+
- [SDK Guide](/frontend/sdk-guide)
|
|
38
|
+
|
|
39
|
+
## Implementation checks for schema-driven UI changes
|
|
40
|
+
|
|
41
|
+
When asked to build dynamic forms, metadata-driven UI, or schema-aware validation, consider whether the right source is `$apiSchema` rather than hand-authored frontend-only field definitions.
|
|
42
|
+
|
|
43
|
+
That keeps the frontend closer to backend truth and reduces duplicate configuration.
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# App Startup Guide
|
|
2
|
+
|
|
3
|
+
## Why app startup matters
|
|
4
|
+
|
|
5
|
+
In Zova, application startup is a structured lifecycle rather than a single opaque bootstrap step.
|
|
6
|
+
|
|
7
|
+
That matters because routing, guards, business initialization, and extension hooks often need to run at different startup phases.
|
|
8
|
+
|
|
9
|
+
## App startup vs system startup
|
|
10
|
+
|
|
11
|
+
App startup is not the same as system startup.
|
|
12
|
+
|
|
13
|
+
In SSR scenarios especially, app startup can be request-scoped, while system startup is not.
|
|
14
|
+
|
|
15
|
+
This guide focuses on the application lifecycle after the lower-level system wiring is already in place. For system-level lifecycle hooks such as route registration and config loading, see [System Startup Guide](/frontend/system-startup-guide).
|
|
16
|
+
|
|
17
|
+
## App startup timings
|
|
18
|
+
|
|
19
|
+
Zova provides three main app startup timings:
|
|
20
|
+
|
|
21
|
+
- `appInitialize`
|
|
22
|
+
- `appInitialized`
|
|
23
|
+
- `appReady`
|
|
24
|
+
|
|
25
|
+
These timings allow business modules to run initialization logic at the earliest appropriate stage.
|
|
26
|
+
|
|
27
|
+
## App shutdown timing
|
|
28
|
+
|
|
29
|
+
App shutdown is represented by:
|
|
30
|
+
|
|
31
|
+
- `appClose`
|
|
32
|
+
|
|
33
|
+
## Module load timings
|
|
34
|
+
|
|
35
|
+
The app lifecycle also intersects with module loading:
|
|
36
|
+
|
|
37
|
+
- `moduleLoading`
|
|
38
|
+
- `moduleLoaded`
|
|
39
|
+
|
|
40
|
+
These allow module-aware logic to participate before or after the app becomes fully ready.
|
|
41
|
+
|
|
42
|
+
## Hook response scenarios
|
|
43
|
+
|
|
44
|
+
Zova supports several implementation locations for these hooks:
|
|
45
|
+
|
|
46
|
+
- **Module Main** in a module-local main file
|
|
47
|
+
- **Module Monkey** in a module-local monkey file
|
|
48
|
+
- **App Monkey** in the project frontend config area
|
|
49
|
+
|
|
50
|
+
This makes startup behavior extensible at both module and project levels.
|
|
51
|
+
|
|
52
|
+
## Hook interface model
|
|
53
|
+
|
|
54
|
+
Different hooks correspond to different interfaces depending on where they are implemented.
|
|
55
|
+
|
|
56
|
+
The important architectural point is not the exact interface matrix alone, but that startup behavior is typed and structured rather than improvised.
|
|
57
|
+
|
|
58
|
+
A compact mental model is:
|
|
59
|
+
|
|
60
|
+
- **Module Main** handles a module’s own loading lifecycle
|
|
61
|
+
- **Module Monkey** lets a module participate in app-wide hook timings
|
|
62
|
+
- **App Monkey** lets the project frontend config layer participate in the same hook system
|
|
63
|
+
|
|
64
|
+
## Module Main
|
|
65
|
+
|
|
66
|
+
A module can provide its own main lifecycle entrypoints.
|
|
67
|
+
|
|
68
|
+
Representative creation command:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm run zova :init:main demo-student
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Representative pattern:
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
export class Main extends BeanSimple implements IModuleMain {
|
|
78
|
+
async moduleLoading() {}
|
|
79
|
+
async moduleLoaded() {}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Module Monkey
|
|
84
|
+
|
|
85
|
+
A module can also provide broader app hook behavior through a monkey entry.
|
|
86
|
+
|
|
87
|
+
Representative creation command:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm run zova :init:monkey demo-student
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Representative pattern:
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
export class Monkey
|
|
97
|
+
extends BeanSimple
|
|
98
|
+
implements
|
|
99
|
+
IMonkeyModule,
|
|
100
|
+
IMonkeyAppInitialize,
|
|
101
|
+
IMonkeyAppInitialized,
|
|
102
|
+
IMonkeyAppReady,
|
|
103
|
+
IMonkeyAppClose
|
|
104
|
+
{
|
|
105
|
+
async moduleLoading(_module: IModule) {}
|
|
106
|
+
async moduleLoaded(_module: IModule) {}
|
|
107
|
+
async appInitialize() {}
|
|
108
|
+
async appInitialized() {}
|
|
109
|
+
async appReady() {}
|
|
110
|
+
async appClose() {}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## App Monkey
|
|
115
|
+
|
|
116
|
+
Project-level app lifecycle customization can be placed in the frontend config area.
|
|
117
|
+
|
|
118
|
+
This is useful when startup behavior belongs to the application as a whole rather than to one module.
|
|
119
|
+
|
|
120
|
+
Representative creation command:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
npm run zova :init:appMonkey
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Representative file location:
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
src/front/config/monkey.ts
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Practical interpretation of the phases
|
|
133
|
+
|
|
134
|
+
A useful rule of thumb is:
|
|
135
|
+
|
|
136
|
+
- use the earliest timing that still satisfies the need
|
|
137
|
+
- reserve later timings for behavior that depends on earlier framework or module setup already being finished
|
|
138
|
+
|
|
139
|
+
That keeps initialization extensible without creating unnecessary ordering coupling.
|
|
140
|
+
|
|
141
|
+
A representative lifecycle interpretation is:
|
|
142
|
+
|
|
143
|
+
- `appInitialize` for the earliest app-level service setup
|
|
144
|
+
- `appInitialized` when other modules should be able to react to the initialized state
|
|
145
|
+
- `appReady` for behavior that depends on the app becoming operational, such as final router-facing readiness
|
|
146
|
+
- `appClose` for teardown and listener cleanup
|
|
147
|
+
|
|
148
|
+
## Relationship to routing and guards
|
|
149
|
+
|
|
150
|
+
This page is the second half of the startup story: once system startup has registered routes and loaded config, app startup makes router services, guards, and first-screen navigation operational.
|
|
151
|
+
|
|
152
|
+
Startup timing is closely related to frontend routing and guards, because route services and route-guard behavior often need to be initialized before the app is considered ready.
|
|
153
|
+
|
|
154
|
+
The legacy startup docs explicitly used the router module as the core example:
|
|
155
|
+
|
|
156
|
+
- `appInitialize` as an early route-guard service setup point
|
|
157
|
+
- `appInitialized` as the point where route-guard events can begin involving other business modules
|
|
158
|
+
- `appReady` as the point where Vue Router can be injected and initial navigation can run
|
|
159
|
+
- `appClose` as the teardown point for route-guard listeners
|
|
160
|
+
|
|
161
|
+
Read this guide together with [Navigation Guards Guide](/frontend/navigation-guards-guide) when route lifecycle is involved.
|
|
162
|
+
|
|
163
|
+
A practical reading sequence is:
|
|
164
|
+
|
|
165
|
+
1. [System Startup Guide](/frontend/system-startup-guide)
|
|
166
|
+
2. this page for router/guard readiness
|
|
167
|
+
3. [Page Route Guide](/frontend/page-route-guide)
|
|
168
|
+
4. [Navigation Guards Guide](/frontend/navigation-guards-guide)
|
|
169
|
+
|
|
170
|
+
## Relationship to environment/config selection
|
|
171
|
+
|
|
172
|
+
The chosen scripts, mode, appMode, and flavor determine which config and env values are active while startup hooks run.
|
|
173
|
+
|
|
174
|
+
Read this guide together with [Environment and Config Guide](/frontend/environment-config-guide).
|
|
175
|
+
|
|
176
|
+
## Implementation checks for app-startup changes
|
|
177
|
+
|
|
178
|
+
When editing frontend startup behavior, ask:
|
|
179
|
+
|
|
180
|
+
1. does this logic belong to app startup or system startup?
|
|
181
|
+
2. what is the earliest safe hook timing for this behavior?
|
|
182
|
+
3. should the logic live in module main, module monkey, or app monkey?
|
|
183
|
+
4. does the behavior depend on routing, SSR, or environment-specific config already being ready?
|
|
184
|
+
|
|
185
|
+
That helps AI place initialization logic correctly instead of pushing everything into one late-stage bootstrap step.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Frontend CLI
|
|
2
|
+
|
|
3
|
+
This guide explains how to use the Zova CLI in the Cabloy monorepo.
|
|
4
|
+
|
|
5
|
+
## Why the CLI matters
|
|
6
|
+
|
|
7
|
+
Zova provides a large number of CLI commands for generating code skeletons and running frontend workflows.
|
|
8
|
+
|
|
9
|
+
For AI-assisted development, the CLI should be the default starting point whenever a generator or refactor command already exists.
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
Create a `component` named `test` in module `demo-student`:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm run zova :create:component test -- --module=demo-student
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Command discovery pattern
|
|
20
|
+
|
|
21
|
+
Zova commands follow a consistent discovery model.
|
|
22
|
+
|
|
23
|
+
### 1. List all command groups and commands
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm run zova :
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 2. List commands for a specific group
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm run zova :create
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 3. Inspect help for one command
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm run zova :create:component --help
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## High-value command families
|
|
42
|
+
|
|
43
|
+
From the current source tree, the most useful Zova command families for day-to-day development are:
|
|
44
|
+
|
|
45
|
+
- `bin:*`
|
|
46
|
+
- `create:*`
|
|
47
|
+
- `init:*`
|
|
48
|
+
- `refactor:*`
|
|
49
|
+
- `tools:*`
|
|
50
|
+
- `openapi:*`
|
|
51
|
+
|
|
52
|
+
Typical use cases include:
|
|
53
|
+
|
|
54
|
+
- scaffold suites, modules, pages, components, mocks, and beans
|
|
55
|
+
- initialize frontend config, locale, constants, assets, and typing helpers
|
|
56
|
+
- run focused refactors such as page query, page params, component props, generic component updates, and related migrations
|
|
57
|
+
- generate OpenAPI-related output
|
|
58
|
+
- refresh metadata and dependency-related output
|
|
59
|
+
|
|
60
|
+
## VS Code menus and the CLI
|
|
61
|
+
|
|
62
|
+
In practice, Zova workflows can be reached from two surfaces:
|
|
63
|
+
|
|
64
|
+
- VS Code menus for discovery and ergonomics
|
|
65
|
+
- the CLI for explicit, scriptable command execution
|
|
66
|
+
|
|
67
|
+
A practical rule is:
|
|
68
|
+
|
|
69
|
+
- use menus when you want to discover the available workflow quickly in the editor
|
|
70
|
+
- use the CLI when you want reproducible automation, explicit command history, or terminal-first documentation
|
|
71
|
+
|
|
72
|
+
These are not competing workflow systems. They are two entrypoints to the same underlying Zova command families.
|
|
73
|
+
|
|
74
|
+
## Practical workflow rule
|
|
75
|
+
|
|
76
|
+
When creating or refactoring frontend code, inspect `npm run zova :` or the relevant command family first, prefer the matching generator or refactor command, inspect the generated or transformed output, and only then make minimal follow-up edits.
|
|
77
|
+
|
|
78
|
+
This keeps frontend work aligned with Zova conventions and avoids avoidable manual scaffolding.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Component Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how components work in Zova within the Cabloy monorepo.
|
|
4
|
+
|
|
5
|
+
## What a component means in Zova
|
|
6
|
+
|
|
7
|
+
A Zova component is not only a reusable render unit. It is also part of the controller-oriented architecture that gives Zova its specific coding style.
|
|
8
|
+
|
|
9
|
+
That means component design is closely tied to:
|
|
10
|
+
|
|
11
|
+
- controller-based logic organization
|
|
12
|
+
- TSX rendering
|
|
13
|
+
- IOC-friendly instance access
|
|
14
|
+
- async-friendly module loading
|
|
15
|
+
- CSS-in-JS styling through the same controller-oriented architecture
|
|
16
|
+
|
|
17
|
+
For the practical styling decision map around local `$style`, dedicated style beans, shared/global styles, and token/theme surfaces, also see [CSS-in-JS Guide](/frontend/css-in-js-guide).
|
|
18
|
+
|
|
19
|
+
## Create a component
|
|
20
|
+
|
|
21
|
+
Example: create a component named `card` in module `demo-student`.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run zova :create:component card -- --module=demo-student
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Controller definition
|
|
28
|
+
|
|
29
|
+
Representative component controller shape:
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
@Controller()
|
|
33
|
+
class ControllerCard extends BeanControllerBase {
|
|
34
|
+
protected render() {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Component wrapper
|
|
41
|
+
|
|
42
|
+
Zova automatically creates a wrapper component for each component.
|
|
43
|
+
|
|
44
|
+
Representative example:
|
|
45
|
+
|
|
46
|
+
- component: `card`
|
|
47
|
+
- wrapper: `ZCard`
|
|
48
|
+
|
|
49
|
+
The `Z` prefix is useful because it makes framework components easy to identify quickly inside TSX.
|
|
50
|
+
|
|
51
|
+
## Use a component
|
|
52
|
+
|
|
53
|
+
Representative usage pattern:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { ZCard } from 'zova-module-demo-student';
|
|
57
|
+
|
|
58
|
+
class RenderPageCounter {
|
|
59
|
+
render() {
|
|
60
|
+
return <ZCard />;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Async loading behavior
|
|
66
|
+
|
|
67
|
+
Component wrappers can also participate in asynchronous loading behavior automatically.
|
|
68
|
+
|
|
69
|
+
This matters because the wrapper is not just a naming convenience. It is part of how Zova turns modular code into practical runtime behavior.
|
|
70
|
+
|
|
71
|
+
## Reference the component instance
|
|
72
|
+
|
|
73
|
+
Instead of relying on template refs in the usual Vue style, Zova prefers direct access to the component controller instance.
|
|
74
|
+
|
|
75
|
+
Representative pattern:
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
import type { ControllerCard } from 'zova-module-demo-student';
|
|
79
|
+
import { ZCard } from 'zova-module-demo-student';
|
|
80
|
+
|
|
81
|
+
class RenderPageCounter {
|
|
82
|
+
cardRef: ControllerCard;
|
|
83
|
+
|
|
84
|
+
render() {
|
|
85
|
+
return (
|
|
86
|
+
<ZCard
|
|
87
|
+
controllerRef={ref => {
|
|
88
|
+
this.cardRef = ref;
|
|
89
|
+
}}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Practical implications for component implementation
|
|
97
|
+
|
|
98
|
+
When working on Zova components, do not automatically fall back to generic Vue component habits.
|
|
99
|
+
|
|
100
|
+
A better default is:
|
|
101
|
+
|
|
102
|
+
1. use the component generator
|
|
103
|
+
2. preserve the wrapper-based usage model
|
|
104
|
+
3. treat controller access as the primary instance-reference pattern
|
|
105
|
+
4. remember that wrapper behavior and async loading are part of the framework design
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Component Props Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how component props work in Zova within the Cabloy monorepo.
|
|
4
|
+
|
|
5
|
+
## Why Zova props feel different
|
|
6
|
+
|
|
7
|
+
In Zova, component design does not force a hard separation between `Props`, `Emits`, and `Slots` in the same way many Vue codebases do.
|
|
8
|
+
|
|
9
|
+
Zova uses a more unified approach centered on component props, which makes the programming model more concise and TypeScript-friendly.
|
|
10
|
+
|
|
11
|
+
## Add props support
|
|
12
|
+
|
|
13
|
+
Example: add props support to component `card`.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm run zova :refactor:componentProps card -- --module=demo-student
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Define props
|
|
20
|
+
|
|
21
|
+
Representative pattern:
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { ISlot } from 'zova';
|
|
25
|
+
|
|
26
|
+
export interface ControllerCardProps {
|
|
27
|
+
content?: string;
|
|
28
|
+
onReset?: () => void;
|
|
29
|
+
slotHeader?: ISlot;
|
|
30
|
+
slotDefault?: (name: string) => VNode;
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
This is important because the props contract can describe ordinary values, callbacks, and slot-like behavior in one consistent shape.
|
|
35
|
+
|
|
36
|
+
## Default values
|
|
37
|
+
|
|
38
|
+
Representative pattern:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
class ControllerCard {
|
|
42
|
+
static $propsDefault = {
|
|
43
|
+
content: 'no content',
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Use props in the controller
|
|
49
|
+
|
|
50
|
+
Zova injects `$props` into the controller base class.
|
|
51
|
+
|
|
52
|
+
Representative pattern:
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
class ControllerCard {
|
|
56
|
+
render() {
|
|
57
|
+
return (
|
|
58
|
+
<div>
|
|
59
|
+
<div>{this.$props.slotHeader?.()}</div>
|
|
60
|
+
<div>{this.$slotDefault?.('tom')}</div>
|
|
61
|
+
<div>{this.$props.content}</div>
|
|
62
|
+
<button onClick={() => this.$props.onReset?.()}>Reset</button>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Pass props to child components
|
|
70
|
+
|
|
71
|
+
Representative pattern:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
<ZCard
|
|
75
|
+
content="custom content"
|
|
76
|
+
onReset={() => {
|
|
77
|
+
console.log('onReset is invoked');
|
|
78
|
+
}}
|
|
79
|
+
slotHeader={() => {
|
|
80
|
+
return <div>custom header</div>;
|
|
81
|
+
}}
|
|
82
|
+
slotDefault={name => {
|
|
83
|
+
return <div>{name}</div>;
|
|
84
|
+
}}
|
|
85
|
+
/>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Practical implications for component API design
|
|
89
|
+
|
|
90
|
+
When creating or refactoring Zova components, do not automatically impose a generic Vue component API style.
|
|
91
|
+
|
|
92
|
+
A better default is:
|
|
93
|
+
|
|
94
|
+
1. use the Zova refactor command to add the props skeleton
|
|
95
|
+
2. keep the props contract explicit and typed
|
|
96
|
+
3. treat props as the main contract surface for values, callbacks, and slot-like behavior
|
|
97
|
+
4. preserve the controller-oriented way of consuming props inside the component
|