cabloy 5.1.50 → 5.1.52

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.
Files changed (300) hide show
  1. package/.claude/skills/cabloy-backend-scaffold/SKILL.md +207 -0
  2. package/.claude/skills/cabloy-backend-scaffold/evals/evals.json +29 -0
  3. package/.claude/skills/cabloy-backend-scaffold/references/backend-thread-map.md +52 -0
  4. package/.claude/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +39 -0
  5. package/.claude/skills/cabloy-contract-loop/SKILL.md +201 -0
  6. package/.claude/skills/cabloy-contract-loop/evals/evals.json +29 -0
  7. package/.claude/skills/cabloy-contract-loop/references/contract-loop-map.md +47 -0
  8. package/.claude/skills/cabloy-contract-loop/references/verification-checklist.md +32 -0
  9. package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +230 -0
  10. package/.claude/skills/cabloy-frontend-scaffold/evals/evals.json +35 -0
  11. package/.claude/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md +41 -0
  12. package/.claude/skills/cabloy-frontend-scaffold/references/frontend-thread-map.md +54 -0
  13. package/.claude/skills/cabloy-workflow/SKILL.md +292 -0
  14. package/.claude/skills/cabloy-workflow/evals/evals.json +35 -0
  15. package/.claude/skills/cabloy-workflow/references/cli-strategy.md +39 -0
  16. package/.claude/skills/cabloy-workflow/references/edition-detection.md +30 -0
  17. package/.github/workflows/docs-pages.yml +56 -0
  18. package/.gitignore +1 -0
  19. package/CHANGELOG.md +54 -0
  20. package/CLAUDE.md +59 -0
  21. package/README.md +152 -0
  22. package/cabloy-docs/.vitepress/config.mjs +255 -0
  23. package/cabloy-docs/.vitepress/public/CNAME +1 -0
  24. package/cabloy-docs/.vitepress/theme/custom.css +64 -0
  25. package/cabloy-docs/.vitepress/theme/edition-badges.md +5 -0
  26. package/cabloy-docs/.vitepress/theme/index.js +5 -0
  27. package/cabloy-docs/ai/class-placement-rule.md +139 -0
  28. package/cabloy-docs/ai/cli-for-agents.md +56 -0
  29. package/cabloy-docs/ai/cli-to-skill-map.md +165 -0
  30. package/cabloy-docs/ai/docs-skills-rules-mapping.md +168 -0
  31. package/cabloy-docs/ai/edition-consistency-checklist.md +150 -0
  32. package/cabloy-docs/ai/edition-detection.md +30 -0
  33. package/cabloy-docs/ai/future-skill-roadmap.md +135 -0
  34. package/cabloy-docs/ai/global-bean-lookup.md +158 -0
  35. package/cabloy-docs/ai/introduction.md +62 -0
  36. package/cabloy-docs/ai/playbook-backend-module.md +111 -0
  37. package/cabloy-docs/ai/playbook-contract-regeneration.md +100 -0
  38. package/cabloy-docs/ai/playbook-frontend-page.md +99 -0
  39. package/cabloy-docs/ai/playbook-metadata-refresh.md +67 -0
  40. package/cabloy-docs/ai/repo-guidance.md +58 -0
  41. package/cabloy-docs/ai/rules-and-config.md +29 -0
  42. package/cabloy-docs/ai/skills.md +37 -0
  43. package/cabloy-docs/ai/verification.md +31 -0
  44. package/cabloy-docs/ai/virtual-decorator-guidance.md +206 -0
  45. package/cabloy-docs/backend/aop-overview.md +128 -0
  46. package/cabloy-docs/backend/auth-guide.md +151 -0
  47. package/cabloy-docs/backend/backend-essentials.md +128 -0
  48. package/cabloy-docs/backend/broadcast-guide.md +138 -0
  49. package/cabloy-docs/backend/cache-guide.md +70 -0
  50. package/cabloy-docs/backend/captcha-guide.md +162 -0
  51. package/cabloy-docs/backend/cli.md +173 -0
  52. package/cabloy-docs/backend/config-guide.md +249 -0
  53. package/cabloy-docs/backend/controller-aop-guide.md +270 -0
  54. package/cabloy-docs/backend/controller-guide.md +347 -0
  55. package/cabloy-docs/backend/crud-workflow.md +118 -0
  56. package/cabloy-docs/backend/dto-guide.md +161 -0
  57. package/cabloy-docs/backend/dto-infer-generation.md +153 -0
  58. package/cabloy-docs/backend/dynamic-datasource-guide.md +70 -0
  59. package/cabloy-docs/backend/election-guide.md +141 -0
  60. package/cabloy-docs/backend/entity-guide.md +150 -0
  61. package/cabloy-docs/backend/error-guide.md +108 -0
  62. package/cabloy-docs/backend/event-guide.md +183 -0
  63. package/cabloy-docs/backend/external-aop-guide.md +149 -0
  64. package/cabloy-docs/backend/field-indexes.md +79 -0
  65. package/cabloy-docs/backend/foundation.md +281 -0
  66. package/cabloy-docs/backend/i18n-guide.md +211 -0
  67. package/cabloy-docs/backend/internal-aop-guide.md +181 -0
  68. package/cabloy-docs/backend/introduction.md +95 -0
  69. package/cabloy-docs/backend/jwt-guide.md +276 -0
  70. package/cabloy-docs/backend/logger-guide.md +223 -0
  71. package/cabloy-docs/backend/mail-guide.md +189 -0
  72. package/cabloy-docs/backend/menu-guide.md +80 -0
  73. package/cabloy-docs/backend/migration-and-changes.md +192 -0
  74. package/cabloy-docs/backend/model-guide.md +274 -0
  75. package/cabloy-docs/backend/multi-database-datasource.md +171 -0
  76. package/cabloy-docs/backend/multi-instance-and-instance-resolution.md +196 -0
  77. package/cabloy-docs/backend/openapi-guide.md +118 -0
  78. package/cabloy-docs/backend/orm-aggregate-group-guide.md +210 -0
  79. package/cabloy-docs/backend/orm-configuration-guide.md +165 -0
  80. package/cabloy-docs/backend/orm-guide.md +109 -0
  81. package/cabloy-docs/backend/orm-mutation-guide.md +195 -0
  82. package/cabloy-docs/backend/orm-select-guide.md +243 -0
  83. package/cabloy-docs/backend/queue-guide.md +271 -0
  84. package/cabloy-docs/backend/quickstart.md +141 -0
  85. package/cabloy-docs/backend/redis-guide.md +70 -0
  86. package/cabloy-docs/backend/redlock-guide.md +60 -0
  87. package/cabloy-docs/backend/relations-guide.md +250 -0
  88. package/cabloy-docs/backend/runtime-and-flavors.md +304 -0
  89. package/cabloy-docs/backend/schedule-guide.md +81 -0
  90. package/cabloy-docs/backend/scripts.md +116 -0
  91. package/cabloy-docs/backend/serialization-guide.md +192 -0
  92. package/cabloy-docs/backend/service-guide.md +166 -0
  93. package/cabloy-docs/backend/sharding-guide.md +49 -0
  94. package/cabloy-docs/backend/startup-guide.md +326 -0
  95. package/cabloy-docs/backend/transaction-guide.md +82 -0
  96. package/cabloy-docs/backend/unit-testing.md +209 -0
  97. package/cabloy-docs/backend/upload-guide.md +160 -0
  98. package/cabloy-docs/backend/user-access-guide.md +157 -0
  99. package/cabloy-docs/backend/validation-guide.md +80 -0
  100. package/cabloy-docs/backend/worker-guide.md +59 -0
  101. package/cabloy-docs/editions/cabloy-basic.md +26 -0
  102. package/cabloy-docs/editions/cabloy-start.md +55 -0
  103. package/cabloy-docs/editions/choosing-between-basic-and-start.md +84 -0
  104. package/cabloy-docs/editions/detection.md +31 -0
  105. package/cabloy-docs/editions/overview.md +107 -0
  106. package/cabloy-docs/frontend/api-guide.md +93 -0
  107. package/cabloy-docs/frontend/api-schema-guide.md +43 -0
  108. package/cabloy-docs/frontend/app-startup-guide.md +185 -0
  109. package/cabloy-docs/frontend/cli.md +78 -0
  110. package/cabloy-docs/frontend/component-guide.md +105 -0
  111. package/cabloy-docs/frontend/component-props-guide.md +97 -0
  112. package/cabloy-docs/frontend/component-v-model-guide.md +110 -0
  113. package/cabloy-docs/frontend/css-in-js-guide.md +151 -0
  114. package/cabloy-docs/frontend/design-principles.md +55 -0
  115. package/cabloy-docs/frontend/environment-config-guide.md +250 -0
  116. package/cabloy-docs/frontend/foundation.md +58 -0
  117. package/cabloy-docs/frontend/generic-component-guide.md +35 -0
  118. package/cabloy-docs/frontend/icon-engine-guide.md +88 -0
  119. package/cabloy-docs/frontend/introduction.md +33 -0
  120. package/cabloy-docs/frontend/ioc-and-beans.md +211 -0
  121. package/cabloy-docs/frontend/mock-guide.md +109 -0
  122. package/cabloy-docs/frontend/model-architecture.md +87 -0
  123. package/cabloy-docs/frontend/model-state-guide.md +70 -0
  124. package/cabloy-docs/frontend/module-scope.md +168 -0
  125. package/cabloy-docs/frontend/modules-and-suites.md +179 -0
  126. package/cabloy-docs/frontend/navigation-guards-guide.md +68 -0
  127. package/cabloy-docs/frontend/openapi-sdk-guide.md +102 -0
  128. package/cabloy-docs/frontend/page-guide.md +223 -0
  129. package/cabloy-docs/frontend/page-params-guide.md +87 -0
  130. package/cabloy-docs/frontend/page-query-guide.md +96 -0
  131. package/cabloy-docs/frontend/page-route-guide.md +147 -0
  132. package/cabloy-docs/frontend/quickstart.md +202 -0
  133. package/cabloy-docs/frontend/route-alias-guide.md +61 -0
  134. package/cabloy-docs/frontend/scripts.md +86 -0
  135. package/cabloy-docs/frontend/sdk-guide.md +45 -0
  136. package/cabloy-docs/frontend/server-data.md +74 -0
  137. package/cabloy-docs/frontend/ssr-client-only.md +40 -0
  138. package/cabloy-docs/frontend/ssr-env.md +51 -0
  139. package/cabloy-docs/frontend/ssr-init-data.md +46 -0
  140. package/cabloy-docs/frontend/ssr-overview.md +48 -0
  141. package/cabloy-docs/frontend/ssr-seo-meta.md +52 -0
  142. package/cabloy-docs/frontend/system-startup-guide.md +186 -0
  143. package/cabloy-docs/frontend/theme-guide.md +154 -0
  144. package/cabloy-docs/frontend/zod-guide.md +161 -0
  145. package/cabloy-docs/fullstack/cli.md +118 -0
  146. package/cabloy-docs/fullstack/comparison-with-other-frameworks.md +117 -0
  147. package/cabloy-docs/fullstack/edition-collaboration-differences.md +62 -0
  148. package/cabloy-docs/fullstack/frontend-metadata-to-backend.md +64 -0
  149. package/cabloy-docs/fullstack/introduction.md +81 -0
  150. package/cabloy-docs/fullstack/openapi-to-sdk.md +116 -0
  151. package/cabloy-docs/fullstack/quickstart.md +89 -0
  152. package/cabloy-docs/fullstack/vona-zova-integration.md +86 -0
  153. package/cabloy-docs/fullstack/vscode-extensions.md +126 -0
  154. package/cabloy-docs/index.md +72 -0
  155. package/cabloy-docs/package.json +16 -0
  156. package/cabloy-docs/pnpm-lock.yaml +1607 -0
  157. package/cabloy-docs/reference/backend-directory-structure.md +88 -0
  158. package/cabloy-docs/reference/cli-reference.md +49 -0
  159. package/cabloy-docs/reference/glossary.md +38 -0
  160. package/cabloy-docs/reference/package-map.md +105 -0
  161. package/cabloy-docs/reference/repo-scripts.md +36 -0
  162. package/package.json +4 -1
  163. package/scripts/init.ts +12 -0
  164. package/scripts/upgrade.ts +31 -3
  165. package/vona/README.md +4 -4
  166. package/vona/README.zh-CN.md +4 -4
  167. package/vona/packages-vona/vona/package.json +1 -1
  168. package/vona/pnpm-lock.yaml +383 -38
  169. package/vona/src/suite-vendor/a-cabloy/modules/a-datasharding/package.json +1 -1
  170. package/vona/src/suite-vendor/a-cabloy/modules/a-datasharding/src/bean/summerCache.datasourceWrite.ts +2 -2
  171. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/package.json +1 -1
  172. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/.metadata/index.ts +49 -1
  173. package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/controller/memoryDiag.ts +97 -0
  174. package/vona/src/suite-vendor/a-cabloy/package.json +1 -1
  175. package/vona/src/suite-vendor/a-captcha/modules/a-captcha/package.json +1 -1
  176. package/vona/src/suite-vendor/a-captcha/modules/a-captcha/src/bean/cacheRedis.captcha.ts +2 -2
  177. package/vona/src/suite-vendor/a-captcha/package.json +1 -1
  178. package/vona/src/suite-vendor/a-vona/modules/a-bean/cli/bean/metadata/generate.ts +5 -6
  179. package/vona/src/suite-vendor/a-vona/modules/a-bean/package.json +1 -1
  180. package/vona/src/suite-vendor/a-vona/modules/a-cache/cli/cacheMem/boilerplate/{{sceneName}}.{{beanName}}.ts_ +2 -2
  181. package/vona/src/suite-vendor/a-vona/modules/a-cache/cli/cacheRedis/boilerplate/{{sceneName}}.{{beanName}}.ts_ +2 -2
  182. package/vona/src/suite-vendor/a-vona/modules/a-cache/package.json +1 -1
  183. package/vona/src/suite-vendor/a-vona/modules/a-cache/src/.metadata/index.ts +13 -2
  184. package/vona/src/suite-vendor/a-vona/modules/a-cache/src/bean/bean.cache.ts +6 -7
  185. package/vona/src/suite-vendor/a-vona/modules/a-cache/src/{bean/bean.cacheMemBase.ts → service/cacheMemBase_.ts} +3 -3
  186. package/vona/src/suite-vendor/a-vona/modules/a-cache/src/{bean/bean.cacheRedisBase.ts → service/cacheRedisBase_.ts} +3 -3
  187. package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/package.json +1 -1
  188. package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/bean/cacheRedis.emailConfirm.ts +2 -2
  189. package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/src/bean/cacheRedis.passwordReset.ts +2 -2
  190. package/vona/src/suite-vendor/a-vona/modules/a-openapi/package.json +1 -1
  191. package/vona/src/suite-vendor/a-vona/modules/a-openapi/src/bean/summerCache.json.ts +2 -2
  192. package/vona/src/suite-vendor/a-vona/modules/a-orm/cli/databaseDialect/boilerplate/{{sceneName}}.{{beanName}}.ts_ +2 -2
  193. package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +1 -1
  194. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/.metadata/index.ts +4 -3
  195. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/bean/bean.database.ts +3 -3
  196. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/bean/bean.model.ts +1 -1
  197. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/bean/schedule.softDeletionPrune.ts +1 -1
  198. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/common/utils.ts +1 -1
  199. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/index.ts +1 -1
  200. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_cache.ts +1 -1
  201. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_meta.ts +1 -1
  202. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.modelBase.ts +0 -5
  203. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoAggregate.ts +1 -1
  204. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoCreate.ts +1 -1
  205. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoGet.ts +1 -1
  206. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoGroup.ts +1 -1
  207. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoMutate.ts +1 -1
  208. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoSelectAndCount.ts +1 -1
  209. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoUpdate.ts +1 -1
  210. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/index.ts +1 -0
  211. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/modelCacheBase.ts +3 -3
  212. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/relations.ts +1 -1
  213. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/relationsDynamic.ts +1 -1
  214. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/relationsMutate.ts +1 -1
  215. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/relationsStatic.ts +1 -1
  216. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/cacheEntity_.ts +1 -1
  217. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/cacheQuery_.ts +1 -1
  218. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/database.ts +2 -2
  219. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean/bean.databaseDialectBase.ts → service/databaseDialectBase_.ts} +38 -41
  220. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/db_.ts +2 -2
  221. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/relations_.ts +3 -3
  222. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/database.ts +0 -5
  223. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/dto/dtoGet.ts +1 -1
  224. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/dto/dtoMutate.ts +1 -1
  225. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/dto/dtoSelectAndCount.ts +1 -1
  226. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/model.ts +1 -1
  227. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelAggr.ts +1 -1
  228. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelCount.ts +1 -1
  229. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelGeneral.ts +1 -1
  230. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelGroup.ts +1 -1
  231. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelIncrement.ts +1 -1
  232. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relations.ts +1 -1
  233. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsColumns.ts +1 -1
  234. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsDef.ts +1 -1
  235. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsDefDynamic.ts +1 -1
  236. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsDefMutate.ts +1 -1
  237. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsMutate.ts +1 -1
  238. package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/relationsTables.ts +1 -1
  239. package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/package.json +1 -1
  240. package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/src/bean/databaseDialect.betterSqlite3.ts +2 -2
  241. package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/src/bean/databaseDialect.mysql.ts +2 -2
  242. package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/src/bean/databaseDialect.pg.ts +2 -2
  243. package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +1 -1
  244. package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/bean.permission.ts +109 -40
  245. package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/summerCache.permission.ts +2 -2
  246. package/vona/src/suite-vendor/a-vona/modules/a-startup/package.json +1 -1
  247. package/vona/src/suite-vendor/a-vona/modules/a-startup/src/bean/cacheRedis.startupDebounce.ts +2 -2
  248. package/vona/src/suite-vendor/a-vona/modules/a-summer/cli/boilerplate/{{sceneName}}.{{beanName}}.ts_ +2 -2
  249. package/vona/src/suite-vendor/a-vona/modules/a-summer/package.json +1 -1
  250. package/vona/src/suite-vendor/a-vona/modules/a-summer/src/.metadata/index.ts +1 -1
  251. package/vona/src/suite-vendor/a-vona/modules/a-summer/src/bean/bean.summer.ts +3 -3
  252. package/vona/src/suite-vendor/a-vona/modules/a-summer/src/service/localMem_.ts +3 -3
  253. package/vona/src/suite-vendor/a-vona/modules/a-summer/src/service/localRedis_.ts +3 -3
  254. package/vona/src/suite-vendor/a-vona/modules/a-summer/src/{bean/bean.summerCacheBase.ts → service/summerCacheBase_.ts} +3 -3
  255. package/vona/src/suite-vendor/a-vona/modules/a-swagger/package.json +1 -1
  256. package/vona/src/suite-vendor/a-vona/modules/a-swagger/src/bean/summerCache.rapidoc.ts +2 -2
  257. package/vona/src/suite-vendor/a-vona/modules/a-swagger/src/bean/summerCache.swagger.ts +2 -2
  258. package/vona/src/suite-vendor/a-vona/modules/a-user/package.json +1 -1
  259. package/vona/src/suite-vendor/a-vona/modules/a-user/src/bean/cacheRedis.authToken.ts +2 -2
  260. package/vona/src/suite-vendor/a-vona/modules/a-worker/package.json +1 -1
  261. package/vona/src/suite-vendor/a-vona/modules/a-worker/src/bean/cacheRedis.workerAlive.ts +2 -2
  262. package/vona/src/suite-vendor/a-vona/package.json +1 -1
  263. package/zova/README.md +5 -5
  264. package/zova/README.zh-CN.md +4 -4
  265. package/zova/package.original.json +4 -4
  266. package/zova/packages-cli/cli/package.json +2 -2
  267. package/zova/packages-cli/cli-set-front/package.json +2 -2
  268. package/zova/packages-utils/zova-jsx/package.json +2 -2
  269. package/zova/packages-utils/zova-vite/package.json +2 -2
  270. package/zova/packages-utils/zova-vite/templates/app/controller.tsx_ +3 -3
  271. package/zova/packages-zova/zova/package.json +3 -3
  272. package/zova/packages-zova/zova-core/package.json +2 -2
  273. package/zova/packages-zova/zova-core/src/bean/beanContainer.ts +3 -3
  274. package/zova/packages-zova/zova-core/src/bean/beanControllerPageBase.ts +1 -0
  275. package/zova/packages-zova/zova-core/src/core/component/module.ts +16 -16
  276. package/zova/packages-zova/zova-core/src/core/context/component.ts +35 -3
  277. package/zova/packages-zova/zova-core/src/core/context/util.ts +15 -11
  278. package/zova/pnpm-lock.yaml +1596 -1679
  279. package/zova/src/suite/a-demo/modules/demo-basic/src/.metadata/index.ts +11 -0
  280. package/zova/src/suite/a-demo/modules/demo-basic/src/.metadata/page/toolMinimal.ts +9 -0
  281. package/zova/src/suite/a-demo/modules/demo-basic/src/page/toolMinimal/controller.tsx +11 -0
  282. package/zova/src/suite/a-demo/modules/demo-basic/src/routes.ts +10 -0
  283. package/zova/src/suite-vendor/a-zova/modules/a-model/package.json +1 -1
  284. package/zova/src/suite-vendor/a-zova/modules/a-model/src/service/storage.ts +4 -5
  285. package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +1 -1
  286. package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/monkey.ts +1 -1
  287. package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +1 -1
  288. package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/lib/ssr.ts +36 -1
  289. package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/lib/ssrMetaStore.ts +7 -2
  290. package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/monkey.ts +3 -0
  291. package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/package.json +1 -1
  292. package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/src/service/ssrHandler.ts +70 -29
  293. package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
  294. package/zova/src/suite-vendor/a-zova/package.json +6 -6
  295. /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_crud.ts +0 -0
  296. /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_crud_inner.ts +0 -0
  297. /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_crud_table.ts +0 -0
  298. /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_knex.ts +0 -0
  299. /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_utils.ts +0 -0
  300. /package/vona/src/suite-vendor/a-vona/modules/a-orm/src/{bean → lib}/bean.model/bean.model_view.ts +0 -0
