@proteus-vue/component-ir 0.1.0 → 0.1.1-beta.0

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/dist/map.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { BackendId } from '@proteus-vue/render-backend';
1
+ import type { BackendId } from '@proteus-vue/contracts';
2
2
  /** 语义类型 → 各端 Backend 控件(布局原语 + UI 原语 + 能力入口——G-31 §3 组件清单)
3
3
  * ★G-31 B5:vue-dom 列与 render-backend SEMANTIC_WEB_MAP 实际产出一致(div.proteus-* 语义类)——
4
4
  * 参考表即门禁标准,component-conformance 机器校验「快照 control == 参考表」 */
@@ -0,0 +1,69 @@
1
+ export type MpSpecStatus = 'covered' | 'planned' | 'private' | 'na' | 'gap';
2
+ export interface MpSpecClass {
3
+ status: MpSpecStatus;
4
+ /** covered/planned 时的 Proteus 承接(Hook/语义/组件) */
5
+ proteus?: string;
6
+ }
7
+ /** spec 快照(与 docs/generated/miniprogram-official-spec.json 同构) */
8
+ export interface MpOfficialSpec {
9
+ components: string[];
10
+ apis: string[];
11
+ }
12
+ export declare const SPEC_COVERED: Record<string, string>;
13
+ export declare const SPEC_PRIVATE: ReadonlySet<string>;
14
+ export declare const SPEC_NA: ReadonlySet<string>;
15
+ export declare const SPEC_PLANNED: Record<string, string>;
16
+ /** 单条分类(规则序:显式 covered → private → na → planned → 事件基名 → gap) */
17
+ export declare function classifySpecApi(name: string): MpSpecClass;
18
+ /** 组件分类:由 MP_MAPPING_MATRIX 的显式登记驱动(tag 命中即 covered/private/...) */
19
+ export declare function classifySpecComponent(tag: string, matrix: ReadonlyArray<{
20
+ mp: string;
21
+ status: string;
22
+ planned?: boolean;
23
+ }>): MpSpecClass;
24
+ /** 组件级显式分类(名不对齐/语义消灭/Skyline 专属——矩阵未逐条登记时的权威声明) */
25
+ export declare const SPEC_COMPONENT_OVERRIDE: Record<string, MpSpecClass>;
26
+ export interface SpecCoverageReport {
27
+ total: number;
28
+ covered: number;
29
+ planned: number;
30
+ private: number;
31
+ na: number;
32
+ gap: number;
33
+ /** 已归类项(total − gap)——分类完整性分母(防「漏登记」)。 */
34
+ accounted: number;
35
+ /** 分类完整率 = accounted/total(恒 100 表示「全部官方项都进了某个箱子」——不是「全实现」!) */
36
+ classifiedPercent: number;
37
+ /** ★可落地项 = covered + planned(排除 private/na——非目标或废弃) */
38
+ actionable: number;
39
+ /** ★真·落地率 = covered / actionable(诚实指标——「可用比例」,非「已归类比例」) */
40
+ landedPercent: number;
41
+ gaps: Array<{
42
+ kind: 'component' | 'api';
43
+ name: string;
44
+ }>;
45
+ /** 规划待落地清单(planned——可见待办) */
46
+ plannedItems: Array<{
47
+ kind: 'component' | 'api';
48
+ name: string;
49
+ proteus?: string;
50
+ }>;
51
+ }
52
+ /**
53
+ * ★spec 覆盖度审计:官方清单逐项分类 → 报告(gap 列出全部缺口名)。
54
+ * @param spec 官方清单快照
55
+ * @param matrix 组件显式登记(MP_MAPPING_MATRIX)
56
+ */
57
+ export declare function auditSpecCoverage(spec: MpOfficialSpec, matrix: ReadonlyArray<{
58
+ mp: string;
59
+ status: string;
60
+ planned?: boolean;
61
+ }>): SpecCoverageReport;
62
+ /**
63
+ * ★棘轮预算:covered 的硬下限 + gap 硬上限——只能向好的方向变。
64
+ * covered 下降 或 gap 上升 → CI 红(防「悄悄丢覆盖」);改善后应手动调高 covered 锁定成果。
65
+ */
66
+ export declare const SPEC_RATCHET: {
67
+ coveredMin: number;
68
+ gapMax: number;
69
+ };
@@ -31,5 +31,5 @@ export declare function primitiveById(id: string): PrimitiveDef | undefined;
31
31
  export declare function primitiveBySemantic(semantic: string): PrimitiveDef | undefined;
