spring-feature-cli 0.2.1 → 0.2.2
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 +63 -38
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,68 +1,93 @@
|
|
|
1
1
|
# spring-feature-cli
|
|
2
2
|
|
|
3
|
-
`spring-feature-cli` is a
|
|
3
|
+
`spring-feature-cli` is a Node.js CLI tool that generates Spring Boot feature-based boilerplate using templates.
|
|
4
|
+
|
|
5
|
+
It helps automate the creation of common backend layers such as entities, services, repositories, and controllers following a clean and consistent structure.
|
|
6
|
+
|
|
7
|
+
---
|
|
4
8
|
|
|
5
9
|
## Purpose
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
+
This project was built to:
|
|
12
|
+
|
|
13
|
+
- Practice building real-world CLI tools with Node.js
|
|
14
|
+
- Learn `commander`, `inquirer`, and `handlebars`
|
|
15
|
+
- Automate repetitive Spring Boot boilerplate generation
|
|
16
|
+
- Apply feature-based architecture patterns
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
---
|
|
13
19
|
|
|
14
|
-
|
|
15
|
-
- Template generation using `handlebars`
|
|
16
|
-
- Input validation and project detection
|
|
17
|
-
- Supports generating:
|
|
18
|
-
- `Entity`
|
|
19
|
-
- `Repository`
|
|
20
|
-
- `Service`
|
|
21
|
-
- `Controller`
|
|
20
|
+
## ⚙️ Installation
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
### Global installation (recommended)
|
|
24
23
|
|
|
25
24
|
```bash
|
|
26
|
-
npm install
|
|
25
|
+
npm install -g spring-feature-cli
|
|
27
26
|
```
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
### Local usage (development)
|
|
31
29
|
```bash
|
|
32
|
-
npm install
|
|
30
|
+
npm install
|
|
31
|
+
npm run dev
|
|
33
32
|
```
|
|
34
33
|
|
|
35
34
|
## Usage
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
### Generate a Spring Boot feature:
|
|
38
37
|
|
|
39
38
|
```bash
|
|
40
|
-
spfc generate
|
|
39
|
+
spfc generate User
|
|
41
40
|
```
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
or
|
|
44
43
|
|
|
45
44
|
```bash
|
|
46
|
-
|
|
45
|
+
spfc g User
|
|
47
46
|
```
|
|
47
|
+
This will generate a full structure for the feature (Entity, Repository, Service, Controller).
|
|
48
|
+
|
|
49
|
+
### 🧱 Generated Structure
|
|
50
|
+
|
|
51
|
+
The CLI generates:
|
|
52
|
+
|
|
53
|
+
- Entity
|
|
54
|
+
- Repository
|
|
55
|
+
- Service
|
|
56
|
+
- Controller
|
|
57
|
+
|
|
58
|
+
All based on Handlebars templates and a consistent naming convention.
|
|
59
|
+
|
|
60
|
+
## 📁 Project Structure
|
|
61
|
+
|
|
62
|
+
- `bin/index.js` → CLI entry point
|
|
63
|
+
- `src/index.js` → Main CLI logic
|
|
64
|
+
- `src/commands/` → Command definitions
|
|
65
|
+
- `src/actions/` → Generation logic
|
|
66
|
+
- `src/validations/` → Input validation layer
|
|
67
|
+
- `src/utils/` → Helpers (logging, scanning, template compilation, etc.)
|
|
68
|
+
- `src/templates/` → Handlebars templates for generated code
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 🧰 Key Dependencies
|
|
73
|
+
|
|
74
|
+
- `commander` → CLI command handling
|
|
75
|
+
- `inquirer` → Interactive prompts
|
|
76
|
+
- `handlebars` → Template engine
|
|
77
|
+
- `chalk` → Terminal styling
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## ⚠️ Requirements
|
|
48
82
|
|
|
49
|
-
|
|
83
|
+
- Node.js >= 16
|
|
50
84
|
|
|
51
|
-
|
|
52
|
-
- `src/index.js`: main CLI logic
|
|
53
|
-
- `src/commands/generate.js`: generate command
|
|
54
|
-
- `src/actions/generateActions.js`: file creation actions
|
|
55
|
-
- `src/validations/generateValidations.js`: input validations
|
|
56
|
-
- `src/utils/`: utilities for Java package resolution, project scanning, and template compilation
|
|
57
|
-
- `src/templates/`: Handlebars templates for generated artifacts
|
|
85
|
+
---
|
|
58
86
|
|
|
59
|
-
##
|
|
87
|
+
## 💡 Notes
|
|
60
88
|
|
|
61
|
-
|
|
62
|
-
- `inquirer` for interactive prompts
|
|
63
|
-
- `handlebars` for template generation
|
|
64
|
-
- `chalk` for console styling
|
|
89
|
+
This tool assumes a Spring Boot project structure and is intended to be used inside a backend project where Java packages are detected automatically.
|
|
65
90
|
|
|
66
|
-
|
|
91
|
+
📄 License
|
|
67
92
|
|
|
68
|
-
|
|
93
|
+
MIT
|