@avleon/cli 0.0.5 → 0.0.6
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/create.js +20 -4
- package/package.json +1 -1
- package/src/create.ts +22 -3
package/dist/create.js
CHANGED
|
@@ -41,7 +41,6 @@ const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
|
41
41
|
const paths_1 = require("./paths");
|
|
42
42
|
const prettier = __importStar(require("prettier"));
|
|
43
43
|
const win32_1 = __importDefault(require("path/win32"));
|
|
44
|
-
const child_process_1 = require("child_process");
|
|
45
44
|
async function createApplication(fname) {
|
|
46
45
|
const appPaths = (0, paths_1.appPaths)(fname);
|
|
47
46
|
const dirs = Object.values(appPaths);
|
|
@@ -71,6 +70,22 @@ const builder = Builder.createAppBuilder();
|
|
|
71
70
|
|
|
72
71
|
// build app
|
|
73
72
|
const app = builder.build();
|
|
73
|
+
|
|
74
|
+
app.useSwagger({
|
|
75
|
+
info: {
|
|
76
|
+
title: "${fname}",
|
|
77
|
+
description: "Your description here",
|
|
78
|
+
version: "0.0.1",
|
|
79
|
+
},
|
|
80
|
+
servers: [
|
|
81
|
+
{
|
|
82
|
+
url: "http://localhost:"+env.PORT,
|
|
83
|
+
description: "Development",
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
|
|
74
89
|
app.mapGet('/', ()=> "Welcome");
|
|
75
90
|
|
|
76
91
|
app.listen(env.PORT);
|
|
@@ -90,7 +105,6 @@ app.listen(env.PORT);
|
|
|
90
105
|
"description": "",
|
|
91
106
|
"main": "index.js",
|
|
92
107
|
"scripts": {
|
|
93
|
-
"test": "echo \\"Error: no test specified\\" && exit 1",
|
|
94
108
|
"dev": "nodemon src/app.ts",
|
|
95
109
|
"start": "node dist/app.js",
|
|
96
110
|
"build": "rimraf dist && tsc"
|
|
@@ -120,8 +134,9 @@ app.listen(env.PORT);
|
|
|
120
134
|
"target": "ES2017",
|
|
121
135
|
"module": "CommonJS",
|
|
122
136
|
"moduleResolution": "node",
|
|
137
|
+
"experimentalDecorators": true,
|
|
138
|
+
"emitDecoratorMetadata": true,
|
|
123
139
|
"outDir": "./dist",
|
|
124
|
-
"rootDir": "./src",
|
|
125
140
|
"esModuleInterop": true,
|
|
126
141
|
"allowSyntheticDefaultImports": true,
|
|
127
142
|
"forceConsistentCasingInFileNames": true,
|
|
@@ -135,6 +150,7 @@ app.listen(env.PORT);
|
|
|
135
150
|
// create basic service
|
|
136
151
|
// create basic controller
|
|
137
152
|
console.info("Running pnpm install");
|
|
138
|
-
|
|
153
|
+
console.log(`cd ${fname}&& pnpm install`);
|
|
154
|
+
//execSync(`cd ${fname}&& pnpm install && pnpm add @avleon/core`, { stdio: 'inherit' })
|
|
139
155
|
console.info("App create successfully.");
|
|
140
156
|
}
|
package/package.json
CHANGED
package/src/create.ts
CHANGED
|
@@ -38,6 +38,22 @@ const builder = Builder.createAppBuilder();
|
|
|
38
38
|
|
|
39
39
|
// build app
|
|
40
40
|
const app = builder.build();
|
|
41
|
+
|
|
42
|
+
app.useSwagger({
|
|
43
|
+
info: {
|
|
44
|
+
title: "${fname}",
|
|
45
|
+
description: "Your description here",
|
|
46
|
+
version: "0.0.1",
|
|
47
|
+
},
|
|
48
|
+
servers: [
|
|
49
|
+
{
|
|
50
|
+
url: "http://localhost:"+env.PORT,
|
|
51
|
+
description: "Development",
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
|
|
41
57
|
app.mapGet('/', ()=> "Welcome");
|
|
42
58
|
|
|
43
59
|
app.listen(env.PORT);
|
|
@@ -63,7 +79,6 @@ app.listen(env.PORT);
|
|
|
63
79
|
"description": "",
|
|
64
80
|
"main": "index.js",
|
|
65
81
|
"scripts": {
|
|
66
|
-
"test": "echo \\"Error: no test specified\\" && exit 1",
|
|
67
82
|
"dev": "nodemon src/app.ts",
|
|
68
83
|
"start": "node dist/app.js",
|
|
69
84
|
"build": "rimraf dist && tsc"
|
|
@@ -97,8 +112,9 @@ app.listen(env.PORT);
|
|
|
97
112
|
"target": "ES2017",
|
|
98
113
|
"module": "CommonJS",
|
|
99
114
|
"moduleResolution": "node",
|
|
115
|
+
"experimentalDecorators": true,
|
|
116
|
+
"emitDecoratorMetadata": true,
|
|
100
117
|
"outDir": "./dist",
|
|
101
|
-
"rootDir": "./src",
|
|
102
118
|
"esModuleInterop": true,
|
|
103
119
|
"allowSyntheticDefaultImports": true,
|
|
104
120
|
"forceConsistentCasingInFileNames": true,
|
|
@@ -114,7 +130,10 @@ app.listen(env.PORT);
|
|
|
114
130
|
|
|
115
131
|
|
|
116
132
|
console.info("Running pnpm install");
|
|
117
|
-
|
|
133
|
+
|
|
134
|
+
console.log(`cd ${fname}&& pnpm install`);
|
|
135
|
+
|
|
136
|
+
//execSync(`cd ${fname}&& pnpm install && pnpm add @avleon/core`, { stdio: 'inherit' })
|
|
118
137
|
|
|
119
138
|
console.info("App create successfully.");
|
|
120
139
|
|