npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-deep-sleep

v0.1.0

Published

DSH plugin: swap the official web UI's in-progress status label "Deep diving..." for "Deep sleep...".

Readme

dsh-deep-sleep

DSH 插件:把官方 Web UI 中任务进行中的状态提示 "Deep diving..." 替换为 "Deep sleep..."

  • 纯 client 插件:host 半部为空壳(no-op),全部逻辑在浏览器侧 lib/client.js
  • 零运行时依赖:client 半部不 import 任何模块;host 半部仅 type-only 引用 cordis(构建期擦除)
  • 幂等替换:MutationObserver 拦截插入/改写,React 每次重建标签都会被再次替换
  • 零源码 patch:不碰 DSH checkout 任何文件,纯官方扩展缝(bundle insert 行 + dsh.client 声明)

原理

官方 dsh-client-ui-conversationTurnStatus 组件把 "Deep diving..." 硬编码在 JSX 里(无 slot、无 locale key,属官方零扩展点),因此按插件惯例在浏览器侧做文本替换:任何包含 "Deep diving" 的文本节点被改写为 "Deep sleep"(保留 "..." 后缀)。

替换是幂等的;React 的 HostText fiber 在 props 不变时不会重写 DOM 文本节点,所以替换结果能扛住 TurnStatus 每秒一次的时钟重渲染;即使官方将来写回旧文本,观察器也会再次替换。

安装

# 从 npm 安装(首选)
dsh plugin --profile web add dsh-deep-sleep

# 或从 git 直装(预构建策略,无需 allowBuilds 授权)
dsh plugin --profile web add github:peach0x33a/dsh-deep-sleep

# 或本地目录(开发/验证)
dsh plugin --profile web add /path/to/dsh-deep-sleep

安装后重启 dsh web,浏览器硬刷新(Ctrl+Shift+R),任务进行中即可看到 "Deep sleep..."。

开发

pnpm install        # 仅 devDependencies(全部公共包,无 private peer)
pnpm run typecheck  # tsc --noEmit
pnpm test           # vitest(jsdom):patch 行为 + 构建产物契约
pnpm run build      # tsdown 双 bundle:lib/index.mjs(host ESM)+ lib/client.js(browser CJS)

预构建策略:lib/ 入库(不进 .gitignore),无 prepare 脚本;改源码后必须 pnpm run build 并提交 lib/

检查

  • [ ] package.jsondsh.bundle.patch + dsh.clientplatform: "web"immediately: true
  • [ ] exports["./client"] 指向构建产物 lib/client.js
  • [ ] lib/client.jswindow.__ModuleLoader__.load({ id: "dsh-deep-sleep", factory }) 包裹,factory 返回 { name, inject, apply }test/bundle-contract.test.js 断言)
  • [ ] cordis.patch.yml 含 insert 行(id / name 齐全)
  • [ ] host 半部不导出 default(A6)
  • [ ] peerDependencies = cordis(optional),无 devDependencies 冒充
  • [ ] pnpm test 全绿