cabloy 5.1.60 → 5.1.62
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/hooks/contract-loop-gate.ts +296 -0
- package/.claude/settings.json +16 -0
- package/.claude/skills/cabloy-backend-scaffold/SKILL.md +2 -0
- package/.claude/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +1 -0
- package/.claude/skills/cabloy-contract-loop/SKILL.md +89 -16
- package/.claude/skills/cabloy-contract-loop/references/contract-loop-map.md +102 -14
- package/.claude/skills/cabloy-contract-loop/references/resource-custom-state-pattern.md +4 -0
- package/.claude/skills/cabloy-contract-loop/references/verification-checklist.md +32 -14
- package/.claude/skills/cabloy-domain-planning/SKILL.md +212 -0
- package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +13 -0
- package/.claude/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md +2 -0
- package/.claude/skills/cabloy-module-removal/SKILL.md +144 -0
- package/.claude/skills/cabloy-resource-field-update/SKILL.md +7 -0
- package/.claude/skills/cabloy-zova-source-reading/SKILL.md +221 -0
- package/.claude/skills/cabloy-zova-source-reading/references/analysis-modes.md +91 -0
- package/.claude/skills/cabloy-zova-source-reading/references/core-reading-paths.md +117 -0
- package/CHANGELOG.md +64 -0
- package/CLAUDE.md +11 -0
- package/cabloy-docs/.vitepress/config.mjs +197 -5
- package/cabloy-docs/ai/cli-to-skill-map.md +7 -0
- package/cabloy-docs/ai/docs-skills-rules-mapping.md +22 -0
- package/cabloy-docs/ai/future-skill-roadmap.md +12 -7
- package/cabloy-docs/ai/introduction.md +1 -0
- package/cabloy-docs/ai/playbook-backend-module.md +6 -0
- package/cabloy-docs/ai/playbook-module-removal.md +164 -0
- package/cabloy-docs/ai/skills.md +12 -0
- package/cabloy-docs/backend/backend-contract-emission-output-inspection.md +189 -0
- package/cabloy-docs/backend/backend-contract-emission-source-reading-map.md +160 -0
- package/cabloy-docs/backend/backend-contract-emission-specimen.md +170 -0
- package/cabloy-docs/backend/backend-resource-module-contract-chain.md +323 -0
- package/cabloy-docs/backend/backend-source-reading-debug-checklist.md +173 -0
- package/cabloy-docs/backend/backend-source-reading-roadmap.md +129 -0
- package/cabloy-docs/backend/backend-source-reading-verify-playbook.md +166 -0
- package/cabloy-docs/backend/bean-scene-authoring.md +4 -4
- package/cabloy-docs/backend/broadcast-guide.md +3 -3
- package/cabloy-docs/backend/cli.md +20 -11
- package/cabloy-docs/backend/config-guide.md +4 -4
- package/cabloy-docs/backend/controller-aop-guide.md +10 -10
- package/cabloy-docs/backend/controller-guide.md +12 -2
- package/cabloy-docs/backend/crud-workflow.md +7 -3
- package/cabloy-docs/backend/dto-guide.md +18 -2
- package/cabloy-docs/backend/dto-infer-generation.md +201 -25
- package/cabloy-docs/backend/election-guide.md +2 -2
- package/cabloy-docs/backend/entity-guide.md +30 -3
- package/cabloy-docs/backend/error-guide.md +3 -3
- package/cabloy-docs/backend/event-guide.md +4 -4
- package/cabloy-docs/backend/external-aop-guide.md +2 -2
- package/cabloy-docs/backend/field-indexes.md +9 -3
- package/cabloy-docs/backend/foundation.md +8 -8
- package/cabloy-docs/backend/i18n-guide.md +6 -6
- package/cabloy-docs/backend/internal-aop-guide.md +2 -2
- package/cabloy-docs/backend/introduction.md +15 -0
- package/cabloy-docs/backend/migration-and-changes.md +3 -3
- package/cabloy-docs/backend/model-guide.md +16 -6
- package/cabloy-docs/backend/openapi-guide.md +3 -0
- package/cabloy-docs/backend/queue-guide.md +3 -3
- package/cabloy-docs/backend/redlock-guide.md +2 -2
- package/cabloy-docs/backend/schedule-guide.md +2 -2
- package/cabloy-docs/backend/scripts.md +8 -0
- package/cabloy-docs/backend/serialization-guide.md +12 -2
- package/cabloy-docs/backend/service-guide.md +18 -9
- package/cabloy-docs/backend/startup-guide.md +5 -5
- package/cabloy-docs/backend/status-guide.md +271 -0
- package/cabloy-docs/backend/unit-testing.md +3 -3
- package/cabloy-docs/backend/vona-source-reading-map.md +157 -0
- package/cabloy-docs/backend/websocket-protocol-guide.md +5 -5
- package/cabloy-docs/backend/websocket-usage-guide.md +15 -8
- package/cabloy-docs/frontend/a-model-under-the-hood.md +281 -0
- package/cabloy-docs/frontend/a-openapi-under-the-hood.md +248 -0
- package/cabloy-docs/frontend/a-router-guide.md +307 -0
- package/cabloy-docs/frontend/api-guide.md +6 -4
- package/cabloy-docs/frontend/api-schema-guide.md +1 -0
- package/cabloy-docs/frontend/app-startup-guide.md +7 -4
- package/cabloy-docs/frontend/bean-scene-authoring.md +3 -1
- package/cabloy-docs/frontend/behavior-guide.md +16 -16
- package/cabloy-docs/frontend/cli.md +14 -2
- package/cabloy-docs/frontend/command-scene-authoring.md +504 -0
- package/cabloy-docs/frontend/component-guide.md +5 -5
- package/cabloy-docs/frontend/component-props-guide.md +1 -1
- package/cabloy-docs/frontend/component-v-model-guide.md +2 -2
- package/cabloy-docs/frontend/design-principles.md +6 -0
- package/cabloy-docs/frontend/fetch-interceptor-guide.md +440 -0
- package/cabloy-docs/frontend/filter-query-select-data-flow-guide.md +260 -0
- package/cabloy-docs/frontend/form-guide.md +786 -0
- package/cabloy-docs/frontend/form-scene-to-page-meta-guide.md +303 -0
- package/cabloy-docs/frontend/foundation.md +33 -0
- package/cabloy-docs/frontend/frontend-source-reading-roadmap.md +249 -0
- package/cabloy-docs/frontend/generated-contract-consumption-debug-checklist.md +190 -0
- package/cabloy-docs/frontend/generated-contract-consumption-entry-branch.md +205 -0
- package/cabloy-docs/frontend/generated-contract-consumption-list-branch.md +157 -0
- package/cabloy-docs/frontend/generated-contract-consumption-specimen.md +203 -0
- package/cabloy-docs/frontend/generated-contract-consumption-verify-playbook.md +189 -0
- package/cabloy-docs/frontend/generic-component-guide.md +1 -1
- package/cabloy-docs/frontend/introduction.md +38 -5
- package/cabloy-docs/frontend/ioc-and-beans.md +6 -0
- package/cabloy-docs/frontend/mock-guide.md +1 -0
- package/cabloy-docs/frontend/model-architecture.md +288 -39
- package/cabloy-docs/frontend/model-resource-best-practices.md +379 -0
- package/cabloy-docs/frontend/model-resource-cookbook.md +508 -0
- package/cabloy-docs/frontend/model-resource-internals-deep-dive.md +238 -0
- package/cabloy-docs/frontend/model-resource-owner-pattern.md +402 -0
- package/cabloy-docs/frontend/model-resource-usage-guide.md +334 -0
- package/cabloy-docs/frontend/model-state-guide.md +371 -15
- package/cabloy-docs/frontend/module-scope.md +8 -8
- package/cabloy-docs/frontend/modules-and-suites.md +2 -1
- package/cabloy-docs/frontend/navigation-guards-guide.md +7 -0
- package/cabloy-docs/frontend/openapi-sdk-guide.md +17 -6
- package/cabloy-docs/frontend/page-guide.md +15 -9
- package/cabloy-docs/frontend/page-meta-guide.md +466 -0
- package/cabloy-docs/frontend/page-params-guide.md +3 -3
- package/cabloy-docs/frontend/page-query-guide.md +2 -2
- package/cabloy-docs/frontend/page-route-guide.md +6 -0
- package/cabloy-docs/frontend/permission-formscene-action-visibility-guide.md +263 -0
- package/cabloy-docs/frontend/quickstart.md +18 -2
- package/cabloy-docs/frontend/reading-zova-for-vue-developers.md +266 -0
- package/cabloy-docs/frontend/resource-entry-page-deep-dive.md +271 -0
- package/cabloy-docs/frontend/resource-list-page-deep-dive.md +279 -0
- package/cabloy-docs/frontend/rest-resource-source-reading-map.md +522 -0
- package/cabloy-docs/frontend/rest-resource-under-the-hood.md +622 -0
- package/cabloy-docs/frontend/root-behaviors-guide.md +282 -0
- package/cabloy-docs/frontend/route-alias-guide.md +6 -0
- package/cabloy-docs/frontend/router-stack-guide.md +229 -0
- package/cabloy-docs/frontend/router-tabs-introduction.md +26 -3
- package/cabloy-docs/frontend/router-tabs-layout-integration.md +367 -0
- package/cabloy-docs/frontend/router-tabs-mechanism.md +6 -0
- package/cabloy-docs/frontend/router-tabs-route-meta-cookbook.md +7 -0
- package/cabloy-docs/frontend/router-tabs-vs-stack.md +167 -0
- package/cabloy-docs/frontend/router-view-hosts-guide.md +450 -0
- package/cabloy-docs/frontend/server-data.md +4 -1
- package/cabloy-docs/frontend/system-startup-guide.md +2 -2
- package/cabloy-docs/frontend/table-action-visibility-permission-flow-guide.md +263 -0
- package/cabloy-docs/frontend/table-cell-cookbook.md +568 -0
- package/cabloy-docs/frontend/table-guide.md +373 -0
- package/cabloy-docs/frontend/table-resource-crud-cookbook.md +496 -0
- package/cabloy-docs/frontend/zova-app-guide.md +251 -0
- package/cabloy-docs/frontend/zova-form-source-reading-map.md +293 -0
- package/cabloy-docs/frontend/zova-form-under-the-hood.md +561 -0
- package/cabloy-docs/frontend/zova-reactivity-under-the-hood.md +320 -0
- package/cabloy-docs/frontend/zova-router-under-the-hood.md +561 -0
- package/cabloy-docs/frontend/zova-source-reading-map.md +421 -0
- package/cabloy-docs/frontend/zova-table-controller-render-supplement.md +225 -0
- package/cabloy-docs/frontend/zova-table-source-reading-map.md +317 -0
- package/cabloy-docs/frontend/zova-table-under-the-hood.md +532 -0
- package/cabloy-docs/frontend/zova-vs-vue3-comparison.md +308 -0
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-debug-checklist.md +245 -0
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-source-reading-map.md +139 -0
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-verify-playbook.md +248 -0
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions.md +511 -0
- package/cabloy-docs/fullstack/contract-loop-playbook.md +356 -0
- package/cabloy-docs/fullstack/edition-collaboration-differences.md +6 -0
- package/cabloy-docs/fullstack/frontend-metadata-to-backend.md +199 -23
- package/cabloy-docs/fullstack/introduction.md +15 -1
- package/cabloy-docs/fullstack/openapi-to-sdk.md +135 -11
- package/cabloy-docs/fullstack/suites-and-modules.md +333 -0
- package/cabloy-docs/fullstack/tutorial-1-first-module.md +3 -0
- package/cabloy-docs/fullstack/tutorial-2-first-crud.md +4 -0
- package/cabloy-docs/fullstack/tutorial-3-frontend-metadata-sharing.md +6 -2
- package/cabloy-docs/fullstack/tutorial-4-custom-level-renderers.md +60 -23
- package/cabloy-docs/fullstack/tutorial-5-backend-contract-sharing.md +14 -7
- package/cabloy-docs/fullstack/tutorial-6-one-contract-four-uses.md +6 -0
- package/cabloy-docs/fullstack/tutorials-overview.md +17 -4
- package/cabloy-docs/reference/bean-scene-boilerplates.md +15 -13
- package/cabloy-docs/reference/package-map.md +4 -3
- package/package.json +2 -1
- package/scripts/init.ts +2 -18
- package/scripts/initTestData.ts +25 -0
- package/scripts/upgrade.ts +17 -2
- package/vona/pnpm-lock.yaml +48 -194
- package/vona/src/suite/a-training/modules/training-student/package.json +53 -0
- package/vona/src/suite/a-training/modules/training-student/src/.metadata/index.ts +400 -0
- package/vona/src/suite/a-training/modules/training-student/src/.metadata/locales.ts +18 -0
- package/vona/src/suite/a-training/modules/training-student/src/.metadata/this.ts +2 -0
- package/vona/src/suite/a-training/modules/training-student/src/bean/meta.index.ts +12 -0
- package/vona/src/suite/a-training/modules/training-student/src/bean/meta.version.ts +21 -0
- package/vona/src/suite/a-training/modules/training-student/src/bean/ssrMenu.student.ts +29 -0
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +15 -0
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +15 -0
- package/vona/src/suite/a-training/modules/training-student/src/controller/student.ts +74 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentCreate.tsx +28 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectReq.tsx +44 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectRes.tsx +11 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectResItem.tsx +45 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSummary.tsx +42 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentUpdate.tsx +28 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentView.tsx +25 -0
- package/vona/src/suite/a-training/modules/training-student/src/entity/student.tsx +84 -0
- package/vona/src/suite/a-training/modules/training-student/src/index.ts +2 -0
- package/vona/src/suite/a-training/modules/training-student/src/model/student.ts +10 -0
- package/vona/src/suite/a-training/modules/training-student/src/service/student.ts +57 -0
- package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +173 -0
- package/vona/src/suite/a-training/modules/training-student/tsconfig.build.json +11 -0
- package/vona/src/suite/a-training/modules/training-student/tsconfig.json +7 -0
- package/vona/src/suite/a-training/package.json +12 -0
- package/vona/src/suite/a-training/tsconfig.base.json +4 -0
- package/vona/src/suite/a-training/tsconfig.json +10 -0
- package/zova/packages-cli/cli/package.json +2 -2
- package/zova/packages-cli/cli-set-front/cli/templates/openapi/config/boilerplate/module/openapi.config.ts +6 -1
- package/zova/packages-cli/cli-set-front/package.json +1 -1
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.generate.ts +34 -4
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +416 -690
- package/zova/src/suite/a-training/modules/training-student/cli/openapi.config.ts +9 -0
- package/zova/src/suite/a-training/modules/training-student/package.json +52 -0
- package/zova/src/suite/a-training/modules/training-student/src/.metadata/component/formFieldLevel.ts +31 -0
- package/zova/src/suite/a-training/modules/training-student/src/.metadata/index.ts +258 -0
- package/zova/src/suite/a-training/modules/training-student/src/.metadata/locales.ts +7 -0
- package/zova/src/suite/a-training/modules/training-student/src/.metadata/this.ts +2 -0
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/baseURL.ts +5 -0
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/index.ts +3 -0
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/schemas.ts +196 -0
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/types.ts +4146 -0
- package/zova/src/suite/a-training/modules/training-student/src/api/trainingStudent.ts +151 -0
- package/zova/src/suite/a-training/modules/training-student/src/apiSchema/trainingStudent.ts +43 -0
- package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionDeleteForce.tsx +51 -0
- package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionSummary.tsx +56 -0
- package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.level.tsx +63 -0
- package/zova/src/suite/a-training/modules/training-student/src/component/formFieldLevel/controller.tsx +117 -0
- package/zova/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +9 -0
- package/zova/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +9 -0
- package/zova/src/suite/a-training/modules/training-student/src/index.ts +2 -0
- package/zova/src/suite/a-training/modules/training-student/src/model/student.ts +42 -0
- package/zova/src/suite/a-training/modules/training-student/tsconfig.build.json +13 -0
- package/zova/src/suite/a-training/modules/training-student/tsconfig.json +5 -0
- package/zova/src/suite/a-training/package.json +12 -0
- package/zova/src/suite/a-training/tsconfig.base.json +4 -0
- package/zova/src/suite/a-training/tsconfig.json +4 -0
- package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/formFieldSelect/controller.tsx +29 -7
- package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/select/controller.tsx +34 -11
- package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-table/src/component/table/controller.tsx +3 -3
- package/zova/src/suite-vendor/a-zova/modules/a-table/src/lib/tableCell.ts +1 -1
- package/zova/src/suite-vendor/a-zova/package.json +2 -2
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# OpenAPI Runtime Under the Hood
|
|
2
|
+
|
|
3
|
+
This guide explains the lower-level runtime of `a-openapi` in Zova through the current public Cabloy Basic source.
|
|
4
|
+
|
|
5
|
+
Use this page when you want to understand:
|
|
6
|
+
|
|
7
|
+
- how `$sdk` becomes available on beans
|
|
8
|
+
- what `ModelSdk` and `SysSdk` each own
|
|
9
|
+
- how bootstrap and permissions loading work
|
|
10
|
+
- how request/query/filter/body/row/paged schema surfaces are derived
|
|
11
|
+
- why `a-openapi` is a lower-level shared runtime substrate for resource, model, and table consumers
|
|
12
|
+
|
|
13
|
+
## Why this page exists
|
|
14
|
+
|
|
15
|
+
Several existing docs already explain usage and positioning around the server-data ladder:
|
|
16
|
+
|
|
17
|
+
- [Server Data](/frontend/server-data)
|
|
18
|
+
- [SDK Guide](/frontend/sdk-guide)
|
|
19
|
+
- [OpenAPI SDK Guide](/frontend/openapi-sdk-guide)
|
|
20
|
+
- [API Schema Guide](/frontend/api-schema-guide)
|
|
21
|
+
|
|
22
|
+
What those pages do not isolate directly is the source-first runtime path inside `a-openapi` itself.
|
|
23
|
+
|
|
24
|
+
That is the gap this page fills.
|
|
25
|
+
|
|
26
|
+
## The shortest accurate mental model
|
|
27
|
+
|
|
28
|
+
A practical mental model is:
|
|
29
|
+
|
|
30
|
+
1. `a-openapi` injects `$sdk` onto beans through its module monkey
|
|
31
|
+
2. `$sdk` resolves a locale-scoped `ModelSdk`
|
|
32
|
+
3. `ModelSdk` exposes bootstrap, permissions, sdk, schema, Zod, and default-value helpers
|
|
33
|
+
4. `SysSdk` owns the lower cache/fetch layer for bootstrap/docs/schemas
|
|
34
|
+
5. `schema.ts` extracts request/query/filter/body/row/paged schema surfaces and applies scene-aware property selection
|
|
35
|
+
6. downstream resource/model/table consumers reuse those lower-level surfaces rather than rebuilding them independently
|
|
36
|
+
|
|
37
|
+
That means `a-openapi` is not only about generated SDK usage. It is also the lower-level schema/runtime bridge beneath the higher-level frontend runtime.
|
|
38
|
+
|
|
39
|
+
## Source-confirmed reading path
|
|
40
|
+
|
|
41
|
+
When reading this topic, use this order:
|
|
42
|
+
|
|
43
|
+
1. `zova/src/suite-vendor/a-zova/modules/a-openapi/src/monkey.ts`
|
|
44
|
+
2. `zova/src/suite-vendor/a-zova/modules/a-openapi/src/model/sdk.ts`
|
|
45
|
+
3. `zova/src/suite-vendor/a-zova/modules/a-openapi/src/bean/sys.sdk.ts`
|
|
46
|
+
4. `zova/src/suite-vendor/a-zova/modules/a-openapi/src/lib/schema.ts`
|
|
47
|
+
5. `zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/rest.ts`
|
|
48
|
+
6. optional supporting files:
|
|
49
|
+
- `zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/sdk.ts`
|
|
50
|
+
- `zova/src/suite-vendor/a-zova/modules/a-openapi/src/config/config.ts`
|
|
51
|
+
|
|
52
|
+
That order moves from bean-level injection, to the locale-scoped model surface, to the lower fetch/cache layer, to the schema extraction layer, and finally to the schema/type contract.
|
|
53
|
+
|
|
54
|
+
## `$sdk` injection and locale-scoped runtime
|
|
55
|
+
|
|
56
|
+
The injection layer lives in:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
zova/src/suite-vendor/a-zova/modules/a-openapi/src/monkey.ts
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The key source-confirmed behavior is:
|
|
63
|
+
|
|
64
|
+
- `beanInit(...)` defines `$sdk` on bean instances
|
|
65
|
+
- `$sdk` points to a ref-like current `ModelSdk`
|
|
66
|
+
- `moduleLoaded(...)` loads the SDK model for the current locale
|
|
67
|
+
- locale changes trigger `_loadSdk()` again
|
|
68
|
+
|
|
69
|
+
That means `$sdk` is not a static global object.
|
|
70
|
+
|
|
71
|
+
It is a runtime-injected, locale-scoped model surface.
|
|
72
|
+
|
|
73
|
+
## `ModelSdk` responsibilities
|
|
74
|
+
|
|
75
|
+
The selector-backed model lives in:
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
zova/src/suite-vendor/a-zova/modules/a-openapi/src/model/sdk.ts
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The current source confirms that `ModelSdk` is:
|
|
82
|
+
|
|
83
|
+
- `@Model({ enableSelector: true })`
|
|
84
|
+
- selector-backed by locale
|
|
85
|
+
- responsible for:
|
|
86
|
+
- `getBootstrap(resource)`
|
|
87
|
+
- `getPermissions(resource)`
|
|
88
|
+
- `getSdk(api, method)`
|
|
89
|
+
- `getSchema(schemaName)`
|
|
90
|
+
- `getZodSchema(schemaName)`
|
|
91
|
+
- `getSchemaDefaultValue(schemaName)`
|
|
92
|
+
- `createApiSchemas(api, method)`
|
|
93
|
+
- `loadSchemaProperties(schema, schemaScene)`
|
|
94
|
+
- `schemaToZodSchema(schema)`
|
|
95
|
+
|
|
96
|
+
A practical reading rule is:
|
|
97
|
+
|
|
98
|
+
- `ModelSdk` is the higher model-facing façade over lower OpenAPI runtime state
|
|
99
|
+
- it is the surface most downstream consumers actually reuse
|
|
100
|
+
|
|
101
|
+
## `SysSdk` responsibilities
|
|
102
|
+
|
|
103
|
+
The lower runtime owner lives in:
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
zova/src/suite-vendor/a-zova/modules/a-openapi/src/bean/sys.sdk.ts
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Its main jobs are:
|
|
110
|
+
|
|
111
|
+
- store loaded bootstraps
|
|
112
|
+
- store loaded schemas
|
|
113
|
+
- store loaded operation SDK entries by API and method
|
|
114
|
+
- fetch bootstrap data
|
|
115
|
+
- fetch operation-level OpenAPI docs
|
|
116
|
+
- cache schemas and operation objects in reactive stores
|
|
117
|
+
- reload caches during SSR HMR reload paths
|
|
118
|
+
|
|
119
|
+
This is the lower-level owner beneath `ModelSdk`.
|
|
120
|
+
|
|
121
|
+
A practical rule is:
|
|
122
|
+
|
|
123
|
+
- `ModelSdk` is the model-facing surface
|
|
124
|
+
- `SysSdk` is the lower cache/fetch owner
|
|
125
|
+
|
|
126
|
+
## Bootstrap and permissions loading
|
|
127
|
+
|
|
128
|
+
The bootstrap path is defined in `ModelSdk.getBootstrap(resource)`.
|
|
129
|
+
|
|
130
|
+
The source confirms that:
|
|
131
|
+
|
|
132
|
+
- bootstrap data is loaded first
|
|
133
|
+
- permissions are then loaded through `getPermissions(resource)`
|
|
134
|
+
- on the server, permissions are autoloaded as part of the bootstrap path
|
|
135
|
+
- on the client, permission queries are refetched when needed
|
|
136
|
+
|
|
137
|
+
That means bootstrap and permissions are part of the same lower-level OpenAPI/runtime ladder, not unrelated utilities.
|
|
138
|
+
|
|
139
|
+
## `getSdk(...)` and schema preloading
|
|
140
|
+
|
|
141
|
+
The operation-level SDK path is centered on:
|
|
142
|
+
|
|
143
|
+
- `ModelSdk.getSdk(api, apiMethod)`
|
|
144
|
+
- `SysSdk.loadSdk(...)`
|
|
145
|
+
|
|
146
|
+
The source confirms that:
|
|
147
|
+
|
|
148
|
+
- one operation-level SDK entry is keyed by API path and request method
|
|
149
|
+
- schema docs are fetched through the lower OpenAPI fetch path
|
|
150
|
+
- component schemas referenced by the operation document are cached into `SysSdk.schemas`
|
|
151
|
+
- operation metadata is cached into `SysSdk.sdks`
|
|
152
|
+
|
|
153
|
+
That means `getSdk(...)` is not only a fetch helper. It is also a preloading point for the schema runtime that later powers query/body/row/filter access.
|
|
154
|
+
|
|
155
|
+
## `createApiSchemas(...)` and derived schema surfaces
|
|
156
|
+
|
|
157
|
+
The high-value consumer-facing helper is:
|
|
158
|
+
|
|
159
|
+
- `createApiSchemas(api, method)`
|
|
160
|
+
|
|
161
|
+
The source confirms that it exposes these derived surfaces:
|
|
162
|
+
|
|
163
|
+
- `query`
|
|
164
|
+
- `filter`
|
|
165
|
+
- `requestBody`
|
|
166
|
+
- `responseBody`
|
|
167
|
+
- `paged`
|
|
168
|
+
- `row`
|
|
169
|
+
|
|
170
|
+
This is the most practical lower-level bridge from raw OpenAPI docs into the higher-level resource, form, and table runtimes.
|
|
171
|
+
|
|
172
|
+
A practical reading rule is:
|
|
173
|
+
|
|
174
|
+
- downstream consumers should reuse these derived schema surfaces
|
|
175
|
+
- they should not rebuild request/query/body/row extraction rules independently
|
|
176
|
+
|
|
177
|
+
## `schema.ts` and scene-aware property loading
|
|
178
|
+
|
|
179
|
+
The canonical schema extraction layer lives in:
|
|
180
|
+
|
|
181
|
+
```text
|
|
182
|
+
zova/src/suite-vendor/a-zova/modules/a-openapi/src/lib/schema.ts
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
This file owns the main lower-level helpers for:
|
|
186
|
+
|
|
187
|
+
- request body schema extraction
|
|
188
|
+
- response body schema extraction
|
|
189
|
+
- request query schema extraction
|
|
190
|
+
- filter-schema extraction
|
|
191
|
+
- scene-aware property loading
|
|
192
|
+
- JSON-schema-to-Zod conversion
|
|
193
|
+
|
|
194
|
+
The most important scene-aware rule is in `loadSchemaProperties(...)`:
|
|
195
|
+
|
|
196
|
+
- property metadata can be extended by `rest.*`
|
|
197
|
+
- scene-specific overlays such as `table`, `form`, `form-view`, `form-create`, and `filter` are applied
|
|
198
|
+
- field ordering is resolved through `rest.order`
|
|
199
|
+
|
|
200
|
+
That means `a-openapi` is not only a transport/schema lookup layer.
|
|
201
|
+
|
|
202
|
+
It is also the lower-level metadata shaping layer for schema-driven UI behavior.
|
|
203
|
+
|
|
204
|
+
## Current consumers that prove the contract
|
|
205
|
+
|
|
206
|
+
The clearest current consumers of `a-openapi` runtime are:
|
|
207
|
+
|
|
208
|
+
- `rest-resource/src/model/resource.ts`
|
|
209
|
+
- list and entry page shells that reuse `ModelResource`
|
|
210
|
+
- table/form runtimes that consume schema surfaces derived from `createApiSchemas(...)` and `loadSchemaProperties(...)`
|
|
211
|
+
|
|
212
|
+
This is enough to show that `a-openapi` should be understood as shared runtime substrate rather than one isolated SDK helper.
|
|
213
|
+
|
|
214
|
+
## What this page does not re-explain
|
|
215
|
+
|
|
216
|
+
This page does **not** fully re-explain:
|
|
217
|
+
|
|
218
|
+
- how to configure or generate OpenAPI SDK output -> see [OpenAPI SDK Guide](/frontend/openapi-sdk-guide)
|
|
219
|
+
- the broader server-data abstraction ladder -> see [Server Data](/frontend/server-data)
|
|
220
|
+
- how `$apiSchema` is positioned conceptually -> see [API Schema Guide](/frontend/api-schema-guide)
|
|
221
|
+
- downstream resource-owner or table runtime behavior -> see the relevant resource/table deep dives
|
|
222
|
+
|
|
223
|
+
Its job is only to explain the lower-level `a-openapi` runtime and source path.
|
|
224
|
+
|
|
225
|
+
## Where to read next
|
|
226
|
+
|
|
227
|
+
Use these next steps depending on your question:
|
|
228
|
+
|
|
229
|
+
- if you want the broader server-data ladder, read [Server Data](/frontend/server-data)
|
|
230
|
+
- if you want OpenAPI generation/config usage, read [OpenAPI SDK Guide](/frontend/openapi-sdk-guide)
|
|
231
|
+
- if you want schema-driven UI positioning, read [API Schema Guide](/frontend/api-schema-guide)
|
|
232
|
+
- if you want the resource-owner consumer side, read [ModelResource Internals Deep Dive](/frontend/model-resource-internals-deep-dive)
|
|
233
|
+
- if you want the table/resource consumer side, read [Zova Table Under the Hood](/frontend/zova-table-under-the-hood) and the resource deep dives
|
|
234
|
+
|
|
235
|
+
## Final takeaway
|
|
236
|
+
|
|
237
|
+
The most accurate way to read `a-openapi` is not as one generated-client helper.
|
|
238
|
+
|
|
239
|
+
Read it as the lower-level schema/runtime bridge that:
|
|
240
|
+
|
|
241
|
+
- injects `$sdk`
|
|
242
|
+
- scopes SDK/runtime state by locale
|
|
243
|
+
- loads bootstrap, permissions, operation docs, and component schemas
|
|
244
|
+
- derives request/query/filter/body/row/paged schema surfaces
|
|
245
|
+
- applies scene-aware schema-property shaping
|
|
246
|
+
- supports higher-level resource, form, and table consumers
|
|
247
|
+
|
|
248
|
+
That is the source-confirmed role of `a-openapi` in the current Cabloy Basic frontend architecture.
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
# A-Router Guide
|
|
2
|
+
|
|
3
|
+
This guide explains the router runtime boundary in Zova through the current public Cabloy Basic source:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
zova/src/suite-vendor/a-zova/modules/a-router
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Use this page when you want to understand:
|
|
10
|
+
|
|
11
|
+
- what `a-router` is responsible for
|
|
12
|
+
- what `a-router` is **not** responsible for
|
|
13
|
+
- how module route records become operational router records
|
|
14
|
+
- how system startup and app startup cooperate around routing
|
|
15
|
+
- where `$route`, `$params`, and `$query` reach page controllers
|
|
16
|
+
- where `a-router` stops and router-view host behavior begins
|
|
17
|
+
|
|
18
|
+
## Why this page exists
|
|
19
|
+
|
|
20
|
+
The existing router docs already explain several important layers:
|
|
21
|
+
|
|
22
|
+
- [Page Route Guide](/frontend/page-route-guide) explains the public route-record surface
|
|
23
|
+
- [Navigation Guards Guide](/frontend/navigation-guards-guide) explains route policy hooks
|
|
24
|
+
- [Page Params Guide](/frontend/page-params-guide) and [Page Query Guide](/frontend/page-query-guide) explain typed route-state authoring
|
|
25
|
+
- [Zova Router Under the Hood](/frontend/zova-router-under-the-hood) explains the broader runtime cooperation
|
|
26
|
+
- [Router View Hosts Guide](/frontend/router-view-hosts-guide) explains how routed pages are hosted after route resolution
|
|
27
|
+
|
|
28
|
+
What those pages do not isolate directly is the module boundary of `a-router` itself.
|
|
29
|
+
|
|
30
|
+
That is the gap this page fills.
|
|
31
|
+
|
|
32
|
+
In the current Basic source, `a-router` is not only a thin wrapper around Vue Router and not only a route-record registry. It is the runtime package that connects module route registration, router creation, startup readiness, guard flow, controller route-state injection, and the handoff into routed hosts.
|
|
33
|
+
|
|
34
|
+
## The shortest accurate mental model
|
|
35
|
+
|
|
36
|
+
A practical mental model is:
|
|
37
|
+
|
|
38
|
+
1. modules declare route records through `routes.ts`
|
|
39
|
+
2. `a-router` registers those records into the shared router during system startup
|
|
40
|
+
3. `a-router` merges config routes, expands module-relative paths, synthesizes aliases, and wraps routes with layout structure when needed
|
|
41
|
+
4. `a-router` makes the main router operational during app startup
|
|
42
|
+
5. `a-router` guard flow lazy-loads modules and normalizes alias or fallback behavior during navigation
|
|
43
|
+
6. `a-router` pushes `$route`, `$routeMatched`, `$params`, and `$query` onto page controllers
|
|
44
|
+
7. the resolved routed output then enters a router-view host for page-instance ownership and keep-alive behavior
|
|
45
|
+
|
|
46
|
+
That is why `a-router` is a real Zova architectural boundary rather than only a route-table utility.
|
|
47
|
+
|
|
48
|
+
## What `a-router` is
|
|
49
|
+
|
|
50
|
+
In the current Basic source, `a-router` is mainly these seven things:
|
|
51
|
+
|
|
52
|
+
- a **module integration surface** through generated metadata
|
|
53
|
+
- a **shared system router owner** through `SysRouter`
|
|
54
|
+
- a **module-route registration bridge** through `monkeySys.ts`
|
|
55
|
+
- an **app lifecycle and router readiness bridge** through `monkey.ts`
|
|
56
|
+
- a **guard service** through `ServiceRouterGuards`
|
|
57
|
+
- a **page-controller route-state injection layer** through `monkey.ts`
|
|
58
|
+
- a **routed-host handoff boundary** through `routerViewBase.tsx`
|
|
59
|
+
|
|
60
|
+
Those roles make `a-router` the package that turns route declarations into operational routed frontend behavior.
|
|
61
|
+
|
|
62
|
+
## What `a-router` is not
|
|
63
|
+
|
|
64
|
+
It is equally important to avoid over-assigning responsibilities to `a-router`.
|
|
65
|
+
|
|
66
|
+
`a-router` does **not** itself own:
|
|
67
|
+
|
|
68
|
+
- the authoring explanation for route records and their public meaning
|
|
69
|
+
- the full typed params/query authoring story
|
|
70
|
+
- the business-facing explanation for navigation policy and auth design
|
|
71
|
+
- the detailed semantics of `routerViewEmpty`, `routerViewTabs`, or `routerViewStack`
|
|
72
|
+
- the tabs or stack workspace models
|
|
73
|
+
- the layout component implementations themselves
|
|
74
|
+
|
|
75
|
+
Those responsibilities belong to other routing, host, and layout docs.
|
|
76
|
+
|
|
77
|
+
So when you read `a-router`, read it as the runtime package that operationalizes routing, not as the page-authoring guide and not as the routed-host guide.
|
|
78
|
+
|
|
79
|
+
## The core source-reading path
|
|
80
|
+
|
|
81
|
+
When reading `a-router`, use this order:
|
|
82
|
+
|
|
83
|
+
1. `zova/src/suite-vendor/a-zova/modules/a-router/src/.metadata/index.ts`
|
|
84
|
+
2. `zova/src/suite-vendor/a-zova/modules/a-router/src/bean/sys.router.ts`
|
|
85
|
+
3. `zova/src/suite-vendor/a-zova/modules/a-router/src/monkeySys.ts`
|
|
86
|
+
4. `zova/src/suite-vendor/a-zova/modules/a-router/src/monkey.ts`
|
|
87
|
+
5. `zova/src/suite-vendor/a-zova/modules/a-router/src/service/routerGuards.ts`
|
|
88
|
+
6. `zova/src/suite-vendor/a-zova/modules/a-router/src/bean/bean.router.ts`
|
|
89
|
+
7. `zova/src/suite-vendor/a-zova/modules/a-router/src/types/router.ts`
|
|
90
|
+
8. `zova/src/suite-vendor/a-zova/modules/a-router/src/lib/routerViewBase.tsx`
|
|
91
|
+
|
|
92
|
+
That order moves from integration surface, to system router ownership, to startup hooks, to navigation flow, to app-level router-view coordination, to type contract, and finally to the routed-host handoff boundary.
|
|
93
|
+
|
|
94
|
+
## What each source file clarifies
|
|
95
|
+
|
|
96
|
+
### `src/.metadata/index.ts`
|
|
97
|
+
|
|
98
|
+
This is the generated integration map for the module.
|
|
99
|
+
|
|
100
|
+
It shows that `a-router` contributes:
|
|
101
|
+
|
|
102
|
+
- model export and typing for page data
|
|
103
|
+
- router sys bean registration
|
|
104
|
+
- router bean registration
|
|
105
|
+
- router guard service registration
|
|
106
|
+
- the `routerViewEmpty` component export
|
|
107
|
+
- config, monkey, and scope integration
|
|
108
|
+
|
|
109
|
+
This file is the best single map of how `a-router` enters the larger Zova bean, config, and component records.
|
|
110
|
+
|
|
111
|
+
### `src/bean/sys.router.ts`
|
|
112
|
+
|
|
113
|
+
This is the shared router owner.
|
|
114
|
+
|
|
115
|
+
Its main jobs are:
|
|
116
|
+
|
|
117
|
+
- create the router instance and choose history mode
|
|
118
|
+
- load config routes by path and name
|
|
119
|
+
- load legacy routes if present
|
|
120
|
+
- register module routes into real router records
|
|
121
|
+
- expand module-relative route paths and names
|
|
122
|
+
- merge config-route overrides
|
|
123
|
+
- synthesize alias routes when needed
|
|
124
|
+
- wrap routed pages with layout routes when `meta.layout` requires it
|
|
125
|
+
- expose helpers such as `getPagePath(...)`, `resolveName(...)`, and `ensureRoute(...)`
|
|
126
|
+
|
|
127
|
+
This is the file that most clearly shows how a module-local route record becomes operational router structure.
|
|
128
|
+
|
|
129
|
+
### `src/monkeySys.ts`
|
|
130
|
+
|
|
131
|
+
This file is the system-startup route registration bridge.
|
|
132
|
+
|
|
133
|
+
Its most important job is:
|
|
134
|
+
|
|
135
|
+
- when a module is loading and contributes `resource.routes`, call `sysRouter._registerRoutes(module)`
|
|
136
|
+
|
|
137
|
+
That matters because route registration belongs to system startup rather than being delayed until page code happens to execute.
|
|
138
|
+
|
|
139
|
+
This file also exposes application-level helpers such as:
|
|
140
|
+
|
|
141
|
+
- `$gotoPage(...)`
|
|
142
|
+
- `$gotoHome(...)`
|
|
143
|
+
- `$gotoLogin(...)`
|
|
144
|
+
- `$getCurrentPagePath()`
|
|
145
|
+
|
|
146
|
+
So `monkeySys.ts` is not only about route registration. It also helps define the application-facing router convenience surface.
|
|
147
|
+
|
|
148
|
+
### `src/monkey.ts`
|
|
149
|
+
|
|
150
|
+
This file is the app lifecycle and controller route-state bridge.
|
|
151
|
+
|
|
152
|
+
Its main jobs are:
|
|
153
|
+
|
|
154
|
+
- create or retrieve the main router bean
|
|
155
|
+
- attach guard setup through the router-guards event flow
|
|
156
|
+
- make the router operational during `appReady()`
|
|
157
|
+
- inject `$router`, `$routerView`, `$pageRoute`, and `$currentRoute` onto bean instances
|
|
158
|
+
- prepare controller route context
|
|
159
|
+
- push `$route` and `$routeMatched` onto page controllers
|
|
160
|
+
- parse typed `$params` and `$query` from page schemas and preserve stable client references
|
|
161
|
+
- handle SSR/client redirect-related error behavior
|
|
162
|
+
|
|
163
|
+
This is the key source file if your question is: “where do page controllers actually receive route-aware state?”
|
|
164
|
+
|
|
165
|
+
## `src/service/routerGuards.ts`
|
|
166
|
+
|
|
167
|
+
This file is the navigation guard runtime layer.
|
|
168
|
+
|
|
169
|
+
Its main jobs are:
|
|
170
|
+
|
|
171
|
+
- run `beforeEach(...)` checks
|
|
172
|
+
- lazy-load modules during navigation when needed
|
|
173
|
+
- normalize alias redirect behavior
|
|
174
|
+
- retry route resolution after module loading when appropriate
|
|
175
|
+
- handle 404/module-load preparation checks
|
|
176
|
+
- emit back/forward notifications after navigation
|
|
177
|
+
|
|
178
|
+
This file is the best place to read when the route exists conceptually but is not yet fully operational at navigation time.
|
|
179
|
+
|
|
180
|
+
## `src/bean/bean.router.ts`
|
|
181
|
+
|
|
182
|
+
This file is the app-level router bean and router-view coordination surface.
|
|
183
|
+
|
|
184
|
+
Its main jobs are:
|
|
185
|
+
|
|
186
|
+
- create the main app router from `SysRouter`
|
|
187
|
+
- expose router APIs through the bean surface
|
|
188
|
+
- register and deregister active router-view hosts
|
|
189
|
+
- forward back-route and forward-route notifications to hosts
|
|
190
|
+
- forward `setPageMeta(...)` updates to hosts
|
|
191
|
+
|
|
192
|
+
This is the layer that connects the router runtime to routed-host controllers.
|
|
193
|
+
|
|
194
|
+
## `src/types/router.ts`
|
|
195
|
+
|
|
196
|
+
This file is the public type contract for the router package.
|
|
197
|
+
|
|
198
|
+
It shows the extended route meta and app/bean/controller-facing router surface, including:
|
|
199
|
+
|
|
200
|
+
- `RouteMeta.layout`
|
|
201
|
+
- `RouteMeta.requiresAuth`
|
|
202
|
+
- `RouteMeta.locale`
|
|
203
|
+
- `RouteMeta.componentKeyMode`
|
|
204
|
+
- `RouteMeta.componentKey`
|
|
205
|
+
- `RouteMeta.tabKey`
|
|
206
|
+
- `RouteMeta.keepAlive`
|
|
207
|
+
- app helpers such as `$gotoPage(...)`
|
|
208
|
+
- bean-level `$router`, `$routerView`, `$pageRoute`, and `$currentRoute`
|
|
209
|
+
- page-controller `$route` and `$routeMatched`
|
|
210
|
+
|
|
211
|
+
This is the best file to read when you want to verify what the router package promises to the rest of the application.
|
|
212
|
+
|
|
213
|
+
## `src/lib/routerViewBase.tsx`
|
|
214
|
+
|
|
215
|
+
This file is the handoff boundary from router runtime into routed-host behavior.
|
|
216
|
+
|
|
217
|
+
What matters here is not the full host model, but the boundary itself:
|
|
218
|
+
|
|
219
|
+
- `a-router` has already resolved the routed page path
|
|
220
|
+
- the routed output now enters a router-view host
|
|
221
|
+
- that host wraps `RouterView`, computes host-facing route meta, manages `KeepAlive`, and injects the current page route into the routed vnode
|
|
222
|
+
|
|
223
|
+
This is the point where router runtime responsibility gives way to routed-host responsibility.
|
|
224
|
+
|
|
225
|
+
For the detailed host layer, continue with [Router View Hosts Guide](/frontend/router-view-hosts-guide).
|
|
226
|
+
|
|
227
|
+
## System startup vs app startup
|
|
228
|
+
|
|
229
|
+
A practical distinction in `a-router` is:
|
|
230
|
+
|
|
231
|
+
- **system startup** registers module routes into the shared router structure
|
|
232
|
+
- **app startup** makes the operational router ready for the running application instance
|
|
233
|
+
|
|
234
|
+
In source terms:
|
|
235
|
+
|
|
236
|
+
- `monkeySys.ts` handles module route registration
|
|
237
|
+
- `monkey.ts` handles app readiness and page-controller route-state injection
|
|
238
|
+
|
|
239
|
+
This split matters because it explains why route-table wiring and first-screen navigation readiness are related but not identical responsibilities.
|
|
240
|
+
|
|
241
|
+
## How layout enters the router runtime
|
|
242
|
+
|
|
243
|
+
One of the most important source-confirmed details in `SysRouter._registerRoute(...)` is that layout is not only a visual afterthought.
|
|
244
|
+
|
|
245
|
+
When layout is enabled:
|
|
246
|
+
|
|
247
|
+
- `a-router` wraps the routed page in a parent route
|
|
248
|
+
- the parent route uses the resolved layout component
|
|
249
|
+
- the original page route becomes the child route
|
|
250
|
+
|
|
251
|
+
That means layout choice becomes runtime route structure inside `a-router`, not only a later rendering preference.
|
|
252
|
+
|
|
253
|
+
## How page controllers receive route-aware state
|
|
254
|
+
|
|
255
|
+
A key Zova-specific behavior in `a-router` is that route-aware page state becomes part of the page-controller surface.
|
|
256
|
+
|
|
257
|
+
In `monkey.ts`, page controllers receive:
|
|
258
|
+
|
|
259
|
+
- `$route`
|
|
260
|
+
- `$routeMatched`
|
|
261
|
+
- `$params`
|
|
262
|
+
- `$query`
|
|
263
|
+
|
|
264
|
+
The important point is that this is not only a thin `useRoute()` translation.
|
|
265
|
+
|
|
266
|
+
The route state is pushed through the controller lifecycle and, for `$params` and `$query`, parsed from the page-schema records that belong to the module resource.
|
|
267
|
+
|
|
268
|
+
That is one reason the routing model stays tightly integrated with the rest of Zova’s controller-oriented architecture.
|
|
269
|
+
|
|
270
|
+
## Where `a-router` stops and router-view hosts begin
|
|
271
|
+
|
|
272
|
+
A useful boundary rule is:
|
|
273
|
+
|
|
274
|
+
- `a-router` owns route registration, layout wrapping, startup readiness, guard flow, and page-controller route-state injection
|
|
275
|
+
- router-view hosts own routed page instance hosting, `tabKey`, `componentKey`, `keepAlive`, and empty/tabs/stack host behavior
|
|
276
|
+
|
|
277
|
+
So if your next question is:
|
|
278
|
+
|
|
279
|
+
- “how does the route become operational?” stay in `a-router`
|
|
280
|
+
- “which host owns the routed page instance now?” continue to [Router View Hosts Guide](/frontend/router-view-hosts-guide)
|
|
281
|
+
- “should this host behave like tabs or stack?” continue with [Router Tabs vs Stack](/frontend/router-tabs-vs-stack)
|
|
282
|
+
|
|
283
|
+
## Read together with
|
|
284
|
+
|
|
285
|
+
Use this page together with:
|
|
286
|
+
|
|
287
|
+
- [Page Route Guide](/frontend/page-route-guide)
|
|
288
|
+
- [Zova Router Under the Hood](/frontend/zova-router-under-the-hood)
|
|
289
|
+
- [Page Params Guide](/frontend/page-params-guide)
|
|
290
|
+
- [Page Query Guide](/frontend/page-query-guide)
|
|
291
|
+
- [Navigation Guards Guide](/frontend/navigation-guards-guide)
|
|
292
|
+
- [Router View Hosts Guide](/frontend/router-view-hosts-guide)
|
|
293
|
+
- [Zova Source Reading Map](/frontend/zova-source-reading-map)
|
|
294
|
+
|
|
295
|
+
## Final takeaway
|
|
296
|
+
|
|
297
|
+
The most accurate way to read `a-router` is not as a generic Vue Router wrapper and not as the owner of every routing-related concern.
|
|
298
|
+
|
|
299
|
+
Read it as the Zova router runtime package that:
|
|
300
|
+
|
|
301
|
+
- registers module routes
|
|
302
|
+
- creates and normalizes operational router structure
|
|
303
|
+
- makes the router ready during app startup
|
|
304
|
+
- injects route-aware state into page controllers
|
|
305
|
+
- hands routed output into router-view hosts
|
|
306
|
+
|
|
307
|
+
That is the source-confirmed role of `a-router` in the current Basic frontend architecture.
|
|
@@ -10,10 +10,10 @@ That means frontend code does not need to scatter raw request details everywhere
|
|
|
10
10
|
|
|
11
11
|
## Create an API service
|
|
12
12
|
|
|
13
|
-
Example: create an API service named `menu` in module `
|
|
13
|
+
Example: create an API service named `menu` in module `training-student`.
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
npm run zova :create:bean api menu -- --module=
|
|
16
|
+
npm run zova :create:bean api menu -- --module=training-student
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## API definition
|
|
@@ -39,6 +39,8 @@ This shows the intended layering clearly:
|
|
|
39
39
|
- `$fetch` handles the lower-level request
|
|
40
40
|
- the API service exposes a business-oriented method such as `retrieveMenus()`
|
|
41
41
|
|
|
42
|
+
If the lower-level request path itself needs transport middleware such as headers, JWT handling, mock fallback, SSR short-circuiting, or response normalization, see [Fetch Interceptor Guide](/frontend/fetch-interceptor-guide).
|
|
43
|
+
|
|
42
44
|
API is also one of the core module-scope resource categories; see [Module Scope](/frontend/module-scope).
|
|
43
45
|
|
|
44
46
|
## Using the API through module scope
|
|
@@ -61,9 +63,9 @@ Representative pattern:
|
|
|
61
63
|
|
|
62
64
|
```typescript
|
|
63
65
|
@UseScope()
|
|
64
|
-
$$
|
|
66
|
+
$$scopeTrainingStudent: ScopeModuleTrainingStudent;
|
|
65
67
|
|
|
66
|
-
const menus = await this.$$
|
|
68
|
+
const menus = await this.$$scopeTrainingStudent.api.menu.retrieveMenus();
|
|
67
69
|
```
|
|
68
70
|
|
|
69
71
|
## Built-in `$api` access
|
|
@@ -35,6 +35,7 @@ Use this page together with:
|
|
|
35
35
|
- [OpenAPI SDK Guide](/frontend/openapi-sdk-guide)
|
|
36
36
|
- [Backend OpenAPI to Frontend SDK](/fullstack/openapi-to-sdk)
|
|
37
37
|
- [SDK Guide](/frontend/sdk-guide)
|
|
38
|
+
- [A-OpenAPI Under the Hood](/frontend/a-openapi-under-the-hood)
|
|
38
39
|
|
|
39
40
|
## Implementation checks for schema-driven UI changes
|
|
40
41
|
|
|
@@ -68,7 +68,7 @@ A module can provide its own main lifecycle entrypoints.
|
|
|
68
68
|
Representative creation command:
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
|
-
npm run zova :init:main
|
|
71
|
+
npm run zova :init:main training-student
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
Representative pattern:
|
|
@@ -87,7 +87,7 @@ A module can also provide broader app hook behavior through a monkey entry.
|
|
|
87
87
|
Representative creation command:
|
|
88
88
|
|
|
89
89
|
```bash
|
|
90
|
-
npm run zova :init:monkey
|
|
90
|
+
npm run zova :init:monkey training-student
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
Representative pattern:
|
|
@@ -164,8 +164,11 @@ A practical reading sequence is:
|
|
|
164
164
|
|
|
165
165
|
1. [System Startup Guide](/frontend/system-startup-guide)
|
|
166
166
|
2. this page for router/guard readiness
|
|
167
|
-
3. [
|
|
168
|
-
4. [
|
|
167
|
+
3. [Zova App Guide](/frontend/zova-app-guide)
|
|
168
|
+
4. [Page Route Guide](/frontend/page-route-guide)
|
|
169
|
+
5. [Navigation Guards Guide](/frontend/navigation-guards-guide)
|
|
170
|
+
|
|
171
|
+
If you want the thin root app-host layer that sits inside the running frontend app, read [Zova App Guide](/frontend/zova-app-guide). That guide focuses on `a-app` as the root controller/behavior host rather than on startup hook timings.
|
|
169
172
|
|
|
170
173
|
## Relationship to environment/config selection
|
|
171
174
|
|
|
@@ -215,6 +215,8 @@ This is useful when one scene needs multiple scaffold shapes for distinct fronte
|
|
|
215
215
|
|
|
216
216
|
Representative built-in examples include the `command` scene, which exposes `commandBulk` and `commandRow` variants, and the `tableCell` scene, which exposes a `tableActionRow` variant in module metadata.
|
|
217
217
|
|
|
218
|
+
For the built-in command scene’s runtime model, helper bases, metadata flow, and source-reading path, see [Command Scene Authoring](/frontend/command-scene-authoring).
|
|
219
|
+
|
|
218
220
|
### `metadataCustom`
|
|
219
221
|
|
|
220
222
|
Use this only when the scene needs additional generated output beyond the standard metadata passes.
|
|
@@ -288,7 +290,7 @@ Keep these two tasks separate.
|
|
|
288
290
|
Example:
|
|
289
291
|
|
|
290
292
|
```bash
|
|
291
|
-
npm run zova :create:bean model menu -- --module=
|
|
293
|
+
npm run zova :create:bean model menu -- --module=training-student
|
|
292
294
|
```
|
|
293
295
|
|
|
294
296
|
This uses an already-defined scene.
|