vona-module-a-static 5.0.26 → 5.0.28
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/dist/index.js +27 -28
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BeanInfo, BeanBase, compose, BeanScopeBase, SymbolModuleBelong } from 'vona';
|
|
2
|
+
import { __decorate } from 'tslib';
|
|
2
3
|
import assert from 'node:assert';
|
|
3
4
|
import { existsSync, mkdirSync } from 'node:fs';
|
|
4
5
|
import path from 'node:path';
|
|
@@ -14,25 +15,7 @@ const __ThisModule__ = 'a-static';
|
|
|
14
15
|
|
|
15
16
|
const SymbolStaticGetFullPathInner = Symbol('SymbolStaticGetFullPathInner');
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
let MiddlewareSystemStatic = (_dec$2 = MiddlewareSystem({
|
|
19
|
-
dependencies: 'a-instance:instance',
|
|
20
|
-
apiStaticPrefix: '/api/static/',
|
|
21
|
-
dirs: [],
|
|
22
|
-
dynamic: true,
|
|
23
|
-
preload: false,
|
|
24
|
-
maxFiles: 1000,
|
|
25
|
-
alias: {
|
|
26
|
-
'/favicon.ico': '/api/static/home/index/img/vona.png'
|
|
27
|
-
},
|
|
28
|
-
getFullPath
|
|
29
|
-
// maxAge: undefined,
|
|
30
|
-
// buffer: false,
|
|
31
|
-
// dir: '',
|
|
32
|
-
// prefix: '/', // should be always '/', so as to support ssr site
|
|
33
|
-
}), _dec2$2 = BeanInfo({
|
|
34
|
-
module: "a-static"
|
|
35
|
-
}), _dec$2(_class$2 = _dec2$2(_class$2 = class MiddlewareSystemStatic extends BeanBase {
|
|
18
|
+
let MiddlewareSystemStatic = class MiddlewareSystemStatic extends BeanBase {
|
|
36
19
|
constructor(...args) {
|
|
37
20
|
super(...args);
|
|
38
21
|
this._composer = void 0;
|
|
@@ -83,7 +66,6 @@ let MiddlewareSystemStatic = (_dec$2 = MiddlewareSystem({
|
|
|
83
66
|
if (newOptions.prefix) {
|
|
84
67
|
prefixs.push(newOptions.prefix);
|
|
85
68
|
}
|
|
86
|
-
|
|
87
69
|
// ensure directory exists
|
|
88
70
|
if (!existsSync(newOptions.dir)) {
|
|
89
71
|
mkdirSync(newOptions.dir, {
|
|
@@ -94,7 +76,25 @@ let MiddlewareSystemStatic = (_dec$2 = MiddlewareSystem({
|
|
|
94
76
|
}
|
|
95
77
|
return middlewares;
|
|
96
78
|
}
|
|
97
|
-
}
|
|
79
|
+
};
|
|
80
|
+
MiddlewareSystemStatic = __decorate([MiddlewareSystem({
|
|
81
|
+
dependencies: 'a-security:securities',
|
|
82
|
+
apiStaticPrefix: '/api/static/',
|
|
83
|
+
dirs: [],
|
|
84
|
+
dynamic: true,
|
|
85
|
+
preload: false,
|
|
86
|
+
maxFiles: 1000,
|
|
87
|
+
alias: {
|
|
88
|
+
'/favicon.ico': '/api/static/home/index/img/vona.png'
|
|
89
|
+
},
|
|
90
|
+
getFullPath
|
|
91
|
+
// maxAge: undefined,
|
|
92
|
+
// buffer: false,
|
|
93
|
+
// dir: '',
|
|
94
|
+
// prefix: '/', // should be always '/', so as to support ssr site
|
|
95
|
+
}), BeanInfo({
|
|
96
|
+
module: "a-static"
|
|
97
|
+
})], MiddlewareSystemStatic);
|
|
98
98
|
async function getFullPath(ctx, dir, filename, options) {
|
|
99
99
|
if (process.env.META_MODE === 'dev') {
|
|
100
100
|
ctx[SymbolStaticGetFullPathInner] = () => {
|
|
@@ -147,16 +147,15 @@ async function _getFullPathInner(ctx, dir, filename, options) {
|
|
|
147
147
|
return fullPath;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
let EventResolvePath = class EventResolvePath extends BeanEventBase {};
|
|
151
|
+
EventResolvePath = __decorate([Event(), BeanInfo({
|
|
152
152
|
module: "a-static"
|
|
153
|
-
}),
|
|
153
|
+
})], EventResolvePath);
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
let ScopeModuleAStatic = class ScopeModuleAStatic extends BeanScopeBase {};
|
|
156
|
+
ScopeModuleAStatic = __decorate([Scope(), BeanInfo({
|
|
157
157
|
module: "a-static"
|
|
158
|
-
}),
|
|
159
|
-
|
|
158
|
+
})], ScopeModuleAStatic);
|
|
160
159
|
/** scope: end */
|
|
161
160
|
|
|
162
161
|
class BeanAssetBase extends BeanBase {
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-module-a-static",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.28",
|
|
5
5
|
"title": "a-static",
|
|
6
6
|
"vonaModule": {
|
|
7
7
|
"dependencies": {},
|
|
8
8
|
"metas": {
|
|
9
9
|
"static": {
|
|
10
10
|
"scopeResource": true,
|
|
11
|
-
"boilerplate": "
|
|
11
|
+
"boilerplate": "static/boilerplate"
|
|
12
12
|
},
|
|
13
13
|
"asset": {
|
|
14
14
|
"scopeResource": true,
|
|
15
|
-
"boilerplate": "
|
|
15
|
+
"boilerplate": "asset/boilerplate"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
},
|