weifuwu 0.27.20 → 0.27.22
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.d.ts +1 -1
- package/dist/index.js +12 -2
- package/dist/ssr/ui/assets.d.ts +2 -0
- package/dist/template/ui/app/layout.ts +3 -3
- package/dist/weifuwu-ui.js +1 -1
- package/package.json +1 -1
- package/dist/template/ui/lib/utils.ts +0 -7
package/dist/index.d.ts
CHANGED
|
@@ -66,4 +66,4 @@ export { loadModule, clearModuleCache } from './ssr/compile.ts';
|
|
|
66
66
|
export { cssContext, cssRouter, clearCSSCache } from './ssr/css.ts';
|
|
67
67
|
export type { CssAsset } from './ssr/css.ts';
|
|
68
68
|
export { assetRouter, assetScripts } from './ssr/assets.ts';
|
|
69
|
-
export { wfuwAssets } from './ssr/ui/assets.ts';
|
|
69
|
+
export { wfuwAssets, wfuwVersion } from './ssr/ui/assets.ts';
|
package/dist/index.js
CHANGED
|
@@ -3664,6 +3664,15 @@ import { readFileSync as readFileSync3 } from "node:fs";
|
|
|
3664
3664
|
import { resolve as resolve7, dirname } from "node:path";
|
|
3665
3665
|
import { fileURLToPath } from "node:url";
|
|
3666
3666
|
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
3667
|
+
var wfuwVersion = (() => {
|
|
3668
|
+
try {
|
|
3669
|
+
const js = readFileSync3(resolve7(__dirname, "weifuwu-ui.js"), "utf-8");
|
|
3670
|
+
const m = js.match(/WFU_VERSION = '([^']+)'/);
|
|
3671
|
+
return m ? m[1] : "0.0.0";
|
|
3672
|
+
} catch {
|
|
3673
|
+
return "0.0.0";
|
|
3674
|
+
}
|
|
3675
|
+
})();
|
|
3667
3676
|
function wfuwAssets() {
|
|
3668
3677
|
const router = new Router();
|
|
3669
3678
|
const jsPath = resolve7(__dirname, "weifuwu-ui.js");
|
|
@@ -3681,7 +3690,7 @@ function wfuwAssets() {
|
|
|
3681
3690
|
return new Response(jsContent, {
|
|
3682
3691
|
headers: {
|
|
3683
3692
|
"content-type": "application/javascript; charset=utf-8",
|
|
3684
|
-
"cache-control": "public, max-age=
|
|
3693
|
+
"cache-control": "public, max-age=31536000, immutable"
|
|
3685
3694
|
}
|
|
3686
3695
|
});
|
|
3687
3696
|
});
|
|
@@ -3696,7 +3705,7 @@ function wfuwAssets() {
|
|
|
3696
3705
|
return new Response(cssContent, {
|
|
3697
3706
|
headers: {
|
|
3698
3707
|
"content-type": "text/css; charset=utf-8",
|
|
3699
|
-
"cache-control": "public, max-age=
|
|
3708
|
+
"cache-control": "public, max-age=31536000, immutable"
|
|
3700
3709
|
}
|
|
3701
3710
|
});
|
|
3702
3711
|
});
|
|
@@ -3786,5 +3795,6 @@ export {
|
|
|
3786
3795
|
validate,
|
|
3787
3796
|
view,
|
|
3788
3797
|
wfuwAssets,
|
|
3798
|
+
wfuwVersion,
|
|
3789
3799
|
withTestDb
|
|
3790
3800
|
};
|
package/dist/ssr/ui/assets.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html, raw } from 'weifuwu'
|
|
1
|
+
import { html, raw, wfuwVersion } from 'weifuwu'
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
4
|
export default function (body: string, ctx: any) {
|
|
@@ -16,8 +16,8 @@ export default function (body: string, ctx: any) {
|
|
|
16
16
|
<meta charset="utf-8" />
|
|
17
17
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
18
18
|
<title>weifuwu</title>
|
|
19
|
-
<link rel="stylesheet" href="/__wfw/css/weifuwu-ui.css" />
|
|
20
|
-
<script src="/__wfw/js/weifuwu-ui.js"></script>
|
|
19
|
+
<link rel="stylesheet" href="/__wfw/css/weifuwu-ui.css?v=${wfuwVersion}" />
|
|
20
|
+
<script src="/__wfw/js/weifuwu-ui.js?v=${wfuwVersion}"></script>
|
|
21
21
|
<script id="__wfw-i18n" type="application/json">
|
|
22
22
|
${raw(JSON.stringify(messages))}
|
|
23
23
|
</script>
|
package/dist/weifuwu-ui.js
CHANGED
package/package.json
CHANGED