weifuwu 0.27.24 → 0.27.25
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/README.md +17 -9
- package/dist/template/AGENTS.md +3 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ Server-rendered HTML with zero frontend build tools. Uses `html()` tagged templa
|
|
|
69
69
|
for safe HTML rendering, and `weifuwu-ui.js` for client-side interactions.
|
|
70
70
|
|
|
71
71
|
```ts
|
|
72
|
-
import { Router, serve, html, raw, layout, view, wfuwAssets, theme, i18n, flash } from 'weifuwu'
|
|
72
|
+
import { Router, serve, html, raw, layout, view, wfuwAssets, wfuwVersion, theme, i18n, flash } from 'weifuwu'
|
|
73
73
|
|
|
74
74
|
const app = new Router()
|
|
75
75
|
|
|
@@ -125,7 +125,7 @@ html`<div>${html`<span>nested</span>`}</div>`
|
|
|
125
125
|
Wraps page HTML in a layout template. Multiple layouts nest naturally.
|
|
126
126
|
|
|
127
127
|
```ts
|
|
128
|
-
import { html, raw } from 'weifuwu'
|
|
128
|
+
import { html, raw, wfuwVersion } from 'weifuwu'
|
|
129
129
|
|
|
130
130
|
// ui/app/layout.ts
|
|
131
131
|
export default function (body: string, ctx: any) {
|
|
@@ -133,8 +133,8 @@ export default function (body: string, ctx: any) {
|
|
|
133
133
|
<html data-theme="${ctx.theme?.value || 'light'}">
|
|
134
134
|
<head>
|
|
135
135
|
<meta charset="utf-8" />
|
|
136
|
-
<link rel="stylesheet" href="/__wfw/css/weifuwu-ui.css" />
|
|
137
|
-
<script src="/__wfw/js/weifuwu-ui.js"></script>
|
|
136
|
+
<link rel="stylesheet" href="/__wfw/css/weifuwu-ui.css?v=${wfuwVersion}" />
|
|
137
|
+
<script src="/__wfw/js/weifuwu-ui.js?v=${wfuwVersion}"></script>
|
|
138
138
|
<script id="__wfw-i18n" type="application/json">
|
|
139
139
|
${raw(JSON.stringify(ctx.i18n?.messages || {}))}
|
|
140
140
|
</script>
|
|
@@ -172,11 +172,15 @@ import { wfuwAssets } from 'weifuwu'
|
|
|
172
172
|
app.use(wfuwAssets()) // serve /__wfw/js/weifuwu-ui.js + /__wfw/css/weifuwu-ui.css
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
In your layout:
|
|
175
|
+
In your layout (with cache-busting via `wfuwVersion`):
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
import { wfuwVersion } from 'weifuwu'
|
|
179
|
+
```
|
|
176
180
|
|
|
177
181
|
```html
|
|
178
|
-
<script src="/__wfw/js/weifuwu-ui.js"></script>
|
|
179
|
-
<link rel="stylesheet" href="/__wfw/css/weifuwu-ui.css" />
|
|
182
|
+
<script src="/__wfw/js/weifuwu-ui.js?v=${wfuwVersion}"></script>
|
|
183
|
+
<link rel="stylesheet" href="/__wfw/css/weifuwu-ui.css?v=${wfuwVersion}" />
|
|
180
184
|
```
|
|
181
185
|
|
|
182
186
|
---
|
|
@@ -565,9 +569,13 @@ import { wfuwAssets } from 'weifuwu'
|
|
|
565
569
|
app.use(wfuwAssets())
|
|
566
570
|
```
|
|
567
571
|
|
|
572
|
+
```ts
|
|
573
|
+
import { wfuwVersion } from 'weifuwu'
|
|
574
|
+
```
|
|
575
|
+
|
|
568
576
|
```html
|
|
569
|
-
<script src="/__wfw/js/weifuwu-ui.js"></script>
|
|
570
|
-
<link rel="stylesheet" href="/__wfw/css/weifuwu-ui.css" />
|
|
577
|
+
<script src="/__wfw/js/weifuwu-ui.js?v=${wfuwVersion}"></script>
|
|
578
|
+
<link rel="stylesheet" href="/__wfw/css/weifuwu-ui.css?v=${wfuwVersion}" />
|
|
571
579
|
```
|
|
572
580
|
|
|
573
581
|
### Standalone utilities
|
package/dist/template/AGENTS.md
CHANGED
|
@@ -4,12 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
This project uses weifuwu-ui.js — a zero-dependency frontend runtime (~5KB).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Must read**: `node_modules/weifuwu/README.md` for the full framework reference.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- **weifuwu-ui.css**: Button, form, card, modal, collapse, tabs, dropdown, toast styles
|
|
12
|
-
with CSS variable theming (light/dark mode via `data-theme` on `<html>`)
|
|
9
|
+
For weifuwu-ui.js attribute reference and component docs, see:
|
|
10
|
+
`node_modules/weifuwu/dist/docs/ssr/ui.md`
|
|
13
11
|
|
|
14
12
|
### Key attributes
|
|
15
13
|
|