Skip to content

chore: 统一 npm 安装并停止追踪 lib - #84

Merged
taekchef merged 9 commits into
omdsh-dev:mainfrom
wang-kaopu:fix/npm-only-install
Aug 28, 2026
Merged

chore: 统一 npm 安装并停止追踪 lib#84
taekchef merged 9 commits into
omdsh-dev:mainfrom
wang-kaopu:fix/npm-only-install

Conversation

@wang-kaopu

@wang-kaopu wang-kaopu commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #77
Addresses #83

背景

目前 dsh-genui 同时维护 npm 和 GitHub 源安装,但 GitHub 安装已经多次带来额外兼容问题:

也就是说,GitHub 源已经不只是“多一种安装方式”,而是会持续产生安装、更新、包改名和市场兼容成本。

为什么统一到 npm

当前一些高 star DSH 项目已经采用类似模式:

  • zhu1090093659/dsh-web-ui:正式安装全部走 npm,GitHub checkout 仅用于开发调试;
  • omdsh-dev/DSH-better-sidebar:正式安装和更新走 npm package,源码安装单独作为开发流程;
  • ccch1mneyyy/dsh-TUI:同样以 npm 一键安装作为主要发布方式。

因此这里也收敛为:GitHub 作为 source,npm 作为 installable release。

正式安装只保留:

dsh plugin --profile web add @changfenhuang/dsh-genui

本 PR

  • README / README.zh-CN 删除 GitHub 源正式安装入口,只保留 npm;
  • scripts/install.sh 改为 npm 安装,不再检查或依赖系统 Git;
  • e2e 安装模式由 git 改为 npm
  • lib/ 改为纯构建产物并停止提交;
  • 删除 CI / release 对 committed lib/ 的 freshness check;
  • 继续保留 pnpm run check、build、verify-pack 和 release publish,npm 包仍然会在发布时完整生成并验证 lib/

对 dsh-market 的改善

#83 中市场从 README 获取到了 Git 安装路径,导致已通过 npm 安装的插件在“更新”时反而走 Git。

统一 npm 后,仓库只向市场暴露一个正式安装目标:

@changfenhuang/dsh-genui

这样可以避免后续 catalog/market 再在 npm 与 Git 两种安装源之间做错误选择。

已有的 market 缓存数据可能仍需要重新抓取 / probe 一次,但仓库侧不再继续产生歧义。

仓库维护收益

停止追踪 lib/ 后,源码 PR 不再同时重写 lib/client.js 等 generated bundle:

src 变更
  ↓
CI build / test
  ↓
release 时生成 lib
  ↓
npm package

可以直接减少:

  • 并行 PR 对 lib/client.js 的高频冲突;
  • generated diff 对 code review 的干扰;
  • 每个源码 PR 都必须同步构建产物的维护成本;
  • bundler / TypeScript 升级产生的大量无业务意义 diff。

构建产物仍由 CI 和 release 严格验证,只是不再把它作为源码仓库的一部分长期维护。

@taekchef 这是一个破坏性更新,需要决策确认。

@taekchef taekchef left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同意方案 A:统一 npm 安装、停止追踪 lib/。README/脚本/e2e/CI 改动都核对过,与本意一致。感谢整理,合并!Closes #77

@taekchef
taekchef merged commit 4cffdba into omdsh-dev:main Aug 28, 2026
2 checks passed
@wang-kaopu
wang-kaopu deleted the fix/npm-only-install branch August 29, 2026 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: 决定 lib/ 构建产物跟踪与 Git tag 安装策略

2 participants