cabloy 5.1.60 → 5.1.61
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/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-frontend-scaffold/SKILL.md +11 -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 +22 -0
- package/CLAUDE.md +10 -0
- package/cabloy-docs/.vitepress/config.mjs +50 -4
- package/cabloy-docs/ai/cli-to-skill-map.md +7 -0
- package/cabloy-docs/ai/docs-skills-rules-mapping.md +14 -0
- package/cabloy-docs/ai/future-skill-roadmap.md +10 -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 +11 -0
- package/cabloy-docs/backend/dto-guide.md +6 -0
- package/cabloy-docs/backend/entity-guide.md +18 -0
- package/cabloy-docs/backend/introduction.md +2 -0
- package/cabloy-docs/backend/serialization-guide.md +10 -0
- package/cabloy-docs/backend/status-guide.md +271 -0
- package/cabloy-docs/frontend/api-guide.md +2 -0
- package/cabloy-docs/frontend/bean-scene-authoring.md +2 -0
- package/cabloy-docs/frontend/cli.md +12 -0
- package/cabloy-docs/frontend/command-scene-authoring.md +495 -0
- package/cabloy-docs/frontend/design-principles.md +6 -0
- package/cabloy-docs/frontend/fetch-interceptor-guide.md +440 -0
- package/cabloy-docs/frontend/form-guide.md +795 -0
- package/cabloy-docs/frontend/foundation.md +29 -0
- package/cabloy-docs/frontend/introduction.md +12 -1
- 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 +252 -39
- package/cabloy-docs/frontend/model-resource-best-practices.md +379 -0
- package/cabloy-docs/frontend/model-resource-cookbook.md +505 -0
- package/cabloy-docs/frontend/model-resource-owner-pattern.md +382 -0
- package/cabloy-docs/frontend/model-resource-usage-guide.md +318 -0
- package/cabloy-docs/frontend/model-state-guide.md +366 -13
- package/cabloy-docs/frontend/openapi-sdk-guide.md +5 -2
- package/cabloy-docs/frontend/page-guide.md +6 -0
- package/cabloy-docs/frontend/quickstart.md +4 -0
- package/cabloy-docs/frontend/reading-zova-for-vue-developers.md +266 -0
- package/cabloy-docs/frontend/server-data.md +2 -0
- package/cabloy-docs/frontend/zova-form-source-reading-map.md +295 -0
- package/cabloy-docs/frontend/zova-form-under-the-hood.md +556 -0
- package/cabloy-docs/frontend/zova-reactivity-under-the-hood.md +320 -0
- package/cabloy-docs/frontend/zova-source-reading-map.md +327 -0
- package/cabloy-docs/frontend/zova-vs-vue3-comparison.md +308 -0
- package/cabloy-docs/fullstack/contract-loop-playbook.md +350 -0
- package/cabloy-docs/fullstack/frontend-metadata-to-backend.md +44 -1
- package/cabloy-docs/fullstack/introduction.md +12 -1
- package/cabloy-docs/fullstack/openapi-to-sdk.md +19 -9
- package/cabloy-docs/fullstack/tutorial-3-frontend-metadata-sharing.md +2 -2
- package/cabloy-docs/fullstack/tutorial-4-custom-level-renderers.md +30 -5
- package/cabloy-docs/fullstack/tutorial-5-backend-contract-sharing.md +9 -7
- package/cabloy-docs/fullstack/tutorial-6-one-contract-four-uses.md +2 -0
- package/cabloy-docs/fullstack/tutorials-overview.md +16 -3
- package/cabloy-docs/reference/bean-scene-boilerplates.md +2 -0
- 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 +94 -4
- 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/pnpm-lock.yaml +20 -20
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# Reading Zova for Vue Developers
|
|
2
|
+
|
|
3
|
+
This guide is for readers who already know Vue 3 and want the shortest accurate path to reading Zova source code without forcing generic Vue assumptions onto it.
|
|
4
|
+
|
|
5
|
+
## Why this page exists
|
|
6
|
+
|
|
7
|
+
When Vue developers first open Zova code, several things can feel unfamiliar at the same time:
|
|
8
|
+
|
|
9
|
+
- page and component logic lives in controller classes
|
|
10
|
+
- plain class fields behave reactively
|
|
11
|
+
- derived state is often wired in `__init__`
|
|
12
|
+
- render logic is written in TSX and can live in a controller or a dedicated render bean
|
|
13
|
+
- state sharing is organized through IoC containers and bean scopes rather than a pile of unrelated patterns
|
|
14
|
+
|
|
15
|
+
If you read Zova as "Vue with unusual syntax," you will miss the architectural point.
|
|
16
|
+
|
|
17
|
+
A better starting point is:
|
|
18
|
+
|
|
19
|
+
- **Vue still provides the reactive foundation**
|
|
20
|
+
- **Zova changes the preferred programming model built on top of that foundation**
|
|
21
|
+
|
|
22
|
+
## The shortest accurate mental model
|
|
23
|
+
|
|
24
|
+
If you only remember one paragraph, remember this one:
|
|
25
|
+
|
|
26
|
+
> Zova keeps Vue 3 reactivity underneath, but moves the main authoring surface from `setup()` locals and explicit `ref/reactive` values toward IoC-managed reactive bean instances such as page controllers, component controllers, service beans, and model beans.
|
|
27
|
+
|
|
28
|
+
That is why Zova code often reads more like controller-oriented application code than like a typical Vue single-file-component or composable-first codebase.
|
|
29
|
+
|
|
30
|
+
## Quick translation table
|
|
31
|
+
|
|
32
|
+
| If you usually think in Vue terms | Read Zova like this instead |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| `setup()` is the main wiring point | `__init__` and bean lifecycle are major wiring points |
|
|
35
|
+
| `ref` / `reactive` are the visible state hosts | controller and bean instances are the visible state hosts |
|
|
36
|
+
| `computed()` creates local derived refs | `$computed()` usually creates instance-level derived state |
|
|
37
|
+
| `useRoute()` pulls route state into the component | page controllers expose `$route`, `$params`, and `$query` as part of the controller surface |
|
|
38
|
+
| `provide/inject`, composables, props, and stores are separate sharing tools | bean scopes and IoC are used to unify more sharing patterns under one model |
|
|
39
|
+
| template or component render is the obvious center | controller-oriented architecture is the center; render can stay in the controller or move into render beans |
|
|
40
|
+
|
|
41
|
+
## Start from the right assumptions
|
|
42
|
+
|
|
43
|
+
### 1. Do not assume Zova wants to end at `ref.value`
|
|
44
|
+
|
|
45
|
+
Zova intentionally aims for code that feels closer to direct variable usage than `ref/reactive`-heavy business code.
|
|
46
|
+
|
|
47
|
+
That does **not** mean Zova rejects Vue reactivity. It means Zova tries to hide more of the reactive primitive management behind a different framework surface.
|
|
48
|
+
|
|
49
|
+
Read together with:
|
|
50
|
+
|
|
51
|
+
- [Design Principles](/frontend/design-principles)
|
|
52
|
+
- [Foundation](/frontend/foundation)
|
|
53
|
+
|
|
54
|
+
### 2. Do not treat IoC as a small convenience layer
|
|
55
|
+
|
|
56
|
+
In Zova, IoC is not only about injecting a helper or two.
|
|
57
|
+
|
|
58
|
+
It is part of the larger architectural answer for:
|
|
59
|
+
|
|
60
|
+
- state ownership
|
|
61
|
+
- state sharing
|
|
62
|
+
- cross-module composition
|
|
63
|
+
- lifecycle structure
|
|
64
|
+
- extensibility
|
|
65
|
+
|
|
66
|
+
Read together with:
|
|
67
|
+
|
|
68
|
+
- [IoC and Beans](/frontend/ioc-and-beans)
|
|
69
|
+
- [Module Scope](/frontend/module-scope)
|
|
70
|
+
- [Modules and Suites](/frontend/modules-and-suites)
|
|
71
|
+
|
|
72
|
+
### 3. Do not collapse page, component, service, and model code into one generic Vue component mental model
|
|
73
|
+
|
|
74
|
+
Zova gives different bean types different architectural jobs.
|
|
75
|
+
|
|
76
|
+
For example:
|
|
77
|
+
|
|
78
|
+
- page controllers organize page-local state and route-aware behavior
|
|
79
|
+
- component controllers organize reusable UI units
|
|
80
|
+
- service beans can own extracted business state or behavior
|
|
81
|
+
- model beans organize broader state categories such as async, local-storage, cookie, or in-memory data
|
|
82
|
+
|
|
83
|
+
Read together with:
|
|
84
|
+
|
|
85
|
+
- [Page Guide](/frontend/page-guide)
|
|
86
|
+
- [Component Guide](/frontend/component-guide)
|
|
87
|
+
- [Model Architecture](/frontend/model-architecture)
|
|
88
|
+
- [Model State Guide](/frontend/model-state-guide)
|
|
89
|
+
|
|
90
|
+
## A concrete specimen to read first
|
|
91
|
+
|
|
92
|
+
If you want one small example that shows the Zova coding style clearly, start with the demo page controller in the public source tree:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
zova/src/suite/a-demo/modules/demo-basic/src/page/state/controller.tsx
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The important things to notice in that file are:
|
|
99
|
+
|
|
100
|
+
- `count` is a plain class field
|
|
101
|
+
- `count2` is wired in `__init__` through `$computed`
|
|
102
|
+
- actions are plain class methods such as `increment()` and `decrement()`
|
|
103
|
+
- `render()` reads the instance fields directly
|
|
104
|
+
|
|
105
|
+
A Vue-first reader often expects this kind of code to be rewritten into `setup()` plus `ref` plus `computed`. That is exactly the instinct you should suspend while reading Zova.
|
|
106
|
+
|
|
107
|
+
## How to read the reactive path under the surface
|
|
108
|
+
|
|
109
|
+
For the example above, a practical source-reading path is:
|
|
110
|
+
|
|
111
|
+
1. the example controller in `zova/src/suite/a-demo/modules/demo-basic/src/page/state/controller.tsx`
|
|
112
|
+
2. `zova/packages-zova/zova-core/src/composables/useController.ts`
|
|
113
|
+
3. `zova/packages-zova/zova-core/src/bean/beanContainer.ts`
|
|
114
|
+
4. `zova/packages-zova/zova-core/src/bean/beanBase.ts`
|
|
115
|
+
5. `zova/packages-zova/zova-core/src/core/context/component.ts`
|
|
116
|
+
6. `zova/src/suite-vendor/a-zova/modules/a-router/src/monkey.ts`
|
|
117
|
+
|
|
118
|
+
A compact interpretation of those files is:
|
|
119
|
+
|
|
120
|
+
- `useController.ts` creates and loads the controller bean
|
|
121
|
+
- `beanContainer.ts` is where bean instances become reactive and container-managed
|
|
122
|
+
- `beanBase.ts` exposes helpers such as `$computed`, `$watch`, and `$toRef`
|
|
123
|
+
- `component.ts` patches the component render flow so controller-driven render logic participates in normal frontend updates
|
|
124
|
+
- `a-router/src/monkey.ts` pushes page route state onto page controllers
|
|
125
|
+
|
|
126
|
+
This is the main reason Zova can feel so different while still standing on top of Vue runtime behavior.
|
|
127
|
+
|
|
128
|
+
If you want the next layer down, continue with [Zova Reactivity Under the Hood](/frontend/zova-reactivity-under-the-hood).
|
|
129
|
+
|
|
130
|
+
## Six practical differences Vue developers usually feel first
|
|
131
|
+
|
|
132
|
+
### 1. The visible state host is the controller instance
|
|
133
|
+
|
|
134
|
+
A Vue developer often expects to see:
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
const count = ref(0);
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
A Zova reader will more often see:
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
count: number = 0;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The important idea is not only less syntax. The important idea is that the framework is making the bean instance itself the main business-facing state surface.
|
|
147
|
+
|
|
148
|
+
### 2. Derived state is written as instance wiring
|
|
149
|
+
|
|
150
|
+
Instead of thinking:
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
const count2 = computed(() => `=== ${count.value} ===`);
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Zova often reads more like:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
protected async __init__() {
|
|
160
|
+
this.count2 = this.$computed(() => {
|
|
161
|
+
return `=== ${this.count} ===`;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
That makes derived state feel like part of object initialization rather than only part of a local `setup()` assembly.
|
|
167
|
+
|
|
168
|
+
### 3. Actions are ordinary methods
|
|
169
|
+
|
|
170
|
+
Instead of scattering behavior through closures returned from `setup()`, Zova often keeps page or component actions as plain methods on the controller instance.
|
|
171
|
+
|
|
172
|
+
That is one reason Zova business code can read more like application controller code.
|
|
173
|
+
|
|
174
|
+
### 4. Route state is part of the page-controller surface
|
|
175
|
+
|
|
176
|
+
A Vue reader often looks for `useRoute()` first.
|
|
177
|
+
|
|
178
|
+
In Zova, a page controller often expects route-aware behavior through members such as:
|
|
179
|
+
|
|
180
|
+
- `$route`
|
|
181
|
+
- `$params`
|
|
182
|
+
- `$query`
|
|
183
|
+
|
|
184
|
+
For the route-oriented mental model, also see [Page Route Guide](/frontend/page-route-guide).
|
|
185
|
+
|
|
186
|
+
### 5. State sharing is more architecture-driven
|
|
187
|
+
|
|
188
|
+
Vue projects often combine several independent techniques:
|
|
189
|
+
|
|
190
|
+
- props and emits
|
|
191
|
+
- composables
|
|
192
|
+
- `provide/inject`
|
|
193
|
+
- store layers
|
|
194
|
+
|
|
195
|
+
Zova tries to keep more of that within the bean and scope architecture, so the first question becomes less "which unrelated mechanism should I use?" and more "which bean owns this state and which scope should that bean live in?"
|
|
196
|
+
|
|
197
|
+
### 6. Render is controller-oriented, not only component-file-oriented
|
|
198
|
+
|
|
199
|
+
A Vue reader might assume that moving code out of a large page means immediately creating more composables or child components.
|
|
200
|
+
|
|
201
|
+
In Zova, a common growth path is:
|
|
202
|
+
|
|
203
|
+
- start with a single page controller
|
|
204
|
+
- split render into a render bean when the page grows
|
|
205
|
+
- split style into a style bean when needed
|
|
206
|
+
- extract business state or logic into service beans when that becomes clearer
|
|
207
|
+
|
|
208
|
+
That growth path is one of the main reasons you should read Zova pages through the page/controller architecture instead of through a generic component-file lens.
|
|
209
|
+
|
|
210
|
+
## A practical reading order for Vue developers
|
|
211
|
+
|
|
212
|
+
If you want the shortest path from Vue familiarity to Zova fluency, use this order:
|
|
213
|
+
|
|
214
|
+
1. [Foundation](/frontend/foundation)
|
|
215
|
+
2. [Design Principles](/frontend/design-principles)
|
|
216
|
+
3. [IoC and Beans](/frontend/ioc-and-beans)
|
|
217
|
+
4. [Page Guide](/frontend/page-guide)
|
|
218
|
+
5. [Component Guide](/frontend/component-guide)
|
|
219
|
+
6. [Model Architecture](/frontend/model-architecture)
|
|
220
|
+
7. [Page Route Guide](/frontend/page-route-guide)
|
|
221
|
+
8. [Behavior Guide](/frontend/behavior-guide)
|
|
222
|
+
|
|
223
|
+
Use this order when:
|
|
224
|
+
|
|
225
|
+
- you already know Vue
|
|
226
|
+
- you want to read Zova source code accurately
|
|
227
|
+
- you want to avoid rewriting framework-specific code back toward generic Vue habits
|
|
228
|
+
|
|
229
|
+
## Common mistakes to avoid
|
|
230
|
+
|
|
231
|
+
### Mistake 1: "This should become a normal Vue SFC"
|
|
232
|
+
|
|
233
|
+
Usually the better question is whether the existing controller, render bean, style bean, or service/model bean boundaries are already the intended Zova architecture.
|
|
234
|
+
|
|
235
|
+
### Mistake 2: "If I do not see `ref`, there is no real reactivity"
|
|
236
|
+
|
|
237
|
+
The reactive foundation is still there. The framework is simply exposing a different authoring surface.
|
|
238
|
+
|
|
239
|
+
### Mistake 3: "IoC only matters for dependency injection"
|
|
240
|
+
|
|
241
|
+
In Zova, IoC is tied to structure, sharing scope, extensibility, and long-term maintainability.
|
|
242
|
+
|
|
243
|
+
### Mistake 4: "Route state should always be pulled locally by composables"
|
|
244
|
+
|
|
245
|
+
For page controllers, route-aware behavior is deliberately pushed into the controller surface so the page model stays cohesive.
|
|
246
|
+
|
|
247
|
+
### Mistake 5: "Model state is just another local store choice"
|
|
248
|
+
|
|
249
|
+
The model layer is one of Zova’s larger architectural answers for unified state categories, SSR-aware state handling, caching, and persistence-oriented behavior.
|
|
250
|
+
|
|
251
|
+
## Edition note
|
|
252
|
+
|
|
253
|
+
This reading guide is about the shared Zova frontend architecture, not about one UI library.
|
|
254
|
+
|
|
255
|
+
That means the architectural reading model applies across Cabloy Basic and Cabloy Start. However, UI-sensitive examples can still diverge:
|
|
256
|
+
|
|
257
|
+
- Cabloy Basic public examples currently align with DaisyUI + Tailwind CSS
|
|
258
|
+
- Cabloy Start aligns with Vuetify-oriented UI workflows and may differ in modules, SSR site baselines, and project assets
|
|
259
|
+
|
|
260
|
+
So when your task becomes UI-specific rather than architecture-specific, detect the active edition before assuming a component or theme workflow.
|
|
261
|
+
|
|
262
|
+
## Final takeaway
|
|
263
|
+
|
|
264
|
+
If Vue teaches you to think in terms of reactive primitives and local composition, Zova asks you to think in terms of reactive framework-managed objects with explicit architectural roles.
|
|
265
|
+
|
|
266
|
+
That is the mental shift that makes the rest of the source tree much easier to read.
|
|
@@ -27,6 +27,8 @@ These layers define the server-data abstraction ladder:
|
|
|
27
27
|
|
|
28
28
|
Use `$fetch` when you need a relatively direct HTTP-oriented access path.
|
|
29
29
|
|
|
30
|
+
When the transport concern itself needs framework-level handling such as auth headers, response-envelope normalization, SSR short-circuiting, or mock fallback, read [Fetch Interceptor Guide](/frontend/fetch-interceptor-guide) together with this page.
|
|
31
|
+
|
|
30
32
|
### `$api`
|
|
31
33
|
|
|
32
34
|
Use `$api` when you want business-oriented service access rather than scattering request details across pages and components.
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# Zova Form Source Reading Map
|
|
2
|
+
|
|
3
|
+
This page is a practical map for contributors and AI workflows that need to read Zova Form source code efficiently.
|
|
4
|
+
|
|
5
|
+
Use this page after [Zova Form Under the Hood](/frontend/zova-form-under-the-hood) when your next question is not the runtime model itself, but which files to read first for a specific form-internals topic.
|
|
6
|
+
|
|
7
|
+
It answers a narrow question:
|
|
8
|
+
|
|
9
|
+
> when I need to understand how Zova Form works internally, which files should I read first, and in what order?
|
|
10
|
+
|
|
11
|
+
Use this page together with:
|
|
12
|
+
|
|
13
|
+
- [Form Guide](/frontend/form-guide)
|
|
14
|
+
- [Zova Form Under the Hood](/frontend/zova-form-under-the-hood)
|
|
15
|
+
- [Zova Source Reading Map](/frontend/zova-source-reading-map)
|
|
16
|
+
- [Behavior Guide](/frontend/behavior-guide)
|
|
17
|
+
- [API Schema Guide](/frontend/api-schema-guide)
|
|
18
|
+
- [Model Resource Owner Pattern](/frontend/model-resource-owner-pattern)
|
|
19
|
+
|
|
20
|
+
> [!TIP]
|
|
21
|
+
> **Zova Form docs path**
|
|
22
|
+
> 1. **[Form Guide](/frontend/form-guide)** — learn the public authoring surface
|
|
23
|
+
> 2. **[Zova Form Under the Hood](/frontend/zova-form-under-the-hood)** — learn how the runtime pieces cooperate
|
|
24
|
+
> 3. **[Zova Form Source Reading Map](/frontend/zova-form-source-reading-map)** — learn which files to read next
|
|
25
|
+
>
|
|
26
|
+
> **You are here:** step 3.
|
|
27
|
+
> **Previous page:** [Zova Form Under the Hood](/frontend/zova-form-under-the-hood).
|
|
28
|
+
|
|
29
|
+
## Why this page exists
|
|
30
|
+
|
|
31
|
+
The `a-form` module sits at the intersection of several Zova concerns at once:
|
|
32
|
+
|
|
33
|
+
- controller-oriented component design
|
|
34
|
+
- schema-driven rendering
|
|
35
|
+
- Zod and TanStack validation
|
|
36
|
+
- behavior-based field wrapping
|
|
37
|
+
- resource-driven CRUD page integration
|
|
38
|
+
|
|
39
|
+
Because of that, form documentation now has three distinct layers:
|
|
40
|
+
|
|
41
|
+
- [Form Guide](/frontend/form-guide) explains how to author forms
|
|
42
|
+
- [Zova Form Under the Hood](/frontend/zova-form-under-the-hood) explains how the runtime pieces cooperate
|
|
43
|
+
- this page explains which files to read first for each source-reading question
|
|
44
|
+
|
|
45
|
+
Because of that, source reading can become slow for one predictable reason:
|
|
46
|
+
|
|
47
|
+
- you can find one relevant file such as the form controller
|
|
48
|
+
- but you do not yet know the shortest accurate path to the next runtime layer
|
|
49
|
+
|
|
50
|
+
This page gives a compact reading order so you can move from public surface to runtime detail without drifting.
|
|
51
|
+
|
|
52
|
+
## How to use this page
|
|
53
|
+
|
|
54
|
+
For each topic below:
|
|
55
|
+
|
|
56
|
+
1. start with the public guide to refresh the architectural intent
|
|
57
|
+
2. read the first source file to identify the public surface
|
|
58
|
+
3. continue into the next runtime file only if you still need the implementation detail
|
|
59
|
+
4. stop as soon as you have enough information for the task
|
|
60
|
+
|
|
61
|
+
The goal is not to read the entire form stack every time. The goal is to choose the shortest correct path.
|
|
62
|
+
|
|
63
|
+
## 1. Public form surface and wrapper entrypoints
|
|
64
|
+
|
|
65
|
+
Use this path when you are asking questions like:
|
|
66
|
+
|
|
67
|
+
- what is the public Zova Form surface?
|
|
68
|
+
- where do `ZForm` and `ZFormField` enter the runtime?
|
|
69
|
+
- how does `controllerRef` reach the controller instance?
|
|
70
|
+
|
|
71
|
+
### Read the docs first
|
|
72
|
+
|
|
73
|
+
- [Form Guide](/frontend/form-guide)
|
|
74
|
+
- [Component Guide](/frontend/component-guide)
|
|
75
|
+
- [Reading Zova for Vue Developers](/frontend/reading-zova-for-vue-developers)
|
|
76
|
+
|
|
77
|
+
### Then read source in this order
|
|
78
|
+
|
|
79
|
+
1. `zova/src/suite-vendor/a-zova/modules/a-form/src/.metadata/component/form.ts`
|
|
80
|
+
2. `zova/src/suite-vendor/a-zova/modules/a-form/src/.metadata/component/formField.ts`
|
|
81
|
+
3. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/form/controller.tsx`
|
|
82
|
+
4. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/formField/controller.tsx`
|
|
83
|
+
5. `zova/packages-zova/zova-core/src/composables/useController.ts`
|
|
84
|
+
|
|
85
|
+
### What each file clarifies
|
|
86
|
+
|
|
87
|
+
- metadata wrapper files show how the public component wrappers enter `useController(...)`
|
|
88
|
+
- `form.ts` exposes `ZForm` and its typed controller-facing props surface
|
|
89
|
+
- `formField.ts` exposes `ZFormField` and the controller-aware slot contract
|
|
90
|
+
- `useController.ts` shows how the controller instance is created and bound to the wrapper component lifecycle
|
|
91
|
+
|
|
92
|
+
## 2. Form controller ownership and form runtime
|
|
93
|
+
|
|
94
|
+
Use this path when you are asking questions like:
|
|
95
|
+
|
|
96
|
+
- where is the form instance created?
|
|
97
|
+
- where does `formState` come from?
|
|
98
|
+
- how does `submit()` or `reset()` work in Zova Form?
|
|
99
|
+
|
|
100
|
+
### Read the docs first
|
|
101
|
+
|
|
102
|
+
- [Form Guide](/frontend/form-guide)
|
|
103
|
+
- [Zod Guide](/frontend/zod-guide)
|
|
104
|
+
|
|
105
|
+
### Then read source in this order
|
|
106
|
+
|
|
107
|
+
1. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/form/controller.tsx`
|
|
108
|
+
2. `zova/src/suite-vendor/a-zova/modules/a-form/src/lib/beanControllerFormBase.ts`
|
|
109
|
+
3. `zova/src/suite-vendor/a-zova/modules/a-form/src/lib/beanControllerPageFormBase.ts`
|
|
110
|
+
4. `zova/src/suite-vendor/a-zova/modules/a-form/src/types/form.ts`
|
|
111
|
+
|
|
112
|
+
### What each file clarifies
|
|
113
|
+
|
|
114
|
+
- `component/form/controller.tsx` is the main form runtime owner
|
|
115
|
+
- `beanControllerFormBase.ts` shows the shared `$useForm(...)` wrapper around TanStack Form
|
|
116
|
+
- `beanControllerPageFormBase.ts` shows the page-controller-oriented variant for form pages
|
|
117
|
+
- `types/form.ts` shows the exposed type contracts for submit data, state, and events
|
|
118
|
+
|
|
119
|
+
## 3. Field controller ownership and field render flow
|
|
120
|
+
|
|
121
|
+
Use this path when you are asking questions like:
|
|
122
|
+
|
|
123
|
+
- how is one field connected to the parent form?
|
|
124
|
+
- where do `setValue(...)` and `handleBlur()` live?
|
|
125
|
+
- how does one field become a rendered vnode?
|
|
126
|
+
|
|
127
|
+
### Read the docs first
|
|
128
|
+
|
|
129
|
+
- [Form Guide](/frontend/form-guide)
|
|
130
|
+
- [Behavior Guide](/frontend/behavior-guide)
|
|
131
|
+
|
|
132
|
+
### Then read source in this order
|
|
133
|
+
|
|
134
|
+
1. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/formField/controller.tsx`
|
|
135
|
+
2. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/formField/render.tsx`
|
|
136
|
+
3. `zova/src/suite-vendor/a-zova/modules/a-form/src/types/formField.ts`
|
|
137
|
+
4. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/formFieldPreset/controller.tsx`
|
|
138
|
+
5. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/formFieldBlank/controller.tsx`
|
|
139
|
+
|
|
140
|
+
### What each file clarifies
|
|
141
|
+
|
|
142
|
+
- `formField/controller.tsx` is the field runtime owner and host-injected child of the form controller
|
|
143
|
+
- `formField/render.tsx` shows the final render handoff through behaviors and `zovaJsx.render(...)`
|
|
144
|
+
- `types/formField.ts` shows field options, layout options, render context, and the `$$FieldProps` marker
|
|
145
|
+
- `formFieldPreset/controller.tsx` shows the preset-driven delegation path
|
|
146
|
+
- `formFieldBlank/controller.tsx` shows the free-row slot-only path
|
|
147
|
+
|
|
148
|
+
## 4. Schema-driven rendering and CEL/JSX resolution
|
|
149
|
+
|
|
150
|
+
Use this path when you are asking questions like:
|
|
151
|
+
|
|
152
|
+
- how does a schema become rendered fields?
|
|
153
|
+
- where do field props come from?
|
|
154
|
+
- how are metadata expressions or render providers resolved?
|
|
155
|
+
|
|
156
|
+
### Read the docs first
|
|
157
|
+
|
|
158
|
+
- [API Schema Guide](/frontend/api-schema-guide)
|
|
159
|
+
- [Form Guide](/frontend/form-guide)
|
|
160
|
+
|
|
161
|
+
### Then read source in this order
|
|
162
|
+
|
|
163
|
+
1. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/form/controller.tsx`
|
|
164
|
+
2. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/form/render.tsx`
|
|
165
|
+
3. `zova/src/suite-vendor/a-zova/modules/a-form/src/types/formField.ts`
|
|
166
|
+
|
|
167
|
+
### What each file clarifies
|
|
168
|
+
|
|
169
|
+
- `form/controller.tsx` shows schema property loading, field CEL scope creation, and top-level field prop extraction
|
|
170
|
+
- `form/render.tsx` shows how schema properties become children when the form body is not manually overridden
|
|
171
|
+
- `types/formField.ts` shows the field render-context shapes that the runtime passes through to renderers and behaviors
|
|
172
|
+
|
|
173
|
+
## 5. Validation, submit flow, and server error normalization
|
|
174
|
+
|
|
175
|
+
Use this path when you are asking questions like:
|
|
176
|
+
|
|
177
|
+
- where is submit wired?
|
|
178
|
+
- how are form-level and field-level validators chosen?
|
|
179
|
+
- how are server validation errors pushed back into the form state?
|
|
180
|
+
|
|
181
|
+
### Read the docs first
|
|
182
|
+
|
|
183
|
+
- [Form Guide](/frontend/form-guide)
|
|
184
|
+
- [Zod Guide](/frontend/zod-guide)
|
|
185
|
+
|
|
186
|
+
### Then read source in this order
|
|
187
|
+
|
|
188
|
+
1. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/form/controller.tsx`
|
|
189
|
+
2. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/formField/controller.tsx`
|
|
190
|
+
3. `zova/src/suite-vendor/a-zova/modules/a-form/src/types/form.ts`
|
|
191
|
+
|
|
192
|
+
### What each file clarifies
|
|
193
|
+
|
|
194
|
+
- `form/controller.tsx` shows `submit(...)`, `_createForm()`, `onSubmitInvalid`, `onSubmitData`, and error normalization
|
|
195
|
+
- `formField/controller.tsx` shows how field validators are derived from Zod schema or explicit field options
|
|
196
|
+
- `types/form.ts` shows the public event and submit-type contracts that the rest of the framework consumes
|
|
197
|
+
|
|
198
|
+
## 6. Provider config, default renderers, and behavior-based layout
|
|
199
|
+
|
|
200
|
+
Use this path when you are asking questions like:
|
|
201
|
+
|
|
202
|
+
- where does the default `Input` renderer come from?
|
|
203
|
+
- how does `formProvider` affect field rendering?
|
|
204
|
+
- where do form-field layout behaviors enter the pipeline?
|
|
205
|
+
|
|
206
|
+
### Read the docs first
|
|
207
|
+
|
|
208
|
+
- [Form Guide](/frontend/form-guide)
|
|
209
|
+
- [Behavior Guide](/frontend/behavior-guide)
|
|
210
|
+
|
|
211
|
+
### Then read source in this order
|
|
212
|
+
|
|
213
|
+
1. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/formField/controller.tsx`
|
|
214
|
+
2. `zova/src/suite/cabloy-basic/modules/basic-adapter/src/config/config.ts`
|
|
215
|
+
3. `zova/src/suite/a-home/modules/home-login/src/page/login/render.tsx`
|
|
216
|
+
4. `zova/src/suite-vendor/a-zova/modules/a-form/src/component/formField/render.tsx`
|
|
217
|
+
|
|
218
|
+
### What each file clarifies
|
|
219
|
+
|
|
220
|
+
- `formField/controller.tsx` shows how field props, layout, options, provider config, and behaviors are merged
|
|
221
|
+
- `basic-adapter/src/config/config.ts` shows the default Basic provider components and layout behaviors
|
|
222
|
+
- `home-login/render.tsx` shows a page-level `formProvider` override for layout behavior
|
|
223
|
+
- `formField/render.tsx` shows how the behavior-wrapped render path leads to the final vnode
|
|
224
|
+
|
|
225
|
+
## 7. Resource-driven CRUD page integration
|
|
226
|
+
|
|
227
|
+
Use this path when you are asking questions like:
|
|
228
|
+
|
|
229
|
+
- how does a resource page feed schema and data into `ZForm`?
|
|
230
|
+
- where do `formMeta`, `formSchema`, and `formProvider` come from in CRUD pages?
|
|
231
|
+
- how does submit delegate back to resource mutation logic?
|
|
232
|
+
|
|
233
|
+
### Read the docs first
|
|
234
|
+
|
|
235
|
+
- [Form Guide](/frontend/form-guide)
|
|
236
|
+
- [Model Resource Owner Pattern](/frontend/model-resource-owner-pattern)
|
|
237
|
+
- [Tutorial 2: Create Your First CRUD](/fullstack/tutorial-2-first-crud)
|
|
238
|
+
- [Tutorial 3: Frontend Metadata Sharing](/fullstack/tutorial-3-frontend-metadata-sharing)
|
|
239
|
+
|
|
240
|
+
### Then read source in this order
|
|
241
|
+
|
|
242
|
+
1. `zova/src/suite/cabloy-basic/modules/basic-pageentry/src/component/blockPageEntry/controller.tsx`
|
|
243
|
+
2. `zova/src/suite/cabloy-basic/modules/basic-pageentry/src/component/blockForm/controller.tsx`
|
|
244
|
+
3. `zova/src/suite-vendor/a-zova/modules/a-form/src/lib/utils.ts`
|
|
245
|
+
4. `zova/src/suite/cabloy-basic/modules/basic-page/src/component/blockFilter/controller.tsx`
|
|
246
|
+
|
|
247
|
+
### What each file clarifies
|
|
248
|
+
|
|
249
|
+
- `blockPageEntry/controller.tsx` shows the resource-driven CRUD form orchestration path
|
|
250
|
+
- `blockForm/controller.tsx` shows how a block-level wrapper passes schema/data/provider/meta into `ZForm`
|
|
251
|
+
- `lib/utils.ts` shows the canonical scene-to-form-meta translation helpers
|
|
252
|
+
- `blockFilter/controller.tsx` shows the lighter-weight filter-form branch using the same form module
|
|
253
|
+
|
|
254
|
+
## 8. Representative specimens to read before editing the framework
|
|
255
|
+
|
|
256
|
+
Use this section when you want one small example before reading the framework internals.
|
|
257
|
+
|
|
258
|
+
### Read these specimens first
|
|
259
|
+
|
|
260
|
+
1. `zova/src/suite/a-demo/modules/demo-basic/src/page/toolOne/controller.tsx`
|
|
261
|
+
2. `zova/src/suite/a-demo/modules/demo-basic/src/page/toolOne/render.tsx`
|
|
262
|
+
3. `zova/src/suite/a-home/modules/home-login/src/page/login/render.tsx`
|
|
263
|
+
|
|
264
|
+
### Why these three specimens matter
|
|
265
|
+
|
|
266
|
+
- `toolOne` shows both schema-driven and manual form usage in one page
|
|
267
|
+
- `home-login` shows a real page using presets, blank rows, and provider-level layout override
|
|
268
|
+
- together they give you the public authoring shape before you descend into the form runtime
|
|
269
|
+
|
|
270
|
+
## 9. A compact reading strategy
|
|
271
|
+
|
|
272
|
+
When in doubt, use this order:
|
|
273
|
+
|
|
274
|
+
1. [Form Guide](/frontend/form-guide)
|
|
275
|
+
2. one real usage specimen such as `toolOne` or `home-login`
|
|
276
|
+
3. the public wrapper metadata under `src/.metadata/component/*.ts`
|
|
277
|
+
4. `component/form/controller.tsx`
|
|
278
|
+
5. `component/formField/controller.tsx`
|
|
279
|
+
6. render beans, types, and integration layers only if you still need more detail
|
|
280
|
+
|
|
281
|
+
That order usually gets you to the answer faster than starting from the deepest runtime files first.
|
|
282
|
+
|
|
283
|
+
## 10. Final takeaway
|
|
284
|
+
|
|
285
|
+
The fastest way to read Zova Form accurately is not to memorize every file in `a-form`.
|
|
286
|
+
|
|
287
|
+
It is to recognize which question you are asking:
|
|
288
|
+
|
|
289
|
+
- public wrapper question
|
|
290
|
+
- form-runtime question
|
|
291
|
+
- field-render question
|
|
292
|
+
- validation question
|
|
293
|
+
- resource-CRUD integration question
|
|
294
|
+
|
|
295
|
+
Then start from the smallest public file that matches that question and only descend into deeper runtime files as needed.
|