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
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
const localFramework = kernel.app.settings.locale;
|
|
2
|
-
let Faker = null
|
|
2
|
+
let Faker = null;
|
|
3
3
|
try {
|
|
4
|
-
Faker = require(
|
|
4
|
+
Faker = require("@withshepherd/faker");
|
|
5
5
|
} catch (e) {}
|
|
6
|
-
//const local = localFramework.slice(0, 2);
|
|
7
|
-
//const Faker = require(`faker/locale/${local}`);
|
|
8
|
-
//Faker.locale = local;
|
|
6
|
+
// const local = localFramework.slice(0, 2);
|
|
7
|
+
// const Faker = require(`faker/locale/${local}`);
|
|
8
|
+
// Faker.locale = local;
|
|
9
9
|
|
|
10
|
-
//let uuid = Faker.random.uuid();
|
|
11
|
-
//let ele = `/${uuid.split('-').slice(1, 4).join('\/')}/${uuid}.jpg `;
|
|
10
|
+
// let uuid = Faker.random.uuid();
|
|
11
|
+
// let ele = `/${uuid.split('-').slice(1, 4).join('\/')}/${uuid}.jpg `;
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
const rolesArray = [
|
|
14
|
+
const rolesArray = ["ROLE_USER", "ROLE_ADMIN", "ROLE_TEST", "ROLE_AUDIO", "ROLE_VIDEO"];
|
|
15
15
|
|
|
16
16
|
const defaultFixtures = [{
|
|
17
17
|
username: "anonymous",
|
|
@@ -63,7 +63,7 @@ const defaultFixtures = [{
|
|
|
63
63
|
}];
|
|
64
64
|
|
|
65
65
|
class randomFixture {
|
|
66
|
-
constructor() {
|
|
66
|
+
constructor () {
|
|
67
67
|
this.matrice = {
|
|
68
68
|
username: "",
|
|
69
69
|
name: "",
|
|
@@ -77,8 +77,8 @@ class randomFixture {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
randomUser(nb = 100) {
|
|
81
|
-
|
|
80
|
+
randomUser (nb = 100) {
|
|
81
|
+
const tab = [];
|
|
82
82
|
for (let i = 0; i < nb; i++) {
|
|
83
83
|
let gender = "male";
|
|
84
84
|
let lang = "fr-FR";
|
|
@@ -86,33 +86,31 @@ class randomFixture {
|
|
|
86
86
|
gender = "female";
|
|
87
87
|
lang = "en_EN";
|
|
88
88
|
}
|
|
89
|
-
tab.push(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}));
|
|
89
|
+
tab.push(nodefony.extend({}, this.matrice, {
|
|
90
|
+
username: Faker.internet.userName(),
|
|
91
|
+
name: Faker.name.lastName(),
|
|
92
|
+
surname: Faker.name.firstName(),
|
|
93
|
+
email: Faker.internet.email(),
|
|
94
|
+
gender,
|
|
95
|
+
lang: Faker.random.locale(),
|
|
96
|
+
image: Faker.image.avatar(),
|
|
97
|
+
url: Faker.internet.url(),
|
|
98
|
+
roles: [Faker.random.arrayElement(rolesArray)]
|
|
99
|
+
}));
|
|
101
100
|
}
|
|
102
101
|
return tab;
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
faker(option) {
|
|
104
|
+
faker (option) {
|
|
106
105
|
return Faker.fake(option);
|
|
107
106
|
}
|
|
108
107
|
|
|
109
|
-
randomFloat(modulo = 0, min = 0, max = 100) {
|
|
108
|
+
randomFloat (modulo = 0, min = 0, max = 100) {
|
|
110
109
|
if (modulo % 2) {
|
|
111
110
|
return -(Math.random() * (max - min) + min).toFixed(2);
|
|
112
111
|
}
|
|
113
112
|
return (Math.random() * (max - min) + min).toFixed(2);
|
|
114
113
|
}
|
|
115
|
-
|
|
116
114
|
}
|
|
117
115
|
|
|
118
116
|
module.exports.default = defaultFixtures;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
const users = require("./users.js");
|
|
2
2
|
|
|
3
3
|
class usersFixture extends nodefony.Fixture {
|
|
4
|
-
|
|
5
|
-
constructor(container) {
|
|
4
|
+
constructor (container) {
|
|
6
5
|
super("users", container);
|
|
7
6
|
this.usersService = this.get("users");
|
|
8
7
|
this.entity = this.orm.getEntity("user");
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
async initialize(random = 0) {
|
|
10
|
+
async initialize (random = 0) {
|
|
12
11
|
switch (this.ormName) {
|
|
13
|
-
case
|
|
12
|
+
case "sequelize":
|
|
14
13
|
if (random) {
|
|
15
14
|
return await this.randomSequelize(random);
|
|
16
15
|
}
|
|
@@ -23,12 +22,12 @@ class usersFixture extends nodefony.Fixture {
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
async randomSequelize(nb) {
|
|
25
|
+
async randomSequelize (nb) {
|
|
27
26
|
try {
|
|
28
|
-
|
|
27
|
+
const tab = [];
|
|
29
28
|
const random = new users.random();
|
|
30
|
-
|
|
31
|
-
for await (
|
|
29
|
+
const fixs = random.randomUser(nb);
|
|
30
|
+
for await (const user of fixs) {
|
|
32
31
|
tab.push(await this.loadSequelizeFixtures(user));
|
|
33
32
|
}
|
|
34
33
|
return tab;
|
|
@@ -37,10 +36,10 @@ class usersFixture extends nodefony.Fixture {
|
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
async runSequelize() {
|
|
39
|
+
async runSequelize () {
|
|
41
40
|
try {
|
|
42
|
-
|
|
43
|
-
for await (
|
|
41
|
+
const tab = [];
|
|
42
|
+
for await (const user of users.default) {
|
|
44
43
|
tab.push(await this.loadSequelizeFixtures(user));
|
|
45
44
|
}
|
|
46
45
|
return tab;
|
|
@@ -49,29 +48,29 @@ class usersFixture extends nodefony.Fixture {
|
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
loadSequelizeFixtures(obj) {
|
|
51
|
+
loadSequelizeFixtures (obj) {
|
|
53
52
|
return this.entity.findOrCreate({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
where: {
|
|
54
|
+
username: obj.username
|
|
55
|
+
},
|
|
56
|
+
defaults: obj
|
|
57
|
+
})
|
|
59
58
|
.then((res) => {
|
|
60
59
|
if (res[1]) {
|
|
61
|
-
this.log(
|
|
60
|
+
this.log(`ADD USER : ${res[0].username}`, "INFO");
|
|
62
61
|
} else {
|
|
63
|
-
this.log(
|
|
62
|
+
this.log(`ALREADY EXIST USER : ${res[0].username}`, "INFO");
|
|
64
63
|
}
|
|
65
64
|
return res[1];
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
async randomMongoose(nb) {
|
|
68
|
+
async randomMongoose (nb) {
|
|
70
69
|
try {
|
|
71
|
-
|
|
70
|
+
const tab = [];
|
|
72
71
|
const random = new users.random();
|
|
73
|
-
|
|
74
|
-
for await (
|
|
72
|
+
const fixs = random.randomUser(nb);
|
|
73
|
+
for await (const user of fixs) {
|
|
75
74
|
tab.push(await this.loadMongooseFixtures(user));
|
|
76
75
|
}
|
|
77
76
|
return tab;
|
|
@@ -80,10 +79,10 @@ class usersFixture extends nodefony.Fixture {
|
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
|
|
83
|
-
async runMongoose() {
|
|
82
|
+
async runMongoose () {
|
|
84
83
|
try {
|
|
85
|
-
|
|
86
|
-
for await (
|
|
84
|
+
const tab = [];
|
|
85
|
+
for await (const user of users.default) {
|
|
87
86
|
tab.push(await this.loadMongooseFixtures(user));
|
|
88
87
|
}
|
|
89
88
|
return tab;
|
|
@@ -92,17 +91,17 @@ class usersFixture extends nodefony.Fixture {
|
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
|
|
95
|
-
loadMongooseFixtures(obj) {
|
|
94
|
+
loadMongooseFixtures (obj) {
|
|
96
95
|
return new Promise(async (resolve, reject) => {
|
|
97
96
|
try {
|
|
98
97
|
let document = await this.entity.findOne({
|
|
99
98
|
username: obj.username
|
|
100
99
|
});
|
|
101
100
|
if (document) {
|
|
102
|
-
this.log(
|
|
101
|
+
this.log(`ALREADY EXIST USER : ${obj.username}`, "INFO");
|
|
103
102
|
} else {
|
|
104
103
|
document = await new this.entity(obj).save();
|
|
105
|
-
this.log(
|
|
104
|
+
this.log(`ADD DOCUMENT USER : ${obj.username}`, "INFO");
|
|
106
105
|
}
|
|
107
106
|
return resolve(document);
|
|
108
107
|
} catch (e) {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* GENERATE BY nodefony-starter BUILDER
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
//const crypto = require('crypto');
|
|
16
|
-
const path = require(
|
|
15
|
+
// const crypto = require('crypto');
|
|
16
|
+
const path = require("path");
|
|
17
17
|
const readFile = function (Path) {
|
|
18
18
|
try {
|
|
19
19
|
return fs.readFileSync(Path, {
|
|
@@ -25,13 +25,14 @@ const readFile = function (Path) {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
const randomSecret = function () {
|
|
28
|
-
|
|
28
|
+
const sercretPath = path.resolve("config", "certificates", "ca", "private", "ca.key.pem");
|
|
29
29
|
return readFile(sercretPath);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
module.exports = {
|
|
33
33
|
type: "sandbox",
|
|
34
34
|
locale: "en_en",
|
|
35
|
+
|
|
35
36
|
/**
|
|
36
37
|
* WATCHERS
|
|
37
38
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* ===============================================================================
|
|
4
4
|
* ROUTING BUNDLE users-bundle
|
|
5
5
|
*
|
|
6
|
-
* Copyright © /2019 |
|
|
6
|
+
* Copyright © /2019 |
|
|
7
7
|
*
|
|
8
8
|
* ===============================================================================
|
|
9
9
|
*
|
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
**/
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
module.exports = {};
|
|
17
17
|
|
|
@@ -13,6 +13,7 @@ const cors = {
|
|
|
13
13
|
|
|
14
14
|
module.exports = {
|
|
15
15
|
security: {
|
|
16
|
+
|
|
16
17
|
/**
|
|
17
18
|
* FIREWALL PROVIDER
|
|
18
19
|
*/
|
|
@@ -44,7 +45,7 @@ module.exports = {
|
|
|
44
45
|
firewalls: {
|
|
45
46
|
// SECURITY AREA <passport-local>
|
|
46
47
|
nodefony_area: {
|
|
47
|
-
pattern: /^\/secure
|
|
48
|
+
pattern: /^\/secure/u,
|
|
48
49
|
provider: "nodefony",
|
|
49
50
|
form_login: {
|
|
50
51
|
login_path: "/login/secure",
|
|
@@ -52,8 +53,8 @@ module.exports = {
|
|
|
52
53
|
default_target_path: "/users"
|
|
53
54
|
},
|
|
54
55
|
"passport-local": {
|
|
55
|
-
usernameField:
|
|
56
|
-
passwordField:
|
|
56
|
+
usernameField: "username",
|
|
57
|
+
passwordField: "passwd"
|
|
57
58
|
},
|
|
58
59
|
logout: "/logout",
|
|
59
60
|
context: null,
|
|
@@ -61,11 +62,11 @@ module.exports = {
|
|
|
61
62
|
},
|
|
62
63
|
// SECURITY AREA LOGIN API <passport-local>
|
|
63
64
|
login_api_area: {
|
|
64
|
-
pattern: /^\/api\/jwt\/login
|
|
65
|
+
pattern: /^\/api\/jwt\/login/u,
|
|
65
66
|
provider: "nodefony",
|
|
66
67
|
"passport-local": {
|
|
67
|
-
usernameField:
|
|
68
|
-
passwordField:
|
|
68
|
+
usernameField: "username",
|
|
69
|
+
passwordField: "passwd"
|
|
69
70
|
},
|
|
70
71
|
stateless: false,
|
|
71
72
|
redirectHttps: true,
|
|
@@ -73,12 +74,12 @@ module.exports = {
|
|
|
73
74
|
},
|
|
74
75
|
// SECURITY AREA API <passport-jwt>
|
|
75
76
|
api_area: {
|
|
76
|
-
pattern: /^\/api
|
|
77
|
+
pattern: /^\/api/u,
|
|
77
78
|
redirectHttps: true,
|
|
78
79
|
stateless: true,
|
|
79
80
|
"passport-jwt": {
|
|
80
81
|
algorithms: "RS256",
|
|
81
|
-
//secretOrKey:"Les sanglots longs Des violons De l’automne Blessent mon cœur D’une langueur Monotone."
|
|
82
|
+
// secretOrKey:"Les sanglots longs Des violons De l’automne Blessent mon cœur D’une langueur Monotone."
|
|
82
83
|
certificats: {
|
|
83
84
|
private: path.resolve("config", "certificates", "ca", "private", "ca.key.pem"),
|
|
84
85
|
public: path.resolve("config", "certificates", "ca", "public", "public.key.pem")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const {CleanWebpackPlugin} = require("clean-webpack-plugin");
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
mode: "development",
|
|
@@ -7,7 +7,7 @@ module.exports = {
|
|
|
7
7
|
new CleanWebpackPlugin({
|
|
8
8
|
verbose: kernel.debug
|
|
9
9
|
})
|
|
10
|
-
//new webpack.NamedModulesPlugin(),
|
|
11
|
-
//new webpack.HotModuleReplacementPlugin()
|
|
10
|
+
// new webpack.NamedModulesPlugin(),
|
|
11
|
+
// new webpack.HotModuleReplacementPlugin()
|
|
12
12
|
]
|
|
13
13
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// WEBPACK PROD CONFIGURATION
|
|
2
|
-
//const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
|
3
|
-
const TerserPlugin = require(
|
|
2
|
+
// const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
|
3
|
+
const TerserPlugin = require("terser-webpack-plugin");
|
|
4
4
|
|
|
5
5
|
module.exports = {
|
|
6
6
|
mode: "production",
|
|
@@ -18,7 +18,8 @@ module.exports = {
|
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
plugins: [
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
/* new OptimizeCssAssetsPlugin({
|
|
22
23
|
cssProcessorOptions: {
|
|
23
24
|
discardComments: {
|
|
24
25
|
removeAll: true
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
|
-
const webpack = require(
|
|
2
|
+
const webpack = require("webpack");
|
|
3
3
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
4
4
|
const {
|
|
5
5
|
merge
|
|
6
|
-
} = require(
|
|
6
|
+
} = require("webpack-merge");
|
|
7
7
|
|
|
8
8
|
// Default context <bundle base directory>
|
|
9
|
-
//const context = path.resolve(__dirname, "..", "public");
|
|
9
|
+
// const context = path.resolve(__dirname, "..", "public");
|
|
10
10
|
const public = path.resolve(__dirname, "..", "public", "assets");
|
|
11
11
|
const package = require(path.resolve("package.json"));
|
|
12
12
|
|
|
@@ -26,14 +26,14 @@ if (kernel.environment === "dev") {
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
module.exports = merge(config, {
|
|
29
|
-
//context: context,
|
|
29
|
+
// context: context,
|
|
30
30
|
target: "web",
|
|
31
31
|
entry: {
|
|
32
32
|
users: ["./Resources/js/users.js"]
|
|
33
33
|
},
|
|
34
34
|
output: {
|
|
35
35
|
path: public,
|
|
36
|
-
publicPath
|
|
36
|
+
publicPath,
|
|
37
37
|
filename: "./js/[name].js",
|
|
38
38
|
hashFunction: "xxhash64",
|
|
39
39
|
library: "[name]",
|
|
@@ -41,101 +41,100 @@ module.exports = merge(config, {
|
|
|
41
41
|
},
|
|
42
42
|
externals: {},
|
|
43
43
|
resolve: {
|
|
44
|
-
extensions: [
|
|
44
|
+
extensions: [".js", ".json", ".jsx", ".css", ".mjs"],
|
|
45
45
|
alias: {
|
|
46
46
|
"@modules": path.join(__dirname, "..", "..", "node_modules")
|
|
47
47
|
},
|
|
48
48
|
fallback: {
|
|
49
49
|
"path": false,
|
|
50
50
|
"assert": false,
|
|
51
|
-
buffer: require.resolve(
|
|
51
|
+
buffer: require.resolve("buffer/")
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
module: {
|
|
55
55
|
rules: [{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
// BABEL TRANSCODE
|
|
57
|
+
test: /\.(jsx|mjs|js|es6)$/,
|
|
58
|
+
exclude: new RegExp("node_modules"),
|
|
59
|
+
use: [{
|
|
60
|
+
loader: "babel-loader",
|
|
61
|
+
options: {
|
|
62
|
+
// presets: ['@babel/preset-env', '@babel/preset-react']
|
|
63
|
+
presets: [
|
|
64
|
+
["@babel/preset-env", {
|
|
65
|
+
modules: false
|
|
66
|
+
}],
|
|
67
|
+
"@babel/preset-react"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
}]
|
|
71
|
+
}, {
|
|
72
|
+
type: "javascript/auto",
|
|
73
|
+
test: /\.mjs$/,
|
|
74
|
+
use: [],
|
|
75
|
+
include: /node_modules/
|
|
76
|
+
}, {
|
|
77
|
+
test: require.resolve("jquery"),
|
|
78
|
+
rules: [{
|
|
79
|
+
loader: "expose-loader",
|
|
80
|
+
options: {
|
|
81
|
+
// expose: ['$', 'jQuery'],
|
|
82
|
+
exposes: [{
|
|
83
|
+
globalName: "$",
|
|
84
|
+
override: true
|
|
85
|
+
}, {
|
|
86
|
+
globalName: "jQuery",
|
|
87
|
+
override: true
|
|
88
|
+
}]
|
|
89
|
+
}
|
|
90
|
+
}]
|
|
91
|
+
}, {
|
|
92
|
+
test: /\.(sa|sc|c)ss$/,
|
|
93
|
+
use: [
|
|
94
|
+
// 'css-hot-loader',
|
|
95
|
+
MiniCssExtractPlugin.loader,
|
|
96
|
+
{
|
|
97
|
+
loader: "css-loader",
|
|
61
98
|
options: {
|
|
62
|
-
|
|
63
|
-
presets: [
|
|
64
|
-
['@babel/preset-env', {
|
|
65
|
-
modules: false
|
|
66
|
-
}],
|
|
67
|
-
'@babel/preset-react',
|
|
68
|
-
],
|
|
99
|
+
sourceMap: true
|
|
69
100
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
type: 'javascript/auto',
|
|
73
|
-
test: /\.mjs$/,
|
|
74
|
-
use: [],
|
|
75
|
-
include: /node_modules/,
|
|
76
|
-
}, {
|
|
77
|
-
test: require.resolve('jquery'),
|
|
78
|
-
rules: [{
|
|
79
|
-
loader: 'expose-loader',
|
|
101
|
+
}, {
|
|
102
|
+
loader: "sass-loader",
|
|
80
103
|
options: {
|
|
81
|
-
|
|
82
|
-
exposes: [{
|
|
83
|
-
globalName: '$',
|
|
84
|
-
override: true,
|
|
85
|
-
}, {
|
|
86
|
-
globalName: 'jQuery',
|
|
87
|
-
override: true,
|
|
88
|
-
}]
|
|
89
|
-
}
|
|
90
|
-
}]
|
|
91
|
-
}, {
|
|
92
|
-
test: /\.(sa|sc|c)ss$/,
|
|
93
|
-
use: [
|
|
94
|
-
//'css-hot-loader',
|
|
95
|
-
MiniCssExtractPlugin.loader,
|
|
96
|
-
{
|
|
97
|
-
loader: "css-loader",
|
|
98
|
-
options: {
|
|
99
|
-
sourceMap: true
|
|
100
|
-
}
|
|
101
|
-
}, {
|
|
102
|
-
loader: "sass-loader",
|
|
103
|
-
options: {
|
|
104
|
-
sourceMap: true
|
|
105
|
-
}
|
|
104
|
+
sourceMap: true
|
|
106
105
|
}
|
|
107
|
-
]
|
|
108
|
-
}, {
|
|
109
|
-
test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
|
|
110
|
-
type: 'asset/inline'
|
|
111
|
-
}, {
|
|
112
|
-
test: /\.svg$/,
|
|
113
|
-
use: [{
|
|
114
|
-
loader: 'svg-inline-loader'
|
|
115
|
-
}],
|
|
116
|
-
}, {
|
|
117
|
-
// IMAGES
|
|
118
|
-
test: /\.(gif|png|jpe?g|svg)$/i,
|
|
119
|
-
type: 'asset/resource',
|
|
120
|
-
generator: {
|
|
121
|
-
filename: "images/[name][ext][query]",
|
|
122
106
|
}
|
|
107
|
+
]
|
|
108
|
+
}, {
|
|
109
|
+
test: /.(ttf|otf|eot|svg|woff(2)?)(\?[a-z0-9]+)?$/,
|
|
110
|
+
type: "asset/inline"
|
|
111
|
+
}, {
|
|
112
|
+
test: /\.svg$/,
|
|
113
|
+
use: [{
|
|
114
|
+
loader: "svg-inline-loader"
|
|
115
|
+
}]
|
|
116
|
+
}, {
|
|
117
|
+
// IMAGES
|
|
118
|
+
test: /\.(gif|png|jpe?g|svg)$/i,
|
|
119
|
+
type: "asset/resource",
|
|
120
|
+
generator: {
|
|
121
|
+
filename: "images/[name][ext][query]"
|
|
123
122
|
}
|
|
124
|
-
]
|
|
123
|
+
}]
|
|
125
124
|
},
|
|
126
125
|
plugins: [
|
|
127
126
|
new webpack.ProvidePlugin({
|
|
128
|
-
Buffer: [
|
|
127
|
+
Buffer: ["buffer", "Buffer"]
|
|
129
128
|
}),
|
|
130
129
|
new MiniCssExtractPlugin({
|
|
131
130
|
filename: "./css/[name].css"
|
|
132
131
|
}),
|
|
133
132
|
new webpack.DefinePlugin({
|
|
134
|
-
|
|
135
|
-
platform
|
|
133
|
+
"process": {
|
|
134
|
+
platform: `'${process.platform}'`
|
|
136
135
|
},
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
"process.env": {
|
|
137
|
+
"NODE_ENV": JSON.stringify(process.env.NODE_ENV),
|
|
139
138
|
"NODE_DEBUG": JSON.stringify(debug),
|
|
140
139
|
"GRAPHIQL": JSON.stringify(bundleConfig.graphiql),
|
|
141
140
|
"SWAGGER": JSON.stringify(bundleConfig.swagger)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
module.exports = {
|
|
2
|
+
styles: {
|
|
3
|
+
"mixins": true,
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
"core": true,
|
|
6
|
+
"icons": true,
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
"larger": true,
|
|
9
|
+
"path": true
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -67,14 +67,14 @@ const openapi = {
|
|
|
67
67
|
summary: "Get OpenAPI (OAS 3.0) configuration",
|
|
68
68
|
tags: ["JSON WEB TOKEN"],
|
|
69
69
|
responses: {
|
|
70
|
-
|
|
70
|
+
"200": {
|
|
71
71
|
description: "A paged array of users"
|
|
72
72
|
},
|
|
73
73
|
default: {
|
|
74
74
|
$ref: "#/components/responses/default"
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
}
|
|
77
|
+
}
|
|
78
78
|
},
|
|
79
79
|
"/api/jwt/login": {
|
|
80
80
|
post: {
|
|
@@ -92,7 +92,7 @@ const openapi = {
|
|
|
92
92
|
required: true
|
|
93
93
|
}],
|
|
94
94
|
responses: {
|
|
95
|
-
|
|
95
|
+
"200": {
|
|
96
96
|
description: "get Authentication tokens",
|
|
97
97
|
content: {
|
|
98
98
|
"application/json": {
|
|
@@ -104,7 +104,7 @@ const openapi = {
|
|
|
104
104
|
properties: {
|
|
105
105
|
result: {
|
|
106
106
|
$ref: "#/components/schemas/jwt"
|
|
107
|
-
}
|
|
107
|
+
}
|
|
108
108
|
}
|
|
109
109
|
}]
|
|
110
110
|
},
|
|
@@ -172,12 +172,12 @@ const openapi = {
|
|
|
172
172
|
parameters: [{
|
|
173
173
|
name: "refreshToken",
|
|
174
174
|
description: "Authentication refreshToken",
|
|
175
|
-
in: "header"
|
|
176
|
-
//required: true
|
|
175
|
+
in: "header"
|
|
176
|
+
// required: true
|
|
177
177
|
}],
|
|
178
178
|
requestBody: {
|
|
179
|
-
description:
|
|
180
|
-
//required: true,
|
|
179
|
+
description: "",
|
|
180
|
+
// required: true,
|
|
181
181
|
content: {
|
|
182
182
|
"application/x-www-form-urlencoded": {
|
|
183
183
|
schema: {
|
|
@@ -190,10 +190,10 @@ const openapi = {
|
|
|
190
190
|
required: ["refreshToken"]
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
-
}
|
|
193
|
+
}
|
|
194
194
|
},
|
|
195
195
|
responses: {
|
|
196
|
-
|
|
196
|
+
"200": {
|
|
197
197
|
description: "Regenerated Token"
|
|
198
198
|
},
|
|
199
199
|
default: {
|
|
@@ -213,7 +213,7 @@ const openapi = {
|
|
|
213
213
|
required: true
|
|
214
214
|
}],
|
|
215
215
|
responses: {
|
|
216
|
-
|
|
216
|
+
"200": {
|
|
217
217
|
description: "logout user"
|
|
218
218
|
},
|
|
219
219
|
default: {
|
|
@@ -222,9 +222,9 @@ const openapi = {
|
|
|
222
222
|
},
|
|
223
223
|
security: [{
|
|
224
224
|
jwtAuth: ""
|
|
225
|
-
}]
|
|
225
|
+
}]
|
|
226
226
|
}
|
|
227
|
-
}
|
|
227
|
+
}
|
|
228
228
|
},
|
|
229
229
|
tags: [{
|
|
230
230
|
name: "JSON WEB TOKEN",
|