@nitro/app 8.1.1 → 9.0.1
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/core/config.js +1 -1
- package/app/lib/utils.js +6 -0
- package/app/lib/view.js +16 -0
- package/package.json +11 -8
package/app/core/config.js
CHANGED
package/app/lib/utils.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const path = require('path');
|
|
4
|
+
const config = require('config');
|
|
4
5
|
|
|
5
6
|
function getServerPath() {
|
|
6
7
|
return path.normalize(path.join(__dirname, '..', 'scripts', 'server'));
|
|
7
8
|
}
|
|
8
9
|
|
|
10
|
+
function getValidThemes() {
|
|
11
|
+
return config.has('themes') && Array.isArray(config.get('themes')) ? config.get('themes') : false;
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
module.exports = {
|
|
10
15
|
getServerPath,
|
|
16
|
+
getValidThemes,
|
|
11
17
|
};
|
package/app/lib/view.js
CHANGED
|
@@ -110,7 +110,23 @@ function getViewCombinations(action) {
|
|
|
110
110
|
return pathes;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* @param req the express request object
|
|
116
|
+
* @returns {boolean}
|
|
117
|
+
*/
|
|
118
|
+
function isView(req) {
|
|
119
|
+
return !req.path.match(/^\/favicon.ico/) &&
|
|
120
|
+
!req.path.match(/^\/api\//) &&
|
|
121
|
+
!req.path.match(/^\/assets\//) &&
|
|
122
|
+
!req.path.match(/^\/content\//) &&
|
|
123
|
+
!req.path.match(/^\/proto\//) &&
|
|
124
|
+
!req.path.match(/^\/reports\//) &&
|
|
125
|
+
!req.path.match(/^\/static\//);
|
|
126
|
+
}
|
|
127
|
+
|
|
113
128
|
module.exports = {
|
|
114
129
|
getViews,
|
|
115
130
|
getViewCombinations,
|
|
131
|
+
isView,
|
|
116
132
|
};
|
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitro/app",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.1",
|
|
4
4
|
"description": "Nitro server",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"repository":
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/merkle-open/generator-nitro.git"
|
|
9
|
+
},
|
|
7
10
|
"author": "The Nitro Team",
|
|
8
11
|
"engines": {
|
|
9
|
-
"node": ">=
|
|
10
|
-
"npm": ">=8.
|
|
12
|
+
"node": ">=18.12.0 <21",
|
|
13
|
+
"npm": ">=8.19.2 <11"
|
|
11
14
|
},
|
|
12
15
|
"bin": {
|
|
13
|
-
"nitro-app-validate-pattern-data": "
|
|
14
|
-
"nitro-app-serve": "
|
|
16
|
+
"nitro-app-validate-pattern-data": "bin/validate-pattern-data.js",
|
|
17
|
+
"nitro-app-serve": "bin/serve.js"
|
|
15
18
|
},
|
|
16
19
|
"scripts": {
|
|
17
20
|
"lint": "eslint .",
|
|
@@ -50,13 +53,13 @@
|
|
|
50
53
|
"jasmine-core": "5.1.1",
|
|
51
54
|
"lodash": "4.17.21",
|
|
52
55
|
"twig": "1.13.3",
|
|
53
|
-
"webpack": "4.
|
|
56
|
+
"webpack": "4.47.0",
|
|
54
57
|
"webpack-dev-middleware": "5.3.3",
|
|
55
58
|
"webpack-hot-middleware": "2.25.4"
|
|
56
59
|
},
|
|
57
60
|
"devDependencies": {
|
|
58
61
|
"@merkle-open/eslint-config": "3.0.0",
|
|
59
|
-
"eslint": "8.
|
|
62
|
+
"eslint": "8.53.0",
|
|
60
63
|
"eslint-plugin-import": "2.29.0"
|
|
61
64
|
},
|
|
62
65
|
"publishConfig": {
|