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 🙏

© 2025 – Pkg Stats / Ryan Hefner

hoolly

v1.0.9

Published

A template generator for creating TypeScript SDK projects

Downloads

142

Readme

Getting Started

hoolly 是一个由 Rust 编写的命令行工具,用于生成可直接发布的 TypeScript/React SDK 脚手架。

安装

通过 npm 安装(推荐)

npm install -g hoolly

安装后会自动尝试编译 Rust 二进制(需要 Rust 工具链)。如果没有 Rust,可以稍后手动编译。

从源码安装

# 克隆仓库
git clone https://github.com/whl555/leo-sdk-template.git
cd leo-sdk-template

# 使用 Cargo 安装
cargo install --path .

从源码快速体验

cargo run -- my-awesome-sdk

本地构建

cargo build --release
./target/release/hoolly --help

快速开始

hoolly my-awesome-sdk

CLI 会引导你选择模板、包管理器等信息;也可以使用 --defaults 快速生成:

hoolly my-awesome-sdk --defaults

常用参数

  • --defaults:跳过所有交互问题,使用默认配置
  • --with-examples:生成示例代码(若模板提供)
  • --with-ci:生成 GitHub Actions 工作流
  • --org <org>:组织名
  • --author <author>:作者名
  • --template <react-lib|ts-lib>:选择模板类型(默认 ts-lib
  • --package-manager <npm|pnpm|yarn>:指定首选包管理器

生成项目后的步骤

  1. 进入新项目目录:

    cd my-awesome-sdk
  2. 安装依赖(以 npm 为例):

    npm install
  3. 构建与测试:

    npm run build
    npm test
  4. 发布前检查与发布:

    npm run prepublishOnly
    npm publish

模板概览

ts-lib

  • 提供纯 TypeScript SDK 脚手架,默认导出 createClient 帮助函数。
  • 预置 Rollup 构建、类型声明与 Jest 测试配置。
  • 适合面向 Node.js/浏览器双端的逻辑 SDK。

react-lib

  • 包含示例 SdkSection 组件,展示如何构建组件型 SDK。
  • 同样提供 Rollup/Jest 配置,方便直接发布。
  • 默认标记 React 为 peer dependency,保持体积轻量。

定制建议

  • 修改 template/ts-libtemplate/react-lib 下的文件定制脚手架内容。
  • 根据团队习惯更新模板中的 rollup.config.jstsconfig*.jsonscripts/publish.js
  • 若需要更多模板类型,可在 template/ 目录新增子目录并扩展 Rust 版生成逻辑。

开发与发布

如果你想要贡献代码或发布 hoolly 工具本身到 npm:

版本管理

使用自动化脚本更新版本号(会同步更新 package.jsonCargo.toml):

# 增加补丁版本 (0.1.0 -> 0.1.1)
npm run version patch

# 增加次版本 (0.1.0 -> 0.2.0)
npm run version minor

# 增加主版本 (0.1.0 -> 1.0.0)
npm run version major

发布到 npm

# 确保已登录 npm
npm login

# 运行发布脚本(会自动构建、测试和发布)
npm run publish

发布脚本会自动:

  • ✅ 检查版本号一致性
  • ✅ 检查 npm 登录状态
  • ✅ 检查 Git 工作目录状态
  • ✅ 构建 Rust 二进制文件
  • ✅ 进行本地打包测试
  • ✅ 发布到 npm
  • ✅ 创建 Git tag 并推送

更多详情请查看 PUBLISH.md