very-express 0.3.0 → 0.3.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/cli.js +3 -2
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -28,7 +28,8 @@ config.jsonSchemaDir = args.j || args.jsonSchemaDir || config.jsonSchemaDir || "
|
|
|
28
28
|
config.rootDir = args.o || args.rootDir || config.rootDir || ".";
|
|
29
29
|
config.srcDir = config.srcDir || config.rootDir + "/src";
|
|
30
30
|
config.openapiDir = config.openapiDir || config.rootDir + "./openapi";
|
|
31
|
-
config.app
|
|
31
|
+
config.app = config.app || {},
|
|
32
|
+
config.app.enableSwagger = config.app.enableSwagger || true,
|
|
32
33
|
config.app.useUserSchema = config.app.useUserSchema || true,
|
|
33
34
|
config.app.useObjectID = config.app.useObjectID || true,
|
|
34
35
|
config.app.allowApiCreateUpdate_id = config.app.allowApiCreateUpdate_id || false,
|
|
@@ -42,7 +43,7 @@ config.useOauth = config.useOauth || {
|
|
|
42
43
|
github: false
|
|
43
44
|
};
|
|
44
45
|
if (config.app.useObjectID && config.app.allowApiCreateUpdate_id) {
|
|
45
|
-
logger_1.default.warn("Not recommended to use \"useObjectID\" with \"allowApiCreateUpdate_id\",\nthis may cause
|
|
46
|
+
logger_1.default.warn("Not recommended to use \"useObjectID\" with \"allowApiCreateUpdate_id\",\nthis may cause some logic issues");
|
|
46
47
|
}
|
|
47
48
|
logger_1.default.process("vex.config.json");
|
|
48
49
|
(0, utils_1.writeFile)("vex.config", "vex.config.json", JSON.stringify(config, null, 4));
|
package/dist/index.js
CHANGED
|
@@ -66,6 +66,9 @@ function generate(options) {
|
|
|
66
66
|
if (!fs_1.default.existsSync(options.openapiDir)) {
|
|
67
67
|
fs_1.default.mkdirSync(options.openapiDir);
|
|
68
68
|
}
|
|
69
|
+
if (!fs_1.default.existsSync(roleSourceDir)) {
|
|
70
|
+
fs_1.default.mkdirSync(roleSourceDir);
|
|
71
|
+
}
|
|
69
72
|
Object.values(dir).forEach((path) => {
|
|
70
73
|
if (!fs_1.default.existsSync(path)) {
|
|
71
74
|
fs_1.default.mkdirSync(path);
|
|
@@ -75,7 +78,6 @@ function generate(options) {
|
|
|
75
78
|
utils.copyDir(`${__dirname}/templates/services`, dir.serviceDir, options, true);
|
|
76
79
|
utils.copyDir(`${__dirname}/templates/plugins`, dir.pluginDir, options, true);
|
|
77
80
|
utils.copyDir(`${__dirname}/templates/roles`, dir.roleDir, options, true);
|
|
78
|
-
utils.copyDir(`${__dirname}/templates/middleware`, dir.middlewareDir, options, true);
|
|
79
81
|
if (options.app.useUserSchema) {
|
|
80
82
|
userSchemaGen.compile({
|
|
81
83
|
compilerOptions: options || utils.defaultCompilerOptions,
|