@vulkano/core 0.7.0 → 0.8.0

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/app.js CHANGED
@@ -1,8 +1,13 @@
1
+ /* eslint-disable import/no-dynamic-require */
2
+
1
3
  /**
2
4
  * Bootstrap.js
3
5
  *
4
6
  */
5
7
 
8
+ // Start Time for logs
9
+ global.START_TIME = new Date();
10
+
6
11
  const dotenv = require('dotenv');
7
12
  const path = require('path');
8
13
  const moment = require('moment');
@@ -16,19 +21,34 @@ global.app = {};
16
21
  global._ = _;
17
22
  global.Promise = Promise;
18
23
 
24
+ const rootProject = path.resolve(process.cwd());
25
+
26
+ // Set the ABS_PATH
19
27
  if (!global.ABS_PATH) {
20
- global.ABS_PATH = path.resolve(__dirname, './');
28
+ global.ABS_PATH = path.resolve(rootProject, './');
21
29
  }
22
30
 
31
+ // Set the APP_PATH
23
32
  if (!global.APP_PATH) {
24
- global.APP_PATH = path.join(__dirname, './');
33
+ global.APP_PATH = path.resolve(rootProject, './app');
34
+ if (!fs.existsSync(APP_PATH)) {
35
+ global.APP_PATH = path.resolve(rootProject, './');
36
+ }
37
+ }
38
+
39
+ if (!fs.existsSync(APP_PATH)) {
40
+ console.log('the global var APP_PATH or directory not found', APP_PATH);
41
+ global.APP_PATH = path.resolve(__dirname, './');
25
42
  }
26
43
 
27
44
  if (!global.PUBLIC_PATH) {
28
- global.PUBLIC_PATH = path.join(__dirname, './');
45
+ global.PUBLIC_PATH = path.resolve(rootProject, './public');
46
+ if (!fs.existsSync(PUBLIC_PATH)) {
47
+ global.PUBLIC_PATH = path.resolve(rootProject, './');
48
+ }
29
49
  }
30
50
 
31
- global.CORE_PATH = path.join(__dirname, './');
51
+ global.CORE_PATH = __dirname;
32
52
 
33
53
  if (!fs.existsSync(APP_PATH)) {
34
54
  console.log('the global var APP_PATH or directory not found', APP_PATH);
@@ -50,7 +70,9 @@ const config = require('include-all')({
50
70
  optional: true
51
71
  });
52
72
 
73
+ //
53
74
  // Get package.json information
75
+ //
54
76
  const pkg = require(`${CORE_PATH}/package.json`);
55
77
  const appPkg = require(`${ABS_PATH}/package.json`);
56
78
 
@@ -246,6 +268,6 @@ function startVulkano() {
246
268
 
247
269
  });
248
270
 
249
- };
271
+ }
250
272
 
251
273
  module.exports = startVulkano;
@@ -12,7 +12,6 @@ const multer = require('multer');
12
12
  const helmet = require('helmet');
13
13
  const timeout = require('connect-timeout');
14
14
  const useragent = require('express-useragent');
15
- const webp = require('webp-middleware');
16
15
  const cookieParser = require('cookie-parser');
17
16
  const merge = require('deepmerge');
18
17
  const { createClient } = require('redis');
@@ -177,19 +176,6 @@ module.exports = {
177
176
  // ---------------
178
177
  server.use(responses);
179
178
 
180
- // ---------------
181
- // WEBP MIDDLEWARE - File: app/config/express/webp.js
182
- // ---------------
183
- if (expressConfig.webp && expressConfig.webp.enabled) {
184
- const cacheDir = expressConfig.webp.folder || `${PUBLIC_PATH}/webp-cache`;
185
- const webpConfig = {
186
- quality: expressConfig.webp.quality || 80,
187
- preset: expressConfig.webp.preset || 'photo',
188
- cacheDir: expressConfig.webp.cacheDir || cacheDir
189
- };
190
- server.use(webp(PUBLIC_PATH, webpConfig));
191
- }
192
-
193
179
  // ---------------
194
180
  // PUBLIC PATH - File: app/config/settings.js
195
181
  // ---------------
package/bun.lockb CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulkano/core",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "A MVC framework using Express 4",
5
5
  "license": "MIT",
6
6
  "author": "Vulkano Team",
@@ -60,9 +60,9 @@
60
60
  "promise.prototype.finally": "^3.1.8",
61
61
  "redis": "^4.6.13",
62
62
  "socket.io": "^4.7.5",
63
+ "socket.io-adapter": "^2.5.4",
63
64
  "socket.io-client": "4.7.5",
64
65
  "underscore": "^1.13.6",
65
- "webp-middleware": "^0.4.0",
66
66
  "yargs": "^17.7.2"
67
67
  },
68
68
  "devDependencies": {