create-project-template-cli 1.0.0 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,112 @@
1
- # 项目模板工具
2
- ## template
3
- 该文件夹下面为自定义的项目模板,每个模板为一个文件夹,文件夹名称为模板名称
4
- ## 自定义模板
5
- 用户可以选择自定义模板,输入gitee或者github的仓库地址,clone该项目
1
+ # create-project-template-cli
2
+
3
+ 一个快速创建项目模板的命令行工具,支持多种流行的前端框架和UI库组合,帮助开发者快速搭建项目骨架。
4
+
5
+ ## 功能特点
6
+
7
+ - 🚀 **快速启动**: 通过简单的命令快速创建项目
8
+ - 📋 **多种模板**: 内置React + Shadcn、Vue + TailwindCSS等流行模板
9
+ - 🔧 **自定义模板**: 支持从Git仓库拉取自定义模板
10
+ - 💡 **交互式操作**: 提供友好的命令行交互界面
11
+
12
+ ## 安装
13
+
14
+ ### 通过npm全局安装
15
+
16
+ ```bash
17
+ npm install -g create-project-template-cli
18
+ ```
19
+
20
+ ### 通过pnpm全局安装
21
+
22
+ ```bash
23
+ pnpm add -g create-project-template-cli
24
+ ```
25
+
26
+ ### 直接使用npx (无需安装)
27
+
28
+ ```bash
29
+ npx create-template
30
+ ```
31
+
32
+ ## 使用方法
33
+
34
+ ### 创建新项目
35
+
36
+ 在要创建项目的目录中执行:
37
+
38
+ ```bash
39
+ create-template
40
+ ```
41
+
42
+ 或者使用npx直接运行:
43
+
44
+ ```bash
45
+ npx create-template
46
+ ```
47
+
48
+ ### 交互式操作流程
49
+
50
+ 1. 选择要使用的模板类型
51
+ 2. 输入项目名称
52
+ 3. 等待模板创建完成
53
+
54
+ ## 支持的模板
55
+
56
+ 目前支持以下模板:
57
+
58
+ - **React + Shadcn**: 基于React的现代化UI组件库模板
59
+ - **Vue + TailwindCSS**: 基于Vue和TailwindCSS的现代前端开发模板
60
+
61
+ ## 使用自定义模板
62
+
63
+ 您可以使用Git仓库中的自定义模板:
64
+
65
+ 1. 在模板选择中选择「自定义模板」
66
+ 2. 输入Git仓库地址(支持GitHub、GitLab等)
67
+ 3. 工具将自动拉取模板并创建项目
68
+
69
+ ## 开发指南
70
+
71
+ ### 克隆仓库
72
+
73
+ ```bash
74
+ git clone [repository-url]
75
+ cd create-project-template-cli
76
+ ```
77
+
78
+ ### 安装依赖
79
+
80
+ ```bash
81
+ pnpm install
82
+ ```
83
+
84
+ ### 本地开发
85
+
86
+ ```bash
87
+ node index.js
88
+ ```
89
+
90
+ ## 模板结构
91
+
92
+ 每个模板都包含以下核心功能:
93
+
94
+ - 现代化构建工具配置
95
+ - 代码规范和linting配置
96
+ - 开发环境和生产环境构建脚本
97
+ - 基础目录结构
98
+
99
+ ## 许可证
100
+
101
+ MIT © [项目作者]
102
+
103
+ ---
104
+
105
+ ## 更新日志
106
+
107
+ ### v1.0.0
108
+
109
+ - 初始版本
110
+ - 支持React + Shadcn模板
111
+ - 支持Vue + TailwindCSS模板
112
+ - 支持自定义模板功能
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-project-template-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.4",
4
4
  "description": "模板快速创建",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -9,9 +9,13 @@
9
9
  },
10
10
  "files": [
11
11
  "index.js",
12
- "template/*",
12
+ "template/**",
13
13
  "utils.js"
14
14
  ],
15
+ "scripts": {
16
+ "test": "echo \"Error: no test specified\" && exit 1",
17
+ "release": "standard-version"
18
+ },
15
19
  "keywords": [
16
20
  "project-template",
17
21
  "template",
@@ -19,6 +23,7 @@
19
23
  ],
20
24
  "author": "",
21
25
  "license": "ISC",
26
+ "packageManager": "pnpm@10.13.1",
22
27
  "dependencies": {
23
28
  "chalk": "^5.6.2",
24
29
  "commander": "^14.0.1",
@@ -27,7 +32,7 @@
27
32
  "inquirer": "^12.9.6",
28
33
  "ora": "^9.0.0"
29
34
  },
30
- "scripts": {
31
- "test": "echo \"Error: no test specified\" && exit 1"
35
+ "devDependencies": {
36
+ "standard-version": "^9.5.0"
32
37
  }
33
- }
38
+ }
@@ -71,7 +71,7 @@ request.interceptors.response.use(
71
71
  if (error === '重复请求') {
72
72
  return Promise.reject('重复请求')
73
73
  }
74
- console.log(error)
74
+
75
75
  const key = genKey(error.config)
76
76
  // 每次请求后删除newSet中的key
77
77
  newSet.delete(key)