@longzai-intelligence-git/config 0.1.5 → 0.1.7

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 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
@@ -167,6 +167,74 @@ type LziGitConfig = {
167
167
  */
168
168
  readonly groups?: readonly GitignoreGroup[];
169
169
  };
170
+ /**
171
+ * fetch 调度配置。
172
+ *
173
+ * 形态为部分覆盖,未提供字段由 `@longzai-intelligence-git/fetch-scheduler` 的内置默认值兜底,
174
+ * 本包只声明配置形状,默认值真源在引擎包。
175
+ */
176
+ readonly fetchScheduler?: FetchSchedulerUserConfig;
177
+ };
178
+ /**
179
+ * fetch 调度配置的用户覆盖形态
180
+ *
181
+ * 与 `@longzai-intelligence-git/fetch-scheduler` 的 `FetchSchedulerOptions` 字段对位,
182
+ * 全字段可选,层级结构与引擎选项一致
183
+ */
184
+ type FetchSchedulerUserConfig = {
185
+ /**
186
+ * 三档拉取间隔的部分覆盖
187
+ */
188
+ readonly tierTtlMs?: {
189
+ /**
190
+ * 活跃档拉取间隔,毫秒
191
+ */
192
+ readonly active?: number;
193
+ /**
194
+ * 近期档拉取间隔,毫秒
195
+ */
196
+ readonly recent?: number;
197
+ /**
198
+ * 休眠档拉取间隔,毫秒
199
+ */
200
+ readonly dormant?: number;
201
+ };
202
+ /**
203
+ * 活跃档判定窗口,毫秒
204
+ */
205
+ readonly activeWindowMs?: number;
206
+ /**
207
+ * 近期档判定窗口,毫秒
208
+ */
209
+ readonly recentWindowMs?: number;
210
+ /**
211
+ * 每仓到期抖动比例
212
+ */
213
+ readonly jitterRatio?: number;
214
+ /**
215
+ * 常驻轮询间隔,毫秒
216
+ */
217
+ readonly tickIntervalMs?: number;
218
+ /**
219
+ * 单轮拉取并发上限
220
+ */
221
+ readonly concurrency?: number;
222
+ /**
223
+ * 单仓拉取超时,毫秒
224
+ */
225
+ readonly fetchTimeoutMs?: number;
226
+ /**
227
+ * 连续失败退避阶梯,毫秒数组
228
+ */
229
+ readonly backoffStepsMs?: readonly number[];
230
+ /**
231
+ * 单轮最大派发数
232
+ */
233
+ readonly maxBatchSize?: number;
234
+ /**
235
+ * 参与调度的分档集合,取值为 `active`、`recent`、`dormant`
236
+ */
237
+ readonly tiers?: readonly ('active' | 'recent' | 'dormant')[];
170
238
  };
171
239
  //#endregion
172
240
  //#region src/define-config.d.ts
@@ -174,9 +242,10 @@ type LziGitConfig = {
174
242
  * lzi-git.config.ts 配置定义助手(内置默认预设 + 深合并覆盖)。
175
243
  *
176
244
  * 合并规则:
177
- * - options:浅合并(用户字段覆盖 DEFAULT_GITIGNORE_OPTIONS 对应字段)
178
- * - presets:浅合并(用户开关覆盖 DEFAULT_GITIGNORE_PRESETS 对应键,未列出的走 preset 自身 default)
179
- * - groups:原样保留(用户自定义分组,可选;未提供则无自定义分组)
245
+ *
246
+ * - options:浅合并(用户字段覆盖 DEFAULT_GITIGNORE_OPTIONS 对应字段)
247
+ * - presets:浅合并(用户开关覆盖 DEFAULT_GITIGNORE_PRESETS 对应键,未列出的走 preset 自身 default)
248
+ * - groups:原样保留(用户自定义分组,可选;未提供则无自定义分组)
180
249
  *
181
250
  * 镜像 @longzai-intelligence-oxfmt/config 的 deep-merge defineConfig 模式。
182
251
  *
@@ -197,4 +266,4 @@ type LziGitConfig = {
197
266
  */
198
267
  declare const defineConfig: (userConfig?: LziGitConfig) => LziGitConfig;
199
268
  //#endregion
200
- export { DEFAULT_GITIGNORE_OPTIONS, DEFAULT_GITIGNORE_PRESETS, GITIGNORE_PRESETS, GitignoreFormatOptions, GitignoreGroup, GitignorePresetDefinition, GitignorePresetKey, GitignorePresets, LziGitConfig, defineConfig };
269
+ export { 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/`,`CLAUDE.md`,`AGENTS.md`],default:!0}},n=Object.fromEntries(Object.keys(t).map(e=>[e,t[e].default])),r={gitignore:{options:e,presets:n}},i=t=>{if(t===void 0||t.gitignore===void 0)return r;let i=t.gitignore,a={options:{...e,...i.options},presets:{...n,...i.presets},...i.groups===void 0?{}:{groups:i.groups}};return{...t,gitignore:a}};export{e as DEFAULT_GITIGNORE_OPTIONS,n as DEFAULT_GITIGNORE_PRESETS,t as GITIGNORE_PRESETS,i as defineConfig};
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}},i=t=>{if(t===void 0)return r;if(t.gitignore===void 0)return{...t,gitignore:r.gitignore};let i=t.gitignore,a={options:{...e,...i.options},presets:{...n,...i.presets},...i.groups===void 0?{}:{groups:i.groups}};return{...t,gitignore:a}};export{e as DEFAULT_GITIGNORE_OPTIONS,n as DEFAULT_GITIGNORE_PRESETS,t as GITIGNORE_PRESETS,i as defineConfig};
package/package.json CHANGED
@@ -1,7 +1,13 @@
1
1
  {
2
2
  "name": "@longzai-intelligence-git/config",
3
- "version": "0.1.5",
4
- "description": "Longzai Intelligence Git - lzi-git.config.ts 配置契约",
3
+ "version": "0.1.7",
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
  ],