dsh-docx2md 0.6.3 → 0.6.4

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 (2) hide show
  1. package/README.md +46 -14
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -50,18 +50,23 @@ WPS / Word 的私有二进制格式(MTEF),解出来必然失真。
50
50
 
51
51
  DSH 的 profile 用 **pnpm** 管理,`node_modules` 是 pnpm 管的(`nodeLinker: hoisted`)。
52
52
  **不要手工往 `node_modules` 里拷目录**——下次 `pnpm install` 会把没有写进
53
- lockfile 的目录删掉。走 pnpm 正规安装:
53
+ lockfile 的目录删掉。
54
54
 
55
- ```bash
56
- # 1. 把包放到 profile 外部(file: 依赖不能指向 node_modules 内部,会成自环)
57
- cp -r dsh-docx2md ~/.dsh/packages/dsh-docx2md
55
+ 本包已发布到 npm([`dsh-docx2md@0.6.4`](https://www.npmjs.com/package/dsh-docx2md)),
56
+ **日常使用直接装正式版本**,不依赖本地源码:
58
57
 
59
- # 2. 在 profile 里用 pnpm 安装(会写进 pnpm-lock.yaml)
58
+ ```bash
60
59
  cd ~/.dsh/profiles/desktop
61
- pnpm add file:~/../packages/dsh-docx2md
60
+ pnpm add dsh-docx2md@0.6.4 # 正式 npm 包(推荐,会写进 pnpm-lock.yaml)
61
+
62
+ # 或 DSH 安装器一条命令(等价于上面的 pnpm add)
63
+ dsh plugin --profile desktop add dsh-docx2md@0.6.4
64
+
65
+ # 或装版本固定的 GitHub Release tarball(与 npm 包字节一致,不需要 npm)
66
+ dsh plugin --profile desktop add https://github.com/stallenlu/dsh-docx2md/releases/download/v0.6.4/dsh-docx2md-0.6.4.tgz
62
67
  ```
63
68
 
64
- Windows 上路径要写成 `pnpm add file:C:/Users/<你>/.dsh/packages/dsh-docx2md`。
69
+ 升级时把 `@0.6.4` 换成新版本号即可。
65
70
 
66
71
  ### 声明的两处
67
72
 
@@ -69,7 +74,7 @@ Windows 上路径要写成 `pnpm add file:C:/Users/<你>/.dsh/packages/dsh-docx2
69
74
 
70
75
  ```jsonc
71
76
  {
72
- "dependencies": { "dsh-docx2md": "file:../../packages/dsh-docx2md" },
77
+ "dependencies": { "dsh-docx2md": "0.6.4" },
73
78
  "dsh": { "profile": { "bundles": [ /* ... */, "dsh-docx2md" ] } }
74
79
  }
75
80
  ```
@@ -79,6 +84,8 @@ Windows 上路径要写成 `pnpm add file:C:/Users/<你>/.dsh/packages/dsh-docx2
79
84
  **不要再往 profile 的 `cordis.patch.yml` 里手写 `insert`** —— 那会导致同一插件被
80
85
  注册两次。
81
86
 
87
+ `dependencies` 里写的是 **npm 版本号**(`pnpm add dsh-docx2md@0.6.4` 会自动写入这一行和 `pnpm-lock.yaml`);不要再写成 `file:` 路径或 `github:` 地址。
88
+
82
89
  ### 让配置改完立即生效
83
90
 
84
91
  profile 的 `package.json` 里加上:
@@ -91,22 +98,47 @@ profile 的 `package.json` 里加上:
91
98
  注意:技能列表走另一套机制(`dsh-skill-filesystem` 用 chokidar 监听文件),
92
99
  所以可能出现"技能已出现、工具还没出现"的中间状态——这不是 bug,重启即可。
93
100
 
94
- ### 从 Git 仓库安装
101
+ ### 本地开发(从源码安装)
102
+
103
+ 只有改本插件代码做开发时才需要这一节;日常使用请直接装上面的 npm 正式包。
104
+
105
+ ```bash
106
+ # 1. 把包放到 profile 外部(file: 依赖不能指向 node_modules 内部,会成自环)
107
+ cp -r dsh-docx2md ~/.dsh/packages/dsh-docx2md
108
+
109
+ # 2. 在 profile 里用 pnpm 安装(会写进 pnpm-lock.yaml)
110
+ cd ~/.dsh/profiles/desktop
111
+ pnpm add file:~/../packages/dsh-docx2md
112
+ ```
113
+
114
+ Windows 上路径要写成 `pnpm add file:C:/Users/<你>/.dsh/packages/dsh-docx2md`。
115
+ 也可以直接从 Git 仓库装开发中的版本:
95
116
 
96
117
  ```bash
