@memef1f1y/dsh-plugin-tts 0.6.1 → 0.6.2

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 CHANGED
@@ -274,7 +274,7 @@ Hot-reload after editing `lib/` (on Windows a `file:` install is a COPY, not a
274
274
  symlink, so the running dsh reads the profile copy):
275
275
 
276
276
  ```powershell
277
- Copy-Item lib/* $env:USERPROFILE\.dsh\profiles\web\node_modules\@dsh-external\dsh-plugin-tts\lib\ -Recurse -Force
277
+ Copy-Item lib/* $env:USERPROFILE\.dsh\profiles\web\node_modules\@memef1f1y\dsh-plugin-tts\lib\ -Recurse -Force
278
278
  # then refresh the browser (bundles are re-read from disk per request; never use pnpm install --force)
279
279
  ```
280
280
 
package/README.zh.md CHANGED
@@ -244,7 +244,7 @@ npm run test:all # 全量:smoke + live + patch + i18n + client-load
244
244
  运行中的 dsh 读的是 profile 副本):
245
245
 
246
246
  ```powershell
247
- Copy-Item lib/* $env:USERPROFILE\.dsh\profiles\web\node_modules\@dsh-external\dsh-plugin-tts\lib\ -Recurse -Force
247
+ Copy-Item lib/* $env:USERPROFILE\.dsh\profiles\web\node_modules\@memef1f1y\dsh-plugin-tts\lib\ -Recurse -Force
248
248
  # 然后刷新浏览器即可(bundle 每次请求重新读盘;勿用 pnpm install --force 覆盖)
249
249
  ```
250
250
 
package/cordis.patch.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  # dsh-plugin-tts bundle: register the Edge TTS voice plugin (host routes + client UI).
2
2
  - insert:
3
3
  - id: tts
4
- name: '@dsh-external/dsh-plugin-tts'
4
+ name: '@memef1f1y/dsh-plugin-tts'
@@ -11,7 +11,7 @@
11
11
  | 项 | 要求 |
12
12
  |---|---|
13
13
  | 环境 | Node ≥ 22;`dsh web` 已启动并加载本插件;浏览器打开 dsh 页面 |
14
- | 代码同步 | 若用 `file:` 本地安装:Windows 先 `Copy-Item lib/* $env:USERPROFILE\.dsh\profiles\web\node_modules\@dsh-external\dsh-plugin-tts\lib\ -Recurse -Force` 再刷新页面;改完 lib/ 后建议重启一次 `dsh web` |
14
+ | 代码同步 | 若用 `file:` 本地安装:Windows 先 `Copy-Item lib/* $env:USERPROFILE\.dsh\profiles\web\node_modules\@memef1f1y\dsh-plugin-tts\lib\ -Recurse -Force` 再刷新页面;改完 lib/ 后建议重启一次 `dsh web` |
15
15
  | 快速确认新代码 | 设置 → 插件 → 语音 → RVC 配置 顶部出现「**RVC 失败时自动改用 Edge TTS**」勾选项 = 已是新版本 |
16
16
  | 音频 | 系统有声、浏览器非静音;先与页面交互一次(自动播放解锁) |
17
17
  | RVC(可选但建议) | 本地模型 .pth + `rvc-server.py`(默认 127.0.0.1:4892)——失败场景需要它「在场但可停止」 |
package/lib/client.js CHANGED
@@ -1,8 +1,8 @@
1
- // @dsh-external/dsh-plugin-tts — Client half (browser bundle).
1
+ // @memef1f1y/dsh-plugin-tts — Client half (browser bundle).
2
2
  // Hand-written in the harness module-loader format; `require` answers the
3
3
  // platform externals (react), everything else is inlined.
