@longzai-intelligence-github-markdown/config 0.0.4 → 0.0.6
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 +9 -16
- package/dist/index.js +1 -1
- package/package.json +12 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import "./rolldown-runtime-BqT_7tdF.js";
|
|
2
1
|
import * as z from "zod";
|
|
3
|
-
import { ConfigLoadError, ConfigLoadOk, ConfigLoadResult } from "@longzai-intelligence-
|
|
4
|
-
//#region src/github-markdown-config.schema.d.ts
|
|
2
|
+
import { ConfigLoadError, ConfigLoadOk, ConfigLoadResult, ConfigLoadResult as ConfigLoadResult$1 } from "@longzai-intelligence-shared-config/core";
|
|
5
3
|
/**
|
|
6
4
|
* 配置结构(lzi-github-markdown.config.ts 默认导出形态)
|
|
7
5
|
*/
|
|
@@ -23,28 +21,24 @@ type GithubMarkdownConfig = z.infer<typeof GithubMarkdownConfigSchema>;
|
|
|
23
21
|
* @returns 原样返回(运行时校验由加载方执行,此处 identity 语义)
|
|
24
22
|
*/
|
|
25
23
|
declare function defineConfig(config?: GithubMarkdownConfig): GithubMarkdownConfig;
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/loader.utils.d.ts
|
|
28
24
|
/**
|
|
29
|
-
*
|
|
25
|
+
* 配置文件约定名,全局 ADR 0090 就地配置一律以工具命名,与 bin/env 前缀三同源
|
|
30
26
|
*/
|
|
31
27
|
declare const CONFIG_FILENAME = "lzi-github-markdown.config.ts";
|
|
32
28
|
/**
|
|
33
|
-
* 自 cwd
|
|
29
|
+
* 自 cwd 向上查找配置文件,显式路径存在则直接采用
|
|
34
30
|
*
|
|
35
|
-
* @param explicitPath -
|
|
36
|
-
* @returns
|
|
31
|
+
* @param explicitPath - 显式指定的配置文件路径,可空
|
|
32
|
+
* @returns 命中的绝对路径,未命中为 undefined
|
|
37
33
|
*/
|
|
38
34
|
declare function discoverConfigPath(explicitPath?: string): string | undefined;
|
|
39
35
|
/**
|
|
40
|
-
*
|
|
36
|
+
* 加载并校验配置,相对路径以配置文件所在目录为基准绝对化
|
|
41
37
|
*
|
|
42
|
-
* @param explicitPath -
|
|
43
|
-
* @returns
|
|
38
|
+
* @param explicitPath - 显式指定的配置文件路径,可空,缺省走向上发现
|
|
39
|
+
* @returns 成功为绝对路径形态配置与文件路径,失败为可读错误,未找到即配置文件必备违规
|
|
44
40
|
*/
|
|
45
|
-
declare function loadGithubMarkdownConfig(explicitPath?: string): Promise<ConfigLoadResult<GithubMarkdownConfig>>;
|
|
46
|
-
//#endregion
|
|
47
|
-
//#region src/scaffold.utils.d.ts
|
|
41
|
+
declare function loadGithubMarkdownConfig(explicitPath?: string): Promise<ConfigLoadResult$1<GithubMarkdownConfig>>;
|
|
48
42
|
/**
|
|
49
43
|
* 配置骨架生成(config init 用)
|
|
50
44
|
*
|
|
@@ -74,5 +68,4 @@ type ScaffoldParams = {
|
|
|
74
68
|
* @returns lzi-github-markdown.config.ts 全文
|
|
75
69
|
*/
|
|
76
70
|
declare function scaffoldConfigText(params?: ScaffoldParams): string;
|
|
77
|
-
//#endregion
|
|
78
71
|
export { CONFIG_FILENAME, type ConfigLoadError, type ConfigLoadOk, type ConfigLoadResult, GithubMarkdownConfig, GithubMarkdownConfigSchema, ScaffoldParams, defineConfig, discoverConfigPath, loadGithubMarkdownConfig, scaffoldConfigText };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./rolldown-runtime-BqT_7tdF.js";import*as e from"zod";import{
|
|
1
|
+
import"./rolldown-runtime-BqT_7tdF.js";import*as e from"zod";import{createDomainConfigLoader as t}from"@longzai-intelligence-shared-config/core";import{resolve as n}from"node:path";const r=e.strictObject({dataRoot:e.string().min(1)});function i(e={dataRoot:`.`}){return e}const a=`lzi-github-markdown.config.ts`,o=t({configFilename:a,schema:r,shapeHint:"dataRoot 单字段,禁 version,代际由包 npm 版本承载,克隆根走 `LZI_GITHUB_MARKDOWN_CLONES_ROOT`",absolutize:(e,t)=>({...e,dataRoot:n(t,e.dataRoot)}),notFoundMessage:`配置文件必备,执行全局 ADR 0097 决策 9:未找到 ${a},自 cwd 向上查找至文件系统根,或经 --config 显式指定,配置文件不得缺失,.env 不作整体替代,.env 仅承载跨项目路径 LZI_GITHUB_MARKDOWN_CLONES_ROOT`});function s(e){return o.discoverConfigPath(e)}async function c(e){return o.loadConfig(e)}function l(e={}){return[`// lzi-github-markdown 就地配置(以工具命名,全局 ADR 0090;defineConfig 工厂收口,全局 ADR 0097 决策 2)。`,`// 相对路径以本文件所在目录为基准——放在数据根时工厂默认 dataRoot "."(零参调用即可)。`,`// 本地克隆根走 .env 的 LZI_GITHUB_MARKDOWN_CLONES_ROOT(跨项目路径零进入库配置,全局 ADR 0097 决策 5)。`,`import { defineConfig } from '@longzai-intelligence-github-markdown/config';`,``,e.dataRoot===void 0||e.dataRoot===`.`?`export default defineConfig();`:`export default defineConfig({ dataRoot: '${e.dataRoot}' });`,``].join(`
|
|
2
2
|
`)}export{a as CONFIG_FILENAME,r as GithubMarkdownConfigSchema,i as defineConfig,s as discoverConfigPath,c as loadGithubMarkdownConfig,l as scaffoldConfigText};
|
package/package.json
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longzai-intelligence-github-markdown/config",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Longzai Intelligence
|
|
3
|
+
"version": "0.0.6",
|
|
4
|
+
"description": "Longzai Intelligence GitHub Markdown 配置",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"config",
|
|
7
|
+
"github-markdown",
|
|
8
|
+
"longzai-intelligence",
|
|
9
|
+
"schema"
|
|
10
|
+
],
|
|
5
11
|
"license": "UNLICENSED",
|
|
6
12
|
"files": [
|
|
7
13
|
"dist"
|
|
@@ -17,12 +23,9 @@
|
|
|
17
23
|
"build": "lzi-builder",
|
|
18
24
|
"build:prod": "NODE_ENV=production bun run build",
|
|
19
25
|
"prepublishOnly": "bun run build:prod",
|
|
20
|
-
"typecheck": "
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"typecheck:test": "lzi-tsgo typecheck tsconfig/test.json",
|
|
24
|
-
"lint": "oxlint && oxfmt --check",
|
|
25
|
-
"lint:fix": "oxlint --fix && oxfmt",
|
|
26
|
+
"typecheck": "lzi-typecheck",
|
|
27
|
+
"lint": "lzi-lint lint",
|
|
28
|
+
"lint:fix": "lzi-lint fix",
|
|
26
29
|
"test": "lzi-bun-cli test",
|
|
27
30
|
"test:watch": "lzi-bun-cli test --watch",
|
|
28
31
|
"test:coverage": "lzi-bun-cli test --coverage",
|
|
@@ -30,9 +33,7 @@
|
|
|
30
33
|
},
|
|
31
34
|
"dependencies": {
|
|
32
35
|
"@longzai-intelligence-markdown/data-engine": "^0.0.1",
|
|
36
|
+
"@longzai-intelligence-shared-config/core": "^0.0.9",
|
|
33
37
|
"zod": "^4.4.3"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@types/bun": "^1.3.14"
|
|
37
38
|
}
|
|
38
39
|
}
|