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.
Files changed (136) hide show
  1. package/CHANGELOG.md +534 -8028
  2. package/README.md +33 -30
  3. package/autoloader.es6 +46 -48
  4. package/builder.es6 +66 -76
  5. package/cli/builder/bundles/bundle.js +57 -63
  6. package/cli/builder/bundles/controller.js +34 -38
  7. package/cli/builder/bundles/users-bundle/Command/fixtureTask.js +11 -12
  8. package/cli/builder/bundles/users-bundle/Command/usersCommand.js +23 -24
  9. package/cli/builder/bundles/users-bundle/Entity/mongoose/userEntity.js +25 -30
  10. package/cli/builder/bundles/users-bundle/Entity/sequelize/userEntity.js +42 -31
  11. package/cli/builder/bundles/users-bundle/Fixtures/users.js +24 -26
  12. package/cli/builder/bundles/users-bundle/Fixtures/usersFixtures.js +28 -29
  13. package/cli/builder/bundles/users-bundle/Resources/config/config.js +4 -3
  14. package/cli/builder/bundles/users-bundle/Resources/config/routing.js +2 -2
  15. package/cli/builder/bundles/users-bundle/Resources/config/security.js +9 -8
  16. package/cli/builder/bundles/users-bundle/Resources/config/webpack/webpack.dev.config.js +3 -3
  17. package/cli/builder/bundles/users-bundle/Resources/config/webpack/webpack.prod.config.js +4 -3
  18. package/cli/builder/bundles/users-bundle/Resources/config/webpack.config.js +74 -75
  19. package/cli/builder/bundles/users-bundle/Resources/scss/awesome/font-awesome.config.js +9 -9
  20. package/cli/builder/bundles/users-bundle/Resources/swagger/openapi/login.js +13 -13
  21. package/cli/builder/bundles/users-bundle/Resources/swagger/openapi/users.js +14 -14
  22. package/cli/builder/bundles/users-bundle/controller/api/graphql/graphqlController.js +13 -15
  23. package/cli/builder/bundles/users-bundle/controller/api/graphql/userResolver.js +29 -29
  24. package/cli/builder/bundles/users-bundle/controller/api/graphql/usertype.js +2 -2
  25. package/cli/builder/bundles/users-bundle/controller/api/openapi/loginApiController.js +34 -36
  26. package/cli/builder/bundles/users-bundle/controller/api/openapi/restUserController.js +32 -36
  27. package/cli/builder/bundles/users-bundle/controller/loginController.js +30 -34
  28. package/cli/builder/bundles/users-bundle/controller/usersController.js +54 -60
  29. package/cli/builder/bundles/users-bundle/package.json +27 -25
  30. package/cli/builder/bundles/users-bundle/pnpm-lock.yaml +4262 -0
  31. package/cli/builder/bundles/users-bundle/readme.md +7 -7
  32. package/cli/builder/bundles/users-bundle/services/usersService.js +97 -102
  33. package/cli/builder/bundles/users-bundle/src/providers/mongoose/userProvider.js +6 -8
  34. package/cli/builder/bundles/users-bundle/src/providers/sequelize/userProvider.js +9 -10
  35. package/cli/builder/bundles/users-bundle/tests/loginTest.js +119 -70
  36. package/cli/builder/bundles/users-bundle/usersBundle.js +2 -3
  37. package/cli/builder/microService/microService.js +139 -141
  38. package/cli/builder/microService/skeletons/package.json +23 -22
  39. package/cli/builder/project/project.js +228 -181
  40. package/cli/builder/project/skeletons/README.md +33 -30
  41. package/cli/builder/project/skeletons/bin/dev-deploy.sh +5 -0
  42. package/cli/builder/project/skeletons/bin/prod-deploy.sh +3 -0
  43. package/cli/builder/project/skeletons/config/config.js.skeleton +1 -0
  44. package/cli/builder/project/skeletons/config/pm2.config.js.skeleton +41 -17
  45. package/cli/builder/project/skeletons/eslintignore.skeleton +15 -0
  46. package/cli/builder/project/skeletons/eslintrc.js.skeleton +97 -0
  47. package/cli/builder/project/skeletons/gitignore.skeleton +1 -0
  48. package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.37.entity-user.js +137 -0
  49. package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.38.entity-session.js +97 -0
  50. package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.39.entity-requests.js +115 -0
  51. package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.40.entity-jwts.js +97 -0
  52. package/cli/builder/project/skeletons/migrations/migrations.skeleton.js +0 -2
  53. package/cli/builder/project/skeletons/package.json.twig +70 -0
  54. package/cli/builder/react/reactBuilder.js +59 -65
  55. package/cli/builder/sandbox/sandBoxBuilder.js +132 -134
  56. package/cli/builder/skeletons/app/appKernel.js +120 -2
  57. package/cli/builder/skeletons/config/config.js +1 -1
  58. package/cli/builder/skeletons/config/nodefony/framework-bundle.js +2 -1
  59. package/cli/builder/skeletons/config/nodefony/http-bundle.js +1 -0
  60. package/cli/builder/skeletons/config/nodefony/mongoose-bundle.js +38 -12
  61. package/cli/builder/skeletons/config/nodefony/monitoring-bundle.js +21 -2
  62. package/cli/builder/skeletons/config/nodefony/sequelize-bundle.js +122 -13
  63. package/cli/builder/skeletons/package.json.twig +57 -0
  64. package/cli/builder/skeletons/unittest/testFile.js +44 -45
  65. package/cli/builder/vue/skeletons/vue.config.js +84 -10
  66. package/cli/builder/vue/vueBuilder.js +116 -114
  67. package/cli/generate/generate.es6 +38 -39
  68. package/cli/install/install.js +45 -58
  69. package/cli/sequelize/sequelize.js +50 -39
  70. package/cli/start.js +353 -347
  71. package/cli/tools/pm2.es6 +55 -57
  72. package/cli/tools/tools.es6 +36 -37
  73. package/cli.es6 +280 -228
  74. package/container.es6 +51 -59
  75. package/error.es6 +25 -27
  76. package/fileClass.es6 +53 -55
  77. package/finder/file.es6 +5 -4
  78. package/finder/fileResult.es6 +23 -22
  79. package/finder/finder2.es6 +46 -54
  80. package/finder.es6 +88 -97
  81. package/kernel/annotations/annotations.es6 +44 -46
  82. package/kernel/api/api.es6 +6 -8
  83. package/kernel/api/graphqlApi.es6 +21 -21
  84. package/kernel/api/jsonApi.es6 +40 -45
  85. package/kernel/api/openApi.es6 +9 -11
  86. package/kernel/api/schemas/openApiSchema.js +61 -32
  87. package/kernel/babylon.es6 +31 -38
  88. package/kernel/bundle.es6 +252 -220
  89. package/kernel/cliKernel.es6 +157 -170
  90. package/kernel/command.es6 +17 -20
  91. package/kernel/commands/nodefonyCommand.es6 +111 -58
  92. package/kernel/commands/tasks/bundlesTask.es6 +14 -19
  93. package/kernel/controllers/controller.es6 +167 -180
  94. package/kernel/fixture.es6 +4 -7
  95. package/kernel/injections/injections.es6 +97 -103
  96. package/kernel/kernel.es6 +476 -384
  97. package/kernel/kernelWatcher.es6 +64 -54
  98. package/kernel/orm/entity.es6 +10 -12
  99. package/kernel/orm/orm.es6 +68 -48
  100. package/kernel/reader.es6 +45 -47
  101. package/kernel/security/encoder.es6 +8 -6
  102. package/kernel/security/factories/factory.es6 +34 -37
  103. package/kernel/security/factories/passeportFactory.es6 +13 -14
  104. package/kernel/security/provider.es6 +11 -13
  105. package/kernel/security/providers/chainProvider.es6 +13 -28
  106. package/kernel/security/providers/memoryProvider.es6 +7 -11
  107. package/kernel/security/providers/providerManager.es6 +11 -14
  108. package/kernel/security/providers/userEntityProvider.es6 +7 -8
  109. package/kernel/security/role.es6 +3 -3
  110. package/kernel/security/secureArea.es6 +143 -149
  111. package/kernel/security/tokens/token.es6 +30 -32
  112. package/kernel/security/user.es6 +19 -19
  113. package/kernel/serviceRealTime.es6 +5 -7
  114. package/kernel/services/connectionsService.es6 +20 -22
  115. package/kernel/services/cron/cronService.es6 +14 -16
  116. package/kernel/task.es6 +20 -26
  117. package/kernel/templates.es6 +4 -5
  118. package/kernel/templating/twig.es6 +56 -47
  119. package/kernel/tests/cliTest.js +7 -11
  120. package/kernel/tests/containerTest.js +25 -37
  121. package/kernel/tests/kernelTest.js +9 -16
  122. package/nodefony.es6 +279 -256
  123. package/notificationsCenter.es6 +28 -20
  124. package/package.json +40 -40
  125. package/protocol.es6 +19 -21
  126. package/protocols/bayeux.es6 +35 -38
  127. package/protocols/jsonRpc/jsonrpc.es6 +12 -14
  128. package/result.es6 +11 -12
  129. package/service.es6 +62 -62
  130. package/syslog/pdu.es6 +99 -91
  131. package/syslog/syslog.es6 +101 -102
  132. package/watcher.es6 +21 -20
  133. package/cli/builder/project/skeletons/jshintignore.skeleton +0 -1
  134. package/cli/builder/project/skeletons/jshintrc.skeleton +0 -60
  135. package/cli/builder/project/skeletons/package.json.skeleton +0 -52
  136. package/cli/builder/skeletons/package.json +0 -61
