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.
- 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 +292 -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 +30 -0
- package/.github/workflows/docs-pages.yml +56 -0
- package/.gitignore +1 -0
- package/CHANGELOG.md +54 -0
- package/CLAUDE.md +59 -0
- package/README.md +152 -0
- package/cabloy-docs/.vitepress/config.mjs +255 -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 +139 -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 +168 -0
- package/cabloy-docs/ai/edition-consistency-checklist.md +150 -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 +158 -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 +37 -0
- package/cabloy-docs/ai/verification.md +31 -0
- package/cabloy-docs/ai/virtual-decorator-guidance.md +206 -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 +26 -0
- package/cabloy-docs/editions/cabloy-start.md +55 -0
- package/cabloy-docs/editions/choosing-between-basic-and-start.md +84 -0
- package/cabloy-docs/editions/detection.md +31 -0
- package/cabloy-docs/editions/overview.md +107 -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 +58 -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 +33 -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 +202 -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/cli.md +118 -0
- package/cabloy-docs/fullstack/comparison-with-other-frameworks.md +117 -0
- package/cabloy-docs/fullstack/edition-collaboration-differences.md +62 -0
- package/cabloy-docs/fullstack/frontend-metadata-to-backend.md +64 -0
- package/cabloy-docs/fullstack/introduction.md +81 -0
- package/cabloy-docs/fullstack/openapi-to-sdk.md +116 -0
- package/cabloy-docs/fullstack/quickstart.md +89 -0
- package/cabloy-docs/fullstack/vona-zova-integration.md +86 -0
- package/cabloy-docs/fullstack/vscode-extensions.md +126 -0
- package/cabloy-docs/index.md +72 -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 +4 -4
- package/vona/README.zh-CN.md +4 -4
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/pnpm-lock.yaml +383 -38
- 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/modules/a-ssr/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/.metadata/index.ts +49 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/src/controller/memoryDiag.ts +97 -0
- 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 +5 -5
- package/zova/README.zh-CN.md +4 -4
- package/zova/package.original.json +4 -4
- package/zova/packages-cli/cli/package.json +2 -2
- package/zova/packages-cli/cli-set-front/package.json +2 -2
- package/zova/packages-utils/zova-jsx/package.json +2 -2
- package/zova/packages-utils/zova-vite/package.json +2 -2
- package/zova/packages-utils/zova-vite/templates/app/controller.tsx_ +3 -3
- package/zova/packages-zova/zova/package.json +3 -3
- package/zova/packages-zova/zova-core/package.json +2 -2
- package/zova/packages-zova/zova-core/src/bean/beanContainer.ts +3 -3
- package/zova/packages-zova/zova-core/src/bean/beanControllerPageBase.ts +1 -0
- package/zova/packages-zova/zova-core/src/core/component/module.ts +16 -16
- package/zova/packages-zova/zova-core/src/core/context/component.ts +35 -3
- package/zova/packages-zova/zova-core/src/core/context/util.ts +15 -11
- package/zova/pnpm-lock.yaml +1596 -1679
- package/zova/src/suite/a-demo/modules/demo-basic/src/.metadata/index.ts +11 -0
- package/zova/src/suite/a-demo/modules/demo-basic/src/.metadata/page/toolMinimal.ts +9 -0
- package/zova/src/suite/a-demo/modules/demo-basic/src/page/toolMinimal/controller.tsx +11 -0
- package/zova/src/suite/a-demo/modules/demo-basic/src/routes.ts +10 -0
- package/zova/src/suite-vendor/a-zova/modules/a-model/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-model/src/service/storage.ts +4 -5
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/monkey.ts +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/lib/ssr.ts +36 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/lib/ssrMetaStore.ts +7 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/monkey.ts +3 -0
- package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/src/service/ssrHandler.ts +70 -29
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +6 -6
- /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,166 @@
|
|
|
1
|
+
# Service Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how services work in Vona within the Cabloy monorepo.
|
|
4
|
+
|
|
5
|
+
## Why services matter
|
|
6
|
+
|
|
7
|
+
A service is usually the business-oriented layer that coordinates controllers, models, validation-related flows, and cross-module behavior.
|
|
8
|
+
|
|
9
|
+
In practice, the service guide is also the most useful page for understanding backend access patterns.
|
|
10
|
+
|
|
11
|
+
## Create a service
|
|
12
|
+
|
|
13
|
+
Example: create a service named `student` in module `demo-student`.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm run vona :create:bean service student -- --module=demo-student
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Service definition
|
|
20
|
+
|
|
21
|
+
Representative pattern:
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
@Service()
|
|
25
|
+
export class ServiceStudent extends BeanBase {}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## The three main access styles
|
|
29
|
+
|
|
30
|
+
Vona backend code commonly uses three access styles:
|
|
31
|
+
|
|
32
|
+
- dependency injection
|
|
33
|
+
- dependency lookup
|
|
34
|
+
- direct bean access
|
|
35
|
+
|
|
36
|
+
A practical rule is:
|
|
37
|
+
|
|
38
|
+
- prefer dependency lookup as the default for concise business code
|
|
39
|
+
- use injection when the surrounding code already follows explicit wiring
|
|
40
|
+
- use direct bean access when you need container-level behavior or a fresh bean instance
|
|
41
|
+
|
|
42
|
+
## Dependency injection
|
|
43
|
+
|
|
44
|
+
### By class type
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { ServiceStudent } from '../service/student.ts';
|
|
48
|
+
|
|
49
|
+
class ControllerStudent {
|
|
50
|
+
@Use()
|
|
51
|
+
serviceStudent: ServiceStudent;
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### By bean identifier
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import type { ServiceStudent } from '../service/student.ts';
|
|
59
|
+
|
|
60
|
+
class ControllerStudent {
|
|
61
|
+
@Use('demo-student.service.student')
|
|
62
|
+
serviceStudent: ServiceStudent;
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This is the clearest place where bean identifiers become visible in ordinary backend code.
|
|
67
|
+
|
|
68
|
+
## Dependency lookup
|
|
69
|
+
|
|
70
|
+
Dependency lookup is usually the best default because it keeps the code concise and follows the module resource facade.
|
|
71
|
+
|
|
72
|
+
### Within the current module
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
class ControllerStudent {
|
|
76
|
+
findOne() {
|
|
77
|
+
return this.scope.service.student.findOne();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Across modules
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
class ControllerStudent {
|
|
86
|
+
findOne() {
|
|
87
|
+
return this.$scope.demoStudent.service.student.findOne();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
A useful distinction is:
|
|
93
|
+
|
|
94
|
+
- `this.scope` means local module resources
|
|
95
|
+
- `this.$scope.<module>` means cross-module resources
|
|
96
|
+
|
|
97
|
+
That same access model also appears for model, entity, config, locale, and other scope resources.
|
|
98
|
+
|
|
99
|
+
## Direct bean access
|
|
100
|
+
|
|
101
|
+
Direct bean access patterns are also available.
|
|
102
|
+
|
|
103
|
+
### Global container access: `_getBean`
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
const serviceStudent = this.bean._getBean('demo-student.service.student');
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Request-scoped access
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
const serviceStudent = this.ctx.bean._getBean('demo-student.service.student');
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Fresh bean creation: `_newBean`
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
const serviceStudent = this.bean._newBean('demo-student.service.student');
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
A practical split is:
|
|
122
|
+
|
|
123
|
+
- `this.bean._getBean(...)` reaches the app-level container more explicitly
|
|
124
|
+
- `this.ctx.bean._getBean(...)` uses request-scoped access
|
|
125
|
+
- `this.bean._newBean(...)` creates a fresh bean instance when the workflow should not reuse the ordinary resolved bean
|
|
126
|
+
|
|
127
|
+
A practical “when to use which” rule is:
|
|
128
|
+
|
|
129
|
+
- use `this.scope.service.student` when the dependency belongs to the current module and ordinary business code is enough
|
|
130
|
+
- use `this.$scope.demoStudent.service.student` when the dependency clearly belongs to another module
|
|
131
|
+
- use `this.bean._getBean(...)` when you need explicit app-container access by bean identifier
|
|
132
|
+
- use `this.ctx.bean._getBean(...)` when the workflow should resolve through request-scoped access
|
|
133
|
+
- use `this.bean._newBean(...)` when you need a fresh bean instance instead of the ordinary resolved one
|
|
134
|
+
|
|
135
|
+
## Relationship to scope and bean scenes
|
|
136
|
+
|
|
137
|
+
Services are one bean scene inside the larger backend essentials model.
|
|
138
|
+
|
|
139
|
+
That means service access should be understood together with:
|
|
140
|
+
|
|
141
|
+
- bean identifiers such as `demo-student.service.student`
|
|
142
|
+
- local module scope vs cross-module scope
|
|
143
|
+
- other scope resource categories such as model and entity
|
|
144
|
+
|
|
145
|
+
For deciding whether a backend base class should stay a helper, move into service-scene, or remain part of the global bean shorthand surface, also see [Class Placement Rule](/ai/class-placement-rule).
|
|
146
|
+
|
|
147
|
+
Read this guide together with:
|
|
148
|
+
|
|
149
|
+
- [Backend Foundation](/backend/foundation)
|
|
150
|
+
- [Backend Essentials](/backend/backend-essentials)
|
|
151
|
+
- [Model Guide](/backend/model-guide)
|
|
152
|
+
- [Entity Guide](/backend/entity-guide)
|
|
153
|
+
- [Backend Startup Guide](/backend/startup-guide)
|
|
154
|
+
|
|
155
|
+
## Practical implications for service-layer implementation
|
|
156
|
+
|
|
157
|
+
When creating business logic in Vona, avoid flattening everything into controllers.
|
|
158
|
+
|
|
159
|
+
A better default is:
|
|
160
|
+
|
|
161
|
+
1. use the CLI to create the service shell
|
|
162
|
+
2. keep controllers thin
|
|
163
|
+
3. place business-oriented orchestration into services
|
|
164
|
+
4. choose deliberately among local scope, cross-module scope, injection, and direct bean access
|
|
165
|
+
|
|
166
|
+
That keeps backend access patterns aligned with Vona’s actual architecture instead of using one access style everywhere by habit.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Sharding Guide
|
|
2
|
+
|
|
3
|
+
This guide points from the backend docs to the deeper Cabloy sharding architecture.
|
|
4
|
+
|
|
5
|
+
## Current source of truth
|
|
6
|
+
|
|
7
|
+
The older ORM page for sharding is intentionally thin because the actual sharding capability is provided by the `a-cabloy` suite.
|
|
8
|
+
|
|
9
|
+
In the new docs structure, treat sharding as a Cabloy-level capability that affects backend data architecture.
|
|
10
|
+
|
|
11
|
+
## Why this matters
|
|
12
|
+
|
|
13
|
+
Sharding is not a local model trick. It changes how data distribution, query behavior, transaction expectations, and system-scale architecture are designed.
|
|
14
|
+
|
|
15
|
+
That means it belongs in the broader Cabloy knowledge graph, even when ORM-facing examples reference it.
|
|
16
|
+
|
|
17
|
+
## When sharding is the right mental model
|
|
18
|
+
|
|
19
|
+
A useful distinction is:
|
|
20
|
+
|
|
21
|
+
- ordinary multi-datasource routing chooses among existing datasources
|
|
22
|
+
- dynamic datasource chooses a datasource based on runtime context
|
|
23
|
+
- sharding changes how data itself is partitioned across the system
|
|
24
|
+
|
|
25
|
+
This matters because not every scaling problem should immediately be treated as sharding.
|
|
26
|
+
|
|
27
|
+
## Relationship to the broader ORM family
|
|
28
|
+
|
|
29
|
+
Read this guide together with:
|
|
30
|
+
|
|
31
|
+
- [ORM Guide](/backend/orm-guide)
|
|
32
|
+
- [Multi-Database and Datasource Guide](/backend/multi-database-datasource)
|
|
33
|
+
- [Dynamic Datasource Guide](/backend/dynamic-datasource-guide)
|
|
34
|
+
- [Transaction Guide](/backend/transaction-guide)
|
|
35
|
+
- [Cache Guide](/backend/cache-guide)
|
|
36
|
+
|
|
37
|
+
## Guidance for contributors and AI workflows
|
|
38
|
+
|
|
39
|
+
When a task mentions sharding, do not assume ordinary single-database model rules are sufficient.
|
|
40
|
+
|
|
41
|
+
Instead:
|
|
42
|
+
|
|
43
|
+
1. identify whether the work belongs to core Vona model design or Cabloy sharding infrastructure
|
|
44
|
+
2. inspect the Cabloy-level sharding guidance and source implementation
|
|
45
|
+
3. verify whether related concerns such as cache, transactions, relations, and DTO inference still behave correctly under the sharded design
|
|
46
|
+
|
|
47
|
+
## Documentation placement rule
|
|
48
|
+
|
|
49
|
+
Keep this page as the backend-facing pointer, but treat the Cabloy-level sharding material as the deeper source of truth.
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
# Backend Startup Guide
|
|
2
|
+
|
|
3
|
+
## Why backend startup matters
|
|
4
|
+
|
|
5
|
+
Vona treats startup as a first-class backend runtime capability rather than as ad hoc boot code scattered across modules.
|
|
6
|
+
|
|
7
|
+
That matters because distributed backend systems need a predictable way to run initialization logic:
|
|
8
|
+
|
|
9
|
+
- once for the whole application
|
|
10
|
+
- once for each initialized instance
|
|
11
|
+
- before or after the main runtime becomes ready
|
|
12
|
+
- with explicit ordering and environment scoping
|
|
13
|
+
|
|
14
|
+
## Startup is part of a larger lifecycle
|
|
15
|
+
|
|
16
|
+
In the current Vona runtime, backend startup sits inside a broader application lifecycle.
|
|
17
|
+
|
|
18
|
+
A practical sequence is:
|
|
19
|
+
|
|
20
|
+
1. app config is loaded and merged
|
|
21
|
+
2. modules are loaded
|
|
22
|
+
3. `appStart` hooks run
|
|
23
|
+
4. `appReady` hooks run
|
|
24
|
+
5. `appStarted` hooks run
|
|
25
|
+
6. shutdown hooks such as `appClose` and `appClosed` are available for teardown-sensitive logic
|
|
26
|
+
|
|
27
|
+
This is important because startup beans are not the only lifecycle surface in the backend.
|
|
28
|
+
|
|
29
|
+
## Two startup types
|
|
30
|
+
|
|
31
|
+
Vona supports two startup types:
|
|
32
|
+
|
|
33
|
+
- **app startup**
|
|
34
|
+
- **instance startup**
|
|
35
|
+
|
|
36
|
+
A useful mental model is:
|
|
37
|
+
|
|
38
|
+
- app startup runs for backend-wide runtime initialization
|
|
39
|
+
- instance startup runs for per-instance initialization in multi-instance or multi-tenant scenarios
|
|
40
|
+
|
|
41
|
+
This is one of the reasons backend startup belongs in the backend docs, not in the frontend app/system startup guides.
|
|
42
|
+
|
|
43
|
+
## Create a startup bean
|
|
44
|
+
|
|
45
|
+
Example: create a startup named `log` in module `demo-student`.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm run vona :create:bean startup log -- --module=demo-student
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Representative shape:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
@Startup()
|
|
55
|
+
export class StartupLog extends BeanBase implements IStartupExecute {
|
|
56
|
+
async execute() {
|
|
57
|
+
console.log('Current time: ', Date.now());
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The `execute()` method contains the initialization logic for that startup bean.
|
|
63
|
+
|
|
64
|
+
## Startup options
|
|
65
|
+
|
|
66
|
+
Representative pattern:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
@Startup({
|
|
70
|
+
instance: false,
|
|
71
|
+
after: false,
|
|
72
|
+
debounce: true,
|
|
73
|
+
transaction: false,
|
|
74
|
+
})
|
|
75
|
+
export class StartupLog {}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The most important options are:
|
|
79
|
+
|
|
80
|
+
- `instance`
|
|
81
|
+
- `after`
|
|
82
|
+
- `debounce`
|
|
83
|
+
- `transaction`
|
|
84
|
+
|
|
85
|
+
A practical interpretation is:
|
|
86
|
+
|
|
87
|
+
- `instance: false` means app-startup behavior
|
|
88
|
+
- `instance: true` means instance-startup behavior
|
|
89
|
+
- `after: false` runs before the relevant ready phase
|
|
90
|
+
- `after: true` runs after the relevant ready phase
|
|
91
|
+
- `debounce` prevents repeated startup execution when the runtime churns
|
|
92
|
+
- `transaction` wraps the startup logic in a database transaction when needed
|
|
93
|
+
|
|
94
|
+
## Configure startups in app config
|
|
95
|
+
|
|
96
|
+
Startup options can also be overridden through app config.
|
|
97
|
+
|
|
98
|
+
In the backend essentials model, startup is one bean scene, so startup configuration also follows the broader bean/onion naming and override conventions used across backend infrastructure.
|
|
99
|
+
|
|
100
|
+
Representative pattern:
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
config.onions = {
|
|
104
|
+
startup: {
|
|
105
|
+
'demo-student:log': {
|
|
106
|
+
after: false,
|
|
107
|
+
debounce: true,
|
|
108
|
+
instance: false,
|
|
109
|
+
transaction: false,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
That keeps startup policy configurable at deployment or project level rather than frozen only in decorator defaults.
|
|
116
|
+
|
|
117
|
+
## Control startup order
|
|
118
|
+
|
|
119
|
+
Startup ordering matters because backend initialization often depends on other runtime capabilities.
|
|
120
|
+
|
|
121
|
+
Two important ordering tools are:
|
|
122
|
+
|
|
123
|
+
- `dependencies`
|
|
124
|
+
- `dependents`
|
|
125
|
+
|
|
126
|
+
Representative patterns:
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
@Startup({
|
|
130
|
+
dependencies: 'a-web:listen',
|
|
131
|
+
})
|
|
132
|
+
class StartupLog {}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
@Startup({
|
|
137
|
+
dependents: 'a-web:listen',
|
|
138
|
+
})
|
|
139
|
+
class StartupLog {}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Use `dependencies` when the current startup must run after another startup. Use `dependents` when the current startup must run before another startup.
|
|
143
|
+
|
|
144
|
+
## Enable or scope a startup
|
|
145
|
+
|
|
146
|
+
App config can disable a startup explicitly:
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
config.onions = {
|
|
150
|
+
startup: {
|
|
151
|
+
'demo-student:log': {
|
|
152
|
+
enable: false,
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Startup decorators can also scope behavior by runtime metadata:
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
@Startup({
|
|
162
|
+
meta: {
|
|
163
|
+
flavor: 'normal',
|
|
164
|
+
mode: 'dev',
|
|
165
|
+
},
|
|
166
|
+
})
|
|
167
|
+
class StartupLog {}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
This matters because backend initialization often differs by environment, flavor, CI workflow, Docker workflow, or tenant-sensitive deployment mode.
|
|
171
|
+
|
|
172
|
+
For the underlying runtime dimensions, also see [Runtime and Flavors](/backend/runtime-and-flavors).
|
|
173
|
+
|
|
174
|
+
## Main hooks, monkey hooks, and startup beans are different surfaces
|
|
175
|
+
|
|
176
|
+
One of the most important lifecycle distinctions in the current Vona backend is that there are several different hook surfaces.
|
|
177
|
+
|
|
178
|
+
### Module main hooks
|
|
179
|
+
|
|
180
|
+
A module main can participate in module-level lifecycle hooks such as:
|
|
181
|
+
|
|
182
|
+
- `moduleLoading`
|
|
183
|
+
- `configLoaded`
|
|
184
|
+
- `moduleLoaded`
|
|
185
|
+
|
|
186
|
+
These are the right tools when a module needs to customize its own loading or config-processing behavior.
|
|
187
|
+
|
|
188
|
+
### Monkey hooks
|
|
189
|
+
|
|
190
|
+
Monkey hooks can participate in broader system lifecycle stages such as:
|
|
191
|
+
|
|
192
|
+
- `appStart`
|
|
193
|
+
- `appReady`
|
|
194
|
+
- `appStarted`
|
|
195
|
+
- `appClose`
|
|
196
|
+
- `appClosed`
|
|
197
|
+
|
|
198
|
+
Module monkey files can also receive module-oriented hook callbacks, and the app-level monkey file can coordinate app-wide lifecycle behavior.
|
|
199
|
+
|
|
200
|
+
Representative CLI workflow:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
npm run vona :init:monkey demo-student
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Startup beans
|
|
207
|
+
|
|
208
|
+
Startup beans are the preferred lifecycle surface when the real goal is to run backend initialization work as part of the startup onion with ordering, metadata gating, transaction, and debounce support.
|
|
209
|
+
|
|
210
|
+
A practical rule is:
|
|
211
|
+
|
|
212
|
+
- use **main hooks** for module bootstrap customization
|
|
213
|
+
- use **monkey hooks** for deeper lifecycle interception
|
|
214
|
+
- use **startup beans** for normal backend initialization logic that should participate in startup ordering and runtime policy
|
|
215
|
+
|
|
216
|
+
## Hook surface matrix
|
|
217
|
+
|
|
218
|
+
| Surface | Best for | Ordering / policy support | Teardown fit |
|
|
219
|
+
| ---------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------ | -------------------------------------------------- |
|
|
220
|
+
| Startup bean | normal backend initialization work | strong support through `dependencies`, `dependents`, `meta`, `debounce`, and `transaction` | not the main teardown surface |
|
|
221
|
+
| Module main hook | module bootstrap customization | tied to module load phases | usually not the main teardown surface |
|
|
222
|
+
| Monkey hook | deeper lifecycle interception across app phases | follows lifecycle stage rather than startup-onion ordering | strongest fit for `appClose` / `appClosed` cleanup |
|
|
223
|
+
|
|
224
|
+
This matrix is useful because the same backend task can look like “startup code” while actually belonging to different lifecycle surfaces.
|
|
225
|
+
|
|
226
|
+
## App startup and instance startup in practice
|
|
227
|
+
|
|
228
|
+
In the current runtime behavior:
|
|
229
|
+
|
|
230
|
+
- non-instance startups run during app startup / app ready phases according to `after`
|
|
231
|
+
- instance startups run when the app is ready for instances
|
|
232
|
+
- in `test` and `dev`, the default instance is started eagerly
|
|
233
|
+
- in production-style flows, configured static instances are started from `config.instance.instances`
|
|
234
|
+
|
|
235
|
+
A practical timeline is:
|
|
236
|
+
|
|
237
|
+
1. run non-instance startups with `after !== true` during app start
|
|
238
|
+
2. run non-instance startups with `after === true` during app ready
|
|
239
|
+
3. trigger instance startup for the relevant instance
|
|
240
|
+
4. run instance startups with `after !== true`
|
|
241
|
+
5. mark `appReadyInstances[instanceName] = true`
|
|
242
|
+
6. run instance startups with `after === true`
|
|
243
|
+
|
|
244
|
+
This is why startup should be read together with the instance and datasource story rather than as a purely global boot topic.
|
|
245
|
+
|
|
246
|
+
## Teardown-oriented monkey examples
|
|
247
|
+
|
|
248
|
+
Lifecycle hooks also matter when the backend is shutting down.
|
|
249
|
+
|
|
250
|
+
Representative current-runtime examples include:
|
|
251
|
+
|
|
252
|
+
- queue uses `appClose` to clear workers and `appClosed` to clear queues
|
|
253
|
+
- broadcast uses `appClose` to dispose the subscriber side and `appClosed` to dispose the publisher side
|
|
254
|
+
- SSR uses `appClose` to remove recorded SSR bean instances from the container
|
|
255
|
+
|
|
256
|
+
These are good examples of when shutdown-sensitive logic belongs to monkey hooks rather than startup beans.
|
|
257
|
+
|
|
258
|
+
## Inspect the effective startup list
|
|
259
|
+
|
|
260
|
+
You can inspect the currently effective startup list:
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
this.bean.onion.startup.inspect();
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
This is useful when you need to debug which startup beans are active after config overrides, metadata filters, and ordering rules are applied.
|
|
267
|
+
|
|
268
|
+
## Built-in startup roles
|
|
269
|
+
|
|
270
|
+
Some built-in startup behaviors are especially important to understand.
|
|
271
|
+
|
|
272
|
+
### App-startup examples
|
|
273
|
+
|
|
274
|
+
Representative built-in app startup roles include:
|
|
275
|
+
|
|
276
|
+
- `a-version:databaseInit`
|
|
277
|
+
- `a-version:databaseName`
|
|
278
|
+
- `a-web:listen`
|
|
279
|
+
|
|
280
|
+
These show that startup is not only for custom business hooks. It is also part of the framework’s core runtime bootstrap.
|
|
281
|
+
|
|
282
|
+
### Instance-startup examples
|
|
283
|
+
|
|
284
|
+
Representative built-in instance startup roles include:
|
|
285
|
+
|
|
286
|
+
- `a-version:instanceInit`
|
|
287
|
+
- `a-printtip:printTip`
|
|
288
|
+
- `a-queue:loadQueueWorkers`
|
|
289
|
+
- `a-schedule:loadSchedules`
|
|
290
|
+
|
|
291
|
+
This is the key architectural point: startup is the lifecycle layer that activates other distributed capabilities such as queues and schedules.
|
|
292
|
+
|
|
293
|
+
## Relationship to config, instance, and datasource behavior
|
|
294
|
+
|
|
295
|
+
Startup should be read together with:
|
|
296
|
+
|
|
297
|
+
- [Config Guide](/backend/config-guide)
|
|
298
|
+
- [Runtime and Flavors](/backend/runtime-and-flavors)
|
|
299
|
+
- [Model Guide](/backend/model-guide)
|
|
300
|
+
- [Multi-Database and Datasource Guide](/backend/multi-database-datasource)
|
|
301
|
+
- [Election Guide](/backend/election-guide)
|
|
302
|
+
- [Queue Guide](/backend/queue-guide)
|
|
303
|
+
- [Schedule Guide](/backend/schedule-guide)
|
|
304
|
+
- [Worker Guide](/backend/worker-guide)
|
|
305
|
+
- [Broadcast Guide](/backend/broadcast-guide)
|
|
306
|
+
|
|
307
|
+
A practical split is:
|
|
308
|
+
|
|
309
|
+
- startup decides _when backend capabilities are initialized_
|
|
310
|
+
- config decides _which startup behavior is enabled or overridden_
|
|
311
|
+
- instance config decides _which instance-specific startup flows exist_
|
|
312
|
+
- datasource behavior decides _which database context those startup flows run against_
|
|
313
|
+
|
|
314
|
+
For a practical distributed-runtime reading path, move from [Runtime and Flavors](/backend/runtime-and-flavors) and [Config Guide](/backend/config-guide) into this page, then continue to [Worker Guide](/backend/worker-guide), [Election Guide](/backend/election-guide), [Queue Guide](/backend/queue-guide), and [Schedule Guide](/backend/schedule-guide).
|
|
315
|
+
|
|
316
|
+
## Implementation checks for startup-sensitive changes
|
|
317
|
+
|
|
318
|
+
When changing backend startup-sensitive code, ask:
|
|
319
|
+
|
|
320
|
+
1. is this initialization logic app-wide or instance-specific?
|
|
321
|
+
2. should this be a startup bean, a module main hook, or a monkey hook?
|
|
322
|
+
3. does the logic need to run before or after the ready phase?
|
|
323
|
+
4. should ordering be expressed through `dependencies` or `dependents`?
|
|
324
|
+
5. should the startup be gated by `mode`, `flavor`, instance config, or app-config overrides?
|
|
325
|
+
|
|
326
|
+
That helps AI keep backend initialization aligned with Vona’s current runtime lifecycle rather than scattering boot logic across unrelated files.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Transaction Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how Vona transactions work in the Cabloy monorepo.
|
|
4
|
+
|
|
5
|
+
## Why transactions matter in Vona
|
|
6
|
+
|
|
7
|
+
Vona treats transactions as a framework-level capability, not just as a raw database primitive.
|
|
8
|
+
|
|
9
|
+
Four especially important areas define the transaction model:
|
|
10
|
+
|
|
11
|
+
- decorator-based transaction entry
|
|
12
|
+
- transaction propagation
|
|
13
|
+
- compensation behavior
|
|
14
|
+
- database and cache consistency
|
|
15
|
+
|
|
16
|
+
That is a stronger model than “open transaction, do SQL, commit or rollback.”
|
|
17
|
+
|
|
18
|
+
## Decorator-based transactions
|
|
19
|
+
|
|
20
|
+
Representative pattern:
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
@Core.transaction()
|
|
24
|
+
async transaction() {
|
|
25
|
+
const post = await this.scope.model.post.insert({ title: 'Post001' });
|
|
26
|
+
await this.scope.model.post.update({ id: post.id, title: 'Post001-Update' });
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This matters because it makes transaction behavior explicit at the business-method level.
|
|
31
|
+
|
|
32
|
+
## Manual transactions
|
|
33
|
+
|
|
34
|
+
Vona also supports manual transaction control using either:
|
|
35
|
+
|
|
36
|
+
- the current datasource
|
|
37
|
+
- a specified datasource
|
|
38
|
+
|
|
39
|
+
That matters for advanced scenarios where the caller needs tighter control over which database handle is active.
|
|
40
|
+
|
|
41
|
+
## Isolation level and propagation
|
|
42
|
+
|
|
43
|
+
Vona supports transaction parameters such as:
|
|
44
|
+
|
|
45
|
+
- `isolationLevel`
|
|
46
|
+
- `propagation`
|
|
47
|
+
|
|
48
|
+
The propagation model includes levels like:
|
|
49
|
+
|
|
50
|
+
- `REQUIRED`
|
|
51
|
+
- `SUPPORTS`
|
|
52
|
+
- `MANDATORY`
|
|
53
|
+
- `REQUIRES_NEW`
|
|
54
|
+
- `NOT_SUPPORTED`
|
|
55
|
+
- `NEVER`
|
|
56
|
+
|
|
57
|
+
This is important because multi-layer business logic often depends on how nested calls interact with an outer transaction.
|
|
58
|
+
|
|
59
|
+
## Compensation hooks
|
|
60
|
+
|
|
61
|
+
Vona also provides success and failure compensation hooks.
|
|
62
|
+
|
|
63
|
+
That means Vona transactions can coordinate follow-up behavior explicitly, not only database commit/rollback.
|
|
64
|
+
|
|
65
|
+
## Transaction and cache consistency
|
|
66
|
+
|
|
67
|
+
One of the most important Vona ideas is that transaction behavior is adapted to the cache system.
|
|
68
|
+
|
|
69
|
+
That means if the transaction fails, cache compensation can run so database and cache state remain consistent.
|
|
70
|
+
|
|
71
|
+
This is a major part of Vona’s large-system story.
|
|
72
|
+
|
|
73
|
+
## Implementation checks for transactional write changes
|
|
74
|
+
|
|
75
|
+
When changing write-path business logic, ask:
|
|
76
|
+
|
|
77
|
+
1. should this operation be transactional?
|
|
78
|
+
2. does propagation behavior matter because the method is called from other transactional methods?
|
|
79
|
+
3. does cache behavior need the transaction-aware path?
|
|
80
|
+
4. is the operation bound to the current datasource or a specified datasource?
|
|
81
|
+
|
|
82
|
+
That helps AI-generated backend code remain correct under real business complexity.
|