97
118
  cd ~/.dsh/profiles/desktop
98
119
  pnpm add github:<你的账号>/dsh-docx2md
99
120
  ```
100
121
 
101
- 再把包名加进 `bundles`。本地开发时用 `file:` 装一次,之后改
102
- `~/.dsh/packages/dsh-docx2md` 里的文件即可——pnpm 建的是**硬链接**,改动
103
- 会立即反映到 `node_modules`(若用编辑器原子写入导致硬链接断开,
104
- 重跑一次 `pnpm install` 即可)。
122
+ 再把包名加进 `bundles`。装好之后改 `~/.dsh/packages/dsh-docx2md` 里的文件即可——
123
+ pnpm 建的是**硬链接**,改动会立即反映到 `node_modules`(若用编辑器原子写入导致
124
+ 硬链接断开,重跑一次 `pnpm install` 即可)。`file:` / `github:` 这类依赖只用于开发,
125
+ 正式环境请用 `dsh-docx2md@0.6.4`。
105
126
 
106
127
  ---
107
128
 
108
129
  ### 更新
109
130
 
131
+ **从 npm 安装时**,升级就是换版本号(lock 里记的是版本号 + integrity):
132
+
133
+ ```bash
134
+ cd ~/.dsh/profiles/desktop
135
+ pnpm add dsh-docx2md@<新版本> # 或 pnpm update dsh-docx2md
136
+ ```
137
+
138
+ 改完重启 DSH,跑一次 `docx2md_inspect` 确认行为符合预期。
139
+
140
+ > 下面「更新 / sync-check」几段只适用于**本地开发(`file:` 依赖)**;从 npm 安装无需这些步骤。
141
+
110
142
  `file:` 依赖在 lock 里记为 `type: directory`(不是版本号),所以 pnpm **不按版本判断
111
143
  是否需要更新**——它只是指向那个目录。因此“更新”要分三种情况:
112
144
 
@@ -166,7 +198,7 @@ pnpm remove dsh-docx2md
166
198
  ```
167
199
 
168
200
  然后从 `package.json` 的 `dsh.profile.bundles` 里删掉 `"dsh-docx2md"`,重启 DSH。
169
- `~/.dsh/packages/dsh-docx2md` 可以留着(下次重装直接用),也可以删掉。
201
+ 若曾用 `file:` 本地开发安装,`~/.dsh/packages/dsh-docx2md` 源码副本可留着下次用,也可以删掉;从 npm 安装则没有这个目录。
170
202
 
171
203
  验证是否干净:`node_modules/dsh-docx2md` 不存在、`pnpm-lock.yaml` 无记录、
172
204
  `bundles` 无条目。本仓库 `test/lifecycle.sh` 就是跑这套闭环的。
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-docx2md",
3
3
  "displayName": "DSH DOCX → Markdown",
4
4
  "description": "把含公式的 Word 文档转成带 LaTeX 的 Markdown —— OLE、Word 原生 OMML、图片公式三种载体都处理,跨平台,保留公式编号与结构。",
5
- "version": "0.6.3",
5
+ "version": "0.6.4",
6
6
  "author": "sidady",
7
7
  "keywords": [
8
8
  "dsh-plugin",