create-next-pro-cli 0.1.12 → 0.1.14

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.
Files changed (72) hide show
  1. package/.github/workflows/ci.yml +38 -0
  2. package/README.md +105 -86
  3. package/bin.ts +0 -0
  4. package/dist/bin.js +5466 -0
  5. package/install.sh +64 -8
  6. package/package.json +9 -3
  7. package/.husky/commit-msg +0 -2
  8. package/.husky/pre-commit +0 -2
  9. package/CODE_OF_CONDUCT.md +0 -33
  10. package/CONTRIBUTING.md +0 -44
  11. package/FONCTIONALITY.md +0 -25
  12. package/src/index.ts +0 -67
  13. package/src/lib/addComponent.ts +0 -119
  14. package/src/lib/addPage.ts +0 -170
  15. package/src/lib/createProject.ts +0 -18
  16. package/src/lib/createProjectWithPrompt.ts +0 -79
  17. package/src/lib/rmPage.ts +0 -52
  18. package/src/lib/utils.ts +0 -36
  19. package/src/scaffold-dev.ts +0 -89
  20. package/src/scaffold.ts +0 -70
  21. package/templates/Projects/default/README.md +0 -36
  22. package/templates/Projects/default/src/app/[locale]/(public)/Login/page.tsx +0 -6
  23. package/templates/Projects/default/src/app/[locale]/(public)/Register/page.tsx +0 -6
  24. package/templates/Projects/default/src/app/[locale]/(public)/_home/loading.tsx +0 -5
  25. package/templates/Projects/default/src/app/[locale]/(public)/_home/page.tsx +0 -6
  26. package/templates/Projects/default/src/app/[locale]/(public)/layout.tsx +0 -9
  27. package/templates/Projects/default/src/app/[locale]/(user)/Dashboard/error.tsx +0 -38
  28. package/templates/Projects/default/src/app/[locale]/(user)/Dashboard/loading.tsx +0 -10
  29. package/templates/Projects/default/src/app/[locale]/(user)/Dashboard/page.tsx +0 -5
  30. package/templates/Projects/default/src/app/[locale]/(user)/Settings/loading.tsx +0 -17
  31. package/templates/Projects/default/src/app/[locale]/(user)/Settings/page.tsx +0 -6
  32. package/templates/Projects/default/src/app/[locale]/(user)/UserInfo/loading.tsx +0 -17
  33. package/templates/Projects/default/src/app/[locale]/(user)/UserInfo/page.tsx +0 -6
  34. package/templates/Projects/default/src/app/[locale]/(user)/layout.tsx +0 -9
  35. package/templates/Projects/default/src/app/[locale]/layout.tsx +0 -31
  36. package/templates/Projects/default/src/app/[locale]/loading.tsx +0 -14
  37. package/templates/Projects/default/src/app/[locale]/not-found.tsx +0 -22
  38. package/templates/Projects/default/src/app/[locale]/page.tsx +0 -6
  39. package/templates/Projects/default/src/app/api/auth/[...nextauth]/route.ts +0 -62
  40. package/templates/Projects/default/src/app/api/auth/post-login/route.ts +0 -26
  41. package/templates/Projects/default/src/app/favicon.ico +0 -0
  42. package/templates/Projects/default/src/app/layout.tsx +0 -11
  43. package/templates/Projects/default/src/app/not-found.tsx +0 -17
  44. package/templates/Projects/default/src/app/page.tsx +0 -6
  45. package/templates/Projects/default/src/app/sitemap.ts +0 -27
  46. package/templates/Projects/default/src/app/styles/globals.css +0 -305
  47. package/templates/Projects/default/src/auth.config.ts +0 -0
  48. package/templates/Projects/default/src/config.ts +0 -4
  49. package/templates/Projects/default/src/lib/auth/disconnect.ts +0 -11
  50. package/templates/Projects/default/src/lib/auth/isConnected.ts +0 -18
  51. package/templates/Projects/default/src/lib/i18n/navigation.ts +0 -19
  52. package/templates/Projects/default/src/lib/i18n/request.ts +0 -31
  53. package/templates/Projects/default/src/lib/i18n/routing.ts +0 -20
  54. package/templates/Projects/default/src/lib/utils.ts +0 -6
  55. package/templates/Projects/default/src/ui/Dashboard/LogoutButton.tsx +0 -27
  56. package/templates/Projects/default/src/ui/Dashboard/StatsCard.tsx +0 -14
  57. package/templates/Projects/default/src/ui/Dashboard/WelcomeCard.tsx +0 -10
  58. package/templates/Projects/default/src/ui/Dashboard/page-ui.tsx +0 -23
  59. package/templates/Projects/default/src/ui/Login/page-ui.tsx +0 -22
  60. package/templates/Projects/default/src/ui/Register/page-ui.tsx +0 -26
  61. package/templates/Projects/default/src/ui/Settings/page-ui.tsx +0 -17
  62. package/templates/Projects/default/src/ui/UserInfo/page-ui.tsx +0 -17
  63. package/templates/Projects/default/src/ui/_global/BackButton.tsx +0 -17
  64. package/templates/Projects/default/src/ui/_global/Button.tsx +0 -75
  65. package/templates/Projects/default/src/ui/_global/GlobalHeader.tsx +0 -55
  66. package/templates/Projects/default/src/ui/_global/GlobalMain.tsx +0 -15
  67. package/templates/Projects/default/src/ui/_global/Loading.tsx +0 -13
  68. package/templates/Projects/default/src/ui/_global/LocaleSwitcher.tsx +0 -38
  69. package/templates/Projects/default/src/ui/_global/PublicNav.tsx +0 -91
  70. package/templates/Projects/default/src/ui/_global/ThemeToggle.tsx +0 -53
  71. package/templates/Projects/default/src/ui/_global/UserNav.tsx +0 -35
  72. package/templates/Projects/default/src/ui/_home/page-ui.tsx +0 -27
