create-next-pro-cli 0.1.12 → 0.1.13
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/.github/workflows/ci.yml +38 -0
- package/README.md +104 -86
- package/dist/bin.js +5466 -0
- package/install.sh +63 -8
- package/package.json +6 -2
- package/src/lib/addComponent.ts +53 -33
- package/src/lib/addPage.ts +70 -39
- package/src/lib/utils.test.ts +23 -0
- package/src/lib/utils.ts +24 -0
- package/src/scaffold.ts +20 -4
- package/.husky/commit-msg +0 -2
- package/.husky/pre-commit +0 -2
- package/CODE_OF_CONDUCT.md +0 -33
- package/CONTRIBUTING.md +0 -44
- package/FONCTIONALITY.md +0 -25
- package/templates/Projects/default/README.md +0 -36
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: ["master"]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test-build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: oven-sh/setup-bun@v1
|
|
14
|
+
- run: bun install
|
|
15
|
+
- run: bun test
|
|
16
|
+
- run: bun run build
|
|
17
|
+
publish:
|
|
18
|
+
needs: test-build
|
|
19
|
+
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
environment:
|
|
22
|
+
name: ENV
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- uses: oven-sh/setup-bun@v2
|
|
26
|
+
with:
|
|
27
|
+
bun-version: latest
|
|
28
|
+
- name: Configure Git
|
|
29
|
+
run: |
|
|
30
|
+
git config user.name "GitHub Actions"
|
|
31
|
+
git config user.email "actions@github.com"
|
|
32
|
+
- run: bun install
|
|
33
|
+
- run: bun run version-patch
|
|
34
|
+
- run: bun run build
|
|
35
|
+
- name: Set up .npmrc
|
|
36
|
+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
|
|
37
|
+
- name: Publish package
|
|
38
|
+
run: npm publish
|
package/README.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
<img src="./public/cnp-banner.svg" alt="create-next-pro logo" style="width:100%;" />
|
|
2
|
+
|
|
3
|
+
# Runtime Support
|
|
4
|
+
|
|
5
|
+
[](https://bun.sh)
|
|
6
|
+
[](https://nodejs.org)
|
|
7
|
+
[](https://deno.land)
|
|
2
8
|
|
|
3
9
|

|
|
4
10
|

|
|
@@ -102,25 +108,26 @@ create-next-pro rmpage ParentPage.ChildPage
|
|
|
102
108
|
|
|
103
109
|
```plaintext
|
|
104
110
|
my-next-app/
|
|
111
|
+
.
|
|
105
112
|
├── eslint.config.mjs
|
|
106
113
|
├── messages
|
|
107
114
|
│ ├── en
|
|
108
|
-
│ │ ├──
|
|
115
|
+
│ │ ├── Dashboard.json
|
|
109
116
|
│ │ ├── _global_ui.json
|
|
110
117
|
│ │ ├── _home.json
|
|
111
|
-
│ │ ├──
|
|
112
|
-
│ │ ├──
|
|
113
|
-
│ │ ├──
|
|
114
|
-
│ │ └──
|
|
118
|
+
│ │ ├── Login.json
|
|
119
|
+
│ │ ├── Register.json
|
|
120
|
+
│ │ ├── Settings.json
|
|
121
|
+
│ │ └── UserInfo.json
|
|
115
122
|
│ ├── en.ts
|
|
116
123
|
│ ├── fr
|
|
117
|
-
│ │ ├──
|
|
124
|
+
│ │ ├── Dashboard.json
|
|
118
125
|
│ │ ├── _global_ui.json
|
|
119
126
|
│ │ ├── _home.json
|
|
120
|
-
│ │ ├──
|
|
121
|
-
│ │ ├──
|
|
122
|
-
│ │ ├──
|
|
123
|
-
│ │ └──
|
|
127
|
+
│ │ ├── Login.json
|
|
128
|
+
│ │ ├── Register.json
|
|
129
|
+
│ │ ├── Settings.json
|
|
130
|
+
│ │ └── UserInfo.json
|
|
124
131
|
│ ├── fr.ts
|
|
125
132
|
│ └── getMergedMessages.ts
|
|
126
133
|
├── middleware.ts
|
|
@@ -129,26 +136,17 @@ my-next-app/
|
|
|
129
136
|
├── package.json
|
|
130
137
|
├── postcss.config.mjs
|
|
131
138
|
├── public
|
|
132
|
-
│ ├── cnp-logo.ico
|
|
133
139
|
│ ├── cnp-logo.png
|
|
134
|
-
│
|
|
135
|
-
│ ├── file.svg
|
|
136
|
-
│ ├── globe.svg
|
|
137
|
-
│ ├── next.svg
|
|
138
|
-
│ ├── vercel.svg
|
|
139
|
-
│ └── window.svg
|
|
140
|
+
│ └── cnp-logo.svg
|
|
140
141
|
├── README.md
|
|
141
142
|
├── src
|
|
142
143
|
│ ├── app
|
|
143
144
|
│ │ ├── api
|
|
144
|
-
│ │ │
|
|
145
|
-
│ │ │
|
|
146
|
-
│ │ │
|
|
147
|
-
│ │ │
|
|
148
|
-
│ │ │
|
|
149
|
-
│ │ │ │ └── route.ts
|
|
150
|
-
│ │ │ └── me
|
|
151
|
-
│ │ │ └── route.ts
|
|
145
|
+
│ │ │ └── auth
|
|
146
|
+
│ │ │ ├── [...nextauth]
|
|
147
|
+
│ │ │ │ └── route.ts
|
|
148
|
+
│ │ │ └── post-login
|
|
149
|
+
│ │ │ └── route.ts
|
|
152
150
|
│ │ ├── favicon.ico
|
|
153
151
|
│ │ ├── layout.tsx
|
|
154
152
|
│ │ ├── [locale]
|
|
@@ -161,20 +159,20 @@ my-next-app/
|
|
|
161
159
|
│ │ │ │ │ ├── loading.tsx
|
|
162
160
|
│ │ │ │ │ └── page.tsx
|
|
163
161
|
│ │ │ │ ├── layout.tsx
|
|
164
|
-
│ │ │ │ ├──
|
|
162
|
+
│ │ │ │ ├── Login
|
|
165
163
|
│ │ │ │ │ └── page.tsx
|
|
166
|
-
│ │ │ │ └──
|
|
164
|
+
│ │ │ │ └── Register
|
|
167
165
|
│ │ │ │ └── page.tsx
|
|
168
166
|
│ │ │ └── (user)
|
|
169
|
-
│ │ │ ├──
|
|
167
|
+
│ │ │ ├── Dashboard
|
|
170
168
|
│ │ │ │ ├── error.tsx
|
|
171
169
|
│ │ │ │ ├── loading.tsx
|
|
172
170
|
│ │ │ │ └── page.tsx
|
|
173
171
|
│ │ │ ├── layout.tsx
|
|
174
|
-
│ │ │ ├──
|
|
172
|
+
│ │ │ ├── Settings
|
|
175
173
|
│ │ │ │ ├── loading.tsx
|
|
176
174
|
│ │ │ │ └── page.tsx
|
|
177
|
-
│ │ │ └──
|
|
175
|
+
│ │ │ └── UserInfo
|
|
178
176
|
│ │ │ ├── loading.tsx
|
|
179
177
|
│ │ │ └── page.tsx
|
|
180
178
|
│ │ ├── not-found.tsx
|
|
@@ -186,24 +184,39 @@ my-next-app/
|
|
|
186
184
|
│ ├── config.ts
|
|
187
185
|
│ ├── lib
|
|
188
186
|
│ │ ├── auth
|
|
187
|
+
│ │ │ ├── disconnect.ts
|
|
189
188
|
│ │ │ └── isConnected.ts
|
|
190
|
-
│ │
|
|
191
|
-
│ │
|
|
192
|
-
│ │
|
|
193
|
-
│ │
|
|
189
|
+
│ │ ├── i18n
|
|
190
|
+
│ │ │ ├── navigation.ts
|
|
191
|
+
│ │ │ ├── request.ts
|
|
192
|
+
│ │ │ └── routing.ts
|
|
193
|
+
│ │ └── utils.ts
|
|
194
194
|
│ └── ui
|
|
195
|
-
│ ├──
|
|
196
|
-
│ │ ├──
|
|
195
|
+
│ ├── Dashboard
|
|
196
|
+
│ │ ├── LogoutButton.tsx
|
|
197
|
+
│ │ ├── page-ui.tsx
|
|
197
198
|
│ │ ├── StatsCard.tsx
|
|
198
199
|
│ │ └── WelcomeCard.tsx
|
|
199
200
|
│ ├── _global
|
|
200
201
|
│ │ ├── BackButton.tsx
|
|
202
|
+
│ │ ├── Button.tsx
|
|
201
203
|
│ │ ├── GlobalHeader.tsx
|
|
202
204
|
│ │ ├── GlobalMain.tsx
|
|
205
|
+
│ │ ├── Loading.tsx
|
|
203
206
|
│ │ ├── LocaleSwitcher.tsx
|
|
204
207
|
│ │ ├── PublicNav.tsx
|
|
208
|
+
│ │ ├── ThemeToggle.tsx
|
|
205
209
|
│ │ └── UserNav.tsx
|
|
206
|
-
│
|
|
210
|
+
│ ├── _home
|
|
211
|
+
│ │ └── page-ui.tsx
|
|
212
|
+
│ ├── Login
|
|
213
|
+
│ │ └── page-ui.tsx
|
|
214
|
+
│ ├── Register
|
|
215
|
+
│ │ └── page-ui.tsx
|
|
216
|
+
│ ├── Settings
|
|
217
|
+
│ │ └── page-ui.tsx
|
|
218
|
+
│ └── UserInfo
|
|
219
|
+
│ └── page-ui.tsx
|
|
207
220
|
├── tailwind.config.ts
|
|
208
221
|
└── tsconfig.json
|
|
209
222
|
```
|
|
@@ -212,20 +225,22 @@ my-next-app/
|
|
|
212
225
|
|
|
213
226
|
## ✅ Main Features
|
|
214
227
|
|
|
215
|
-
- Interactive CLI
|
|
216
|
-
-
|
|
217
|
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
-
|
|
226
|
-
-
|
|
227
|
-
- `.env`, `.env.local`, `.env.production`, etc.
|
|
228
|
+
- Interactive CLI available for Bun, Node.js, or Deno
|
|
229
|
+
- Multi-runtime support: Bun, Node.js, Deno
|
|
230
|
+
- Features:
|
|
231
|
+
- TypeScript integration
|
|
232
|
+
- ESLint configuration
|
|
233
|
+
- Tailwind CSS setup
|
|
234
|
+
- App Router support (with or without `src/` directory)
|
|
235
|
+
- Internationalization using `next-intl`
|
|
236
|
+
- Turbopack or Webpack support
|
|
237
|
+
- Custom path aliases (e.g., `@/*`, `@core/*`)
|
|
238
|
+
- Next-auth with custom cookies
|
|
239
|
+
- Automatic generation of pages and components
|
|
228
240
|
- Clean i18n structure: `/messages/en/*.json`, `/lib/i18n/`
|
|
241
|
+
- Add or remove pages and components via CLI
|
|
242
|
+
- Bash and Zsh autocompletion
|
|
243
|
+
- Interactive installation and runtime detection
|
|
229
244
|
|
|
230
245
|
---
|
|
231
246
|
|
|
@@ -234,19 +249,26 @@ my-next-app/
|
|
|
234
249
|
```plaintext
|
|
235
250
|
create-next-pro/
|
|
236
251
|
.
|
|
237
|
-
├── bin.ts
|
|
238
|
-
├──
|
|
239
|
-
├── create-next-pro-completion.sh # Auto completion for source
|
|
240
|
-
├── FONCTIONALITY.md
|
|
252
|
+
├── bin.ts
|
|
253
|
+
├── create-next-pro-completion.sh
|
|
241
254
|
├── install.sh
|
|
242
|
-
├── package.json
|
|
243
|
-
├──
|
|
255
|
+
├── package.json
|
|
256
|
+
├── public
|
|
257
|
+
│ ├── cnp-banner.svg
|
|
258
|
+
│ └── logo.svg
|
|
244
259
|
├── src
|
|
245
|
-
│ ├── index.ts
|
|
246
|
-
│ ├──
|
|
260
|
+
│ ├── index.ts
|
|
261
|
+
│ ├── lib
|
|
262
|
+
│ │ ├── addComponent.ts
|
|
263
|
+
│ │ ├── addPage.ts
|
|
264
|
+
│ │ ├── createProject.ts
|
|
265
|
+
│ │ ├── createProjectWithPrompt.ts
|
|
266
|
+
│ │ ├── rmPage.ts
|
|
267
|
+
│ │ ├── utils.test.ts
|
|
268
|
+
│ │ └── utils.ts
|
|
247
269
|
│ ├── scaffold-dev.ts
|
|
248
270
|
│ └── scaffold.ts
|
|
249
|
-
└── tsconfig.json
|
|
271
|
+
└── tsconfig.json
|
|
250
272
|
|
|
251
273
|
```
|
|
252
274
|
|
|
@@ -254,26 +276,31 @@ create-next-pro/
|
|
|
254
276
|
|
|
255
277
|
## 🚀 Install & Usage
|
|
256
278
|
|
|
257
|
-
### Local from git (dev)
|
|
279
|
+
### Local from git ( dev & bun only )
|
|
258
280
|
|
|
259
281
|
```bash
|
|
282
|
+
git clone https://github.com/Rising-Corporation/create-next-pro-cli.git
|
|
260
283
|
bun install
|
|
261
284
|
bun dev
|
|
262
285
|
```
|
|
263
286
|
|
|
264
|
-
|
|
287
|
+
- then Global ( on your machine )
|
|
265
288
|
|
|
266
289
|
```bash
|
|
267
290
|
bun link create-next-pro-cli
|
|
268
291
|
create-next-pro my-next-project
|
|
269
292
|
```
|
|
270
293
|
|
|
271
|
-
### From
|
|
294
|
+
### From npm (via bunx , npx ... or global install)
|
|
272
295
|
|
|
273
296
|
```bash
|
|
274
297
|
bunx create-next-pro-cli # to try without install
|
|
275
|
-
|
|
276
|
-
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
- or
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
bun install -g create-next-pro-cli #ℹ️
|
|
277
304
|
```
|
|
278
305
|
|
|
279
306
|
> ℹ️ To enable autocompletion automatically, add the `--trust` option when installing globally with Bun:
|
|
@@ -288,7 +315,7 @@ bun install -g create-next-pro-cli
|
|
|
288
315
|
> bash install.sh
|
|
289
316
|
> ```
|
|
290
317
|
|
|
291
|
-
>
|
|
318
|
+
> Or add the autocompletion line to your `.bashrc`/`.zshrc` :
|
|
292
319
|
>
|
|
293
320
|
> ```bash
|
|
294
321
|
> source ~/.bun/install/global/node_modules/create-next-pro-cli/create-next-pro-completion.sh
|
|
@@ -299,33 +326,24 @@ bun install -g create-next-pro-cli
|
|
|
299
326
|
> ```bash
|
|
300
327
|
> source ~/.bashrc
|
|
301
328
|
> ```
|
|
329
|
+
>
|
|
330
|
+
> ||
|
|
331
|
+
>
|
|
332
|
+
> ```bash
|
|
333
|
+
> source ~/.zshrc
|
|
334
|
+
> ```
|
|
302
335
|
|
|
303
336
|
---
|
|
304
337
|
|
|
305
|
-
## 🛣️ Roadmap
|
|
338
|
+
## 🛣️ Roadmap in coming for beta v0.2.0
|
|
306
339
|
|
|
307
|
-
- [x] Bun config + `tsconfig.json`
|
|
308
|
-
- [x] `bin.ts` CLI entry point
|
|
309
|
-
- [x] CLI project structure `src/index.ts`
|
|
310
340
|
- [ ] Implementation of interactive prompts
|
|
311
|
-
- [
|
|
312
|
-
- [
|
|
313
|
-
- [x] Custom alias support
|
|
314
|
-
- [x] Next-auth with custom cookies
|
|
315
|
-
- [x] Full `next-intl` support with `lib/i18n/` and `messages/`
|
|
341
|
+
- [ ] Create library features
|
|
342
|
+
- [ ] Create API features
|
|
316
343
|
- [ ] Generation of `.env.*`
|
|
317
344
|
- [ ] Multi-platform testing (`bunx`, `link`, `npm`, etc.)
|
|
318
|
-
- [
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
## ✨ Coming Soon
|
|
323
|
-
|
|
324
|
-
- Additional Components templates (admin panel, landing page, etc.)
|
|
325
|
-
- Library templates
|
|
326
|
-
- API templates
|
|
327
|
-
- Prettier / Husky / Commitlint integration
|
|
328
|
-
- Auto deployment to Vercel
|
|
345
|
+
- [ ] Additional Components templates (admin panel, landing page, etc.)
|
|
346
|
+
- [ ] Auto deployment to Vercel
|
|
329
347
|
|
|
330
348
|
---
|
|
331
349
|
|