@longzai-intelligence-tsconfig/config 0.0.1 → 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.
package/dist/index.d.ts CHANGED
@@ -18,11 +18,9 @@ type SingleTsconfigExemption = {
18
18
  */
19
19
  type PackageOverride = {
20
20
  /**
21
- * app 片应 extends 的预设名
21
+ * app 片包型覆写
22
22
  *
23
- * 如 `library`、`react`、`elysia`,对应共享配置包 `presets/<名>.json`
24
- *
25
- * @default 不声明时仅校验 extends 合法性,不做包型比对
23
+ * 包型默认按依赖自动推断(如 `react`、`elysia`、`next`,无框架依赖默认 `library`),仅推断误判或特异预设(如 decorator 变体)时覆写
26
24
  */
27
25
  appPreset?: string;
28
26
  /**
@@ -52,18 +50,18 @@ type LziTsconfigConfig = {
52
50
  /**
53
51
  * lzi-tsconfig 配置工厂
54
52
  *
55
- * 纯类型透传,运行时无副作用原样返回,为配置文件提供类型推导与形态收口
53
+ * 参数可选、零参返回空默认配置——消费仓无仓库特有事实时 `defineConfig()` 一行即接入,开箱即用;有参时纯类型透传原样返回,为配置文件提供类型推导与形态收口
56
54
  *
57
- * @param config - 使用方就地配置对象
58
- * @returns 原样返回的配置对象
55
+ * @param config - 使用方就地配置对象,省略时取空配置
56
+ * @returns 配置对象,省略入参时为空对象
59
57
  */
60
- declare function defineConfig(config: LziTsconfigConfig): LziTsconfigConfig;
58
+ declare function defineConfig(config?: LziTsconfigConfig): LziTsconfigConfig;
61
59
  //#endregion
62
60
  //#region src/config-template.utils.d.ts
63
61
  /**
64
62
  * 构建配置文件模板内容
65
63
  *
66
- * 供 `lzi-tsconfig init` 写盘与 `--dry-run` 预览共用,注释遵循配置文件治理规范
64
+ * 供 `lzi-tsconfig init` 写盘与 `--dry-run` 预览共用,零参开箱即用形态,注释遵循配置文件治理规范
67
65
  *
68
66
  * @returns 配置文件全文
69
67
  */
package/dist/index.js CHANGED
@@ -1,9 +1,7 @@
1
- import"./rolldown-runtime-BqT_7tdF.js";import{createJiti as e}from"jiti";import{existsSync as t}from"node:fs";import{join as n}from"node:path";function r(e){return e}function i(){return`import { defineConfig } from '@longzai-intelligence-tsconfig/config';
1
+ import"./rolldown-runtime-BqT_7tdF.js";import{createJiti as e}from"jiti";import{existsSync as t}from"node:fs";import{join as n}from"node:path";function r(e){return e??{}}function i(){return`import { defineConfig } from '@longzai-intelligence-tsconfig/config';
2
2
 
3
3
  /**
4
4
  * lzi-tsconfig 配置
5
5
  */
6
- export default defineConfig({
7
- packages: {},
8
- });
6
+ export default defineConfig();
9
7
  `}const a=`lzi-tsconfig.config.ts`;function o(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function s(e){if(!o(e))return!1;if(e.packages!==void 0){if(!o(e.packages))return!1;for(let t of Object.values(e.packages)){if(!o(t))return!1;let e=t.appPreset;if(e!==void 0&&typeof e!=`string`)return!1;let n=t.singleTsconfig;if(n!==void 0){if(!o(n))return!1;let e=n.reason;if(typeof e!=`string`||e.length===0)return!1}}}return e.exclude===void 0||!!Array.isArray(e.exclude)&&!e.exclude.some(e=>typeof e!=`string`)}async function c(r){let i=n(r,a);if(!t(i))return null;let c=await e(import.meta.url).import(i);if(!o(c))throw Error(`配置模块导出缺失`);let l=c.default;if(!s(l))throw Error(`配置默认导出形态不合规`);return{config:l,path:i}}export{a as CONFIG_FILE_NAME,i as buildConfigFileContent,r as defineConfig,c as loadConfig};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longzai-intelligence-tsconfig/config",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "private": false,
5
5
  "description": "Longzai Intelligence tsconfig 形态门禁配置契约",
6
6
  "license": "UNLICENSED",