wormajs 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.
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/dist/bin/actions.js +245 -0
- package/dist/bin/cli.js +27 -0
- package/dist/bin/progressRenderer.js +47 -0
- package/dist/bin/renderer.js +551 -0
- package/dist/bin/theme.js +26 -0
- package/dist/config.js +19 -0
- package/dist/constant.js +162 -0
- package/dist/core/WorkerPool.js +102 -0
- package/dist/core/loader/astLoader/generates/array.js +34 -0
- package/dist/core/loader/astLoader/generates/enum.js +61 -0
- package/dist/core/loader/astLoader/generates/group.js +41 -0
- package/dist/core/loader/astLoader/generates/index.js +71 -0
- package/dist/core/loader/astLoader/generates/interface.js +59 -0
- package/dist/core/loader/astLoader/generates/simple.js +67 -0
- package/dist/core/loader/astLoader/generates/tuple.js +54 -0
- package/dist/core/loader/astLoader/generates/type.js +2 -0
- package/dist/core/loader/astLoader/generates/utils.js +86 -0
- package/dist/core/loader/astLoader/helper.js +21 -0
- package/dist/core/loader/astLoader/index.js +24 -0
- package/dist/core/loader/astLoader/normalize/index.js +70 -0
- package/dist/core/loader/astLoader/normalize/normalizer.js +69 -0
- package/dist/core/loader/astLoader/normalize/rules/convertTypeArray.js +68 -0
- package/dist/core/loader/astLoader/normalize/rules/handleEmptyType.js +8 -0
- package/dist/core/loader/astLoader/normalize/rules/inferType.js +43 -0
- package/dist/core/loader/astLoader/normalize/rules/mergeAnyOf.js +45 -0
- package/dist/core/loader/astLoader/normalize/rules/normalizeCombiningKeywords.js +26 -0
- package/dist/core/loader/astLoader/normalize/rules/normalizeEnum.js +38 -0
- package/dist/core/loader/astLoader/normalize/rules/normalizeNullType.js +24 -0
- package/dist/core/loader/astLoader/normalize/rules/removeRedundantKeywords.js +27 -0
- package/dist/core/loader/astLoader/normalize/rules/simplifySingleType.js +8 -0
- package/dist/core/loader/astLoader/normalize/rules/validateSchema.js +14 -0
- package/dist/core/loader/astLoader/parsers/array.js +28 -0
- package/dist/core/loader/astLoader/parsers/enum.js +49 -0
- package/dist/core/loader/astLoader/parsers/forward/array.js +12 -0
- package/dist/core/loader/astLoader/parsers/forward/enum.js +10 -0
- package/dist/core/loader/astLoader/parsers/forward/group.js +12 -0
- package/dist/core/loader/astLoader/parsers/forward/index.js +20 -0
- package/dist/core/loader/astLoader/parsers/forward/object.js +12 -0
- package/dist/core/loader/astLoader/parsers/forward/tuple.js +11 -0
- package/dist/core/loader/astLoader/parsers/forward/type.js +2 -0
- package/dist/core/loader/astLoader/parsers/group.js +50 -0
- package/dist/core/loader/astLoader/parsers/index.js +66 -0
- package/dist/core/loader/astLoader/parsers/object.js +44 -0
- package/dist/core/loader/astLoader/parsers/reference.js +41 -0
- package/dist/core/loader/astLoader/parsers/simple.js +48 -0
- package/dist/core/loader/astLoader/parsers/tuple.js +36 -0
- package/dist/core/loader/astLoader/parsers/type.js +2 -0
- package/dist/core/loader/astLoader/parsers/utils.js +58 -0
- package/dist/core/loader/callingCodeLoader/helper.js +183 -0
- package/dist/core/loader/callingCodeLoader/index.js +40 -0
- package/dist/core/loader/index.js +20 -0
- package/dist/core/loader/schemaLoader/index.js +101 -0
- package/dist/core/loader/standardLoader/helper.js +142 -0
- package/dist/core/loader/standardLoader/index.js +38 -0
- package/dist/core/loader/standardLoader/standards.js +105 -0
- package/dist/core/parser/index.js +18 -0
- package/dist/core/parser/openApiParser/helper.js +165 -0
- package/dist/core/parser/openApiParser/index.js +14 -0
- package/dist/core/parser/templateParser/helper.js +333 -0
- package/dist/core/parser/templateParser/index.js +314 -0
- package/dist/core/workerPool/index.js +6 -0
- package/dist/core/workerPool/poolManager.js +45 -0
- package/dist/core/workerPool/swagger2Worker.js +24 -0
- package/dist/core/workerPool/worker.js +61 -0
- package/dist/createConfig.js +37 -0
- package/dist/defineConfig.js +6 -0
- package/dist/functions/getAutoTemplateType.js +37 -0
- package/dist/functions/getFrameworkTag.js +18 -0
- package/dist/functions/prepareConfig.js +41 -0
- package/dist/functions/readWormaRc.js +155 -0
- package/dist/functions/wormaJson.js +232 -0
- package/dist/generate.js +84 -0
- package/dist/helper/PluginDriver.js +98 -0
- package/dist/helper/comment.js +88 -0
- package/dist/helper/config/ConfigHelper.js +79 -0
- package/dist/helper/config/ConfigManager.js +88 -0
- package/dist/helper/config/GeneratorHelper.js +343 -0
- package/dist/helper/config/index.js +19 -0
- package/dist/helper/config/type.js +2 -0
- package/dist/helper/config/zType.js +170 -0
- package/dist/helper/document/index.js +160 -0
- package/dist/helper/index.js +23 -0
- package/dist/helper/logger/index.js +76 -0
- package/dist/helper/progress.js +66 -0
- package/dist/helper/template/index.js +475 -0
- package/dist/index.js +33 -0
- package/dist/plugins/createPlugin.js +30 -0
- package/dist/plugins/index.js +34 -0
- package/dist/plugins/presets/aiDoc.js +173 -0
- package/dist/plugins/presets/apifox.js +56 -0
- package/dist/plugins/presets/filterApi.js +129 -0
- package/dist/plugins/presets/importType.js +49 -0
- package/dist/plugins/presets/payloadModifier/hepler.js +195 -0
- package/dist/plugins/presets/payloadModifier/index.js +122 -0
- package/dist/plugins/presets/payloadModifier/type.js +2 -0
- package/dist/plugins/presets/platform.js +73 -0
- package/dist/plugins/presets/rename.js +209 -0
- package/dist/plugins/presets/tagModifier.js +104 -0
- package/dist/plugins/presets/utils.js +36 -0
- package/dist/readConfig.js +92 -0
- package/dist/resolveWorkspaces.js +83 -0
- package/dist/template/index.js +180 -0
- package/dist/template/presets/ai-doc/SKILL.md.handlebars +29 -0
- package/dist/template/presets/ai-doc/references/{tag}/{api}.md.handlebars +54 -0
- package/dist/template/presets/alova/common/#index.cjs.handlebars +12 -0
- package/dist/template/presets/alova/common/components.d.cts.handlebars +1 -0
- package/dist/template/presets/alova/common/helper.cjs.handlebars +13 -0
- package/dist/template/presets/alova/common/services/#index.cjs.handlebars +13 -0
- package/dist/template/presets/alova/common/services/{tag}.cjs.handlebars +28 -0
- package/dist/template/presets/alova/common/services/{tag}.d.cts.handlebars +15 -0
- package/dist/template/presets/alova/common/typed.d.cts.handlebars +1 -0
- package/dist/template/presets/alova/module/#index.js.handlebars +12 -0
- package/dist/template/presets/alova/module/components.d.ts.handlebars +1 -0
- package/dist/template/presets/alova/module/helper.js.handlebars +11 -0
- package/dist/template/presets/alova/module/services/#index.js.handlebars +9 -0
- package/dist/template/presets/alova/module/services/{tag}.d.ts.handlebars +15 -0
- package/dist/template/presets/alova/module/services/{tag}.js.handlebars +21 -0
- package/dist/template/presets/alova/module/typed.d.ts.handlebars +1 -0
- package/dist/template/presets/alova/partials/api-jsdoc.handlebars +44 -0
- package/dist/template/presets/alova/partials/build-payload-body.handlebars +22 -0
- package/dist/template/presets/alova/partials/comment.handlebars +19 -0
- package/dist/template/presets/alova/partials/components-body.handlebars +4 -0
- package/dist/template/presets/alova/partials/dts-extra-config.handlebars +8 -0
- package/dist/template/presets/alova/partials/dts-fn-declare.handlebars +1 -0
- package/dist/template/presets/alova/partials/extract-responded.handlebars +11 -0
- package/dist/template/presets/alova/partials/stateshook-import.handlebars +9 -0
- package/dist/template/presets/alova/partials/stateshook-option.handlebars +9 -0
- package/dist/template/presets/alova/partials/typed-body.handlebars +43 -0
- package/dist/template/presets/alova/typescript/#index.ts.handlebars +14 -0
- package/dist/template/presets/alova/typescript/components.d.ts.handlebars +1 -0
- package/dist/template/presets/alova/typescript/helper.ts.handlebars +9 -0
- package/dist/template/presets/alova/typescript/services/#index.ts.handlebars +9 -0
- package/dist/template/presets/alova/typescript/services/{tag}.ts.handlebars +35 -0
- package/dist/template/presets/alova/typescript/typed.ts.handlebars +1 -0
- package/dist/template/presets/alova-globals/common/#index.cjs.handlebars +41 -0
- package/dist/template/presets/alova-globals/common/apiDefinitions.cjs.handlebars +12 -0
- package/dist/template/presets/alova-globals/common/createApis.cjs.handlebars +48 -0
- package/dist/template/presets/alova-globals/common/globals.d.cts.handlebars +2 -0
- package/dist/template/presets/alova-globals/module/#index.js.handlebars +2 -0
- package/dist/template/presets/alova-globals/module/apiDefinitions.js.handlebars +12 -0
- package/dist/template/presets/alova-globals/module/createApis.js.handlebars +44 -0
- package/dist/template/presets/alova-globals/module/globals.d.ts.handlebars +2 -0
- package/dist/template/presets/alova-globals/partials/comment.handlebars +19 -0
- package/dist/template/presets/alova-globals/partials/createApis-proxy-js.handlebars +55 -0
- package/dist/template/presets/alova-globals/partials/globals-d-ts.handlebars +148 -0
- package/dist/template/presets/alova-globals/partials/index-esm.handlebars +38 -0
- package/dist/template/presets/alova-globals/partials/withConfigType-jsdoc.handlebars +22 -0
- package/dist/template/presets/alova-globals/typescript/#index.ts.handlebars +2 -0
- package/dist/template/presets/alova-globals/typescript/apiDefinitions.ts.handlebars +12 -0
- package/dist/template/presets/alova-globals/typescript/createApis.ts.handlebars +99 -0
- package/dist/template/presets/alova-globals/typescript/globals.d.ts.handlebars +2 -0
- package/dist/template/presets/axios/common/#index.cjs.handlebars +22 -0
- package/dist/template/presets/axios/common/components.d.cts.handlebars +1 -0
- package/dist/template/presets/axios/common/helper.cjs.handlebars +27 -0
- package/dist/template/presets/axios/common/services/#index.cjs.handlebars +13 -0
- package/dist/template/presets/axios/common/services/{tag}.cjs.handlebars +28 -0
- package/dist/template/presets/axios/common/services/{tag}.d.cts.handlebars +11 -0
- package/dist/template/presets/axios/module/#index.js.handlebars +20 -0
- package/dist/template/presets/axios/module/components.d.ts.handlebars +1 -0
- package/dist/template/presets/axios/module/helper.js.handlebars +25 -0
- package/dist/template/presets/axios/module/services/#index.js.handlebars +9 -0
- package/dist/template/presets/axios/module/services/{tag}.d.ts.handlebars +11 -0
- package/dist/template/presets/axios/module/services/{tag}.js.handlebars +20 -0
- package/dist/template/presets/axios/partials/api-jsdoc.handlebars +44 -0
- package/dist/template/presets/axios/partials/comment.handlebars +19 -0
- package/dist/template/presets/axios/partials/components-body.handlebars +4 -0
- package/dist/template/presets/axios/partials/dts-fn-declare.handlebars +1 -0
- package/dist/template/presets/axios/partials/dts-types.handlebars +7 -0
- package/dist/template/presets/axios/typescript/#index.ts.handlebars +20 -0
- package/dist/template/presets/axios/typescript/components.d.ts.handlebars +1 -0
- package/dist/template/presets/axios/typescript/helper.ts.handlebars +28 -0
- package/dist/template/presets/axios/typescript/services/#index.ts.handlebars +9 -0
- package/dist/template/presets/axios/typescript/services/{tag}.ts.handlebars +31 -0
- package/dist/template/presets/config/common/worma.config.js.handlebars +9 -0
- package/dist/template/presets/config/module/worma.config.js.handlebars +9 -0
- package/dist/template/presets/config/partials/generator-content.handlebars +45 -0
- package/dist/template/presets/config/typescript/worma.config.ts.handlebars +9 -0
- package/dist/template/presets/fetch/common/#index.cjs.handlebars +17 -0
- package/dist/template/presets/fetch/common/FetchClient.cjs.handlebars +48 -0
- package/dist/template/presets/fetch/common/components.d.cts.handlebars +1 -0
- package/dist/template/presets/fetch/common/helper.cjs.handlebars +27 -0
- package/dist/template/presets/fetch/common/services/#index.cjs.handlebars +13 -0
- package/dist/template/presets/fetch/common/services/{tag}.cjs.handlebars +23 -0
- package/dist/template/presets/fetch/common/services/{tag}.d.cts.handlebars +10 -0
- package/dist/template/presets/fetch/module/#index.js.handlebars +15 -0
- package/dist/template/presets/fetch/module/FetchClient.js.handlebars +46 -0
- package/dist/template/presets/fetch/module/components.d.ts.handlebars +1 -0
- package/dist/template/presets/fetch/module/helper.js.handlebars +25 -0
- package/dist/template/presets/fetch/module/services/#index.js.handlebars +9 -0
- package/dist/template/presets/fetch/module/services/{tag}.d.ts.handlebars +10 -0
- package/dist/template/presets/fetch/module/services/{tag}.js.handlebars +15 -0
- package/dist/template/presets/fetch/partials/api-jsdoc.handlebars +44 -0
- package/dist/template/presets/fetch/partials/comment.handlebars +19 -0
- package/dist/template/presets/fetch/partials/components-body.handlebars +4 -0
- package/dist/template/presets/fetch/partials/dts-fn-declare.handlebars +1 -0
- package/dist/template/presets/fetch/partials/dts-types.handlebars +7 -0
- package/dist/template/presets/fetch/typescript/#index.ts.handlebars +15 -0
- package/dist/template/presets/fetch/typescript/FetchClient.ts.handlebars +59 -0
- package/dist/template/presets/fetch/typescript/components.d.ts.handlebars +1 -0
- package/dist/template/presets/fetch/typescript/helper.ts.handlebars +28 -0
- package/dist/template/presets/fetch/typescript/services/#index.ts.handlebars +9 -0
- package/dist/template/presets/fetch/typescript/services/{tag}.ts.handlebars +25 -0
- package/dist/template/presets/ky/module/#index.js.handlebars +14 -0
- package/dist/template/presets/ky/module/components.d.ts.handlebars +1 -0
- package/dist/template/presets/ky/module/helper.js.handlebars +27 -0
- package/dist/template/presets/ky/module/services/#index.js.handlebars +9 -0
- package/dist/template/presets/ky/module/services/{tag}.d.ts.handlebars +11 -0
- package/dist/template/presets/ky/module/services/{tag}.js.handlebars +19 -0
- package/dist/template/presets/ky/partials/api-jsdoc.handlebars +44 -0
- package/dist/template/presets/ky/partials/comment.handlebars +19 -0
- package/dist/template/presets/ky/partials/components-body.handlebars +4 -0
- package/dist/template/presets/ky/partials/dts-fn-declare.handlebars +1 -0
- package/dist/template/presets/ky/partials/dts-types.handlebars +9 -0
- package/dist/template/presets/ky/typescript/#index.ts.handlebars +14 -0
- package/dist/template/presets/ky/typescript/components.d.ts.handlebars +1 -0
- package/dist/template/presets/ky/typescript/helper.ts.handlebars +30 -0
- package/dist/template/presets/ky/typescript/services/#index.ts.handlebars +9 -0
- package/dist/template/presets/ky/typescript/services/{tag}.ts.handlebars +30 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/type/api.js +14 -0
- package/dist/type/ast.js +24 -0
- package/dist/type/base.js +17 -0
- package/dist/type/index.js +20 -0
- package/dist/type/lib.js +17 -0
- package/dist/type/openapi.js +2 -0
- package/dist/utils/base.js +212 -0
- package/dist/utils/format.js +64 -0
- package/dist/utils/index.js +21 -0
- package/dist/utils/openapi.js +417 -0
- package/dist/utils/readPackageJson.js +35 -0
- package/dist/utils/template.js +93 -0
- package/package.json +88 -0
- package/typings/index.d.ts +512 -0
- package/typings/plugins.d.ts +727 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generatorHelper = exports.GeneratorHelper = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const zod_validation_error_1 = require("zod-validation-error");
|
|
9
|
+
const constant_1 = require("../../constant");
|
|
10
|
+
const parser_1 = require("../../core/parser");
|
|
11
|
+
const helper_1 = require("../../core/parser/openApiParser/helper");
|
|
12
|
+
const getAutoTemplateType_1 = __importDefault(require("../../functions/getAutoTemplateType"));
|
|
13
|
+
const wormaJson_1 = require("../../functions/wormaJson");
|
|
14
|
+
const helper_2 = require("../../helper");
|
|
15
|
+
const progress_1 = require("../../helper/progress");
|
|
16
|
+
const zType_1 = require("./zType");
|
|
17
|
+
class GeneratorHelper {
|
|
18
|
+
constructor() {
|
|
19
|
+
/**
|
|
20
|
+
* Default configuration values
|
|
21
|
+
*/
|
|
22
|
+
this.defaultConfig = Object.freeze({
|
|
23
|
+
input: '',
|
|
24
|
+
output: '',
|
|
25
|
+
responseMediaType: 'application/json',
|
|
26
|
+
bodyMediaType: 'application/json',
|
|
27
|
+
type: constant_1.ConfigTypeEnum.AUTO,
|
|
28
|
+
defaultRequire: false,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
static getInstance() {
|
|
32
|
+
if (!GeneratorHelper.instance) {
|
|
33
|
+
GeneratorHelper.instance = new GeneratorHelper();
|
|
34
|
+
}
|
|
35
|
+
return GeneratorHelper.instance;
|
|
36
|
+
}
|
|
37
|
+
static load(config) {
|
|
38
|
+
const ins = new GeneratorHelper();
|
|
39
|
+
return ins.load(config);
|
|
40
|
+
}
|
|
41
|
+
getConfig() {
|
|
42
|
+
return this.readConfig;
|
|
43
|
+
}
|
|
44
|
+
getDefaultConfig() {
|
|
45
|
+
return this.defaultConfig;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Load and validate configuration
|
|
49
|
+
* @param config - Partial generator configuration
|
|
50
|
+
* @returns GeneratorHelper instance
|
|
51
|
+
*/
|
|
52
|
+
async load(config) {
|
|
53
|
+
// Merge with default config
|
|
54
|
+
const mergedConfig = { ...this.defaultConfig, ...config };
|
|
55
|
+
// Validate configuration
|
|
56
|
+
const validatedConfig = await GeneratorHelper.validateConfig(mergedConfig);
|
|
57
|
+
// Update config
|
|
58
|
+
this.config = validatedConfig;
|
|
59
|
+
this.readConfig = Object.freeze(this.config);
|
|
60
|
+
this.pluginDriver = new helper_2.PluginDriver(this.config.plugins);
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get template type based on config
|
|
65
|
+
* @param projectPath - Project path
|
|
66
|
+
* @returns Template type
|
|
67
|
+
*/
|
|
68
|
+
async getTemplateType(projectPath) {
|
|
69
|
+
return GeneratorHelper.getTemplateType(this.config, projectPath);
|
|
70
|
+
}
|
|
71
|
+
getPluginDriver() {
|
|
72
|
+
return this.pluginDriver;
|
|
73
|
+
}
|
|
74
|
+
async openApiData(projectPath) {
|
|
75
|
+
return GeneratorHelper.openApiData(this.config, projectPath);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Validate configuration using zod schema
|
|
79
|
+
* @param config - Configuration to validate
|
|
80
|
+
* @returns Validated configuration
|
|
81
|
+
*/
|
|
82
|
+
static async validateConfig(config) {
|
|
83
|
+
let result = config;
|
|
84
|
+
try {
|
|
85
|
+
result = zType_1.zGeneratorConfig.parse(config);
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
const zError = (0, zod_validation_error_1.fromError)(error);
|
|
89
|
+
throw helper_2.logger.throwError(zError.message, zError.details);
|
|
90
|
+
}
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Determine template type based on config type value
|
|
95
|
+
* @param config - Generator configuration
|
|
96
|
+
* @param projectPath - Project path for auto detection
|
|
97
|
+
* @returns Template type
|
|
98
|
+
*/
|
|
99
|
+
static async getTemplateType(config, projectPath) {
|
|
100
|
+
let type;
|
|
101
|
+
const configType = config.type ?? constant_1.ConfigTypeEnum.AUTO;
|
|
102
|
+
switch (configType) {
|
|
103
|
+
case constant_1.ConfigTypeEnum.TS:
|
|
104
|
+
case constant_1.ConfigTypeEnum.TYPESCRIPT:
|
|
105
|
+
type = constant_1.TemplateTypeEnum.TYPESCRIPT;
|
|
106
|
+
break;
|
|
107
|
+
case constant_1.ConfigTypeEnum.MODULE:
|
|
108
|
+
type = constant_1.TemplateTypeEnum.MODULE;
|
|
109
|
+
break;
|
|
110
|
+
case constant_1.ConfigTypeEnum.AUTO:
|
|
111
|
+
type = await (0, getAutoTemplateType_1.default)(projectPath);
|
|
112
|
+
break;
|
|
113
|
+
default:
|
|
114
|
+
type = constant_1.TemplateTypeEnum.COMMONJS;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
return type;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Parse OpenAPI document from config input
|
|
121
|
+
* @param config - Generator configuration
|
|
122
|
+
* @param projectPath - Project path
|
|
123
|
+
* @returns OpenAPI document
|
|
124
|
+
*/
|
|
125
|
+
static openApiData(config, projectPath) {
|
|
126
|
+
return parser_1.openApiParser.parse(config.input, {
|
|
127
|
+
projectPath,
|
|
128
|
+
fetchOptions: config.fetchOptions,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
static async openApiDataWithUrl(config, projectPath) {
|
|
132
|
+
return (0, helper_1.getOpenApiDataWithUrl)(config.input, {
|
|
133
|
+
projectPath,
|
|
134
|
+
fetchOptions: config.fetchOptions,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
static async generate(config, { projectPath, force, tracker }) {
|
|
138
|
+
const reporter = (plugin) => tracker?.reporterFor(plugin.name ?? 'plugin') ?? progress_1.noopReportProgress;
|
|
139
|
+
const pluginDriver = new helper_2.PluginDriver(config.plugins, { reporter });
|
|
140
|
+
const reportCore = (progress, message) => {
|
|
141
|
+
tracker?.update(progress_1.CORE_PROGRESS_SOURCE, progress, message);
|
|
142
|
+
};
|
|
143
|
+
const pluginCount = (config.plugins || []).length;
|
|
144
|
+
const pluginNames = (config.plugins || []).map(p => p.name).filter(Boolean);
|
|
145
|
+
helper_2.logger.debug('Starting generation process', {
|
|
146
|
+
projectPath,
|
|
147
|
+
force,
|
|
148
|
+
input: config.input,
|
|
149
|
+
output: config.output,
|
|
150
|
+
plugins: pluginCount,
|
|
151
|
+
pluginNames: pluginNames.length ? pluginNames : 'none',
|
|
152
|
+
});
|
|
153
|
+
reportCore(5, 'starting');
|
|
154
|
+
const frozenConfig = Object.freeze(config);
|
|
155
|
+
// Plugin: handle before parse openapi
|
|
156
|
+
reportCore(10, 'beforeOpenapiParse');
|
|
157
|
+
helper_2.logger.debug('Running beforeOpenapiParse hook');
|
|
158
|
+
await pluginDriver.hookParallelEach('beforeOpenapiParse', () => ({
|
|
159
|
+
config: frozenConfig,
|
|
160
|
+
projectPath,
|
|
161
|
+
}));
|
|
162
|
+
reportCore(20, 'parsing openapi document');
|
|
163
|
+
helper_2.logger.debug('Fetching OpenAPI document', { input: config.input });
|
|
164
|
+
const openApiResult = await this.openApiDataWithUrl(config, projectPath);
|
|
165
|
+
let document = openApiResult.data;
|
|
166
|
+
const resolvedInput = openApiResult.resolvedUrl;
|
|
167
|
+
if (!document) {
|
|
168
|
+
helper_2.logger.debug('No OpenAPI document found, skipping generation', { resolvedInput });
|
|
169
|
+
reportCore(100, 'skipped: no openapi document');
|
|
170
|
+
return { success: false, resolvedInput };
|
|
171
|
+
}
|
|
172
|
+
helper_2.logger.debug('OpenAPI document parsed successfully', {
|
|
173
|
+
resolvedUrl: resolvedInput,
|
|
174
|
+
version: document?.info?.version,
|
|
175
|
+
paths: Object.keys(document?.paths || {}).length,
|
|
176
|
+
});
|
|
177
|
+
reportCore(35, 'openapi parsed');
|
|
178
|
+
// Plugin: handle after parse openapi (openapiParsed)
|
|
179
|
+
helper_2.logger.debug('Running openapiParsed hook', { pluginCount });
|
|
180
|
+
const openapiParsed = await pluginDriver.hookSeqEach('openapiParsed', (_p, prevResult, _ctx) => {
|
|
181
|
+
if (prevResult) {
|
|
182
|
+
document = prevResult;
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
config: frozenConfig,
|
|
186
|
+
document,
|
|
187
|
+
projectPath,
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
if (openapiParsed) {
|
|
191
|
+
document = openapiParsed;
|
|
192
|
+
helper_2.logger.debug('openapiParsed hook modified document');
|
|
193
|
+
}
|
|
194
|
+
reportCore(45, 'openapiParsed');
|
|
195
|
+
const output = node_path_1.default.resolve(projectPath, config.output);
|
|
196
|
+
const templateType = await GeneratorHelper.getTemplateType(config, projectPath);
|
|
197
|
+
helper_2.logger.debug('Resolved output and template type', { output, templateType });
|
|
198
|
+
// Get template path from plugins (last non-nil wins)
|
|
199
|
+
helper_2.logger.debug('Running getTemplate hook');
|
|
200
|
+
const templateResult = await pluginDriver.hookSeqEach('getTemplate', (_p, _prevResult, _ctx) => ({
|
|
201
|
+
config: frozenConfig,
|
|
202
|
+
projectPath,
|
|
203
|
+
}));
|
|
204
|
+
if (!templateResult?.path) {
|
|
205
|
+
throw helper_2.logger.throwError('No template configured. Please add a template preset plugin (e.g. alovaGlobals, alova, axios, fetch, ky) to `config.generator.plugins`.');
|
|
206
|
+
}
|
|
207
|
+
helper_2.logger.debug('Template configuration loaded', {
|
|
208
|
+
path: templateResult.path,
|
|
209
|
+
type: templateType,
|
|
210
|
+
});
|
|
211
|
+
reportCore(55, 'template configuration loaded');
|
|
212
|
+
// Collect onHandlebarsCreated callbacks from plugins (deferred until hbs is created)
|
|
213
|
+
const onHbsCreatedCallbacks = [];
|
|
214
|
+
const plugins = (config.plugins || []);
|
|
215
|
+
for (const plugin of plugins) {
|
|
216
|
+
if (typeof plugin.onHandlebarsCreated === 'function') {
|
|
217
|
+
const fn = plugin.onHandlebarsCreated;
|
|
218
|
+
onHbsCreatedCallbacks.push((hbs) => fn.call(plugin, {
|
|
219
|
+
hbs,
|
|
220
|
+
config: frozenConfig,
|
|
221
|
+
projectPath,
|
|
222
|
+
reportProgress: reporter(plugin),
|
|
223
|
+
}));
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const templateHelper = helper_2.TemplateHelper.load({
|
|
227
|
+
type: templateType,
|
|
228
|
+
templatePath: templateResult.path,
|
|
229
|
+
// We'll collect and inject onHandlebarsCreated later
|
|
230
|
+
});
|
|
231
|
+
// Parse document and create template data
|
|
232
|
+
const tempalteParser = new parser_1.TemplateParser();
|
|
233
|
+
const templateData = await tempalteParser.parse(document, {
|
|
234
|
+
projectPath,
|
|
235
|
+
generatorConfig: config,
|
|
236
|
+
});
|
|
237
|
+
helper_2.logger.debug('Template data parsed', {
|
|
238
|
+
apisCount: templateData.allApis?.length ?? 0,
|
|
239
|
+
tagsCount: templateData.tagedApis?.length ?? 0,
|
|
240
|
+
});
|
|
241
|
+
reportCore(65, 'template data parsed');
|
|
242
|
+
// M3-B2: hash-based comparison instead of lodash.isEqual O(n·s) deep compare
|
|
243
|
+
// P2: Pass tagedApis to avoid re-grouping; apiHashCache avoids re-hashing same Api objects
|
|
244
|
+
const newApis = templateData.allApis || [];
|
|
245
|
+
const newHashInfo = (0, wormaJson_1.computePerTagHashes)(newApis, templateData.tagedApis);
|
|
246
|
+
let changedTags;
|
|
247
|
+
if (!force) {
|
|
248
|
+
const oldEntry = await (0, wormaJson_1.getCacheEntry)(projectPath, config.output);
|
|
249
|
+
if (oldEntry) {
|
|
250
|
+
if (oldEntry.hash === newHashInfo.hash) {
|
|
251
|
+
helper_2.logger.debug('Template data unchanged (hash match), skipping generation');
|
|
252
|
+
reportCore(100, 'skipped: template data unchanged');
|
|
253
|
+
return { success: false, resolvedInput };
|
|
254
|
+
}
|
|
255
|
+
// Compute which tags changed for incremental rendering
|
|
256
|
+
changedTags = (0, wormaJson_1.diffChangedTags)(oldEntry.tags, newHashInfo.tags);
|
|
257
|
+
helper_2.logger.debug('Incremental update detected', {
|
|
258
|
+
totalTags: Object.keys(newHashInfo.tags).length,
|
|
259
|
+
changedTags: changedTags.size,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
reportCore(70, 'beforeCodeGenerate');
|
|
264
|
+
helper_2.logger.debug('Running beforeCodeGenerate hook');
|
|
265
|
+
await pluginDriver.hookParallelEach('beforeCodeGenerate', () => ({
|
|
266
|
+
config: frozenConfig,
|
|
267
|
+
data: templateData,
|
|
268
|
+
projectPath,
|
|
269
|
+
}));
|
|
270
|
+
let codeGenError;
|
|
271
|
+
let filePaths = [];
|
|
272
|
+
try {
|
|
273
|
+
// Reload templateHelper with onHandlebarsCreated callbacks
|
|
274
|
+
templateHelper.load({
|
|
275
|
+
type: templateType,
|
|
276
|
+
templatePath: templateResult.path,
|
|
277
|
+
onHandlebarsCreated: onHbsCreatedCallbacks,
|
|
278
|
+
});
|
|
279
|
+
helper_2.logger.debug('Resolving template files', { templatePath: templateResult.path });
|
|
280
|
+
// Save template data and cache data (hash info included for later write)
|
|
281
|
+
await helper_2.TemplateHelper.setData(templateData, projectPath, config.output, config);
|
|
282
|
+
helper_2.logger.debug('Processing templates');
|
|
283
|
+
reportCore(80, 'processing templates');
|
|
284
|
+
// 9.2.1: Unified streaming pipeline — render + beforeFileWrite hooks + write
|
|
285
|
+
const perf = config.performance;
|
|
286
|
+
const writeConcurrency = perf?.writeConcurrency ?? 32;
|
|
287
|
+
const formatFile = perf?.formatFile ?? true;
|
|
288
|
+
helper_2.logger.debug('Starting template generation', {
|
|
289
|
+
writeConcurrency,
|
|
290
|
+
formatFile,
|
|
291
|
+
changedTagsCount: changedTags?.size ?? 'all',
|
|
292
|
+
});
|
|
293
|
+
const result = await templateHelper.generateFromTemplateDir(templateResult.path, output, templateData, {
|
|
294
|
+
changedTags,
|
|
295
|
+
writeConcurrency,
|
|
296
|
+
formatFile,
|
|
297
|
+
beforeFileWrite: async ({ filePath: relPath, content: fileContent, meta }) => {
|
|
298
|
+
return pluginDriver.hookPipe('beforeFileWrite', fileContent, (_p, currentContent, _ctx) => ({
|
|
299
|
+
config: frozenConfig,
|
|
300
|
+
data: templateData,
|
|
301
|
+
filePath: relPath,
|
|
302
|
+
content: currentContent,
|
|
303
|
+
projectPath,
|
|
304
|
+
meta,
|
|
305
|
+
}));
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
filePaths = result.filePaths;
|
|
309
|
+
helper_2.logger.debug('Template generation completed', {
|
|
310
|
+
filesWritten: filePaths.length,
|
|
311
|
+
});
|
|
312
|
+
reportCore(95, 'files written');
|
|
313
|
+
}
|
|
314
|
+
catch (error) {
|
|
315
|
+
codeGenError = error;
|
|
316
|
+
helper_2.logger.debug('Template generation failed', {
|
|
317
|
+
error: codeGenError.message,
|
|
318
|
+
stack: codeGenError.stack,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
// 9.1.4 & 9.1.1: codeGenerated is called AFTER all files are written, only receives file paths
|
|
322
|
+
helper_2.logger.debug('Running codeGenerated hook', { fileCount: filePaths.length });
|
|
323
|
+
await pluginDriver.hookParallelEach('codeGenerated', () => ({
|
|
324
|
+
config: frozenConfig,
|
|
325
|
+
data: templateData,
|
|
326
|
+
filePaths,
|
|
327
|
+
outputDir: output,
|
|
328
|
+
projectPath,
|
|
329
|
+
error: codeGenError,
|
|
330
|
+
renderTemplate: (params) => helper_2.TemplateHelper.renderToDir(params),
|
|
331
|
+
}));
|
|
332
|
+
if (!codeGenError) {
|
|
333
|
+
reportCore(100, 'completed');
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
reportCore(100, `failed: ${codeGenError.message}`);
|
|
337
|
+
throw codeGenError;
|
|
338
|
+
}
|
|
339
|
+
return { success: true, resolvedInput };
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
exports.GeneratorHelper = GeneratorHelper;
|
|
343
|
+
exports.generatorHelper = GeneratorHelper.getInstance();
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ConfigHelper"), exports);
|
|
18
|
+
__exportStar(require("./ConfigManager"), exports);
|
|
19
|
+
__exportStar(require("./GeneratorHelper"), exports);
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.zConfig = exports.zGeneratorConfig = exports._zGeneratorConfig = exports.zApiPlugin = exports.zFetchOptions = exports.zHandleApi = exports.zApiDescriptor = exports.zTemplateResult = exports.zTemplateType = exports.zConfigType = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
const v3_1 = require("zod/v3"); // v4版本不稳定,暂时使用v3
|
|
9
|
+
/**
|
|
10
|
+
* Find the corresponding input attribute value
|
|
11
|
+
*/
|
|
12
|
+
exports.zConfigType = v3_1.z.enum(['auto', 'ts', 'typescript', 'module', 'commonjs']);
|
|
13
|
+
/**
|
|
14
|
+
* template type
|
|
15
|
+
*/
|
|
16
|
+
exports.zTemplateType = v3_1.z.enum(['typescript', 'module', 'commonjs']);
|
|
17
|
+
exports.zTemplateResult = v3_1.z.object({
|
|
18
|
+
path: v3_1.z.string(),
|
|
19
|
+
});
|
|
20
|
+
exports.zApiDescriptor = v3_1.z.any();
|
|
21
|
+
exports.zHandleApi = v3_1.z
|
|
22
|
+
.function()
|
|
23
|
+
.args(exports.zApiDescriptor)
|
|
24
|
+
.returns(v3_1.z.union([exports.zApiDescriptor, v3_1.z.undefined(), v3_1.z.null(), v3_1.z.void()]));
|
|
25
|
+
exports.zFetchOptions = v3_1.z.record(v3_1.z.string(), v3_1.z.any());
|
|
26
|
+
exports.zApiPlugin = v3_1.z.object({
|
|
27
|
+
name: v3_1.z.string().optional(),
|
|
28
|
+
config: v3_1.z.function().optional(),
|
|
29
|
+
beforeOpenapiParse: v3_1.z.function().optional(),
|
|
30
|
+
openapiParsed: v3_1.z.function().optional(),
|
|
31
|
+
beforeCodeGenerate: v3_1.z.function().optional(),
|
|
32
|
+
beforeFileWrite: v3_1.z.function().optional(),
|
|
33
|
+
codeGenerated: v3_1.z.function().optional(),
|
|
34
|
+
getTemplate: v3_1.z.function().optional(),
|
|
35
|
+
onHandlebarsCreated: v3_1.z.function().optional(),
|
|
36
|
+
});
|
|
37
|
+
exports._zGeneratorConfig = v3_1.z.object({
|
|
38
|
+
/**
|
|
39
|
+
* Openapi file path, it supports json and yaml file, and network url.
|
|
40
|
+
* Can be a single URL string or an array of URLs. When set to an array,
|
|
41
|
+
* each URL will be tried in order and the first successful response is returned.
|
|
42
|
+
* @requires true
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* input: 'http://localhost:3000/openapi.json'
|
|
46
|
+
* input: 'openapi/api.json' -> Take the current project as the local address of the relative directory
|
|
47
|
+
* input: ['https://primary.com/openapi.json', 'https://fallback.com/openapi.json'] -> Try each URL in order
|
|
48
|
+
*/
|
|
49
|
+
input: v3_1.z.union([v3_1.z.string(), v3_1.z.array(v3_1.z.string())]).refine(val => (typeof val === 'string' && val.length > 0) || (Array.isArray(val) && val.length > 0), 'Field input is required in `config.generator`'),
|
|
50
|
+
// Fetch options used by remote OpenAPI retrieval (headers, timeout, insecure). See FetchOptions in '@/utils/base'.
|
|
51
|
+
fetchOptions: exports.zFetchOptions.optional(),
|
|
52
|
+
/**
|
|
53
|
+
* A list of type identifiers to exclude from generation.
|
|
54
|
+
* Matches against type names parsed from the OpenAPI schema; matched types
|
|
55
|
+
* are skipped and referenced directly by their identifier in generated code
|
|
56
|
+
* to avoid duplicate or conflicting declarations.
|
|
57
|
+
* Use this when you already have hand-written types or types provided by
|
|
58
|
+
* frameworks/libraries that should not be generated.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* externalTypes: ['File', 'Blob', 'FormData', 'Pagination']
|
|
62
|
+
*/
|
|
63
|
+
externalTypes: v3_1.z.array(v3_1.z.string()).optional(),
|
|
64
|
+
/**
|
|
65
|
+
* The output path of the interface file and type file, multiple generators cannot have repeated addresses, otherwise the generated codes will cover each other, which is meaningless.
|
|
66
|
+
* @requires true
|
|
67
|
+
*/
|
|
68
|
+
output: v3_1.z
|
|
69
|
+
.string({
|
|
70
|
+
required_error: 'Field output is required in `config.generator`',
|
|
71
|
+
})
|
|
72
|
+
.nonempty('Field output is required in `config.generator`'),
|
|
73
|
+
/**
|
|
74
|
+
* Whether to generate documentation comments, default is true.
|
|
75
|
+
* Set to false to improve generation performance.
|
|
76
|
+
*/
|
|
77
|
+
docComment: v3_1.z.boolean().optional(),
|
|
78
|
+
/**
|
|
79
|
+
* Specify the media type of the generated response data. After specifying, use this data type to generate the response ts format of the 2xx status code.
|
|
80
|
+
* Can be a string or an array of strings for fallback media types.
|
|
81
|
+
*/
|
|
82
|
+
responseMediaType: v3_1.z.union([v3_1.z.string(), v3_1.z.array(v3_1.z.string())]).optional(),
|
|
83
|
+
/**
|
|
84
|
+
* Specify the media type of the generated request body data. After specifying, use this data type to generate the ts format of the request body.
|
|
85
|
+
* Can be a string or an array of strings for fallback media types.
|
|
86
|
+
*/
|
|
87
|
+
bodyMediaType: v3_1.z.union([v3_1.z.string(), v3_1.z.array(v3_1.z.string())]).optional(),
|
|
88
|
+
/**
|
|
89
|
+
* Custom server name for displaying in the sidebar when multiple API docs are configured.
|
|
90
|
+
*/
|
|
91
|
+
serverName: v3_1.z.string().optional(),
|
|
92
|
+
/**
|
|
93
|
+
* The type of generated code. The optional value is `auto/ts/typescript/module/commonjs`.
|
|
94
|
+
* default is `auto`, it means the type of current project will be determined through certain rules.
|
|
95
|
+
*
|
|
96
|
+
* @param type
|
|
97
|
+
* 1. ts/typescript: The same meaning means generating ts type files
|
|
98
|
+
* 2. module: generate esModule specification file
|
|
99
|
+
* 3. commonjs: means generating commonjs specification file
|
|
100
|
+
*
|
|
101
|
+
* @default 'auto'
|
|
102
|
+
*/
|
|
103
|
+
type: exports.zConfigType.optional(),
|
|
104
|
+
/**
|
|
105
|
+
* When there is no require, it defaults to require, and only nullable takes effect.
|
|
106
|
+
*/
|
|
107
|
+
defaultRequire: v3_1.z.boolean().optional(),
|
|
108
|
+
/**
|
|
109
|
+
* plugin will be executed before `handleApi`
|
|
110
|
+
*/
|
|
111
|
+
plugins: v3_1.z.array(exports.zApiPlugin).optional(),
|
|
112
|
+
/**
|
|
113
|
+
* Filter or convert the generated api function and return a new `apiDescriptor` to generate the api.
|
|
114
|
+
* When this function is not specified, `apiDescriptor` object is not converted.
|
|
115
|
+
* The type of `apiDescriptor` is the same as the api item of openapi file.
|
|
116
|
+
*
|
|
117
|
+
* @see https://spec.openapis.org/oas/v3.1.0.html#operation-object
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```js
|
|
121
|
+
* // Do not generate the apis that starts with `/user`
|
|
122
|
+
* handleApi(apiDescriptor) {
|
|
123
|
+
* if (apiDescriptor.path.startsWith('/user')) {
|
|
124
|
+
* return;
|
|
125
|
+
* }
|
|
126
|
+
* return apiDescriptor;
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* ```js
|
|
131
|
+
* // modify the api's parameters
|
|
132
|
+
* handleApi(apiDescriptor) {
|
|
133
|
+
* apiDescriptor.parameters = (apiDescriptor.parameters || []).filter(
|
|
134
|
+
* param => param.in === 'header' && param.name === 'token'
|
|
135
|
+
* );
|
|
136
|
+
* delete apiDescriptor.requestBody.id;
|
|
137
|
+
* apiDescriptor.url = apiDescriptor.url.replace('/user', '');
|
|
138
|
+
* return apiDescriptor;
|
|
139
|
+
* }
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
handleApi: exports.zHandleApi.optional(),
|
|
143
|
+
});
|
|
144
|
+
exports.zGeneratorConfig = exports._zGeneratorConfig;
|
|
145
|
+
exports.zConfig = v3_1.z.object({
|
|
146
|
+
/**
|
|
147
|
+
* API generation settings are arrays. Each item represents an automatically generated rule, including the generated input and output directories, specification file addresses, etc.
|
|
148
|
+
* Currently, only OpenAPI specifications are supported, including OpenAPI 2.0 and 3.0 specifications.
|
|
149
|
+
*/
|
|
150
|
+
generator: v3_1.z
|
|
151
|
+
.array(exports.zGeneratorConfig)
|
|
152
|
+
.min(1, 'No items found in the `config.generator`')
|
|
153
|
+
.superRefine((data, ctx) => {
|
|
154
|
+
if (data.length < 2) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const outputSet = new Set();
|
|
158
|
+
data.forEach((item) => {
|
|
159
|
+
if (outputSet.has(node_path_1.default.join(item.output ?? ''))) {
|
|
160
|
+
ctx.addIssue({
|
|
161
|
+
code: v3_1.z.ZodIssueCode.custom,
|
|
162
|
+
path: ['generator', 'output'],
|
|
163
|
+
message: `output \`${item.output}\` is repeated`,
|
|
164
|
+
});
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
outputSet.add(node_path_1.default.join(item.output ?? ''));
|
|
168
|
+
});
|
|
169
|
+
}),
|
|
170
|
+
});
|