4
4
  window.__ModuleLoader__.load({
5
- id: "@dsh-external/dsh-plugin-tts",
5
+ id: "@memef1f1y/dsh-plugin-tts",
6
6
  factory: require => {
7
7
  var module = { exports: {} };
8
8
  var exports = module.exports;
package/lib/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // @dsh-external/dsh-plugin-tts — Host half.
1
+ // @memef1f1y/dsh-plugin-tts — Host half.
2
2
  // Registers webServer routes:
3
3
  // POST /dsh-tts-api/speak { text, voice } -> { url | jobId+chunks } | { error }
4
4
  // GET /dsh-tts-audio/<id> -> audio bytes
@@ -1939,7 +1939,7 @@ function loadRecentErrors() {
1939
1939
  }
1940
1940
  loadRecentErrors();
1941
1941
  // Plugin build identity for the exported log (best-effort; never throws).
1942
- let PLUGIN_META = { name: '@dsh-external/dsh-plugin-tts', version: 'unknown' };
1942
+ let PLUGIN_META = { name: '@memef1f1y/dsh-plugin-tts', version: 'unknown' };
1943
1943
  try {
1944
1944
  const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
1945
1945
  if (pkg && pkg.version) PLUGIN_META = { name: pkg.name || PLUGIN_META.name, version: String(pkg.version) };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@memef1f1y/dsh-plugin-tts",
3
3
  "description": "Edge TTS 语音大集成插件:消息朗读按钮、自动朗读开关、语音设置面板(Edge TTS / RVC / Index-TTS2 / CosyVoice / Google Cloud TTS)",
4
- "version": "0.6.1",
4
+ "version": "0.6.2",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=22"
package/tests/smoke.mjs CHANGED
@@ -1,4 +1,4 @@
1
- // Smoke test for the Host half of @dsh-external/dsh-plugin-tts.
1
+ // Smoke test for the Host half of @memef1f1y/dsh-plugin-tts.
2
2
  // Uses a fake ctx (webServer captures the routes) and exercises the real
3
3
  // Edge TTS synthesis over the network, the RVC chain against a mock local
4
4
  // RVC inference server, plus the voice-pack registry (mock static server).
@@ -97,6 +97,24 @@ const audioRoute = routes.find((r) => r.kind === 'prefix' && r.path === '/dsh-tt
97
97
 
98
98
  check('plugin registers two routes', speakRoute !== undefined && audioRoute !== undefined);
99
99
 
100
+ // Package identity consistency: the loader entry name (cordis.patch.yml)
101
+ // and the browser bundle id (lib/client.js) must both equal package.json's
102
+ // name. A stale name here ships a package that crashes dsh web at boot
103
+ // (loader imports a package name that isn't installed) — exactly the 0.6.1
104
+ // market-install boot failure.
105
+ {
106
+ const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
107
+ const pkgName = JSON.parse(readFileSync(path.join(repoRoot, 'package.json'), 'utf8')).name;
108
+ const patchText = readFileSync(path.join(repoRoot, 'cordis.patch.yml'), 'utf8');
109
+ const patchName = (patchText.match(/name:\s*['"]([^'"]+)['"]/m) || [])[1] || '';
110
+ const clientText = readFileSync(path.join(repoRoot, 'lib', 'client.js'), 'utf8');
111
+ const clientId = (clientText.match(/^\s*id:\s*"([^"]+)"/m) || [])[1] || '';
112
+ check('cordis.patch.yml entry name matches package.json name',
113
+ patchName === pkgName, `patch=${patchName} pkg=${pkgName}`);
114
+ check('client bundle id matches package.json name',
115
+ clientId === pkgName, `client=${clientId} pkg=${pkgName}`);
116
+ }
117
+
100
118
  if (speakRoute && audioRoute) {
101
119
  const res = await call(speakRoute, mockReq('/dsh-tts-api/speak', JSON.stringify({ text: '你好,这是一个冒烟测试。', voice: 'zh-CN-XiaoxuanNeural' })), mockRes());
102
120
  const parsed = JSON.parse(res.body);