32
32
  /** 按 p-* 标签查原语 */
33
33
  export declare function primitiveByTag(tag: string): PrimitiveDef | undefined;
34
- /** 清单自检:128 项 / id 唯一 / semantic 唯一 / 编号连续 */
34
+ /** 清单自检:长度/id 唯一/semantic 唯一/tag 唯一(长度按 SSOT 常量动态——新增项同步本行注释) */
35
35
  export declare function checkPrimitiveCatalog(): string[];
package/dist/schema.d.ts CHANGED
@@ -15,7 +15,7 @@ export interface ComponentIR {
15
15
  degradation?: Record<string, 'supported' | 'fallback' | 'unsupported'>;
16
16
  }
17
17
  /** 语义枚举(与 plan component-ir.schema.json 一致)——<domain>.<kind> */
18
- export declare const SEMANTIC_ENUM: readonly ["layout.box", "layout.inline", "layout.stack", "layout.grid", "layout.fluid", "layout.adaptive", "layout.fit", "layout.spacer", "layout.divider", "layout.scroll", "layout.virtual-list", "layout.masonry", "layout.split", "layout.safe", "layout.sidebar", "ui.text", "ui.heading", "ui.rich-text", "ui.icon", "ui.image", "ui.avatar", "ui.media", "ui.canvas", "ui.svg", "ui.input", "ui.textarea", "ui.select", "ui.checkbox", "ui.radio", "ui.switch", "ui.slider", "ui.picker", "ui.form", "ui.button", "ui.list", "ui.nav", "shell.page", "shell.nav", "shell.tabbar", "shell.segment", "shell.drawer", "shell.modal", "shell.popover", "shell.toast", "shell.action-sheet", "gesture.draggable", "gesture.scrollable", "engineering.router-link", "engineering.transition", "engineering.animate", "capability.scan-qr", "capability.pick-photo", "capability.location"];
18
+ export declare const SEMANTIC_ENUM: readonly ["layout.box", "layout.inline", "layout.stack", "layout.grid", "layout.fluid", "layout.adaptive", "layout.fit", "layout.spacer", "layout.divider", "layout.scroll", "layout.virtual-list", "layout.masonry", "layout.split", "layout.safe", "layout.sidebar", "layout.aspect", "layout.zone", "ui.text", "ui.heading", "ui.rich-text", "ui.icon", "ui.image", "ui.avatar", "ui.media", "ui.canvas", "ui.svg", "ui.input", "ui.textarea", "ui.select", "ui.checkbox", "ui.radio", "ui.switch", "ui.slider", "ui.picker", "ui.form", "ui.button", "ui.list", "ui.nav", "ui.loading", "ui.scale", "ui.skeleton", "ui.progress", "ui.label", "ui.selection", "ui.camera", "shell.page", "shell.nav", "shell.tabbar", "shell.segment", "shell.drawer", "shell.modal", "shell.popover", "shell.toast", "shell.action-sheet", "shell.mask", "shell.popup", "shell.toolbar", "shell.page-container", "shell.keyboard-accessory", "shell.webview", "shell.ad", "ui.map", "gesture.draggable", "gesture.scrollable", "engineering.router-link", "engineering.transition", "engineering.animate", "engineering.error-boundary", "capability.scan-qr", "capability.pick-photo", "capability.location"];
19
19
  /** C-IR JSON Schema(等价于 plan component-ir.schema.json——TS 内嵌供校验/工具消费) */
