@vulkano/core 0.7.0 → 0.9.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 +31 -6
- package/bootstrap/server.js +0 -14
- package/bun.lockb +0 -0
- package/package.json +2 -2
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,37 @@ 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(
|
|
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.
|
|
33
|
+
global.APP_PATH = path.resolve(rootProject, './app');
|
|
34
|
+
if (!fs.existsSync(APP_PATH)) {
|
|
35
|
+
global.APP_PATH = path.resolve(rootProject, './vulkano');
|
|
36
|
+
if (!fs.existsSync(APP_PATH)) {
|
|
37
|
+
global.APP_PATH = path.resolve(rootProject, './');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (!fs.existsSync(APP_PATH)) {
|
|
43
|
+
console.log('the global var APP_PATH or the vulkano directory not found', APP_PATH);
|
|
44
|
+
global.APP_PATH = path.resolve(__dirname, './');
|
|
25
45
|
}
|
|
26
46
|
|
|
27
47
|
if (!global.PUBLIC_PATH) {
|
|
28
|
-
global.PUBLIC_PATH = path.
|
|
48
|
+
global.PUBLIC_PATH = path.resolve(rootProject, './public');
|
|
49
|
+
if (!fs.existsSync(PUBLIC_PATH)) {
|
|
50
|
+
global.PUBLIC_PATH = path.resolve(rootProject, './');
|
|
51
|
+
}
|
|
29
52
|
}
|
|
30
53
|
|
|
31
|
-
global.CORE_PATH =
|
|
54
|
+
global.CORE_PATH = __dirname;
|
|
32
55
|
|
|
33
56
|
if (!fs.existsSync(APP_PATH)) {
|
|
34
57
|
console.log('the global var APP_PATH or directory not found', APP_PATH);
|
|
@@ -50,7 +73,9 @@ const config = require('include-all')({
|
|
|
50
73
|
optional: true
|
|
51
74
|
});
|
|
52
75
|
|
|
76
|
+
//
|
|
53
77
|
// Get package.json information
|
|
78
|
+
//
|
|
54
79
|
const pkg = require(`${CORE_PATH}/package.json`);
|
|
55
80
|
const appPkg = require(`${ABS_PATH}/package.json`);
|
|
56
81
|
|
|
@@ -145,7 +170,7 @@ function startVulkano() {
|
|
|
145
170
|
console.log('');
|
|
146
171
|
console.log(colors.fg.cyan, ' 🌋', colors.reset);
|
|
147
172
|
console.log(colors.fg.cyan, ` APP VERSION ${appPkg.version}`, colors.reset);
|
|
148
|
-
console.log(colors.fg.cyan, `
|
|
173
|
+
console.log(colors.fg.cyan, ` @VULKANO/CORE ${pkg.version}`, colors.reset);
|
|
149
174
|
console.log('');
|
|
150
175
|
console.log(colors.fg.blue, '🔗 https://github.com/vulkanojs/vulkano', colors.reset);
|
|
151
176
|
console.log(colors.fg.cyan, '☕ https://buymeacoffee.com/argordmel', colors.reset);
|
|
@@ -246,6 +271,6 @@ function startVulkano() {
|
|
|
246
271
|
|
|
247
272
|
});
|
|
248
273
|
|
|
249
|
-
}
|
|
274
|
+
}
|
|
250
275
|
|
|
251
276
|
module.exports = startVulkano;
|
package/bootstrap/server.js
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "0.9.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": {
|