done-coding-extract 0.1.9-alpha.0 → 0.1.10-alpha.0

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/es/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { c as m } from "./index-7899ce46.js";
2
+ import { c as m } from "./index-ad21e5e4.js";
3
3
  import "./index-a1ee6691-8c73eb4d.js";
4
4
  import "@done-coding/cli-utils";
5
5
  import "node:path";
@@ -6,7 +6,7 @@ import y from "node:fs";
6
6
  import { OutputModeEnum as U, batchCompileHandler as W } from "@done-coding/cli-template";
7
7
  const O = {
8
8
  name: "@done-coding/cli-extract",
9
- version: "0.1.9-alpha.0",
9
+ version: "0.1.10-alpha.0",
10
10
  description: "信息提取命令行工具",
11
11
  cliConfig: {
12
12
  namespaceDir: ".done-coding",
@@ -47,7 +47,7 @@ const O = {
47
47
  }
48
48
  }, S = {
49
49
  name: "@done-coding/cli-inject",
50
- version: "0.5.9-alpha.0",
50
+ version: "0.5.10-alpha.0",
51
51
  description: "信息(JSON)注入命令行工具",
52
52
  cliConfig: {
53
53
  namespaceDir: ".done-coding",
@@ -55,7 +55,7 @@ const O = {
55
55
  }
56
56
  }, {
57
57
  cliConfig: { namespaceDir: q, moduleName: z }
58
- } = S, B = `./${q}/${z}`, A = `${B}.json`, x = {
58
+ } = S, B = `./${q}/${z}`, A = `${B}.json`, Q = {
59
59
  sourceFilePath: "./package.json",
60
60
  keyConfigMap: {
61
61
  name: {
@@ -69,22 +69,22 @@ const O = {
69
69
  }
70
70
  },
71
71
  injectFilePath: "./src/injectInfo.json"
72
- }, Q = () => D({
72
+ }, x = Q, Y = () => D({
73
73
  configPathDefault: A
74
- }), Y = async (e) => v(x, e, {
74
+ }), Z = async (e) => v(x, e, {
75
75
  onFileGenerated: () => {
76
76
  s.info("文件生成成功");
77
77
  }
78
- }), Z = {
78
+ }), ee = {
79
79
  command: T.INIT,
80
80
  describe: "初始化配置文件",
81
- options: Q(),
82
- handler: Y
83
- }, ee = () => ({
81
+ options: Y(),
82
+ handler: Z
83
+ }, ne = () => ({
84
84
  ...D({
85
85
  configPathDefault: A
86
86
  })
87
- }), ne = async ({
87
+ }), te = async ({
88
88
  rootDir: e = process.cwd(),
89
89
  config: n = x,
90
90
  keyConfigMap: o = {}
@@ -116,28 +116,28 @@ const O = {
116
116
  } else
117
117
  s.stage("开始注入文件");
118
118
  y.writeFileSync(p, E), s.success(`文件注入成功: ${p}`), s.info(E);
119
- }, te = async (e) => {
119
+ }, oe = async (e) => {
120
120
  const n = await F(e);
121
121
  if (!n)
122
122
  return s.error("配置文件为空"), process.exit(1);
123
123
  const { rootDir: o } = e;
124
- await ne({ rootDir: o, config: n });
125
- }, oe = {
124
+ await te({ rootDir: o, config: n });
125
+ }, se = {
126
126
  command: T.GENERATE,
127
127
  describe: "生成文件",
128
- options: ee(),
129
- handler: te
130
- }, { version: se, description: re } = S;
131
- [Z, oe].map(
128
+ options: ne(),
129
+ handler: oe
130
+ }, { version: re, description: ce } = S;
131
+ [ee, se].map(
132
132
  N
133
133
  );
134
- const ce = ({
134
+ const ie = ({
135
135
  input: e,
136
136
  rootDir: n
137
137
  }) => {
138
138
  const o = j.resolve(n, e), t = y.readFileSync(o, "utf-8");
139
139
  return e.endsWith(".json") || e.endsWith(".json5") ? JSON.parse(t) : t;
140
- }, ie = (e) => typeof e == "object" && !!e, ae = ({
140
+ }, ae = (e) => typeof e == "object" && !!e, ue = ({
141
141
  content: e,
142
142
  targetKey: n,
143
143
  keyConfig: o
@@ -160,7 +160,7 @@ const ce = ({
160
160
  });
161
161
  }
162
162
  case u.JSON_INJECT: {
163
- if (!ie(e))
163
+ if (!ae(e))
164
164
  throw new Error(`${t} 类型的keyConfig需要content为json`);
165
165
  return C({
166
166
  sourceJson: e,
@@ -180,11 +180,11 @@ const ce = ({
180
180
  default:
181
181
  throw new Error(`不支持的类型${t}`);
182
182
  }
183
- }, ue = {
183
+ }, de = {
184
184
  name: "${name}",
185
185
  version: "${version}",
186
186
  description: "${description}"
187
- }, de = {
187
+ }, pe = {
188
188
  extractInput: {
189
189
  "./package.json": {
190
190
  name: {
@@ -223,23 +223,23 @@ const ce = ({
223
223
  list: [
224
224
  {
225
225
  mode: U.OVERWRITE,
226
- inputData: JSON.stringify(ue, null, 2),
226
+ inputData: JSON.stringify(de, null, 2),
227
227
  output: "./src/extractInfo.json"
228
228
  }
229
229
  ]
230
230
  }
231
- }, pe = () => D({
231
+ }, me = () => D({
232
232
  configPathDefault: J
233
- }), G = async (e) => v(de, e, {
233
+ }), G = async (e) => v(pe, e, {
234
234
  onFileGenerated: () => {
235
235
  s.info("文件生成成功");
236
236
  }
237
- }), me = {
237
+ }), le = {
238
238
  command: h.INIT,
239
239
  describe: "初始化配置文件",
240
- options: pe(),
240
+ options: me(),
241
241
  handler: G
242
- }, le = () => ({
242
+ }, fe = () => ({
243
243
  ...D({
244
244
  configPathDefault: J
245
245
  }),
@@ -250,19 +250,19 @@ const ce = ({
250
250
  default: $.RESULT,
251
251
  describe: "生成模式"
252
252
  }
253
- }), fe = async ({
253
+ }), Ee = async ({
254
254
  rootDir: e = process.cwd(),
255
255
  config: n
256
256
  }) => {
257
257
  const { extractInput: o, extractOutput: t } = n, a = Object.entries(o).reduce(
258
258
  (c, [m, l]) => {
259
- const f = ce({
259
+ const f = ie({
260
260
  rootDir: e,
261
261
  input: m
262
262
  });
263
263
  return Object.entries(l).reduce(
264
264
  (d, [i, p]) => {
265
- const E = ae({
265
+ const E = ue({
266
266
  content: f,
267
267
  targetKey: i,
268
268
  keyConfig: p
@@ -286,13 +286,13 @@ const ce = ({
286
286
  if (!n)
287
287
  return s.error("配置文件为空"), process.exit(1);
288
288
  const { rootDir: o } = e;
289
- await fe({ rootDir: o, config: n });
290
- }, Ee = {
289
+ await Ee({ rootDir: o, config: n });
290
+ }, ye = {
291
291
  command: h.GENERATE,
292
292
  describe: "生成文件",
293
- options: le(),
293
+ options: fe(),
294
294
  handler: I
295
- }, Ne = async (e, n) => {
295
+ }, Oe = async (e, n) => {
296
296
  switch (e) {
297
297
  case h.INIT:
298
298
  return G(n);
@@ -301,10 +301,10 @@ const ce = ({
301
301
  default:
302
302
  return I(n);
303
303
  }
304
- }, { version: ye, description: ge } = O, k = {
305
- describe: ge,
306
- version: ye,
307
- subcommands: [me, Ee].map(
304
+ }, { version: ge, description: Ce } = O, k = {
305
+ describe: Ce,
306
+ version: ge,
307
+ subcommands: [le, ye].map(
308
308
  N
309
309
  ),
310
310
  demandCommandCount: 1
@@ -313,21 +313,21 @@ const ce = ({
313
313
  } = O, _ = (e = !1) => {
314
314
  const n = e ? w : void 0, o = `$0${e ? ` ${w}` : ""} <command> [options]`;
315
315
  return { command: n, usage: o };
316
- }, Oe = async () => V({
316
+ }, Re = async () => V({
317
317
  ...k,
318
318
  ..._()
319
- }), Re = () => N({
319
+ }), $e = () => N({
320
320
  ...k,
321
321
  ..._(!0)
322
322
  });
323
323
  export {
324
- Re as a,
325
- me as b,
326
- Oe as c,
324
+ $e as a,
325
+ le as b,
326
+ Re as c,
327
327
  I as d,
328
- Ee as e,
329
- Ne as f,
330
- fe as g,
328
+ ye as e,
329
+ Oe as f,
330
+ Ee as g,
331
331
  G as h,
332
332
  k as i
333
333
  };
package/es/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as t, a as i, e as s, g as d, d as l, f as p, b as f, h as u } from "./index-7899ce46.js";
2
+ import { i as t, a as i, e as s, g as d, d as l, f as p, b as f, h as u } from "./index-ad21e5e4.js";
3
3
  import { E as C, G as E, S as b } from "./index-a1ee6691-8c73eb4d.js";
4
4
  import "@done-coding/cli-utils";
5
5
  import "node:path";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "done-coding-extract",
3
- "version": "0.1.9-alpha.0",
3
+ "version": "0.1.10-alpha.0",
4
4
  "description": "信息提取命令行工具",
5
5
  "private": false,
6
6
  "module": "es/index.mjs",
@@ -42,7 +42,7 @@
42
42
  "license": "MIT",
43
43
  "sideEffects": false,
44
44
  "devDependencies": {
45
- "@done-coding/cli-inject": "^0.5.9-alpha.0",
45
+ "@done-coding/cli-inject": "^0.5.10-alpha.0",
46
46
  "@types/node": "^18.0.0",
47
47
  "@types/yargs": "^17.0.28",
48
48
  "rimraf": "^6.0.1",
@@ -54,9 +54,9 @@
54
54
  "node": ">=18.0.0"
55
55
  },
56
56
  "dependencies": {
57
- "@done-coding/cli-template": "0.7.9-alpha.0",
58
- "@done-coding/cli-utils": "^0.7.0"
57
+ "@done-coding/cli-template": "0.7.10-alpha.0",
58
+ "@done-coding/cli-utils": "^0.7.1-alpha.0"
59
59
  },
60
- "gitHead": "62a4c9df2bf8690e52753e0734ebb09010bb2e88",
60
+ "gitHead": "3376f5fbbf8b87c791316e76df06028afd650e08",
61
61
  "scripts": {}
62
62
  }
package/types/cli.d.ts CHANGED
@@ -1,2 +1 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ export { }
@@ -1 +1,70 @@
1
- export * from './helpers-assets/done-coding';
1
+ import type { CompileTemplateConfig } from '@done-coding/cli-template';
2
+ import type { InjectKeyConfig } from '@done-coding/cli-inject';
3
+ import type { InjectKeyConfigFixed } from '@done-coding/cli-inject';
4
+ import type { InjectKeyConfigReg } from '@done-coding/cli-inject';
5
+
6
+ /** done-coding 系列cli 别名发布信息 */
7
+ export declare const doneCodingPublishAliasInfo: ExtractConfig;
8
+
9
+ /** done-coding 系列cli 注入信息 */
10
+ export declare const doneCodingSeriesCliInjectInfo: ExtractConfig;
11
+
12
+ declare interface ExtractConfig {
13
+ /**
14
+ * 输入配置
15
+ * -- 每个源文件 对应一个配置
16
+ */
17
+ extractInput: Record<string, ExtractInputConfig>;
18
+ /** 输出配置 */
19
+ extractOutput: CompileTemplateConfig;
20
+ }
21
+
22
+ /** 提取输入配置 */
23
+ declare interface ExtractInputConfig {
24
+ [key: string]: ExtractInputKeyConfig;
25
+ }
26
+
27
+ /** 提取配置 */
28
+ declare type ExtractInputKeyConfig = ExtractInputKeyConfigReg | ExtractInputKeyConfigJsonInject | ExtractInputKeyConfigFixed;
29
+
30
+ /** 提取配置基础 */
31
+ declare interface ExtractInputKeyConfigBase<T extends ExtractTypeEnum> {
32
+ /**
33
+ * 提取类型
34
+ */
35
+ type: T;
36
+ }
37
+
38
+ /** 提取配置固定值 */
39
+ declare type ExtractInputKeyConfigFixed = ExtractInputKeyConfigBase<ExtractTypeEnum.FIXED> & Omit<InjectKeyConfigFixed, "type">;
40
+
41
+ /** 提取配置直接读取 */
42
+ declare interface ExtractInputKeyConfigJsonInject extends ExtractInputKeyConfigBase<ExtractTypeEnum.JSON_INJECT> {
43
+ inject: InjectKeyConfig;
44
+ }
45
+
46
+ /** 提取配置正则表达式 */
47
+ declare interface ExtractInputKeyConfigReg extends ExtractInputKeyConfigBase<ExtractTypeEnum.REG>, Omit<InjectKeyConfigReg, "type" | "sourceKey"> {
48
+ }
49
+
50
+ /** 提取方式枚举 */
51
+ declare enum ExtractTypeEnum {
52
+ /**
53
+ * 正则 类型
54
+ * ---
55
+ * 通过正则匹配后 replace 替换
56
+ */
57
+ REG = "reg",
58
+ /**
59
+ * json注入 类型
60
+ * ---
61
+ * 只限于读取json文件 input\output 均为json文件
62
+ * ---
63
+ * 内部直接调用 @done-coding/cli-inject
64
+ */
65
+ JSON_INJECT = "json-inject",
66
+ /** 固定值 类型 */
67
+ FIXED = "fixed"
68
+ }
69
+
70
+ export { }
package/types/index.d.ts CHANGED
@@ -1,3 +1,118 @@
1
- export * from './handlers';
2
- export { crateAsSubcommand } from "./main";
3
- export * from './types';
1
+ import { CliHandlerArgv } from '@done-coding/cli-utils';
2
+ import { CliInfo } from '@done-coding/cli-utils';
3
+ import { CommandModule } from 'yargs';
4
+ import type { CompileTemplateConfig } from '@done-coding/cli-template';
5
+ import type { InitConfigFileOptions } from '@done-coding/cli-utils';
6
+ import type { InjectKeyConfig } from '@done-coding/cli-inject';
7
+ import type { InjectKeyConfigFixed } from '@done-coding/cli-inject';
8
+ import type { InjectKeyConfigReg } from '@done-coding/cli-inject';
9
+ import type { ReadConfigFileOptions } from '@done-coding/cli-utils';
10
+ import { SubCliInfo } from '@done-coding/cli-utils';
11
+
12
+ export declare const commandCliInfo: Omit<CliInfo, "usage">;
13
+
14
+ /** 作为子命令创建 */
15
+ export declare const crateAsSubcommand: () => CommandModule<{}, {}>;
16
+
17
+ export declare interface ExtractConfig {
18
+ /**
19
+ * 输入配置
20
+ * -- 每个源文件 对应一个配置
21
+ */
22
+ extractInput: Record<string, ExtractInputConfig>;
23
+ /** 输出配置 */
24
+ extractOutput: CompileTemplateConfig;
25
+ }
26
+
27
+ /** 提取输入配置 */
28
+ export declare interface ExtractInputConfig {
29
+ [key: string]: ExtractInputKeyConfig;
30
+ }
31
+
32
+ /** 提取配置 */
33
+ export declare type ExtractInputKeyConfig = ExtractInputKeyConfigReg | ExtractInputKeyConfigJsonInject | ExtractInputKeyConfigFixed;
34
+
35
+ /** 提取配置基础 */
36
+ export declare interface ExtractInputKeyConfigBase<T extends ExtractTypeEnum> {
37
+ /**
38
+ * 提取类型
39
+ */
40
+ type: T;
41
+ }
42
+
43
+ /** 提取配置固定值 */
44
+ export declare type ExtractInputKeyConfigFixed = ExtractInputKeyConfigBase<ExtractTypeEnum.FIXED> & Omit<InjectKeyConfigFixed, "type">;
45
+
46
+ /** 提取配置直接读取 */
47
+ export declare interface ExtractInputKeyConfigJsonInject extends ExtractInputKeyConfigBase<ExtractTypeEnum.JSON_INJECT> {
48
+ inject: InjectKeyConfig;
49
+ }
50
+
51
+ /** 提取配置正则表达式 */
52
+ export declare interface ExtractInputKeyConfigReg extends ExtractInputKeyConfigBase<ExtractTypeEnum.REG>, Omit<InjectKeyConfigReg, "type" | "sourceKey"> {
53
+ }
54
+
55
+ /** 提取方式枚举 */
56
+ export declare enum ExtractTypeEnum {
57
+ /**
58
+ * 正则 类型
59
+ * ---
60
+ * 通过正则匹配后 replace 替换
61
+ */
62
+ REG = "reg",
63
+ /**
64
+ * json注入 类型
65
+ * ---
66
+ * 只限于读取json文件 input\output 均为json文件
67
+ * ---
68
+ * 内部直接调用 @done-coding/cli-inject
69
+ */
70
+ JSON_INJECT = "json-inject",
71
+ /** 固定值 类型 */
72
+ FIXED = "fixed"
73
+ }
74
+
75
+ export declare const generateCommandCliInfo: SubCliInfo;
76
+
77
+ /** 将提取的信息生成文件 */
78
+ export declare const generateFile: ({ rootDir, config, }: {
79
+ rootDir?: string | undefined;
80
+ config: ExtractConfig;
81
+ }) => Promise<void>;
82
+
83
+ /** 提取文件命令处理器 */
84
+ export declare const generateHandler: (argv: CliHandlerArgv<GenerateOptions>) => Promise<undefined>;
85
+
86
+ /** 生成模式枚举 */
87
+ export declare enum GenerateModeEnum {
88
+ /** 提取出结果 */
89
+ RESULT = "result",
90
+ /** 提取出模板 */
91
+ TEMPLATE = "template"
92
+ }
93
+
94
+ /** 生成选项 */
95
+ export declare interface GenerateOptions extends ReadConfigFileOptions {
96
+ /** 生成模式 */
97
+ mode?: GenerateModeEnum;
98
+ }
99
+
100
+ export declare const handler: (command: SubcommandEnum, argv: CliHandlerArgv<any>) => Promise<void>;
101
+
102
+ export declare const initCommandCliInfo: SubCliInfo;
103
+
104
+ /** 初始化命令处理器 */
105
+ export declare const initHandler: (argv: CliHandlerArgv<InitOptions>) => Promise<void>;
106
+
107
+ /** 初始化选项 */
108
+ export declare type InitOptions = InitConfigFileOptions;
109
+
110
+ /** 子命令枚举 */
111
+ export declare enum SubcommandEnum {
112
+ /** 初始化提取配置文件 */
113
+ INIT = "init",
114
+ /** 生成文件 */
115
+ GENERATE = "generate"
116
+ }
117
+
118
+ export { }
@@ -1,3 +0,0 @@
1
- import { type ExtractConfig } from '../types';
2
- declare const config: ExtractConfig;
3
- export default config;
@@ -1,13 +0,0 @@
1
- import type { SubCliInfo } from "@done-coding/cli-utils";
2
- import { type CliHandlerArgv, type CliInfo } from "@done-coding/cli-utils";
3
- import { type ExtractConfig, type GenerateOptions } from '../types';
4
- /** 获取生成命令选项 */
5
- export declare const getOptions: () => CliInfo["options"];
6
- /** 将提取的信息生成文件 */
7
- export declare const generateFile: ({ rootDir, config, }: {
8
- rootDir?: string | undefined;
9
- config: ExtractConfig;
10
- }) => Promise<void>;
11
- /** 提取文件命令处理器 */
12
- export declare const handler: (argv: CliHandlerArgv<GenerateOptions>) => Promise<undefined>;
13
- export declare const commandCliInfo: SubCliInfo;
@@ -1,7 +0,0 @@
1
- import { handler as initHandler, commandCliInfo as initCommandCliInfo } from "./init";
2
- import { handler as generateHandler, commandCliInfo as generateCommandCliInfo, generateFile } from "./generate";
3
- import { SubcommandEnum } from '../types';
4
- import { type CliHandlerArgv, type CliInfo } from "@done-coding/cli-utils";
5
- export { initHandler, initCommandCliInfo, generateHandler, generateCommandCliInfo, generateFile, };
6
- export declare const handler: (command: SubcommandEnum, argv: CliHandlerArgv<any>) => Promise<void>;
7
- export declare const commandCliInfo: Omit<CliInfo, "usage">;
@@ -1,8 +0,0 @@
1
- /// <reference types="yargs" />
2
- import type { CliHandlerArgv, SubCliInfo } from "@done-coding/cli-utils";
3
- import { type InitOptions } from '../types';
4
- /** 获取初始化选项 */
5
- export declare const getOptions: () => Record<keyof import("@done-coding/cli-utils").ConfigFileCommonOptions, import("yargs").Options>;
6
- /** 初始化命令处理器 */
7
- export declare const handler: (argv: CliHandlerArgv<InitOptions>) => Promise<void>;
8
- export declare const commandCliInfo: SubCliInfo;
@@ -1,5 +0,0 @@
1
- import { type ExtractConfig } from "../types";
2
- /** done-coding 系列cli 注入信息 */
3
- export declare const doneCodingSeriesCliInjectInfo: ExtractConfig;
4
- /** done-coding 系列cli 别名发布信息 */
5
- export declare const doneCodingPublishAliasInfo: ExtractConfig;
@@ -1,11 +0,0 @@
1
- declare const _default: {
2
- "name": "@done-coding/cli-extract",
3
- "version": "0.1.9-alpha.0",
4
- "description": "信息提取命令行工具",
5
- "cliConfig": {
6
- "namespaceDir": ".done-coding",
7
- "moduleName": "extract"
8
- }
9
- };
10
-
11
- export default _default;
package/types/main.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /// <reference types="yargs" />
2
- /** 作为主命令创建 */
3
- export declare const createCommand: () => Promise<void | {
4
- [x: string]: unknown;
5
- _: (string | number)[];
6
- $0: string;
7
- }>;
8
- /** 作为子命令创建 */
9
- export declare const crateAsSubcommand: () => import("yargs").CommandModule<{}, {}>;
@@ -1,74 +0,0 @@
1
- import type { InitConfigFileOptions, ReadConfigFileOptions } from "@done-coding/cli-utils";
2
- import type { CompileTemplateConfig } from "@done-coding/cli-template";
3
- import type { InjectKeyConfig, InjectKeyConfigFixed, InjectKeyConfigReg } from "@done-coding/cli-inject";
4
- /** 子命令枚举 */
5
- export declare enum SubcommandEnum {
6
- /** 初始化提取配置文件 */
7
- INIT = "init",
8
- /** 生成文件 */
9
- GENERATE = "generate"
10
- }
11
- /** 提取方式枚举 */
12
- export declare enum ExtractTypeEnum {
13
- /**
14
- * 正则 类型
15
- * ---
16
- * 通过正则匹配后 replace 替换
17
- */
18
- REG = "reg",
19
- /**
20
- * json注入 类型
21
- * ---
22
- * 只限于读取json文件 input\output 均为json文件
23
- * ---
24
- * 内部直接调用 @done-coding/cli-inject
25
- */
26
- JSON_INJECT = "json-inject",
27
- /** 固定值 类型 */
28
- FIXED = "fixed"
29
- }
30
- /** 初始化选项 */
31
- export type InitOptions = InitConfigFileOptions;
32
- /** 提取配置基础 */
33
- export interface ExtractInputKeyConfigBase<T extends ExtractTypeEnum> {
34
- /**
35
- * 提取类型
36
- */
37
- type: T;
38
- }
39
- /** 提取配置正则表达式 */
40
- export interface ExtractInputKeyConfigReg extends ExtractInputKeyConfigBase<ExtractTypeEnum.REG>, Omit<InjectKeyConfigReg, "type" | "sourceKey"> {
41
- }
42
- /** 提取配置直接读取 */
43
- export interface ExtractInputKeyConfigJsonInject extends ExtractInputKeyConfigBase<ExtractTypeEnum.JSON_INJECT> {
44
- inject: InjectKeyConfig;
45
- }
46
- /** 提取配置固定值 */
47
- export type ExtractInputKeyConfigFixed = ExtractInputKeyConfigBase<ExtractTypeEnum.FIXED> & Omit<InjectKeyConfigFixed, "type">;
48
- /** 提取配置 */
49
- export type ExtractInputKeyConfig = ExtractInputKeyConfigReg | ExtractInputKeyConfigJsonInject | ExtractInputKeyConfigFixed;
50
- /** 提取输入配置 */
51
- export interface ExtractInputConfig {
52
- [key: string]: ExtractInputKeyConfig;
53
- }
54
- export interface ExtractConfig {
55
- /**
56
- * 输入配置
57
- * -- 每个源文件 对应一个配置
58
- */
59
- extractInput: Record<string, ExtractInputConfig>;
60
- /** 输出配置 */
61
- extractOutput: CompileTemplateConfig;
62
- }
63
- /** 生成模式枚举 */
64
- export declare enum GenerateModeEnum {
65
- /** 提取出结果 */
66
- RESULT = "result",
67
- /** 提取出模板 */
68
- TEMPLATE = "template"
69
- }
70
- /** 生成选项 */
71
- export interface GenerateOptions extends ReadConfigFileOptions {
72
- /** 生成模式 */
73
- mode?: GenerateModeEnum;
74
- }
@@ -1,2 +0,0 @@
1
- export * from "./path";
2
- export * from "./resolve";
@@ -1,4 +0,0 @@
1
- /** 模块配置相对路径 */
2
- export declare const MODULE_CONFIG_RELATIVE_PATH: string;
3
- /** 模块默认配置文件相对路径 */
4
- export declare const MODULE_DEFAULT_CONFIG_RELATIVE_PATH: string;
@@ -1,14 +0,0 @@
1
- import { type ExtractInputKeyConfig } from '../types';
2
- /** 内容解析 */
3
- export declare const contentResolve: ({ input, rootDir, }: {
4
- input: string;
5
- rootDir: string;
6
- }) => string | Record<string, any>;
7
- /** 内容是否为对象 */
8
- export declare const contentIsObj: (content: ReturnType<typeof contentResolve>) => boolean;
9
- /** 配置解析 */
10
- export declare const keyConfigResolve: ({ content, targetKey, keyConfig, }: {
11
- content: ReturnType<typeof contentResolve>;
12
- targetKey: string;
13
- keyConfig: ExtractInputKeyConfig;
14
- }) => any;