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

scaffold-engine

v0.3.0

Published

Requirement-driven scaffold engine for analyze, draft, validate, and generate workflows.

Readme

Scaffold Monorepo

多项目 monorepo 脚手架,包含 apiadminmobilesharedshared-auth

快速启动

# 1. 进入 scaffold 目录
cd scaffold

# 2. 安装依赖(首次或依赖变更后)
pnpm install

# 3. 初始化数据库(首次)
pnpm init-db

# 4. 启动 API 服务
pnpm dev:api

启动成功后访问:

  • API 服务: http://localhost:3001
  • API 文档: http://localhost:3001/api

测试登录:

curl -X POST http://localhost:3001/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"admin","password":"admin123"}'

目录结构

scaffold/
├── packages/
│   ├── api          # 后端 API(aiko-boot,当前实现用户登录)
│   ├── shared       # 公共常量(API 基地址、存储 key 等)
│   ├── shared-auth  # 前端鉴权公共模块(AuthProvider、useAuth、登录态持久化)
│   ├── admin        # 管理端(Vite + React,共用 shared-auth 登录)
│   └── mobile       # 移动端 H5(Next.js,共用 shared-auth 登录)
├── docs/
│   ├── auth-shared-design.md       # Auth 公共模块设计说明
│   └── cli-auth-feature-boundary.md # CLI 生成时「是否需要系统功能」边界(供生成器排除登录用)
└── package.json

只运行这一个项目

可以。scaffold 依赖仓库内的 @ai-partner-x/* 等包,因此需要在 ai-frist-framework 仓库内 使用,但日常只需操作 scaffold 本身:

  1. 在仓库根 执行一次 pnpm install(或进入 scaffold 后执行 pnpm install)。
  2. 之后所有开发、构建、启动都在 scaffold 目录 下完成,无需运行或构建仓库里其他项目(如 user-crud、其他 examples)。
cd scaffold
pnpm init-db    # 首次
pnpm dev        # 并行启动 api + admin + mobile

测试登录:mobile / admin 的登录页会请求 http://localhost:3001/api/auth/login,需先保证 API 已启动(pnpm dev:apipnpm dev 已包含)。两端共用 @scaffold/shared-auth 的登录态与持久化(localStorage),详见 Auth 公共模块设计

前置

  • Node 18+
  • pnpm

安装依赖(在仓库根或 scaffold 目录下执行均可,会使用仓库根 workspace):

cd /path/to/ai-frist-framework
pnpm install
# 或在 scaffold 目录下
cd scaffold && pnpm install

init-db 使用纯 JS 的 sql.js,无需编译。运行 API 服务pnpm dev:api)时依赖 better-sqlite3 原生模块;若报错找不到 bindings,在仓库根执行(会进入 better-sqlite3 目录执行 node-gyp rebuild):

pnpm run rebuild:sqlite

开发

依赖在仓库根安装完成后,在 scaffold 目录 下执行:

cd scaffold
pnpm init-db    # 首次运行:初始化 SQLite 数据库
pnpm dev        # 并行启动 api + admin + mobile

或分别启动:

  • pnpm dev:api — API 默认 http://localhost:3001
  • pnpm dev:admin — Admin 管理端(留空)
  • pnpm dev:mobile — Mobile 默认 http://localhost:3002

API 热更新(与 user-crud 一致):pnpm dev:api 会同时跑 codegen watchHTTP 服务。修改 entity/dto/controller/ 后会自动重新生成 dist/client,前端可即时引用新类型与接口;改 src/server.ts 会触发服务重启。

构建

pnpm build
# 或
pnpm build:api
pnpm build:admin
pnpm build:mobile

API 说明

  • POST /api/auth/login
    请求体:{ "username": "admin", "password": "admin123" }
    成功返回:{ "success": true, "data": { "id", "username", "email" } }

默认测试账号(见 packages/api 的 init-db):admin / admin123