@longzai-intelligence-git/config 0.1.2 → 0.1.4
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 +18 -12
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* 用于把散落在 .gitignore 中的模式按主题归类,输出时以 `# <comment>` 作为分组头。
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
type GitignoreGroup = {
|
|
15
15
|
/**
|
|
16
16
|
* 分组标题纯文本。
|
|
17
17
|
*
|
|
@@ -25,14 +25,14 @@ interface GitignoreGroup {
|
|
|
25
25
|
* 用于把现有 .gitignore 中的行分类到分组;分类时按归一化后的模式精确匹配。
|
|
26
26
|
*/
|
|
27
27
|
readonly patterns: readonly string[];
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
/**
|
|
30
30
|
* .gitignore 格式化选项
|
|
31
31
|
*
|
|
32
32
|
* 控制归一化与分组编排的具体行为。所有字段在 lzi-git.config.ts 中以 Partial 形式可选,
|
|
33
33
|
* 未提供时由格式化器回退到默认值。
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
type GitignoreFormatOptions = {
|
|
36
36
|
/**
|
|
37
37
|
* 是否按 config.groups 重组模式到分组下。
|
|
38
38
|
*
|
|
@@ -78,7 +78,7 @@ interface GitignoreFormatOptions {
|
|
|
78
78
|
* 默认 '其他'。
|
|
79
79
|
*/
|
|
80
80
|
readonly miscGroupComment: string;
|
|
81
|
-
}
|
|
81
|
+
};
|
|
82
82
|
/**
|
|
83
83
|
* .gitignore 格式化的默认选项。
|
|
84
84
|
*
|
|
@@ -91,7 +91,7 @@ declare const DEFAULT_GITIGNORE_OPTIONS: GitignoreFormatOptions;
|
|
|
91
91
|
* 每个键对应一组通用忽略模式,用户在 lzi-git.config.ts 的 presets 里用同名 boolean 开关控制。
|
|
92
92
|
* 扩展新预设时在此联合类型追加键名。
|
|
93
93
|
*/
|
|
94
|
-
type GitignorePresetKey = 'node' | 'bun' | 'turbo' | 'swc' | 'coverage' | 'sqlite' | 'env' | 'idea' | 'vscode' | 'macos' | 'windows' | 'linux' | 'npm' | 'agent';
|
|
94
|
+
type GitignorePresetKey = 'node' | 'electron' | 'bun' | 'turbo' | 'swc' | 'coverage' | 'sqlite' | 'env' | 'idea' | 'vscode' | 'macos' | 'windows' | 'linux' | 'npm' | 'agent' | 'lzi';
|
|
95
95
|
/**
|
|
96
96
|
* 内置预设定义。
|
|
97
97
|
*
|
|
@@ -99,14 +99,20 @@ type GitignorePresetKey = 'node' | 'bun' | 'turbo' | 'swc' | 'coverage' | 'sqlit
|
|
|
99
99
|
* - default=true 的 preset 在用户未配置时自动启用(开箱即用)
|
|
100
100
|
* - default=false 的 preset 需用户显式开启(如 vscode,多数团队希望保留 .vscode 共享配置提交)
|
|
101
101
|
*/
|
|
102
|
-
|
|
103
|
-
/**
|
|
102
|
+
type GitignorePresetDefinition = {
|
|
103
|
+
/**
|
|
104
|
+
* 归属分组标题(纯文本,不含 #,输出时自动补)。
|
|
105
|
+
*/
|
|
104
106
|
readonly comment: string;
|
|
105
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* 该预设注入的模式集合。
|
|
109
|
+
*/
|
|
106
110
|
readonly patterns: readonly string[];
|
|
107
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* 默认开关(用户未在 presets 里声明时使用)。
|
|
113
|
+
*/
|
|
108
114
|
readonly default: boolean;
|
|
109
|
-
}
|
|
115
|
+
};
|
|
110
116
|
/**
|
|
111
117
|
* 内置预设表(键 → 定义)。
|
|
112
118
|
*
|
|
@@ -132,7 +138,7 @@ declare const DEFAULT_GITIGNORE_PRESETS: GitignorePresets;
|
|
|
132
138
|
*
|
|
133
139
|
* 顶层按工具域分块,当前仅有 gitignore。后续新增工具域(如 hooks、aliases)时在此扩展。
|
|
134
140
|
*/
|
|
135
|
-
|
|
141
|
+
type LziGitConfig = {
|
|
136
142
|
/**
|
|
137
143
|
* .gitignore 格式化配置。
|
|
138
144
|
*/
|
|
@@ -160,7 +166,7 @@ interface LziGitConfig {
|
|
|
160
166
|
*/
|
|
161
167
|
readonly groups?: readonly GitignoreGroup[];
|
|
162
168
|
};
|
|
163
|
-
}
|
|
169
|
+
};
|
|
164
170
|
//#endregion
|
|
165
171
|
//#region src/define-config.d.ts
|
|
166
172
|
/**
|
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
|
|
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};
|