@lambertkeith/spec-go 0.2.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.
Files changed (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +163 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +850 -0
  5. package/dist/index.js.map +1 -0
  6. package/package.json +46 -0
  7. package/templates/django/README.md +27 -0
  8. package/templates/django/_gitignore +20 -0
  9. package/templates/django/_template.json +14 -0
  10. package/templates/django/manage.py +22 -0
  11. package/templates/django/project_name/__init__.py +1 -0
  12. package/templates/django/project_name/asgi.py +11 -0
  13. package/templates/django/project_name/settings.py +75 -0
  14. package/templates/django/project_name/urls.py +16 -0
  15. package/templates/django/project_name/wsgi.py +11 -0
  16. package/templates/django/pyproject.toml +20 -0
  17. package/templates/empty/README.md +3 -0
  18. package/templates/empty/_gitignore +6 -0
  19. package/templates/empty/_template.json +6 -0
  20. package/templates/express-ts/README.md +27 -0
  21. package/templates/express-ts/_gitignore +7 -0
  22. package/templates/express-ts/_template.json +13 -0
  23. package/templates/express-ts/package.json +23 -0
  24. package/templates/express-ts/src/index.ts +17 -0
  25. package/templates/express-ts/src/middleware/error-handler.ts +14 -0
  26. package/templates/express-ts/src/routes/index.ts +11 -0
  27. package/templates/express-ts/tsconfig.json +17 -0
  28. package/templates/express-ts/tsup.config.ts +9 -0
  29. package/templates/fastapi/README.md +21 -0
  30. package/templates/fastapi/_gitignore +16 -0
  31. package/templates/fastapi/_template.json +14 -0
  32. package/templates/fastapi/pyproject.toml +21 -0
  33. package/templates/fastapi/src/project_name/__init__.py +1 -0
  34. package/templates/fastapi/src/project_name/main.py +20 -0
  35. package/templates/fastapi/src/project_name/routes/__init__.py +8 -0
  36. package/templates/flask/README.md +15 -0
  37. package/templates/flask/_gitignore +17 -0
  38. package/templates/flask/_template.json +14 -0
  39. package/templates/flask/pyproject.toml +19 -0
  40. package/templates/flask/src/project_name/__init__.py +1 -0
  41. package/templates/flask/src/project_name/app.py +15 -0
  42. package/templates/flask/src/project_name/routes/__init__.py +8 -0
  43. package/templates/fullstack-react-node/README.md +35 -0
  44. package/templates/fullstack-react-node/_gitignore +7 -0
  45. package/templates/fullstack-react-node/_template.json +14 -0
  46. package/templates/fullstack-react-node/backend/package.json +22 -0
  47. package/templates/fullstack-react-node/backend/src/index.ts +20 -0
  48. package/templates/fullstack-react-node/backend/tsconfig.json +17 -0
  49. package/templates/fullstack-react-node/backend/tsup.config.ts +9 -0
  50. package/templates/fullstack-react-node/frontend/index.html +12 -0
  51. package/templates/fullstack-react-node/frontend/package.json +22 -0
  52. package/templates/fullstack-react-node/frontend/src/App.css +16 -0
  53. package/templates/fullstack-react-node/frontend/src/App.tsx +22 -0
  54. package/templates/fullstack-react-node/frontend/src/main.tsx +9 -0
  55. package/templates/fullstack-react-node/frontend/tsconfig.json +20 -0
  56. package/templates/fullstack-react-node/frontend/vite.config.ts +14 -0
  57. package/templates/fullstack-react-node/package.json +10 -0
  58. package/templates/fullstack-react-node/pnpm-workspace.yaml +3 -0
  59. package/templates/fullstack-react-python/Makefile +35 -0
  60. package/templates/fullstack-react-python/README.md +43 -0
  61. package/templates/fullstack-react-python/_gitignore +18 -0
  62. package/templates/fullstack-react-python/_template.json +25 -0
  63. package/templates/fullstack-react-python/backend/pyproject.toml +21 -0
  64. package/templates/fullstack-react-python/backend/src/project_name/__init__.py +1 -0
  65. package/templates/fullstack-react-python/backend/src/project_name/main.py +29 -0
  66. package/templates/fullstack-react-python/backend/src/project_name/routes/__init__.py +8 -0
  67. package/templates/fullstack-react-python/frontend/index.html +12 -0
  68. package/templates/fullstack-react-python/frontend/package.json +22 -0
  69. package/templates/fullstack-react-python/frontend/src/App.css +16 -0
  70. package/templates/fullstack-react-python/frontend/src/App.tsx +22 -0
  71. package/templates/fullstack-react-python/frontend/src/main.tsx +9 -0
  72. package/templates/fullstack-react-python/frontend/tsconfig.json +20 -0
  73. package/templates/fullstack-react-python/frontend/vite.config.ts +14 -0
  74. package/templates/fullstack-vue-node/README.md +35 -0
  75. package/templates/fullstack-vue-node/_gitignore +7 -0
  76. package/templates/fullstack-vue-node/_template.json +14 -0
  77. package/templates/fullstack-vue-node/backend/package.json +22 -0
  78. package/templates/fullstack-vue-node/backend/src/index.ts +20 -0
  79. package/templates/fullstack-vue-node/backend/tsconfig.json +17 -0
  80. package/templates/fullstack-vue-node/backend/tsup.config.ts +9 -0
  81. package/templates/fullstack-vue-node/frontend/index.html +12 -0
  82. package/templates/fullstack-vue-node/frontend/package.json +20 -0
  83. package/templates/fullstack-vue-node/frontend/src/App.vue +41 -0
  84. package/templates/fullstack-vue-node/frontend/src/main.ts +4 -0
  85. package/templates/fullstack-vue-node/frontend/src/vite-env.d.ts +1 -0
  86. package/templates/fullstack-vue-node/frontend/tsconfig.json +20 -0
  87. package/templates/fullstack-vue-node/frontend/vite.config.ts +14 -0
  88. package/templates/fullstack-vue-node/package.json +10 -0
  89. package/templates/fullstack-vue-node/pnpm-workspace.yaml +3 -0
  90. package/templates/next-ts/README.md +26 -0
  91. package/templates/next-ts/_gitignore +34 -0
  92. package/templates/next-ts/_template.json +13 -0
  93. package/templates/next-ts/next.config.ts +7 -0
  94. package/templates/next-ts/package.json +22 -0
  95. package/templates/next-ts/src/app/globals.css +21 -0
  96. package/templates/next-ts/src/app/layout.tsx +19 -0
  97. package/templates/next-ts/src/app/page.tsx +10 -0
  98. package/templates/next-ts/tsconfig.json +27 -0
  99. package/templates/node-ts/README.md +21 -0
  100. package/templates/node-ts/_gitignore +7 -0
  101. package/templates/node-ts/_template.json +16 -0
  102. package/templates/node-ts/package.json +19 -0
  103. package/templates/node-ts/src/index.ts +1 -0
  104. package/templates/node-ts/tsconfig.json +17 -0
  105. package/templates/node-ts/tsup.config.ts +9 -0
  106. package/templates/python-uv/README.md +22 -0
  107. package/templates/python-uv/_gitignore +30 -0
  108. package/templates/python-uv/_template.json +14 -0
  109. package/templates/python-uv/pyproject.toml +20 -0
  110. package/templates/python-uv/src/project_name/__init__.py +10 -0
  111. package/templates/python-uv/src/project_name/__main__.py +4 -0
  112. package/templates/react-ts/_gitignore +6 -0
  113. package/templates/react-ts/_template.json +13 -0
  114. package/templates/react-ts/index.html +13 -0
  115. package/templates/react-ts/package.json +23 -0
  116. package/templates/react-ts/src/App.css +14 -0
  117. package/templates/react-ts/src/App.tsx +12 -0
  118. package/templates/react-ts/src/index.css +11 -0
  119. package/templates/react-ts/src/main.tsx +10 -0
  120. package/templates/react-ts/tsconfig.json +20 -0
  121. package/templates/react-ts/vite.config.ts +6 -0
  122. package/templates/springboot/.mvn/wrapper/maven-wrapper.properties +2 -0
  123. package/templates/springboot/README.md +27 -0
  124. package/templates/springboot/_gitignore +36 -0
  125. package/templates/springboot/_template.json +14 -0
  126. package/templates/springboot/mvnw +19 -0
  127. package/templates/springboot/mvnw.cmd +13 -0
  128. package/templates/springboot/pom.xml +46 -0
  129. package/templates/springboot/src/main/java/com/example/project_name/Application.java +12 -0
  130. package/templates/springboot/src/main/java/com/example/project_name/controller/HelloController.java +25 -0
  131. package/templates/springboot/src/main/resources/application.yml +6 -0
  132. package/templates/springboot/src/test/java/com/example/project_name/ApplicationTests.java +12 -0
  133. package/templates/template.config.json +102 -0
  134. package/templates/vue-ts/_gitignore +6 -0
  135. package/templates/vue-ts/_template.json +13 -0
  136. package/templates/vue-ts/index.html +13 -0
  137. package/templates/vue-ts/package.json +20 -0
  138. package/templates/vue-ts/src/App.vue +37 -0
  139. package/templates/vue-ts/src/main.ts +5 -0
  140. package/templates/vue-ts/src/style.css +11 -0
  141. package/templates/vue-ts/src/vite-env.d.ts +7 -0
  142. package/templates/vue-ts/tsconfig.json +20 -0
  143. package/templates/vue-ts/vite.config.ts +6 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,163 @@
1
+ # spec-go
2
+
3
+ 快速创建项目并自动初始化 GitHub 仓库的 CLI 脚手架工具。
4
+
5
+ ## 快速开始
6
+
7
+ ```bash
8
+ # 使用 npx (推荐)
9
+ npx @lambertkeith/spec-go my-app
10
+
11
+ # 或全局安装后使用
12
+ npm install -g @lambertkeith/spec-go
13
+ spec-go my-app
14
+ ```
15
+
16
+ ## 用法
17
+
18
+ ### 交互式创建
19
+
20
+ ```bash
21
+ npx @lambertkeith/spec-go
22
+ ```
23
+
24
+ ### 指定模板创建
25
+
26
+ ```bash
27
+ npx @lambertkeith/spec-go my-app --template react-ts
28
+ npx @lambertkeith/spec-go my-api --template fastapi
29
+ npx @lambertkeith/spec-go my-fullstack --template fullstack-react-node
30
+ ```
31
+
32
+ ### 一条命令创建并推送到 GitHub
33
+
34
+ ```bash
35
+ npx @lambertkeith/spec-go my-app --github --template node-ts
36
+ ```
37
+
38
+ ### 列出所有可用模板
39
+
40
+ ```bash
41
+ npx @lambertkeith/spec-go list
42
+ ```
43
+
44
+ ## 可用模板
45
+
46
+ ### 单体项目
47
+
48
+ | 模板名 | 描述 |
49
+ |--------|------|
50
+ | `node-ts` | Node.js + TypeScript |
51
+ | `express-ts` | Express + TypeScript API |
52
+ | `react-ts` | React 18 + Vite + TypeScript |
53
+ | `vue-ts` | Vue 3 + Vite + TypeScript |
54
+ | `next-ts` | Next.js 14 + App Router |
55
+ | `python-uv` | Python + uv 包管理器 |
56
+ | `fastapi` | FastAPI + uv |
57
+ | `django` | Django + uv |
58
+ | `flask` | Flask + uv |
59
+ | `springboot` | Spring Boot 3.x + Maven |
60
+ | `empty` | 空项目 |
61
+
62
+ ### 前后端分离
63
+
64
+ | 模板名 | 描述 |
65
+ |--------|------|
66
+ | `fullstack-react-node` | React + Express (pnpm workspace) |
67
+ | `fullstack-vue-node` | Vue 3 + Express (pnpm workspace) |
68
+ | `fullstack-react-python` | React + FastAPI (Makefile) |
69
+
70
+ ## 命令参考
71
+
72
+ ### 创建项目
73
+
74
+ ```bash
75
+ npx @lambertkeith/spec-go # 交互式创建
76
+ npx @lambertkeith/spec-go my-app # 指定项目名
77
+ npx @lambertkeith/spec-go my-app --template node-ts # 指定模板
78
+ npx @lambertkeith/spec-go my-app --github # 创建 + GitHub 仓库
79
+ npx @lambertkeith/spec-go my-app --github --public # 创建公开仓库
80
+ npx @lambertkeith/spec-go my-app --no-git # 不初始化 Git
81
+ npx @lambertkeith/spec-go my-app --no-install # 跳过依赖安装
82
+ ```
83
+
84
+ ### 列出模板
85
+
86
+ ```bash
87
+ npx @lambertkeith/spec-go list
88
+ ```
89
+
90
+ ### 配置管理
91
+
92
+ ```bash
93
+ spec-go config --setup-github # 配置 GitHub Token
94
+ spec-go config --show # 显示当前配置
95
+ spec-go config --path # 显示配置文件路径
96
+ ```
97
+
98
+ ## GitHub 集成
99
+
100
+ ### 首次使用配置 Token
101
+
102
+ ```bash
103
+ npx @lambertkeith/spec-go config --setup-github
104
+ ```
105
+
106
+ 按提示获取 Token: https://github.com/settings/tokens/new?scopes=repo
107
+
108
+ ### 配置文件
109
+
110
+ 配置文件位置: `~/.spec-go.json`
111
+
112
+ ```json
113
+ {
114
+ "defaults": {
115
+ "github": true,
116
+ "public": false,
117
+ "template": "node-ts"
118
+ },
119
+ "github": {
120
+ "token": "ghp_xxxxxxxxxxxx",
121
+ "defaultOrg": "my-organization"
122
+ }
123
+ }
124
+ ```
125
+
126
+ ## 项目结构示例
127
+
128
+ ### 单体项目 (node-ts)
129
+
130
+ ```
131
+ my-app/
132
+ ├── src/
133
+ │ └── index.ts
134
+ ├── package.json
135
+ ├── tsconfig.json
136
+ └── README.md
137
+ ```
138
+
139
+ ### 全栈项目 (fullstack-react-node)
140
+
141
+ ```
142
+ my-app/
143
+ ├── frontend/
144
+ │ ├── src/
145
+ │ ├── package.json
146
+ │ └── vite.config.ts
147
+ ├── backend/
148
+ │ ├── src/
149
+ │ └── package.json
150
+ ├── package.json
151
+ └── pnpm-workspace.yaml
152
+ ```
153
+
154
+ ## 系统要求
155
+
156
+ - Node.js >= 18.0.0
157
+ - pnpm (推荐) / npm / yarn
158
+ - uv (Python 模板)
159
+ - Maven (Spring Boot 模板)
160
+
161
+ ## 许可证
162
+
163
+ MIT
@@ -0,0 +1,2 @@
1
+
2
+ export { }