@longzai-intelligence-situation-markdown/config 0.0.0-stage → 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.
@@ -0,0 +1,70 @@
1
+ import * as z from "zod";
2
+ import { ConfigLoadErr, ConfigLoadError, ConfigLoadOk, ConfigLoadResult, ConfigLoadResult as ConfigLoadResult$1 } from "@longzai-intelligence-shared-config/core";
3
+ /**
4
+ * 配置结构(lzi-situation-markdown.config.ts 默认导出形态)
5
+ */
6
+ declare const SituationConfigSchema: z.ZodObject<{
7
+ dataRoot: z.ZodString;
8
+ }, z.core.$strict>;
9
+ /**
10
+ * 配置类型(schema 推断)
11
+ */
12
+ type SituationConfig = z.infer<typeof SituationConfigSchema>;
13
+ /**
14
+ * 配置工厂:类型收口(identity 语义,运行时校验由加载方执行);导出名统一为 defineConfig(全局 ADR 0097 决策 2,禁域前缀工厂名)
15
+ *
16
+ * 缺省零参调用=就地自指 dataRoot '.'(用户裁定 2026-09-30 家族统一 defineConfig() 零参标准形态)
17
+ *
18
+ * @param config - 现状判断工具配置(缺省 { dataRoot: '.' } 就地自指)
19
+ * @returns 原样返回的配置
20
+ */
21
+ declare function defineConfig(config?: SituationConfig): SituationConfig;
22
+ /**
23
+ * 配置文件约定名
24
+ *
25
+ * @remarks
26
+ * 以工具命名,全局 ADR 0090,与 bin 与 env 前缀三同源
27
+ */
28
+ declare const CONFIG_FILENAME = "lzi-situation-markdown.config.ts";
29
+ /**
30
+ * 自 cwd 向上查找配置文件
31
+ *
32
+ * @param explicitPath - 显式指定的配置文件路径,可空
33
+ * @returns 命中的绝对路径,未命中为 undefined
34
+ */
35
+ declare function discoverConfigPath(explicitPath?: string): string | undefined;
36
+ /**
37
+ * 加载并校验配置
38
+ *
39
+ * @param explicitPath - 显式指定的配置文件路径,可空,缺省走向上发现
40
+ * @returns 成功为绝对路径形态配置与文件路径,失败为可读错误
41
+ */
42
+ declare function loadSituationConfig(explicitPath?: string): Promise<ConfigLoadResult$1<SituationConfig>>;
43
+ /**
44
+ * 配置骨架生成(config init 用)
45
+ *
46
+ * defineConfig 工厂导出形态(全局 ADR 0097 决策 2;裸对象过渡形态废止;禁 version——
47
+ * 代际由包 npm 版本承载)。零参调用为标准形态=dataRoot '.' 就地自指工厂默认(用户
48
+ * 裁定 2026-09-30 家族统一 defineConfig() 零参;参照仓 github-trending-markdown
49
+ * scaffold 配方)。骨架依赖目标目录已安装 config 包(依赖就绪门,ADR 0100 先例)。
50
+ * 结构仅 dataRoot 单字段——现状记录仓根属跨项目路径,走 .env 的
51
+ * LZI_SITUATION_MARKDOWN_SOURCE_ROOT 不进配置文件。引擎 ScaffoldTemplate 仅承载裸
52
+ * 字面量导出形态,define 工厂包装属域形态,本模块自持文本生成(非引擎能力分叉)。
53
+ */
54
+ /**
55
+ * 骨架入参
56
+ */
57
+ type ScaffoldParams = {
58
+ /**
59
+ * 数据根(缺省 '.' 即零参标准形态;显式覆盖仅用于配置文件不放数据根的场景)
60
+ */
61
+ readonly dataRoot?: string;
62
+ };
63
+ /**
64
+ * 生成配置骨架文本(defineConfig 工厂零参标准形态导出)
65
+ *
66
+ * @param params - 骨架入参(dataRoot 可选覆盖;缺省即零参形态)
67
+ * @returns lzi-situation-markdown.config.ts 全文
68
+ */
69
+ declare function scaffoldConfigText(params?: ScaffoldParams): string;
70
+ export { CONFIG_FILENAME, type ConfigLoadErr, type ConfigLoadError, type ConfigLoadOk, type ConfigLoadResult, ScaffoldParams, SituationConfig, SituationConfigSchema, defineConfig, discoverConfigPath, loadSituationConfig, scaffoldConfigText };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ 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-situation-markdown.config.ts`,o=()=>t({configFilename:a,schema:r,shapeHint:"dataRoot 单字段,禁 version,代际由包 npm 版本承载,现状记录仓根走 `LZI_SITUATION_MARKDOWN_SOURCE_ROOT`",absolutize:(e,t)=>({...e,dataRoot:n(t,e.dataRoot)}),notFoundMessage:`配置文件必备,执行全局 ADR 0097 决策 9:未找到 ${a},自 cwd 向上查找至文件系统根,或经 --config 显式指定,配置文件不得缺失,.env 不作整体替代,.env 仅承载跨项目路径 LZI_SITUATION_MARKDOWN_SOURCE_ROOT`});function s(e){return o().discoverConfigPath(e)}function c(e){return o().loadConfig(e)}function l(e={}){return[`// lzi-situation-markdown 就地配置(以工具命名,全局 ADR 0090;defineConfig 工厂收口,全局 ADR 0097 决策 2)。`,`// 相对路径以本文件所在目录为基准——放在数据根时工厂默认 dataRoot "."(零参调用即可)。`,`// 现状记录仓根走 .env 的 LZI_SITUATION_MARKDOWN_SOURCE_ROOT(跨项目路径零进入库配置,全局 ADR 0097 决策 5)。`,`import { defineConfig } from '@longzai-intelligence-situation-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 SituationConfigSchema,i as defineConfig,s as discoverConfigPath,c as loadSituationConfig,l as scaffoldConfigText};
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "@longzai-intelligence-situation-markdown/config",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.2",
4
+ "description": "Longzai Intelligence 配置包",
5
+ "keywords": [
6
+ "config",
7
+ "longzai-intelligence"
8
+ ],
9
+ "license": "UNLICENSED",
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "type": "module",
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js"
20
+ }
21
+ },
22
+ "scripts": {
23
+ "build": "lzi-builder",
24
+ "build:prod": "NODE_ENV=production bun run build",
25
+ "prepublishOnly": "bun run build:prod",
26
+ "typecheck": "lzi-typecheck",
27
+ "lint": "oxlint && oxfmt --check",
28
+ "lint:fix": "oxlint --fix && oxfmt",
29
+ "test": "lzi-bun test",
30
+ "test:watch": "lzi-bun test --watch",
31
+ "test:coverage": "lzi-bun test --coverage",
32
+ "clean": "lzi-dev-tools clean"
33
+ },
34
+ "dependencies": {
35
+ "@longzai-intelligence-markdown/data-engine": "^0.0.8",
36
+ "@longzai-intelligence-shared-config/core": "0.0.10",
37
+ "zod": "^4.6.5"
38
+ }
39
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.