@longzai-intelligence-toolchain/config 0.0.1 → 0.0.2
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 +33 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,27 @@ type ToolchainConfig = {
|
|
|
30
30
|
* 委托域的就地覆盖表,键为域名
|
|
31
31
|
*/
|
|
32
32
|
domains?: Record<string, DomainOverride>;
|
|
33
|
+
/**
|
|
34
|
+
* check 聚合命令的检查项选择
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* `include` 显式指定检查项清单时取代默认集,`exclude` 自默认集剔除。
|
|
38
|
+
* 值为检查项 id 或域名,域名命中该域全部检查项
|
|
39
|
+
*/
|
|
40
|
+
checks?: CheckSelection;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* check 聚合命令的检查项选择
|
|
44
|
+
*/
|
|
45
|
+
type CheckSelection = {
|
|
46
|
+
/**
|
|
47
|
+
* 显式指定的检查项清单,取代默认集
|
|
48
|
+
*/
|
|
49
|
+
include?: string[];
|
|
50
|
+
/**
|
|
51
|
+
* 自运行集剔除的检查项清单
|
|
52
|
+
*/
|
|
53
|
+
exclude?: string[];
|
|
33
54
|
};
|
|
34
55
|
/**
|
|
35
56
|
* 域覆盖项的 zod schema
|
|
@@ -38,6 +59,13 @@ declare const domainOverrideSchema: z.ZodObject<{
|
|
|
38
59
|
bin: z.ZodOptional<z.ZodString>;
|
|
39
60
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
40
61
|
}, z.core.$strip>;
|
|
62
|
+
/**
|
|
63
|
+
* 检查项选择的 zod schema
|
|
64
|
+
*/
|
|
65
|
+
declare const checkSelectionSchema: z.ZodObject<{
|
|
66
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
41
69
|
/**
|
|
42
70
|
* 配置形态的 zod schema
|
|
43
71
|
*/
|
|
@@ -46,6 +74,10 @@ declare const toolchainConfigSchema: z.ZodObject<{
|
|
|
46
74
|
bin: z.ZodOptional<z.ZodString>;
|
|
47
75
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
48
76
|
}, z.core.$strip>>>;
|
|
77
|
+
checks: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
79
|
+
exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
49
81
|
}, z.core.$strip>;
|
|
50
82
|
/**
|
|
51
83
|
* 配置加载结果
|
|
@@ -88,4 +120,4 @@ declare const defineConfig: (config?: ToolchainConfig) => ToolchainConfig;
|
|
|
88
120
|
*/
|
|
89
121
|
declare const loadToolchainConfig: () => Promise<LoadedToolchainConfig | null>;
|
|
90
122
|
//#endregion
|
|
91
|
-
export { type DomainOverride, type LoadedToolchainConfig, type ToolchainConfig, defineConfig, domainOverrideSchema, loadToolchainConfig, toolchainConfigSchema };
|
|
123
|
+
export { type CheckSelection, type DomainOverride, type LoadedToolchainConfig, type ToolchainConfig, checkSelectionSchema, defineConfig, domainOverrideSchema, loadToolchainConfig, toolchainConfigSchema };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-BqT_7tdF.js";import*as e from"zod";import{existsSync as t}from"node:fs";import{join as n}from"node:path";const r=e.object({bin:e.string().min(1).optional(),enabled:e.boolean().optional()}),i=e.object({domains:e.record(e.string().min(1),r).optional()}),
|
|
1
|
+
import"./rolldown-runtime-BqT_7tdF.js";import*as e from"zod";import{existsSync as t}from"node:fs";import{join as n}from"node:path";const r=e.object({bin:e.string().min(1).optional(),enabled:e.boolean().optional()}),i=e.object({include:e.array(e.string().min(1)).optional(),exclude:e.array(e.string().min(1)).optional()}),a=e.object({domains:e.record(e.string().min(1),r).optional(),checks:i.optional()}),o=(e={})=>{let t=a.safeParse(e);if(!t.success){let e=t.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `);throw Error(`lzi-toolchain.config.ts 校验失败: ${e}`)}return e},s=async()=>{let e=process.cwd();for(;;){let r=n(e,`lzi-toolchain.config.ts`);if(t(r)){let e=(await import(r)).default,t=a.safeParse(e);if(!t.success){let e=t.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `);throw Error(`${r} 校验失败: ${e}`)}return{config:t.data,filePath:r}}let i=n(e,`..`);if(i===e)return null;e=i}};export{i as checkSelectionSchema,o as defineConfig,r as domainOverrideSchema,s as loadToolchainConfig,a as toolchainConfigSchema};
|