Skip to content

Commit 0706ac2

Browse files
committed
🎨 🎨 Fix code formatting with Prettier
- Apply consistent formatting to CONTRIBUTING.md - Format docs/STACKS.md for better readability - Fix TypeScript type formatting in ui.ts and scaffold.ts - Ensure all files follow project code style guidelines
1 parent 38a7f39 commit 0706ac2

File tree

4 files changed

+74
-8
lines changed

4 files changed

+74
-8
lines changed

CONTRIBUTING.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ packages/core/src/templates/your-stack-name/
101101
```
102102

103103
**Important**: Use these replacement variables in your templates:
104+
104105
- `{{projectName}}` - The project name
105106
- `{{description}}` - Project description
106107
- `{{authorName}}` - Author name
107108

108109
**Example package.json.tpl:**
110+
109111
```json
110112
{
111113
"name": "{{projectName}}",
@@ -137,22 +139,42 @@ dist/
137139
Add your new stack to the type definitions:
138140

139141
**In `packages/core/src/scaffold.ts`:**
142+
140143
```typescript
141144
export interface ProjectOptions {
142145
projectPath: string;
143-
stack: "node-js" | "node-ts" | "react" | "vue" | "python" | "java" | "go" | "php" | "your-stack-name";
146+
stack:
147+
| "node-js"
148+
| "node-ts"
149+
| "react"
150+
| "vue"
151+
| "python"
152+
| "java"
153+
| "go"
154+
| "php"
155+
| "your-stack-name";
144156
features: ("docker" | "husky")[];
145157
replacements: Record<string, string>;
146158
}
147159
```
148160

149161
**In `packages/cli/src/commands/ui.ts`:**
162+
150163
```typescript
151164
export interface InitAnswers {
152165
projectName: string;
153166
description: string;
154167
authorName: string;
155-
stack: "node-js" | "node-ts" | "react" | "vue" | "python" | "java" | "go" | "php" | "your-stack-name";
168+
stack:
169+
| "node-js"
170+
| "node-ts"
171+
| "react"
172+
| "vue"
173+
| "python"
174+
| "java"
175+
| "go"
176+
| "php"
177+
| "your-stack-name";
156178
features: ("docker" | "husky")[];
157179
commitValidation?: boolean;
158180
}
@@ -176,7 +198,7 @@ Update the stack choices in `packages/cli/src/commands/ui.ts`:
176198
{ name: "Java + Spring", value: "java" },
177199
{ name: "Go + Gin", value: "go" },
178200
{ name: "PHP + Laravel", value: "php" },
179-
{ name: "Your Stack + Framework", value: "your-stack-name" },
201+
{ name: "Your Stack + Framework", value: "your-stack-name" },
180202
],
181203
}
182204
```
@@ -206,6 +228,7 @@ if (answers.stack === "python") {
206228
### 3. Best Practices for New Stacks
207229
208230
#### Template Structure Guidelines:
231+
209232
- **Follow conventions**: Use the technology's standard project structure
210233
- **Include essentials**: Configuration files, build tools, testing setup
211234
- **Add documentation**: Include basic README template
@@ -215,6 +238,7 @@ if (answers.stack === "python") {
215238
#### Example Folder Structures:
216239
217240
**Frontend Stack (SPA):**
241+
218242
```
219243
src/
220244
├── components/
@@ -226,6 +250,7 @@ src/
226250
```
227251
228252
**Backend Stack (API):**
253+
229254
```
230255
src/
231256
├── controllers/
@@ -237,6 +262,7 @@ src/
237262
```
238263
239264
**Full-Stack Framework:**
265+
240266
```
241267
src/
242268
├── components/

docs/STACKS.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ StackCode supports multiple technology stacks, each designed with best practices
77
### Frontend Stacks
88

99
#### React + TypeScript
10+
1011
- **Framework**: React 18 with TypeScript
1112
- **Build Tool**: Vite
1213
- **Styling**: TailwindCSS
@@ -15,6 +16,7 @@ StackCode supports multiple technology stacks, each designed with best practices
1516
- **Features**: Modern JSX Transform, ESLint configuration, component structure
1617

1718
**Generated Structure:**
19+
1820
```
1921
├── src/
2022
│ ├── components/
@@ -30,6 +32,7 @@ StackCode supports multiple technology stacks, each designed with best practices
3032
```
3133

3234
#### Vue.js + TypeScript
35+
3336
- **Framework**: Vue 3 with Composition API and TypeScript
3437
- **Build Tool**: Vite
3538
- **Styling**: TailwindCSS
@@ -38,6 +41,7 @@ StackCode supports multiple technology stacks, each designed with best practices
3841
- **Features**: SFC (Single File Components), modern Vue patterns
3942

4043
**Generated Structure:**
44+
4145
```
4246
├── src/
4347
│ ├── components/ # Reusable components
@@ -54,11 +58,13 @@ StackCode supports multiple technology stacks, each designed with best practices
5458
### Backend Stacks
5559

5660
#### Node.js + JavaScript
61+
5762
- **Runtime**: Node.js with ES6+
5863
- **Testing**: Jest
5964
- **Features**: Express.js structure, middleware, controllers, routes
6065

6166
**Generated Structure:**
67+
6268
```
6369
├── src/
6470
│ ├── controllers/ # Request handlers
@@ -72,11 +78,13 @@ StackCode supports multiple technology stacks, each designed with best practices
7278
```
7379

7480
#### Node.js + TypeScript
81+
7582
- **Runtime**: Node.js with TypeScript
7683
- **Testing**: Vitest
7784
- **Features**: Type-safe development, modern TypeScript configuration
7885

7986
**Generated Structure:**
87+
8088
```
8189
├── src/
8290
│ ├── controllers/ # Type-safe controllers
@@ -88,23 +96,27 @@ StackCode supports multiple technology stacks, each designed with best practices
8896
```
8997

9098
#### Python + FastAPI
99+
91100
- **Framework**: FastAPI
92101
- **Package Management**: pip with pyproject.toml
93102
- **Features**: Modern Python async API development
94103

95104
**Generated Structure:**
105+
96106
```
97107
├── src/
98108
│ └── main.py
99109
└── pyproject.toml
100110
```
101111

102112
#### Java + Spring
113+
103114
- **Framework**: Spring Boot
104115
- **Build Tool**: Maven
105116
- **Features**: Enterprise Java development structure
106117

107118
**Generated Structure:**
119+
108120
```
109121
├── src/main/java/com/example/app/
110122
│ ├── Application.java
@@ -114,22 +126,26 @@ StackCode supports multiple technology stacks, each designed with best practices
114126
```
115127

116128
#### Go + Gin
129+
117130
- **Framework**: Gin web framework
118131
- **Package Management**: Go modules
119132
- **Features**: High-performance Go web development
120133

121134
**Generated Structure:**
135+
122136
```
123137
├── main.go
124138
└── go.mod
125139
```
126140

127141
#### PHP + Laravel
142+
128143
- **Framework**: Laravel
129144
- **Package Management**: Composer
130145
- **Features**: Modern PHP development with MVC structure
131146

132147
**Generated Structure:**
148+
133149
```
134150
├── app/Http/Controllers/
135151
├── bootstrap/
@@ -141,7 +157,9 @@ StackCode supports multiple technology stacks, each designed with best practices
141157
## 🔧 Stack Features
142158

143159
### Automatic Configuration
160+
144161
Each stack includes:
162+
145163
-**Optimized package.json** (or equivalent) with relevant dependencies
146164
-**TypeScript configuration** (where applicable)
147165
-**Build tool setup** (Vite, Maven, etc.)
@@ -150,18 +168,23 @@ Each stack includes:
150168
-**Best practice folder structure**
151169

152170
### Smart Package Management
171+
153172
StackCode automatically uses the appropriate package manager:
173+
154174
- **npm** for Node.js-based stacks (React, Vue, Node.js)
155175
- **pip** for Python projects
156-
- **maven** for Java projects
176+
- **maven** for Java projects
157177
- **go mod** for Go projects
158178
- **composer** for PHP projects
159179

160180
### Docker Support
181+
161182
All stacks can include Docker configuration when the Docker feature is selected during project initialization.
162183

163184
### Git Integration
185+
164186
Every generated project includes:
187+
165188
-**Stack-specific .gitignore** files
166189
-**Git repository initialization**
167190
-**Conventional commit setup** (with Husky)
@@ -181,12 +204,13 @@ Then select your preferred technology stack from the interactive menu.
181204
Interested in adding support for a new technology stack? Check out our comprehensive guide in [CONTRIBUTING.md](../CONTRIBUTING.md#adding-new-technology-stacks).
182205

183206
The process involves:
207+
184208
1. Creating template files
185-
2. Updating type definitions
209+
2. Updating type definitions
186210
3. Adding CLI options
187211
4. Configuring package management
188212
5. Testing thoroughly
189213

190214
---
191215

192-
*For more information about StackCode, visit our [main documentation](../README.md).*
216+
_For more information about StackCode, visit our [main documentation](../README.md)._

packages/cli/src/commands/ui.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,15 @@ export interface InitAnswers {
194194
projectName: string;
195195
description: string;
196196
authorName: string;
197-
stack: "node-js" | "node-ts" | "react" | "vue" | "python" | "java" | "go" | "php";
197+
stack:
198+
| "node-js"
199+
| "node-ts"
200+
| "react"
201+
| "vue"
202+
| "python"
203+
| "java"
204+
| "go"
205+
| "php";
198206
features: ("docker" | "husky")[];
199207
commitValidation?: boolean;
200208
}

packages/core/src/scaffold.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@ async function copyTemplateFiles(
3939

4040
export interface ProjectOptions {
4141
projectPath: string;
42-
stack: "node-js" | "node-ts" | "react" | "vue" | "python" | "java" | "go" | "php";
42+
stack:
43+
| "node-js"
44+
| "node-ts"
45+
| "react"
46+
| "vue"
47+
| "python"
48+
| "java"
49+
| "go"
50+
| "php";
4351
features: ("docker" | "husky")[];
4452
replacements: Record<string, string>;
4553
}

0 commit comments

Comments
 (0)