@longzai-intelligence-progress-board/data 0.0.0-stage → 0.0.5
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/index.d.ts +580 -0
- package/dist/index.js +1 -0
- package/package.json +36 -4
- package/README.md +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 板目录契约——编排产物与呈现登记的单一正本
|
|
3
|
+
*
|
|
4
|
+
* 上游为仓根 `board:sync` 经编排工具族生成的 `domains.catalog.json` 产物,
|
|
5
|
+
* 下游为板应用数据层薄壳与本包推导核,契约字段语义与编排侧导出面对齐
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* 目录契约版本
|
|
9
|
+
*
|
|
10
|
+
* 与编排侧 `EXPORT_SCHEMA_VERSION` 同步递增,工厂装载时校验
|
|
11
|
+
*/
|
|
12
|
+
declare const CATALOG_SCHEMA_VERSION = 1;
|
|
13
|
+
/**
|
|
14
|
+
* 推进状态词表
|
|
15
|
+
*
|
|
16
|
+
* 取值限于四态语义键,中文标签经 `STAGE_STATUS_LABELS` 映射,禁止脱离词表自造状态
|
|
17
|
+
*/
|
|
18
|
+
type StageStatus = 'done' | 'blocked' | 'todo' | 'doing';
|
|
19
|
+
/**
|
|
20
|
+
* 状态中文标签映射
|
|
21
|
+
*/
|
|
22
|
+
declare const STAGE_STATUS_LABELS: Record<StageStatus, string>;
|
|
23
|
+
/**
|
|
24
|
+
* 键值事实行
|
|
25
|
+
*
|
|
26
|
+
* 条目独立页与身份要素呈现复用
|
|
27
|
+
*/
|
|
28
|
+
type KeyValueRow = {
|
|
29
|
+
/**
|
|
30
|
+
* 行标签
|
|
31
|
+
*/
|
|
32
|
+
label: string;
|
|
33
|
+
/**
|
|
34
|
+
* 行取值
|
|
35
|
+
*/
|
|
36
|
+
value: string;
|
|
37
|
+
/**
|
|
38
|
+
* 等宽字体标注,路径与版本号类取值为真
|
|
39
|
+
*
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
mono?: boolean;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* 关键计数要素行
|
|
46
|
+
*
|
|
47
|
+
* 进度行携带核验计数,状态行携带状态染色
|
|
48
|
+
*/
|
|
49
|
+
type SummaryRow = {
|
|
50
|
+
/**
|
|
51
|
+
* 行标签
|
|
52
|
+
*/
|
|
53
|
+
label: string;
|
|
54
|
+
/**
|
|
55
|
+
* 行取值
|
|
56
|
+
*/
|
|
57
|
+
value: string;
|
|
58
|
+
/**
|
|
59
|
+
* 状态染色,携带时以状态徽标呈现取值
|
|
60
|
+
*/
|
|
61
|
+
status?: StageStatus;
|
|
62
|
+
/**
|
|
63
|
+
* 补充说明
|
|
64
|
+
*/
|
|
65
|
+
note?: string;
|
|
66
|
+
/**
|
|
67
|
+
* 进度数据,仅进度行携带
|
|
68
|
+
*/
|
|
69
|
+
progress?: {
|
|
70
|
+
/**
|
|
71
|
+
* 已过计数
|
|
72
|
+
*/
|
|
73
|
+
passed: number;
|
|
74
|
+
/**
|
|
75
|
+
* 总计数
|
|
76
|
+
*/
|
|
77
|
+
total: number;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* 注册表条目登记
|
|
82
|
+
*
|
|
83
|
+
* 真源为仓内 `docs` 各注册表,本契约只做呈现登记,维护先改真源再改呈现
|
|
84
|
+
*/
|
|
85
|
+
type RegistryEntry = {
|
|
86
|
+
/**
|
|
87
|
+
* 条目路由标识,全站唯一,形态为「域标识-条目 slug」
|
|
88
|
+
*/
|
|
89
|
+
routeId: string;
|
|
90
|
+
/**
|
|
91
|
+
* 条目标题,取注册表条目登记名
|
|
92
|
+
*/
|
|
93
|
+
title: string;
|
|
94
|
+
/**
|
|
95
|
+
* 一句话说明,缺省取正本锚点说明
|
|
96
|
+
*/
|
|
97
|
+
note: string;
|
|
98
|
+
/**
|
|
99
|
+
* 推进状态,无状态语义的注册表缺省
|
|
100
|
+
*/
|
|
101
|
+
status?: StageStatus;
|
|
102
|
+
/**
|
|
103
|
+
* 条目独立页键值事实行
|
|
104
|
+
*/
|
|
105
|
+
facts: KeyValueRow[];
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* 文档域登记
|
|
109
|
+
*
|
|
110
|
+
* 一域对位仓内 `docs` 下同名注册表或文档通道,`registered` 以目录实况为真源
|
|
111
|
+
*/
|
|
112
|
+
type DomainRegistration = {
|
|
113
|
+
/**
|
|
114
|
+
* 域标识,与 `docs` 目录名一致
|
|
115
|
+
*/
|
|
116
|
+
id: string;
|
|
117
|
+
/**
|
|
118
|
+
* 域显示名
|
|
119
|
+
*/
|
|
120
|
+
label: string;
|
|
121
|
+
/**
|
|
122
|
+
* 域一句话定位
|
|
123
|
+
*/
|
|
124
|
+
note: string;
|
|
125
|
+
/**
|
|
126
|
+
* 正本目录,等宽呈现于空态与独立页
|
|
127
|
+
*/
|
|
128
|
+
sourceDir: string;
|
|
129
|
+
/**
|
|
130
|
+
* 该仓是否实有此域,真源为 `docs` 目录实况
|
|
131
|
+
*/
|
|
132
|
+
registered: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* 注册表条目全集
|
|
135
|
+
*/
|
|
136
|
+
entries: RegistryEntry[];
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* 分区来源组
|
|
140
|
+
*
|
|
141
|
+
* 并档分区内按来源域分组的呈现单元,单域分区仅一组
|
|
142
|
+
*/
|
|
143
|
+
type SectionGroup = {
|
|
144
|
+
/**
|
|
145
|
+
* 来源域标识
|
|
146
|
+
*/
|
|
147
|
+
domainId: string;
|
|
148
|
+
/**
|
|
149
|
+
* 来源域显示名,并档分区分组标题使用
|
|
150
|
+
*/
|
|
151
|
+
label: string;
|
|
152
|
+
/**
|
|
153
|
+
* 正本目录,等宽呈现于空态
|
|
154
|
+
*/
|
|
155
|
+
sourceDir: string;
|
|
156
|
+
/**
|
|
157
|
+
* 该域条目全集
|
|
158
|
+
*/
|
|
159
|
+
entries: RegistryEntry[];
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* 板分区
|
|
163
|
+
*
|
|
164
|
+
* 六分区构成规则的产物,并档分区携带多个来源组
|
|
165
|
+
*/
|
|
166
|
+
type BoardSection = {
|
|
167
|
+
/**
|
|
168
|
+
* 分区路由标识,单域分区为域标识,并档分区为并入域标识连缀
|
|
169
|
+
*/
|
|
170
|
+
id: string;
|
|
171
|
+
/**
|
|
172
|
+
* 分区显示名,并档分区为并入域显示名以「与」连缀
|
|
173
|
+
*/
|
|
174
|
+
label: string;
|
|
175
|
+
/**
|
|
176
|
+
* 分区一句话定位
|
|
177
|
+
*/
|
|
178
|
+
note: string;
|
|
179
|
+
/**
|
|
180
|
+
* 来源组序列,单域分区仅一项
|
|
181
|
+
*/
|
|
182
|
+
groups: SectionGroup[];
|
|
183
|
+
/**
|
|
184
|
+
* 分区条目全集,按来源组序拼接
|
|
185
|
+
*/
|
|
186
|
+
entries: RegistryEntry[];
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* 目录产物原文条目
|
|
190
|
+
*/
|
|
191
|
+
type CatalogEntry = {
|
|
192
|
+
/**
|
|
193
|
+
* 条目路由标识
|
|
194
|
+
*/
|
|
195
|
+
routeId: string;
|
|
196
|
+
/**
|
|
197
|
+
* 条目标题
|
|
198
|
+
*/
|
|
199
|
+
title: string;
|
|
200
|
+
/**
|
|
201
|
+
* 一句话说明
|
|
202
|
+
*/
|
|
203
|
+
note: string;
|
|
204
|
+
/**
|
|
205
|
+
* 推进状态原文,四态语义键
|
|
206
|
+
*/
|
|
207
|
+
status?: string;
|
|
208
|
+
/**
|
|
209
|
+
* 键值事实行全集
|
|
210
|
+
*/
|
|
211
|
+
facts: Array<{
|
|
212
|
+
label: string;
|
|
213
|
+
value: string;
|
|
214
|
+
mono?: boolean;
|
|
215
|
+
}>;
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* 目录产物原文域
|
|
219
|
+
*/
|
|
220
|
+
type CatalogDomain = {
|
|
221
|
+
/**
|
|
222
|
+
* 域标识
|
|
223
|
+
*/
|
|
224
|
+
id: string;
|
|
225
|
+
/**
|
|
226
|
+
* 域显示名
|
|
227
|
+
*/
|
|
228
|
+
label: string;
|
|
229
|
+
/**
|
|
230
|
+
* 域一句话定位
|
|
231
|
+
*/
|
|
232
|
+
note: string;
|
|
233
|
+
/**
|
|
234
|
+
* 正本目录
|
|
235
|
+
*/
|
|
236
|
+
sourceDir: string;
|
|
237
|
+
/**
|
|
238
|
+
* 该域是否实有
|
|
239
|
+
*/
|
|
240
|
+
registered: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* 条目全集
|
|
243
|
+
*/
|
|
244
|
+
entries: CatalogEntry[];
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* 目录产物原文形态
|
|
248
|
+
*/
|
|
249
|
+
type BoardCatalogJson = {
|
|
250
|
+
/**
|
|
251
|
+
* 目录契约版本
|
|
252
|
+
*/
|
|
253
|
+
schemaVersion: number;
|
|
254
|
+
/**
|
|
255
|
+
* 板标题
|
|
256
|
+
*/
|
|
257
|
+
boardTitle: string;
|
|
258
|
+
/**
|
|
259
|
+
* 域目录全集
|
|
260
|
+
*/
|
|
261
|
+
domains: Record<string, CatalogDomain>;
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* 计数徽标配色档
|
|
265
|
+
*
|
|
266
|
+
* 随所属分级取红、黄、绿、灰系
|
|
267
|
+
*/
|
|
268
|
+
type PipTone = 'bad' | 'todo' | 'ok' | 'neutral';
|
|
269
|
+
/**
|
|
270
|
+
* 侧边栏子级条目
|
|
271
|
+
*/
|
|
272
|
+
type NavChild = {
|
|
273
|
+
/**
|
|
274
|
+
* 条目标识
|
|
275
|
+
*/
|
|
276
|
+
id: string;
|
|
277
|
+
/**
|
|
278
|
+
* 显示名
|
|
279
|
+
*/
|
|
280
|
+
label: string;
|
|
281
|
+
/**
|
|
282
|
+
* 跳转目标路由
|
|
283
|
+
*/
|
|
284
|
+
to: string;
|
|
285
|
+
/**
|
|
286
|
+
* 状态圆点,仅携带状态语义的条目使用
|
|
287
|
+
*/
|
|
288
|
+
dot?: StageStatus;
|
|
289
|
+
/**
|
|
290
|
+
* 计数徽标
|
|
291
|
+
*/
|
|
292
|
+
pip?: {
|
|
293
|
+
tone: PipTone;
|
|
294
|
+
count: number;
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* 点击后滚动定位的卡片段标识,仅总览子级携带
|
|
298
|
+
*/
|
|
299
|
+
scrollTo?: string;
|
|
300
|
+
/**
|
|
301
|
+
* 当前分区命中该值时子级高亮
|
|
302
|
+
*/
|
|
303
|
+
activeSection?: string;
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* 侧边栏父级条目
|
|
307
|
+
*/
|
|
308
|
+
type NavSection = {
|
|
309
|
+
/**
|
|
310
|
+
* 分区标识
|
|
311
|
+
*/
|
|
312
|
+
id: string;
|
|
313
|
+
/**
|
|
314
|
+
* 显示名
|
|
315
|
+
*/
|
|
316
|
+
label: string;
|
|
317
|
+
/**
|
|
318
|
+
* 跳转目标路由
|
|
319
|
+
*/
|
|
320
|
+
to: string;
|
|
321
|
+
/**
|
|
322
|
+
* 当前分区命中这些值时父级同样高亮,用于跨分区挂靠
|
|
323
|
+
*/
|
|
324
|
+
alsoActiveFor?: string[];
|
|
325
|
+
/**
|
|
326
|
+
* 子级条目,空注册表分区缺省
|
|
327
|
+
*/
|
|
328
|
+
children?: NavChild[];
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* 顶部导航条目
|
|
332
|
+
*/
|
|
333
|
+
type TopNavItem = {
|
|
334
|
+
/**
|
|
335
|
+
* 事项标识
|
|
336
|
+
*/
|
|
337
|
+
id: string;
|
|
338
|
+
/**
|
|
339
|
+
* 显示名
|
|
340
|
+
*/
|
|
341
|
+
label: string;
|
|
342
|
+
/**
|
|
343
|
+
* 跳转目标路由
|
|
344
|
+
*/
|
|
345
|
+
to: string;
|
|
346
|
+
/**
|
|
347
|
+
* 状态圆点,总览类事项缺省
|
|
348
|
+
*/
|
|
349
|
+
dot?: StageStatus;
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* 面包屑单项
|
|
353
|
+
*/
|
|
354
|
+
type CrumbEntry = {
|
|
355
|
+
/**
|
|
356
|
+
* 显示名
|
|
357
|
+
*/
|
|
358
|
+
label: string;
|
|
359
|
+
/**
|
|
360
|
+
* 跳转路由,缺省为纯文本级
|
|
361
|
+
*/
|
|
362
|
+
to?: string;
|
|
363
|
+
};
|
|
364
|
+
/**
|
|
365
|
+
* 条目索引行
|
|
366
|
+
*/
|
|
367
|
+
type EntryIndexRow = {
|
|
368
|
+
/**
|
|
369
|
+
* 命中的注册表条目
|
|
370
|
+
*/
|
|
371
|
+
entry: RegistryEntry;
|
|
372
|
+
/**
|
|
373
|
+
* 所属分区标识
|
|
374
|
+
*/
|
|
375
|
+
sectionId: string;
|
|
376
|
+
};
|
|
377
|
+
/**
|
|
378
|
+
* 注册表族优先序
|
|
379
|
+
*
|
|
380
|
+
* 事项分区先取注册表族,固定序为 issue 注册表、feature 注册表、技术债、决策库、台账族
|
|
381
|
+
*/
|
|
382
|
+
declare const REGISTRY_FAMILY_ORDER: readonly string[];
|
|
383
|
+
/**
|
|
384
|
+
* 文档域优先序
|
|
385
|
+
*
|
|
386
|
+
* 注册表族不足五位时以文档域补足,固定序为作业记录、过错判例、计划归档、变更规格、思考与反思、探索发现、自由故事
|
|
387
|
+
*/
|
|
388
|
+
declare const DOC_DOMAIN_ORDER: readonly string[];
|
|
389
|
+
/**
|
|
390
|
+
* 域全序
|
|
391
|
+
*
|
|
392
|
+
* 注册表族在前文档域在后的候选全序,装配核以此序显式遍历,不依赖产物键序
|
|
393
|
+
*/
|
|
394
|
+
declare const DOMAIN_FULL_ORDER: readonly string[];
|
|
395
|
+
/**
|
|
396
|
+
* 分区取位上限
|
|
397
|
+
*
|
|
398
|
+
* 总览之外最多五个事项分区,超出者并入末位分区并档呈现
|
|
399
|
+
*/
|
|
400
|
+
declare const SECTION_SLOT_COUNT = 5;
|
|
401
|
+
/**
|
|
402
|
+
* 并档分区兜底显示名
|
|
403
|
+
*
|
|
404
|
+
* 并入域超过两个时不再连缀域名,固定以其他文档域命名
|
|
405
|
+
*/
|
|
406
|
+
declare const MERGED_SECTION_FALLBACK_LABEL = "其他文档域";
|
|
407
|
+
/**
|
|
408
|
+
* 候选域全集解析
|
|
409
|
+
*
|
|
410
|
+
* 注册表族全体先于文档域,仅收录登记为实有的域
|
|
411
|
+
*
|
|
412
|
+
* @param domains - 文档域登记全集
|
|
413
|
+
* @returns 有序候选域标识序列
|
|
414
|
+
*/
|
|
415
|
+
declare const resolveCandidateDomainIds: (domains: Record<string, DomainRegistration>) => string[];
|
|
416
|
+
/**
|
|
417
|
+
* 板分区全集解析
|
|
418
|
+
*
|
|
419
|
+
* 六分区构成规则的可执行正本:候选不超过五域时各成单域分区,
|
|
420
|
+
* 超过五域时前四域各成单域分区,余域并入末位分区并档呈现,
|
|
421
|
+
* 无候选时返回空序列,板仅余总览
|
|
422
|
+
*
|
|
423
|
+
* @param domains - 文档域登记全集
|
|
424
|
+
* @returns 事项分区序列,总览不在其列
|
|
425
|
+
*/
|
|
426
|
+
declare const resolveBoardSections: (domains: Record<string, DomainRegistration>) => BoardSection[];
|
|
427
|
+
/**
|
|
428
|
+
* 总览分区标识
|
|
429
|
+
*
|
|
430
|
+
* 总览恒居六分区首位,根路由即总览
|
|
431
|
+
*/
|
|
432
|
+
declare const OVERVIEW_SECTION_ID = "overview";
|
|
433
|
+
/**
|
|
434
|
+
* 总览分区显示名
|
|
435
|
+
*/
|
|
436
|
+
declare const OVERVIEW_SECTION_LABEL = "总览";
|
|
437
|
+
/**
|
|
438
|
+
* 总览分区一句话定位
|
|
439
|
+
*/
|
|
440
|
+
declare const OVERVIEW_SECTION_NOTE = "各分区导览与关键计数";
|
|
441
|
+
/**
|
|
442
|
+
* 分区元信息
|
|
443
|
+
*/
|
|
444
|
+
type SectionMeta = {
|
|
445
|
+
/**
|
|
446
|
+
* 分区显示名
|
|
447
|
+
*/
|
|
448
|
+
label: string;
|
|
449
|
+
/**
|
|
450
|
+
* 分区一句话定位
|
|
451
|
+
*/
|
|
452
|
+
note: string;
|
|
453
|
+
/**
|
|
454
|
+
* 面包屑用短标题
|
|
455
|
+
*/
|
|
456
|
+
title: string;
|
|
457
|
+
};
|
|
458
|
+
/**
|
|
459
|
+
* 板导航推导产物
|
|
460
|
+
*
|
|
461
|
+
* 查询函数闭包持有 `Map` 索引,消费侧禁绕过函数直取索引结构
|
|
462
|
+
*/
|
|
463
|
+
type BoardNavigation = {
|
|
464
|
+
/**
|
|
465
|
+
* 分区标识全集,总览居首,分区按构成序排列
|
|
466
|
+
*/
|
|
467
|
+
sectionIds: readonly string[];
|
|
468
|
+
/**
|
|
469
|
+
* 分区元信息查询
|
|
470
|
+
*
|
|
471
|
+
* @remarks
|
|
472
|
+
* 以 `Map` 承载,未命中返回 `undefined`,原型链键不参与命中
|
|
473
|
+
*/
|
|
474
|
+
findSectionMeta: (id: string) => SectionMeta | undefined;
|
|
475
|
+
/**
|
|
476
|
+
* 判定字符串是否为合法分区标识
|
|
477
|
+
*/
|
|
478
|
+
isSectionId: (value: string) => boolean;
|
|
479
|
+
/**
|
|
480
|
+
* 按分区标识查板分区
|
|
481
|
+
*
|
|
482
|
+
* @remarks
|
|
483
|
+
* 命中的板分区,总览与未命中返回 `undefined`
|
|
484
|
+
*/
|
|
485
|
+
findBoardSection: (id: string) => BoardSection | undefined;
|
|
486
|
+
/**
|
|
487
|
+
* 按条目路由标识查索引行
|
|
488
|
+
*
|
|
489
|
+
* @remarks
|
|
490
|
+
* 以 `Map` 承载,未命中返回 `undefined`,原型链键不参与命中
|
|
491
|
+
*/
|
|
492
|
+
findEntryIndex: (itemId: string) => EntryIndexRow | undefined;
|
|
493
|
+
/**
|
|
494
|
+
* 顶部导航条目全集
|
|
495
|
+
*
|
|
496
|
+
* 事项级导航,总览居首,分区按构成序排列
|
|
497
|
+
*/
|
|
498
|
+
topNavItems: TopNavItem[];
|
|
499
|
+
/**
|
|
500
|
+
* 侧边栏分区全集
|
|
501
|
+
*
|
|
502
|
+
* 父级为分区锚点,子级为分区内条目,空注册表分区仅父级
|
|
503
|
+
*/
|
|
504
|
+
navSections: NavSection[];
|
|
505
|
+
};
|
|
506
|
+
/**
|
|
507
|
+
* 分区状态圆点解析
|
|
508
|
+
*
|
|
509
|
+
* 分区携带未开始或受阻条目时显点,受阻优先,进行中不亮点
|
|
510
|
+
*
|
|
511
|
+
* @param entries - 分区条目全集
|
|
512
|
+
* @returns 圆点状态,无显点语义返回 `undefined`
|
|
513
|
+
*/
|
|
514
|
+
declare const sectionDotOf: (entries: RegistryEntry[]) => StageStatus | undefined;
|
|
515
|
+
/**
|
|
516
|
+
* 板导航推导
|
|
517
|
+
*
|
|
518
|
+
* 以板分区全集构建分区元信息表、全站条目索引与两栏导航条目,
|
|
519
|
+
* 索引结构一律 `Map`,键集合封闭于总览加实际分区与实际条目
|
|
520
|
+
*
|
|
521
|
+
* @param sections - 板分区全集,依构成序
|
|
522
|
+
* @returns 板导航推导产物
|
|
523
|
+
*/
|
|
524
|
+
declare const buildBoardNavigation: (sections: BoardSection[]) => BoardNavigation;
|
|
525
|
+
/**
|
|
526
|
+
* 板数据装配产物
|
|
527
|
+
*
|
|
528
|
+
* 域登记、板分区与导航推导的聚合承载,查询函数闭包持有索引结构
|
|
529
|
+
*/
|
|
530
|
+
type BoardData = {
|
|
531
|
+
/**
|
|
532
|
+
* 板标题,以仓名为身份宣告
|
|
533
|
+
*/
|
|
534
|
+
boardTitle: string;
|
|
535
|
+
/**
|
|
536
|
+
* 文档域登记全集
|
|
537
|
+
*
|
|
538
|
+
* @remarks
|
|
539
|
+
* 键为域标识,装配序为域全序,不依赖产物键序
|
|
540
|
+
*/
|
|
541
|
+
domains: Record<string, DomainRegistration>;
|
|
542
|
+
/**
|
|
543
|
+
* 域全序标识序列,词表全域俱在
|
|
544
|
+
*/
|
|
545
|
+
domainIds: readonly string[];
|
|
546
|
+
/**
|
|
547
|
+
* 按域标识取实有条目数
|
|
548
|
+
*
|
|
549
|
+
* @remarks
|
|
550
|
+
* 未实有与未登记域为 `0`
|
|
551
|
+
*/
|
|
552
|
+
domainCount: (id: string) => number;
|
|
553
|
+
/**
|
|
554
|
+
* 按域标识取已完成条目数
|
|
555
|
+
*
|
|
556
|
+
* @remarks
|
|
557
|
+
* 未实有与未登记域为 `0`
|
|
558
|
+
*/
|
|
559
|
+
domainDoneCount: (id: string) => number;
|
|
560
|
+
/**
|
|
561
|
+
* 板分区全集,依构成序,总览不在其列
|
|
562
|
+
*/
|
|
563
|
+
sections: ReturnType<typeof resolveBoardSections>;
|
|
564
|
+
/**
|
|
565
|
+
* 板导航推导产物
|
|
566
|
+
*/
|
|
567
|
+
navigation: BoardNavigation;
|
|
568
|
+
};
|
|
569
|
+
/**
|
|
570
|
+
* 板数据装配工厂
|
|
571
|
+
*
|
|
572
|
+
* 校验目录契约版本与词表全域在场后按域全序装配,域缺席即抛错暴露产物
|
|
573
|
+
* 与词表的漂移,禁止静默丢域
|
|
574
|
+
*
|
|
575
|
+
* @param catalog - 目录产物原文,板内 `data` 目录的 `domains.catalog.json`
|
|
576
|
+
* @returns 板数据装配产物
|
|
577
|
+
* @throws {@link Error} 目录契约版本不符或词表域缺席时抛出,暴露产物与词表的漂移
|
|
578
|
+
*/
|
|
579
|
+
declare const createBoardData: (catalog: BoardCatalogJson) => BoardData;
|
|
580
|
+
export { BoardCatalogJson, BoardData, BoardNavigation, BoardSection, CATALOG_SCHEMA_VERSION, CatalogDomain, CatalogEntry, CrumbEntry, DOC_DOMAIN_ORDER, DOMAIN_FULL_ORDER, DomainRegistration, EntryIndexRow, KeyValueRow, MERGED_SECTION_FALLBACK_LABEL, NavChild, NavSection, OVERVIEW_SECTION_ID, OVERVIEW_SECTION_LABEL, OVERVIEW_SECTION_NOTE, PipTone, REGISTRY_FAMILY_ORDER, RegistryEntry, SECTION_SLOT_COUNT, STAGE_STATUS_LABELS, SectionGroup, SectionMeta, StageStatus, SummaryRow, TopNavItem, buildBoardNavigation, createBoardData, resolveBoardSections, resolveCandidateDomainIds, sectionDotOf };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=1,t={blocked:`受阻`,done:`已完成`,doing:`进行中`,todo:`未开始`},n=[`issues`,`features`,`debts`,`decisions`,`ledgers`],r=[`records`,`pitfalls`,`plans`,`specs`,`reflections`,`findings`,`stories`],i=[...n,...r],a=5,o=`其他文档域`,s=e=>({domainId:e.id,entries:e.entries,label:e.label,sourceDir:e.sourceDir}),c=e=>({entries:e.entries,groups:[s(e)],id:e.id,label:e.label,note:e.note}),l=e=>({entries:e.flatMap(e=>e.entries),groups:e.map(s),id:e.map(e=>e.id).join(`-`),label:e.length<=2?e.map(e=>e.label).join(`与`):o,note:`并入域的合并登记,条目按来源域分组呈现`}),u=e=>i.filter(t=>e[t]?.registered===!0),d=e=>{let t=u(e).flatMap(t=>{let n=e[t];return n===void 0?[]:[n]});if(t.length<=5)return t.map(c);let n=t.slice(0,4),r=t.slice(4);return[...n.map(c),l(r)]},f=`overview`,p=`总览`,m=`各分区导览与关键计数`,h=e=>{if(e.some(e=>e.status===`blocked`))return`blocked`;if(e.some(e=>e.status===`todo`))return`todo`},g=(e,t)=>({dot:t.status,id:t.routeId,label:t.title,to:`/${e}/${t.routeId}`}),_=e=>{let t=new Map([[f,{label:p,note:m,title:p}],...e.map(e=>[e.id,{label:e.label,note:e.note,title:e.label}])]),n=[f,...e.map(e=>e.id)],r=new Map(e.map(e=>[e.id,e])),i=new Map(e.flatMap(e=>e.entries.map(t=>[t.routeId,{entry:t,sectionId:e.id}])));return{findBoardSection:e=>r.get(e),findEntryIndex:e=>i.get(e),findSectionMeta:e=>t.get(e),isSectionId:e=>t.has(e),navSections:[{id:f,label:p,to:`/`},...e.map(e=>({children:e.entries.length===0?void 0:e.entries.map(t=>g(e.id,t)),id:e.id,label:e.label,to:`/${e.id}`}))],sectionIds:n,topNavItems:[{id:f,label:p,to:`/`},...e.map(e=>({dot:h(e.entries),id:e.id,label:e.label,to:`/${e.id}`}))]}},v=new Set(Object.keys(t)),y=e=>v.has(e),b=e=>{if(e!==void 0)return y(e)?e:void 0},x=e=>({facts:e.facts,note:e.note,routeId:e.routeId,status:b(e.status),title:e.title}),S=e=>({entries:e.entries.map(x),id:e.id,label:e.label,note:e.note,registered:e.registered,sourceDir:e.sourceDir}),C=e=>{if(e.schemaVersion!==1)throw Error(`目录契约版本不符:期望 1 实到 ${String(e.schemaVersion)}`);let t=i.map(t=>{let n=e.domains[t];if(n===void 0)throw Error(`目录产物缺域:${t}`);return S(n)}),n=Object.fromEntries(t.map(e=>[e.id,e])),r=d(n),a=new Map(t.map(e=>[e.id,e.registered?e.entries.length:0])),o=new Map(t.map(e=>[e.id,e.registered?e.entries.filter(e=>e.status===`done`).length:0]));return{boardTitle:e.boardTitle,domainCount:e=>a.get(e)??0,domainDoneCount:e=>o.get(e)??0,domainIds:i,domains:n,navigation:_(r),sections:r}};export{e as CATALOG_SCHEMA_VERSION,r as DOC_DOMAIN_ORDER,i as DOMAIN_FULL_ORDER,o as MERGED_SECTION_FALLBACK_LABEL,f as OVERVIEW_SECTION_ID,p as OVERVIEW_SECTION_LABEL,m as OVERVIEW_SECTION_NOTE,n as REGISTRY_FAMILY_ORDER,a as SECTION_SLOT_COUNT,t as STAGE_STATUS_LABELS,_ as buildBoardNavigation,C as createBoardData,d as resolveBoardSections,u as resolveCandidateDomainIds,h as sectionDotOf};
|
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longzai-intelligence-progress-board/data",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "Longzai Intelligence 进度板数据消费推导包",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"data",
|
|
7
|
+
"longzai-intelligence",
|
|
8
|
+
"progress-board"
|
|
9
|
+
],
|
|
10
|
+
"license": "UNLICENSED",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "lzi-builder",
|
|
25
|
+
"build:prod": "NODE_ENV=production bun run build",
|
|
26
|
+
"prepublishOnly": "bun run build:prod",
|
|
27
|
+
"clean": "lzi-dev-tools clean",
|
|
28
|
+
"typecheck": "lzi-typecheck",
|
|
29
|
+
"lint": "lzi-lint lint",
|
|
30
|
+
"lint:fix": "lzi-lint fix",
|
|
31
|
+
"test": "lzi-bun test",
|
|
32
|
+
"test:coverage": "lzi-bun test --coverage",
|
|
33
|
+
"test:watch": "lzi-bun test --watch"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@longzai-intelligence-builder/esm": "^0.2.28"
|
|
37
|
+
}
|
|
38
|
+
}
|
package/README.md
DELETED