@longzai-intelligence-tsconfig/config 0.0.2 → 0.0.3
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 +26 -4
- package/dist/index.js +2 -2
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,19 @@ type SingleTsconfigExemption = {
|
|
|
13
13
|
*/
|
|
14
14
|
reason: string;
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* 模块根 paths 豁免声明
|
|
18
|
+
*
|
|
19
|
+
* 对应根溶液保留 `compilerOptions.paths` 承担全仓 IDE 解析的裁量形态,登记后模块根文件跳过 R7 判定
|
|
20
|
+
*/
|
|
21
|
+
type ModuleRootPathsExemption = {
|
|
22
|
+
/**
|
|
23
|
+
* 豁免依据
|
|
24
|
+
*
|
|
25
|
+
* 须引用 ADR 或用户裁定出处,如 `ADR 0008 裁量保留`
|
|
26
|
+
*/
|
|
27
|
+
reason: string;
|
|
28
|
+
};
|
|
16
29
|
/**
|
|
17
30
|
* 单包覆写声明
|
|
18
31
|
*/
|
|
@@ -44,6 +57,12 @@ type LziTsconfigConfig = {
|
|
|
44
57
|
* 精确匹配单元相对路径,如 `e2e/fixtures`
|
|
45
58
|
*/
|
|
46
59
|
exclude?: string[];
|
|
60
|
+
/**
|
|
61
|
+
* 模块根 paths 豁免声明
|
|
62
|
+
*
|
|
63
|
+
* 登记后模块根溶液与根 node 片跳过 R7 判定,子包单元的跨包 paths 不适用本豁免
|
|
64
|
+
*/
|
|
65
|
+
moduleRootPaths?: ModuleRootPathsExemption;
|
|
47
66
|
};
|
|
48
67
|
//#endregion
|
|
49
68
|
//#region src/define-config.config.d.ts
|
|
@@ -81,18 +100,21 @@ type LoadedConfig = {
|
|
|
81
100
|
*/
|
|
82
101
|
config: LziTsconfigConfig;
|
|
83
102
|
/**
|
|
84
|
-
*
|
|
103
|
+
* 配置来源绝对路径
|
|
85
104
|
*/
|
|
86
105
|
path: string;
|
|
87
106
|
};
|
|
88
107
|
/**
|
|
89
108
|
* 装载就地配置
|
|
90
109
|
*
|
|
91
|
-
*
|
|
110
|
+
* 经 shared-config 的 `loadUnifiedConfig` 统一加载:从目标仓根向上查找
|
|
111
|
+
* `lzi-tsconfig.config.ts`,回退统一配置 `lzi.config.ts` 的 `tsconfig` 字段,
|
|
112
|
+
* 命中后随加载执行 zod 结构校验,配置不存在时返回 `null` 由调用方按零配置继续
|
|
92
113
|
*
|
|
93
114
|
* @param rootDir - 目标仓根目录
|
|
94
|
-
* @returns
|
|
95
|
-
* @throws {@link
|
|
115
|
+
* @returns 装载结果,配置不存在时为 `null`
|
|
116
|
+
* @throws {@link SharedConfigLoadError} 配置文件加载失败或缺少默认导出时抛出
|
|
117
|
+
* @throws {@link SharedConfigValidationError} 配置结构校验失败时抛出
|
|
96
118
|
*/
|
|
97
119
|
declare function loadConfig(rootDir: string): Promise<LoadedConfig | null>;
|
|
98
120
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import"./rolldown-runtime-BqT_7tdF.js";import{
|
|
1
|
+
import"./rolldown-runtime-BqT_7tdF.js";import{loadUnifiedConfig as e}from"@longzai-intelligence-shared-config/core";import*as t from"zod";function n(e){return e??{}}function r(){return`import { defineConfig } from '@longzai-intelligence-tsconfig/config';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* lzi-tsconfig 配置
|
|
5
5
|
*/
|
|
6
6
|
export default defineConfig();
|
|
7
|
-
`}const
|
|
7
|
+
`}const i=`lzi-tsconfig.config.ts`,a=t.looseObject({reason:t.string().min(1)}),o=t.looseObject({reason:t.string().min(1)}),s=t.looseObject({appPreset:t.string().optional(),singleTsconfig:a.optional()}),c=t.looseObject({packages:t.record(t.string(),s).optional(),exclude:t.array(t.string()).optional(),moduleRootPaths:o.optional()});async function l(t){let n=await e({cwd:t,standaloneFile:[i,`lzi-tsconfig.config.mts`],unifiedField:`tsconfig`,schema:c});return n.success?{config:n.config,path:n.configFilePath}:null}export{i as CONFIG_FILE_NAME,r as buildConfigFileContent,n as defineConfig,l as loadConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longzai-intelligence-tsconfig/config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Longzai Intelligence tsconfig 形态门禁配置契约",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"clean": "lzi-dev-cli clean"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"
|
|
35
|
+
"@longzai-intelligence-shared-config/core": "^0.0.9",
|
|
36
|
+
"zod": "^4.4.3"
|
|
36
37
|
}
|
|
37
38
|
}
|