devstarter-tool 0.1.0 → 0.1.1
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 +82 -62
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,126 +1,146 @@
|
|
|
1
|
-
#
|
|
1
|
+
# devstarter-tool
|
|
2
2
|
|
|
3
|
-
CLI
|
|
3
|
+
CLI to generate projects with best practices and predefined configurations.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install -g devstarter-
|
|
8
|
+
npm install -g devstarter-tool
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Or run directly with npx:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npx devstarter-
|
|
14
|
+
npx devstarter-tool init my-app
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Usage
|
|
18
18
|
|
|
19
|
-
###
|
|
19
|
+
### Basic command
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
|
-
devstarter init [
|
|
22
|
+
devstarter init [project-name]
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
###
|
|
25
|
+
### Options
|
|
26
26
|
|
|
27
|
-
|
|
|
27
|
+
| Option | Description |
|
|
28
28
|
|--------|-------------|
|
|
29
|
-
| `-y, --yes` |
|
|
30
|
-
| `-t, --type <
|
|
31
|
-
| `--
|
|
29
|
+
| `-y, --yes` | Use default values without prompting |
|
|
30
|
+
| `-t, --type <type>` | Project type: `frontend` or `backend` |
|
|
31
|
+
| `--template <name>` | Template to use |
|
|
32
|
+
| `--dry-run` | Preview changes without creating files |
|
|
32
33
|
|
|
33
|
-
###
|
|
34
|
+
### Examples
|
|
34
35
|
|
|
35
36
|
```bash
|
|
36
|
-
#
|
|
37
|
+
# Full interactive mode
|
|
37
38
|
devstarter init
|
|
38
39
|
|
|
39
|
-
#
|
|
40
|
+
# Create project with specific name
|
|
40
41
|
devstarter init my-app
|
|
41
42
|
|
|
42
|
-
#
|
|
43
|
+
# Create frontend project without prompts
|
|
43
44
|
devstarter init my-app --type frontend -y
|
|
44
45
|
|
|
45
|
-
#
|
|
46
|
+
# Preview what files would be created
|
|
46
47
|
devstarter init my-app --type frontend --dry-run
|
|
47
48
|
```
|
|
48
49
|
|
|
49
|
-
##
|
|
50
|
+
## Project Structures
|
|
51
|
+
|
|
52
|
+
### Basic (single project)
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
my-app/
|
|
56
|
+
├── src/
|
|
57
|
+
│ └── main.ts (or main.tsx for React)
|
|
58
|
+
├── package.json
|
|
59
|
+
├── README.md
|
|
60
|
+
└── .git/ (if git is initialized)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Monorepo (full-stack)
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
my-app/
|
|
67
|
+
├── apps/
|
|
68
|
+
│ ├── web/ <- frontend template
|
|
69
|
+
│ └── api/ <- backend template
|
|
70
|
+
├── packages/
|
|
71
|
+
│ └── shared/ <- shared code
|
|
72
|
+
├── package.json
|
|
73
|
+
├── pnpm-workspace.yaml
|
|
74
|
+
├── tsconfig.base.json
|
|
75
|
+
└── README.md
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Available Templates
|
|
50
79
|
|
|
51
80
|
### Frontend
|
|
52
81
|
|
|
53
|
-
| Template |
|
|
82
|
+
| Template | Description |
|
|
54
83
|
|----------|-------------|
|
|
55
|
-
| `basic` | TypeScript
|
|
84
|
+
| `basic` | Minimal TypeScript with basic structure |
|
|
56
85
|
| `react` | React 18 + Vite + TypeScript |
|
|
57
86
|
|
|
58
87
|
### Backend
|
|
59
88
|
|
|
60
|
-
| Template |
|
|
89
|
+
| Template | Description |
|
|
61
90
|
|----------|-------------|
|
|
62
91
|
| `basic` | Express + TypeScript |
|
|
63
92
|
|
|
64
|
-
##
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
my-app/
|
|
68
|
-
├── src/
|
|
69
|
-
│ └── main.ts (o main.tsx para React)
|
|
70
|
-
├── package.json
|
|
71
|
-
├── README.md
|
|
72
|
-
└── .git/ (si se inicializa git)
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Caracteristicas
|
|
93
|
+
## Features
|
|
76
94
|
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
95
|
+
- Project structure selection (basic or monorepo)
|
|
96
|
+
- Automatic package manager detection (npm, pnpm, yarn)
|
|
97
|
+
- Interactive template selection
|
|
98
|
+
- Optional Git repository initialization
|
|
99
|
+
- Dry-run mode to preview changes
|
|
100
|
+
- Automatic project name normalization (kebab-case)
|
|
101
|
+
- Colored output for better readability
|
|
83
102
|
|
|
84
|
-
##
|
|
103
|
+
## Development
|
|
85
104
|
|
|
86
|
-
###
|
|
105
|
+
### Requirements
|
|
87
106
|
|
|
88
107
|
- Node.js 18+
|
|
89
|
-
- npm, pnpm
|
|
108
|
+
- npm, pnpm or yarn
|
|
90
109
|
|
|
91
110
|
### Setup
|
|
92
111
|
|
|
93
112
|
```bash
|
|
94
|
-
#
|
|
95
|
-
git clone https://github.com/abraham-diaz/
|
|
96
|
-
cd
|
|
113
|
+
# Clone repository
|
|
114
|
+
git clone https://github.com/abraham-diaz/devstarter-cli.git
|
|
115
|
+
cd devstarter-cli
|
|
97
116
|
|
|
98
|
-
#
|
|
117
|
+
# Install dependencies
|
|
99
118
|
npm install
|
|
100
119
|
|
|
101
|
-
#
|
|
120
|
+
# Build
|
|
102
121
|
npm run build
|
|
103
122
|
|
|
104
|
-
#
|
|
123
|
+
# Run locally
|
|
105
124
|
node dist/cli.js init test-app --dry-run
|
|
106
125
|
```
|
|
107
126
|
|
|
108
|
-
### Scripts
|
|
127
|
+
### Available Scripts
|
|
109
128
|
|
|
110
|
-
| Script |
|
|
129
|
+
| Script | Description |
|
|
111
130
|
|--------|-------------|
|
|
112
|
-
| `npm run build` |
|
|
113
|
-
| `npm run dev` |
|
|
114
|
-
| `npm run
|
|
115
|
-
| `npm run
|
|
131
|
+
| `npm run build` | Compile TypeScript and copy templates |
|
|
132
|
+
| `npm run dev` | Watch mode for development |
|
|
133
|
+
| `npm run test` | Run tests |
|
|
134
|
+
| `npm run lint` | Run ESLint |
|
|
135
|
+
| `npm run format` | Format code with Prettier |
|
|
116
136
|
|
|
117
|
-
###
|
|
137
|
+
### Adding New Templates
|
|
118
138
|
|
|
119
|
-
1.
|
|
120
|
-
2.
|
|
121
|
-
3.
|
|
122
|
-
4.
|
|
139
|
+
1. Create folder in `src/templates/<type>/<template-name>/`
|
|
140
|
+
2. Add template files (use `.tpl` extension for files with placeholders)
|
|
141
|
+
3. Available placeholders: `{{projectName}}`
|
|
142
|
+
4. Run `npm run build`
|
|
123
143
|
|
|
124
|
-
##
|
|
144
|
+
## License
|
|
125
145
|
|
|
126
146
|
MIT
|