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

@wyj-fe/wa-cli

v0.2.0

Published

web-admin 脚手架:一键生成完整的前后端工程(含 git/commitlint/husky/eslint/prettier 基建)

Readme

@wyj-fe/wa-cli

web-admin 脚手架:一键生成完整的前后端工程(Koa + Vue3 + Webpack5 + TypeScript), 并内置 git 提交规范(husky + commitlint)、eslint、prettier 等工程基建。

定位与 @wyj-fe/web-admin(框架库)分离:web-admin 是"库",wa-cli 是"脚手架", 类似 Vue 与 create-vue 的关系。

快速开始

# 1. 生成完整工程(在当前目录下)
npx @wyj-fe/wa-cli create

# 2. 安装依赖(npm/yarn 平铺提升开箱即用;pnpm 会自动生成 .npmrc 依赖提升)
pnpm install   # 或 npm install / yarn

# 3. 启动
pnpm dev        # 开发环境 Koa 服务(8080),TS 源码直接运行
pnpm dev:web    # 前端开发构建(HMR)

# 4. 生产构建与启动(业务侧产物统一输出到 dist/)
pnpm build
pnpm prod       # 等价于 _ENV=prod node dist/server.js

命令

wa-cli create         # 生成完整工程(默认全部生成)
wa-cli create app     # 只生成 app 目录
wa-cli create app config model

生成内容

|—— 根目录
  |—— app
    |—— controller(示例:user.ts)
    |—— service(示例:user.ts)
    |—— middleware
    |—— router(示例:user.ts)
    |—— router-schema(示例:user.ts)
    |—— extend
    |—— pages
      |—— dashboard(router.ts / source 示例)
      |—— widgets
    |—— middleware.ts
    |—— webpack.config.ts
    |—— public(内置静态资源)
  |—— config
    |—— config.default.ts / config.dev.ts / config.prod.ts
  |—— model
    |—— education(领域模型示例,用户只需修改这里即可快速看到效果)
  |—— types
    |—— index.d.ts
  |—— server.ts
  |—— tsconfig.json / tsconfig.node.json(内置 $sys* 与 $business* 别名,编译产物输出到 dist/)
  |—— eslint.config.mjs / .prettierrc.mjs / commitlint.config.js
  |—— .husky(pre-commit 执行 lint:check,commit-msg 执行 commitlint)
  |—— .npmrc(pnpm 场景自动生成,依赖提升)

使用说明

  • 用户只需修改 model/ 下的领域模型即可快速看到页面/接口效果
  • 自定义页面:app/pages/ 下新增 entry.xxx.ts + 页面组件
  • webpack 扩展:app/webpack.config.ts(与内置配置 webpack-merge)
  • 业务侧编译产物统一输出到 dist/,不污染源码目录

CJS / ESM 混用与 tsconfig

工程是 CJS 与 ESM 混用的,两套 tsconfig 各司其职:

  • tsconfig.json:IDE 类型检查 + 前端(app/pages/**)使用,module: ESNext + moduleResolution: Bundler,由 webpack 处理 ESM; 内置 $sys*$business* 路径别名
  • tsconfig.node.json:业务侧服务端编译(server.ts / app/controller / app/service / app/router / app/middleware / config / model), module: Node16(产物为 CommonJS,输出到 dist/),解析支持包 exports;因此业务侧服务端文件既可用 module.exports/require,也可用 import/export

路径别名

  • $sys*:框架内置别名(如 $sysSchemaTable$sysCurl$sysTypes),指向已安装的 @wyj-fe/web-admin; 构建期由框架 webpack 自动解析,IDE 由 tsconfig paths 解析
  • $business*:业务侧别名(如 $businessPages/*$businessCommon/*$businessTypes/*), 自动指向当前工程 app/pagestypes 等目录,构建期同样由框架 webpack 自动解析
  • 类型导入:import type { Model } from "@wyj-fe/web-admin/types"(包 exports 已映射,两者均可)

注意:template/ 下的 tsconfig 是为“生成后的工程”准备的,其中路径指向已安装的 @wyj-fe/web-admin。 在 wa-cli 仓库内(未安装依赖)打开时 IDE 对模版文件报“找不到模块/类型”等提示属正常现象, 生成工程并执行 pnpm install 后即消失。

维护

npm pack --dry-run   # 检查发布内容(必须包含 bin/ 与 template/)
npm publish          # 发布到 npm(scope 包需要 --access public)