Files
cli-template/package.json
shenjianZ 1a7c800391 feat: 初始化 TypeScript CLI 模板项目
建立完整的 CLI 产品基础骨架,支持多种演进方向

  - 添加项目基础配置(package.json、tsconfig、pnpm-lock.yaml、.gitignore、.npmignore)
  - 实现运行时基础设施(RuntimeServices 统一注入、日志、输出模式、配置存储、插件加载、任务注册表)
  - 采用 command/use-case/presenter 三层架构组织业务模块(demo、config、task)
  - 添加 UI 渲染层(banner、panel、table、主题样式)
  - 实现插件机制,支持运行时扫描加载外部模块和任务
  - 支持 text/json 双输出模式,便于集成与调试
  - 添加统一错误模型 AppError 和 CLI 错误边界处理
  - 基于 node:test 建立测试基座,包含示例测试用例
  - 配置 npm 发布脚本和包元数据
  - 编写完整 README 文档,包含快速开始、开发约定和演进方向
2026-03-14 17:35:41 +08:00

59 lines
1.9 KiB
JSON

{
"name": "cli-template-v1",
"version": "0.1.0",
"description": "A scalable TypeScript CLI template with rich terminal UI patterns.",
"type": "module",
"packageManager": "pnpm@10.17.1",
"bin": {
"cli-template-v1": "./dist/index.js"
},
"files": [
"dist",
"README.md",
"LICENSE"
],
"exports": {
".": "./dist/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/your-org/cli-template-v1.git"
},
"homepage": "https://github.com/your-org/cli-template-v1#readme",
"bugs": {
"url": "https://github.com/your-org/cli-template-v1/issues"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
"dev": "tsx src/index.ts",
"build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json",
"start": "node dist/index.js",
"check": "tsc --noEmit -p tsconfig.json",
"test": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && node ./node_modules/typescript/bin/tsc -p tsconfig.json && node --test dist/test/all.test.js",
"pack:check": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && node ./node_modules/typescript/bin/tsc -p tsconfig.build.json && npm pack --dry-run --cache .npm-pack-cache",
"prepublishOnly": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && node ./node_modules/typescript/bin/tsc --noEmit -p tsconfig.json && node ./node_modules/typescript/bin/tsc -p tsconfig.build.json"
},
"keywords": [
"cli",
"typescript",
"template",
"terminal-ui"
],
"license": "MIT",
"engines": {
"node": ">=20"
},
"dependencies": {
"commander": "^14.0.3",
"picocolors": "^1.1.1"
},
"devDependencies": {
"@types/node": "^24.12.0",
"tsx": "^4.21.0",
"typescript": "^5.9.3"
}
}