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

wetw

v0.1.0

Published

tsdown bundler template

Readme

wetw CLI 使用说明

一个借鉴 shadcn-ui 思路的生成器:通过配置文件 + 组件注册表,把模板文件直接拷贝到你的项目中,方便二次定制。配置文件默认使用 wetw.config.ts(c12 原生支持)。

安装

pnpm add -D wetw

或在未安装的情况下临时调用:

npx wetw --help

快速开始

  1. 生成配置文件:
wetw init

会在当前目录写出 wetw.config.ts,默认输出目录是 wetw/,同时可选择框架类型(mp-weixin / uni-app vue3 / taro react)。

  1. 查看可用组件:
wetw list
  1. 添加组件(示例内置了一个 counter):
wetw add counter

生成的文件将落在配置的 outDir 下,例如 wetw/counter/*。所有样式使用 Tailwind 工具类内联,不再附带自定义样式文件;如需覆盖已有文件,加上 --force

配置示例

wetw.config.ts

import { defineConfig } from 'wetw'

export default defineConfig({
  outDir: 'wetw', // 生成目录,默认为 wetw
  framework: 'mp-weixin', // 可选:mp-weixin | uni-app-vue3 | taro-react
  // registry 可以是本地/远程 JSON,或直接写数组
  // registry: 'https://example.com/wetw/registry.json',
  // templatesRoot: './templates', // 用于解析 registry 文件中的相对 src
})

命令速查

  • wetw init [--config wetw.config.ts]:写入默认配置文件。
  • wetw list [--json]:输出当前 registry 中的组件清单。
  • wetw add <name...> [--force]:按名称生成组件文件。
  • 通用参数:--config 指定配置文件,--cwd 指定工作目录。

自定义 registry

一个最小的注册表示例(保存为 registry.json):

[
  {
    "name": "button",
    "description": "自定义按钮",
    "files": [
      { "path": "button/index.ts", "content": "export const btn = true" }
    ]
  }
]

wetw.config.ts 中指定:

export default defineConfig({
  registry: './registry.json',
})

随后执行 wetw add button 即可写入对应文件。

使用官方线上 registry

项目内置的线上清单可直接复用:

export default defineConfig({
  registry: 'https://tw.icebreaker.top/wetw/registry.json',
  framework: 'mp-weixin',
})

当前包含 countertag 两个示例组件,并为 mp-weixin / uni-app vue3 / taro react 分别提供模板。