vite-plugin-refresh-guard 0.2.0 → 0.2.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +30 -10
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # 更新日志
2
2
 
3
+ ## v0.2.1 (2026-10-08)
4
+
5
+ **补上从 0.2.0 起就欠的两件事**(两件都不改运行期行为):
6
+
7
+ - **README 重写**(10281B → 精简版):0.2.0 发布时 README 已经是精简后的版本,但 CHANGELOG
8
+ 没记,属于用户可见变化却无记录 —— 补上。README 随包发布,装 0.2.0 的用户拿到的就是这一版。
9
+ - **补 `.github/workflows/publish.yml`**:0.2.0 当初是手工 `npm publish` 发的,仓库既没有
10
+ tag 也没有发布工作流,于是 `prepublish-gate` / `readme-gate` **从未在 CI 上被触发过** ——
11
+ 门禁写了等于白写。本次改成 tag `v*` 触发(npm Trusted Publishing / OIDC)。
12
+
13
+
3
14
  ## v0.2.0 (2026-08-13)
4
15
 
5
16
  **dev 下改 CHANGELOG.md 即时热更新**:此前虚拟模块 `virtual:refresh-guard-changelog` 的内容在 dev server 启动时缓存,改了 CHANGELOG 必须重启 vite 才生效——在真实项目里踩到(改了日志以为没生效,重启才发现)。
package/README.md CHANGED
@@ -1,13 +1,33 @@
1
- # vite-plugin-refresh-guard
2
-
3
- 中文 | [English](./README.en.md)
4
-
5
- [![CI](https://github.com/webkubor/vite-plugin-refresh-guard/actions/workflows/ci.yml/badge.svg)](https://github.com/webkubor/vite-plugin-refresh-guard/actions/workflows/ci.yml)
6
- [![npm version](https://img.shields.io/npm/v/vite-plugin-refresh-guard.svg)](https://www.npmjs.com/package/vite-plugin-refresh-guard)
7
- [![license](https://img.shields.io/npm/l/vite-plugin-refresh-guard.svg)](./LICENSE)
8
- [![vite](https://img.shields.io/badge/vite-%3E%3D4%20%3C9-646CFF?logo=vite&logoColor=white)](https://vitejs.dev)
9
- [![vue](https://img.shields.io/badge/vue-%3E%3D3-4FC08D?logo=vue.js&logoColor=white)](https://vuejs.org)
10
- [![react](https://img.shields.io/badge/react-%3E%3D18-61DAFB?logo=react&logoColor=white)](https://react.dev)
1
+ <h1 align="center">🔄 vite-plugin-refresh-guard</h1>
2
+
3
+ <p align="center">
4
+ <strong>部署了新版本,接下来怎么办 —— 把这件事变成一行配置。</strong><br>
5
+ 静默刷新 / 提示后刷新 / 弹窗阻断,三选一写进 config;<br>
6
+ 核心逻辑与框架无关,Vue 与 React 各一层薄适配。
7
+ </p>
8
+
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/vite-plugin-refresh-guard"><img src="https://img.shields.io/npm/v/vite-plugin-refresh-guard?style=for-the-badge&color=4d6bfe&logo=npm&label=npm" alt="npm" /></a>
11
+ <a href="https://www.npmjs.com/package/vite-plugin-refresh-guard"><img src="https://img.shields.io/npm/dm/vite-plugin-refresh-guard?style=for-the-badge&color=6d7f9c&label=downloads" alt="downloads" /></a>
12
+ <a href="https://github.com/webkubor/vite-plugin-refresh-guard/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/webkubor/vite-plugin-refresh-guard/ci.yml?style=for-the-badge&label=CI" alt="CI" /></a>
13
+ <img src="https://img.shields.io/badge/vite-%3E%3D4%20%3C9-646CFF?style=for-the-badge&logo=vite&logoColor=white" alt="vite" />
14
+ <img src="https://img.shields.io/badge/vue-%3E%3D3-4FC08D?style=for-the-badge&logo=vue.js&logoColor=white" alt="vue" />
15
+ <img src="https://img.shields.io/badge/react-%3E%3D18-61DAFB?style=for-the-badge&logo=react&logoColor=white" alt="react" />
16
+ <img src="https://img.shields.io/badge/license-MIT-777?style=for-the-badge" alt="MIT" />
17
+ </p>
18
+
19
+ <p align="center">
20
+ <a href="./README.en.md">English</a> | 中文
21
+ </p>
22
+
23
+ ## Why This
24
+
25
+ | | 本插件 | 各项目自己写胶水 | 完全不管 |
26
+ |---|---|---|---|
27
+ | 策略是否显式 | ✅ 写进 config,三选一 | ❌ 散落各处,改一次跑偏一次 | ❌ 没有这回事 |
28
+ | 框架覆盖 | ✅ 核心无关 + Vue / React 适配 | ⚠️ 每个项目复制一遍 | — |
29
+ | 新版本探测 | ✅ 构建产物指纹比对 | ⚠️ 各写各的,边界情况没人管 | ❌ 无 |
30
+ | 用户拿到旧版本时 | ✅ 提示 / 弹窗文案可定制 | ⚠️ 看实现 | ❌ 静默跑旧代码 |
11
31
 
12
32
  给 Vite 项目做"部署了新版本,接下来怎么办"的可配置方案。
13
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-refresh-guard",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Vite 应用的可配置版本更新检测+刷新方案:静默自动刷新 / 提示后自动刷新 / 弹窗阻断,按产品需要选档位,核心逻辑框架无关,附 Vue/React 适配层。Configurable new-version detection + refresh for Vite apps — silent / toast-auto / modal-blocking, framework-agnostic core with Vue and React adapters.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -53,7 +53,7 @@
53
53
  "typecheck": "tsc --noEmit",
54
54
  "test": "vitest run",
55
55
  "compat": "npm run typecheck && npm test && npm run build",
56
- "prepublishOnly": "npm run build"
56
+ "prepublishOnly": "npm run build && node scripts/prepublish-gate.mjs && node scripts/readme-gate.mjs"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "react": ">=18",