@longzai-intelligence-github-markdown/config 0.0.2 → 0.0.5
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 +24 -18
- package/dist/index.js +2 -2
- package/package.json +12 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./rolldown-runtime-BqT_7tdF.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import { ConfigLoadError, ConfigLoadOk, ConfigLoadResult } from "@longzai-intelligence-
|
|
3
|
+
import { ConfigLoadError, ConfigLoadOk, ConfigLoadResult, ConfigLoadResult as ConfigLoadResult$1 } from "@longzai-intelligence-shared-config/core";
|
|
4
4
|
//#region src/github-markdown-config.schema.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* 配置结构(lzi-github-markdown.config.ts 默认导出形态)
|
|
@@ -13,39 +13,45 @@ declare const GithubMarkdownConfigSchema: z.ZodObject<{
|
|
|
13
13
|
*/
|
|
14
14
|
type GithubMarkdownConfig = z.infer<typeof GithubMarkdownConfigSchema>;
|
|
15
15
|
/**
|
|
16
|
-
* 配置工厂:类型收口 + 便于 IDE
|
|
16
|
+
* 配置工厂:类型收口 + 便于 IDE 推导;导出名统一为 defineConfig(全局 ADR 0097 决策 2,用户裁定 2026-09-26 收敛域名工厂漂移)
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* 缺省零参调用=就地自指 dataRoot '.'(数据根绝对主流用法收进工厂默认,用户裁定
|
|
19
|
+
* 2026-09-30 家族统一 defineConfig() 零参标准形态,对齐 lzi-kol config 包先例;
|
|
20
|
+
* 配置文件不放数据根时显式传参覆盖)
|
|
21
|
+
*
|
|
22
|
+
* @param config - 配置对象(缺省 { dataRoot: '.' } 就地自指)
|
|
19
23
|
* @returns 原样返回(运行时校验由加载方执行,此处 identity 语义)
|
|
20
24
|
*/
|
|
21
|
-
declare function
|
|
25
|
+
declare function defineConfig(config?: GithubMarkdownConfig): GithubMarkdownConfig;
|
|
22
26
|
//#endregion
|
|
23
27
|
//#region src/loader.utils.d.ts
|
|
24
28
|
/**
|
|
25
|
-
*
|
|
29
|
+
* 配置文件约定名,全局 ADR 0090 就地配置一律以工具命名,与 bin/env 前缀三同源
|
|
26
30
|
*/
|
|
27
31
|
declare const CONFIG_FILENAME = "lzi-github-markdown.config.ts";
|
|
28
32
|
/**
|
|
29
|
-
* 自 cwd
|
|
33
|
+
* 自 cwd 向上查找配置文件,显式路径存在则直接采用
|
|
30
34
|
*
|
|
31
|
-
* @param explicitPath -
|
|
32
|
-
* @returns
|
|
35
|
+
* @param explicitPath - 显式指定的配置文件路径,可空
|
|
36
|
+
* @returns 命中的绝对路径,未命中为 undefined
|
|
33
37
|
*/
|
|
34
38
|
declare function discoverConfigPath(explicitPath?: string): string | undefined;
|
|
35
39
|
/**
|
|
36
|
-
*
|
|
40
|
+
* 加载并校验配置,相对路径以配置文件所在目录为基准绝对化
|
|
37
41
|
*
|
|
38
|
-
* @param explicitPath -
|
|
39
|
-
* @returns
|
|
42
|
+
* @param explicitPath - 显式指定的配置文件路径,可空,缺省走向上发现
|
|
43
|
+
* @returns 成功为绝对路径形态配置与文件路径,失败为可读错误,未找到即配置文件必备违规
|
|
40
44
|
*/
|
|
41
|
-
declare function loadGithubMarkdownConfig(explicitPath?: string): Promise<ConfigLoadResult<GithubMarkdownConfig>>;
|
|
45
|
+
declare function loadGithubMarkdownConfig(explicitPath?: string): Promise<ConfigLoadResult$1<GithubMarkdownConfig>>;
|
|
42
46
|
//#endregion
|
|
43
47
|
//#region src/scaffold.utils.d.ts
|
|
44
48
|
/**
|
|
45
49
|
* 配置骨架生成(config init 用)
|
|
46
50
|
*
|
|
47
|
-
*
|
|
48
|
-
* 用户裁定 2026-09-25
|
|
51
|
+
* defineConfig 工厂导出形态(全局 ADR 0097 决策 2 defineXXX 收口;
|
|
52
|
+
* 用户裁定 2026-09-25 就地配置不得为裸对象过渡形态)。零参调用为标准形态=
|
|
53
|
+
* dataRoot '.' 就地自指工厂默认(用户裁定 2026-09-30 家族统一 defineConfig()
|
|
54
|
+
* 零参;对齐 lzi-kol config 包先例)。骨架依赖目标目录已安装
|
|
49
55
|
* config 包(`@longzai-intelligence-github-markdown/config`)——未安装处生成文件不可加载(依赖
|
|
50
56
|
* 就绪门,ADR 0100 先例;仓 ADR 0009 勘误注记)。结构仅 dataRoot 单字段(禁
|
|
51
57
|
* version——代际由包 npm 版本承载;克隆根属跨项目路径,走 .env 不进配置文件)。
|
|
@@ -57,16 +63,16 @@ declare function loadGithubMarkdownConfig(explicitPath?: string): Promise<Config
|
|
|
57
63
|
*/
|
|
58
64
|
type ScaffoldParams = {
|
|
59
65
|
/**
|
|
60
|
-
* 数据根(缺省 '.'
|
|
66
|
+
* 数据根(缺省 '.' 即零参标准形态;显式覆盖仅用于配置文件不放数据根的场景)
|
|
61
67
|
*/
|
|
62
68
|
readonly dataRoot?: string;
|
|
63
69
|
};
|
|
64
70
|
/**
|
|
65
|
-
* 生成配置骨架文本(
|
|
71
|
+
* 生成配置骨架文本(defineConfig 工厂零参标准形态导出)
|
|
66
72
|
*
|
|
67
|
-
* @param params - 骨架入参(dataRoot
|
|
73
|
+
* @param params - 骨架入参(dataRoot 可选覆盖;缺省即零参形态)
|
|
68
74
|
* @returns lzi-github-markdown.config.ts 全文
|
|
69
75
|
*/
|
|
70
76
|
declare function scaffoldConfigText(params?: ScaffoldParams): string;
|
|
71
77
|
//#endregion
|
|
72
|
-
export { CONFIG_FILENAME, type ConfigLoadError, type ConfigLoadOk, type ConfigLoadResult, GithubMarkdownConfig, GithubMarkdownConfigSchema, ScaffoldParams,
|
|
78
|
+
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{
|
|
2
|
-
`)}export{a as CONFIG_FILENAME,r as GithubMarkdownConfigSchema,i as
|
|
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
|
+
`)}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.5",
|
|
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
|
}
|