soma-core 2.2.6 → 2.2.8
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/core/build/compiler/soma-precompile.js +66 -10
- package/core/client/container/IContainerAdapter.ts +4 -0
- package/core/client/container/SomaContainerAdapter.ts +43 -2
- package/core/client/data/data-object-resolver.ts +43 -8
- package/core/client/engine/event-engine.ts +28 -3
- package/core/client/engine/soma-bootstrap.ts +2 -1
- package/core/client/engines/chart/adapter-echarts.ts +75 -2
- package/core/client/engines/chart/index.ts +18 -0
- package/core/client/engines/chart/port.ts +13 -0
- package/core/client/infra/notify/DefaultNotifyService.ts +2 -2
- package/core/client/parser/confirm-spec.ts +99 -6
- package/core/client/parser/data-config-parser.ts +1 -1
- package/core/client/parser/pipeline-parser.ts +2 -1
- package/core/client/render-ports/hide-transition.ts +9 -0
- package/core/client/render-ports/index.ts +4 -0
- package/core/client/render-ports/notify-renderer.ts +2 -1
- package/core/index.ts +16 -4
- package/core/server/api/load-host-service.ts +3 -0
- package/core/server/api/paged-list.ts +259 -0
- package/core/server/host/empty-host-bootstrap.mjs +3 -0
- package/core/server/host/host-assembly.ts +3 -0
- package/core/server/host/source-aliases.cjs +345 -0
- package/core/server/host/source-aliases.ts +32 -0
- package/core/server/host/source-packages.cjs +1 -0
- package/core/server/infra/cache/ServerFileCache.ts +4 -1
- package/core/server/node.ts +10 -0
- package/core/server/runtime-space/bindings.ts +47 -1
- package/core/server/runtime-space/digest.ts +6 -0
- package/core/server/runtime-space/index.ts +1 -1
- package/core/server/runtime-space/inject.ts +4 -1
- package/core/server/runtime-space/prewarm.ts +8 -8
- package/core/server/runtime-space/store.ts +8 -7
- package/core/server/runtime-space/types.ts +3 -2
- package/core/shared/core-diagnostic-codes.ts +6 -0
- package/core/shared/data-declaration-checks.ts +29 -3
- package/core/shared/registry-generated/diagnostic-registry-index.ts +5 -0
- package/core/shared/registry-generated/diagnostic-registry.ts +35 -0
- package/core/shared/registry-generated/limits.ts +18 -2
- package/core/shared/registry-generated/std-grammar.ts +1 -1
- package/core/shared/types/data-config.types.ts +3 -1
- package/core/shared/types/event.types.ts +9 -0
- package/dist/browser/soma-runtime.js +262 -23
- package/dist/core/index.cjs +283 -23
- package/dist/host-native/aot-builder.cjs +284 -0
- package/dist/host-native/native-server.cjs +395 -24
- package/dist/lsp/component-tree.cjs +66 -10
- package/dist/types/client/container/IContainerAdapter.d.ts +3 -0
- package/dist/types/client/container/SomaContainerAdapter.d.ts +5 -0
- package/dist/types/client/data/data-object-resolver.d.ts +2 -0
- package/dist/types/client/engines/chart/index.d.ts +1 -1
- package/dist/types/client/engines/chart/port.d.ts +15 -0
- package/dist/types/client/parser/confirm-spec.d.ts +27 -3
- package/dist/types/client/render-ports/hide-transition.d.ts +9 -0
- package/dist/types/client/render-ports/index.d.ts +4 -0
- package/dist/types/client/render-ports/notify-renderer.d.ts +2 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/server/api/paged-list.d.ts +101 -0
- package/dist/types/server/host/source-aliases.d.cts +53 -0
- package/dist/types/server/host/source-aliases.d.ts +30 -0
- package/dist/types/server/host/source-packages.d.cts +2 -0
- package/dist/types/server/node.d.ts +1 -0
- package/dist/types/server/runtime-space/bindings.d.ts +9 -0
- package/dist/types/server/runtime-space/digest.d.ts +5 -0
- package/dist/types/server/runtime-space/index.d.ts +1 -1
- package/dist/types/server/runtime-space/prewarm.d.ts +2 -2
- package/dist/types/server/runtime-space/types.d.ts +3 -2
- package/dist/types/shared/core-diagnostic-codes.d.ts +1 -1
- package/dist/types/shared/registry-generated/diagnostic-registry.d.ts +30 -0
- package/dist/types/shared/registry-generated/limits.d.ts +14 -0
- package/dist/types/shared/registry-generated/std-grammar.d.ts +1 -1
- package/dist/types/shared/types/data-config.types.d.ts +3 -1
- package/dist/types/shared/types/event.types.d.ts +8 -0
- package/host-native/src/aot-builder.ts +23 -0
- package/host-native/src/host-prepare.ts +18 -1
- package/host-native/src/native-server.ts +16 -0
- package/host-native/styles/globals.css +30 -28
- package/package.json +13 -2
|
@@ -171,12 +171,13 @@ export interface SomaRuntimeStoreStats {
|
|
|
171
171
|
}
|
|
172
172
|
/** 一条落盘的绑定记录(`<root>/bindings/<键>.json`) */
|
|
173
173
|
export interface SomaPersistedBinding {
|
|
174
|
-
|
|
174
|
+
/** core 落盘格式版本(`SOMA_RUNTIME_STORE_FORMAT`);读回不符即丢弃 */
|
|
175
|
+
readonly schemaVersion: number;
|
|
175
176
|
readonly binding: SomaRuntimeBinding;
|
|
176
177
|
}
|
|
177
178
|
/** 预热索引 `<root>/prewarm/index.json` */
|
|
178
179
|
export interface SomaPrewarmIndex {
|
|
179
|
-
readonly schemaVersion:
|
|
180
|
+
readonly schemaVersion: number;
|
|
180
181
|
/** 地址 → 内容摘要 */
|
|
181
182
|
readonly entries: Readonly<Record<string, string>>;
|
|
182
183
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentTreeErrorCode } from './component-tree-errors';
|
|
2
2
|
import type { SomaGenerationErrorShape, SomaGenerationLayer } from './types/generation-error.types';
|
|
3
|
-
export declare const SOMA_CORE_DIAGNOSTIC_CODES: readonly ["CORE-PORT-MISSING", "CORE-PORT-CONFLICT", "CORE-PORT-LEGACY-PACK", "CORE-PORT-IDENTITY-DRIFT", "CORE-PORT-RECOMPILE", "CORE-PORT-PURPOSE", "CORE-STYLE-INVALID", "CORE-HOOK-UNCOMPILED", "CORE-SHELL-SLOT", "CORE-CONTRACT-SHAPE", "CORE-CONTRACT-DEFAULTS", "CORE-LINKAGE-DUPLICATE", "CORE-OBSERVE-FAILED", "CORE-OBSERVE-OFF", "CORE-RUNTIME-ERROR", "CORE-RUNTIME-ROOT-INVALID", "CORE-RUNTIME-ROOT-UNSET", "CORE-FORMAT-VERSION-UNSUPPORTED", "CORE-FORMAT-VERSION-MISMATCH", "CORE-INJECT-NONSTANDARD-KEY", "CORE-INJECT-PAGE-LOGIC", "CORE-INJECT-PAGE-CLOSURE", "CORE-PAGE-NEGATE-FORBIDDEN", "CORE-STYLE-COMPARE-FORBIDDEN", "CORE-PAGE-ROLE-BY-INVALID", "CORE-RUNTIME-ADDRESS-INVALID", "CORE-RUNTIME-ADDRESS-RESERVED", "CORE-RUNTIME-ADDRESS-STATIC", "CORE-RUNTIME-ADDRESS-CONFLICT", "CORE-RUNTIME-ADDRESS-OWNED", "CORE-RUNTIME-ADDRESS-MISMATCH", "CORE-RUNTIME-ADDRESS-MISSING", "CORE-RUNTIME-ADDRESS-EXPIRED", "CORE-RUNTIME-GENERATION", "CORE-RUNTIME-PROVENANCE", "CORE-RUNTIME-GRANT", "CORE-RUNTIME-GRANT-INVALID", "CORE-RUNTIME-BATCH", "CORE-RUNTIME-PARAM-INVALID", "CORE-RUNTIME-ACCESS-DENIED", "CORE-NAV-PARENT-MISSING", "CORE-NAV-OVERFLOW", "CORE-NAV-BACK-INVALID", "CORE-VIEW-DEFINE", "CORE-VIEW-CTX", "CORE-REACTIVE-WRITE", "CORE-RUNTIME-DOMAIN-STATIC-ONLY", "CORE-RUNTIME-MOUNT", "CORE-ADAPTER-EMIT", "CORE-ADAPTER-DEFINE", "CORE-DATA-FORBIDDEN", "CORE-DATA-RELATION", "CORE-DATA-REQUIRE", "CORE-LOCALE-UNKNOWN", "CORE-ENGINE-LOAD", "CORE-ENGINE-ADAPTER", "CORE-STYLE-ENGINE-CANDIDATE", "CORE-STYLE-ENGINE-THEME", "CORE-STYLE-ENGINE-COMPILE", "CORE-BEHAVIOR-MACHINE-UNKNOWN", "CORE-BEHAVIOR-LAYER-DETACHED", "CORE-BEHAVIOR-MACHINE-CONFLICT", "CORE-TABLE-COLUMN", "CORE-TABLE-STATE", "CORE-VIRTUAL-SCROLLER", "CORE-CHART-KIND-UNKNOWN", "CORE-CHART-THEME", "CORE-CHART-OPTION", "CORE-TEMPORAL-PARSE", "CORE-TEMPORAL-NOT-READY", "CORE-TEMPORAL-ZONE", "CORE-DND-SPEC", "CORE-ALGO-DIFF-INPUT", "CORE-ALGO-QR-CAPACITY", "CORE-ASYNC-CHECK-TABLE", "CORE-ASYNC-CHECK-UNREGISTERED", "CORE-TOAST-CONFIG", "CORE-FORMAT-LOCALE", "CORE-FORMAT-TIMEZONE", "CORE-FORMAT-CONFIG", "CORE-BEHAVIOR-DECL", "CORE-A11Y-DECL", "CORE-OVERLAY-DECL", "CORE-KEYBOARD-DECL", "CORE-BEHAVIOR-COLLECTION-MISMATCH", "CORE-BEHAVIOR-MACHINE-MISMATCH", "CORE-KEYBOARD-MISSING", "CORE-KEYBOARD-GRID-COLUMNS", "CORE-KEYBOARD-INEFFECTIVE", "CORE-KEYBOARD-UNWIRED", "CORE-A11Y-CONFIG", "CORE-A11Y-OVERLAY-NO-DISMISS", "CORE-A11Y-ROLE-KEYBOARD-MISMATCH", "CORE-A11Y-ROLE-OVERLAY", "CORE-A11Y-ROLE-LANDMARK-CONFLICT", "CORE-A11Y-LANDMARK-NAME-SOURCE", "CORE-A11Y-LANDMARK-UNNAMED", "CORE-A11Y-LANDMARK-DUPLICATE-NAME", "CORE-LOCALE-PACK-SHAPE", "CORE-LOCALE-PACK-LOCALE", "CORE-LOCALE-PACK-POSITION", "CORE-LOCALE-PACK-VALUE", "CORE-SCOPES-CONFLICT", "CORE-FRAGMENTS-CONFLICT", "CORE-ANCHOR-DUPLICATE", "CORE-REG-INPUT-INVALID", "CORE-REG-NO-COMPILED-ARTIFACT", "CORE-CHECK-BLOCKS", "CORE-CHECK-DIALECT", "CORE-CHECK-DATA", "CORE-CHECK-EVENT", "CORE-CHECK-SCOPES", "CORE-CHECK-COMPILE", "CORE-CHECK-RUNTIME", "CORE-ENVELOPE-KEY", "CORE-ENVELOPE-VALUE", "CORE-ENVELOPE-PARAM", "CORE-ENVELOPE-PARAM-IMPLICIT", "CORE-ENVELOPE-QUERY", "CORE-ENVELOPE-NAV", "CORE-ENVELOPE-SOURCE", "CORE-ENVELOPE-LIFECYCLE", "CORE-ENVELOPE-AUTHOR", "CORE-ENVELOPE-COMPAT", "CORE-USER-REF-MISSING", "CORE-USER-REF-UNKNOWN", "CORE-AUTH-SCOPE", "CORE-WRITE-FEEDBACK-SCOPE", "CORE-WRITE-SHORTCUT-DECL", "CORE-WRITE-SHORTCUT-DUP", "ERR-RUN-001", "ERR-RUN-002", "ERR-RUN-003", "ERR-PUB-001", "ERR-PUB-002", "ERR-PUB-003"];
|
|
3
|
+
export declare const SOMA_CORE_DIAGNOSTIC_CODES: readonly ["CORE-PORT-MISSING", "CORE-PORT-CONFLICT", "CORE-PORT-LEGACY-PACK", "CORE-PORT-IDENTITY-DRIFT", "CORE-PORT-RECOMPILE", "CORE-PORT-PURPOSE", "CORE-STYLE-INVALID", "CORE-HOOK-UNCOMPILED", "CORE-SHELL-SLOT", "CORE-CONTRACT-SHAPE", "CORE-CONTRACT-DEFAULTS", "CORE-LINKAGE-DUPLICATE", "CORE-OBSERVE-FAILED", "CORE-OBSERVE-OFF", "CORE-RUNTIME-ERROR", "CORE-RUNTIME-ROOT-INVALID", "CORE-RUNTIME-ROOT-UNSET", "CORE-FORMAT-VERSION-UNSUPPORTED", "CORE-FORMAT-VERSION-MISMATCH", "CORE-INJECT-NONSTANDARD-KEY", "CORE-INJECT-PAGE-LOGIC", "CORE-INJECT-PAGE-CLOSURE", "CORE-PAGE-NEGATE-FORBIDDEN", "CORE-STYLE-COMPARE-FORBIDDEN", "CORE-PAGE-ROLE-BY-INVALID", "CORE-RUNTIME-ADDRESS-INVALID", "CORE-RUNTIME-ADDRESS-RESERVED", "CORE-RUNTIME-ADDRESS-STATIC", "CORE-RUNTIME-ADDRESS-CONFLICT", "CORE-RUNTIME-ADDRESS-OWNED", "CORE-RUNTIME-ADDRESS-MISMATCH", "CORE-RUNTIME-ADDRESS-MISSING", "CORE-RUNTIME-ADDRESS-EXPIRED", "CORE-RUNTIME-GENERATION", "CORE-RUNTIME-PROVENANCE", "CORE-RUNTIME-GRANT", "CORE-RUNTIME-GRANT-INVALID", "CORE-RUNTIME-BATCH", "CORE-RUNTIME-PARAM-INVALID", "CORE-RUNTIME-ACCESS-DENIED", "CORE-NAV-PARENT-MISSING", "CORE-NAV-OVERFLOW", "CORE-NAV-BACK-INVALID", "CORE-VIEW-DEFINE", "CORE-VIEW-CTX", "CORE-REACTIVE-WRITE", "CORE-RUNTIME-DOMAIN-STATIC-ONLY", "CORE-RUNTIME-MOUNT", "CORE-ADAPTER-EMIT", "CORE-ADAPTER-DEFINE", "CORE-DATA-FORBIDDEN", "CORE-DATA-RELATION", "CORE-DATA-REQUIRE", "CORE-LOCALE-UNKNOWN", "CORE-ENGINE-LOAD", "CORE-ENGINE-ADAPTER", "CORE-STYLE-ENGINE-CANDIDATE", "CORE-STYLE-ENGINE-THEME", "CORE-STYLE-ENGINE-COMPILE", "CORE-BEHAVIOR-MACHINE-UNKNOWN", "CORE-BEHAVIOR-LAYER-DETACHED", "CORE-BEHAVIOR-MACHINE-CONFLICT", "CORE-TABLE-COLUMN", "CORE-TABLE-STATE", "CORE-VIRTUAL-SCROLLER", "CORE-CHART-KIND-UNKNOWN", "CORE-CHART-THEME", "CORE-CHART-OPTION", "CORE-TEMPORAL-PARSE", "CORE-TEMPORAL-NOT-READY", "CORE-TEMPORAL-ZONE", "CORE-HOST-ALIAS-INVALID", "CORE-HOST-ALIAS-RESERVED", "CORE-HOST-ALIAS-SHADOW", "CORE-HOST-ALIAS-DUPLICATE", "CORE-HOST-ALIAS-TSCONFIG-DRIFT", "CORE-DND-SPEC", "CORE-ALGO-DIFF-INPUT", "CORE-ALGO-QR-CAPACITY", "CORE-ASYNC-CHECK-TABLE", "CORE-ASYNC-CHECK-UNREGISTERED", "CORE-TOAST-CONFIG", "CORE-FORMAT-LOCALE", "CORE-FORMAT-TIMEZONE", "CORE-FORMAT-CONFIG", "CORE-BEHAVIOR-DECL", "CORE-A11Y-DECL", "CORE-OVERLAY-DECL", "CORE-KEYBOARD-DECL", "CORE-BEHAVIOR-COLLECTION-MISMATCH", "CORE-BEHAVIOR-MACHINE-MISMATCH", "CORE-KEYBOARD-MISSING", "CORE-KEYBOARD-GRID-COLUMNS", "CORE-KEYBOARD-INEFFECTIVE", "CORE-KEYBOARD-UNWIRED", "CORE-A11Y-CONFIG", "CORE-A11Y-OVERLAY-NO-DISMISS", "CORE-A11Y-ROLE-KEYBOARD-MISMATCH", "CORE-A11Y-ROLE-OVERLAY", "CORE-A11Y-ROLE-LANDMARK-CONFLICT", "CORE-A11Y-LANDMARK-NAME-SOURCE", "CORE-A11Y-LANDMARK-UNNAMED", "CORE-A11Y-LANDMARK-DUPLICATE-NAME", "CORE-LOCALE-PACK-SHAPE", "CORE-LOCALE-PACK-LOCALE", "CORE-LOCALE-PACK-POSITION", "CORE-LOCALE-PACK-VALUE", "CORE-SCOPES-CONFLICT", "CORE-FRAGMENTS-CONFLICT", "CORE-ANCHOR-DUPLICATE", "CORE-REG-INPUT-INVALID", "CORE-REG-NO-COMPILED-ARTIFACT", "CORE-CHECK-BLOCKS", "CORE-CHECK-DIALECT", "CORE-CHECK-DATA", "CORE-CHECK-EVENT", "CORE-CHECK-SCOPES", "CORE-CHECK-COMPILE", "CORE-CHECK-RUNTIME", "CORE-ENVELOPE-KEY", "CORE-ENVELOPE-VALUE", "CORE-ENVELOPE-PARAM", "CORE-ENVELOPE-PARAM-IMPLICIT", "CORE-ENVELOPE-QUERY", "CORE-ENVELOPE-NAV", "CORE-ENVELOPE-SOURCE", "CORE-ENVELOPE-LIFECYCLE", "CORE-ENVELOPE-AUTHOR", "CORE-ENVELOPE-COMPAT", "CORE-USER-REF-MISSING", "CORE-USER-REF-UNKNOWN", "CORE-AUTH-SCOPE", "CORE-WRITE-FEEDBACK-SCOPE", "CORE-WRITE-SHORTCUT-DECL", "CORE-WRITE-SHORTCUT-DUP", "ERR-RUN-001", "ERR-RUN-002", "ERR-RUN-003", "ERR-PUB-001", "ERR-PUB-002", "ERR-PUB-003"];
|
|
4
4
|
export type SomaCoreOwnDiagnosticCode = (typeof SOMA_CORE_DIAGNOSTIC_CODES)[number];
|
|
5
5
|
/** core 码全集:自有码 ∪ `CT-*` 组件树码(`CT-*` 闭集仍定义在 `component-tree-errors.ts`) */
|
|
6
6
|
export type SomaCoreDiagnosticCode = SomaCoreOwnDiagnosticCode | ComponentTreeErrorCode;
|
|
@@ -386,6 +386,36 @@ export declare const SOMA_PIPELINE_DIAGNOSTIC_REGISTRY: {
|
|
|
386
386
|
readonly stage: "core";
|
|
387
387
|
readonly severity: "warn";
|
|
388
388
|
readonly owner: "soma-core/core/shared/core-diagnostic-codes.ts";
|
|
389
|
+
}, {
|
|
390
|
+
readonly code: "CORE-HOST-ALIAS-INVALID";
|
|
391
|
+
readonly family: "CORE";
|
|
392
|
+
readonly stage: "core";
|
|
393
|
+
readonly severity: "error";
|
|
394
|
+
readonly owner: "soma-core/core/server/host/source-aliases.cjs";
|
|
395
|
+
}, {
|
|
396
|
+
readonly code: "CORE-HOST-ALIAS-RESERVED";
|
|
397
|
+
readonly family: "CORE";
|
|
398
|
+
readonly stage: "core";
|
|
399
|
+
readonly severity: "error";
|
|
400
|
+
readonly owner: "soma-core/core/server/host/source-aliases.cjs";
|
|
401
|
+
}, {
|
|
402
|
+
readonly code: "CORE-HOST-ALIAS-SHADOW";
|
|
403
|
+
readonly family: "CORE";
|
|
404
|
+
readonly stage: "core";
|
|
405
|
+
readonly severity: "warn";
|
|
406
|
+
readonly owner: "soma-core/core/server/host/source-aliases.cjs";
|
|
407
|
+
}, {
|
|
408
|
+
readonly code: "CORE-HOST-ALIAS-DUPLICATE";
|
|
409
|
+
readonly family: "CORE";
|
|
410
|
+
readonly stage: "core";
|
|
411
|
+
readonly severity: "warn";
|
|
412
|
+
readonly owner: "soma-core/core/server/host/source-aliases.cjs";
|
|
413
|
+
}, {
|
|
414
|
+
readonly code: "CORE-HOST-ALIAS-TSCONFIG-DRIFT";
|
|
415
|
+
readonly family: "CORE";
|
|
416
|
+
readonly stage: "core";
|
|
417
|
+
readonly severity: "warn";
|
|
418
|
+
readonly owner: "soma-core/core/server/host/source-aliases.cjs";
|
|
389
419
|
}, {
|
|
390
420
|
readonly code: "CORE-DND-SPEC";
|
|
391
421
|
readonly family: "CORE";
|
|
@@ -101,6 +101,10 @@ export declare const SOMA_PIPELINE_LIMITS: {
|
|
|
101
101
|
readonly module: "soma-core";
|
|
102
102
|
readonly file: "core/server/registry/registry-file-lock.ts";
|
|
103
103
|
readonly symbol: "SOMA_PIPELINE_LIMITS";
|
|
104
|
+
}, {
|
|
105
|
+
readonly module: "soma-core";
|
|
106
|
+
readonly file: "core/server/api/paged-list.ts";
|
|
107
|
+
readonly symbol: "SOMA_PIPELINE_LIMITS";
|
|
104
108
|
}, {
|
|
105
109
|
readonly module: "soma-core";
|
|
106
110
|
readonly file: "core/server/registry/registry-write-pipeline.ts";
|
|
@@ -113,6 +117,10 @@ export declare const SOMA_PIPELINE_LIMITS: {
|
|
|
113
117
|
readonly module: "soma-core";
|
|
114
118
|
readonly file: "core/server/registry/source/version-store.ts";
|
|
115
119
|
readonly symbol: "SOMA_PIPELINE_LIMITS";
|
|
120
|
+
}, {
|
|
121
|
+
readonly module: "soma-core";
|
|
122
|
+
readonly file: "core/server/runtime-space/inject.ts";
|
|
123
|
+
readonly symbol: "SOMA_PIPELINE_LIMITS";
|
|
116
124
|
}, {
|
|
117
125
|
readonly module: "soma-ui";
|
|
118
126
|
readonly file: "src/compiler/bdl/registry/archive.ts";
|
|
@@ -396,6 +404,7 @@ export declare const SOMA_PIPELINE_LIMITS: {
|
|
|
396
404
|
readonly serverFileMaxEntries: 512;
|
|
397
405
|
readonly serverFileMaxBytes: 33554432;
|
|
398
406
|
readonly serverDirMaxEntries: 256;
|
|
407
|
+
readonly sourceRootAliasCapacity: 64;
|
|
399
408
|
};
|
|
400
409
|
readonly runtimeCache: {
|
|
401
410
|
readonly basis: "runtime 空间 L1 内存 LRU 的条目容量(编译结果与标准格式产物各一条目)与静态页地址清单的开发态复核间隔;容量不小于发布页产物缓存容量(cache.publishedArtifactCapacity),因为 L1 要容得下已发布页加上运行期按 URL 注入的页;复核间隔让新增静态页最迟这个毫秒数后进入写入期冲突判定(生产态不过期)。迁入前是 soma-core store.ts 的 SOMA_RUNTIME_CACHE_ENTRIES_DEFAULT 与 static-source.ts 的 DEV_TTL_MS";
|
|
@@ -413,6 +422,10 @@ export declare const SOMA_PIPELINE_LIMITS: {
|
|
|
413
422
|
readonly maxWaitMs: 5000;
|
|
414
423
|
readonly waitSliceMs: 15;
|
|
415
424
|
};
|
|
425
|
+
readonly pagedList: {
|
|
426
|
+
readonly pageSizeDefault: 10;
|
|
427
|
+
readonly pageSizeMax: 500;
|
|
428
|
+
};
|
|
416
429
|
readonly writeRate: {
|
|
417
430
|
readonly limit: 120;
|
|
418
431
|
readonly windowMs: 60000;
|
|
@@ -424,6 +437,7 @@ export declare const SOMA_PIPELINE_LIMITS: {
|
|
|
424
437
|
};
|
|
425
438
|
readonly inject: {
|
|
426
439
|
readonly pageMaxBytes: 4194304;
|
|
440
|
+
readonly batchFailureMessageMaxChars: 2000;
|
|
427
441
|
};
|
|
428
442
|
readonly execution: {
|
|
429
443
|
readonly maxNodes: 128;
|
|
@@ -654,7 +654,7 @@ export declare const SOMA_PIPELINE_STD_GRAMMAR: {
|
|
|
654
654
|
readonly code: "ERR-BIZ-002";
|
|
655
655
|
}];
|
|
656
656
|
readonly status: "implemented";
|
|
657
|
-
readonly note: "from[] 项键:api / params / into / require。require 是必填参数名数组(非空、无重复、都必须出现在同一项 params 里,违者 CORE-DATA-REQUIRE
|
|
657
|
+
readonly note: "from[] 项键:api / params / into / require。require 是必填参数名数组(非空、无重复、都必须出现在同一项 params 里,违者 CORE-DATA-REQUIRE);元素也可以是「至少一个」分组:2 个及以上不同参数名的数组,如 [[changeId, deliverableId]],可与单名混写,只此一层、不嵌套、同名不得跨单项与分组或两个分组重复:任一必填单名解析后为 null / undefined / 空串、或任一分组的成员全部为空时跳过这次请求,该来源不并入对象(写了 into 的子键落空数组),对象读状态为 idle(数据端口 getObjectStatus),不是错误;每次解析 / 重取重新判定。写入型对象:没有 from 但声明了 write 的 create / update / delete 至少一个端点是合法的(建单表单、登录、导入、联动目标):取数跳过、落空对象 {}、读状态 idle,data.submit 照常,write.reload 点名它时跳过重取;既无 from 也无写端点报「缺少 from 取数来源」(判定 data-config-parser.ts parseObject,测试 data-config-parser.test.ts 含负样本)";
|
|
658
658
|
}, {
|
|
659
659
|
readonly id: "poll.every";
|
|
660
660
|
readonly context: "poll";
|
|
@@ -86,8 +86,10 @@ export interface SomaDataSourceConfig {
|
|
|
86
86
|
* 必填参数名(都必须出现在同一项的 `params` 里):任一必填参数解析后为 null / undefined / 空串时跳过本次请求,
|
|
87
87
|
* 该来源不并入对象(写了 `into` 的子键落空数组),对象标 `idle`(数据端口 `getObjectStatus`);不是错误。
|
|
88
88
|
* 每次解析 / 重取都重新判定,参数补齐后的下一次重取就会发请求。
|
|
89
|
+
* 元素也可以是「至少一个」分组:2 个及以上不同参数名的数组(如 `[[changeId, deliverableId]]`),
|
|
90
|
+
* 组内全部为空才跳过;单名字符串与分组可混写。只此一层,不嵌套、不取反、不表达「恰好一个」。
|
|
89
91
|
*/
|
|
90
|
-
require?: string[]
|
|
92
|
+
require?: Array<string | string[]>;
|
|
91
93
|
/** 响应信封失败判定:HTTP 成功但响应体命中此闭集谓词即按取数失败(字段是响应体顶层键,深取用 `path`) */
|
|
92
94
|
failWhen?: SomaFieldPredicate;
|
|
93
95
|
/** 命中 failWhen 时,业务错误信息在响应体里的点路径 */
|
|
@@ -32,6 +32,9 @@ export interface NotifyDeclaration {
|
|
|
32
32
|
/** 确认分级闭集(R-23 / AD-43):plain 一句话确认 / typed 键入固定词 / consent 先勾选同意 */
|
|
33
33
|
export declare const SOMA_CONFIRM_LEVELS: readonly ["plain", "typed", "consent"];
|
|
34
34
|
export type SomaConfirmLevel = (typeof SOMA_CONFIRM_LEVELS)[number];
|
|
35
|
+
/** 确认语气闭集:default 常规 / danger 破坏性(删除等)。中性词,不规定样子;缺省 = default */
|
|
36
|
+
export declare const SOMA_CONFIRM_TONES: readonly ["default", "danger"];
|
|
37
|
+
export type SomaConfirmTone = (typeof SOMA_CONFIRM_TONES)[number];
|
|
35
38
|
/** 确认规格:`confirm:` 段的标准结构 */
|
|
36
39
|
export interface SomaConfirmSpec {
|
|
37
40
|
readonly level: SomaConfirmLevel;
|
|
@@ -41,6 +44,11 @@ export interface SomaConfirmSpec {
|
|
|
41
44
|
readonly phrase?: string;
|
|
42
45
|
/** 关联项影响说明;consent 级必写,typed 级可选 */
|
|
43
46
|
readonly impact?: string;
|
|
47
|
+
/**
|
|
48
|
+
* 语气:只有 `danger` 会出现(`default` / 不写 = 常规,解析时归一为不带本字段)。
|
|
49
|
+
* 渲染端口据它决定确认钮的警示呈现与初始焦点(破坏性确认的初始焦点应在「取消」);typed / consent 的放行规则不受它影响。
|
|
50
|
+
*/
|
|
51
|
+
readonly tone?: Exclude<SomaConfirmTone, 'default'>;
|
|
44
52
|
}
|
|
45
53
|
/**
|
|
46
54
|
* 解析后的事件配置
|
|
@@ -5,6 +5,25 @@ import esbuild, { type BuildContext, type Plugin } from 'esbuild';
|
|
|
5
5
|
import { readAllSomaPublicAliases } from './public-packages.cjs';
|
|
6
6
|
import { toPascalCase } from '../../core/server/api/service-path';
|
|
7
7
|
import { getSomaHostSourceRoot, getSomaHostApiRoot } from '../../core/server/host/source-packages.cjs';
|
|
8
|
+
import { getSomaSourceRootAliases, matchSomaSourceRoot, somaSourceRootFilter } from '../../core/server/host/source-aliases.cjs';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 源码根别名(soma.sourceRoots)的 esbuild 钩子:与 jiti 别名同一份实现,只认带斜杠的整段前缀。
|
|
12
|
+
* 只处理宿主自己代码的 import(importer 不在 node_modules 内),不改写依赖包内部的同名子路径。
|
|
13
|
+
* 未声明 → 不注册(零影响)。放在 resolveModuleFile 之后定义,调用时才解析。
|
|
14
|
+
*/
|
|
15
|
+
function registerSourceRootResolve(build: Parameters<Plugin['setup']>[0], hostDir: string, env?: NodeJS.ProcessEnv): void {
|
|
16
|
+
const aliases = getSomaSourceRootAliases(hostDir, env) as Record<string, string>;
|
|
17
|
+
const filter = somaSourceRootFilter(aliases);
|
|
18
|
+
if (!filter) return;
|
|
19
|
+
const nodeModulesSegment = `${path.sep}node_modules${path.sep}`;
|
|
20
|
+
build.onResolve({ filter }, (args) => {
|
|
21
|
+
if (args.importer.includes(nodeModulesSegment)) return undefined;
|
|
22
|
+
const hit = matchSomaSourceRoot(aliases, args.path);
|
|
23
|
+
if (!hit) return undefined;
|
|
24
|
+
return { path: resolveModuleFile(hit.dir, hit.subpath) };
|
|
25
|
+
});
|
|
26
|
+
}
|
|
8
27
|
|
|
9
28
|
export interface BuildBrowserClientOptions {
|
|
10
29
|
readonly hostDir: string;
|
|
@@ -154,6 +173,9 @@ function createBrowserClientPlugin(options: {
|
|
|
154
173
|
return { path: target };
|
|
155
174
|
});
|
|
156
175
|
|
|
176
|
+
// 5b. 源码根别名(soma.sourceRoots)
|
|
177
|
+
registerSourceRootResolve(build, hostDir);
|
|
178
|
+
|
|
157
179
|
// 6. 拦截内部 engine 模块私有深导入(RT4 守卫)
|
|
158
180
|
build.onResolve({ filter: /core\/client\/engine\// }, (args) => {
|
|
159
181
|
if (!args.importer.includes('soma-core')) {
|
|
@@ -444,6 +466,7 @@ export async function buildServerAot(
|
|
|
444
466
|
const subpath = args.path.replace(/^@soma-host\/?/, '');
|
|
445
467
|
return { path: resolveModuleFile(webRoot, subpath) };
|
|
446
468
|
});
|
|
469
|
+
registerSourceRootResolve(build, hostDir, options.env);
|
|
447
470
|
build.onResolve({ filter: /^@soma-api(?:\/.*)?$/ }, (args) => {
|
|
448
471
|
const subpath = args.path.replace(/^@soma-api\/?/, '');
|
|
449
472
|
return { path: resolveModuleFile(apiRoot, subpath) };
|
|
@@ -7,12 +7,28 @@ import { addressOfPageBase } from '../../core/build/compiler/page-base-resolver'
|
|
|
7
7
|
import { loadPageMarkupConfig } from '../../core/server/host/page-markup-config';
|
|
8
8
|
import { resolveHostTreeCompileContext } from '../../core/server/host/resolve-host-tree-context';
|
|
9
9
|
import { runPrewarm, computePrewarmInputsDigest } from '../../core/server/runtime-space/prewarm';
|
|
10
|
+
import { SOMA_RUNTIME_STORE_FORMAT } from '../../core/server/runtime-space/digest';
|
|
10
11
|
import { resolveAppConfigPath, resolveHostAppConfigPath } from '../../core/server/host/host-config-paths.cjs';
|
|
11
12
|
import { getSomaAssetSources, collectPageEntries, collectIncludes } from '../../core/server/host/source-packages';
|
|
12
13
|
import { invalidateStaticAddresses } from '../../core/server/runtime-space/static-source';
|
|
13
14
|
|
|
14
15
|
export const SOMA_SHELL_ROUTES_ENV = 'SOMA_SHELL_ROUTES';
|
|
15
16
|
|
|
17
|
+
let coreIdentityMemo: string | null = null;
|
|
18
|
+
/** 预编译旁档的编译身份:soma-core 包版本 + 落盘格式版本;读不到包版本时回 `unknown`(不复用不是错,复用旧的才是错——此时随格式版本变) */
|
|
19
|
+
function coreCompilerIdentity(): string {
|
|
20
|
+
if (coreIdentityMemo !== null) return coreIdentityMemo;
|
|
21
|
+
let version = 'unknown';
|
|
22
|
+
try {
|
|
23
|
+
const raw = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'), 'utf8')) as { version?: unknown };
|
|
24
|
+
if (typeof raw.version === 'string') version = raw.version;
|
|
25
|
+
} catch {
|
|
26
|
+
/* 读不到:用 unknown */
|
|
27
|
+
}
|
|
28
|
+
coreIdentityMemo = `soma-core@${version}/store-format-${SOMA_RUNTIME_STORE_FORMAT}`;
|
|
29
|
+
return coreIdentityMemo;
|
|
30
|
+
}
|
|
31
|
+
|
|
16
32
|
let lastRaw: string | undefined;
|
|
17
33
|
let lastParsed: readonly string[] = [];
|
|
18
34
|
|
|
@@ -138,7 +154,8 @@ export async function prewarmHostPages(hostDir: string, env: NodeJS.ProcessEnv =
|
|
|
138
154
|
appConfigYaml: compileInput.appConfigYaml,
|
|
139
155
|
hostAppConfigYaml: appConfigYaml,
|
|
140
156
|
treeContext: compileInput.treeContext ?? null,
|
|
141
|
-
|
|
157
|
+
// 预编译旁档只在「同一份 core 编的」时复用:core 升级后整批旁档自动失效,不需要手工清 .soma/runtime
|
|
158
|
+
compilerIdentity: coreCompilerIdentity(),
|
|
142
159
|
}),
|
|
143
160
|
compile: () => precompilePage(compileInput, { hostAppConfig: shell.appConfig }),
|
|
144
161
|
};
|
|
@@ -16,6 +16,7 @@ import { clearTailwindCompilerCache } from 'soma-core/server/style-engine';
|
|
|
16
16
|
import { resolveHostResponseHeaders } from '../../core/server/host/host-response-headers';
|
|
17
17
|
import type { BrowserClientBuildResult, ServerAotManifest } from './aot-builder';
|
|
18
18
|
import { pageSuccessResponse, pageErrorResponse } from './page-http';
|
|
19
|
+
import { isStatusError } from '../../core/server/runtime-space/errors';
|
|
19
20
|
import { handleManifestGet } from './manifest-http';
|
|
20
21
|
import { prepareHostAssembly, invalidateHostPreparation, prewarmHostPages } from './host-prepare';
|
|
21
22
|
import { staticResponse, serveStaticFromRoot, isSafeSegments, acceptsGzip } from './static-file';
|
|
@@ -684,6 +685,15 @@ export async function createNativeServer(
|
|
|
684
685
|
return refreshTask;
|
|
685
686
|
};
|
|
686
687
|
|
|
688
|
+
/** 等开发态刷新队列走空(有待处理变更、debounce 中、重建中都算忙),至多等 30 秒,超时放行(不让一次卡住的重建拖死页面) */
|
|
689
|
+
const waitForDevRefreshIdle = async (): Promise<void> => {
|
|
690
|
+
const deadline = Date.now() + 30_000;
|
|
691
|
+
while (!watcherClosed && (refreshTask !== null || refreshPending || debounceTimer !== null) && Date.now() < deadline) {
|
|
692
|
+
if (refreshTask !== null) await refreshTask.catch(() => undefined);
|
|
693
|
+
else await new Promise<void>((resolve) => setTimeout(resolve, 50));
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
|
|
687
697
|
if (dev) {
|
|
688
698
|
try {
|
|
689
699
|
fsWatcher = fs.watch(webRoot, { recursive: true }, (_event, filename) => {
|
|
@@ -807,8 +817,12 @@ export async function createNativeServer(
|
|
|
807
817
|
const subSegments = pathname.slice('/_soma/client/'.length).split('/').filter(Boolean);
|
|
808
818
|
const staticReq = createStaticLookupRequest(req, method);
|
|
809
819
|
const clientStaticDir = path.resolve(runtimeLayout.dirs.static, 'client');
|
|
820
|
+
// 开发态:增量重建进行中先等它写完——entry 与它引用的 chunk 是同一代产物,重建中途请求会读到「新 entry + 还没写出的 chunk」或「旧 chunk 已被清掉」(偶发 404,页面无内容)
|
|
821
|
+
if (dev) await waitForDevRefreshIdle();
|
|
810
822
|
const clientRes = serveStaticFromRoot(clientStaticDir, subSegments, staticReq, true);
|
|
811
823
|
if (clientRes) {
|
|
824
|
+
// 开发态:不带内容哈希的 entry / 样式每次都向服务器核对(缺省 max-age=300 会让浏览器在重建后的 5 分钟里继续用旧 entry,它引用的旧哈希 chunk 已被重建清掉 → 404)
|
|
825
|
+
if (dev && !/immutable/.test(clientRes.headers.get('cache-control') ?? '')) clientRes.headers.set('cache-control', 'no-cache');
|
|
812
826
|
await sendWebResponse(clientRes, res, method);
|
|
813
827
|
return;
|
|
814
828
|
}
|
|
@@ -890,6 +904,8 @@ export async function createNativeServer(
|
|
|
890
904
|
await sendWebResponse(response, res, method);
|
|
891
905
|
return;
|
|
892
906
|
} catch (error) {
|
|
907
|
+
// 响应体对外只给通用 500(不泄露内部细节),原因必须落服务端日志,否则页面载入失败无从排查
|
|
908
|
+
if (!isStatusError(error)) console.error(`[soma-native] 页面载入失败 path=${pagePath}`, error);
|
|
893
909
|
let response = pageErrorResponse(error, assembly);
|
|
894
910
|
response = await applyHostAndCspHeaders(response, { method: 'GET', pathname }, env);
|
|
895
911
|
await sendWebResponse(response, res, method);
|
|
@@ -34,39 +34,41 @@ select {
|
|
|
34
34
|
font: inherit;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/* 托管组件由角色类和布局工具决定外观,不能叠加浏览器默认标题边距、按钮底色或 outset
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
/* 托管组件由角色类和布局工具决定外观,不能叠加浏览器默认标题边距、按钮底色或 outset 边框;置于最底层 @layer base,确保不压过组件/主题 @layer 规则。 */
|
|
38
|
+
@layer base {
|
|
39
|
+
:where([data-soma-host], [data-soma-host] *, [data-soma-host] *::before, [data-soma-host] *::after) {
|
|
40
|
+
border-width: 0;
|
|
41
|
+
border-style: solid;
|
|
42
|
+
}
|
|
42
43
|
|
|
43
|
-
:where([data-soma-host]) :where(h1, h2, h3, h4, h5, h6, p, blockquote, figure, dl, dd) {
|
|
44
|
-
|
|
45
|
-
}
|
|
44
|
+
:where([data-soma-host]) :where(h1, h2, h3, h4, h5, h6, p, blockquote, figure, dl, dd) {
|
|
45
|
+
margin: 0;
|
|
46
|
+
}
|
|
46
47
|
|
|
47
|
-
:where([data-soma-host], [data-soma-overlay-root]) :where(button, input, optgroup, select, textarea) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
48
|
+
:where([data-soma-host], [data-soma-overlay-root]) :where(button, input, optgroup, select, textarea) {
|
|
49
|
+
color: inherit;
|
|
50
|
+
font: inherit;
|
|
51
|
+
background-color: transparent;
|
|
52
|
+
border-radius: 0;
|
|
53
|
+
border-width: 0;
|
|
54
|
+
border-style: solid;
|
|
55
|
+
}
|
|
55
56
|
|
|
56
|
-
:where([data-soma-host]) :where(ol, ul, menu) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
57
|
+
:where([data-soma-host]) :where(ol, ul, menu) {
|
|
58
|
+
list-style: none;
|
|
59
|
+
margin: 0;
|
|
60
|
+
padding: 0;
|
|
61
|
+
}
|
|
61
62
|
|
|
62
|
-
:where([data-soma-host]) table {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
63
|
+
:where([data-soma-host]) table {
|
|
64
|
+
border-collapse: collapse;
|
|
65
|
+
text-indent: 0;
|
|
66
|
+
}
|
|
66
67
|
|
|
67
|
-
:where([data-soma-host]) a {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
:where([data-soma-host]) a {
|
|
69
|
+
color: inherit;
|
|
70
|
+
text-decoration: inherit;
|
|
71
|
+
}
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
.soma-hidden {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soma-core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.8",
|
|
4
4
|
"description": "SOMA — Semantic Oriented Modular Architecture. A declarative frontend framework runtime with no UI framework dependency; native host shell ships in host-native/.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"soma",
|
|
@@ -175,6 +175,11 @@
|
|
|
175
175
|
"import": "./core/server/index.ts",
|
|
176
176
|
"default": "./core/server/index.ts"
|
|
177
177
|
},
|
|
178
|
+
"./server/paged-list": {
|
|
179
|
+
"types": "./dist/types/server/api/paged-list.d.ts",
|
|
180
|
+
"import": "./core/server/api/paged-list.ts",
|
|
181
|
+
"default": "./core/server/api/paged-list.ts"
|
|
182
|
+
},
|
|
178
183
|
"./server/runtime": {
|
|
179
184
|
"types": "./dist/types/server/runtime-space/index.d.ts",
|
|
180
185
|
"import": "./core/server/runtime-space/index.ts",
|
|
@@ -190,6 +195,12 @@
|
|
|
190
195
|
"import": "./core/server/node.ts",
|
|
191
196
|
"default": "./core/server/node.ts"
|
|
192
197
|
},
|
|
198
|
+
"./server/source-aliases": {
|
|
199
|
+
"types": "./dist/types/server/host/source-aliases.d.ts",
|
|
200
|
+
"require": "./core/server/host/source-aliases.cjs",
|
|
201
|
+
"import": "./core/server/host/source-aliases.cjs",
|
|
202
|
+
"default": "./core/server/host/source-aliases.cjs"
|
|
203
|
+
},
|
|
193
204
|
"./server/registry": {
|
|
194
205
|
"types": "./dist/types/server/registry/index.d.ts",
|
|
195
206
|
"import": "./core/server/registry/index.ts",
|
|
@@ -321,7 +332,7 @@
|
|
|
321
332
|
"parse5": "7.3.0",
|
|
322
333
|
"qrcode-generator": "2.0.4",
|
|
323
334
|
"server-only": "0.0.1",
|
|
324
|
-
"soma-foundation": "^0.1.
|
|
335
|
+
"soma-foundation": "^0.1.5",
|
|
325
336
|
"temporal-polyfill": "0.3.2"
|
|
326
337
|
},
|
|
327
338
|
"peerDependencies": {
|