dsh-version-check 0.3.0 → 0.3.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/README.md +19 -2
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -89,9 +89,26 @@ npm run verify # 构建、类型检查与测试
|
|
|
89
89
|
|
|
90
90
|
## 发布
|
|
91
91
|
|
|
92
|
+
发布由 GitHub Actions 完成,认证使用 npm trusted publishing(OIDC),仓库里不保存 npm token。
|
|
93
|
+
|
|
94
|
+
- `.github/workflows/ci.yml`:推送到 `main` 与发起 pull request 时执行构建、类型检查与测试。
|
|
95
|
+
- `.github/workflows/publish.yml`:推送 `v*` tag 时执行同样的检查,然后执行 `npm publish` 发布到 `latest`。
|
|
96
|
+
|
|
97
|
+
发布前在 npmjs.com 打开包的 `Settings` 页面,在 `Trusted publishing` 里添加一个 GitHub Actions 发布者,这是只需要做一次的配置:
|
|
98
|
+
|
|
99
|
+
- Organization or user:`kerolt`
|
|
100
|
+
- Repository:`dsh-version-check`
|
|
101
|
+
- Workflow filename:`publish.yml`
|
|
102
|
+
- Allowed actions:勾选 `npm publish`
|
|
103
|
+
|
|
104
|
+
新建的发布者配置必须在 2 天内完成第一次成功发布,否则会失效。发布时自动生成 provenance 证明,这要求 npm CLI 不低于 11.5.1;工作流使用 Node 24,自带的 npm 满足要求。
|
|
105
|
+
|
|
106
|
+
发布步骤:
|
|
107
|
+
|
|
92
108
|
```sh
|
|
93
|
-
|
|
94
|
-
|
|
109
|
+
# 修改 package.json 里的 version 并提交到 main
|
|
110
|
+
git tag v0.4.0
|
|
111
|
+
git push origin v0.4.0
|
|
95
112
|
```
|
|
96
113
|
|
|
97
114
|
发布包只包含 `lib/`、`cordis.patch.yml`、`locale/`、`icon.svg`、`README.md` 与 `package.json`,源码与测试不进入发布包。安装到 profile 的 `node_modules` 后,DSH 从 `exports` 解析到 `lib/index.js` 与 `lib/client.js`,因此发布形态不依赖 Node 的类型剥离能力。
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-version-check",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "在 DSH Web 侧边栏底部显示 DSH 版本,从 npm 检查新版本,支持一键更新、把主程序回滚到更早的已发布版本,并在更新与回滚后自动重启服务;更新检查可在设置页里开关与调整。",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/kerolt/dsh-version-check.git"
|
|
8
|
+
},
|
|
5
9
|
"type": "module",
|
|
6
10
|
"main": "./lib/index.js",
|
|
7
11
|
"types": "./lib/index.d.ts",
|