nodefony 7.0.0-beta.2 → 7.0.0-beta.21
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/CHANGELOG.md +534 -8028
- package/README.md +33 -30
- package/autoloader.es6 +46 -48
- package/builder.es6 +66 -76
- package/cli/builder/bundles/bundle.js +57 -63
- package/cli/builder/bundles/controller.js +34 -38
- package/cli/builder/bundles/users-bundle/Command/fixtureTask.js +11 -12
- package/cli/builder/bundles/users-bundle/Command/usersCommand.js +23 -24
- package/cli/builder/bundles/users-bundle/Entity/mongoose/userEntity.js +25 -30
- package/cli/builder/bundles/users-bundle/Entity/sequelize/userEntity.js +42 -31
- package/cli/builder/bundles/users-bundle/Fixtures/users.js +24 -26
- package/cli/builder/bundles/users-bundle/Fixtures/usersFixtures.js +28 -29
- package/cli/builder/bundles/users-bundle/Resources/config/config.js +4 -3
- package/cli/builder/bundles/users-bundle/Resources/config/routing.js +2 -2
- package/cli/builder/bundles/users-bundle/Resources/config/security.js +9 -8
- package/cli/builder/bundles/users-bundle/Resources/config/webpack/webpack.dev.config.js +3 -3
- package/cli/builder/bundles/users-bundle/Resources/config/webpack/webpack.prod.config.js +4 -3
- package/cli/builder/bundles/users-bundle/Resources/config/webpack.config.js +74 -75
- package/cli/builder/bundles/users-bundle/Resources/scss/awesome/font-awesome.config.js +9 -9
- package/cli/builder/bundles/users-bundle/Resources/swagger/openapi/login.js +13 -13
- package/cli/builder/bundles/users-bundle/Resources/swagger/openapi/users.js +14 -14
- package/cli/builder/bundles/users-bundle/controller/api/graphql/graphqlController.js +13 -15
- package/cli/builder/bundles/users-bundle/controller/api/graphql/userResolver.js +29 -29
- package/cli/builder/bundles/users-bundle/controller/api/graphql/usertype.js +2 -2
- package/cli/builder/bundles/users-bundle/controller/api/openapi/loginApiController.js +34 -36
- package/cli/builder/bundles/users-bundle/controller/api/openapi/restUserController.js +32 -36
- package/cli/builder/bundles/users-bundle/controller/loginController.js +30 -34
- package/cli/builder/bundles/users-bundle/controller/usersController.js +54 -60
- package/cli/builder/bundles/users-bundle/package.json +27 -25
- package/cli/builder/bundles/users-bundle/pnpm-lock.yaml +4262 -0
- package/cli/builder/bundles/users-bundle/readme.md +7 -7
- package/cli/builder/bundles/users-bundle/services/usersService.js +97 -102
- package/cli/builder/bundles/users-bundle/src/providers/mongoose/userProvider.js +6 -8
- package/cli/builder/bundles/users-bundle/src/providers/sequelize/userProvider.js +9 -10
- package/cli/builder/bundles/users-bundle/tests/loginTest.js +119 -70
- package/cli/builder/bundles/users-bundle/usersBundle.js +2 -3
- package/cli/builder/microService/microService.js +139 -141
- package/cli/builder/microService/skeletons/package.json +23 -22
- package/cli/builder/project/project.js +228 -181
- package/cli/builder/project/skeletons/README.md +33 -30
- package/cli/builder/project/skeletons/bin/dev-deploy.sh +5 -0
- package/cli/builder/project/skeletons/bin/prod-deploy.sh +3 -0
- package/cli/builder/project/skeletons/config/config.js.skeleton +1 -0
- package/cli/builder/project/skeletons/config/pm2.config.js.skeleton +41 -17
- package/cli/builder/project/skeletons/eslintignore.skeleton +15 -0
- package/cli/builder/project/skeletons/eslintrc.js.skeleton +97 -0
- package/cli/builder/project/skeletons/gitignore.skeleton +1 -0
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.37.entity-user.js +137 -0
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.38.entity-session.js +97 -0
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.39.entity-requests.js +115 -0
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.40.entity-jwts.js +97 -0
- package/cli/builder/project/skeletons/migrations/migrations.skeleton.js +0 -2
- package/cli/builder/project/skeletons/package.json.twig +70 -0
- package/cli/builder/react/reactBuilder.js +59 -65
- package/cli/builder/sandbox/sandBoxBuilder.js +132 -134
- package/cli/builder/skeletons/app/appKernel.js +120 -2
- package/cli/builder/skeletons/config/config.js +1 -1
- package/cli/builder/skeletons/config/nodefony/framework-bundle.js +2 -1
- package/cli/builder/skeletons/config/nodefony/http-bundle.js +1 -0
- package/cli/builder/skeletons/config/nodefony/mongoose-bundle.js +38 -12
- package/cli/builder/skeletons/config/nodefony/monitoring-bundle.js +21 -2
- package/cli/builder/skeletons/config/nodefony/sequelize-bundle.js +122 -13
- package/cli/builder/skeletons/package.json.twig +57 -0
- package/cli/builder/skeletons/unittest/testFile.js +44 -45
- package/cli/builder/vue/skeletons/vue.config.js +84 -10
- package/cli/builder/vue/vueBuilder.js +116 -114
- package/cli/generate/generate.es6 +38 -39
- package/cli/install/install.js +45 -58
- package/cli/sequelize/sequelize.js +50 -39
- package/cli/start.js +353 -347
- package/cli/tools/pm2.es6 +55 -57
- package/cli/tools/tools.es6 +36 -37
- package/cli.es6 +280 -228
- package/container.es6 +51 -59
- package/error.es6 +25 -27
- package/fileClass.es6 +53 -55
- package/finder/file.es6 +5 -4
- package/finder/fileResult.es6 +23 -22
- package/finder/finder2.es6 +46 -54
- package/finder.es6 +88 -97
- package/kernel/annotations/annotations.es6 +44 -46
- package/kernel/api/api.es6 +6 -8
- package/kernel/api/graphqlApi.es6 +21 -21
- package/kernel/api/jsonApi.es6 +40 -45
- package/kernel/api/openApi.es6 +9 -11
- package/kernel/api/schemas/openApiSchema.js +61 -32
- package/kernel/babylon.es6 +31 -38
- package/kernel/bundle.es6 +252 -220
- package/kernel/cliKernel.es6 +157 -170
- package/kernel/command.es6 +17 -20
- package/kernel/commands/nodefonyCommand.es6 +111 -58
- package/kernel/commands/tasks/bundlesTask.es6 +14 -19
- package/kernel/controllers/controller.es6 +167 -180
- package/kernel/fixture.es6 +4 -7
- package/kernel/injections/injections.es6 +97 -103
- package/kernel/kernel.es6 +476 -384
- package/kernel/kernelWatcher.es6 +64 -54
- package/kernel/orm/entity.es6 +10 -12
- package/kernel/orm/orm.es6 +68 -48
- package/kernel/reader.es6 +45 -47
- package/kernel/security/encoder.es6 +8 -6
- package/kernel/security/factories/factory.es6 +34 -37
- package/kernel/security/factories/passeportFactory.es6 +13 -14
- package/kernel/security/provider.es6 +11 -13
- package/kernel/security/providers/chainProvider.es6 +13 -28
- package/kernel/security/providers/memoryProvider.es6 +7 -11
- package/kernel/security/providers/providerManager.es6 +11 -14
- package/kernel/security/providers/userEntityProvider.es6 +7 -8
- package/kernel/security/role.es6 +3 -3
- package/kernel/security/secureArea.es6 +143 -149
- package/kernel/security/tokens/token.es6 +30 -32
- package/kernel/security/user.es6 +19 -19
- package/kernel/serviceRealTime.es6 +5 -7
- package/kernel/services/connectionsService.es6 +20 -22
- package/kernel/services/cron/cronService.es6 +14 -16
- package/kernel/task.es6 +20 -26
- package/kernel/templates.es6 +4 -5
- package/kernel/templating/twig.es6 +56 -47
- package/kernel/tests/cliTest.js +7 -11
- package/kernel/tests/containerTest.js +25 -37
- package/kernel/tests/kernelTest.js +9 -16
- package/nodefony.es6 +279 -256
- package/notificationsCenter.es6 +28 -20
- package/package.json +40 -40
- package/protocol.es6 +19 -21
- package/protocols/bayeux.es6 +35 -38
- package/protocols/jsonRpc/jsonrpc.es6 +12 -14
- package/result.es6 +11 -12
- package/service.es6 +62 -62
- package/syslog/pdu.es6 +99 -91
- package/syslog/syslog.es6 +101 -102
- package/watcher.es6 +21 -20
- package/cli/builder/project/skeletons/jshintignore.skeleton +0 -1
- package/cli/builder/project/skeletons/jshintrc.skeleton +0 -60
- package/cli/builder/project/skeletons/package.json.skeleton +0 -52
- package/cli/builder/skeletons/package.json +0 -61
package/cli/start.js
CHANGED
|
@@ -4,7 +4,7 @@ let builderTools = null;
|
|
|
4
4
|
let builderPM2 = null;
|
|
5
5
|
let builderSequelize = null;
|
|
6
6
|
try {
|
|
7
|
-
builderInstall = require(path.resolve(__dirname
|
|
7
|
+
builderInstall = require(path.resolve(__dirname, "install", "install.js"));
|
|
8
8
|
builderGenerater = require(path.resolve(__dirname, "generate", "generate.es6"));
|
|
9
9
|
builderTools = require(path.resolve(__dirname, "tools", "tools.es6"));
|
|
10
10
|
builderPM2 = require(path.resolve(__dirname, "tools", "pm2.es6"));
|
|
@@ -14,18 +14,18 @@ try {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
module.exports = class cliStart extends nodefony.cliKernel {
|
|
17
|
-
|
|
18
|
-
constructor() {
|
|
17
|
+
constructor () {
|
|
19
18
|
super("nodefony", null, null, {
|
|
20
19
|
asciify: false,
|
|
21
20
|
autostart: false,
|
|
22
21
|
signals: true,
|
|
22
|
+
commander: true,
|
|
23
23
|
clean: true,
|
|
24
24
|
promiseRejection: true,
|
|
25
25
|
version: nodefony.version,
|
|
26
|
-
events:{
|
|
26
|
+
events: {
|
|
27
27
|
nbListeners: 60,
|
|
28
|
-
captureRejections:true
|
|
28
|
+
captureRejections: true
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
this.choices = [];
|
|
@@ -39,21 +39,24 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
39
39
|
[options] <command:action> [args...]
|
|
40
40
|
[options] <action> [args...]`);
|
|
41
41
|
// EVENTS ACTION
|
|
42
|
-
this.commander.arguments(
|
|
42
|
+
this.commander.arguments("[cmd] [args...]")
|
|
43
43
|
.action((cmd, args, commander) => {
|
|
44
|
-
//this.log(`Commnand : ${cmd} Arguments : ${args}`, "DEBUG", "CLI EVENT ACTION");
|
|
45
|
-
//this.cmd = cmd ? cmd.toLowerCase() : null;
|
|
44
|
+
// this.log(`Commnand : ${cmd} Arguments : ${args}`, "DEBUG", "CLI EVENT ACTION");
|
|
45
|
+
// this.cmd = cmd ? cmd.toLowerCase() : null;
|
|
46
46
|
this.cmd = cmd;
|
|
47
47
|
this.rawCommand = cmd;
|
|
48
48
|
this.args = args;
|
|
49
49
|
return commander;
|
|
50
50
|
});
|
|
51
51
|
// INIT
|
|
52
|
-
this.initialize()
|
|
52
|
+
this.initialize()
|
|
53
|
+
.catch((e) => {
|
|
54
|
+
this.terminate(e.code || 1);
|
|
55
|
+
});
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
async setCommand(cmd, args = []) {
|
|
56
|
-
//this.log(`Commnand : ${cmd} Arguments : ${args}`, "DEBUG", "COMMAND");
|
|
58
|
+
async setCommand (cmd, args = []) {
|
|
59
|
+
// this.log(`Commnand : ${cmd} Arguments : ${args}`, "DEBUG", "COMMAND");
|
|
57
60
|
this.clearCommand();
|
|
58
61
|
if (cmd) {
|
|
59
62
|
process.argv.push(cmd);
|
|
@@ -62,10 +65,10 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
62
65
|
return await this.onStart(this.cmd, this.args);
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
async onStart(cmd = this.cmd, args = this.args) {
|
|
66
|
-
//this.log(`Commnand : ${cmd} Arguments : ${args}`, "DEBUG", "CLI ONSTART");
|
|
67
|
-
this.interactive = this.commander.opts().interactive|| false;
|
|
68
|
-
if (!cmd && !process.argv.slice(2).length &&
|
|
68
|
+
async onStart (cmd = this.cmd, args = this.args) {
|
|
69
|
+
// this.log(`Commnand : ${cmd} Arguments : ${args}`, "DEBUG", "CLI ONSTART");
|
|
70
|
+
this.interactive = this.commander.opts().interactive || false;
|
|
71
|
+
if (!cmd && !process.argv.slice(2).length && !process.argv[2]) {
|
|
69
72
|
this.buildMenu();
|
|
70
73
|
this.interactive = true;
|
|
71
74
|
return this.showMenu()
|
|
@@ -122,32 +125,35 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
122
125
|
}
|
|
123
126
|
return this.terminate(1);
|
|
124
127
|
}
|
|
128
|
+
throw e;
|
|
125
129
|
});
|
|
126
130
|
}
|
|
127
131
|
|
|
128
|
-
async initialize() {
|
|
129
|
-
await super.start()
|
|
132
|
+
async initialize () {
|
|
133
|
+
await super.start();
|
|
130
134
|
this.initHelp();
|
|
131
135
|
this.initOptions();
|
|
132
136
|
await this.parseCommand(process.argv);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
137
|
+
if (process.argv.slice(2).includes("--help") || process.argv.slice(2).includes("-h")) {
|
|
138
|
+
return await this.onStart("help")
|
|
139
|
+
.catch((e) => {
|
|
140
|
+
throw e;
|
|
141
|
+
});
|
|
139
142
|
}
|
|
140
|
-
return await this.onStart()
|
|
143
|
+
return await this.onStart()
|
|
144
|
+
.catch((e) => {
|
|
145
|
+
throw e;
|
|
146
|
+
});
|
|
141
147
|
}
|
|
142
148
|
|
|
143
|
-
/*async onCommand(cmd = this.cmd, args = this.args) {
|
|
149
|
+
/* async onCommand(cmd = this.cmd, args = this.args) {
|
|
144
150
|
//this.cmd = cmd ? cmd.toLowerCase() : null;
|
|
145
151
|
//this.args = args;
|
|
146
152
|
this.parseNodefonyCommand();
|
|
147
153
|
return await this.onStart(cmd, args);
|
|
148
154
|
}*/
|
|
149
155
|
|
|
150
|
-
clearCommand() {
|
|
156
|
+
clearCommand () {
|
|
151
157
|
this.cmd = null;
|
|
152
158
|
this.args.length = 0;
|
|
153
159
|
this.clearNodefonyCommand();
|
|
@@ -156,8 +162,8 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
156
162
|
}
|
|
157
163
|
}
|
|
158
164
|
|
|
159
|
-
initHelp() {
|
|
160
|
-
this.commander.on(
|
|
165
|
+
initHelp () {
|
|
166
|
+
this.commander.on("--help", () => {
|
|
161
167
|
if (!nodefony.isTrunk) {
|
|
162
168
|
this.setTitleHelp(this.clc.cyan("nodefony"));
|
|
163
169
|
this.setHelp("", "create [-i] name [path]", "Create New Nodefony Project");
|
|
@@ -173,17 +179,17 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
173
179
|
});
|
|
174
180
|
}
|
|
175
181
|
|
|
176
|
-
initOptions() {
|
|
177
|
-
this.setOption(
|
|
178
|
-
this.setOption(
|
|
179
|
-
this.setOption(
|
|
180
|
-
this.setOption(
|
|
181
|
-
this.setOption(
|
|
182
|
-
this.setOption(
|
|
183
|
-
this.setOption(
|
|
182
|
+
initOptions () {
|
|
183
|
+
this.setOption("-d, --debug ", "Nodefony debug");
|
|
184
|
+
this.setOption("--no-daemon", "Nodefony Deamon off for production mode (usefull for docker)", true);
|
|
185
|
+
this.setOption("--no-dump", "Nodefony Start don't run Webpack Production Mode", true);
|
|
186
|
+
this.setOption("-h, --help ", "Nodefony help");
|
|
187
|
+
this.setOption("-f, --force ", "Force disable interactive mode");
|
|
188
|
+
this.setOption("-i, --interactive ", "Nodefony cli Interactive Mode");
|
|
189
|
+
this.setOption("-j, --json", "Nodefony json response");
|
|
184
190
|
}
|
|
185
191
|
|
|
186
|
-
showBanner(data) {
|
|
192
|
+
showBanner (data) {
|
|
187
193
|
super.showBanner(data);
|
|
188
194
|
if (nodefony.projectName !== "nodefony") {
|
|
189
195
|
this.log(`WELCOME PROJECT : ${nodefony.projectName} ${nodefony.projectVersion}`);
|
|
@@ -192,16 +198,16 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
192
198
|
}
|
|
193
199
|
}
|
|
194
200
|
|
|
195
|
-
reloadPromt(clear) {
|
|
201
|
+
reloadPromt (clear) {
|
|
196
202
|
if (clear) {
|
|
197
203
|
this.clear();
|
|
198
204
|
}
|
|
199
205
|
this.reloadMenu = true;
|
|
200
|
-
//this.clearCommand();
|
|
206
|
+
// this.clearCommand();
|
|
201
207
|
return Promise.resolve();
|
|
202
208
|
}
|
|
203
209
|
|
|
204
|
-
showMenu(noAscii = false, reload = false) {
|
|
210
|
+
showMenu (noAscii = false, reload = false) {
|
|
205
211
|
if (!noAscii) {
|
|
206
212
|
return this.showAsciify("NODEFONY")
|
|
207
213
|
.then((data) => {
|
|
@@ -215,273 +221,278 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
215
221
|
return this.runMenu(reload);
|
|
216
222
|
}
|
|
217
223
|
|
|
218
|
-
|
|
219
|
-
|
|
224
|
+
// eslint-disable-next-line max-lines-per-function, complexity
|
|
225
|
+
async start (command, args) {
|
|
226
|
+
// this.log(`Commnand : ${command} Arguments : ${args}`, "DEBUG", "CLI START");
|
|
220
227
|
this.started = true;
|
|
221
228
|
switch (command) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
try {
|
|
233
|
-
if (nodefony.isTrunk) {
|
|
234
|
-
return this.rebuild()
|
|
235
|
-
.then((cwd) => {
|
|
236
|
-
this.parseNodefonyCommand("nodefony:rebuild", [cwd]);
|
|
237
|
-
return nodefony.start(command, args, this);
|
|
238
|
-
})
|
|
239
|
-
.then(() => {
|
|
240
|
-
return this.installProject()
|
|
241
|
-
.then(() => {
|
|
242
|
-
return this.buildProject()
|
|
243
|
-
.then((cwd) => {
|
|
244
|
-
this.parseNodefonyCommand("nodefony:build", [cwd]);
|
|
245
|
-
return nodefony.start(command, args, this);
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
this.showHelp();
|
|
251
|
-
this.log("No nodefony trunk detected !", "WARNING");
|
|
252
|
-
break;
|
|
253
|
-
} catch (e) {
|
|
254
|
-
throw e;
|
|
255
|
-
}
|
|
256
|
-
break;
|
|
257
|
-
case "build":
|
|
258
|
-
try {
|
|
259
|
-
if (nodefony.isTrunk) {
|
|
260
|
-
return this.installProject()
|
|
261
|
-
.then(() => {
|
|
262
|
-
return this.buildProject()
|
|
263
|
-
.then((cwd) => {
|
|
264
|
-
this.parseNodefonyCommand("nodefony:build", [cwd]);
|
|
265
|
-
return nodefony.start(command, args, this);
|
|
266
|
-
});
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
this.showHelp();
|
|
270
|
-
this.log("No nodefony trunk detected !", "WARNING");
|
|
271
|
-
break;
|
|
272
|
-
} catch (e) {
|
|
273
|
-
throw e;
|
|
274
|
-
}
|
|
275
|
-
break;
|
|
276
|
-
case "install":
|
|
229
|
+
case "showmenu":
|
|
230
|
+
return this.reloadPromt();
|
|
231
|
+
case "create":
|
|
232
|
+
try {
|
|
233
|
+
return this.createProject(command, args, this.interactive);
|
|
234
|
+
} catch (e) {
|
|
235
|
+
throw e;
|
|
236
|
+
}
|
|
237
|
+
case "rebuild":
|
|
238
|
+
try {
|
|
277
239
|
if (nodefony.isTrunk) {
|
|
278
|
-
return this.
|
|
279
|
-
.then((
|
|
240
|
+
return this.rebuild(path.resolve("."), args, this.interactive)
|
|
241
|
+
.then((cwd) => {
|
|
242
|
+
this.parseNodefonyCommand("nodefony:rebuild", [cwd, args, this.interactive]);
|
|
280
243
|
return nodefony.start(command, args, this)
|
|
281
|
-
.then((...args) => {
|
|
282
|
-
return args;
|
|
283
|
-
})
|
|
284
244
|
.catch((e) => {
|
|
285
245
|
throw e;
|
|
286
246
|
});
|
|
287
|
-
})
|
|
247
|
+
})
|
|
248
|
+
.then(() => this.installProject(path.resolve("."), args, this.interactive)
|
|
249
|
+
.then(() => this.buildProject(path.resolve("."), args, this.interactive)
|
|
250
|
+
.then((cwd) => {
|
|
251
|
+
this.parseNodefonyCommand("nodefony:build", [cwd, args, this.interactive]);
|
|
252
|
+
return nodefony.start(command, args, this)
|
|
253
|
+
.catch((e) => {
|
|
254
|
+
throw e;
|
|
255
|
+
});
|
|
256
|
+
})));
|
|
288
257
|
}
|
|
289
258
|
this.showHelp();
|
|
290
259
|
this.log("No nodefony trunk detected !", "WARNING");
|
|
291
260
|
break;
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
261
|
+
} catch (e) {
|
|
262
|
+
throw e;
|
|
263
|
+
}
|
|
264
|
+
break;
|
|
265
|
+
case "build":
|
|
266
|
+
try {
|
|
267
|
+
if (nodefony.isTrunk) {
|
|
268
|
+
return this.installProject(path.resolve("."), args, this.interactive)
|
|
269
|
+
.then(() => this.buildProject(path.resolve("."), args, this.interactive)
|
|
270
|
+
.then((cwd) => {
|
|
271
|
+
this.parseNodefonyCommand("nodefony:build", [cwd, args, this.interactive]);
|
|
272
|
+
return nodefony.start(command, args, this)
|
|
273
|
+
.catch((e) => {
|
|
274
|
+
throw e;
|
|
275
|
+
});
|
|
276
|
+
}));
|
|
297
277
|
}
|
|
278
|
+
this.showHelp();
|
|
279
|
+
this.log("No nodefony trunk detected !", "WARNING");
|
|
298
280
|
break;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
281
|
+
} catch (e) {
|
|
282
|
+
throw e;
|
|
283
|
+
}
|
|
284
|
+
break;
|
|
285
|
+
case "install":
|
|
286
|
+
if (nodefony.isTrunk) {
|
|
287
|
+
return this.installProject(path.resolve("."), args, this.interactive)
|
|
288
|
+
.then((...args) => nodefony.start(command, args, this)
|
|
289
|
+
.then((...args) => args)
|
|
290
|
+
.catch((e) => {
|
|
291
|
+
throw e;
|
|
292
|
+
}));
|
|
293
|
+
}
|
|
294
|
+
this.showHelp();
|
|
295
|
+
this.log("No nodefony trunk detected !", "WARNING");
|
|
296
|
+
break;
|
|
297
|
+
case "version":
|
|
298
|
+
try {
|
|
299
|
+
return process.stdout.write(nodefony.version);
|
|
300
|
+
} catch (e) {
|
|
301
|
+
throw e;
|
|
302
|
+
}
|
|
303
|
+
break;
|
|
304
|
+
case "help":
|
|
305
|
+
if (!nodefony.isTrunk) {
|
|
306
|
+
return this.showHelp();
|
|
307
|
+
}
|
|
308
|
+
return await nodefony.start(command, args, this)
|
|
309
|
+
.then(() => this.showHelp())
|
|
310
|
+
.catch((e) => {
|
|
311
|
+
this.showHelp();
|
|
312
|
+
if (command === "help") {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
throw e;
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
break;
|
|
319
|
+
case "certificates":
|
|
320
|
+
return this.generateCertificates();
|
|
321
|
+
default:
|
|
322
|
+
this.parseNodefonyCommand(command, args);
|
|
323
|
+
if (nodefony.isTrunk) {
|
|
324
|
+
try {
|
|
325
|
+
if (this.kernel) {
|
|
326
|
+
return this.matchCommand();
|
|
327
|
+
}
|
|
303
328
|
return await nodefony.start(command, args, this)
|
|
304
|
-
.
|
|
305
|
-
|
|
306
|
-
})
|
|
307
|
-
.catch(() => {
|
|
308
|
-
return this.showHelp();
|
|
329
|
+
.catch((e) => {
|
|
330
|
+
throw e;
|
|
309
331
|
});
|
|
310
|
-
}
|
|
311
|
-
break;
|
|
312
|
-
case "certificates":
|
|
313
|
-
return this.generateCertificates();
|
|
314
|
-
default:
|
|
315
|
-
this.parseNodefonyCommand(command, args);
|
|
316
|
-
if (nodefony.isTrunk) {
|
|
332
|
+
} catch (e) {
|
|
317
333
|
try {
|
|
318
|
-
if (this.
|
|
319
|
-
return this.
|
|
334
|
+
if (this.rawCommand) {
|
|
335
|
+
// return require(path.resolve(this.rawCommand));
|
|
336
|
+
} else {
|
|
337
|
+
// this.showHelp();
|
|
320
338
|
}
|
|
321
|
-
|
|
339
|
+
throw e;
|
|
322
340
|
} catch (e) {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
throw e;
|
|
330
|
-
} catch (e) {
|
|
331
|
-
//this.showHelp();
|
|
332
|
-
//this.log(`Command Not Found ${this.cmd} ${this.args}`, "ERROR");
|
|
333
|
-
//this.log(e, "ERROR", "MODULE");
|
|
334
|
-
//this.terminate(1);
|
|
335
|
-
throw e;
|
|
336
|
-
}
|
|
341
|
+
// this.showHelp();
|
|
342
|
+
// this.log(`Command Not Found ${this.cmd} ${this.args}`, "ERROR");
|
|
343
|
+
// this.log(e, "ERROR", "MODULE");
|
|
344
|
+
// this.terminate(1);
|
|
345
|
+
throw e;
|
|
337
346
|
}
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
if (this.rawCommand) {
|
|
344
|
-
//return require(path.resolve(this.rawCommand));
|
|
345
|
-
} else {
|
|
346
|
-
//return this.showHelp();
|
|
347
|
-
}
|
|
348
|
-
throw e;
|
|
349
|
-
} catch (e) {
|
|
350
|
-
//this.showHelp();
|
|
351
|
-
//this.log(`Command Not Found ${this.cmd} ${this.args}`, "ERROR");
|
|
352
|
-
//this.log(e, "ERROR", "MODULE");
|
|
353
|
-
//this.terminate(1);
|
|
347
|
+
}
|
|
348
|
+
} else {
|
|
349
|
+
try {
|
|
350
|
+
return await nodefony.start(this.rawCommand, args, this)
|
|
351
|
+
.catch((e) => {
|
|
354
352
|
throw e;
|
|
353
|
+
});
|
|
354
|
+
} catch (e) {
|
|
355
|
+
try {
|
|
356
|
+
if (this.rawCommand) {
|
|
357
|
+
// return require(path.resolve(this.rawCommand));
|
|
358
|
+
} else {
|
|
359
|
+
// return this.showHelp();
|
|
355
360
|
}
|
|
361
|
+
throw e;
|
|
362
|
+
} catch (e) {
|
|
363
|
+
// this.showHelp();
|
|
364
|
+
// this.log(`Command Not Found ${this.cmd} ${this.args}`, "ERROR");
|
|
365
|
+
// this.log(e, "ERROR", "MODULE");
|
|
366
|
+
// this.terminate(1);
|
|
367
|
+
throw e;
|
|
356
368
|
}
|
|
357
369
|
}
|
|
370
|
+
}
|
|
358
371
|
}
|
|
359
372
|
}
|
|
360
373
|
|
|
361
|
-
buildMenu() {
|
|
362
|
-
this.generateString =
|
|
374
|
+
buildMenu () {
|
|
375
|
+
this.generateString = "Generater";
|
|
363
376
|
this.startString = "Start Servers";
|
|
364
377
|
if (nodefony.isTrunk) {
|
|
365
378
|
if (nodefony.builded) {
|
|
366
379
|
this.choices.push(`${this.startString} Development`);
|
|
367
380
|
this.choices.push(`${this.startString} Pre-Production`);
|
|
368
381
|
this.choices.push(`${this.startString} Production`);
|
|
369
|
-
this.choices.push(
|
|
370
|
-
this.choices.push(
|
|
371
|
-
this.choices.push(
|
|
372
|
-
this.choices.push(
|
|
382
|
+
this.choices.push("Install Project");
|
|
383
|
+
this.choices.push("Build Project");
|
|
384
|
+
this.choices.push("Rebuild Project");
|
|
385
|
+
this.choices.push("Sequelize");
|
|
373
386
|
this.choices.push(`${this.generateString}`);
|
|
374
|
-
this.choices.push(
|
|
375
|
-
this.choices.push(
|
|
376
|
-
this.choices.push(
|
|
387
|
+
this.choices.push("Tools");
|
|
388
|
+
this.choices.push("PM2 Tools");
|
|
389
|
+
this.choices.push("Run Test");
|
|
377
390
|
} else {
|
|
378
|
-
this.choices.push(
|
|
391
|
+
this.choices.push("Build Project");
|
|
379
392
|
this.choices.push(`${this.generateString}`);
|
|
380
|
-
this.choices.push(
|
|
381
|
-
this.choices.push(
|
|
393
|
+
this.choices.push("Tools");
|
|
394
|
+
this.choices.push("PM2 Tools");
|
|
382
395
|
}
|
|
383
396
|
} else {
|
|
384
|
-
this.choices.push(
|
|
385
|
-
this.choices.push(
|
|
386
|
-
this.choices.push(
|
|
397
|
+
this.choices.push("Create Nodefony Web Project");
|
|
398
|
+
this.choices.push("Create Micro Service Project");
|
|
399
|
+
this.choices.push("PM2 Tools");
|
|
387
400
|
}
|
|
388
401
|
this.choices.push(this.getSeparator());
|
|
389
402
|
this.choices.push("Help");
|
|
390
403
|
this.choices.push("Quit");
|
|
391
404
|
}
|
|
392
405
|
|
|
393
|
-
interaction(choices) {
|
|
406
|
+
interaction (choices) {
|
|
394
407
|
return this.prompt([{
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
}
|
|
408
|
+
type: "list",
|
|
409
|
+
name: "command",
|
|
410
|
+
message: " Nodefony CLI : ",
|
|
411
|
+
default: 0, // (choices.length - 1),
|
|
412
|
+
pageSize: choices.length,
|
|
413
|
+
choices,
|
|
414
|
+
filter: (val) => {
|
|
415
|
+
switch (val) {
|
|
416
|
+
case "Quit":
|
|
417
|
+
return "exit";
|
|
418
|
+
case "Help":
|
|
419
|
+
return "help";
|
|
420
|
+
case `${this.startString} Development`:
|
|
421
|
+
return "development";
|
|
422
|
+
case `${this.startString} Production`:
|
|
423
|
+
return "production";
|
|
424
|
+
case `${this.startString} Pre-Production`:
|
|
425
|
+
return "pre-production";
|
|
426
|
+
case "Create Nodefony Web Project":
|
|
427
|
+
return "project";
|
|
428
|
+
case "Create Micro Service Project":
|
|
429
|
+
return "microservice";
|
|
430
|
+
case `${this.generateString}`:
|
|
431
|
+
return "generate";
|
|
432
|
+
case "Sequelize":
|
|
433
|
+
return "sequelize";
|
|
434
|
+
case "Run Test":
|
|
435
|
+
return "test";
|
|
436
|
+
case "Install":
|
|
437
|
+
case "Install Framework":
|
|
438
|
+
case "Install Project":
|
|
439
|
+
return "install";
|
|
440
|
+
case "Build":
|
|
441
|
+
case "Build Project":
|
|
442
|
+
return "build";
|
|
443
|
+
case "Rebuild Project":
|
|
444
|
+
return "rebuild";
|
|
445
|
+
case "PM2 Tools":
|
|
446
|
+
return "pm2";
|
|
447
|
+
case "Tools":
|
|
448
|
+
return "tools";
|
|
449
|
+
default:
|
|
450
|
+
console.log("\n");
|
|
451
|
+
this.log(`command not found : ${val}`, "INFO");
|
|
452
|
+
this.terminate(1);
|
|
441
453
|
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
});
|
|
454
|
+
}
|
|
455
|
+
}])
|
|
456
|
+
.then((response) => nodefony.extend(this.response, response));
|
|
446
457
|
}
|
|
447
458
|
|
|
448
|
-
runMenu(reload = false) {
|
|
459
|
+
runMenu (reload = false) {
|
|
449
460
|
return this.interaction(this.choices)
|
|
450
461
|
.then(() => {
|
|
451
462
|
this.reloadMenu = reload || this.reloadMenu;
|
|
452
463
|
switch (this.response.command) {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
//return this.setCommand(null, ["-h"]);
|
|
464
|
+
case "project":
|
|
465
|
+
return this.createProject(null, null, true);
|
|
466
|
+
case "microservice":
|
|
467
|
+
return this.createMicroService(null, null, true);
|
|
468
|
+
case "rebuild":
|
|
469
|
+
return this.setCommand("rebuild");
|
|
470
|
+
case "build":
|
|
471
|
+
return this.setCommand("build");
|
|
472
|
+
case "install":
|
|
473
|
+
return this.setCommand("install");
|
|
474
|
+
case "generate":
|
|
475
|
+
return this.generateCli(true);
|
|
476
|
+
case "sequelize":
|
|
477
|
+
return this.sequelizeCli(true);
|
|
478
|
+
case "pm2":
|
|
479
|
+
return this.pm2Cli(true);
|
|
480
|
+
case "tools":
|
|
481
|
+
return this.toolsCli(true);
|
|
482
|
+
case "development":
|
|
483
|
+
return this.setCommand("development");
|
|
484
|
+
case "production":
|
|
485
|
+
return this.setCommand("production");
|
|
486
|
+
case "pre-production":
|
|
487
|
+
return this.setCommand("preprod");
|
|
488
|
+
case "test":
|
|
489
|
+
return this.setCommand("unitest:launch:all");
|
|
490
|
+
case "exit":
|
|
491
|
+
this.log("QUIT");
|
|
492
|
+
return this.terminate(0);
|
|
493
|
+
default:
|
|
494
|
+
return this.setCommand("help");
|
|
495
|
+
// return this.setCommand(null, ["-h"]);
|
|
485
496
|
}
|
|
486
497
|
})
|
|
487
498
|
.catch((e) => {
|
|
@@ -489,73 +500,67 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
489
500
|
});
|
|
490
501
|
}
|
|
491
502
|
|
|
492
|
-
gitInit(project, response) {
|
|
503
|
+
gitInit (project, response) {
|
|
493
504
|
let gitP, cwd, git;
|
|
494
505
|
try {
|
|
495
506
|
cwd = path.resolve(project.location, project.name);
|
|
496
|
-
gitP = require(
|
|
507
|
+
gitP = require("simple-git");
|
|
497
508
|
git = gitP(cwd);
|
|
498
509
|
} catch (e) {
|
|
499
510
|
throw e;
|
|
500
511
|
}
|
|
501
512
|
return git.init()
|
|
502
|
-
.then(() =>
|
|
503
|
-
|
|
504
|
-
.then(() =>
|
|
505
|
-
|
|
506
|
-
.then(() => {
|
|
507
|
-
return git.addConfig('user.email', response.authorMail)
|
|
508
|
-
.then(() => {
|
|
509
|
-
return git.commit("first commit!");
|
|
510
|
-
});
|
|
511
|
-
});
|
|
512
|
-
});
|
|
513
|
-
});
|
|
513
|
+
.then(() => git.add(path.resolve(cwd, "*"))
|
|
514
|
+
.then(() => git.addConfig("user.name", response.authorFullName)
|
|
515
|
+
.then(() => git.addConfig("user.email", response.authorMail)
|
|
516
|
+
.then(() => git.commit("first commit!")))));
|
|
514
517
|
}
|
|
515
518
|
|
|
516
|
-
createProject(command, args, interactive = false) {
|
|
519
|
+
createProject (command, args, interactive = false) {
|
|
517
520
|
try {
|
|
518
521
|
if (command === "create") {
|
|
519
522
|
if (!args[0]) {
|
|
520
523
|
args[0] = "nodefony-starter";
|
|
521
524
|
}
|
|
522
525
|
}
|
|
523
|
-
|
|
526
|
+
const project = new nodefony.builders.project(this, command, args);
|
|
524
527
|
return project.run(interactive)
|
|
525
|
-
.then((obj) =>
|
|
526
|
-
|
|
527
|
-
.
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
.then(() => {
|
|
533
|
-
|
|
534
|
-
.
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
return nodefony.start(command, args, this);
|
|
539
|
-
} catch (e) {
|
|
528
|
+
.then((obj) => this.gitInit(project, obj.response)
|
|
529
|
+
.then(() => {
|
|
530
|
+
const cwd = path.resolve(project.location, project.name);
|
|
531
|
+
this.log(`Create Project ${obj.response.name} complete`, "INFO");
|
|
532
|
+
this.cd(cwd);
|
|
533
|
+
return this.installProject(cwd, args, interactive)
|
|
534
|
+
.then(() => this.buildProject(cwd, args, interactive)
|
|
535
|
+
.then((cwd) => {
|
|
536
|
+
try {
|
|
537
|
+
nodefony.checkTrunk(cwd);
|
|
538
|
+
this.parseNodefonyCommand("nodefony:build", [cwd, args, interactive]);
|
|
539
|
+
return nodefony.start(command, args, this)
|
|
540
|
+
.catch((e) => {
|
|
540
541
|
throw e;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
542
|
+
});
|
|
543
|
+
} catch (e) {
|
|
544
|
+
throw e;
|
|
545
|
+
}
|
|
546
|
+
})
|
|
547
|
+
.catch((e) => {
|
|
547
548
|
this.log(e, "ERROR");
|
|
548
549
|
throw e;
|
|
549
|
-
})
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
550
|
+
}))
|
|
551
|
+
.catch((e) => {
|
|
552
|
+
this.log(e, "ERROR");
|
|
553
|
+
throw e;
|
|
554
|
+
});
|
|
555
|
+
})
|
|
556
|
+
.catch((e) => {
|
|
557
|
+
if (e.code || e.code === 0) {
|
|
558
|
+
this.log(e, "INFO");
|
|
559
|
+
this.terminate(e.code);
|
|
560
|
+
}
|
|
561
|
+
this.log(e, "ERROR");
|
|
562
|
+
this.terminate(e.code || 1);
|
|
563
|
+
}))
|
|
559
564
|
.catch((e) => {
|
|
560
565
|
throw e;
|
|
561
566
|
});
|
|
@@ -564,33 +569,31 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
564
569
|
}
|
|
565
570
|
}
|
|
566
571
|
|
|
567
|
-
createMicroService(command, args, interactive = false){
|
|
568
|
-
|
|
572
|
+
createMicroService (command, args, interactive = false) {
|
|
573
|
+
const microService = new nodefony.builders.microService(this, command, args);
|
|
569
574
|
return microService.run(interactive)
|
|
570
|
-
.then((obj) =>
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
let cwd = path.resolve(microService.location, microService.name);
|
|
575
|
+
.then((obj) => this.gitInit(microService, obj.response)
|
|
576
|
+
.then(() => {
|
|
577
|
+
const cwd = path.resolve(microService.location, microService.name);
|
|
574
578
|
this.log(`Nodefony Micro Service ${obj.response.name} complete`, "INFO");
|
|
575
579
|
this.cd(cwd);
|
|
576
580
|
return this.npm(["install"], cwd)
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
}).catch(e =>{
|
|
581
|
+
.then(() => this.generateCertificates(cwd)
|
|
582
|
+
.then(() => {
|
|
583
|
+
this.log(`cd ${obj.response.name}`);
|
|
584
|
+
this.log("npm start");
|
|
585
|
+
return cwd;
|
|
586
|
+
}));
|
|
587
|
+
})
|
|
588
|
+
.catch((e) => {
|
|
586
589
|
if (e.code || e.code === 0) {
|
|
587
590
|
this.log(e, "INFO");
|
|
588
591
|
this.terminate(e.code);
|
|
589
592
|
}
|
|
590
593
|
this.log(e, "ERROR");
|
|
591
594
|
this.terminate(e.code || 1);
|
|
592
|
-
})
|
|
593
|
-
|
|
595
|
+
}))
|
|
596
|
+
.catch((e) => {
|
|
594
597
|
if (e.code || e.code === 0) {
|
|
595
598
|
this.log(e, "INFO");
|
|
596
599
|
this.terminate(e.code);
|
|
@@ -600,14 +603,15 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
600
603
|
});
|
|
601
604
|
}
|
|
602
605
|
|
|
603
|
-
installProject(cwd = path.resolve(".")) {
|
|
606
|
+
installProject (cwd = path.resolve("."), args, interactive = false) {
|
|
604
607
|
try {
|
|
605
|
-
|
|
606
|
-
return installer.install(cwd)
|
|
608
|
+
const installer = new builderInstall(this);
|
|
609
|
+
return installer.install(cwd, args, interactive)
|
|
607
610
|
.then((ret) => {
|
|
608
611
|
this.log("Install Complete");
|
|
609
612
|
return ret;
|
|
610
|
-
})
|
|
613
|
+
})
|
|
614
|
+
.catch((e) => {
|
|
611
615
|
this.log(e, "ERROR");
|
|
612
616
|
throw e;
|
|
613
617
|
});
|
|
@@ -617,14 +621,15 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
617
621
|
}
|
|
618
622
|
}
|
|
619
623
|
|
|
620
|
-
rebuild(cwd = path.resolve(".")) {
|
|
624
|
+
rebuild (cwd = path.resolve("."), args, interactive = false) {
|
|
621
625
|
try {
|
|
622
|
-
|
|
623
|
-
return installer.rebuild(cwd)
|
|
626
|
+
const installer = new builderInstall(this);
|
|
627
|
+
return installer.rebuild(cwd, args, interactive)
|
|
624
628
|
.then((ret) => {
|
|
625
629
|
this.log(`Rebuild Complete : ${cwd}`);
|
|
626
630
|
return ret;
|
|
627
|
-
})
|
|
631
|
+
})
|
|
632
|
+
.catch((e) => {
|
|
628
633
|
this.log(e, "ERROR");
|
|
629
634
|
throw e;
|
|
630
635
|
});
|
|
@@ -634,14 +639,15 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
634
639
|
}
|
|
635
640
|
}
|
|
636
641
|
|
|
637
|
-
buildProject(cwd = path.resolve(".")) {
|
|
642
|
+
buildProject (cwd = path.resolve("."), args, interactive) {
|
|
638
643
|
try {
|
|
639
|
-
|
|
640
|
-
return installer.build(cwd)
|
|
644
|
+
const installer = new builderInstall(this);
|
|
645
|
+
return installer.build(cwd, args, interactive)
|
|
641
646
|
.then((ret) => {
|
|
642
647
|
this.log("Build Complete");
|
|
643
648
|
return ret;
|
|
644
|
-
})
|
|
649
|
+
})
|
|
650
|
+
.catch((e) => {
|
|
645
651
|
this.log(e, "ERROR");
|
|
646
652
|
throw e;
|
|
647
653
|
});
|
|
@@ -651,39 +657,40 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
651
657
|
}
|
|
652
658
|
}
|
|
653
659
|
|
|
654
|
-
generateCli(interactive) {
|
|
655
|
-
|
|
660
|
+
generateCli (interactive) {
|
|
661
|
+
const generater = new builderGenerater(this);
|
|
656
662
|
return generater.run(interactive);
|
|
657
663
|
}
|
|
658
664
|
|
|
659
|
-
toolsCli(interactive) {
|
|
660
|
-
|
|
665
|
+
toolsCli (interactive) {
|
|
666
|
+
const generater = new builderTools(this);
|
|
661
667
|
return generater.run(interactive);
|
|
662
668
|
}
|
|
663
669
|
|
|
664
|
-
pm2Cli(interactive) {
|
|
665
|
-
|
|
670
|
+
pm2Cli (interactive) {
|
|
671
|
+
const generater = new builderPM2(this);
|
|
666
672
|
return generater.run(interactive);
|
|
667
673
|
}
|
|
668
674
|
|
|
669
|
-
sequelizeCli(interactive){
|
|
670
|
-
|
|
675
|
+
sequelizeCli (interactive) {
|
|
676
|
+
const generater = new builderSequelize(this);
|
|
671
677
|
return generater.run(interactive);
|
|
672
678
|
}
|
|
673
679
|
|
|
674
|
-
generateCertificates(cwd = path.resolve(".")) {
|
|
680
|
+
generateCertificates (cwd = path.resolve(".")) {
|
|
675
681
|
try {
|
|
676
|
-
|
|
682
|
+
const installer = new builderInstall(this);
|
|
677
683
|
return installer.generateCertificates(cwd)
|
|
678
684
|
.then(() => {
|
|
679
|
-
|
|
680
|
-
|
|
685
|
+
const directory = path.resolve(cwd, "config", "certificates");
|
|
686
|
+
const config = path.resolve(cwd, "config", "openssl");
|
|
681
687
|
this.log(`Certificates build with config : ${config}`);
|
|
682
|
-
|
|
688
|
+
const res = this.ls(directory);
|
|
683
689
|
this.log(`See Generated Certificates in directory : ${directory} \n${res.stdout}`);
|
|
684
690
|
this.log("Generate Certificates Complete");
|
|
685
691
|
return cwd;
|
|
686
|
-
})
|
|
692
|
+
})
|
|
693
|
+
.catch((e) => {
|
|
687
694
|
this.log(e, "ERROR");
|
|
688
695
|
throw e;
|
|
689
696
|
});
|
|
@@ -692,5 +699,4 @@ module.exports = class cliStart extends nodefony.cliKernel {
|
|
|
692
699
|
throw e;
|
|
693
700
|
}
|
|
694
701
|
}
|
|
695
|
-
|
|
696
702
|
};
|