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

create-demo-tcb-app

v1.0.33

Published

CLI tool to create a new DemoTcb project from template

Readme

DemoTCB

DemoTcb - Monorepo 项目模板和 CLI 工具

项目结构

DemoTcb/
├── src/                # CLI 源代码
├── dist/               # 编译产物
├── scripts/            # 构建和发布脚本
├── template/           # 项目模板
│   ├── packages/       # Monorepo 包
│   │   ├── server/     # 服务端应用
│   │   └── sdk/        # Node.js SDK
│   └── package.json    # 模板根配置
├── package.json        # CLI 包配置
└── tsconfig.json       # TypeScript 配置

快速开始

使用 CLI 创建新项目

# 使用 npx (推荐)
npx create-demo-tcb-app

# 或者全局安装后使用
npm install -g create-demo-tcb-app
create-demo-tcb-app

CLI 会引导你输入:

  • 项目名称(大驼峰格式,如 OrderTcb)
  • 配置 Key(如 Order)
  • SDK 包名(如 @be-link/order-tcb-node-sdk)
  • 目标目录

本地开发 CLI

# 安装依赖
npm install

# 构建
npm run build

# 本地测试
node dist/cli.js

# 或使用 npm link
npm link
create-demo-tcb-app

CLI 开发

构建和发布流程

  1. 修改模板: 在 template/ 目录中修改项目模板

  2. 构建 CLI:

    npm run build

    构建过程会自动:

    • 检查 template/ 目录完整性
    • 编译 TypeScript 代码到 dist/
  3. 测试 CLI:

    npm test
    npm run test-package
  4. 发布到 npm:

    npm run release
    # 或手动
    npm publish

CLI 文件说明

  • src/cli.ts - CLI 入口文件,处理命令行参数
  • src/index.ts - 主逻辑,协调整个流程
  • src/prompts.ts - 交互式提问
  • src/generator.ts - 项目生成器
  • src/utils/nameConverter.ts - 命名格式转换
  • src/utils/fileReplacer.ts - 文件内容替换
  • scripts/copy-template.js - 检查模板完整性
  • scripts/publish-root.sh - 发布脚本
  • scripts/test-package.sh - 打包测试脚本

模板说明

模板位于 template/ 目录,包含:

项目结构

template/
├── packages/
│   ├── server/          # 服务端应用
│   └── sdk/             # Node.js SDK
├── pnpm-workspace.yaml  # pnpm workspace 配置
├── package.json         # 根 package.json
├── .eslintrc.json       # ESLint 配置
├── lint-staged.config.js # Lint-staged 配置
└── Jenkinsfile          # Jenkins CI/CD 配置

使用模板创建的项目

项目创建后,可以:

# 安装依赖
pnpm install

# 启动开发服务器
pnpm dev:server

# 构建所有包
pnpm build:all

# 代码检查
pnpm lint
pnpm lint:fix

注意事项

  1. 模板文件: 所有模板文件都在 template/ 目录,修改后需要重新构建 CLI
  2. 占位符: 模板中使用以下占位符会被 CLI 自动替换:
    • DemoTcb → 项目名(PascalCase)
    • demo-tcb → 项目名(kebab-case)
    • demoTcb → 项目名(camelCase)
    • @be-link/demo-tcb-node-sdk → SDK 包名
    • Demo → 配置 Key
  3. 发布: 发布到 npm 时会包含 dist/template/ 目录

License

ISC