From 74c169c1bbacdddfe5d0539caa80fcb45ec96282 Mon Sep 17 00:00:00 2001 From: kelvinwww <1970138194@qq.com> Date: Tue, 20 Oct 2026 23:14:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=BC=E5=87=BA=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=AD=90=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + CHANGELOG_EN.md | 1 + package.json | 1 + tests/plugin-meta.spec.ts | 7 ++++--- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1945ab5..469a7ed2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### v0.28.0 +- **导出插件图标子路径**:增加 `dsh-better-sidebar/icon` 包入口,方便其他包按 `exports` 规则读取 `icon.svg`。 - **正式版支持线前移到 DSH 0.2.1-rc.1+**:13 条 DSH peer 下限统一为 `^0.2.1-rc.1`,开发依赖、CI 与安装脚本使用精确 RC 基线。不新增运行时兼容层、不改功能实现。 - **沿用已发布 alpha 的功能**:上游 alpha.5 → rc.1 完整源码树差异共 355 项,全部为 `package.json`,源码零变化;本次仅同步版本、依赖声明与文档。伴随依赖调整为 Cordis peer `^4.0.5` / dev `4.0.5`、group `1.0.5`、schemastery `~3.18.5`,include 保持 `1.0.10`。 - **发布渠道切换至 npm `latest`**:插件 v0.28.0 即将接管 `latest`,现有 workflow 按正式版本号自动选择该标签,无需修改。**宿主 npm `latest` 此时仍是 0.2.0-rc.2,不能安装本版**;该宿主必须固定插件 **v0.26.1**。DSH 0.2.1-alpha.5 用户固定 **v0.28.0-alpha.0**;0.2.0-rc.1、0.1.7 及更早支持线保持原指引。用户已明确接受两个包的 `latest` 不对齐风险。 diff --git a/CHANGELOG_EN.md b/CHANGELOG_EN.md index f084a4e1..0a9a8628 100644 --- a/CHANGELOG_EN.md +++ b/CHANGELOG_EN.md @@ -6,6 +6,7 @@ ### v0.28.0 +- **Export the plugin icon subpath**: add the `dsh-better-sidebar/icon` package entry so other packages can resolve `icon.svg` through `exports`. - **Stable plugin support moves to DSH 0.2.1-rc.1+**: all 13 DSH peer floors are `^0.2.1-rc.1`; development dependencies, CI and installers pin the exact RC baseline. No runtime compatibility layer or feature implementation changes are introduced. - **Retain the published alpha's functionality**: the upstream alpha.5 → rc.1 full source-tree diff contains 355 files, all `package.json`, with no source changes. This release updates versions, dependency declarations and documentation only. Companion versions are Cordis peer `^4.0.5` / dev `4.0.5`, group `1.0.5`, schemastery `~3.18.5`, and unchanged include `1.0.10`. - **Move to npm `latest`**: v0.28.0 will take over the plugin's `latest` tag through the existing stable-version workflow; no workflow change is needed. **DSH's own `latest` still points to 0.2.0-rc.2 and cannot run this release**: pin plugin **v0.26.1** on that host. DSH 0.2.1-alpha.5 users pin **v0.28.0-alpha.0**; earlier support-line guidance is unchanged. The user explicitly accepted the independent tags' compatibility risk. diff --git a/package.json b/package.json index bd736238..b1406afc 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "default": "./lib/client.js" }, "./src/*": "./src/*", + "./icon": "./icon.svg", "./package.json": "./package.json", "./locale/*.json": "./locale/*.json" }, diff --git a/tests/plugin-meta.spec.ts b/tests/plugin-meta.spec.ts index 741ce94c..6235127f 100644 --- a/tests/plugin-meta.spec.ts +++ b/tests/plugin-meta.spec.ts @@ -63,9 +63,10 @@ describe('DSH plugin presentation metadata', () => { expect(pkg.files!).toContain(`${LOCALE_DIR}/*.json`) }) - it('exposes the locale documents and the manifest through exports', () => { - // `${name}/locale/` is how readPluginMeta resolves a translation, - // and `${name}/package.json` is how it reads the icon declaration. + it('exposes the icon, locale documents and manifest through exports', () => { + // DSH 通过 `${name}/locale/` 读取翻译,并通过 `${name}/package.json` 读取图标声明。 + // 其他消费者可以通过 `${name}/icon` 获取插件图标。 + expect(pkg.exports?.['./icon'], 'exports["./icon"]').toBe('./icon.svg') expect(pkg.exports?.['./locale/*.json'], 'exports["./locale/*.json"]').toBe('./locale/*.json') expect(pkg.exports?.['./package.json'], 'exports["./package.json"]').toBe('./package.json') })