@longzai-intelligence-situation-markdown/config 0.0.0-stage → 0.0.1

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
+ * 配置结构
5
+ */
6
+ declare const SituationConfigSchema: z.ZodObject<{
7
+ dataRoot: z.ZodDefault<z.ZodString>;
8
+ sourceRoot: z.ZodString;
9
+ }, z.core.$strip>;
10
+ /**
11
+ * 配置类型(schema 推断)
12
+ */
13
+ type SituationConfig = z.infer<typeof SituationConfigSchema>;
14
+ /**
15
+ * 配置工厂:类型收口(identity 语义,运行时校验由加载方执行);导出名统一为 defineConfig(全局 ADR 0097 决策 2,禁域前缀工厂名)
16
+ *
17
+ * @param config - 现状判断工具配置
18
+ * @returns 原样返回的配置
19
+ */
20
+ declare function defineConfig(config: SituationConfig): SituationConfig;
21
+ /**
22
+ * 配置文件约定名
23
+ *
24
+ * @remarks
25
+ * 以工具命名,全局 ADR 0090,与 bin 与 env 前缀三同源
26
+ */
27
+ declare const CONFIG_FILENAME = "lzi-situation-markdown.config.ts";
28
+ /**
29
+ * 自 cwd 向上查找配置文件
30
+ *
31
+ * @param explicitPath - 显式指定的配置文件路径,可空
32
+ * @returns 命中的绝对路径,未命中为 undefined
33
+ */
34
+ declare function discoverConfigPath(explicitPath?: string): string | undefined;
35
+ /**
36
+ * 加载并校验配置
37
+ *
38
+ * @param explicitPath - 显式指定的配置文件路径,可空,缺省走向上发现
39
+ * @returns 成功为绝对路径形态配置与文件路径,失败为可读错误
40
+ */
41
+ declare function loadSituationConfig(explicitPath?: string): Promise<ConfigLoadResult$1<SituationConfig>>;
42
+ /**
43
+ * 配置骨架生成(config init 用)
44
+ *
45
+ * defineConfig 工厂导出形态(全局 ADR 0097 决策 2;裸对象过渡形态废止;禁 version——
46
+ * 代际由包 npm 版本承载)。骨架依赖目标目录已安装 config 包(依赖就绪门,ADR 0100
47
+ * 先例)。引擎 ScaffoldTemplate 仅承载裸字面量导出形态,define 工厂包装属域形态,
48
+ * 本模块自持文本生成(非引擎能力分叉)。
49
+ */
50
+ /**
51
+ * 骨架入参
52
+ */
53
+ type ScaffoldParams = {
54
+ /**
55
+ * 数据根(缺省 `.` 即就地自指)
56
+ */
57
+ readonly dataRoot?: string;
58
+ /**
59
+ * 数据源根(域语义由使用方特化)
60
+ */
61
+ readonly sourceRoot?: string;
62
+ };
63
+ /**
64
+ * 生成配置骨架文本(defineConfig 工厂形态导出)
65
+ *
66
+ * @param params - 骨架入参
67
+ * @returns 就地配置全文
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.object({dataRoot:e.string().min(1).default(`.`),sourceRoot:e.string().min(1)});function i(e){return e}const a=`lzi-situation-markdown.config.ts`,o=()=>t({configFilename:a,schema:r,shapeHint:`defineConfig 收口的 dataRoot 加 sourceRoot,禁 version 字段,代际由包 npm 版本承载`,absolutize:(e,t)=>({...e,dataRoot:n(t,e.dataRoot),sourceRoot:n(t,e.sourceRoot)})});function s(e){return o().discoverConfigPath(e)}function c(e){return o().loadConfig(e)}function l(e={}){let t=[];return e.dataRoot!==void 0&&e.dataRoot!==`.`&&t.push(`dataRoot: '${e.dataRoot}'`),e.sourceRoot!==void 0&&t.push(`sourceRoot: '${e.sourceRoot}'`),[`// lzi-situation-markdown 就地配置(以工具命名,全局 ADR 0090;defineConfig 工厂收口,全局 ADR 0097 决策 2)。`,`// 相对路径以本文件所在目录为基准——放在数据根时工厂默认 dataRoot "."(零参调用即可)。`,`import { defineConfig } from '@longzai-intelligence-situation-markdown/config';`,``,t.length===0?`export default defineConfig();`:`export default defineConfig({ ${t.join(`, `)} });`,``].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,42 @@
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.1",
4
+ "description": "Longzai Intelligence 配置包",
5
+ "keywords": [
6
+ "config",
7
+ "longzai-intelligence"
8
+ ],
9
+ "license": "UNLICENSED",
10
+ "type": "module",
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js"
17
+ }
18
+ },
19
+ "scripts": {
20
+ "build": "lzi-builder",
21
+ "build:prod": "NODE_ENV=production lzi-builder",
22
+ "prepublishOnly": "bun run build:prod",
23
+ "typecheck": "bun run typecheck:app && bun run typecheck:node && bun run typecheck:test",
24
+ "typecheck:app": "lzi-tsgo typecheck tsconfig/app.json",
25
+ "typecheck:node": "lzi-tsgo typecheck tsconfig/node.json",
26
+ "typecheck:test": "lzi-tsgo typecheck tsconfig/test.json",
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.6",
36
+ "@longzai-intelligence-shared-config/core": "0.0.10",
37
+ "zod": "^4.6.5"
38
+ },
39
+ "files": [
40
+ "dist"
41
+ ]
42
+ }
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.