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

pax-miniprogram

v1.0.1

Published

Pax 小程序脚手架 - 快速创建基于 TDesign 的企业级小程序项目

Readme

pax-miniprogram

基于 Pax 模板快速创建微信小程序项目的 CLI 脚手架。

快速使用

npx pax-miniprogram my-app

创建后进入项目目录,安装依赖,用微信开发者工具打开即可:

cd my-app
npm install
# 微信开发者工具 → 导入项目 → 选择 my-app 目录

命令参数

# 基础用法(项目名即标题)
npx pax-miniprogram my-app

# 自定义小程序标题
npx pax-miniprogram my-app --title "我的管理系统"

# 查看帮助
npx pax-miniprogram --help

模板包含内容

template/
├── app.js                    # 应用入口
├── app.json                  # 应用配置(标题自动替换)
├── app.wxss                  # 全局样式(含 TDesign 主题变量)
├── package.json              # npm 依赖(tdesign-miniprogram)
├── project.config.json       # 微信项目配置(AppID 自动替换)
├── sitemap.json              # 站点地图
├── .gitignore                # Git 忽略规则
├── assets/                   # 静态资源(logo、通用样式)
├── behaviors/                # Behavior 复用(滚动渐变导航栏)
├── components/               # 自定义组件(navbar)
├── custom-tab-bar/           # 自定义 tabBar(TDesign tab-bar)
├── pages/
│   ├── index/                # 启动页(自动跳转)
│   ├── home/                 # 首页(问候+功能入口+公告)
│   ├── login/                # 登录页(微信/手机双模式)
│   └── profile/              # 个人中心
└── utils/
    ├── request.js            # 网络请求封装(JWT、拦截器)
    ├── userInfoAny.js        # 用户信息工具
    └── util.js               # 通用工具函数

模板变量

CLI 在复制模板时会自动替换以下占位符:

| 占位符 | 说明 | 示例值 | |--------|------|--------| | {{PROJECT_NAME}} | 项目名称 | my-app | | {{TITLE}} | 小程序标题(app.json) | 我的管理系统 | | {{APPID}} | 微信 AppID(留空,手动填) | `` | | {{DESCRIPTION}} | 项目描述 | 我的管理系统 - 基于 Pax 模板 |

如果需要更多变量,在 bin/index.jsreplaceVars 函数中添加即可。

本地调试

开发阶段不需要发布到 npm,直接本地测试:

cd publish/pax-miniprogram/cli

# 方式一:npm link(全局可用)
npm link
pax-miniprogram test-project

# 方式二:直接 node 执行
node bin/index.js test-project

# 测试完取消 link
npm unlink -g pax-miniprogram

常见问题

Q: npm publish 报 403? A: 包名可能被占用,改 package.json 中的 name,例如加组织前缀 @yourname/pax-miniprogram

Q: npx 执行时用的是缓存的旧版本? A: npx pax-miniprogram@latest my-app 强制使用最新版。

Q: 如何发布为私有包? A: 在 package.json 中加 "publishConfig": { "access": "restricted" },需要 npm 付费账号。

Q: 模板更新后用户能自动获取吗? A: 不能,npx pax-miniprogram 使用的是发布时的模板快照。更新后需重新 npm publish,用户下次执行 npx 会自动拉取最新版。