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
|
@@ -9,59 +9,79 @@
|
|
|
9
9
|
* kernel : instance of kernel who launch the test
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
const assert = require(
|
|
12
|
+
const assert = require("assert");
|
|
13
|
+
const http = require("node:http");
|
|
14
|
+
const https = require("node:https");
|
|
13
15
|
|
|
14
16
|
describe("BUNDLE users", () => {
|
|
15
|
-
|
|
16
17
|
before(() => {
|
|
17
|
-
//for example
|
|
18
|
+
// for example
|
|
18
19
|
assert.equal(typeof nodefony, "object");
|
|
19
20
|
// check instance kernel
|
|
20
21
|
assert.equal(typeof kernel, "object");
|
|
21
|
-
//assert.equal(kernel instanceof nodefony.kernel, true);
|
|
22
|
-
// requests tools
|
|
23
|
-
const Request = kernel.get("requestClient");
|
|
24
22
|
const serviceHttps = kernel.get("httpsServer");
|
|
25
23
|
const openssl = serviceHttps.getCertificats();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
global.baseUrl = `https://${kernel.settings.system.domain}:${kernel.settings.system.httpsPort}/api/jwt`;
|
|
25
|
+
const request = kernel.get("fetch");
|
|
26
|
+
global.fetch = request.fetch;
|
|
27
|
+
global.formData = request.library.FormData;
|
|
28
|
+
global.Headers = request.library.Headers;
|
|
29
|
+
const httpAgent = new http.Agent({
|
|
30
|
+
keepAlive: true
|
|
31
|
+
});
|
|
32
|
+
const httpsAgent = new https.Agent({
|
|
33
|
+
keepAlive: true,
|
|
34
|
+
key: openssl.key,
|
|
35
|
+
cert: openssl.cert,
|
|
36
|
+
ca: openssl.ca
|
|
37
|
+
});
|
|
38
|
+
global.options = {
|
|
39
|
+
agent (_parsedURL) {
|
|
40
|
+
if (_parsedURL.protocol == "http:") {
|
|
41
|
+
return httpAgent;
|
|
42
|
+
}
|
|
43
|
+
return httpsAgent;
|
|
41
44
|
}
|
|
42
45
|
};
|
|
43
|
-
global.baseUrl = `https://${kernel.settings.system.domain}:${kernel.settings.system.httpsPort}/api/jwt`;
|
|
44
|
-
const request = Request.create(global.baseUrl, requestOptions);
|
|
45
|
-
global.http = request.http.bind(request);
|
|
46
|
-
|
|
47
46
|
});
|
|
48
47
|
|
|
49
|
-
describe(
|
|
48
|
+
describe("API LOGIN", () => {
|
|
50
49
|
beforeEach(() => {});
|
|
51
50
|
before(() => {});
|
|
51
|
+
|
|
52
52
|
it("LOGIN JWT", async () => {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
// const formData = new global.FormData()
|
|
54
|
+
// formData.set('username', 'admin')
|
|
55
|
+
// formData.set('passwd', 'admin')
|
|
56
|
+
|
|
57
|
+
const meta = {
|
|
58
|
+
// 'Content-Type': 'application/json',
|
|
59
|
+
// "Accept":"application/json"
|
|
60
|
+
};
|
|
61
|
+
const headers = new global.Headers(meta);
|
|
62
|
+
const params = new URLSearchParams();
|
|
63
|
+
params.append("username", "admin");
|
|
64
|
+
params.append("passwd", "admin");
|
|
65
|
+
// console.log(formData)
|
|
66
|
+
const options = nodefony.extend({
|
|
67
|
+
method: "POST",
|
|
68
|
+
headers,
|
|
69
|
+
body: params
|
|
70
|
+
|
|
71
|
+
/* body: JSON.stringify({
|
|
72
|
+
username: "admin",
|
|
73
|
+
passwd: "admin"
|
|
74
|
+
})*/
|
|
75
|
+
}, global.options);
|
|
76
|
+
// console.log(formData)
|
|
77
|
+
const url = `${global.baseUrl}/login`;
|
|
78
|
+
// let url = "https://127.0.0.1:5152/api/jwt/login"
|
|
79
|
+
const response = await global.fetch(url, options)
|
|
80
|
+
.catch((e) => {
|
|
81
|
+
console.log(e);
|
|
61
82
|
throw e;
|
|
62
83
|
});
|
|
63
|
-
|
|
64
|
-
const body = JSON.parse(result.json.body);
|
|
84
|
+
const body = await response.json();
|
|
65
85
|
assert(body.result);
|
|
66
86
|
assert(body.result.token);
|
|
67
87
|
global.token = body.result.token;
|
|
@@ -73,60 +93,89 @@ describe("BUNDLE users", () => {
|
|
|
73
93
|
assert(body.result.decodedToken.exp);
|
|
74
94
|
assert.strictEqual(body.api, "login-api");
|
|
75
95
|
assert.strictEqual(body.code, 200);
|
|
76
|
-
assert.strictEqual(body.message,
|
|
96
|
+
assert.strictEqual(body.message, "OK");
|
|
77
97
|
assert.strictEqual(body.messageId, null);
|
|
78
|
-
//assert.strictEqual(body.error, undefined);
|
|
79
|
-
//assert.strictEqual(body.errorCode, undefined);
|
|
98
|
+
// assert.strictEqual(body.error, undefined);
|
|
99
|
+
// assert.strictEqual(body.errorCode, undefined);
|
|
80
100
|
assert.strictEqual(body.url, `${global.baseUrl}/login`);
|
|
81
|
-
assert.strictEqual(body.method,
|
|
82
|
-
assert.strictEqual(body.scheme,
|
|
83
|
-
assert.strictEqual(body.severity,
|
|
101
|
+
assert.strictEqual(body.method, "POST");
|
|
102
|
+
assert.strictEqual(body.scheme, "https");
|
|
103
|
+
assert.strictEqual(body.severity, "INFO");
|
|
84
104
|
assert.strictEqual(body.code, 200);
|
|
85
105
|
});
|
|
86
106
|
|
|
87
107
|
it("BAD PASSWD LOGIN JWT ", async () => {
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
108
|
+
const meta = {
|
|
109
|
+
"Content-Type": "application/json",
|
|
110
|
+
"Accept": "application/json"
|
|
111
|
+
};
|
|
112
|
+
const headers = new global.Headers(meta);
|
|
113
|
+
const url = `${global.baseUrl}/login`;
|
|
114
|
+
const options = nodefony.extend({
|
|
115
|
+
method: "POST",
|
|
116
|
+
headers,
|
|
117
|
+
body: JSON.stringify({
|
|
118
|
+
username: "admin",
|
|
119
|
+
passwd: "testfalse"
|
|
94
120
|
})
|
|
95
|
-
|
|
121
|
+
}, global.options);
|
|
122
|
+
const response = await global.fetch(url, options)
|
|
123
|
+
.catch((e) => {
|
|
124
|
+
console.log(e);
|
|
96
125
|
throw e;
|
|
97
126
|
});
|
|
98
|
-
|
|
99
|
-
|
|
127
|
+
const body = await response.json();
|
|
128
|
+
assert.strictEqual(body.code, 401);
|
|
129
|
+
assert(body.error);
|
|
100
130
|
});
|
|
131
|
+
|
|
101
132
|
it("BAD NAME LOGIN JWT ", async () => {
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
133
|
+
const meta = {
|
|
134
|
+
"Content-Type": "application/json",
|
|
135
|
+
"Accept": "application/json"
|
|
136
|
+
};
|
|
137
|
+
const headers = new global.Headers(meta);
|
|
138
|
+
const url = `${global.baseUrl}/login`;
|
|
139
|
+
const options = nodefony.extend({
|
|
140
|
+
method: "POST",
|
|
141
|
+
headers,
|
|
142
|
+
body: JSON.stringify({
|
|
143
|
+
username: "badname",
|
|
144
|
+
passwd: "admin"
|
|
108
145
|
})
|
|
109
|
-
|
|
146
|
+
}, global.options);
|
|
147
|
+
const response = await global.fetch(url, options)
|
|
148
|
+
.catch((e) => {
|
|
149
|
+
console.log(e);
|
|
110
150
|
throw e;
|
|
111
151
|
});
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
assert.strictEqual(body.message, "User : badname not Found");
|
|
152
|
+
const body = await response.json();
|
|
153
|
+
assert.strictEqual(body.code, 404);
|
|
154
|
+
assert.strictEqual(body.error.message, "User : badname not Found");
|
|
115
155
|
});
|
|
116
156
|
|
|
117
157
|
it("BAD LOGIN NO credentials ", async () => {
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
158
|
+
const meta = {
|
|
159
|
+
"Content-Type": "application/json",
|
|
160
|
+
"Accept": "application/json"
|
|
161
|
+
};
|
|
162
|
+
const headers = new global.Headers(meta);
|
|
163
|
+
const url = `${global.baseUrl}/login`;
|
|
164
|
+
const options = nodefony.extend({
|
|
165
|
+
method: "POST",
|
|
166
|
+
headers,
|
|
167
|
+
body: JSON.stringify({
|
|
168
|
+
|
|
121
169
|
})
|
|
122
|
-
|
|
170
|
+
}, global.options);
|
|
171
|
+
const response = await global.fetch(url, options)
|
|
172
|
+
.catch((e) => {
|
|
173
|
+
console.log(e);
|
|
123
174
|
throw e;
|
|
124
175
|
});
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
assert.strictEqual(body.message, "Missing credentials");
|
|
176
|
+
const body = await response.json();
|
|
177
|
+
assert.strictEqual(body.code, 400);
|
|
178
|
+
assert.strictEqual(body.error.message, "Missing credentials");
|
|
128
179
|
});
|
|
129
|
-
|
|
130
180
|
});
|
|
131
|
-
|
|
132
181
|
});
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
module.exports = class usersBundle extends nodefony.Bundle {
|
|
13
|
-
|
|
14
|
-
constructor(name, kernel, container) {
|
|
13
|
+
constructor (name, kernel, container) {
|
|
15
14
|
// Mother Class constructor
|
|
16
15
|
super(name, kernel, container);
|
|
17
16
|
// Load core bundle library
|
|
@@ -19,7 +18,7 @@ module.exports = class usersBundle extends nodefony.Bundle {
|
|
|
19
18
|
case "sequelize":
|
|
20
19
|
this.autoLoader.load(path.resolve(this.path, "src", "providers", "sequelize", "userProvider.js"));
|
|
21
20
|
break;
|
|
22
|
-
case
|
|
21
|
+
case "mongoose":
|
|
23
22
|
this.autoLoader.load(path.resolve(this.path, "src", "providers", "mongoose", "userProvider.js"));
|
|
24
23
|
break;
|
|
25
24
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
class microService extends nodefony.Builder {
|
|
2
|
-
|
|
3
|
-
constructor(cli, cmd, args) {
|
|
2
|
+
constructor (cli, cmd, args) {
|
|
4
3
|
super(cli, cmd, args);
|
|
5
4
|
this.name = null;
|
|
6
5
|
this.pathSkeleton = path.resolve(__dirname, "skeletons");
|
|
@@ -23,7 +22,7 @@ class microService extends nodefony.Builder {
|
|
|
23
22
|
authorMail: "admin@nodefony.com",
|
|
24
23
|
domain: "localhost",
|
|
25
24
|
year: new Date().getFullYear(),
|
|
26
|
-
npm:
|
|
25
|
+
npm: "npm",
|
|
27
26
|
version: nodefony.version,
|
|
28
27
|
addons: {}
|
|
29
28
|
});
|
|
@@ -34,12 +33,12 @@ class microService extends nodefony.Builder {
|
|
|
34
33
|
this.setEnv();
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
async interaction() {
|
|
38
|
-
|
|
39
|
-
type:
|
|
40
|
-
name:
|
|
36
|
+
async interaction () {
|
|
37
|
+
const promtOptions = [{
|
|
38
|
+
type: "input",
|
|
39
|
+
name: "name",
|
|
41
40
|
default: this.response.name,
|
|
42
|
-
message:
|
|
41
|
+
message: "Enter Service Name",
|
|
43
42
|
validate: (value) => {
|
|
44
43
|
if (value) {
|
|
45
44
|
this.name = value;
|
|
@@ -48,10 +47,10 @@ class microService extends nodefony.Builder {
|
|
|
48
47
|
}
|
|
49
48
|
return `${value} Unauthorised Please enter a valid project name`;
|
|
50
49
|
}
|
|
51
|
-
|
|
52
|
-
type:
|
|
53
|
-
name:
|
|
54
|
-
message:
|
|
50
|
+
}, {
|
|
51
|
+
type: "input",
|
|
52
|
+
name: "description",
|
|
53
|
+
message: "Enter short description",
|
|
55
54
|
default: this.response.description,
|
|
56
55
|
validate: (value) => {
|
|
57
56
|
if (!value) {
|
|
@@ -65,11 +64,11 @@ class microService extends nodefony.Builder {
|
|
|
65
64
|
}
|
|
66
65
|
return value;
|
|
67
66
|
}
|
|
68
|
-
|
|
69
|
-
type:
|
|
70
|
-
name:
|
|
67
|
+
}, {
|
|
68
|
+
type: "input",
|
|
69
|
+
name: "path",
|
|
71
70
|
default: this.location,
|
|
72
|
-
message:
|
|
71
|
+
message: "Project Path",
|
|
73
72
|
validate: (value) => {
|
|
74
73
|
let myPath = null;
|
|
75
74
|
try {
|
|
@@ -82,13 +81,13 @@ class microService extends nodefony.Builder {
|
|
|
82
81
|
this.location = value;
|
|
83
82
|
return true;
|
|
84
83
|
}
|
|
85
|
-
return
|
|
84
|
+
return "Please enter a valid Service Path";
|
|
86
85
|
}
|
|
87
|
-
|
|
88
|
-
type:
|
|
89
|
-
name:
|
|
86
|
+
}, {
|
|
87
|
+
type: "input",
|
|
88
|
+
name: "authorFullName",
|
|
90
89
|
default: this.response.authorFullName,
|
|
91
|
-
message:
|
|
90
|
+
message: "Please Enter Author Full Name",
|
|
92
91
|
filter: (value) => {
|
|
93
92
|
if (!value) {
|
|
94
93
|
this.response.authorName = this.response.authorFullName;
|
|
@@ -96,18 +95,18 @@ class microService extends nodefony.Builder {
|
|
|
96
95
|
}
|
|
97
96
|
return value;
|
|
98
97
|
}
|
|
99
|
-
|
|
100
|
-
type:
|
|
101
|
-
name:
|
|
98
|
+
}, {
|
|
99
|
+
type: "input",
|
|
100
|
+
name: "authorMail",
|
|
102
101
|
default: this.response.authorMail,
|
|
103
|
-
message:
|
|
102
|
+
message: "Please Enter Email Author ",
|
|
104
103
|
filter: (value) => {
|
|
105
104
|
if (!value) {
|
|
106
105
|
return this.response.authorMail;
|
|
107
106
|
}
|
|
108
107
|
return value;
|
|
109
108
|
}
|
|
110
|
-
|
|
109
|
+
}];
|
|
111
110
|
|
|
112
111
|
return this.cli.prompt(promtOptions)
|
|
113
112
|
.then((response) => {
|
|
@@ -116,142 +115,141 @@ class microService extends nodefony.Builder {
|
|
|
116
115
|
});
|
|
117
116
|
}
|
|
118
117
|
|
|
119
|
-
createBuilder(response) {
|
|
118
|
+
createBuilder (response) {
|
|
120
119
|
try {
|
|
121
120
|
return {
|
|
122
121
|
name: this.response.name,
|
|
123
122
|
type: "directory",
|
|
124
123
|
childs: [{
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
124
|
+
name: "tmp",
|
|
125
|
+
type: "directory"
|
|
126
|
+
}, {
|
|
127
|
+
name: "dist",
|
|
128
|
+
type: "directory"
|
|
129
|
+
}, {
|
|
130
|
+
name: "package.json",
|
|
131
|
+
type: "file",
|
|
132
|
+
skeleton: path.resolve(this.pathSkeleton, "package.json"),
|
|
133
|
+
params: this.response
|
|
134
|
+
}, {
|
|
135
|
+
name: "README.md",
|
|
136
|
+
type: "copy",
|
|
137
|
+
path: path.resolve(this.pathSkeleton, "README.md")
|
|
138
|
+
}, {
|
|
139
|
+
name: ".env-cmdrc.js",
|
|
140
|
+
type: "copy",
|
|
141
|
+
path: path.resolve(this.pathSkeleton, ".env-cmdrc.js")
|
|
142
|
+
}, {
|
|
143
|
+
name: ".editorconfig",
|
|
144
|
+
type: "copy",
|
|
145
|
+
path: path.resolve(this.pathSkeleton, ".editorconfig")
|
|
146
|
+
}, {
|
|
147
|
+
name: ".gitignore",
|
|
148
|
+
type: "copy",
|
|
149
|
+
path: path.resolve(this.pathSkeleton, ".gitignore")
|
|
150
|
+
}, {
|
|
151
|
+
name: ".jshintrc",
|
|
152
|
+
type: "copy",
|
|
153
|
+
path: path.resolve(this.pathSkeleton, ".jshintrc")
|
|
154
|
+
}, {
|
|
155
|
+
name: "bin",
|
|
156
|
+
type: "directory",
|
|
157
|
+
childs: [{
|
|
158
|
+
name: "cli",
|
|
132
159
|
type: "file",
|
|
133
|
-
|
|
160
|
+
chmod: 755,
|
|
161
|
+
skeleton: path.resolve(this.pathSkeleton, "bin", "cli"),
|
|
134
162
|
params: this.response
|
|
135
163
|
}, {
|
|
136
|
-
name: "
|
|
137
|
-
type: "
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
type: "copy",
|
|
142
|
-
path: path.resolve(this.pathSkeleton, ".env-cmdrc.js")
|
|
143
|
-
}, {
|
|
144
|
-
name: ".editorconfig",
|
|
145
|
-
type: "copy",
|
|
146
|
-
path: path.resolve(this.pathSkeleton, ".editorconfig")
|
|
164
|
+
name: "hello.sh",
|
|
165
|
+
type: "file",
|
|
166
|
+
chmod: 755,
|
|
167
|
+
skeleton: path.resolve(this.pathSkeleton, "bin", "bash", "hello.sh"),
|
|
168
|
+
params: this.response
|
|
147
169
|
}, {
|
|
148
|
-
name: ".
|
|
149
|
-
type: "
|
|
150
|
-
|
|
170
|
+
name: "hello.py",
|
|
171
|
+
type: "file",
|
|
172
|
+
chmod: 755,
|
|
173
|
+
skeleton: path.resolve(this.pathSkeleton, "bin", "python", "hello.py"),
|
|
174
|
+
params: this.response
|
|
151
175
|
}, {
|
|
152
|
-
name: ".
|
|
153
|
-
type: "
|
|
154
|
-
|
|
176
|
+
name: "generateCertificates.sh",
|
|
177
|
+
type: "file",
|
|
178
|
+
chmod: 755,
|
|
179
|
+
skeleton: path.resolve(this.projectSkeleton, "bin", "generateCertificates.sh.skeleton"),
|
|
180
|
+
params: this.response
|
|
181
|
+
}]
|
|
182
|
+
}, {
|
|
183
|
+
name: "src",
|
|
184
|
+
type: "copy",
|
|
185
|
+
path: path.resolve(this.pathSkeleton, "src"),
|
|
186
|
+
params: {
|
|
187
|
+
recurse: true
|
|
188
|
+
}
|
|
189
|
+
}, {
|
|
190
|
+
name: "tests",
|
|
191
|
+
type: "copy",
|
|
192
|
+
path: path.resolve(this.pathSkeleton, "tests"),
|
|
193
|
+
params: {
|
|
194
|
+
recurse: true
|
|
195
|
+
}
|
|
196
|
+
}, {
|
|
197
|
+
// name: "config",
|
|
198
|
+
// type: "copy",
|
|
199
|
+
// path: path.resolve(this.pathSkeleton, "config"),
|
|
200
|
+
// params:{recurse:true}
|
|
201
|
+
}, {
|
|
202
|
+
name: "config",
|
|
203
|
+
type: "directory",
|
|
204
|
+
childs: [{
|
|
205
|
+
name: "certificates",
|
|
206
|
+
type: "directory"
|
|
155
207
|
}, {
|
|
156
|
-
name: "
|
|
208
|
+
name: "openssl",
|
|
157
209
|
type: "directory",
|
|
158
210
|
childs: [{
|
|
159
|
-
name: "
|
|
160
|
-
type: "
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
chmod: 755,
|
|
168
|
-
skeleton: path.resolve(this.pathSkeleton, "bin", "bash", "hello.sh"),
|
|
169
|
-
params: this.response
|
|
170
|
-
}, {
|
|
171
|
-
name: "hello.py",
|
|
172
|
-
type: "file",
|
|
173
|
-
chmod: 755,
|
|
174
|
-
skeleton: path.resolve(this.pathSkeleton, "bin", "python", "hello.py"),
|
|
175
|
-
params: this.response
|
|
211
|
+
name: "ca",
|
|
212
|
+
type: "directory",
|
|
213
|
+
childs: [{
|
|
214
|
+
name: "openssl.cnf",
|
|
215
|
+
type: "file",
|
|
216
|
+
skeleton: path.resolve(this.projectSkeleton, "config", "openssl", "ca", "openssl.cnf.skeleton"),
|
|
217
|
+
params: this.response
|
|
218
|
+
}]
|
|
176
219
|
}, {
|
|
177
|
-
name: "
|
|
178
|
-
type: "
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
220
|
+
name: "ca_intermediate",
|
|
221
|
+
type: "directory",
|
|
222
|
+
childs: [{
|
|
223
|
+
name: "openssl.cnf",
|
|
224
|
+
type: "file",
|
|
225
|
+
skeleton: path.resolve(this.projectSkeleton, "config", "openssl", "ca_intermediate", "openssl.cnf.skeleton"),
|
|
226
|
+
params: this.response
|
|
227
|
+
}]
|
|
182
228
|
}]
|
|
183
229
|
}, {
|
|
184
|
-
name: "
|
|
185
|
-
type: "
|
|
186
|
-
|
|
187
|
-
params:
|
|
188
|
-
recurse: true
|
|
189
|
-
}
|
|
230
|
+
name: "config.js",
|
|
231
|
+
type: "file",
|
|
232
|
+
skeleton: path.resolve(this.pathSkeleton, "config", "config.js"),
|
|
233
|
+
params: this.response
|
|
190
234
|
}, {
|
|
191
|
-
name: "
|
|
235
|
+
name: "pm2.config.js",
|
|
236
|
+
type: "file",
|
|
237
|
+
skeleton: path.resolve(this.pathSkeleton, "config", "pm2.config.js"),
|
|
238
|
+
params: this.response
|
|
239
|
+
}, {
|
|
240
|
+
name: "webpack.config.js",
|
|
241
|
+
type: "file",
|
|
242
|
+
skeleton: path.resolve(this.pathSkeleton, "config", "webpack.config.js"),
|
|
243
|
+
params: this.response
|
|
244
|
+
}, {
|
|
245
|
+
name: "webpack",
|
|
192
246
|
type: "copy",
|
|
193
|
-
path: path.resolve(this.pathSkeleton, "
|
|
247
|
+
path: path.resolve(this.pathSkeleton, "config", "webpack"),
|
|
194
248
|
params: {
|
|
195
249
|
recurse: true
|
|
196
250
|
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
//type: "copy",
|
|
200
|
-
//path: path.resolve(this.pathSkeleton, "config"),
|
|
201
|
-
//params:{recurse:true}
|
|
202
|
-
}, {
|
|
203
|
-
name: "config",
|
|
204
|
-
type: "directory",
|
|
205
|
-
childs: [{
|
|
206
|
-
name: "certificates",
|
|
207
|
-
type: "directory"
|
|
208
|
-
}, {
|
|
209
|
-
name: "openssl",
|
|
210
|
-
type: "directory",
|
|
211
|
-
childs: [{
|
|
212
|
-
name: "ca",
|
|
213
|
-
type: "directory",
|
|
214
|
-
childs: [{
|
|
215
|
-
name: "openssl.cnf",
|
|
216
|
-
type: "file",
|
|
217
|
-
skeleton: path.resolve(this.projectSkeleton, "config", "openssl", "ca", "openssl.cnf.skeleton"),
|
|
218
|
-
params: this.response
|
|
219
|
-
}]
|
|
220
|
-
}, {
|
|
221
|
-
name: "ca_intermediate",
|
|
222
|
-
type: "directory",
|
|
223
|
-
childs: [{
|
|
224
|
-
name: "openssl.cnf",
|
|
225
|
-
type: "file",
|
|
226
|
-
skeleton: path.resolve(this.projectSkeleton, "config", "openssl", "ca_intermediate", "openssl.cnf.skeleton"),
|
|
227
|
-
params: this.response
|
|
228
|
-
}]
|
|
229
|
-
}]
|
|
230
|
-
}, {
|
|
231
|
-
name: "config.js",
|
|
232
|
-
type: "file",
|
|
233
|
-
skeleton: path.resolve(this.pathSkeleton, "config", "config.js"),
|
|
234
|
-
params: this.response
|
|
235
|
-
}, {
|
|
236
|
-
name: "pm2.config.js",
|
|
237
|
-
type: "file",
|
|
238
|
-
skeleton: path.resolve(this.pathSkeleton, "config", "pm2.config.js"),
|
|
239
|
-
params: this.response
|
|
240
|
-
}, {
|
|
241
|
-
name: "webpack.config.js",
|
|
242
|
-
type: "file",
|
|
243
|
-
skeleton: path.resolve(this.pathSkeleton, "config", "webpack.config.js"),
|
|
244
|
-
params: this.response
|
|
245
|
-
}, {
|
|
246
|
-
name: "webpack",
|
|
247
|
-
type: "copy",
|
|
248
|
-
path: path.resolve(this.pathSkeleton, "config", "webpack"),
|
|
249
|
-
params: {
|
|
250
|
-
recurse: true
|
|
251
|
-
}
|
|
252
|
-
}]
|
|
253
|
-
}
|
|
254
|
-
]
|
|
251
|
+
}]
|
|
252
|
+
}]
|
|
255
253
|
};
|
|
256
254
|
} catch (e) {
|
|
257
255
|
throw e;
|