cabloy 5.1.51 → 5.1.53
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-contract-loop/SKILL.md +1 -1
- package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +11 -1
- package/.claude/skills/cabloy-workflow/SKILL.md +8 -4
- package/.claude/skills/cabloy-workflow/references/edition-detection.md +3 -2
- package/.github/workflows/docs-pages.yml +2 -0
- package/CHANGELOG.md +42 -0
- package/CLAUDE.md +7 -4
- package/README.md +36 -21
- package/cabloy-docs/.vitepress/config.mjs +171 -44
- package/cabloy-docs/ai/class-placement-rule.md +1 -0
- package/cabloy-docs/ai/cli-for-agents.md +1 -1
- package/cabloy-docs/ai/docs-skills-rules-mapping.md +1 -0
- package/cabloy-docs/ai/edition-consistency-checklist.md +150 -0
- package/cabloy-docs/ai/edition-detection.md +3 -3
- package/cabloy-docs/ai/global-bean-lookup.md +1 -0
- package/cabloy-docs/ai/introduction.md +47 -3
- package/cabloy-docs/ai/repo-guidance.md +2 -2
- package/cabloy-docs/ai/rules-and-config.md +1 -1
- package/cabloy-docs/ai/skills.md +2 -0
- package/cabloy-docs/ai/verification.md +1 -0
- package/cabloy-docs/ai/virtual-decorator-guidance.md +206 -0
- package/cabloy-docs/backend/introduction.md +2 -2
- package/cabloy-docs/backend/logger-guide.md +1 -1
- package/cabloy-docs/backend/quickstart.md +3 -3
- package/cabloy-docs/editions/cabloy-basic.md +4 -3
- package/cabloy-docs/editions/cabloy-start.md +34 -3
- package/cabloy-docs/editions/choosing-between-basic-and-start.md +84 -0
- package/cabloy-docs/editions/overview.md +114 -20
- package/cabloy-docs/frontend/css-in-js-guide.md +1 -1
- package/cabloy-docs/frontend/environment-config-guide.md +28 -0
- package/cabloy-docs/frontend/foundation.md +3 -2
- package/cabloy-docs/frontend/introduction.md +73 -4
- package/cabloy-docs/frontend/navigation-guards-guide.md +1 -1
- package/cabloy-docs/frontend/quickstart.md +4 -2
- package/cabloy-docs/frontend/scripts.md +2 -2
- package/cabloy-docs/frontend/ssr-env.md +23 -0
- package/cabloy-docs/frontend/theme-guide.md +140 -7
- 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 +3 -2
- package/cabloy-docs/fullstack/introduction.md +84 -34
- package/cabloy-docs/fullstack/quickstart.md +7 -4
- package/cabloy-docs/fullstack/vona-zova-integration.md +2 -2
- package/cabloy-docs/fullstack/vscode-extensions.md +126 -0
- package/cabloy-docs/index.md +39 -40
- package/cabloy-docs/reference/frontend-directory-structure.md +125 -0
- package/cabloy-docs/reference/glossary.md +2 -2
- package/cabloy-docs/reference/introduction.md +47 -0
- package/cabloy-docs/reference/package-map.md +2 -0
- package/cabloy-docs/reference/repo-scripts.md +5 -3
- package/package.json +1 -1
- package/vona/README.md +1 -1
- package/vona/pnpm-lock.yaml +383 -38
- 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/zova/README.md +1 -1
- 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-cli/cli-set-front/src/lib/bean/cli.tools.metadata.ts +1 -1
- package/zova/packages-cli/cli-set-front/src/lib/bean/toolsMetadata/generateConfig.ts +2 -12
- 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/packages-zova/zova-core/src/core/sys/config.ts +1 -1
- package/zova/pnpm-lock.yaml +1607 -1690
- package/zova/src/front/config/config/config.ts +1 -1
- 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/locales.ts +0 -15
- 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/a-devui/modules/devui-adapter/src/bean/meta.themeHandler.ts +1 -0
- package/zova/src/suite/a-home/modules/home-base/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/a-home/modules/home-base/src/service/routerGuards.ts +1 -1
- package/zova/src/suite/a-home/modules/home-base/src/service/ssrLayout.ts +1 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/a-home/modules/home-layoutweb/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/controller.tsx +2 -2
- package/zova/src/suite/a-home/modules/home-login/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/a-home/modules/home-passport/src/model/passport.ts +2 -2
- package/zova/src/suite/cabloy-basic/modules/basic-captcha/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/cabloy-basic/modules/basic-form/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/cabloy-basic/modules/basic-page/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/src/.metadata/locales.ts +0 -15
- package/zova/src/suite/cabloy-basic/modules/basic-table/src/.metadata/locales.ts +0 -15
- package/zova/src/suite-vendor/a-zova/modules/a-interceptor/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-interceptor/src/bean/interceptor.jwt.ts +1 -1
- 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 +8 -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-style/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-style/src/bean/bean.theme.ts +6 -3
- package/zova/src/suite-vendor/a-zova/modules/a-zod/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-zod/src/.metadata/locales.ts +0 -15
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +9 -9
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// eslint-disable
|
|
2
|
+
import type { TypeControllerOptionsActions } from 'vona-module-a-openapi';
|
|
2
3
|
/** interceptor: begin */
|
|
3
4
|
export * from '../bean/interceptor.ssrRedirect.ts';
|
|
4
5
|
export * from '../bean/interceptor.ssrRender.ts';
|
|
@@ -83,13 +84,60 @@ declare module 'vona-module-a-ssr' {
|
|
|
83
84
|
/** bean: end */
|
|
84
85
|
/** bean: begin */
|
|
85
86
|
import type { BeanSsr } from '../bean/bean.ssr.ts';
|
|
86
|
-
import 'vona';
|
|
87
|
+
import 'vona';
|
|
87
88
|
declare module 'vona' {
|
|
88
89
|
export interface IBeanRecordGlobal {
|
|
89
90
|
'ssr': BeanSsr;
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
/** bean: end */
|
|
94
|
+
/** controller: begin */
|
|
95
|
+
export * from '../controller/memoryDiag.ts';
|
|
96
|
+
import type { IControllerOptionsMemoryDiag } from '../controller/memoryDiag.ts';
|
|
97
|
+
import 'vona-module-a-web';
|
|
98
|
+
declare module 'vona-module-a-web' {
|
|
99
|
+
|
|
100
|
+
export interface IControllerRecord {
|
|
101
|
+
'a-ssr:memoryDiag': IControllerOptionsMemoryDiag;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
declare module 'vona-module-a-ssr' {
|
|
107
|
+
|
|
108
|
+
export interface ControllerMemoryDiag {
|
|
109
|
+
/** @internal */
|
|
110
|
+
get scope(): ScopeModuleASsr;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface ControllerMemoryDiag {
|
|
114
|
+
get $beanFullName(): 'a-ssr.controller.memoryDiag';
|
|
115
|
+
get $onionName(): 'a-ssr:memoryDiag';
|
|
116
|
+
get $onionOptions(): IControllerOptionsMemoryDiag;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/** controller: end */
|
|
120
|
+
/** controller: begin */
|
|
121
|
+
// @ts-ignore ignore
|
|
122
|
+
import type { ControllerMemoryDiag } from '../controller/memoryDiag.ts';
|
|
123
|
+
declare module 'vona-module-a-ssr' {
|
|
124
|
+
|
|
125
|
+
export interface IControllerOptionsMemoryDiag {
|
|
126
|
+
actions?: TypeControllerOptionsActions<ControllerMemoryDiag>;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
declare module 'vona-module-a-web' {
|
|
130
|
+
export interface IApiPathGetRecord{
|
|
131
|
+
'/ssr/memoryDiag/stats': undefined;
|
|
132
|
+
}
|
|
133
|
+
export interface IApiPathPostRecord{
|
|
134
|
+
'/ssr/memoryDiag/gc': undefined;
|
|
135
|
+
'/ssr/memoryDiag/heapSnapshot': undefined;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** controller: end */
|
|
93
141
|
/** service: begin */
|
|
94
142
|
export * from '../service/devProxy.ts';
|
|
95
143
|
export * from '../service/ssr.ts';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { IDecoratorControllerOptions } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import inspector from 'node:inspector';
|
|
4
|
+
import v8 from 'node:v8';
|
|
5
|
+
import { BeanBase } from 'vona';
|
|
6
|
+
import { Passport } from 'vona-module-a-user';
|
|
7
|
+
import { Controller, Web } from 'vona-module-a-web';
|
|
8
|
+
|
|
9
|
+
const HEADER_MEMORY_DIAG_TOKEN = 'x-ssr-memory-diag-token';
|
|
10
|
+
const ENV_MEMORY_DIAG_TOKEN = 'SSR_MEMORY_DIAG_TOKEN';
|
|
11
|
+
|
|
12
|
+
export interface IControllerOptionsMemoryDiag extends IDecoratorControllerOptions {}
|
|
13
|
+
|
|
14
|
+
@Controller<IControllerOptionsMemoryDiag>('memoryDiag', {
|
|
15
|
+
exclude: true,
|
|
16
|
+
})
|
|
17
|
+
export class ControllerMemoryDiag extends BeanBase {
|
|
18
|
+
@Web.get('stats')
|
|
19
|
+
@Passport.public()
|
|
20
|
+
async stats() {
|
|
21
|
+
this._checkAccess();
|
|
22
|
+
const mem = process.memoryUsage();
|
|
23
|
+
const heap = v8.getHeapStatistics();
|
|
24
|
+
return {
|
|
25
|
+
pid: process.pid,
|
|
26
|
+
timestamp: Date.now(),
|
|
27
|
+
memoryUsage: {
|
|
28
|
+
rss: mem.rss,
|
|
29
|
+
heapTotal: mem.heapTotal,
|
|
30
|
+
heapUsed: mem.heapUsed,
|
|
31
|
+
external: mem.external,
|
|
32
|
+
arrayBuffers: mem.arrayBuffers,
|
|
33
|
+
},
|
|
34
|
+
heapStatistics: {
|
|
35
|
+
used_heap_size: heap.used_heap_size,
|
|
36
|
+
total_heap_size: heap.total_heap_size,
|
|
37
|
+
total_available_size: heap.total_available_size,
|
|
38
|
+
heap_size_limit: heap.heap_size_limit,
|
|
39
|
+
malloced_memory: heap.malloced_memory,
|
|
40
|
+
number_of_native_contexts: heap.number_of_native_contexts,
|
|
41
|
+
number_of_detached_contexts: heap.number_of_detached_contexts,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@Web.post('gc')
|
|
47
|
+
@Passport.public()
|
|
48
|
+
async forceGc() {
|
|
49
|
+
this._checkAccess();
|
|
50
|
+
const session = new inspector.Session();
|
|
51
|
+
session.connect();
|
|
52
|
+
try {
|
|
53
|
+
await this._postHeapProfiler(session, 'HeapProfiler.enable');
|
|
54
|
+
await this._postHeapProfiler(session, 'HeapProfiler.collectGarbage');
|
|
55
|
+
} finally {
|
|
56
|
+
session.disconnect();
|
|
57
|
+
}
|
|
58
|
+
return await this.stats();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@Web.post('heapSnapshot')
|
|
62
|
+
@Passport.public()
|
|
63
|
+
async heapSnapshot() {
|
|
64
|
+
this._checkAccess();
|
|
65
|
+
const fileName = v8.writeHeapSnapshot(
|
|
66
|
+
`/tmp/heapdump-${process.pid}-${Date.now()}.heapsnapshot`,
|
|
67
|
+
);
|
|
68
|
+
return { pid: process.pid, file: fileName };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private _postHeapProfiler(session: inspector.Session, method: string): Promise<void> {
|
|
72
|
+
return new Promise<void>(function postHeapProfiler(resolve, reject) {
|
|
73
|
+
session.post(method, function onPost(err) {
|
|
74
|
+
if (err) {
|
|
75
|
+
reject(err);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
resolve();
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private _checkAccess() {
|
|
84
|
+
const token = process.env[ENV_MEMORY_DIAG_TOKEN];
|
|
85
|
+
if (!token) {
|
|
86
|
+
if (!this.app.meta.isDev && !this.app.meta.isTest) {
|
|
87
|
+
this.app.throw(403);
|
|
88
|
+
}
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const tokenHeader = this.ctx.get(HEADER_MEMORY_DIAG_TOKEN);
|
|
93
|
+
if (tokenHeader !== token) {
|
|
94
|
+
this.app.throw(403);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
package/zova/README.md
CHANGED
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@cabloy/lint": "^5.1.27",
|
|
69
69
|
"@cabloy/openapi-typescript": "^7.9.2",
|
|
70
|
-
"@quasar/app-vite": "npm:@cabloy/quasar-app-vite@^2.5.
|
|
70
|
+
"@quasar/app-vite": "npm:@cabloy/quasar-app-vite@^2.5.10",
|
|
71
71
|
"@types/node": "^22.19.17",
|
|
72
72
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
73
73
|
"concurrently": "^8.2.2",
|
|
74
|
-
"quasar-app-extension-zova": "^1.3.
|
|
74
|
+
"quasar-app-extension-zova": "^1.3.1",
|
|
75
75
|
"sass": "^1.99.0",
|
|
76
76
|
"typescript": "^5.9.3",
|
|
77
77
|
"vite": "^8.0.14",
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
},
|
|
92
92
|
"pnpm": {
|
|
93
93
|
"overrides": {
|
|
94
|
-
"@quasar/app-vite": "npm:@cabloy/quasar-app-vite@^2.5.
|
|
94
|
+
"@quasar/app-vite": "npm:@cabloy/quasar-app-vite@^2.5.10",
|
|
95
95
|
"@vue/babel-plugin-jsx": "npm:@cabloy/vue-babel-plugin-jsx@^2.0.1",
|
|
96
96
|
"@vue/compiler-sfc": "npm:@cabloy/vue-compiler-sfc@^3.5.14",
|
|
97
|
-
"@vue/runtime-core": "npm:@cabloy/vue-runtime-core@^3.5.
|
|
97
|
+
"@vue/runtime-core": "npm:@cabloy/vue-runtime-core@^3.5.57",
|
|
98
98
|
"@vue/runtime-dom": "npm:@cabloy/vue-runtime-dom@^3.5.13",
|
|
99
99
|
"@vue/reactivity": "npm:@cabloy/vue-reactivity@^3.5.16",
|
|
100
100
|
"@vue/server-renderer": "npm:@cabloy/vue-server-renderer@^3.5.18",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.75",
|
|
4
4
|
"gitHead": "6f675a8cc46d596142c591c28a40cc4d82fcc6cc",
|
|
5
5
|
"description": "zova cli",
|
|
6
6
|
"keywords": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@cabloy/process-helper": "^3.0.0",
|
|
45
45
|
"fs-extra": "^11.3.5",
|
|
46
46
|
"semver": "^7.6.2",
|
|
47
|
-
"zova-cli-set-front": "^1.2.
|
|
47
|
+
"zova-cli-set-front": "^1.2.73"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-cli-set-front",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.73",
|
|
4
4
|
"gitHead": "6f675a8cc46d596142c591c28a40cc4d82fcc6cc",
|
|
5
5
|
"description": "zova cli-set-front",
|
|
6
6
|
"keywords": [
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"vite": "^8.0.14",
|
|
71
71
|
"yaml": "^2.8.3",
|
|
72
72
|
"zova-openapi": "^1.1.14",
|
|
73
|
-
"zova-vite": "^1.1.
|
|
73
|
+
"zova-vite": "^1.1.35"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"clean-package": "^2.2.0",
|
|
@@ -168,7 +168,7 @@ export class CliToolsMetadata extends BeanCliBase {
|
|
|
168
168
|
const contentConstants = await generateConstant(modulePath);
|
|
169
169
|
content += contentConstants;
|
|
170
170
|
// locale
|
|
171
|
-
const contentLocales1 = await generateLocale1(modulePath
|
|
171
|
+
const contentLocales1 = await generateLocale1(modulePath);
|
|
172
172
|
const contentLocales2 = await generateLocale2(contentLocales1);
|
|
173
173
|
content += contentLocales2;
|
|
174
174
|
// error
|
|
@@ -26,7 +26,7 @@ import { constants } from '../config/constants.js';
|
|
|
26
26
|
return content;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export async function generateLocale1(modulePath: string
|
|
29
|
+
export async function generateLocale1(modulePath: string) {
|
|
30
30
|
const files = await globby('src/config/locale/*.ts', { cwd: modulePath });
|
|
31
31
|
if (files.length === 0) return '';
|
|
32
32
|
files.sort();
|
|
@@ -39,21 +39,11 @@ export async function generateLocale1(modulePath: string, moduleName: string) {
|
|
|
39
39
|
contentLocales.push(` '${localeName}': ${className},`);
|
|
40
40
|
}
|
|
41
41
|
// combine
|
|
42
|
-
const content =
|
|
43
|
-
import { useApp, useComputed } from 'zova';
|
|
44
|
-
${contentImports.join('\n')}
|
|
42
|
+
const content = `${contentImports.join('\n')}
|
|
45
43
|
|
|
46
44
|
export const locales = {
|
|
47
45
|
${contentLocales.join('\n')}
|
|
48
46
|
};
|
|
49
|
-
|
|
50
|
-
export function $useLocale<K extends keyof (typeof locales)[TypeLocaleBase]>(key: K, ...args: any[]) {
|
|
51
|
-
const app = useApp();
|
|
52
|
-
const str = \`${moduleName}::\${key}\`;
|
|
53
|
-
return useComputed(() => {
|
|
54
|
-
return app.meta.text(str, ...args);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
47
|
`;
|
|
58
48
|
return content;
|
|
59
49
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-jsx",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.56",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "Zova JSX",
|
|
6
6
|
"keywords": [
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@cabloy/word-utils": "^2.1.14",
|
|
51
51
|
"typestyle": "^2.4.0",
|
|
52
52
|
"vue": "^3.5.32",
|
|
53
|
-
"zova-core": "^5.1.
|
|
53
|
+
"zova-core": "^5.1.50"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-vite",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.35",
|
|
4
4
|
"gitHead": "09d901d17140a80ee0764211b441cda72fd94663",
|
|
5
5
|
"description": "zova vite",
|
|
6
6
|
"keywords": [
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@cabloy/vue-compiler-sfc": "^3.5.14",
|
|
50
50
|
"@cabloy/vue-reactivity": "^3.5.16",
|
|
51
51
|
"@cabloy/vue-router": "^4.4.16",
|
|
52
|
-
"@cabloy/vue-runtime-core": "^3.5.
|
|
52
|
+
"@cabloy/vue-runtime-core": "^3.5.57",
|
|
53
53
|
"@cabloy/vue-runtime-dom": "^3.5.13",
|
|
54
54
|
"@cabloy/vue-server-renderer": "^3.5.18",
|
|
55
55
|
"@faker-js/faker": "^8.4.1",
|
|
@@ -7,11 +7,11 @@ export class ControllerPageApp extends BeanControllerPageBase {
|
|
|
7
7
|
// app
|
|
8
8
|
const instance = getCurrentInstance();
|
|
9
9
|
const app = instance!.appContext.app!;
|
|
10
|
-
if (
|
|
11
|
-
await this.initApp(app);
|
|
12
|
-
} else {
|
|
10
|
+
if (app.zova) {
|
|
13
11
|
await this.updateApp(app.zova);
|
|
12
|
+
return;
|
|
14
13
|
}
|
|
14
|
+
await this.initApp(app);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
protected render() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.95",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "A vue3 framework with ioc",
|
|
6
6
|
"keywords": [
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"postpack": "clean-package restore"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"zova-core": "^5.1.
|
|
49
|
-
"zova-suite-a-zova": "^5.1.
|
|
48
|
+
"zova-core": "^5.1.50",
|
|
49
|
+
"zova-suite-a-zova": "^5.1.94"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"clean-package": "^2.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-core",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.50",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "A vue3 framework with ioc",
|
|
6
6
|
"keywords": [
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@cabloy/vue-compiler-sfc": "^3.5.14",
|
|
57
57
|
"@cabloy/vue-reactivity": "^3.5.16",
|
|
58
58
|
"@cabloy/vue-router": "^4.4.16",
|
|
59
|
-
"@cabloy/vue-runtime-core": "^3.5.
|
|
59
|
+
"@cabloy/vue-runtime-core": "^3.5.57",
|
|
60
60
|
"@cabloy/vue-runtime-dom": "^3.5.13",
|
|
61
61
|
"@cabloy/vue-server-renderer": "^3.5.18",
|
|
62
62
|
"@cabloy/word-utils": "^2.1.14",
|
|
@@ -103,7 +103,7 @@ export class BeanContainer {
|
|
|
103
103
|
beanInstance,
|
|
104
104
|
);
|
|
105
105
|
this.runWithInstanceScopeOrAppContext(() => {
|
|
106
|
-
beanInstance.__dispose__();
|
|
106
|
+
return beanInstance.__dispose__();
|
|
107
107
|
});
|
|
108
108
|
this.app.meta.module._monkeyModuleSync(
|
|
109
109
|
false,
|
|
@@ -630,8 +630,8 @@ export class BeanContainer {
|
|
|
630
630
|
await this.app?.meta.module._monkeyModule(true, 'beanInit', undefined, this, beanInstance);
|
|
631
631
|
}
|
|
632
632
|
if (!(beanInstance instanceof BeanAopBase) && beanInstance.__init__) {
|
|
633
|
-
await this.runWithInstanceScopeOrAppContext(
|
|
634
|
-
|
|
633
|
+
await this.runWithInstanceScopeOrAppContext(() => {
|
|
634
|
+
return beanInstance.__init__(...args);
|
|
635
635
|
});
|
|
636
636
|
}
|
|
637
637
|
if (this.containerType === 'sys') {
|
|
@@ -186,8 +186,8 @@ export class AppModule extends BeanSimple {
|
|
|
186
186
|
const mainInstance = this.mainInstances[moduleTarget.info.relativeName];
|
|
187
187
|
if (mainInstance && mainInstance[monkeyName]) {
|
|
188
188
|
// @ts-ignore ignore
|
|
189
|
-
await this.app.vue.runWithContext(
|
|
190
|
-
|
|
189
|
+
await this.app.vue.runWithContext(() => {
|
|
190
|
+
return mainInstance[monkeyName](...monkeyData);
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
}
|
|
@@ -197,13 +197,13 @@ export class AppModule extends BeanSimple {
|
|
|
197
197
|
if (moduleMonkey.info.capabilities?.monkey) {
|
|
198
198
|
const monkeyInstance = this.monkeyInstances[key];
|
|
199
199
|
if (monkeyInstance && monkeyInstance[monkeyName]) {
|
|
200
|
-
await this.app.vue.runWithContext(
|
|
200
|
+
await this.app.vue.runWithContext(() => {
|
|
201
201
|
if (moduleTarget === undefined) {
|
|
202
202
|
// @ts-ignore ignore
|
|
203
|
-
|
|
203
|
+
return monkeyInstance[monkeyName](...monkeyData);
|
|
204
204
|
} else {
|
|
205
205
|
// @ts-ignore ignore
|
|
206
|
-
|
|
206
|
+
return monkeyInstance[monkeyName](moduleTarget, ...monkeyData);
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
209
|
}
|
|
@@ -212,13 +212,13 @@ export class AppModule extends BeanSimple {
|
|
|
212
212
|
// app monkey
|
|
213
213
|
const appMonkey = this.app.meta.appMonkey;
|
|
214
214
|
if (appMonkey && appMonkey[monkeyName]) {
|
|
215
|
-
await this.app.vue.runWithContext(
|
|
215
|
+
await this.app.vue.runWithContext(() => {
|
|
216
216
|
if (moduleTarget === undefined) {
|
|
217
217
|
// @ts-ignore ignore
|
|
218
|
-
|
|
218
|
+
return appMonkey[monkeyName](...monkeyData);
|
|
219
219
|
} else {
|
|
220
220
|
// @ts-ignore ignore
|
|
221
|
-
|
|
221
|
+
return appMonkey[monkeyName](moduleTarget, ...monkeyData);
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
224
|
}
|
|
@@ -238,8 +238,8 @@ export class AppModule extends BeanSimple {
|
|
|
238
238
|
const mainInstance = this.mainInstances[moduleTarget.info.relativeName];
|
|
239
239
|
if (mainInstance && mainInstance[monkeyName]) {
|
|
240
240
|
// @ts-ignore ignore
|
|
241
|
-
this.app.vue.runWithContext(
|
|
242
|
-
mainInstance[monkeyName](...monkeyData);
|
|
241
|
+
this.app.vue.runWithContext(() => {
|
|
242
|
+
return mainInstance[monkeyName](...monkeyData);
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
}
|
|
@@ -249,13 +249,13 @@ export class AppModule extends BeanSimple {
|
|
|
249
249
|
if (moduleMonkey.info.capabilities?.monkey) {
|
|
250
250
|
const monkeyInstance = this.monkeyInstances[key];
|
|
251
251
|
if (monkeyInstance && monkeyInstance[monkeyName]) {
|
|
252
|
-
this.app.vue.runWithContext(
|
|
252
|
+
this.app.vue.runWithContext(() => {
|
|
253
253
|
if (moduleTarget === undefined) {
|
|
254
254
|
// @ts-ignore ignore
|
|
255
|
-
monkeyInstance[monkeyName](...monkeyData);
|
|
255
|
+
return monkeyInstance[monkeyName](...monkeyData);
|
|
256
256
|
} else {
|
|
257
257
|
// @ts-ignore ignore
|
|
258
|
-
monkeyInstance[monkeyName](moduleTarget, ...monkeyData);
|
|
258
|
+
return monkeyInstance[monkeyName](moduleTarget, ...monkeyData);
|
|
259
259
|
}
|
|
260
260
|
});
|
|
261
261
|
}
|
|
@@ -264,13 +264,13 @@ export class AppModule extends BeanSimple {
|
|
|
264
264
|
// app monkey
|
|
265
265
|
const appMonkey = this.app.meta.appMonkey;
|
|
266
266
|
if (appMonkey && appMonkey[monkeyName]) {
|
|
267
|
-
this.app.vue.runWithContext(
|
|
267
|
+
this.app.vue.runWithContext(() => {
|
|
268
268
|
if (moduleTarget === undefined) {
|
|
269
269
|
// @ts-ignore ignore
|
|
270
|
-
appMonkey[monkeyName](...monkeyData);
|
|
270
|
+
return appMonkey[monkeyName](...monkeyData);
|
|
271
271
|
} else {
|
|
272
272
|
// @ts-ignore ignore
|
|
273
|
-
appMonkey[monkeyName](moduleTarget, ...monkeyData);
|
|
273
|
+
return appMonkey[monkeyName](moduleTarget, ...monkeyData);
|
|
274
274
|
}
|
|
275
275
|
});
|
|
276
276
|
}
|
|
@@ -4,15 +4,21 @@ import { BeanSimple } from '../../bean/beanSimple.ts';
|
|
|
4
4
|
import { BeanControllerIdentifier, BeanRenderIdentifier } from '../../bean/type.ts';
|
|
5
5
|
import { cast } from '../../types/utils/cast.ts';
|
|
6
6
|
|
|
7
|
+
const SymbolTypeSSRRenderOriginal = Symbol('SymbolTypeSSRRenderOriginal');
|
|
8
|
+
const SymbolTypeSSRRenderResetCount = Symbol('SymbolTypeSSRRenderResetCount');
|
|
9
|
+
|
|
7
10
|
export class CtxComponent extends BeanSimple {
|
|
8
11
|
private _bean_render_original: any;
|
|
12
|
+
private _instance_ssrRender_original: any;
|
|
13
|
+
private _renderPatched = false;
|
|
14
|
+
private _ssrRenderReset = false;
|
|
9
15
|
|
|
10
16
|
activate() {
|
|
11
17
|
if (this.ctx.disposed) return;
|
|
12
18
|
const renderMethod = 'render';
|
|
13
|
-
const self = this;
|
|
14
19
|
const instance = cast(this.ctx.instance);
|
|
15
20
|
this._bean_render_original = instance[renderMethod];
|
|
21
|
+
const self = this;
|
|
16
22
|
instance[renderMethod] = function (this, ...args) {
|
|
17
23
|
if (instance.isUnmounted) return;
|
|
18
24
|
if (!self.ctx.meta.state.inited.state) {
|
|
@@ -33,16 +39,42 @@ export class CtxComponent extends BeanSimple {
|
|
|
33
39
|
// return render.render();
|
|
34
40
|
// }
|
|
35
41
|
};
|
|
36
|
-
|
|
42
|
+
this._renderPatched = true;
|
|
43
|
+
const componentType = cast(instance.type);
|
|
44
|
+
const ssrRenderResetCount = componentType[SymbolTypeSSRRenderResetCount] ?? 0;
|
|
45
|
+
if (ssrRenderResetCount === 0) {
|
|
46
|
+
componentType[SymbolTypeSSRRenderOriginal] = componentType.ssrRender;
|
|
47
|
+
componentType.ssrRender = null;
|
|
48
|
+
}
|
|
49
|
+
componentType[SymbolTypeSSRRenderResetCount] = ssrRenderResetCount + 1;
|
|
50
|
+
this._instance_ssrRender_original = instance.ssrRender;
|
|
37
51
|
instance.ssrRender = null;
|
|
52
|
+
this._ssrRenderReset = true;
|
|
38
53
|
}
|
|
39
54
|
|
|
40
55
|
/** @internal */
|
|
41
56
|
public dispose() {
|
|
42
57
|
const renderMethod = 'render';
|
|
43
58
|
const instance = cast(this.ctx.instance);
|
|
44
|
-
|
|
59
|
+
if (this._renderPatched) {
|
|
60
|
+
instance[renderMethod] = this._bean_render_original;
|
|
61
|
+
}
|
|
62
|
+
if (this._ssrRenderReset) {
|
|
63
|
+
instance.ssrRender = this._instance_ssrRender_original;
|
|
64
|
+
const componentType = cast(instance.type);
|
|
65
|
+
const ssrRenderResetCount = componentType[SymbolTypeSSRRenderResetCount] ?? 0;
|
|
66
|
+
if (ssrRenderResetCount <= 1) {
|
|
67
|
+
componentType.ssrRender = componentType[SymbolTypeSSRRenderOriginal];
|
|
68
|
+
componentType[SymbolTypeSSRRenderOriginal] = undefined;
|
|
69
|
+
componentType[SymbolTypeSSRRenderResetCount] = 0;
|
|
70
|
+
} else {
|
|
71
|
+
componentType[SymbolTypeSSRRenderResetCount] = ssrRenderResetCount - 1;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
45
74
|
this._bean_render_original = null;
|
|
75
|
+
this._instance_ssrRender_original = null;
|
|
76
|
+
this._renderPatched = false;
|
|
77
|
+
this._ssrRenderReset = false;
|
|
46
78
|
}
|
|
47
79
|
|
|
48
80
|
private _getRender(): any {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { withCurrentInstanceScope, withCurrentInstanceScopeSSR } from '@cabloy/vue-runtime-core';
|
|
2
2
|
import { pauseTracking, resetTracking } from '@vue/reactivity';
|
|
3
3
|
|
|
4
4
|
import { BeanSimple } from '../../bean/beanSimple.ts';
|
|
@@ -9,17 +9,21 @@ export class CtxUtil extends BeanSimple {
|
|
|
9
9
|
if (this.ctx.disposed) {
|
|
10
10
|
throwErrorComponentUnmounted();
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
try {
|
|
17
|
-
return fn();
|
|
18
|
-
} finally {
|
|
12
|
+
const instance = this.ctx.instance as any;
|
|
13
|
+
const runner = process.env.SERVER ? withCurrentInstanceScopeSSR : withCurrentInstanceScope;
|
|
14
|
+
const result = runner(instance, () => {
|
|
19
15
|
if (!tracking) {
|
|
20
|
-
|
|
16
|
+
pauseTracking();
|
|
21
17
|
}
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
try {
|
|
19
|
+
const result = fn();
|
|
20
|
+
return result;
|
|
21
|
+
} finally {
|
|
22
|
+
if (!tracking) {
|
|
23
|
+
resetTracking();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return result;
|
|
24
28
|
}
|
|
25
29
|
}
|