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

rndoc-cli

v2.1.0

Published

rndoc 的命令行工具,用于开发文档站点、构建组件库产物(ES/CJS/UMD)及生成 API 文档。

Readme

rndoc-cli

rndoc 的命令行工具,用于开发文档站点、构建组件库产物(ES/CJS/UMD)及生成 API 文档。

安装

在已有项目中安装(推荐):

pnpm add -D rndoc-cli
# 或
npm i -D rndoc-cli

命令

| 命令 | 说明 | | ------------------ | -------------------------------------------------------------------- | | rndoc dev | 启动文档开发服务器 | | rndoc build | 生产模式构建组件(产出 dist/esdist/cjs 及可选的 bundle) | | rndoc docs-build | 生产模式构建文档站点(产出到 docs-distbuild.site.outputDir) | | rndoc preview | 预览已构建的文档站点 | | rndoc clean | 清理所有构建产物(如 dist.rndoc 等) | | rndoc test | 使用 Jest 运行单测,支持 --watch--updateSnapshot 等选项 |

配置文件

  • 站点与构建行为:在项目根目录使用以下任一文件配置
    rndoc.config.ts / rndoc.config.js / rndoc.config.mjs / rndoc.config.json
  • 组件构建(Babel 转译):使用 CLI 内置的 .rndoc.build.cjs,或通过 build 配置传入的路径;配置会与根目录 rndoc 配置中的 build 合并。

构建说明

两段构建

  • Vite 打包:可选。将入口打成整包(如 dist/xxx.es.min.jsdist/xxx.umd.min.js)。由 build.bundle 控制。
  • Babel 转译:将 src 按文件转成 dist/esdist/cjs(及可选的 dist/lib 等),供按需引用。

压缩

  • 整包(bundle)build.bundle 为对象时,可用 minifyEsminifyUmd 控制 ES/UMD 是否压缩,默认均为 true
  • 按文件产物(dist/es、dist/cjs):由 Babel 构建配置中的 esm.minifycjs.minify 控制;CLI 默认配置已开启,可在项目侧或 .rndoc.build.cjs 中改为 false 关闭。

常用 build 配置示例

// rndoc.config.ts
export default {
  build: {
    // 关闭整包,只保留 dist/es、dist/cjs
    bundle: false,
    // 或开启整包并指定格式与压缩
    // bundle: { formats: ['es', 'umd'], minifyEs: true, minifyUmd: true },
    bundleDir: '', // bundle 输出子目录,相对 dist
    esm: { minify: true }, // 与 Babel 转译的 es 产物一致
    cjs: { minify: true },
    transform: true, // 是否执行 Babel 转译
    packageJson: true, // 是否同步 package.json 的 exports、files 等
  },
};

更多选项(如 resolve.includessitemenusnavs 等)见 rndoc 官网 与类型定义。

发布本包(维护者)

不要packages/cli 下直接执行 pnpm publish。本包依赖 rndoc-themerndoc-theme-default 等 workspace 包,需在仓库根目录走统一发布流程。

原则:只改了哪个包就只给该包升级发包,其他包不需要升级。

# 在仓库根目录
cd /path/to/rndoc
pnpm changeset    # 只勾选要发的包(如 rndoc-cli)和版本类型(patch/minor/major)
pnpm release      # 应用版本、安装、构建、发布

release:patch 会对所有包执行 patch 并发布,仅在确实需要全量发时使用。