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

dc-publish

v0.7.13

Published

项目发布命令行工具

Readme

@done-coding/cli-publish

项目发布命令行工具 - 自动化项目版本管理和发布流程

npm version License: MIT

安装

独立安装

npm install @done-coding/cli-publish
# 或
pnpm add @done-coding/cli-publish

作为 done-coding CLI 的一部分

npm install -g @done-coding/cli
# 然后使用
DC publish [command]

快速开始

# 独立使用
dc-publish [command]

# 作为主 CLI 的子命令
DC publish [command]

# 查看帮助
dc-publish --help

功能特性

  • 版本管理: 支持语义化版本号管理
  • 📦 多模式发布: 支持 npm 和 web 两种发布模式
  • 🏷️ 标签管理: 支持不同的发布标签(latest、next、alpha、beta、rc)
  • 🔄 Git 集成: 支持自动推送到远程仓库
  • ⚙️ 配置管理: 支持配置文件管理发布规则

API 文档

基础命令

dc-publish init

初始化配置文件

# 创建默认配置文件
dc-publish init

dc-publish (默认命令)

执行发布命令

# 使用默认配置发布
dc-publish

# 指定发布类型
dc-publish -t patch

# 指定发布模式
dc-publish -m npm

# 指定发布标签
dc-publish -d next

# 禁用推送到远程仓库
dc-publish -p false

dc-publish alias

别名发布

# 执行别名发布
dc-publish alias

命令选项

  • -R, --rootDir: 运行目录
  • -C, --configPath: 配置文件相对路径,默认为 ./.done-coding/publish.json
  • -m, --mode: 发布模式,可选值:npm(默认)、web
  • -t, --type: 发布类型,可选值:majorminorpatchpremajorpreminorprepatchprereleasecustom version
  • -p, --push: 是否推送至远程仓库,默认为 true
  • -d, --distTag: 发布标签,可选值:latestnextalphabetarc

使用示例

基础使用场景

# 1. 初始化配置
dc-publish init

# 2. 发布补丁版本
dc-publish -t patch

# 3. 发布到 next 标签
dc-publish -t minor -d next

# 4. 发布但不推送到远程仓库
dc-publish -t patch -p false

不同发布类型

# 主版本发布 (1.0.0 -> 2.0.0)
dc-publish -t major

# 次版本发布 (1.0.0 -> 1.1.0)
dc-publish -t minor

# 补丁版本发布 (1.0.0 -> 1.0.1)
dc-publish -t patch

# 预发布版本 (1.0.0 -> 1.0.1-0)
dc-publish -t prerelease

不同发布模式

# npm 模式发布
dc-publish -m npm

# web 模式发布
dc-publish -m web

作为主 CLI 的一部分

# Windows 系统
dc publish init
dc publish -t patch
dc publish alias

# macOS/Linux 系统
DC publish init
DC publish -t patch
DC publish alias

配置

通过 dc-publish init 命令可以初始化配置文件 .done-coding/publish.json

具体的配置选项需要查看初始化后生成的配置文件内容。

编程接口

本包提供了编程接口,具体的导出内容请查看包的类型定义文件。

故障排除

常见问题

Q: 配置文件找不到

# 检查配置文件是否存在
ls -la .done-coding/publish.json

# 重新初始化配置
dc-publish init

Q: 发布失败

# 检查 npm 登录状态
npm whoami

# 检查包名是否已存在
npm view @your-package-name

# 检查网络连接
npm ping

Q: Git 推送失败

# 检查 Git 远程仓库配置
git remote -v

# 检查 Git 认证
git config --list | grep user

# 禁用自动推送
dc-publish -p false

调试模式

# 查看版本信息
dc-publish --version

# 查看帮助信息
dc-publish --help

贡献指南

我们欢迎贡献!请遵循以下步骤:

  1. Fork 本仓库
  2. 创建功能分支:git checkout -b feature/amazing-feature
  3. 提交更改:git commit -m "feat: add amazing feature"
  4. 推送分支:git push origin feature/amazing-feature
  5. 创建 Pull Request

开发环境设置

# 克隆仓库
git clone https://gitee.com/done-coding/done-coding-cli.git
cd done-coding-cli/packages/publish

# 安装依赖
pnpm install

# 开发模式
pnpm dev

# 构建
pnpm build

# 本地开发测试
node es/cli.mjs --help

# 注意:本地使用 node + 入口文件,发布后使用 bin 命令名
# 功能完全一致,只是调用方式不同

许可证

MIT © JustSoSu

相关链接