@longzai-intelligence-readme/core 0.0.1
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 +254 -0
- package/dist/index.js +3 -0
- package/package.json +37 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { LziReadmeExemption } from "@longzai-intelligence-readme/config";
|
|
2
|
+
//#region src/types.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* 门禁引擎类型定义
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 违例级别:error 计入 exitCode 阻断;warn 为线索级报告不阻断(人工判定)
|
|
8
|
+
*/
|
|
9
|
+
type ReadmeSeverity = 'error' | 'warn';
|
|
10
|
+
/**
|
|
11
|
+
* README 文件类别:仓库根 / 嵌套(packages、apps 下)
|
|
12
|
+
*/
|
|
13
|
+
type ReadmeFileKind = 'root' | 'nested';
|
|
14
|
+
/**
|
|
15
|
+
* 单条违例
|
|
16
|
+
*/
|
|
17
|
+
type ReadmeViolation = {
|
|
18
|
+
/**
|
|
19
|
+
* 仓库相对 posix 路径(如 `README.md`、`packages/core/README.md`)
|
|
20
|
+
*/
|
|
21
|
+
file: string;
|
|
22
|
+
/**
|
|
23
|
+
* 行号(1-based);文件级规则(标题缺失等)为 null
|
|
24
|
+
*/
|
|
25
|
+
line: number | null;
|
|
26
|
+
/**
|
|
27
|
+
* 规则标识(如 `E-BRAND-CN`、`W-MECH`)
|
|
28
|
+
*/
|
|
29
|
+
rule: string;
|
|
30
|
+
/**
|
|
31
|
+
* 级别
|
|
32
|
+
*/
|
|
33
|
+
severity: ReadmeSeverity;
|
|
34
|
+
/**
|
|
35
|
+
* 违例说明(含整改指引)
|
|
36
|
+
*/
|
|
37
|
+
message: string;
|
|
38
|
+
/**
|
|
39
|
+
* 命中行摘录(截断;文件级规则缺省)
|
|
40
|
+
*/
|
|
41
|
+
excerpt?: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* 被豁免的违例(附豁免原因)
|
|
45
|
+
*/
|
|
46
|
+
type ReadmeExemptedViolation = ReadmeViolation & {
|
|
47
|
+
/**
|
|
48
|
+
* 豁免原因(来自配置登记,原样展示)
|
|
49
|
+
*/
|
|
50
|
+
reason: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* 扫描目标(发现器产出)
|
|
54
|
+
*/
|
|
55
|
+
type ReadmeScanTarget = {
|
|
56
|
+
/**
|
|
57
|
+
* 仓库相对 posix 路径
|
|
58
|
+
*/
|
|
59
|
+
relPath: string;
|
|
60
|
+
/**
|
|
61
|
+
* 文件类别
|
|
62
|
+
*/
|
|
63
|
+
kind: ReadmeFileKind;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* 门禁汇总
|
|
67
|
+
*/
|
|
68
|
+
type ReadmeGateSummary = {
|
|
69
|
+
/**
|
|
70
|
+
* 扫描 README 文件数
|
|
71
|
+
*/
|
|
72
|
+
filesScanned: number;
|
|
73
|
+
/**
|
|
74
|
+
* 根 README 数(0 或 1)
|
|
75
|
+
*/
|
|
76
|
+
rootCount: number;
|
|
77
|
+
/**
|
|
78
|
+
* 嵌套 README 数
|
|
79
|
+
*/
|
|
80
|
+
nestedCount: number;
|
|
81
|
+
/**
|
|
82
|
+
* error 违例数(豁免不计入)
|
|
83
|
+
*/
|
|
84
|
+
errorCount: number;
|
|
85
|
+
/**
|
|
86
|
+
* warn 违例数(豁免不计入)
|
|
87
|
+
*/
|
|
88
|
+
warnCount: number;
|
|
89
|
+
/**
|
|
90
|
+
* 豁免命中数
|
|
91
|
+
*/
|
|
92
|
+
exemptedCount: number;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* 门禁报告(text/json 格式化的唯一数据源)
|
|
96
|
+
*/
|
|
97
|
+
type ReadmeGateReport = {
|
|
98
|
+
/**
|
|
99
|
+
* 规则集版本(与规范草案版本绑定)
|
|
100
|
+
*/
|
|
101
|
+
rulesVersion: string;
|
|
102
|
+
/**
|
|
103
|
+
* 规则依据指针(草案位置留痕)
|
|
104
|
+
*/
|
|
105
|
+
specPointer: string;
|
|
106
|
+
/**
|
|
107
|
+
* 生效违例(error + warn,豁免已剔除)
|
|
108
|
+
*/
|
|
109
|
+
violations: ReadmeViolation[];
|
|
110
|
+
/**
|
|
111
|
+
* 豁免命中的违例(单列展示)
|
|
112
|
+
*/
|
|
113
|
+
exempted: ReadmeExemptedViolation[];
|
|
114
|
+
/**
|
|
115
|
+
* 汇总计数
|
|
116
|
+
*/
|
|
117
|
+
summary: ReadmeGateSummary;
|
|
118
|
+
};
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/rules.d.ts
|
|
121
|
+
/**
|
|
122
|
+
* 行级规则定义(逐行正则命中即报告)
|
|
123
|
+
*/
|
|
124
|
+
type ReadmeLineRule = {
|
|
125
|
+
/**
|
|
126
|
+
* 规则标识
|
|
127
|
+
*/
|
|
128
|
+
id: string;
|
|
129
|
+
/**
|
|
130
|
+
* 级别
|
|
131
|
+
*/
|
|
132
|
+
severity: ReadmeSeverity;
|
|
133
|
+
/**
|
|
134
|
+
* 命中正则(全局标志;实现层逐行新建实例探测)
|
|
135
|
+
*/
|
|
136
|
+
pattern: RegExp;
|
|
137
|
+
/**
|
|
138
|
+
* 违例说明(含整改指引)
|
|
139
|
+
*/
|
|
140
|
+
message: string;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* error 行级规则表
|
|
144
|
+
*
|
|
145
|
+
* 覆盖草案 v2 负面清单 a–f、i–l 与品牌口径(标题级规则见 scan 层)。
|
|
146
|
+
*/
|
|
147
|
+
declare const ERROR_LINE_RULES: readonly ReadmeLineRule[];
|
|
148
|
+
/**
|
|
149
|
+
* warn 行级规则表(草案 g/k 线索级:人工判定,不阻断)
|
|
150
|
+
*/
|
|
151
|
+
declare const WARN_LINE_RULES: readonly ReadmeLineRule[];
|
|
152
|
+
/**
|
|
153
|
+
* 全部行级规则(error 在前,warn 在后)
|
|
154
|
+
*/
|
|
155
|
+
declare const LINE_RULES: readonly ReadmeLineRule[];
|
|
156
|
+
/**
|
|
157
|
+
* 根标题合规形态:`# Longzai Intelligence <Name>`
|
|
158
|
+
*/
|
|
159
|
+
declare const ROOT_TITLE_PATTERN: RegExp;
|
|
160
|
+
/**
|
|
161
|
+
* 一级标题行形态(用于定位根标题)
|
|
162
|
+
*/
|
|
163
|
+
declare const H1_HEADING_PATTERN: RegExp;
|
|
164
|
+
/**
|
|
165
|
+
* 禁止段落标题(许可证/贡献——由 package.json 承载)
|
|
166
|
+
*/
|
|
167
|
+
declare const FORBIDDEN_SECTION_PATTERN: RegExp;
|
|
168
|
+
/**
|
|
169
|
+
* 立项文体节标题(发布 README 精简口径,内部细节迁内部承接文件)
|
|
170
|
+
*/
|
|
171
|
+
declare const CHARTER_SECTION_PATTERN: RegExp;
|
|
172
|
+
/**
|
|
173
|
+
* 结构树行形态(含树形字符)
|
|
174
|
+
*/
|
|
175
|
+
declare const TREE_LINE_PATTERN: RegExp;
|
|
176
|
+
/**
|
|
177
|
+
* 结构树行内注释形态(树行 + 行内 # 注释)
|
|
178
|
+
*/
|
|
179
|
+
declare const TREE_ANNOTATED_PATTERN: RegExp;
|
|
180
|
+
/**
|
|
181
|
+
* 结构树注释行数阈值(达到即报 E-TREE-ANNOTATED)
|
|
182
|
+
*/
|
|
183
|
+
declare const TREE_ANNOTATED_THRESHOLD = 3;
|
|
184
|
+
/**
|
|
185
|
+
* 结构树总行数阈值(超过即报 E-TREE-LONG)
|
|
186
|
+
*/
|
|
187
|
+
declare const TREE_LONG_THRESHOLD = 40;
|
|
188
|
+
/**
|
|
189
|
+
* 单规则单文件保留命中上限(防超长文件刷屏)
|
|
190
|
+
*/
|
|
191
|
+
declare const MAX_HITS_PER_RULE = 8;
|
|
192
|
+
/**
|
|
193
|
+
* 摘录截断长度
|
|
194
|
+
*/
|
|
195
|
+
declare const EXCERPT_MAX_LENGTH = 120;
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/discover.utils.d.ts
|
|
198
|
+
/**
|
|
199
|
+
* 收集单仓全部 README 扫描目标
|
|
200
|
+
*
|
|
201
|
+
* @param repoRoot - 仓库根目录绝对路径
|
|
202
|
+
* @returns 扫描目标列表(根在前,嵌套按路径字典序)
|
|
203
|
+
*/
|
|
204
|
+
declare const collectReadmeTargets: (repoRoot: string) => ReadmeScanTarget[];
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region src/scan.utils.d.ts
|
|
207
|
+
/**
|
|
208
|
+
* 扫描单个 README 内容
|
|
209
|
+
*
|
|
210
|
+
* @param target - 扫描目标(相对路径 + 类别)
|
|
211
|
+
* @param content - README 全文
|
|
212
|
+
* @returns 违例清单(按行号升序)
|
|
213
|
+
*/
|
|
214
|
+
declare const scanReadmeContent: (target: ReadmeScanTarget, content: string) => ReadmeViolation[];
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/gate.core.d.ts
|
|
217
|
+
/**
|
|
218
|
+
* 门禁运行参数
|
|
219
|
+
*/
|
|
220
|
+
type RunReadmeGateOptions = {
|
|
221
|
+
/**
|
|
222
|
+
* 仓库根目录绝对路径
|
|
223
|
+
*/
|
|
224
|
+
repoRoot: string;
|
|
225
|
+
/**
|
|
226
|
+
* 豁免登记列表(来自就地配置;缺省空)
|
|
227
|
+
*/
|
|
228
|
+
exemptions?: LziReadmeExemption[];
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* 运行 README 门禁
|
|
232
|
+
*
|
|
233
|
+
* @param options - 门禁运行参数
|
|
234
|
+
* @returns 门禁报告(违例、豁免与汇总)
|
|
235
|
+
*/
|
|
236
|
+
declare const runReadmeGate: (options: RunReadmeGateOptions) => ReadmeGateReport;
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region src/format-gate-report.utils.d.ts
|
|
239
|
+
/**
|
|
240
|
+
* 渲染 text 形态报告
|
|
241
|
+
*
|
|
242
|
+
* @param report - 门禁报告
|
|
243
|
+
* @returns stdout 全文(不含汇总错误行——失败汇总由命令层写 stderr)
|
|
244
|
+
*/
|
|
245
|
+
declare const formatGateReport: (report: ReadmeGateReport) => string;
|
|
246
|
+
/**
|
|
247
|
+
* 渲染 json 形态报告
|
|
248
|
+
*
|
|
249
|
+
* @param report - 门禁报告
|
|
250
|
+
* @returns JSON 全文(缩进 2 空格)
|
|
251
|
+
*/
|
|
252
|
+
declare const formatGateReportJson: (report: ReadmeGateReport) => string;
|
|
253
|
+
//#endregion
|
|
254
|
+
export { CHARTER_SECTION_PATTERN, ERROR_LINE_RULES, EXCERPT_MAX_LENGTH, FORBIDDEN_SECTION_PATTERN, H1_HEADING_PATTERN, LINE_RULES, MAX_HITS_PER_RULE, ROOT_TITLE_PATTERN, type ReadmeExemptedViolation, type ReadmeFileKind, type ReadmeGateReport, type ReadmeGateSummary, type ReadmeLineRule, type ReadmeScanTarget, type ReadmeSeverity, type ReadmeViolation, type RunReadmeGateOptions, TREE_ANNOTATED_PATTERN, TREE_ANNOTATED_THRESHOLD, TREE_LINE_PATTERN, TREE_LONG_THRESHOLD, WARN_LINE_RULES, collectReadmeTargets, formatGateReport, formatGateReportJson, runReadmeGate, scanReadmeContent };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{readFileSync as e,readdirSync as t,statSync as n}from"node:fs";import{join as r}from"node:path";import{RULES_SPEC_POINTER as i,RULES_VERSION as a}from"@longzai-intelligence-readme/config";const o=[{id:`E-BRAND-CN`,severity:`error`,pattern:/龙智|龙仔智能|隆智|龙崽/g,message:`中文品牌译名——品牌唯一正确表达为 "Longzai Intelligence",任何中文译名禁止`},{id:`E-SHORT-SCOPE`,severity:`error`,pattern:/@lzi\//g,message:`短 scope 包名——包名一律长形式 @longzai-intelligence-*`},{id:`E-BAD-ABBR`,severity:`error`,pattern:/\bLI\b|\bLZ\b/g,message:`禁用缩写——品牌缩写仅 LZI/lzi`},{id:`E-INTERNAL-NET`,severity:`error`,pattern:/\b(?:10\.\d{1,3}\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3}|172\.(?:1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3})\b|\b[\w-]+\.(?:local|internal|corp)\b/g,message:`内网地址/域名——README 按发布口径处理,不得含内网信息(示例也用占位形态)`},{id:`E-ABS-PATH`,severity:`error`,pattern:/\/Volumes\/|\/Users\/[A-Za-z0-9_-]+|\/home\/[A-Za-z0-9_-]+/g,message:`本机绝对路径——示例一律用 ~/ 或 <占位> 形态`},{id:`E-EMAIL`,severity:`error`,pattern:/[\w.+-]+@(?!([\w-]+\.)*example\.(?:com|org|net)\b)[A-Za-z][\w-]*(?:\.[\w-]+)*\.[A-Za-z]{2,}/g,message:`邮箱形态——README 不含联系方式(文档示例域 example.* 及其子域除外)`},{id:`E-CREDENTIAL`,severity:`error`,pattern:/(?:api[_-]?key|secret|passwd|password|token)\s*[:=]\s*(?!['"]?(?:your-|xxx|<))\S+/gi,message:`凭据形态——密钥/token/口令及其实值不得出现(占位示例除外)`},{id:`E-SCALE`,severity:`error`,pattern:/\d{2,}\s*个(?:子)?(?:项目|仓库|仓)/g,message:`内部规模数字(「N 个项目」类)——不入发布 README`},{id:`E-OPS`,severity:`error`,pattern:/\bbun\s+(?:push-all|push|version:upgrade-across|version:upgrade|agent:sync|vscode:sync)\b/g,message:`跨仓运维命令——产品群级操作不入 README`},{id:`E-ORG-COMPARE`,severity:`error`,pattern:/与\s*`?@longzai-intelligence-[a-z-]+`?(?:[、,]\s*`?@longzai-intelligence-[a-z-]+`?)*\s*同级/g,message:`内部组织结构对比表述——不入发布 README`},{id:`E-GIT-REMOTE`,severity:`error`,pattern:/git@[A-Za-z0-9.-]+:[\w./-]+|longzai-tech\b/g,message:`内部 git remote/组织账号/托管位置——不入 README`},{id:`E-DEV-CONSTRAINT`,severity:`error`,pattern:/禁止在[^,。\n]{0,12}(?:运行|执行)|请在(?:子包|各应用目录|应用目录|包目录|各仓)/g,message:`内部工程约束——面向仓内开发者的禁令/流程,迁内部承接文件`},{id:`E-MIT`,severity:`error`,pattern:/\[MIT\]|MIT License/gi,message:`MIT 表述——默认 UNLICENSED,禁默认 MIT`}],s=[{id:`W-MECH`,severity:`warn`,pattern:/\.lzi\/|\.lzi\b|lzi-architecture(?:\.sample)?\.yaml|docs\/ledgers|lzi-[a-z-]+\.config\.ts/g,message:`内部治理机制命名/路径(线索级,人工判定;机制即本仓产品者可豁免登记)`},{id:`W-TOOL`,severity:`warn`,pattern:/\blzi-(?:builder|projects|dev-cli|release|env|git|decision|issues|vscode|agent|npm-registry|bun)\b/g,message:`内部工具名(线索级,人工判定)`},{id:`W-ADR`,severity:`warn`,pattern:/ADR[\s-]?\d{3,4}/g,message:`ADR 编号引用(线索级,人工判定;指向本仓决策记录者可豁免登记)`}],c=[...o,...s],l=/^#\s+Longzai Intelligence(\s|$)/,u=/^#\s+/,d=/^#{1,3}\s*(?:许可证|贡献|License|Contributing)\s*$/,f=/^#{1,3}\s*(?:创建初衷|工作范围)\s*$/,p=/[│├└]/,m=/#\s+\S/,h=3,g=40,_=8,v=120,y=/* @__PURE__ */ new Set([`node_modules`,`dist`,`out`,`.turbo`,`.git`,`build`,`.next`,`coverage`,`.cache`,`target`,`.venv`]),b=[`packages`,`apps`],x=e=>{let t=[];C(r(e,`README.md`))&&t.push({relPath:`README.md`,kind:`root`});for(let n of b){let i=r(e,n);w(i)&&S(i,n,0,t)}return t},S=(e,n,i,a)=>{if(i>3)return;let o;try{o=t(e,{withFileTypes:!0})}catch{return}for(let t of o){if(y.has(t.name))continue;let o=`${n}/${t.name}`;t.isDirectory()?S(r(e,t.name),o,i+1,a):t.isFile()&&t.name===`README.md`&&a.push({relPath:o,kind:`nested`})}},C=e=>{try{return n(e).isFile()}catch{return!1}},w=e=>{try{return n(e).isDirectory()}catch{return!1}},T=(e,t)=>{let n=[],r=t.split(`
|
|
2
|
+
`);return n.push(...E(e.relPath,r)),n.push(...D(e,r)),n.sort((e,t)=>(e.line??0)-(t.line??0)),n},E=(e,t)=>{let n=[];for(let r of c){let i=0;for(let a=0;a<t.length&&i<8;a+=1){let o=t[a];if(o===void 0)break;new RegExp(r.pattern.source,r.pattern.flags).test(o)&&(n.push({file:e,line:a+1,rule:r.id,severity:r.severity,message:r.message,excerpt:A(o)}),i+=1)}}return n},D=(e,t)=>{let n=[];e.kind===`root`&&n.push(...O(e.relPath,t));let r=t.map((e,t)=>({line:e,number:t+1})).filter(e=>d.test(e.line));for(let t of r)n.push({file:e.relPath,line:t.number,rule:`E-FORBIDDEN-SECTION`,severity:`error`,message:`许可证/贡献段落——由 package.json 承载,README 不设该段`,excerpt:A(t.line)});let i=t.map((e,t)=>({line:e,number:t+1})).filter(e=>f.test(e.line));for(let t of i)n.push({file:e.relPath,line:t.number,rule:`E-CHARTER-SECTION`,severity:`error`,message:`立项文体节(创建初衷/工作范围)——发布 README 精简口径,内部细节迁内部承接文件`,excerpt:A(t.line)});return n.push(...k(e.relPath,t)),n},O=(e,t)=>{let n=t.findIndex(e=>u.test(e)),r=n===-1?void 0:t[n];return r!==void 0&&l.test(r)?[]:[{file:e,line:n===-1?null:n+1,rule:`E-ROOT-TITLE`,severity:`error`,message:"根标题须为 `# Longzai Intelligence <Name>`——缺品牌前缀/纯中文/仓库名或包名充当标题均不合规",excerpt:r===void 0?void 0:A(r)}]},k=(e,t)=>{let n=[],r=t.map((e,t)=>({line:e,number:t+1})).filter(e=>p.test(e.line));if(r.length===0)return n;let i=r.filter(e=>m.test(e.line));return i.length>=3&&n.push({file:e,line:i[0]?.number??null,rule:`E-TREE-ANNOTATED`,severity:`error`,message:`结构树逐行注释(${i.length} 行)——树只表达层级,职责在正文说明`,excerpt:i[0]===void 0?void 0:A(i[0].line)}),r.length>40&&n.push({file:e,line:r[0]?.number??null,rule:`E-TREE-LONG`,severity:`error`,message:`结构树过长(${r.length} 行 > 40)——发布 README 精简口径`,excerpt:r[0]===void 0?void 0:A(r[0].line)}),n},A=e=>{let t=e.trim();return t.length>120?`${t.slice(0,120)}…`:t},j=t=>{let n=t.exemptions??[],o=x(t.repoRoot),s=[];for(let n of o){let i=null;try{i=e(r(t.repoRoot,n.relPath),`utf8`)}catch{continue}s.push(...T(n,i))}let c=e=>{for(let t of n)if(t.file===e.file&&t.rule===e.rule)return t;return null},l=[],u=[];for(let e of s){let t=c(e);t===null?l.push(e):u.push({...e,reason:t.reason})}return{rulesVersion:a,specPointer:i,violations:l,exempted:u,summary:{filesScanned:o.length,rootCount:o.filter(e=>e.kind===`root`).length,nestedCount:o.filter(e=>e.kind===`nested`).length,errorCount:l.filter(e=>e.severity===`error`).length,warnCount:l.filter(e=>e.severity===`warn`).length,exemptedCount:u.length}}},M=e=>{let t=[];t.push(`[INFO] readme:check 规则版本 ${e.rulesVersion}`),t.push(`[INFO] 依据 ${e.specPointer}`),t.push(`[INFO] 扫描 README ${e.summary.filesScanned} 个(根 ${e.summary.rootCount}、嵌套 ${e.summary.nestedCount})`);for(let n of e.violations)t.push(N(n));for(let n of e.exempted)t.push(P(n));return e.summary.errorCount===0?t.push(`[SUCCESS] readme:check 通过(0 error、${e.summary.warnCount} warn、豁免 ${e.summary.exemptedCount})`):t.push(`✖ ${e.summary.errorCount} error、${e.summary.warnCount} warn(豁免 ${e.summary.exemptedCount})`),t.join(`
|
|
3
|
+
`)},N=e=>{let t=e.line===null?e.file:`${e.file}:${e.line}`,n=e.excerpt===void 0?``:`|摘录:${e.excerpt}`;return`${t} [${e.rule}] ${e.message}${n}`},P=e=>`[豁免] ${e.line===null?e.file:`${e.file}:${e.line}`} [${e.rule}](原因:${e.reason})`,F=e=>JSON.stringify(e,null,2);export{f as CHARTER_SECTION_PATTERN,o as ERROR_LINE_RULES,v as EXCERPT_MAX_LENGTH,d as FORBIDDEN_SECTION_PATTERN,u as H1_HEADING_PATTERN,c as LINE_RULES,_ as MAX_HITS_PER_RULE,l as ROOT_TITLE_PATTERN,m as TREE_ANNOTATED_PATTERN,h as TREE_ANNOTATED_THRESHOLD,p as TREE_LINE_PATTERN,g as TREE_LONG_THRESHOLD,s as WARN_LINE_RULES,x as collectReadmeTargets,M as formatGateReport,F as formatGateReportJson,j as runReadmeGate,T as scanReadmeContent};
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@longzai-intelligence-readme/core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Longzai Intelligence README 门禁引擎(发布口径规则集、README 发现器、报告)",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "lzi-builder",
|
|
20
|
+
"build:prod": "NODE_ENV=production bun run build",
|
|
21
|
+
"prepublishOnly": "bun run build:prod",
|
|
22
|
+
"typecheck": "bun run typecheck:app && bun run typecheck:node && bun run typecheck:test",
|
|
23
|
+
"typecheck:app": "lzi-tsgo typecheck tsconfig/app.json",
|
|
24
|
+
"typecheck:node": "lzi-tsgo typecheck tsconfig/node.json",
|
|
25
|
+
"typecheck:test": "lzi-tsgo typecheck tsconfig/test.json",
|
|
26
|
+
"lint": "oxlint && oxfmt --check",
|
|
27
|
+
"lint:fix": "oxlint --fix && oxfmt",
|
|
28
|
+
"test": "bun test",
|
|
29
|
+
"test:watch": "bun test --watch",
|
|
30
|
+
"test:coverage": "bun test --coverage",
|
|
31
|
+
"clean": "lzi-dev-cli clean"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@longzai-intelligence-readme/config": "0.0.1",
|
|
35
|
+
"zod": "^4.4.3"
|
|
36
|
+
}
|
|
37
|
+
}
|