20
20
  export declare const COMPONENT_IR_SCHEMA: {
21
21
  readonly $schema: "https://json-schema.org/draft/2020-12/schema";
@@ -30,7 +30,7 @@ export declare const COMPONENT_IR_SCHEMA: {
30
30
  };
31
31
  readonly semantic: {
32
32
  readonly type: "string";
33
- readonly enum: readonly ["layout.box", "layout.inline", "layout.stack", "layout.grid", "layout.fluid", "layout.adaptive", "layout.fit", "layout.spacer", "layout.divider", "layout.scroll", "layout.virtual-list", "layout.masonry", "layout.split", "layout.safe", "layout.sidebar", "ui.text", "ui.heading", "ui.rich-text", "ui.icon", "ui.image", "ui.avatar", "ui.media", "ui.canvas", "ui.svg", "ui.input", "ui.textarea", "ui.select", "ui.checkbox", "ui.radio", "ui.switch", "ui.slider", "ui.picker", "ui.form", "ui.button", "ui.list", "ui.nav", "shell.page", "shell.nav", "shell.tabbar", "shell.segment", "shell.drawer", "shell.modal", "shell.popover", "shell.toast", "shell.action-sheet", "gesture.draggable", "gesture.scrollable", "engineering.router-link", "engineering.transition", "engineering.animate", "capability.scan-qr", "capability.pick-photo", "capability.location"];
33
+ readonly enum: readonly ["layout.box", "layout.inline", "layout.stack", "layout.grid", "layout.fluid", "layout.adaptive", "layout.fit", "layout.spacer", "layout.divider", "layout.scroll", "layout.virtual-list", "layout.masonry", "layout.split", "layout.safe", "layout.sidebar", "layout.aspect", "layout.zone", "ui.text", "ui.heading", "ui.rich-text", "ui.icon", "ui.image", "ui.avatar", "ui.media", "ui.canvas", "ui.svg", "ui.input", "ui.textarea", "ui.select", "ui.checkbox", "ui.radio", "ui.switch", "ui.slider", "ui.picker", "ui.form", "ui.button", "ui.list", "ui.nav", "ui.loading", "ui.scale", "ui.skeleton", "ui.progress", "ui.label", "ui.selection", "ui.camera", "shell.page", "shell.nav", "shell.tabbar", "shell.segment", "shell.drawer", "shell.modal", "shell.popover", "shell.toast", "shell.action-sheet", "shell.mask", "shell.popup", "shell.toolbar", "shell.page-container", "shell.keyboard-accessory", "shell.webview", "shell.ad", "ui.map", "gesture.draggable", "gesture.scrollable", "engineering.router-link", "engineering.transition", "engineering.animate", "engineering.error-boundary", "capability.scan-qr", "capability.pick-photo", "capability.location"];
34
34
  };
35
35
  readonly props: {
36
36
  readonly type: "object";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteus-vue/component-ir",
3
- "version": "0.1.0",
3
+ "version": "0.1.1-beta.0",
4
4
  "description": "G-31 组件与 API 语义化(component-semantics-plan B1):Component IR(C-IR)schema + 属性约束校验 + semantic 映射——组件=语义、属性=约束、Backend 消费 semantic 而非 tag(零依赖纯逻辑)",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -18,10 +18,10 @@
18
18
  "dist",
19
19
  "README.md"
20
20
  ],
21
+ "dependencies": {
22
+ "@proteus-vue/contracts": "0.1.0"
23
+ },
21
24
  "scripts": {
22
25
  "build": "tsc -p tsconfig.build.json --emitDeclarationOnly && esbuild src/index.ts --bundle --format=esm --platform=neutral --outfile=dist/index.js"
23
- },
24
- "devDependencies": {
25
- "@proteus-vue/render-backend": "0.1.0"
26
26
  }
27
- }
27
+ }