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
@@ -8,19 +8,45 @@
8
8
  * By default nodefony create connector name nodefony
9
9
  * for manage Sessions / Users
10
10
  */
11
- module.exports = {
12
- mongoose: {
13
- debug: false,
14
- connectors: {
15
- nodefony: {
16
- host: "localhost",
17
- port: 27017,
18
- dbname: "nodefony",
19
- settings: {
20
- user: "",
21
- pass: ""
22
- }
11
+
12
+ let connectors = {}
13
+ const vault = async () => {
14
+ const serviceVault = kernel.get("vault");
15
+ return await serviceVault.getSecret({
16
+ path: "nodefony/data/database/mongo/connector/nodefony"
17
+ })
18
+ .then((secret) => {
19
+ return secret.data.data
20
+ })
21
+ .catch(e => {
22
+ throw e
23
+ })
24
+ }
25
+
26
+ switch (kernel.appEnvironment.environment) {
27
+ case "production":
28
+ case "development":
29
+ default:
30
+ connectors.nodefony = {
31
+ host: "localhost",
32
+ port: 27017,
33
+ dbname: "nodefony",
34
+ //credentials: vault,
35
+ settings: {
36
+ user: "nodefony",
37
+ pass: "nodefony",
38
+ maxPoolSize: 50,
39
+ useNewUrlParser: true,
40
+ serverSelectionTimeoutMS: 5000,
41
+ socketTimeoutMS: 5000,
42
+ connectTimeoutMS: 5000
23
43
  }
24
44
  }
45
+ }
46
+
47
+ module.exports = {
48
+ mongoose: {
49
+ debug: true,
50
+ connectors: connectors
25
51
  }
26
52
  };
@@ -4,12 +4,31 @@
4
4
  * see MONITORING BUNDLE config for more options
5
5
  *
6
6
  */
7
-
8
7
  module.exports = {
9
8
  debugBar: true,
10
9
  forceDebugBarProd: false,
11
10
  profiler: {
12
11
  active: false,
13
12
  storage: "orm"
14
- }
13
+ },
14
+ // entry point swagger Multi URL
15
+ swagger:{
16
+ projectName: "NODEFONY",
17
+ logo: "/app/images/app-logo.png",
18
+ urls: [{
19
+ url: "/api/users/documentation",
20
+ name: "users"
21
+ }, {
22
+ url: "/api/jwt/documentation",
23
+ name: "login"
24
+ }],
25
+ primaryName: "users"
26
+ },
27
+
28
+ // entry point graphigl monitoring only 1 URL (use merge in graphgl controller )
29
+ graphigl:{
30
+ projectName: "Nodefony Graphql Api",
31
+ logo: "/app/images/app-logo.png",
32
+ url:"/api/graphql"
33
+ },
15
34
  };
@@ -10,23 +10,22 @@
10
10
  * By default nodefony create connector name nodefony ( driver sqlite )
11
11
  * for manage Sessions / Users
12
12
  *
13
- * For mysql/mariadb create database nodefony before :
13
+ * Strategy sync or migrate Create Structure Database
14
14
  *
15
- * $ nodefony sequelize:create:database [force] => Create database
15
+ * Strategy sync
16
+ * $ nodefony sequelize:sync => Create Structure tables from Entity
16
17
  *
17
- * Synchronize entities :
18
- * $ nodefony sequelize:sync [force] => Create tables index ...
18
+ * Strategy migrate
19
+ * $ nodefony sequelize:migrate => Create Structure tables from migrate files
19
20
  *
20
- * Here create new databases connectors
21
- * and use for sync connectors :
22
- * nodefony sequelize:sync
23
21
  *
24
- * connectors: {
25
- * nodefony: {
22
+ * connectors: {
23
+ * nodefony: {
26
24
  * driver: "mysql",
27
25
  * dbname: 'nodefony',
28
26
  * username: 'nodefony',
29
27
  * password: 'nodefony',
28
+ * credentials: vault,
30
29
  * options: {
31
30
  * dialect: "mysql",
32
31
  * host: "localhost",
@@ -38,10 +37,120 @@
38
37
  * acquire:60000
39
38
  * }
40
39
  * }
41
- * }
42
- *
40
+ * },
41
+ * myconnector:{
42
+ * dbname: 'nodefony',
43
+ * username: 'postgres',
44
+ * password: 'nodefony',
45
+ * options: {
46
+ * dialect: "postgres",
47
+ * host: "localhost",
48
+ * port: "5432",
49
+ * pool: {
50
+ * max: 30,
51
+ * min: 0,
52
+ * idle: 10000,
53
+ * acquire: 60000
54
+ * },
55
+ * retry: {
56
+ * match: [
57
+ * Sequelize.ConnectionError,
58
+ * Sequelize.ConnectionTimedOutError,
59
+ * Sequelize.ConnectionRefusedError,
60
+ * Sequelize.TimeoutError,
61
+ * /Deadlock/i
62
+ * ],
63
+ * max: Infinit
64
+ * }
65
+ * }
66
+ * }
43
67
  */
68
+ let Transaction, Sequelize
69
+ if (nodefony.Sequelize) {
70
+ Transaction = nodefony.Sequelize.Transaction
71
+ Sequelize = nodefony.Sequelize.Sequelize
72
+ }
73
+
74
+ const vault = async () => {
75
+ const serviceVault = kernel.get("vault");
76
+ return await serviceVault.getSecret({
77
+ path: "nodefony/data/database/postgresql/connector/nodefony"
78
+ })
79
+ .then((secret) => {
80
+ return secret.data.data
81
+ })
82
+ .catch(e => {
83
+ throw e
84
+ })
85
+ }
86
+
87
+ const connectors = {}
88
+ switch (kernel.appEnvironment.environment) {
89
+ case "production":
90
+ case "development":
91
+ default:
92
+ connectors.nodefony = {
93
+ driver: 'sqlite',
94
+ dbname: path.resolve("app", "Resources", "databases", "nodefony.db"),
95
+ options: {
96
+ dialect: "sqlite",
97
+ //isolationLevel: Transaction.ISOLATION_LEVELS.SERIALIZABLE,
98
+ retry: {
99
+ match: [
100
+ //Sequelize.ConnectionError,
101
+ //Sequelize.ConnectionTimedOutError,
102
+ //Sequelize.TimeoutError,
103
+ /Deadlock/i,
104
+ 'SQLITE_BUSY'
105
+ ],
106
+ max: Infinity
107
+ },
108
+ pool: {
109
+ max: 5,
110
+ min: 0,
111
+ idle: 10000
112
+ }
113
+ }
114
+ }
115
+ /*connectors.nodefony = {
116
+ driver: "postgres",
117
+ dbname: 'nodefony',
118
+ username: 'postgres',
119
+ password: 'nodefony',
120
+ //credentials: vault,
121
+ options: {
122
+ dialect: "postgres",
123
+ host: "localhost",
124
+ port: "5432",
125
+ //isolationLevel: Transaction.ISOLATION_LEVELS.SERIALIZABLE,
126
+ retry: {
127
+ match: [
128
+ //Sequelize.ConnectionError,
129
+ //Sequelize.ConnectionTimedOutError,
130
+ //Sequelize.TimeoutError,
131
+ /Deadlock/i
132
+ ],
133
+ max: 5
134
+ },
135
+ pool: {
136
+ max: 20,
137
+ min: 0,
138
+ idle: 10000,
139
+ acquire: 60000
140
+ }
141
+ }
142
+ }*/
143
+ }
144
+
44
145
  module.exports = {
45
146
  debug: false,
46
- connectors: {}
47
- };
147
+ strategy: "migrate", // sync || migrate || none when nodefony build or nodefony install
148
+ connectors: connectors,
149
+ migrations: {
150
+ storage: "sequelize", // sequelize || memory || json
151
+ path: path.resolve(kernel.path, "migrations", "sequelize"),
152
+ seedeersPath: path.resolve(kernel.path, "migrations", "seedeers"),
153
+ storageSeedeers:"json",
154
+ options: {}
155
+ }
156
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "{{packageName}}",
3
+ "version": "1.0.0",
4
+ "description": "{{name}} description",
5
+ "author": "{{authorName}} <{{authorEmail}}>",
6
+ {% if packageName == "app" %}
7
+ "main": "appKernel.js",
8
+ {% else %}
9
+ "main": "{{name}}Bundle.js",
10
+ {% endif %}
11
+ "scripts": {},
12
+ "private": true,
13
+ "keywords": [
14
+ "nodefony",
15
+ "javascript",
16
+ "{{name}}"
17
+ ],
18
+ "repository": {},
19
+ "dependencies": {},
20
+ "devDependencies": {
21
+ {% if addons.workbox %}
22
+ "workbox-webpack-plugin": "7.0.0",
23
+ {% endif %}
24
+ {% if addons.bootstrap %}
25
+ "@popperjs/core": "2.11.8",
26
+ "bootstrap": "5.3.2",
27
+ "jquery": "3.7.1",
28
+ "font-awesome": "^4.7.0",
29
+ {% endif %}
30
+ {% if addons.webpack %}
31
+ "@babel/core": "7.23.0",
32
+ "@babel/preset-env": "7.22.20",
33
+ "babel-loader": "9.1.3",
34
+ "clean-webpack-plugin": "^4.0.0",
35
+ "css-hot-loader": "^1.4.4",
36
+ "css-loader": "6.8.1",
37
+ "expose-loader": "4.1.0",
38
+ "favicons": "7.1.4",
39
+ "favicons-webpack-plugin": "6.0.1",
40
+ "html-webpack-plugin": "5.5.3",
41
+ "imports-loader": "4.0.1",
42
+ "mini-css-extract-plugin": "2.7.6",
43
+ "sass": "1.69.2",
44
+ "sass-loader": "13.3.2",
45
+ "sitemap-webpack-plugin": "^1.1.1",
46
+ "style-loader": "3.3.3",
47
+ "terser-webpack-plugin": "5.3.9",
48
+ "webpack": "5.88.2",
49
+ "webpack-dev-server": "4.15.1",
50
+ "webpack-merge": "5.9.0",
51
+ {% endif %}
52
+ "@mapbox/node-pre-gyp": "1.0.11",
53
+ "node-gyp": "9.4.0"
54
+ },
55
+ "license": "",
56
+ "readmeFilename": "README.md"
57
+ }
@@ -1,47 +1,46 @@
1
- /*
2
- * MODEFONY FRAMEWORK UNIT TEST
3
- *
4
- * MOCHA STYLE
5
- *
6
- * In the global context you can find :
7
- *
8
- * nodefony : namespace to get library
9
- * kernel : instance of kernel who launch the test
10
- *
11
- *
12
- *
13
- */
14
- const assert = require('assert');
1
+ /*
2
+ * MODEFONY FRAMEWORK UNIT TEST
3
+ *
4
+ * MOCHA STYLE
5
+ *
6
+ * In the global context you can find :
7
+ *
8
+ * nodefony : namespace to get library
9
+ * kernel : instance of kernel who launch the test
10
+ *
11
+ *
12
+ *
13
+ */
14
+ const assert = require('assert');
15
+ const https = require('node:https');
15
16
 
16
- describe("BUNDLE {{testName}}", () => {
17
- beforeEach(() => {
18
- const requestClient = kernel.get("requestClient");
19
- const httpsServer = kernel.get("httpsServer");
20
- const certificats = httpsServer.getCertificats();
21
- const defaultOptions = {
22
- method: 'GET',
23
- timeout: 5000,
24
- agentOptions: {
25
- cert: certificats.cert,
26
- key: certificats.key,
27
- ca: certificats.ca
28
- }
29
- };
30
- const myurl = `https://${kernel.settings.system.domain}:${kernel.settings.system.httpsPort}`;
31
- global.request = requestClient.create(myurl, defaultOptions);
32
- });
17
+ describe("BUNDLE {{testName}}", () => {
18
+ beforeEach(() => {
19
+ const fetchService = kernel.get("fetch");
20
+ const httpsServer = kernel.get("httpsServer");
21
+ const certificats = httpsServer.getCertificats();
22
+ const httpsAgent = new https.Agent({
23
+ keepAlive: true,
24
+ cert: certificats.cert,
25
+ key: certificats.key,
26
+ ca: certificats.ca
27
+ });
28
+ const defaultOptions = {
29
+ method: 'GET',
30
+ agent: httpsAgent
31
+ };
32
+ global.url = `https://${kernel.settings.system.domain}:${kernel.settings.system.httpsPort}`;
33
+ global.fetch = fetchService.fetch
34
+ global.options = defaultOptions
35
+ });
33
36
 
34
- describe('ROUTE', () => {
35
-
36
- it("ROUTE {{routeName}} ", async () => {
37
- let options = {
38
- timeout: 1500
39
- };
40
- let result = await global.request.http("{{routeName}}", options);
41
- assert.equal(result.json.statusCode, 200);
42
- assert.equal(result.json.headers.server, "nodefony");
43
- });
44
-
45
- });
46
-
47
- });
37
+ describe('REQUEST ', () => {
38
+ it("FETCH REQUEST {{routeName}}", async () => {
39
+ let response = await global.fetch(`${global.url}/{{routeName}}`, global.options)
40
+ assert.equal(response.status, 200);
41
+ assert.equal(response.headers.get("server"), "nodefony");
42
+ let html = await response.text()
43
+ assert(html);
44
+ });
45
+ });
46
+ });
@@ -1,20 +1,54 @@
1
1
  // vue.config.js
2
+ const {
3
+ defineConfig
4
+ } = require('@vue/cli-service')
5
+ const webpack = require('webpack');
2
6
  const path = require('path');
3
- const package = require(path.resolve("package.json"));
4
- const packageVue = require(path.resolve("node_modules","vue","package.json"));
7
+ const Package = require(path.resolve("package.json"));
8
+ const packageVue = require(path.resolve("node_modules", "vue", "package.json"));
5
9
  const outputDir = path.resolve("Resources", "public");
6
10
  const indexPath = path.resolve("Resources", "views", 'index.html.twig');
7
11
  const publicPath = "/{{bundleName}}";
8
12
  const template = path.resolve('public', 'index.html');
9
- const { CleanWebpackPlugin } = require('clean-webpack-plugin');
10
- const title = package.name;
13
+ const {
14
+ CleanWebpackPlugin
15
+ } = require('clean-webpack-plugin');
16
+ const title = Package.name;
17
+ const nodeModule = path.resolve(process.cwd(), "node_modules");
11
18
 
12
- process.env.VUE_APP_VERSION = package.version;
19
+ {% if addons.vuetify %}
20
+ const vuetifyDir = path.dirname(require.resolve("vuetify"));
21
+ const packageVuetify = require(path.resolve(vuetifyDir, "..", "package.json"));
22
+ {% endif %}
23
+
24
+ process.env.VUE_APP_VERSION = Package.version;
13
25
  process.env.VUE_APP_VUE_VERSION = packageVue.version;
14
26
  process.env.VUE_APP_DEBUG = process.env.DEBUG_MODE;
15
27
  process.env.VUE_APP_NODE_ENV = process.env.NODE_ENV;
28
+ {% if addons.vuetify %}
29
+ process.env.VUE_APP_VUETIFY_VERSION = packageVuetify.version;
30
+ {% endif %}
31
+ try {
32
+ process.env.VUE_APP_DOMAIN = kernel.domain;
33
+ process.env.VUE_APP_HTTP_PORT = kernel.httpPort;
34
+ process.env.VUE_APP_HTTPS_PORT = kernel.httpsPort;
35
+ } catch (e) {}
36
+
37
+
38
+ let dev = true;
39
+ let debug = false
40
+ let watch = false
16
41
 
17
- module.exports = {
42
+ try {
43
+ if (kernel.environment !== "dev") {
44
+ dev = false;
45
+ } else {
46
+ watch = true;
47
+ }
48
+ debug = kernel.debug ? "*" : false;
49
+ } catch (e) {}
50
+
51
+ module.exports = defineConfig({
18
52
  lintOnSave: false,
19
53
  publicPath: publicPath,
20
54
  outputDir: outputDir,
@@ -26,14 +60,47 @@ module.exports = {
26
60
  .tap(args => {
27
61
  args[0].title = title;
28
62
  args[0].template = template;
63
+ args[0].chunks = ['app'];
29
64
  return args;
30
65
  });
31
66
  },
67
+
32
68
  configureWebpack: {
69
+ cache: true,
33
70
  devtool: process.env.NODE_ENV === "development" ? "source-map" : false,
71
+ watchOptions: {
72
+ aggregateTimeout: 2000,
73
+ ignored: /node_modules|assets|Resources|dist|tmp|public/,
74
+ followSymlinks: false
75
+ },
76
+ performance: {
77
+ hints: false,
78
+ maxEntrypointSize: 11000000,
79
+ maxAssetSize: 11000000
80
+ },
81
+ optimization: {
82
+ runtimeChunk: true,
83
+ removeAvailableModules: false,
84
+ removeEmptyChunks: false,
85
+ splitChunks: false,
86
+ },
34
87
  output:{
35
- hotUpdateChunkFilename:'hot/[id].[hash].hot-update.js',
36
- hotUpdateMainFilename: 'hot/[hash].hot-update.json'
88
+ hotUpdateChunkFilename: 'hot/[id].[fullhash].hot-update.js',
89
+ hotUpdateMainFilename: 'hot/[runtime].[fullhash].hot-update.json'
90
+ },
91
+ resolve: {
92
+ alias: {
93
+ "@bundles": path.join(__dirname, ".."),
94
+ "@app": path.join(__dirname, "..", "..", "..", "app"),
95
+ "vue": path.resolve(`./node_modules/vue`),
96
+ "vue-router": path.resolve(`./node_modules/vue-router`)
97
+ },
98
+ extensions: ['.js', '.json', '.css', '.mjs'],
99
+ fallback: {
100
+ "path": false,
101
+ "assert": false
102
+ },
103
+ modules: [nodeModule]
37
104
  },
38
105
  plugins: [
39
106
  new CleanWebpackPlugin({
@@ -45,11 +112,18 @@ module.exports = {
45
112
  protectWebpackAssets:true,
46
113
  cleanAfterEveryBuildPatterns:[],
47
114
  dangerouslyAllowCleanPatternsOutsideProject: true
48
- })
115
+ }),
116
+ new webpack.DefinePlugin({
117
+ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
118
+ 'process.env.NODE_DEBUG': JSON.stringify(debug)
119
+ }),
49
120
  ]
50
121
  }{% if addons.vuetify %},
122
+ pluginOptions: {
123
+ vuetify: {}
124
+ },
51
125
  transpileDependencies: [
52
126
  "vuetify"
53
127
  ]
54
128
  {% endif %}
55
- };
129
+ })