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

fortpanel-publish

v0.1.2

Published

Channel-aware release CLI for FortPanel (dev/beta/stable). Builds the FortPanel node binary and uploads it to a FortPanelAdmin instance for one-click panel-version distribution.

Readme

fortpanel-publish

Channel-aware release CLI for FortPanel —— 一条命令把面板源码编译并推送到 FortPanelAdmin 的版本仓库,供节点自动升级链路拉取。

FortPanel/deploy/release.sh + FortPanelAdmin/publish-skill/publish.sh 的纯 Node 重写,不再依赖 bash / Git Bash / WSL,Windows 上也能跑。

安装

npm i -g fortpanel-publish
fortpanel-publish --version

要发布得另外装:

  • Go 1.25+(交叉编译 FortPanel 后端)
  • Node 18+ / pnpm(构建 FortPanelWeb)
  • git

5 分钟上手

# 1. 准备凭据(放 ~/.config/fortpanel-publish/.env, mode 600)
mkdir -p ~/.config/fortpanel-publish
cat > ~/.config/fortpanel-publish/.env <<'EOF'
# HOST 可省略,默认 https://kadm.fortpanel.app
admin_token=fpk_xxxxxxxxxxxxxxxx
EOF
chmod 600 ~/.config/fortpanel-publish/.env

# 2. 进入 FortPanel 工作区(含 FortPanel/ + FortPanelWeb/ 同级目录)
cd ~/work/qp/FortPanel

# 3. 体检一遍
fortpanel-publish doctor

# 4. 先 dry-run 给老板看 changelog
fortpanel-publish release --channel dev --dry-run

# 5. 实际发布
fortpanel-publish release --channel dev

命令

release —— 编译并上传

fortpanel-publish release --channel <dev|beta|stable> [flags]

  --fortpanel-tag <tag>    FortPanel 仓的 tag (beta/stable 必填或取最新)
  --web-tag <tag>          FortPanelWeb 仓的 tag (同上)
  --arches <list>          逗号分隔, 默认 linux-amd64
                           例: --arches linux-amd64,linux-arm64
  --dry-run                只校验 + 生成 changelog,不构建不上传
  --workspace-root <path>  指定根目录,默认 cwd 向上找
  --out-dir <path>         二进制落地目录,默认 <root>/.deploy/fortpanel-release
  --publish-log-file <path> 发布公告(给终端用户)文件;内容由 fortpanel-publish-skill
                           据 changelog 生成,随上传写入面板的 publish_log

版本号:面板版本号是构建时刻 YY.MMDD.HHMM(定宽 → 字符串序即时间序),独立于 两仓 tag。构建时注入二进制 buildinfo.Version,节点据此(时间序)判断是否最新。两仓各自 的 tag/commit 作为元数据(fortpanel_tag/web_tag/git_commit/web_commit)随版本一并记录。

两类说明:notes = 变更日志(change log,本 CLI 按 commit 自动生成); publish_log = 发布公告(由 skill 据 change log 生成,面向终端用户)。

doctor —— 环境探测

fortpanel-publish doctor [--workspace-root <path>]

检查 go / git / node / npm / pnpm / .env / 工作区结构。

Channel 矩阵

| Channel | 触发条件 | Changelog 范围 | 失败拒绝条件 | |---|---|---|---| | dev | 两仓必须 master + clean | 最近 10 条 commit | 任一仓非 master / 工作树 dirty | | beta | 两仓 HEAD == 指定 tag(或最新) | 面板上该 channel 最新版本记录的 tag .. 本次 tag(各仓独立;查不到则回退本地上一个 git tag) | 本地 tag 不存在 / HEAD 不在 tag | | stable | 同 beta + 工作树 clean | 同 beta | 同 beta + tag 含 -beta/-rc/-alpha 后缀 |

凭据安全

  • admin_token 必须 fpk_ 前缀(FortPanelAdmin API Key)
  • HOST 可省略,默认 https://kadm.fortpanel.app
  • 绝不接受命令行 --admin-token / --token / --api-key / --build,会被前置 reject
  • 所有日志输出经 fpk_*** 脱敏
  • POSIX 下 .env 权限非 600 会告警(不强制拒绝;Windows 不检查)

环境变量

| Var | 用途 | |---|---| | HOST / ADMIN_TOKEN | 同 .envHOST / admin_token,优先级低于 .env(兼容旧 BUILD) | | FORTPANEL_PUBLISH_ENV | 覆盖 .env 路径 |

Exit Code

| Code | 含义 | |---|---| | 0 | 成功 | | 2 | 参数 / 前置校验错(含 token / channel / tag / 工作区) | | 4 | 构建 / 上传失败 |

与原 bash 脚本的关系

| 旧 | 新 | |---|---| | FortPanelAdmin/publish-skill/publish.sh | fortpanel-publish release | | FortPanel/deploy/release.sh | (内联到 release.ts) | | Windows 需 Git Bash | 纯 Node 跨平台 | | 凭据校验在 bash 里 | 同等的 reject + 0600 告警 |

旧版 bash publish-skill/移除;本 npm 包是唯一实现。

给 AI Agent

如果你是 Claude / Copilot / Codex 等 Agent,不要直接跑这个 CLI —— 走 fortpanel-publish-skill (同 family 的 SKILL.md 安装器),它会教 Agent 何时该用哪个 channel、--dry-run 流程、 失败 exit code 怎么解读。

License

MIT