@longzai-intelligence-git/config 0.0.1 → 0.1.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 +14 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,19 @@ interface GitignoreFormatOptions {
|
|
|
40
40
|
* - false:保留原文件的 `#` 注释分组结构,仅在组内做归一化/排序/去重
|
|
41
41
|
*/
|
|
42
42
|
readonly groupByConfig: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* 预设/自定义分组缺失模式的注入范围。
|
|
45
|
+
*
|
|
46
|
+
* - `'root-only'`(默认):仅向「配置根 `.gitignore`」(与 `lzi-git.config.ts` 同目录的那个)
|
|
47
|
+
* 注入启用的 preset 与自定义 groups 的缺失模式;其余子目录 `.gitignore` 只做分类归组、
|
|
48
|
+
* 归一化、排序、去重,不新增任何模式。这避免子文件重复根已覆盖的通用忽略项。
|
|
49
|
+
* - `'always'`:向每个被处理的 `.gitignore` 都注入缺失模式(遗留行为,子文件会膨胀)。
|
|
50
|
+
*
|
|
51
|
+
* 「是否为根文件」由 CLI 根据文件所在目录是否等于配置文件目录判定,并通过
|
|
52
|
+
* `formatGitignore` 的 `fileContext.isRoot` 传入;直接调用格式化器不传时按根文件处理
|
|
53
|
+
* (即注入),以保持单文件格式化的向后兼容。
|
|
54
|
+
*/
|
|
55
|
+
readonly injectMode: 'root-only' | 'always';
|
|
43
56
|
/**
|
|
44
57
|
* 组内是否按大小写敏感升序稳定排序。
|
|
45
58
|
*
|
|
@@ -78,7 +91,7 @@ declare const DEFAULT_GITIGNORE_OPTIONS: GitignoreFormatOptions;
|
|
|
78
91
|
* 每个键对应一组通用忽略模式,用户在 lzi-git.config.ts 的 presets 里用同名 boolean 开关控制。
|
|
79
92
|
* 扩展新预设时在此联合类型追加键名。
|
|
80
93
|
*/
|
|
81
|
-
type GitignorePresetKey = 'node' | 'bun' | 'turbo' | 'coverage' | 'env' | 'idea' | 'vscode' | 'macos' | 'windows' | 'linux' | 'npm' | 'agent';
|
|
94
|
+
type GitignorePresetKey = 'node' | 'bun' | 'turbo' | 'swc' | 'coverage' | 'sqlite' | 'env' | 'idea' | 'vscode' | 'macos' | 'windows' | 'linux' | 'npm' | 'agent';
|
|
82
95
|
/**
|
|
83
96
|
* 内置预设定义。
|
|
84
97
|
*
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={groupByConfig:!0,sortWithinGroup:!0,dedupe:!0,blankLinesBetweenGroups:1,miscGroupComment:`其他`},t={node:{comment:`依赖与构建`,patterns:[`node_modules/`,`.pnp/`,`.pnp.js`,`.pnp.cjs`,`dist/`,`out/`,`build/`,`*.log`,`*.tsbuildinfo`,`tsup.config.bundled_*.mjs`],default:!0},bun:{comment:`Bun`,patterns:[`.bun/`],default:!0},turbo:{comment:`Turbo`,patterns:[`.turbo/`],default:!0},coverage:{comment:`测试覆盖率`,patterns:[`coverage/`,`.nyc_output/`],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}},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/`,`.pnp/`,`.pnp.js`,`.pnp.cjs`,`dist/`,`out/`,`build/`,`*.log`,`*.tsbuildinfo`,`tsup.config.bundled_*.mjs`],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}},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};
|