next-accelerate 1.0.0
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/LICENSE +21 -0
- package/README.md +262 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3217 -0
- package/package.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Clodoaldo Brito
|
|
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,262 @@
|
|
|
1
|
+
# Next-accelerate
|
|
2
|
+
|
|
3
|
+
*Next-accelerate* is a command-line tool (CLI) that automates repetitive tasks during the development of Next.js projects, already implementing part of the architecture with ready-to-use templates
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
## Requirements
|
|
15
|
+
|
|
16
|
+
> The next.js project should follow the development pattern with (App Router).
|
|
17
|
+
> Your project should follow a standardized folder structure using (Nested Layouts or Layout Composition) and Route Groups.
|
|
18
|
+
> create next project with settings custom
|
|
19
|
+
|
|
20
|
+
ex: npx create-next-app frontend
|
|
21
|
+
|
|
22
|
+
? Would you like to use the recommended Next.js defaults? › - Use arrow-keys. Return to submit.
|
|
23
|
+
|
|
24
|
+
- Yes, use recommended defaults
|
|
25
|
+
|
|
26
|
+
- No, reuse previous settings
|
|
27
|
+
|
|
28
|
+
- ❯ No, **_customize settings_**
|
|
29
|
+
|
|
30
|
+
## folder structure
|
|
31
|
+
Simple and straightforward, for any new feature you intend to create, just follow the steps.
|
|
32
|
+
> Create an assembler function in (commands), -> create a builder that will be used by the assembler in (builders) -> register its functionality in the switch, as an option (in src/index.ts -> main).
|
|
33
|
+
|
|
34
|
+
> ⚠️ **Important**
|
|
35
|
+
> Don't complicate things, this is an CLI, don't use decorators and the like, Node.js doesn't support them and this will generate errors. Remember: simplicity favors women, and in Node.js it's no different.
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
├── src
|
|
39
|
+
│ ├── builders
|
|
40
|
+
│ │ ├── core
|
|
41
|
+
│ │ │ └── next-accelerate-builder.ts
|
|
42
|
+
│ │ ├── interfaces
|
|
43
|
+
│ │ │ ├── next-auth-builder.interface.ts
|
|
44
|
+
│ │ │ ├── resource-api-builder.interface.ts
|
|
45
|
+
│ │ │ ├── resource-builder.interface.ts
|
|
46
|
+
│ │ │ ├── resource-form-builder.interface.ts
|
|
47
|
+
│ │ │ ├── resource-install-builder.interface.ts
|
|
48
|
+
│ │ │ └── tests-builder.interface.ts
|
|
49
|
+
│ │ ├── next-auth-builder.ts
|
|
50
|
+
│ │ ├── resource-api-builder.ts
|
|
51
|
+
│ │ ├── resource-builder.ts
|
|
52
|
+
│ │ ├── resource-form-builder.ts
|
|
53
|
+
│ │ └── tests-builder.ts
|
|
54
|
+
│ ├── commands
|
|
55
|
+
│ │ ├── create-api-resource.ts
|
|
56
|
+
│ │ ├── create-config-tests.ts
|
|
57
|
+
│ │ ├── create-form-resource.ts
|
|
58
|
+
│ │ ├── create-nextauth-resource.ts
|
|
59
|
+
│ │ ├── create-resource.ts
|
|
60
|
+
│ │ └── index.ts
|
|
61
|
+
│ ├── index.ts
|
|
62
|
+
│ ├── templates
|
|
63
|
+
│ │ ├── components
|
|
64
|
+
│ │ │ ├── button-comp.ts
|
|
65
|
+
│ │ │ ├── footer-comp.ts
|
|
66
|
+
│ │ │ ├── header-comp.ts
|
|
67
|
+
│ │ │ ├── index.ts
|
|
68
|
+
│ │ │ └── menu-aside-comp.ts
|
|
69
|
+
│ │ ├── config
|
|
70
|
+
│ │ │ ├── decode-claims.ts
|
|
71
|
+
│ │ │ ├── environment.ts
|
|
72
|
+
│ │ │ ├── hiddenpaths.ts
|
|
73
|
+
│ │ │ ├── proxy.ts
|
|
74
|
+
│ │ │ ├── request-api.ts
|
|
75
|
+
│ │ │ ├── session.ts
|
|
76
|
+
│ │ │ └── utils.ts
|
|
77
|
+
│ │ ├── forms
|
|
78
|
+
│ │ │ ├── create-form.ts
|
|
79
|
+
│ │ │ ├── delete-form.ts
|
|
80
|
+
│ │ │ ├── forgot-form.ts
|
|
81
|
+
│ │ │ ├── login-form.ts
|
|
82
|
+
│ │ │ ├── login-wrapper-form.ts
|
|
83
|
+
│ │ │ ├── redef-form.ts
|
|
84
|
+
│ │ │ ├── register-form.ts
|
|
85
|
+
│ │ │ ├── schems
|
|
86
|
+
│ │ │ │ ├── create-form-scheme.ts
|
|
87
|
+
│ │ │ │ ├── index.ts
|
|
88
|
+
│ │ │ │ ├── login-form-scheme.ts
|
|
89
|
+
│ │ │ │ ├── redef-form-scheme.ts
|
|
90
|
+
│ │ │ │ ├── register-form-scheme.ts
|
|
91
|
+
│ │ │ │ ├── update-form-scheme.ts
|
|
92
|
+
│ │ │ │ └── updateuser-form-scheme.ts
|
|
93
|
+
│ │ │ ├── update-form.ts
|
|
94
|
+
│ │ │ └── update-user-form.ts
|
|
95
|
+
│ │ ├── index.ts
|
|
96
|
+
│ │ ├── inputs
|
|
97
|
+
│ │ │ └── input-template.ts
|
|
98
|
+
│ │ ├── layouts
|
|
99
|
+
│ │ │ ├── capture-error-layout.ts
|
|
100
|
+
│ │ │ ├── index.ts
|
|
101
|
+
│ │ │ ├── main-layout.ts
|
|
102
|
+
│ │ │ ├── manager-layout-css.ts
|
|
103
|
+
│ │ │ ├── manager-layout.ts
|
|
104
|
+
│ │ │ ├── private-next-layout.ts
|
|
105
|
+
│ │ │ ├── public-next-layout.ts
|
|
106
|
+
│ │ │ └── root-next-layout.ts
|
|
107
|
+
│ │ ├── pages
|
|
108
|
+
│ │ │ ├── delete-page.ts
|
|
109
|
+
│ │ │ ├── detail-page.ts
|
|
110
|
+
│ │ │ ├── list-page.ts
|
|
111
|
+
│ │ │ ├── manager-page.ts
|
|
112
|
+
│ │ │ ├── new-page.ts
|
|
113
|
+
│ │ │ └── update-page.ts
|
|
114
|
+
│ │ ├── routes
|
|
115
|
+
│ │ │ ├── create-resource-route.ts
|
|
116
|
+
│ │ │ ├── delete-route.ts
|
|
117
|
+
│ │ │ ├── image-upload-route.ts
|
|
118
|
+
│ │ │ ├── manager-context.ts
|
|
119
|
+
│ │ │ ├── nextauth-route.ts
|
|
120
|
+
│ │ │ ├── set-user-photo-route.ts
|
|
121
|
+
│ │ │ ├── update-resource-route.ts
|
|
122
|
+
│ │ │ ├── user-create-route.ts
|
|
123
|
+
│ │ │ └── user-update-route.ts
|
|
124
|
+
│ │ └── tests
|
|
125
|
+
│ │ ├── config-playwright.ts
|
|
126
|
+
│ │ ├── config-vitest.ts
|
|
127
|
+
│ │ └── index.ts
|
|
128
|
+
│ └── utils
|
|
129
|
+
│ ├── contracts
|
|
130
|
+
│ │ └── build-options.ts
|
|
131
|
+
│ ├── fs.ts
|
|
132
|
+
│ ├── guards
|
|
133
|
+
│ │ ├── dependency.guard.ts
|
|
134
|
+
│ │ ├── index.ts
|
|
135
|
+
│ │ └── next-verify.guard.ts
|
|
136
|
+
│ ├── interceptors
|
|
137
|
+
│ │ └── args.interceptor.ts
|
|
138
|
+
│ ├── services
|
|
139
|
+
│ │ ├── git.service.ts
|
|
140
|
+
│ │ ├── install-dependences-form.service.ts
|
|
141
|
+
│ │ ├── install-dependences.service.ts
|
|
142
|
+
│ │ ├── install-nextauth-motion.service.ts
|
|
143
|
+
│ │ ├── install-tests-e2e-dependences.service.ts
|
|
144
|
+
│ │ └── install-tests-unit-dependences.service.ts
|
|
145
|
+
│ └── string.ts
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## 📦 Installation
|
|
149
|
+
|
|
150
|
+
You can run the CLI **without installing anything globally** using `npx`:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
npx next-accelerate create singular_resource_name
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Or install globally:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npm install -g next-accelerate && next-accelerate create singular_resource_name
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Or you can download directly from the repository and build it:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
git clone https://github.com/brito-response/next-accelerate.git && cd next-accelerate && npm i && npm run build && npm link
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### For now, the CLI only offers the following features
|
|
171
|
+
|
|
172
|
+
- Create pages for a resource.
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
npx next-accelerate create ingular_resource_name
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
- Create forms resouces folders for resources.
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npx next-accelerate create:form singular_resource_name
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
- Using git commit flag.
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
npx next-accelerate create:form singular_resource_name --git
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
- Config Next-Auth.
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
npx next-accelerate config:next-auth --git
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
At the end, you can run:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
npm run dev
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
And see your project more structured and faster.
|
|
203
|
+
|
|
204
|
+
Let's develop! 🚀
|
|
205
|
+
|
|
206
|
+
## 📁 Generated structure (example)
|
|
207
|
+
|
|
208
|
+
```txt
|
|
209
|
+
src/
|
|
210
|
+
├─ app/
|
|
211
|
+
| └── (publics)/
|
|
212
|
+
| └───(privates)/ _resources_dirs_
|
|
213
|
+
├─ components/
|
|
214
|
+
├─ hooks/
|
|
215
|
+
├─ lib/
|
|
216
|
+
├─ services/
|
|
217
|
+
└─ utils/
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
> The structure can evolve with new versions of the CLI.
|
|
222
|
+
|
|
223
|
+
## 🧠 Why use it?
|
|
224
|
+
|
|
225
|
+
- ⏱️ Saves setup time
|
|
226
|
+
|
|
227
|
+
- 📐 Maintains consistency across projects
|
|
228
|
+
|
|
229
|
+
- 🧹 Avoids repetitive boilerplate code
|
|
230
|
+
- 🔁 Ideal for freelancers, squads, and studies
|
|
231
|
+
|
|
232
|
+
## 🛠 Technologies
|
|
233
|
+
|
|
234
|
+
- Node.js
|
|
235
|
+
|
|
236
|
+
- Next.js
|
|
237
|
+
|
|
238
|
+
- TypeScript
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## 📄 License
|
|
243
|
+
|
|
244
|
+
This project is licensed under the **MIT** license.
|
|
245
|
+
|
|
246
|
+
## 🤝 Contributing
|
|
247
|
+
|
|
248
|
+
Contributions are welcome!
|
|
249
|
+
|
|
250
|
+
1. Fork the repository
|
|
251
|
+
2. Create a branch: `git checkout -b feature/my-feature`
|
|
252
|
+
3. Commit your changes
|
|
253
|
+
4. Open a Pull Request
|
|
254
|
+
|
|
255
|
+
## 🏃 Nex feature
|
|
256
|
+
|
|
257
|
+
- support for testing the created components
|
|
258
|
+
|
|
259
|
+
## ✨ Author
|
|
260
|
+
|
|
261
|
+
Dveloped by **Neto** 💅
|
|
262
|
+
If this project helped you, leave a ⭐ on the repository!
|
package/dist/index.d.ts
ADDED