dsh-theme-palette 1.4.1 → 1.4.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/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@
4
4
 
5
5
  ## 版本一览
6
6
 
7
+ ### 1.4.2
8
+ - **修复启动崩溃**:1.4.1 为了展示元数据加了 `exports`,但漏了 `"./client"` —— 宿主 `client-modules` 找不到 client bundle 时会让 **required 插件 `modules` 启动失败**,整个 profile 的插件全部不加载(重启后界面报错、插件消失)
9
+ - `exports` 现在显式列出 `./client`、`./client.js`、`./index.js`、`./cordis.patch.yml`、`./package.json`
10
+ - `tools/release.mjs` 增加守卫:声明了 `dsh.client` 就必须能解析 `exports["./client"]`,否则发版前直接失败
11
+
7
12
  ### 1.4.1
8
13
  - README 按 DSH 插件标准拆成五语:`README.md`(英文源)/ `README-zh.md` / `README-es.md` / `README-pt.md` / `README-hi.md`,章节结构完全一致
9
14
  - 补展示元数据:`locale/{en,zh}.json` 的 `meta.title`/`meta.description` + `exports` 暴露 `./locale/*.json` 与 `./icon`
package/client.js CHANGED
@@ -27,7 +27,7 @@ window.__ModuleLoader__.load({
27
27
  const React = require('react')
28
28
  const h = React.createElement
29
29
 
30
- const PLUGIN_VERSION = '1.4.1'
30
+ const PLUGIN_VERSION = '1.4.2'
31
31
  const STORE_KEY = 'dsh-theme-palette.v1'
32
32
  const OVERRIDE_SOURCE = 'dsh-theme-palette'
33
33
 
package/package.json CHANGED
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "name": "dsh-theme-palette",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "DSH 主题配色:4 套配色 × 明暗两模式,OKLCH 色域安全重建 + 真实承载面对比度求解,可调强度与面板表面。",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "exports": {
8
8
  ".": "./index.js",
9
+ "./client": "./client.js",
10
+ "./client.js": "./client.js",
11
+ "./index.js": "./index.js",
12
+ "./cordis.patch.yml": "./cordis.patch.yml",
9
13
  "./locale/*.json": "./locale/*.json",
10
- "./icon": "./icon.svg"
14
+ "./icon": "./icon.svg",
15
+ "./package.json": "./package.json"
11
16
  },
12
17
  "files": [
13
18
  "index.js",
package/tools/release.mjs CHANGED
@@ -12,7 +12,7 @@
12
12
  * 另外 latest 不保证自动前移,得验一次。
13
13
  */
14
14
  import { execFileSync } from 'node:child_process'
15
- import { readFileSync } from 'node:fs'
15
+ import { readFileSync, existsSync } from 'node:fs'
16
16
  import path from 'node:path'
17
17
  import { fileURLToPath } from 'node:url'
18
18
 
@@ -41,6 +41,19 @@ console.log(`\n发版 ${name}@${version}${has('dry') ? '(dry run)' : ''}\n`)
41
41
 
42
42
  // 1. 本地检查
43
43
  try { run(process.execPath, ['--check', 'client.js']); ok('client.js 语法') } catch { die('client.js 语法错误') }
44
+ // 1b. dsh.client 必须配 exports["./client"] —— 缺了宿主 client-modules 会直接启动失败
45
+ // (2026-10-21 实测:加 exports 却漏掉 ./client 导致重启后整个 profile 起不来)
46
+ {
47
+ const manifest = JSON.parse(readFileSync(path.join(root, 'package.json'), 'utf8'))
48
+ if (manifest.dsh && manifest.dsh.client) {
49
+ const clientRel = manifest.exports && manifest.exports['./client']
50
+ if (!clientRel) die('dsh.client 已声明但 exports 缺 "./client"(宿主会报 exports no "./client" bundle)')
51
+ const rel = typeof clientRel === 'string' ? clientRel : clientRel.default
52
+ if (typeof rel !== 'string' || !existsSync(path.join(root, rel))) die('exports["./client"] 指向的文件不存在:' + rel)
53
+ ok('client 子路径可解析:exports["./client"] → ' + rel)
54
+ }
55
+ }
56
+
44
57
  const dirty = sh('git status --porcelain')
45
58
  if (dirty) die('工作区不干净,先提交:\n' + dirty)
46
59
  ok('工作区干净')