@@ -0,0 +1,109 @@
1
+ # Mock Guide
2
+
3
+ ## Why mock matters in Zova
4
+
5
+ Zova provides an out-of-the-box mock mechanism so frontend development can continue even when a real backend integration path is incomplete or intentionally decoupled.
6
+
7
+ That matters because page, API, and server-data workflows often need stable response shapes before the final backend contract is available.
8
+
9
+ ## Core mock model
10
+
11
+ The Zova mock mechanism is based on `vite-plugin-fake-server` and is integrated into the frontend development workflow.
12
+
13
+ A mock route is typically defined in a `.fake.ts` file inside the relevant module.
14
+
15
+ ## Mock file structure
16
+
17
+ Representative example:
18
+
19
+ ```typescript
20
+ import { defineFakeRoute } from 'vite-plugin-fake-server-turbo/client';
21
+
22
+ export default defineFakeRoute([
23
+ {
24
+ url: '/home/layout/menu/select',
25
+ method: 'get',
26
+ response: () => {
27
+ return {
28
+ code: 0,
29
+ message: 'Success',
30
+ data: [],
31
+ };
32
+ },
33
+ },
34
+ ]);
35
+ ```
36
+
37
+ Key points:
38
+
39
+ - mock files use the `.fake.ts` extension
40
+ - `defineFakeRoute(...)` provides the route definition shape
41
+ - each mock route describes the request path, method, and response
42
+
43
+ ## Where mock files belong
44
+
45
+ Mocks belong near the frontend module that consumes or defines the route shape.
46
+
47
+ Representative example:
48
+
49
+ - `src/suite/a-home/modules/home-layout/mock/menu.fake.ts`
50
+
51
+ This keeps mock behavior close to the page, API, or business module that depends on it.
52
+
53
+ ## Relationship to frontend APIs and server data
54
+
55
+ Mocking fits naturally with:
56
+
57
+ - [API Guide](/frontend/api-guide)
58
+ - [Server Data](/frontend/server-data)
59
+ - [Page Guide](/frontend/page-guide)
60
+
61
+ A common workflow is:
62
+
63
+ 1. define or update the frontend page or API contract
64
+ 2. provide a mock route with the expected response shape
65
+ 3. build page, component, or model behavior against that mock response
66
+ 4. later replace the mock-backed path with the real backend contract when ready
67
+
68
+ ## Configuration
69
+
70
+ Mock behavior is configured through environment variables such as:
71
+
72
+ - `MOCK_ENABLED`
73
+ - `MOCK_LOGGER`
74
+ - `MOCK_BASE_NAME`
75
+ - `MOCK_BUILD`
76
+ - `MOCK_BUILD_PORT`
77
+ - `MOCK_BUILD_OUTPUT`
78
+ - `MOCK_BUILD_CORS`
79
+
80
+ These settings control whether mocks are enabled, whether a standalone fake server should be built, and how the mock server behaves.
81
+
82
+ ## Development and production behavior
83
+
84
+ By default, production builds do not generate the fake server.
85
+
86
+ If a standalone fake server should be generated during build, `MOCK_BUILD` must be enabled.
87
+
88
+ That means mock support can be used in development only, or intentionally packaged for separate deployment when needed.
89
+
90
+ ## When to use mock
91
+
92
+ Use mock when:
93
+
94
+ - frontend page or API work needs stable response data before the backend is ready
95
+ - you want to prototype UI behavior against an expected contract
96
+ - you want repeatable local demo or development behavior without a live backend dependency
97
+
98
+ Do not treat mock as the final source of truth for the contract when a real backend/OpenAPI path already exists.
99
+
100
+ ## Implementation checks for mock-versus-contract decisions
101
+
102
+ When editing frontend integration paths, ask:
103
+
104
+ 1. is the real backend contract available yet?
105
+ 2. should this flow use a temporary mock route or a real `$api`/OpenAPI path?
106
+ 3. does the mock response shape match the intended page, API, or model contract?
107
+ 4. should mock be enabled only for development, or is a standalone fake server also needed?
108
+
109
+ That helps AI keep frontend development moving without confusing temporary mock behavior with final backend truth.
@@ -0,0 +1,87 @@
1
+ # Model Architecture
2
+
3
+ This guide explains the overall model architecture in Zova within the Cabloy monorepo.
4
+
5
+ ## Why Zova models matter
6
+
7
+ Zova uses a unified `Model` mechanism to manage several kinds of data that other frontend stacks often split across unrelated tools.
8
+
9
+ This is one of the most important architectural ideas in Zova.
10
+
11
+ ## Four kinds of global state
12
+
13
+ The model architecture can be understood through four common data categories:
14
+
15
+ - asynchronous data, usually from the server
16
+ - local storage data
17
+ - cookie data
18
+ - in-memory data
19
+
20
+ In Zova, these can all participate in one broader model-centered system instead of forcing developers to switch between unrelated mental models.
21
+
22
+ ## Relationship to TanStack Query
23
+
24
+ One key point is explicit: the base of Zova Model is TanStack Query.
25
+
26
+ That matters because Zova is not discarding the strengths of TanStack Query. It is building a more unified and framework-friendly usage model on top of it.
27
+
28
+ ## Key model capabilities
29
+
30
+ Several important capabilities remain central in the unified docs:
31
+
32
+ ### 1. Support for async and sync data
33
+
34
+ The model system is not limited to server data. It also extends the same broader mechanism to synchronous data categories.
35
+
36
+ ### 2. Automatic caching
37
+
38
+ Remote data can be cached locally, while local-storage or cookie-backed data can be accessed through unified model patterns.
39
+
40
+ ### 3. Automatic update behavior
41
+
42
+ The model system supports data freshness and update behavior instead of treating state as static snapshots.
43
+
44
+ ### 4. Reduced duplicate requests
45
+
46
+ When multiple parts of the app need the same data, the framework avoids unnecessary repeated requests.
47
+
48
+ ### 5. Memory optimization
49
+
50
+ Model-managed data does not need to occupy memory forever. Cache lifecycle and release behavior matter, especially for large long-running applications.
51
+
52
+ ### 6. Persistence
53
+
54
+ Model-managed data can participate in persistence strategies so refreshes do not always mean starting from nothing.
55
+
56
+ ### 7. SSR support
57
+
58
+ The model system helps smooth out SSR differences across data categories and makes hydration more natural.
59
+
60
+ ### 8. Namespace isolation
61
+
62
+ Because data is managed through model beans, the bean identity itself helps provide namespace isolation and reduces collision risk.
63
+
64
+ ## Create a model bean
65
+
66
+ Representative pattern:
67
+
68
+ ```typescript
69
+ import { Model } from 'zova';
70
+ import { BeanModelBase } from 'zova-module-a-model';
71
+
72
+ @Model()
73
+ export class ModelTodo extends BeanModelBase {}
74
+ ```
75
+
76
+ ## Practical implications for frontend state design
77
+
78
+ When asked to add frontend state, do not immediately assume a generic Vue/Pinia-style answer.
79
+
80
+ A better default is to ask:
81
+
82
+ 1. is this state already a good fit for a Zova model?
83
+ 2. is the data async or sync, and does that distinction matter to the model choice?
84
+ 3. does SSR or persistence make the model layer especially valuable here?
85
+ 4. is there already a model bean that should own this state instead of adding a new ad hoc state container?
86
+
87
+ That keeps the code aligned with Zova’s actual architecture.
@@ -0,0 +1,70 @@
1
+ # Model State Guide
2
+
3
+ This guide explains how model-based server-data state works in Zova within the Cabloy monorepo.
4
+
5
+ ## Why the model layer exists
6
+
7
+ Zova uses model-based state management on top of API access so remote data can participate in a more unified caching and usage model.
8
+
9
+ This improves runtime performance and developer experience by building on top of TanStack Query rather than exposing only raw request flows.
10
+
11
+ ## Create a model
12
+
13
+ Example: create a model named `menu` in module `demo-student`.
14
+
15
+ ```bash
16
+ npm run zova :create:bean model menu -- --module=demo-student
17
+ ```
18
+
19
+ ## Model definition
20
+
21
+ Representative pattern:
22
+
23
+ ```typescript
24
+ @Model()
25
+ export class ModelMenu {
26
+ retrieveMenus() {
27
+ return this.$useStateData({
28
+ queryKey: ['retrieveMenus'],
29
+ queryFn: async () => {
30
+ return await this.$api.homeBaseMenu.retrieveMenus({
31
+ params: { publicPath: '' },
32
+ });
33
+ },
34
+ });
35
+ }
36
+ }
37
+ ```
38
+
39
+ This pattern is important because it shows that model logic is not just local state. It is also the place where cached remote data becomes a reusable abstraction.
40
+
41
+ ## Using a model
42
+
43
+ Representative pattern:
44
+
45
+ ```typescript
46
+ @Use()
47
+ $$modelMenu: ModelMenu;
48
+
49
+ protected render() {
50
+ const { data, error } = this.$$modelMenu.retrieveMenus();
51
+ if (error) return <div>{error.message}</div>;
52
+ return <div>{data}</div>;
53
+ }
54
+ ```
55
+
56
+ ## Relationship to the server-data ladder
57
+
58
+ In the new docs, think about the layers like this:
59
+
60
+ - `$fetch` → direct request access
61
+ - `$api` → business-oriented service methods
62
+ - `Model` → cached, reusable, UI-friendly remote state
63
+
64
+ That makes the model layer one of the most important bridges between backend contracts and frontend rendering.
65
+
66
+ ## Implementation checks for model-based state changes
67
+
68
+ When you see repeated frontend data usage, caching concerns, or UI state that depends on remote data, ask whether the right abstraction is a model instead of a direct API call in the page.
69
+
70
+ That usually leads to cleaner SSR behavior, cleaner reuse, and a more Cabloy-native structure.
@@ -0,0 +1,168 @@
1
+ # Module Scope
2
+
3
+ ## Why module scope matters in Zova
4
+
5
+ Zova uses module scope as the unified resource facade for frontend modules.
6
+
7
+ That matters because business code needs a consistent way to access module resources such as config, locale, errors, APIs, and related metadata without scattering unrelated access patterns through every page or component.
8
+
9
+ ## What scope is
10
+
11
+ A `Scope` instance is the module-facing object that exposes the resources of a module in one place.
12
+
13
+ This is one of the main reasons Zova can keep dependency lookup concise while still preserving strong structure.
14
+
15
+ ## `this.scope`
16
+
17
+ All beans inherit from `BeanBase`, so the current module scope is directly available through:
18
+
19
+ ```typescript
20
+ this.scope;
21
+ ```
22
+
23
+ This gives the current bean a natural way to access the resources of its own module.
24
+
25
+ ## Main scope resource categories
26
+
27
+ Representative scope members include:
28
+
29
+ - `config`
30
+ - `constant`
31
+ - `locale`
32
+ - `error`
33
+ - `api`
34
+ - `apiSchema`
35
+
36
+ These categories make module resources discoverable and consistently organized.
37
+
38
+ ## Initialize scope-backed resources
39
+
40
+ Representative CLI entrypoints include:
41
+
42
+ ```bash
43
+ npm run zova :init:config demo-student
44
+ npm run zova :init:constant demo-student
45
+ npm run zova :init:locale demo-student
46
+ npm run zova :init:error demo-student
47
+ npm run zova :create:bean api test -- --module=demo-student
48
+ ```
49
+
50
+ This matters because scope is not just a read surface. It is the organized destination for resources generated or initialized through the standard Zova workflow.
51
+
52
+ ## `config`
53
+
54
+ Module config belongs in the scope model so business logic can read feature-specific configuration in a structured way.
55
+
56
+ Representative access pattern:
57
+
58
+ ```typescript
59
+ console.log(this.scope.config.title);
60
+ ```
61
+
62
+ Projects can also override module-level config through project-level frontend config, which makes scope a bridge between reusable module defaults and app-specific customization.
63
+
64
+ ## `constant`
65
+
66
+ Module constants can live in scope so feature-level constant values remain namespaced and easy to access.
67
+
68
+ Representative access pattern:
69
+
70
+ ```typescript
71
+ console.log(this.scope.constant.gender.male);
72
+ console.log(this.scope.constant.gender.female);
73
+ ```
74
+
75
+ ## `locale`
76
+
77
+ Module locale resources are exposed through scope so frontend code can retrieve localized text in a module-aware way.
78
+
79
+ Representative access patterns:
80
+
81
+ ```typescript
82
+ const message1 = this.scope.locale.HelloWorld();
83
+ const message2 = this.scope.locale.HelloWorld.locale('en-us');
84
+ ```
85
+
86
+ Project-level locale resources can override module-level locale values, which is one of the key reasons scope stays useful even when the final app wants customized wording.
87
+
88
+ ## `error`
89
+
90
+ Module-specific errors are exposed through scope so business code can throw namespaced error definitions without inventing ad hoc exception patterns.
91
+
92
+ Representative access pattern:
93
+
94
+ ```typescript
95
+ this.scope.error.ErrorTest.throw();
96
+ ```
97
+
98
+ ## `api`
99
+
100
+ Backend API calls can be wrapped as module `api` resources and accessed through scope.
101
+
102
+ This is one of the most practical scope categories because it keeps request logic close to the module boundary instead of scattering raw request paths through page code.
103
+
104
+ Representative access pattern:
105
+
106
+ ```typescript
107
+ const res = await this.scope.api.test.echo();
108
+ ```
109
+
110
+ ## `apiSchema`
111
+
112
+ Schema-oriented API metadata can also be exposed through scope when higher-level frontend behavior depends on API metadata directly.
113
+
114
+ ## Cross-module scope access
115
+
116
+ Zova also supports cross-module scope access through `@UseScope()`.
117
+
118
+ Representative pattern:
119
+
120
+ ```typescript
121
+ @UseScope()
122
+ $$scopeDemoStudent: ScopeModuleDemoStudent;
123
+ ```
124
+
125
+ A common follow-up access pattern is:
126
+
127
+ ```typescript
128
+ const res = await this.$$scopeDemoStudent.api.test.echo();
129
+ console.log(this.$$scopeDemoStudent.locale.HelloWorld());
130
+ ```
131
+
132
+ This allows one module to consume another module’s scoped resources explicitly without flattening everything into one shared global namespace.
133
+
134
+ Compiler support also lets `@UseScope()` participate in async module loading behavior, which fits naturally with Zova’s module-level bundle boundaries.
135
+
136
+ ## Why this matters for architecture
137
+
138
+ Module scope is a key bridge between:
139
+
140
+ - modularization
141
+ - IoC and bean lookup
142
+ - API access
143
+ - locale and error handling
144
+ - project-level override behavior
145
+
146
+ That makes scope one of the most important frontend concepts to understand before extending a larger Zova application.
147
+
148
+ ## Relationship to other frontend guides
149
+
150
+ Read this together with:
151
+
152
+ - [IoC and Beans](/frontend/ioc-and-beans)
153
+ - [Modules and Suites](/frontend/modules-and-suites)
154
+ - [API Guide](/frontend/api-guide)
155
+ - [Server Data](/frontend/server-data)
156
+
157
+ These guides explain how scope fits into bean architecture, module boundaries, and data-access design.
158
+
159
+ ## Implementation checks for module-scope changes
160
+
161
+ When editing Zova frontend code, ask:
162
+
163
+ 1. should this resource be accessed through `this.scope` instead of a direct ad hoc import?
164
+ 2. does the logic belong to the current module or another module’s scope?
165
+ 3. should cross-module access use `@UseScope()`?
166
+ 4. is this concern best modeled as config, constant, locale, error, api, or apiSchema?
167
+
168
+ That helps AI keep frontend resource access aligned with Zova’s intended module architecture.
@@ -0,0 +1,179 @@
1
+ # Modules and Suites
2
+
3
+ ## Why modularization matters in Zova
4
+
5
+ Zova organizes frontend code into modules and suites so business code can scale without collapsing into one large undifferentiated app surface.
6
+
7
+ That matters for:
8
+
9
+ - business decoupling
10
+ - reuse of feature units
11
+ - clear bundle boundaries
12
+ - team-level work decomposition
13
+ - namespace isolation
14
+
15
+ ## Module as the core business unit
16
+
17
+ In Zova, a module groups related pages, components, config, locale, API resources, and other frontend assets into one coherent feature boundary.
18
+
19
+ A module is not just a folder. It is a unit of architecture, naming, and bundling.
20
+
21
+ ## Why modules help
22
+
23
+ Representative benefits include:
24
+
25
+ - clearer business boundaries
26
+ - easier reuse across systems
27
+ - reduced naming conflicts through namespace isolation
28
+ - more natural async bundle boundaries during build
29
+
30
+ ## Module naming convention
31
+
32
+ Zova modules follow a naming model such as:
33
+
34
+ ```text
35
+ FullName: zova-module-{providerId}-{moduleName}
36
+ ShortName: {providerId}-{moduleName}
37
+ ```
38
+
39
+ This naming system is important because it supports both architectural clarity and bean/scope identity across module boundaries.
40
+
41
+ ## Suite as a multi-module boundary
42
+
43
+ A suite groups several related modules into a larger business scenario.
44
+
45
+ Representative examples might correspond to areas such as:
46
+
47
+ - e-commerce
48
+ - CRM
49
+ - supply chain
50
+ - shared application foundations
51
+
52
+ A suite is therefore not merely a package wrapper. It is a business-level composition boundary.
53
+
54
+ ## Suite naming convention
55
+
56
+ Suites follow a similar naming model:
57
+
58
+ ```text
59
+ FullName: zova-suite-{providerId}-{suiteName}
60
+ ShortName: {providerId}-{suiteName}
61
+ ```
62
+
63
+ ## Create modules and suites
64
+
65
+ Representative CLI entrypoints are:
66
+
67
+ ```bash
68
+ npm run zova :create:module moduleName -- [--suite=]
69
+ npm run zova :create:suite suiteName
70
+ ```
71
+
72
+ That matters because the CLI already knows the intended source-tree conventions and should be preferred over ad hoc manual scaffolding.
73
+
74
+ ## Directory structure
75
+
76
+ The project directory structure expresses this modular architecture directly.
77
+
78
+ Representative areas include:
79
+
80
+ - `src/module`
81
+ - `src/module-vendor`
82
+ - `src/suite`
83
+ - `src/suite-vendor`
84
+
85
+ This makes frontend architecture visible in the source tree rather than hiding it behind build-only conventions.
86
+
87
+ ### Representative source tree
88
+
89
+ ```text
90
+ project
91
+ ├── env
92
+ ├── src
93
+ │ ├── front
94
+ │ │ └── config
95
+ │ ├── module
96
+ │ ├── module-vendor
97
+ │ ├── suite
98
+ │ │ ├── a-demo
99
+ │ │ └── a-home
100
+ │ │ └── modules
101
+ │ │ ├── home-base
102
+ │ │ ├── home-icon
103
+ │ │ ├── home-indexadmin
104
+ │ │ └── home-layoutadmin
105
+ │ └── suite-vendor
106
+ ```
107
+
108
+ A practical convention from the legacy guidance is that `a-demo` can host demo or disposable exploratory code, while suites such as `a-home` act as the normal starting point for real application growth.
109
+
110
+ ## Module and suite boundaries in practice
111
+
112
+ A practical mental model is:
113
+
114
+ - use a **module** for a coherent feature unit
115
+ - use a **suite** when several modules belong to one larger business scenario
116
+ - use the source tree as a reflection of real architecture, not only file storage
117
+
118
+ ## Relationship to frontend build behavior
119
+
120
+ A module is also a natural async bundle boundary.
121
+
122
+ That means modularization is not only about code organization. It also affects how frontend output is built, loaded, and maintained.
123
+
124
+ ### Package-level module metadata
125
+
126
+ A module package can also declare metadata in `package.json` through `zovaModule`, for example to describe inter-module dependencies or bundle behavior.
127
+
128
+ Representative patterns include:
129
+
130
+ ```json
131
+ {
132
+ "name": "zova-module-demo-student",
133
+ "zovaModule": {
134
+ "dependencies": {
135
+ "a-zova": "5.0.0"
136
+ }
137
+ }
138
+ }
139
+ ```
140
+
141
+ ```json
142
+ {
143
+ "name": "zova-module-a-model",
144
+ "zovaModule": {
145
+ "bundle": {
146
+ "vendors": [
147
+ {
148
+ "match": ["@tanstack/query-core", "@tanstack/vue-query"],
149
+ "output": "tanstack-query"
150
+ }
151
+ ]
152
+ }
153
+ }
154
+ }
155
+ ```
156
+
157
+ This reinforces that modules are not merely folders. They are explicit package, dependency, and bundle boundaries.
158
+
159
+ ## Relationship to other frontend guides
160
+
161
+ Read this together with:
162
+
163
+ - [IoC and Beans](/frontend/ioc-and-beans)
164
+ - [Module Scope](/frontend/module-scope)
165
+ - [Frontend Scripts](/frontend/scripts)
166
+ - [Reference Package Map](/reference/package-map)
167
+
168
+ These guides explain how modules connect to bean identity, scope-based resources, and monorepo layout.
169
+
170
+ ## Implementation checks for module and suite changes
171
+
172
+ When editing or creates frontend code, ask:
173
+
174
+ 1. does this belong in an existing module or a new one?
175
+ 2. is this really one feature unit, or should it become part of a suite?
176
+ 3. does the naming follow Zova’s module/suite conventions?
177
+ 4. will the chosen placement preserve the intended architectural and bundle boundaries?
178
+
179
+ That helps AI keep frontend growth aligned with Zova’s modular system instead of falling back to generic folder expansion.
@@ -0,0 +1,68 @@
1
+ # Navigation Guards Guide
2
+
3
+ This guide explains how navigation guards work in Zova within the Cabloy monorepo.
4
+
5
+ ## Why navigation guards matter
6
+
7
+ Navigation guards are one of the main places where routing behavior becomes application policy.
8
+
9
+ Typical uses include:
10
+
11
+ - checking authentication state
12
+ - redirecting unauthenticated users to login
13
+ - enforcing route-level behavior from route metadata
14
+
15
+ ## Home-base guard entrypoint
16
+
17
+ The `home-base` module provides a router-guard service hook where custom logic can be added.
18
+
19
+ Representative shape:
20
+
21
+ ```typescript
22
+ class ServiceRouterGuards {
23
+ protected onRouterGuards(router: BeanRouter) {
24
+ router.beforeEach(async to => {
25
+ if (
26
+ !this.sys.config.ssr.ignoreCookieOnServer &&
27
+ to.meta.requiresAuth !== false &&
28
+ !this.$passport.isAuthenticated
29
+ ) {
30
+ const [_res, err] = await catchError(() => {
31
+ return this.$passport.ensurePassport();
32
+ });
33
+ if (err) {
34
+ this.$errorHandler(err, 'onRouterGuards');
35
+ return false;
36
+ }
37
+ if (!this.$passport.isAuthenticated) {
38
+ this.app.$gotoLogin(to.fullPath);
39
+ return false;
40
+ }
41
+ }
42
+ });
43
+ }
44
+ }
45
+ ```
46
+
47
+ ## Why route meta matters here
48
+
49
+ The example makes a key architectural point: navigation guards are tightly coupled to route metadata such as `requiresAuth`.
50
+
51
+ That means route configuration and guard behavior should be read together, not as separate concerns.
52
+
53
+ ## SSR-sensitive detail
54
+
55
+ The example also references SSR-related configuration such as cookie handling on the server side.
56
+
57
+ So guards are not purely a client-side router concern. In Cabloy/Zova, they can also intersect with SSR behavior.
58
+
59
+ ## Implementation checks for navigation-guard changes
60
+
61
+ When changing auth-sensitive routing behavior, ask:
62
+
63
+ 1. does the route meta need to change?
64
+ 2. does the guard logic need to change?
65
+ 3. does SSR cookie or server-side behavior affect the guard decision path?
66
+ 4. should redirects happen at the routing-policy layer rather than being hardcoded into page logic?
67
+
68
+ That produces cleaner and more framework-native navigation behavior.