package/cli/tools/pm2.es6 CHANGED
@@ -1,30 +1,29 @@
1
1
  module.exports = class pm2Builder extends nodefony.Builder {
2
-
3
- constructor(cli) {
2
+ constructor (cli) {
4
3
  super(cli);
5
4
  this.choices = [];
6
5
  if (nodefony.isTrunk) {
7
- this.choices.push(`List PM2 Production Projects`);
8
- this.choices.push(`Log PM2 Production Project`);
9
- this.choices.push(`Stop PM2 Production Project`);
10
- this.choices.push(`Restart PM2 Production Project`);
11
- this.choices.push(`Delete PM2 Production Project`);
12
- this.choices.push(`Save PM2`);
13
- this.choices.push(`Startup PM2`);
14
- this.choices.push(`Unstartup PM2`);
15
- this.choices.push(`Install PM2 Logrotate`);
16
- this.choices.push(`Kill PM2 Deamon`);
6
+ this.choices.push("List PM2 Production Projects");
7
+ this.choices.push("Log PM2 Production Project");
8
+ this.choices.push("Stop PM2 Production Project");
9
+ this.choices.push("Restart PM2 Production Project");
10
+ this.choices.push("Delete PM2 Production Project");
11
+ this.choices.push("Save PM2");
12
+ this.choices.push("Startup PM2");
13
+ this.choices.push("Unstartup PM2");
14
+ this.choices.push("Install PM2 Logrotate");
15
+ this.choices.push("Kill PM2 Deamon");
17
16
  } else {
18
- this.choices.push(`List PM2 Production Projects`);
19
- this.choices.push(`Log PM2 Production Projects`);
20
- //this.choices.push(`Install PM2 Logrotate`);
21
- this.choices.push(`Kill PM2 Deamon`);
17
+ this.choices.push("List PM2 Production Projects");
18
+ this.choices.push("Log PM2 Production Projects");
19
+ // this.choices.push(`Install PM2 Logrotate`);
20
+ this.choices.push("Kill PM2 Deamon");
22
21
  }
23
22
  this.choices.push(this.cli.getSeparator());
24
23
  this.choices.push("Quit");
25
24
  }
26
25
 
27
- log(pci, severity, msgid, msg) {
26
+ log (pci, severity, msgid, msg) {
28
27
  try {
29
28
  if (!msgid) {
30
29
  msgid = "PM2";
@@ -35,53 +34,53 @@ module.exports = class pm2Builder extends nodefony.Builder {
35
34
  }
36
35
  }
37
36
 
38
- interaction() {
37
+ interaction () {
39
38
  return this.cli.prompt([{
40
- type: 'list',
41
- name: 'command',
42
- message: ' Nodefony CLI : ',
43
- default: 0,
44
- pageSize: this.choices.length,
45
- choices: this.choices,
46
- filter: (val) => {
47
- switch (val) {
48
- case "List PM2 Production Projects":
49
- return "list";
50
- case "Stop PM2 Production Project":
51
- return "stop";
52
- case "Restart PM2 Production Project":
53
- return "restart";
54
- case "Delete PM2 Production Project":
55
- return "delete";
56
- case "Log PM2 Production Projects":
57
- case "Log PM2 Production Project":
58
- return "logs";
59
- case "Save PM2":
60
- return "pm2-save";
61
- case "Startup PM2":
62
- return "pm2-startup";
63
- case "Unstartup PM2":
64
- return "pm2-unstartup";
65
- case "Install PM2 Logrotate":
66
- return "pm2-logrotate";
67
- case "Kill PM2 Deamon":
68
- return "kill";
69
- case "Quit":
70
- return "quit";
71
- default:
72
- console.log("\n");
73
- this.log(`command not found : ${val}`, "ERROR");
74
- this.cli.terminate(1);
75
- }
39
+ type: "list",
40
+ name: "command",
41
+ message: " Nodefony CLI : ",
42
+ default: 0,
43
+ pageSize: this.choices.length,
44
+ choices: this.choices,
45
+ filter: (val) => {
46
+ switch (val) {
47
+ case "List PM2 Production Projects":
48
+ return "list";
49
+ case "Stop PM2 Production Project":
50
+ return "stop";
51
+ case "Restart PM2 Production Project":
52
+ return "restart";
53
+ case "Delete PM2 Production Project":
54
+ return "delete";
55
+ case "Log PM2 Production Projects":
56
+ case "Log PM2 Production Project":
57
+ return "logs";
58
+ case "Save PM2":
59
+ return "pm2-save";
60
+ case "Startup PM2":
61
+ return "pm2-startup";
62
+ case "Unstartup PM2":
63
+ return "pm2-unstartup";
64
+ case "Install PM2 Logrotate":
65
+ return "pm2-logrotate";
66
+ case "Kill PM2 Deamon":
67
+ return "kill";
68
+ case "Quit":
69
+ return "quit";
70
+ default:
71
+ console.log("\n");
72
+ this.log(`command not found : ${val}`, "ERROR");
73
+ this.cli.terminate(1);
76
74
  }
77
- }])
75
+ }
76
+ }])
78
77
  .then((response) => {
79
78
  this.start(response);
80
79
  return response;
81
80
  });
82
81
  }
83
82
 
84
- start(response) {
83
+ start (response) {
85
84
  switch (response.command) {
86
85
  case "stop":
87
86
  return this.cli.setCommand("stop");
@@ -110,5 +109,4 @@ module.exports = class pm2Builder extends nodefony.Builder {
110
109
  return this.cli.setCommand("", "-h");
111
110
  }
112
111
  }
113
-
114
112
  };
@@ -1,26 +1,25 @@
1
1
  const builderInstall = require(path.resolve(__dirname, "..", "install", "install.js"));
2
2
 
3
3
  module.exports = class toolsBuilder extends nodefony.Builder {
4
-
5
- constructor(cli) {
4
+ constructor (cli) {
6
5
  super(cli);
7
6
  this.choices = [];
8
7
  if (nodefony.isTrunk) {
9
8
  if (nodefony.builded) {
10
- this.choices.push(`Webpack Dump`);
11
- this.choices.push(`Outdated Packages`);
12
- this.choices.push(`Clear Project`);
9
+ this.choices.push("Webpack Dump");
10
+ this.choices.push("Outdated Packages");
11
+ this.choices.push("Clear Project");
13
12
  } else {
14
- this.choices.push(`Clear Project`);
13
+ this.choices.push("Clear Project");
15
14
  }
16
15
  } else {
17
- this.choices.push(`Clear Project`);
16
+ this.choices.push("Clear Project");
18
17
  }
19
18
  this.choices.push(this.cli.getSeparator());
20
19
  this.choices.push("Quit");
21
20
  }
22
21
 
23
- log(pci, severity, msgid, msg) {
22
+ log (pci, severity, msgid, msg) {
24
23
  try {
25
24
  if (!msgid) {
26
25
  msgid = "TOOLS";
@@ -31,38 +30,38 @@ module.exports = class toolsBuilder extends nodefony.Builder {
31
30
  }
32
31
  }
33
32
 
34
- interaction() {
33
+ interaction () {
35
34
  return this.cli.prompt([{
36
- type: 'list',
37
- name: 'command',
38
- message: ' Nodefony CLI : ',
39
- default: 0,
40
- pageSize: this.choices.length,
41
- choices: this.choices,
42
- filter: (val) => {
43
- switch (val) {
44
- case `Clear Project`:
45
- return "clear";
46
- case `Webpack Dump`:
47
- return "webpack";
48
- case `Outdated Packages`:
49
- return "outdated";
50
- case "Quit":
51
- return "quit";
52
- default:
53
- console.log("\n");
54
- this.log(`command not found : ${val}`, "INFO");
55
- this.cli.terminate(1);
56
- }
35
+ type: "list",
36
+ name: "command",
37
+ message: " Nodefony CLI : ",
38
+ default: 0,
39
+ pageSize: this.choices.length,
40
+ choices: this.choices,
41
+ filter: (val) => {
42
+ switch (val) {
43
+ case "Clear Project":
44
+ return "clear";
45
+ case "Webpack Dump":
46
+ return "webpack";
47
+ case "Outdated Packages":
48
+ return "outdated";
49
+ case "Quit":
50
+ return "quit";
51
+ default:
52
+ console.log("\n");
53
+ this.log(`command not found : ${val}`, "INFO");
54
+ this.cli.terminate(1);
57
55
  }
58
- }])
56
+ }
57
+ }])
59
58
  .then((response) => {
60
59
  this.start(response);
61
- return response ;
60
+ return response;
62
61
  });
63
62
  }
64
63
 
65
- start(response) {
64
+ start (response) {
66
65
  switch (response.command) {
67
66
  case "clear":
68
67
  return this.cleanProject();
@@ -78,14 +77,15 @@ module.exports = class toolsBuilder extends nodefony.Builder {
78
77
  }
79
78
  }
80
79
 
81
- cleanProject(cwd = path.resolve(".")) {
80
+ cleanProject (cwd = path.resolve(".")) {
82
81
  try {
83
- let installer = new builderInstall(this.cli);
82
+ const installer = new builderInstall(this.cli);
84
83
  return installer.clear(cwd)
85
84
  .then(() => {
86
85
  this.log("Clean Project Complete");
87
86
  this.cli.terminate(0);
88
- }).catch((e) => {
87
+ })
88
+ .catch((e) => {
89
89
  this.log(e, "ERROR");
90
90
  throw e;
91
91
  });
@@ -94,5 +94,4 @@ module.exports = class toolsBuilder extends nodefony.Builder {
94
94
  throw e;
95
95
  }
96
96
  }
97
-
98
97
  };