@@ -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
- ![create-next-pro logo](./public/cnp-banner.svg)
1
+ <img src="./public/cnp-banner.svg" alt="create-next-pro logo" style="width:100%;" />
2
+
3
+ # Runtime Support
4
+
5
+ [![Bun](https://img.shields.io/badge/Bun-%23000000?logo=bun&logoColor=white&style=for-the-badge)](https://bun.sh)
6
+ [![Node.js](https://img.shields.io/badge/Node.js-%23339933?logo=node.js&logoColor=white&style=for-the-badge)](https://nodejs.org)
7
+ [![Deno](https://img.shields.io/badge/Deno-%23000000?logo=deno&logoColor=white&style=for-the-badge)](https://deno.land)
2
8
 
3
9
  ![npm](https://img.shields.io/npm/v/create-next-pro-cli?logo=npm&color=orange)
4
10
  ![npm dependencies](https://img.shields.io/librariesio/release/npm/create-next-pro-cli?logo=npm)
@@ -7,6 +13,7 @@
7
13
  ![GitHub](https://img.shields.io/github/stars/Rising-Corporation/create-next-pro-cli?style=social&logo=github)
8
14
  ![GitHub forks](https://img.shields.io/github/forks/Rising-Corporation/create-next-pro-cli?style=social&logo=github)
9
15
  ![GitHub issues](https://img.shields.io/github/issues/Rising-Corporation/create-next-pro-cli?logo=github)
16
+ ![CI](https://github.com/Rising-Corporation/typed-sse/actions/workflows/ci.yml/badge.svg)
10
17
 
11
18
  ![status](https://img.shields.io/badge/status-beta-orange)
12
19
  ![license](https://img.shields.io/github/license/Rising-Corporation/create-next-pro-cli?logo=open-source-initiative&logoColor=white)
@@ -102,25 +109,26 @@ create-next-pro rmpage ParentPage.ChildPage
102
109
 
103
110
  ```plaintext
104
111
  my-next-app/
112
+ .
105
113
  ├── eslint.config.mjs
106
114
  ├── messages
107
115
  │ ├── en
108
- │ │ ├── dashboard.json
116
+ │ │ ├── Dashboard.json
109
117
  │ │ ├── _global_ui.json
110
118
  │ │ ├── _home.json
111
- │ │ ├── login.json
112
- │ │ ├── register.json
113
- │ │ ├── settings.json
114
- │ │ └── user_info.json
119
+ │ │ ├── Login.json
120
+ │ │ ├── Register.json
121
+ │ │ ├── Settings.json
122
+ │ │ └── UserInfo.json
115
123
  │ ├── en.ts
116
124
  │ ├── fr
117
- │ │ ├── dashboard.json
125
+ │ │ ├── Dashboard.json
118
126
  │ │ ├── _global_ui.json
119
127
  │ │ ├── _home.json
120
- │ │ ├── login.json
121
- │ │ ├── register.json
122
- │ │ ├── settings.json
123
- │ │ └── user_info.json
128
+ │ │ ├── Login.json
129
+ │ │ ├── Register.json
130
+ │ │ ├── Settings.json
131
+ │ │ └── UserInfo.json
124
132
  │ ├── fr.ts
125
133
  │ └── getMergedMessages.ts
126
134
  ├── middleware.ts
@@ -129,26 +137,17 @@ my-next-app/
129
137
  ├── package.json
130
138
  ├── postcss.config.mjs
131
139
  ├── public
132
- │ ├── cnp-logo.ico
133
140
  │ ├── cnp-logo.png
134
- ├── cnp-logo.svg
135
- │ ├── file.svg
136
- │ ├── globe.svg
137
- │ ├── next.svg
138
- │ ├── vercel.svg
139
- │ └── window.svg
141
+ └── cnp-logo.svg
140
142
  ├── README.md
141
143
  ├── src
142
144
  │ ├── app
143
145
  │ │ ├── api
144
- │ │ │ ├── auth
145
- │ │ │├── [...nextauth]
146
- │ │ │ └── route.ts
147
- │ │ │ │ ├── [...nextauth].ts
148
- │ │ │└── post-login
149
- │ │ │ │ └── route.ts
150
- │ │ │ └── me
151
- │ │ │ └── route.ts
146
+ │ │ │ └── auth
147
+ │ │ │ ├── [...nextauth]
148
+ │ │ │ │ └── route.ts
149
+ │ │ │ └── post-login
150
+ │ │ │ └── route.ts
152
151
  │ │ ├── favicon.ico
153
152
  │ │ ├── layout.tsx
154
153
  │ │ ├── [locale]
@@ -161,20 +160,20 @@ my-next-app/
161
160
  │ │ │ │ │ ├── loading.tsx
162
161
  │ │ │ │ │ └── page.tsx
163
162
  │ │ │ │ ├── layout.tsx
164
- │ │ │ │ ├── login
163
+ │ │ │ │ ├── Login
165
164
  │ │ │ │ │ └── page.tsx
166
- │ │ │ │ └── register
165
+ │ │ │ │ └── Register
167
166
  │ │ │ │ └── page.tsx
168
167
  │ │ │ └── (user)
169
- │ │ │ ├── dashboard
168
+ │ │ │ ├── Dashboard
170
169
  │ │ │ │ ├── error.tsx
171
170
  │ │ │ │ ├── loading.tsx
172
171
  │ │ │ │ └── page.tsx
173
172
  │ │ │ ├── layout.tsx
174
- │ │ │ ├── settings
173
+ │ │ │ ├── Settings
175
174
  │ │ │ │ ├── loading.tsx
176
175
  │ │ │ │ └── page.tsx
177
- │ │ │ └── user_info
176
+ │ │ │ └── UserInfo
178
177
  │ │ │ ├── loading.tsx
179
178
  │ │ │ └── page.tsx
180
179
  │ │ ├── not-found.tsx
@@ -186,24 +185,39 @@ my-next-app/
186
185
  │ ├── config.ts
187
186
  │ ├── lib
188
187
  │ │ ├── auth
188
+ │ │ │ ├── disconnect.ts
189
189
  │ │ │ └── isConnected.ts
190
- │ │ └── i18n
191
- │ │ ├── navigation.ts
192
- │ │ ├── request.ts
193
- │ │ └── routing.ts
190
+ │ │ ├── i18n
191
+ │ │├── navigation.ts
192
+ │ │├── request.ts
193
+ │ │└── routing.ts
194
+ │ │ └── utils.ts
194
195
  │ └── ui
195
- │ ├── dashboard
196
- │ │ ├── page.tsx
196
+ │ ├── Dashboard
197
+ │ │ ├── LogoutButton.tsx
198
+ │ │ ├── page-ui.tsx
197
199
  │ │ ├── StatsCard.tsx
198
200
  │ │ └── WelcomeCard.tsx
199
201
  │ ├── _global
200
202
  │ │ ├── BackButton.tsx
203
+ │ │ ├── Button.tsx
201
204
  │ │ ├── GlobalHeader.tsx
202
205
  │ │ ├── GlobalMain.tsx
206
+ │ │ ├── Loading.tsx
203
207
  │ │ ├── LocaleSwitcher.tsx
204
208
  │ │ ├── PublicNav.tsx
209
+ │ │ ├── ThemeToggle.tsx
205
210
  │ │ └── UserNav.tsx
206
- └── _home
211
+ ├── _home
212
+ │ │ └── page-ui.tsx
213
+ │ ├── Login
214
+ │ │ └── page-ui.tsx
215
+ │ ├── Register
216
+ │ │ └── page-ui.tsx
217
+ │ ├── Settings
218
+ │ │ └── page-ui.tsx
219
+ │ └── UserInfo
220
+ │ └── page-ui.tsx
207
221
  ├── tailwind.config.ts
208
222
  └── tsconfig.json
209
223
  ```
@@ -212,20 +226,22 @@ my-next-app/
212
226
 
213
227
  ## ✅ Main Features
214
228
 
215
- - Interactive CLI via `bun` or `bunx`
216
- - Supports:
217
- - TypeScript
218
- - ESLint
219
- - Tailwind CSS
220
- - App Router (with or without `src/`)
221
- - i18n (`next-intl`)
222
- - Turbopack / Webpack
223
- - Custom aliases (`@/*`, `@core/*`, etc.)
224
- - Automatic generation:
225
- - Folders
226
- - Base pages: `page.tsx`, `layout.tsx`, `loading.tsx`, `not-found.tsx`, `error.tsx`
227
- - `.env`, `.env.local`, `.env.production`, etc.
229
+ - Interactive CLI available for Bun, Node.js, or Deno
230
+ - Multi-runtime support: Bun, Node.js, Deno
231
+ - Features:
232
+ - TypeScript integration
233
+ - ESLint configuration
234
+ - Tailwind CSS setup
235
+ - App Router support (with or without `src/` directory)
236
+ - Internationalization using `next-intl`
237
+ - Turbopack or Webpack support
238
+ - Custom path aliases (e.g., `@/*`, `@core/*`)
239
+ - Next-auth with custom cookies
240
+ - Automatic generation of pages and components
228
241
  - Clean i18n structure: `/messages/en/*.json`, `/lib/i18n/`
242
+ - Add or remove pages and components via CLI
243
+ - Bash and Zsh autocompletion
244
+ - Interactive installation and runtime detection
229
245
 
230
246
  ---
231
247
 
@@ -234,19 +250,26 @@ my-next-app/
234
250
  ```plaintext
235
251
  create-next-pro/
236
252
  .
237
- ├── bin.ts # CLI entry point (#!/usr/bin/env bun)
238
- ├── bun.lock
239
- ├── create-next-pro-completion.sh # Auto completion for source
240
- ├── FONCTIONALITY.md
253
+ ├── bin.ts
254
+ ├── create-next-pro-completion.sh
241
255
  ├── install.sh
242
- ├── package.json # Binary declaration
243
- ├── README.md
256
+ ├── package.json
257
+ ├── public
258
+ │ ├── cnp-banner.svg
259
+ │ └── logo.svg
244
260
  ├── src
245
- │ ├── index.ts # Interactive logic (prompts, generation)
246
- │ ├── logo.svg
261
+ │ ├── index.ts
262
+ │ ├── lib
263
+ │ │ ├── addComponent.ts
264
+ │ │ ├── addPage.ts
265
+ │ │ ├── createProject.ts
266
+ │ │ ├── createProjectWithPrompt.ts
267
+ │ │ ├── rmPage.ts
268
+ │ │ ├── utils.test.ts
269
+ │ │ └── utils.ts
247
270
  │ ├── scaffold-dev.ts
248
271
  │ └── scaffold.ts
249
- └── tsconfig.json # Bun/TypeScript config
272
+ └── tsconfig.json
250
273
 
251
274
  ```
252
275
 
@@ -254,26 +277,31 @@ create-next-pro/
254
277
 
255
278
  ## 🚀 Install & Usage
256
279
 
257
- ### Local from git (dev)
280
+ ### Local from git ( dev & bun only )
258
281
 
259
282
  ```bash
283
+ git clone https://github.com/Rising-Corporation/create-next-pro-cli.git
260
284
  bun install
261
285
  bun dev
262
286
  ```
263
287
 
264
- ### Global (on your machine)
288
+ - then Global ( on your machine )
265
289
 
266
290
  ```bash
267
291
  bun link create-next-pro-cli
268
292
  create-next-pro my-next-project
269
293
  ```
270
294
 
271
- ### From another PC (via bunx or global install)
295
+ ### From npm (via bunx , npx ... or global install)
272
296
 
273
297
  ```bash
274
298
  bunx create-next-pro-cli # to try without install
275
- # or
276
- bun install -g create-next-pro-cli
299
+ ```
300
+
301
+ - or
302
+
303
+ ```bash
304
+ bun install -g create-next-pro-cli #ℹ️
277
305
  ```
278
306
 
279
307
  > ℹ️ To enable autocompletion automatically, add the `--trust` option when installing globally with Bun:
@@ -288,7 +316,7 @@ bun install -g create-next-pro-cli
288
316
  > bash install.sh
289
317
  > ```
290
318
 
291
- > or add the autocompletion line to your `.bashrc`/`.zshrc` :
319
+ > Or add the autocompletion line to your `.bashrc`/`.zshrc` :
292
320
  >
293
321
  > ```bash
294
322
  > source ~/.bun/install/global/node_modules/create-next-pro-cli/create-next-pro-completion.sh
@@ -299,33 +327,24 @@ bun install -g create-next-pro-cli
299
327
  > ```bash
300
328
  > source ~/.bashrc
301
329
  > ```
330
+ >
331
+ > ||
332
+ >
333
+ > ```bash
334
+ > source ~/.zshrc
335
+ > ```
302
336
 
303
337
  ---
304
338
 
305
- ## 🛣️ Roadmap
339
+ ## 🛣️ Roadmap in coming for beta v0.2.0
306
340
 
307
- - [x] Bun config + `tsconfig.json`
308
- - [x] `bin.ts` CLI entry point
309
- - [x] CLI project structure `src/index.ts`
310
341
  - [ ] Implementation of interactive prompts
311
- - [x] Basic Next.js project scaffolding
312
- - [x] CLI file/page generation
313
- - [x] Custom alias support
314
- - [x] Next-auth with custom cookies
315
- - [x] Full `next-intl` support with `lib/i18n/` and `messages/`
342
+ - [ ] Create library features
343
+ - [ ] Create API features
316
344
  - [ ] Generation of `.env.*`
317
345
  - [ ] Multi-platform testing (`bunx`, `link`, `npm`, etc.)
318
- - [x] Publish to npm or Bun registry
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
346
+ - [ ] Additional Components templates (admin panel, landing page, etc.)
347
+ - [ ] Auto deployment to Vercel
329
348
 
330
349
  ---
331
350
 
package/bin.ts CHANGED
File without changes