@longzai-intelligence-git/config 0.1.6 → 0.1.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/README.md +13 -0
- package/dist/index.d.ts +93 -4
- package/dist/index.js +1 -1
- package/package.json +8 -2
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @longzai-intelligence-git/config
|
|
2
|
+
|
|
3
|
+
Longzai Intelligence Git 的配置契约。
|
|
4
|
+
|
|
5
|
+
## 简介
|
|
6
|
+
|
|
7
|
+
治理本仓工具配置文件的统一口径:`lzi-git.config.ts` 所需的全部类型与 defineConfig 助手在此定义,零业务逻辑、零运行时依赖。
|
|
8
|
+
|
|
9
|
+
## 能力
|
|
10
|
+
|
|
11
|
+
- 定义 lzi-git.config.ts 配置类型契约(LziGitConfig)
|
|
12
|
+
- 提供 defineConfig 配置助手
|
|
13
|
+
- 定义 .gitignore 格式化选项、分组类型与预设键(含默认选项与默认预设)
|
package/dist/index.d.ts
CHANGED
|
@@ -132,6 +132,16 @@ type GitignorePresets = Partial<Record<GitignorePresetKey, boolean>>;
|
|
|
132
132
|
* defineConfig 合并 presets 时用此作为基底,用户覆盖优先。
|
|
133
133
|
*/
|
|
134
134
|
declare const DEFAULT_GITIGNORE_PRESETS: GitignorePresets;
|
|
135
|
+
/**
|
|
136
|
+
* 内置禁止忽略项默认清单。
|
|
137
|
+
*
|
|
138
|
+
* @remarks
|
|
139
|
+
* 清单内的文件必须被 git 跟踪,禁止被任何忽略模式命中。
|
|
140
|
+
* AGENTS.md 与 CLAUDE.md 曾于 2026-09-18 作为 lzi-agent-cli 合成产物纳入忽略,
|
|
141
|
+
* 2026-09-23 用户裁定两文件必须进源代码管理,自 `lzi` 预设移除后由本清单承担反向守门。
|
|
142
|
+
* `format` 在格式化时政策性剔除命中项,`check` 检出违规并以非零退出报告。
|
|
143
|
+
*/
|
|
144
|
+
declare const DEFAULT_GITIGNORE_FORBIDDEN: readonly string[];
|
|
135
145
|
/**
|
|
136
146
|
* lzi-git.config.ts 根配置。
|
|
137
147
|
*
|
|
@@ -166,7 +176,85 @@ type LziGitConfig = {
|
|
|
166
176
|
* 未提供时仅使用 preset 分组。
|
|
167
177
|
*/
|
|
168
178
|
readonly groups?: readonly GitignoreGroup[];
|
|
179
|
+
/**
|
|
180
|
+
* 禁止忽略项清单。
|
|
181
|
+
*
|
|
182
|
+
* @remarks
|
|
183
|
+
* 清单内的文件必须被 git 跟踪,忽略模式命中任一项即为违例。
|
|
184
|
+
* `format` 在格式化时政策性剔除命中的忽略模式行,`check` 检出违规并以非零退出报告。
|
|
185
|
+
* 提供空数组可关闭守门,未提供时回退到内置默认清单。
|
|
186
|
+
* @default DEFAULT_GITIGNORE_FORBIDDEN
|
|
187
|
+
*/
|
|
188
|
+
readonly forbidden?: readonly string[];
|
|
169
189
|
};
|
|
190
|
+
/**
|
|
191
|
+
* fetch 调度配置。
|
|
192
|
+
*
|
|
193
|
+
* 形态为部分覆盖,未提供字段由 `@longzai-intelligence-git/fetch-scheduler` 的内置默认值兜底,
|
|
194
|
+
* 本包只声明配置形状,默认值真源在引擎包。
|
|
195
|
+
*/
|
|
196
|
+
readonly fetchScheduler?: FetchSchedulerUserConfig;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* fetch 调度配置的用户覆盖形态
|
|
200
|
+
*
|
|
201
|
+
* 与 `@longzai-intelligence-git/fetch-scheduler` 的 `FetchSchedulerOptions` 字段对位,
|
|
202
|
+
* 全字段可选,层级结构与引擎选项一致
|
|
203
|
+
*/
|
|
204
|
+
type FetchSchedulerUserConfig = {
|
|
205
|
+
/**
|
|
206
|
+
* 三档拉取间隔的部分覆盖
|
|
207
|
+
*/
|
|
208
|
+
readonly tierTtlMs?: {
|
|
209
|
+
/**
|
|
210
|
+
* 活跃档拉取间隔,毫秒
|
|
211
|
+
*/
|
|
212
|
+
readonly active?: number;
|
|
213
|
+
/**
|
|
214
|
+
* 近期档拉取间隔,毫秒
|
|
215
|
+
*/
|
|
216
|
+
readonly recent?: number;
|
|
217
|
+
/**
|
|
218
|
+
* 休眠档拉取间隔,毫秒
|
|
219
|
+
*/
|
|
220
|
+
readonly dormant?: number;
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* 活跃档判定窗口,毫秒
|
|
224
|
+
*/
|
|
225
|
+
readonly activeWindowMs?: number;
|
|
226
|
+
/**
|
|
227
|
+
* 近期档判定窗口,毫秒
|
|
228
|
+
*/
|
|
229
|
+
readonly recentWindowMs?: number;
|
|
230
|
+
/**
|
|
231
|
+
* 每仓到期抖动比例
|
|
232
|
+
*/
|
|
233
|
+
readonly jitterRatio?: number;
|
|
234
|
+
/**
|
|
235
|
+
* 常驻轮询间隔,毫秒
|
|
236
|
+
*/
|
|
237
|
+
readonly tickIntervalMs?: number;
|
|
238
|
+
/**
|
|
239
|
+
* 单轮拉取并发上限
|
|
240
|
+
*/
|
|
241
|
+
readonly concurrency?: number;
|
|
242
|
+
/**
|
|
243
|
+
* 单仓拉取超时,毫秒
|
|
244
|
+
*/
|
|
245
|
+
readonly fetchTimeoutMs?: number;
|
|
246
|
+
/**
|
|
247
|
+
* 连续失败退避阶梯,毫秒数组
|
|
248
|
+
*/
|
|
249
|
+
readonly backoffStepsMs?: readonly number[];
|
|
250
|
+
/**
|
|
251
|
+
* 单轮最大派发数
|
|
252
|
+
*/
|
|
253
|
+
readonly maxBatchSize?: number;
|
|
254
|
+
/**
|
|
255
|
+
* 参与调度的分档集合,取值为 `active`、`recent`、`dormant`
|
|
256
|
+
*/
|
|
257
|
+
readonly tiers?: readonly ('active' | 'recent' | 'dormant')[];
|
|
170
258
|
};
|
|
171
259
|
//#endregion
|
|
172
260
|
//#region src/define-config.d.ts
|
|
@@ -174,9 +262,10 @@ type LziGitConfig = {
|
|
|
174
262
|
* lzi-git.config.ts 配置定义助手(内置默认预设 + 深合并覆盖)。
|
|
175
263
|
*
|
|
176
264
|
* 合并规则:
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
265
|
+
*
|
|
266
|
+
* - options:浅合并(用户字段覆盖 DEFAULT_GITIGNORE_OPTIONS 对应字段)
|
|
267
|
+
* - presets:浅合并(用户开关覆盖 DEFAULT_GITIGNORE_PRESETS 对应键,未列出的走 preset 自身 default)
|
|
268
|
+
* - groups:原样保留(用户自定义分组,可选;未提供则无自定义分组)
|
|
180
269
|
*
|
|
181
270
|
* 镜像 @longzai-intelligence-oxfmt/config 的 deep-merge defineConfig 模式。
|
|
182
271
|
*
|
|
@@ -197,4 +286,4 @@ type LziGitConfig = {
|
|
|
197
286
|
*/
|
|
198
287
|
declare const defineConfig: (userConfig?: LziGitConfig) => LziGitConfig;
|
|
199
288
|
//#endregion
|
|
200
|
-
export { DEFAULT_GITIGNORE_OPTIONS, DEFAULT_GITIGNORE_PRESETS, GITIGNORE_PRESETS, GitignoreFormatOptions, GitignoreGroup, GitignorePresetDefinition, GitignorePresetKey, GitignorePresets, LziGitConfig, defineConfig };
|
|
289
|
+
export { DEFAULT_GITIGNORE_FORBIDDEN, DEFAULT_GITIGNORE_OPTIONS, DEFAULT_GITIGNORE_PRESETS, FetchSchedulerUserConfig, GITIGNORE_PRESETS, GitignoreFormatOptions, GitignoreGroup, GitignorePresetDefinition, GitignorePresetKey, GitignorePresets, LziGitConfig, defineConfig };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={groupByConfig:!0,injectMode:`root-only`,sortWithinGroup:!0,dedupe:!0,blankLinesBetweenGroups:1,miscGroupComment:`其他`},t={node:{comment:`依赖与构建`,patterns:[`node_modules/`,`dist/`,`build/`,`.cache/`,`*.log`,`*.tsbuildinfo`,`tsup.config.bundled_*.mjs`],default:!0},electron:{comment:`Electron`,patterns:[`out/`],default:!0},bun:{comment:`Bun`,patterns:[`.bun/`],default:!0},turbo:{comment:`Turbo`,patterns:[`.turbo/`],default:!0},swc:{comment:`SWC`,patterns:[`.swc/`],default:!0},coverage:{comment:`测试覆盖率`,patterns:[`coverage/`,`.nyc_output/`],default:!0},sqlite:{comment:`SQLite 数据库`,patterns:[`*.db`,`*.db-journal`,`*.db-wal`,`*.db-shm`,`*.sqlite`,`*.sqlite3`,`*.sqlite-journal`,`*.sqlite-wal`,`*.sqlite-shm`],default:!0},env:{comment:`环境变量`,patterns:[`.env`,`.env.*`,`!.env.example`],default:!0},idea:{comment:`JetBrains IDE`,patterns:[`.idea/`],default:!0},vscode:{comment:`VSCode`,patterns:[`.vscode/*`,`!.vscode/settings.json`,`!.vscode/tasks.json`,`!.vscode/launch.json`,`!.vscode/extensions.json`],default:!1},macos:{comment:`macOS 系统文件`,patterns:[`.DS_Store`],default:!0},windows:{comment:`Windows 系统文件`,patterns:[`Thumbs.db`,`ehthumbs.db`,`Desktop.ini`],default:!1},linux:{comment:`Linux 系统文件`,patterns:[`*~`],default:!1},npm:{comment:`npm`,patterns:[`.npmrc`],default:!0},agent:{comment:`AI Agent 本地文件`,patterns:[`CLAUDE.local.md`],default:!0},lzi:{comment:`lzi 工具链产物`,patterns:[`.lzi/issues/`],default:!0}},n=Object.fromEntries(Object.keys(t).map(e=>[e,t[e].default])),r={gitignore:{options:e,presets:n}},
|
|
1
|
+
const e={groupByConfig:!0,injectMode:`root-only`,sortWithinGroup:!0,dedupe:!0,blankLinesBetweenGroups:1,miscGroupComment:`其他`},t={node:{comment:`依赖与构建`,patterns:[`node_modules/`,`dist/`,`build/`,`.cache/`,`*.log`,`*.tsbuildinfo`,`tsup.config.bundled_*.mjs`],default:!0},electron:{comment:`Electron`,patterns:[`out/`],default:!0},bun:{comment:`Bun`,patterns:[`.bun/`],default:!0},turbo:{comment:`Turbo`,patterns:[`.turbo/`],default:!0},swc:{comment:`SWC`,patterns:[`.swc/`],default:!0},coverage:{comment:`测试覆盖率`,patterns:[`coverage/`,`.nyc_output/`],default:!0},sqlite:{comment:`SQLite 数据库`,patterns:[`*.db`,`*.db-journal`,`*.db-wal`,`*.db-shm`,`*.sqlite`,`*.sqlite3`,`*.sqlite-journal`,`*.sqlite-wal`,`*.sqlite-shm`],default:!0},env:{comment:`环境变量`,patterns:[`.env`,`.env.*`,`!.env.example`],default:!0},idea:{comment:`JetBrains IDE`,patterns:[`.idea/`],default:!0},vscode:{comment:`VSCode`,patterns:[`.vscode/*`,`!.vscode/settings.json`,`!.vscode/tasks.json`,`!.vscode/launch.json`,`!.vscode/extensions.json`],default:!1},macos:{comment:`macOS 系统文件`,patterns:[`.DS_Store`],default:!0},windows:{comment:`Windows 系统文件`,patterns:[`Thumbs.db`,`ehthumbs.db`,`Desktop.ini`],default:!1},linux:{comment:`Linux 系统文件`,patterns:[`*~`],default:!1},npm:{comment:`npm`,patterns:[`.npmrc`],default:!0},agent:{comment:`AI Agent 本地文件`,patterns:[`CLAUDE.local.md`],default:!0},lzi:{comment:`lzi 工具链产物`,patterns:[`.lzi/issues/`],default:!0}},n=Object.fromEntries(Object.keys(t).map(e=>[e,t[e].default])),r=[`AGENTS.md`,`CLAUDE.md`],i={gitignore:{options:e,presets:n,forbidden:r}},a=t=>{if(t===void 0)return i;if(t.gitignore===void 0)return{...t,gitignore:i.gitignore};let a=t.gitignore,o={options:{...e,...a.options},presets:{...n,...a.presets},...a.groups===void 0?{}:{groups:a.groups},forbidden:a.forbidden??r};return{...t,gitignore:o}};export{r as DEFAULT_GITIGNORE_FORBIDDEN,e as DEFAULT_GITIGNORE_OPTIONS,n as DEFAULT_GITIGNORE_PRESETS,t as GITIGNORE_PRESETS,a as defineConfig};
|
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longzai-intelligence-git/config",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Longzai Intelligence Git
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "Longzai Intelligence Git 配置契约",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"config",
|
|
7
|
+
"git",
|
|
8
|
+
"longzai-intelligence",
|
|
9
|
+
"schema"
|
|
10
|
+
],
|
|
5
11
|
"files": [
|
|
6
12
|
"dist"
|
|
7
13
|
],
|