@dinoxx/dinox-cli 1.0.3 → 1.0.5
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 +36 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -88,7 +88,7 @@ dino info
|
|
|
88
88
|
## 第 1 步:登录
|
|
89
89
|
|
|
90
90
|
```bash
|
|
91
|
-
dino auth login "
|
|
91
|
+
dino auth login "<你的token>"
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
## 第 2 步:同步
|
|
@@ -253,7 +253,7 @@ dino note create --title "测试" --content "@.\note.md"
|
|
|
253
253
|
你还没有完成登录。执行:
|
|
254
254
|
|
|
255
255
|
```bash
|
|
256
|
-
dino auth login "
|
|
256
|
+
dino auth login "<token>"
|
|
257
257
|
```
|
|
258
258
|
|
|
259
259
|
## Q2:创建笔记时报 `Unknown tags` 或 `Unknown zettel box names`
|
|
@@ -282,13 +282,13 @@ dino box add "你的卡片盒"
|
|
|
282
282
|
|
|
283
283
|
## 8.2 `auth` 命令
|
|
284
284
|
|
|
285
|
-
### `dino auth login <
|
|
285
|
+
### `dino auth login <token>`
|
|
286
286
|
|
|
287
287
|
保存授权信息并验证连接。
|
|
288
288
|
|
|
289
289
|
| 参数 | 必填 | 说明 |
|
|
290
290
|
| --- | --- | --- |
|
|
291
|
-
| `<
|
|
291
|
+
| `<token>` | 是 | 登录 token,直接传 token 字符串(不需要 `Bearer` 前缀)。 |
|
|
292
292
|
|
|
293
293
|
支持全局参数:`--json`、`--sync-timeout`
|
|
294
294
|
|
|
@@ -520,3 +520,35 @@ dino <命令> <子命令> --help
|
|
|
520
520
|
dino note --help
|
|
521
521
|
dino note create --help
|
|
522
522
|
```
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
## 10. GitHub Action 自动发布 npm
|
|
527
|
+
|
|
528
|
+
仓库已内置工作流:`/Users/shanks/Documents/GitHub/dinox-cli/.github/workflows/publish-npm.yml`
|
|
529
|
+
|
|
530
|
+
### 10.1 先配置 Secret
|
|
531
|
+
|
|
532
|
+
在 GitHub 仓库设置里添加:
|
|
533
|
+
|
|
534
|
+
- `NPM_TOKEN`:npm 的 publish token(建议使用 granular token,并开启 bypass 2FA)
|
|
535
|
+
|
|
536
|
+
### 10.2 手动触发发布
|
|
537
|
+
|
|
538
|
+
1. 打开 GitHub 仓库 → **Actions** → **Publish NPM**
|
|
539
|
+
2. 点击 **Run workflow**
|
|
540
|
+
3. 选择参数:
|
|
541
|
+
- `dry_run`:`true` 只做演练,不真正发布
|
|
542
|
+
- `run_tests`:`true` 时会先执行测试
|
|
543
|
+
|
|
544
|
+
### 10.3 Push 自动触发
|
|
545
|
+
|
|
546
|
+
- 每次 push 到默认分支(当前为 `main`)会自动触发发布流程
|
|
547
|
+
- 为兼容分支命名迁移,workflow 也监听 `master`,但发布阶段会只允许默认分支执行
|
|
548
|
+
- 为防止递归触发,workflow 会跳过 `github-actions[bot]` 自己提交的版本 bump commit
|
|
549
|
+
|
|
550
|
+
### 10.4 工作流行为
|
|
551
|
+
|
|
552
|
+
- 只允许在仓库默认分支执行发布(默认分支改名后无需改 workflow 逻辑)
|
|
553
|
+
- 调用仓库脚本 `publish-npm.sh` 自动递增 patch 版本并发布
|
|
554
|
+
- 发布成功后自动提交 `package.json` 版本变更、打 `vX.Y.Z` tag 并 push 回仓库
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dinoxx/dinox-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Dinox CLI",
|
|
5
5
|
"main": "dist/dinox.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc -p tsconfig.json && node scripts/add-shebang.mjs",
|
|
8
8
|
"dev": "tsx src/dinox.ts",
|
|
9
9
|
"prepublishOnly": "npm run build",
|
|
10
|
-
"publish:npm": "sh
|
|
11
|
-
"publish:npm:dry-run": "sh
|
|
10
|
+
"publish:npm": "sh ./publish-npm.sh",
|
|
11
|
+
"publish:npm:dry-run": "sh ./publish-npm.sh --dry-run",
|
|
12
12
|
"start": "node dist/dinox.js",
|
|
13
|
-
"test": "node --test --import tsx test
|
|
13
|
+
"test": "node --test --import tsx test/*.test.ts"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [],
|
|
16
16
|
"author": "",
|