@vulkano/core 1.18.0 → 1.19.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/.oxlintrc.json +42 -0
- package/.vscode/settings.json +14 -0
- package/app.js +51 -58
- package/bin/setup.js +3 -3
- package/biome.json +31 -0
- package/bootstrap/engines/handlebars.js +55 -0
- package/bootstrap/engines/index.js +31 -0
- package/bootstrap/engines/nunjucks.js +33 -0
- package/bootstrap/express.js +1 -1
- package/bootstrap/logger.js +2 -2
- package/bootstrap/responses.js +1 -1
- package/bootstrap/server.js +163 -289
- package/bootstrap/services.js +1 -1
- package/bootstrap/views.js +4 -7
- package/libs/Download.js +3 -3
- package/libs/Encrypter.js +1 -1
- package/libs/Filter.js +1 -1
- package/libs/VSError.js +1 -1
- package/libs/Vite.js +1 -1
- package/package.json +8 -17
- package/views/errors/handlebars/exception.html +48 -0
- package/views/errors/handlebars/no_action.html +63 -0
- package/views/errors/handlebars/no_controller.html +65 -0
- package/views/errors/handlebars/no_view.html +57 -0
package/bootstrap/services.js
CHANGED
package/bootstrap/views.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const path = require('path');
|
|
1
|
+
const path = require('node:path');
|
|
2
2
|
|
|
3
3
|
// Include all filters
|
|
4
4
|
const coreFilters = require('include-all')({
|
|
@@ -28,16 +28,13 @@ const appHelpers = require('include-all')({
|
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
module.exports = {
|
|
31
|
-
|
|
32
31
|
path: path.join(APP_PATH, 'views'),
|
|
33
32
|
|
|
34
33
|
engine: 'nunjucks',
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
coreFilters || {},
|
|
38
|
-
appFilters || {}
|
|
39
|
-
],
|
|
35
|
+
ext: '.html',
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
filters: [coreFilters || {}, appFilters || {}],
|
|
42
38
|
|
|
39
|
+
helpers: [coreHelpers || {}, appHelpers || {}]
|
|
43
40
|
};
|
package/libs/Download.js
CHANGED
package/libs/Encrypter.js
CHANGED
package/libs/Filter.js
CHANGED
package/libs/VSError.js
CHANGED
|
@@ -26,6 +26,6 @@ VSError.notFound = (n) => {
|
|
|
26
26
|
VSError.reject = (text, status, props) => Promise.reject(new VSError(text, status, props));
|
|
27
27
|
|
|
28
28
|
// Extending of native error object
|
|
29
|
-
require('util').inherits(VSError, Error);
|
|
29
|
+
require('node:util').inherits(VSError, Error);
|
|
30
30
|
|
|
31
31
|
module.exports = VSError;
|
package/libs/Vite.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulkano/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "A MVC framework using Express 4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Vulkano Team",
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
"vulkano": "./bin/vulkano.js"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
|
+
"format": "biome format --write .",
|
|
16
|
+
"lint": "oxlint . && biome check .",
|
|
15
17
|
"test": "jest",
|
|
16
18
|
"test:watch": "jest --watch",
|
|
17
19
|
"test:coverage": "jest --coverage",
|
|
@@ -42,6 +44,7 @@
|
|
|
42
44
|
"cron": "^4.1.0",
|
|
43
45
|
"dotenv": "^17.4.2",
|
|
44
46
|
"express": "^4.21.2",
|
|
47
|
+
"express-handlebars": "^9.0.1",
|
|
45
48
|
"express-jwt": "^8.5.1",
|
|
46
49
|
"express-session": "^1.18.1",
|
|
47
50
|
"express-useragent": "^2.1.0",
|
|
@@ -61,21 +64,9 @@
|
|
|
61
64
|
"undici": "^6.25.0"
|
|
62
65
|
},
|
|
63
66
|
"devDependencies": {
|
|
64
|
-
"@
|
|
65
|
-
"@babel/eslint-parser": "^7.26.8",
|
|
66
|
-
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
67
|
-
"@babel/plugin-syntax-jsx": "^7.25.9",
|
|
68
|
-
"@babel/preset-env": "^7.26.9",
|
|
69
|
-
"@babel/preset-react": "^7.26.3",
|
|
70
|
-
"@babel/preset-stage-1": "^7.8.3",
|
|
71
|
-
"eslint": "^8.57.0",
|
|
72
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
73
|
-
"eslint-import-resolver-alias": "^1.1.2",
|
|
74
|
-
"eslint-plugin-import": "^2.31.0",
|
|
75
|
-
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
76
|
-
"eslint-plugin-react": "^7.37.4",
|
|
77
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
|
67
|
+
"@biomejs/biome": "^2.4.15",
|
|
78
68
|
"jest": "^29.7.0",
|
|
79
|
-
"nodemon": "^3.1.14"
|
|
69
|
+
"nodemon": "^3.1.14",
|
|
70
|
+
"oxlint": "^1.64.0"
|
|
80
71
|
}
|
|
81
|
-
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!DOCTYPE HTML>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Oops! something was wrong :( - VulkanoJS</title>
|
|
5
|
+
<meta charset=UTF-8>
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css">
|
|
9
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
|
10
|
+
<style>
|
|
11
|
+
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
|
|
12
|
+
html { font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100% }
|
|
13
|
+
html, body { margin: 0; padding: 0; }
|
|
14
|
+
.flash { margin: 0; min-height: 32px; padding:3px 50px; background-repeat: no-repeat; background-position: 10px center; line-height: 1.7; border-radius: 2px; }
|
|
15
|
+
.error { color: #D8000C; background-color: #FFBABA; }
|
|
16
|
+
.info { color: #00529B; background-color: #BDE5F8; }
|
|
17
|
+
.valid { color: #4F8A10; background-color: #DFF2BF; }
|
|
18
|
+
.stack { color: #9F6000; background-color: #FEEFB3; }
|
|
19
|
+
pre { tab-size: 2; }
|
|
20
|
+
body { background: #f2f2f2; }
|
|
21
|
+
</style>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
<div id="vulkano-error">
|
|
25
|
+
<div class="flash error">
|
|
26
|
+
<h1>Internal Error</h1>
|
|
27
|
+
<p>
|
|
28
|
+
<strong>Error: {{statusCode}}</strong>
|
|
29
|
+
</p>
|
|
30
|
+
</div>
|
|
31
|
+
{{#if stack}}
|
|
32
|
+
<div class="flash stack">
|
|
33
|
+
<h2>Stack</h2>
|
|
34
|
+
<p>{{stack}}</p>
|
|
35
|
+
</div>
|
|
36
|
+
{{/if}}
|
|
37
|
+
</div>
|
|
38
|
+
<footer>
|
|
39
|
+
<div class="flash info">
|
|
40
|
+
<p><b>In PRODUCTION this error does not appear :), it shows the app error template:</b></p>
|
|
41
|
+
<p>/app/views/_shared/errors/500.html</p>
|
|
42
|
+
<p><span style="font-weight: normal">You can edit it as you want!</span></p>
|
|
43
|
+
</div>
|
|
44
|
+
</footer>
|
|
45
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/javascript.min.js"></script>
|
|
46
|
+
<script>hljs.highlightAll();</script>
|
|
47
|
+
</body>
|
|
48
|
+
</html>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<!DOCTYPE HTML>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Oops! something was wrong :( - VulkanoJS</title>
|
|
5
|
+
<meta charset=UTF-8>
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css">
|
|
9
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
|
10
|
+
<style>
|
|
11
|
+
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
|
|
12
|
+
html { font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100% }
|
|
13
|
+
html, body { margin: 0; padding: 0; }
|
|
14
|
+
.flash { margin: 0; min-height: 32px; padding:3px 50px; background-repeat: no-repeat; background-position: 10px center; line-height: 1.7; border-radius: 2px; }
|
|
15
|
+
.error { color: #D8000C; background-color: #FFBABA; }
|
|
16
|
+
.info { color: #00529B; background-color: #BDE5F8; }
|
|
17
|
+
.valid { color: #4F8A10; background-color: #DFF2BF; }
|
|
18
|
+
pre { tab-size: 2; }
|
|
19
|
+
body { background: #f2f2f2; }
|
|
20
|
+
.file { word-break: break-word; }
|
|
21
|
+
</style>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
<div id="vulkano-error">
|
|
25
|
+
<div class="flash error">
|
|
26
|
+
<h1>Action Not Found</h1>
|
|
27
|
+
<p>
|
|
28
|
+
<strong>Error: </strong>
|
|
29
|
+
The Action <b><em>{{action}}</em></b> does not exist or could not be found.
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="flash valid">
|
|
33
|
+
<h2>How To Fix:</h2>
|
|
34
|
+
<h4>
|
|
35
|
+
<strong>
|
|
36
|
+
Create the method <em>{{action}}</em> into the <em>{{vCamelCase controller}}Controller</em> to make it work correctly:
|
|
37
|
+
</strong>
|
|
38
|
+
</h4>
|
|
39
|
+
<pre><code>/**
|
|
40
|
+
* Controller:
|
|
41
|
+
* {{vCamelCase controller}}Controller.js
|
|
42
|
+
*/
|
|
43
|
+
module.exports = {
|
|
44
|
+
|
|
45
|
+
// Action to run
|
|
46
|
+
'{{action}}': (req, res) => {
|
|
47
|
+
res.render('{{vLowercase controller}}/index.html');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
};</code></pre>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<footer>
|
|
54
|
+
<div class="flash info">
|
|
55
|
+
<p><b>In PRODUCTION this error does not appear :), it shows the app error template:</b></p>
|
|
56
|
+
<p>/app/views/_shared/errors/404.html</p>
|
|
57
|
+
<p><span style="font-weight: normal">You can edit it as you want!</span></p>
|
|
58
|
+
</div>
|
|
59
|
+
</footer>
|
|
60
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/javascript.min.js"></script>
|
|
61
|
+
<script>hljs.highlightAll();</script>
|
|
62
|
+
</body>
|
|
63
|
+
</html>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!DOCTYPE HTML>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Oops! something was wrong :( - VulkanoJS</title>
|
|
5
|
+
<meta charset=UTF-8>
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css">
|
|
9
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
|
10
|
+
<style>
|
|
11
|
+
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
|
|
12
|
+
html { font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100% }
|
|
13
|
+
html, body { margin: 0; padding: 0; }
|
|
14
|
+
.flash { margin: 0; min-height: 32px; padding:3px 50px; background-repeat: no-repeat; background-position: 10px center; line-height: 1.7; border-radius: 2px; }
|
|
15
|
+
.error { color: #D8000C; background-color: #FFBABA; }
|
|
16
|
+
.info { color: #00529B; background-color: #BDE5F8; }
|
|
17
|
+
.valid { color: #4F8A10; background-color: #DFF2BF; }
|
|
18
|
+
pre { tab-size: 2; }
|
|
19
|
+
body { background: #f2f2f2; }
|
|
20
|
+
.file { word-break: break-word; }
|
|
21
|
+
</style>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
<div id="vulkano-error">
|
|
25
|
+
<div class="flash error">
|
|
26
|
+
<h1>Controller Not Found</h1>
|
|
27
|
+
<p>
|
|
28
|
+
<strong>Error: </strong>
|
|
29
|
+
<em>{{vCamelCase controller}}Controller</em> not exist or could not be found.
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="flash valid">
|
|
33
|
+
<h2>How To Fix:</h2>
|
|
34
|
+
<h4>
|
|
35
|
+
<strong>
|
|
36
|
+
Create the file <em>{{vCamelCase controller}}Controller</em> in the path:
|
|
37
|
+
<br>
|
|
38
|
+
<em class="file">/app/controllers/{{vLowercase controller}}_controller.js</em>
|
|
39
|
+
</strong>
|
|
40
|
+
</h4>
|
|
41
|
+
<pre><code>/**
|
|
42
|
+
* Controller:
|
|
43
|
+
* {{vCamelCase controller}}Controller.js
|
|
44
|
+
*/
|
|
45
|
+
module.exports = {
|
|
46
|
+
|
|
47
|
+
// Action to run - {{vLowercase controller}}/hello
|
|
48
|
+
'hello': (req, res) => {
|
|
49
|
+
res.render('{{vLowercase controller}}/index.html');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
};</code></pre>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<footer>
|
|
56
|
+
<div class="flash info">
|
|
57
|
+
<p><b>In PRODUCTION this error does not appear :), it shows the app error template:</b></p>
|
|
58
|
+
<p>/app/views/_shared/errors/404.html</p>
|
|
59
|
+
<p><span style="font-weight: normal">You can edit it as you want!</span></p>
|
|
60
|
+
</div>
|
|
61
|
+
</footer>
|
|
62
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/javascript.min.js"></script>
|
|
63
|
+
<script>hljs.highlightAll();</script>
|
|
64
|
+
</body>
|
|
65
|
+
</html>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!DOCTYPE HTML>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Oops! something was wrong :( - VulkanoJS</title>
|
|
5
|
+
<meta charset=UTF-8>
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css">
|
|
9
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
|
|
10
|
+
<style>
|
|
11
|
+
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
|
|
12
|
+
html { font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100% }
|
|
13
|
+
html, body { margin: 0; padding: 0; }
|
|
14
|
+
.flash { margin: 0; min-height: 32px; padding:3px 50px; background-repeat: no-repeat; background-position: 10px center; line-height: 1.7; border-radius: 2px; }
|
|
15
|
+
.error { color: #D8000C; background-color: #FFBABA; }
|
|
16
|
+
.info { color: #00529B; background-color: #BDE5F8; }
|
|
17
|
+
.valid { color: #4F8A10; background-color: #DFF2BF; }
|
|
18
|
+
pre { tab-size: 2; }
|
|
19
|
+
body { background: #f2f2f2; }
|
|
20
|
+
.file { word-break: break-word; }
|
|
21
|
+
</style>
|
|
22
|
+
</head>
|
|
23
|
+
<body>
|
|
24
|
+
<div id="vulkano-error">
|
|
25
|
+
<div class="flash error">
|
|
26
|
+
<h1>View Not Found</h1>
|
|
27
|
+
<p>
|
|
28
|
+
<strong>Error: </strong>
|
|
29
|
+
The template <b><em>{{view}}</em></b> does not exist or could not be found.
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="flash valid">
|
|
33
|
+
<h2>How To Fix:</h2>
|
|
34
|
+
<h4>
|
|
35
|
+
<strong>
|
|
36
|
+
Create the view <em>{{view}}</em> into the <em>{{APP_PATH}}/views</em> to make it work correctly.
|
|
37
|
+
</strong>
|
|
38
|
+
</h4>
|
|
39
|
+
</div>
|
|
40
|
+
{{#if stack}}
|
|
41
|
+
<div class="flash stack">
|
|
42
|
+
<h2>Stack</h2>
|
|
43
|
+
<p>{{stack}}</p>
|
|
44
|
+
</div>
|
|
45
|
+
{{/if}}
|
|
46
|
+
</div>
|
|
47
|
+
<footer>
|
|
48
|
+
<div class="flash info">
|
|
49
|
+
<p><b>In PRODUCTION this error does not appear :), it shows the app error template:</b></p>
|
|
50
|
+
<p>/app/views/_shared/errors/404.html</p>
|
|
51
|
+
<p><span style="font-weight: normal">You can edit it as you want!</span></p>
|
|
52
|
+
</div>
|
|
53
|
+
</footer>
|
|
54
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/javascript.min.js"></script>
|
|
55
|
+
<script>hljs.highlightAll();</script>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|