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.
- package/.github/workflows/ci.yml +38 -0
- package/README.md +105 -86
- package/bin.ts +0 -0
- package/dist/bin.js +5466 -0
- package/install.sh +64 -8
- package/package.json +9 -3
- 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/src/index.ts +0 -67
- package/src/lib/addComponent.ts +0 -119
- package/src/lib/addPage.ts +0 -170
- package/src/lib/createProject.ts +0 -18
- package/src/lib/createProjectWithPrompt.ts +0 -79
- package/src/lib/rmPage.ts +0 -52
- package/src/lib/utils.ts +0 -36
- package/src/scaffold-dev.ts +0 -89
- package/src/scaffold.ts +0 -70
- package/templates/Projects/default/README.md +0 -36
- package/templates/Projects/default/src/app/[locale]/(public)/Login/page.tsx +0 -6
- package/templates/Projects/default/src/app/[locale]/(public)/Register/page.tsx +0 -6
- package/templates/Projects/default/src/app/[locale]/(public)/_home/loading.tsx +0 -5
- package/templates/Projects/default/src/app/[locale]/(public)/_home/page.tsx +0 -6
- package/templates/Projects/default/src/app/[locale]/(public)/layout.tsx +0 -9
- package/templates/Projects/default/src/app/[locale]/(user)/Dashboard/error.tsx +0 -38
- package/templates/Projects/default/src/app/[locale]/(user)/Dashboard/loading.tsx +0 -10
- package/templates/Projects/default/src/app/[locale]/(user)/Dashboard/page.tsx +0 -5
- package/templates/Projects/default/src/app/[locale]/(user)/Settings/loading.tsx +0 -17
- package/templates/Projects/default/src/app/[locale]/(user)/Settings/page.tsx +0 -6
- package/templates/Projects/default/src/app/[locale]/(user)/UserInfo/loading.tsx +0 -17
- package/templates/Projects/default/src/app/[locale]/(user)/UserInfo/page.tsx +0 -6
- package/templates/Projects/default/src/app/[locale]/(user)/layout.tsx +0 -9
- package/templates/Projects/default/src/app/[locale]/layout.tsx +0 -31
- package/templates/Projects/default/src/app/[locale]/loading.tsx +0 -14
- package/templates/Projects/default/src/app/[locale]/not-found.tsx +0 -22
- package/templates/Projects/default/src/app/[locale]/page.tsx +0 -6
- package/templates/Projects/default/src/app/api/auth/[...nextauth]/route.ts +0 -62
- package/templates/Projects/default/src/app/api/auth/post-login/route.ts +0 -26
- package/templates/Projects/default/src/app/favicon.ico +0 -0
- package/templates/Projects/default/src/app/layout.tsx +0 -11
- package/templates/Projects/default/src/app/not-found.tsx +0 -17
- package/templates/Projects/default/src/app/page.tsx +0 -6
- package/templates/Projects/default/src/app/sitemap.ts +0 -27
- package/templates/Projects/default/src/app/styles/globals.css +0 -305
- package/templates/Projects/default/src/auth.config.ts +0 -0
- package/templates/Projects/default/src/config.ts +0 -4
- package/templates/Projects/default/src/lib/auth/disconnect.ts +0 -11
- package/templates/Projects/default/src/lib/auth/isConnected.ts +0 -18
- package/templates/Projects/default/src/lib/i18n/navigation.ts +0 -19
- package/templates/Projects/default/src/lib/i18n/request.ts +0 -31
- package/templates/Projects/default/src/lib/i18n/routing.ts +0 -20
- package/templates/Projects/default/src/lib/utils.ts +0 -6
- package/templates/Projects/default/src/ui/Dashboard/LogoutButton.tsx +0 -27
- package/templates/Projects/default/src/ui/Dashboard/StatsCard.tsx +0 -14
- package/templates/Projects/default/src/ui/Dashboard/WelcomeCard.tsx +0 -10
- package/templates/Projects/default/src/ui/Dashboard/page-ui.tsx +0 -23
- package/templates/Projects/default/src/ui/Login/page-ui.tsx +0 -22
- package/templates/Projects/default/src/ui/Register/page-ui.tsx +0 -26
- package/templates/Projects/default/src/ui/Settings/page-ui.tsx +0 -17
- package/templates/Projects/default/src/ui/UserInfo/page-ui.tsx +0 -17
- package/templates/Projects/default/src/ui/_global/BackButton.tsx +0 -17
- package/templates/Projects/default/src/ui/_global/Button.tsx +0 -75
- package/templates/Projects/default/src/ui/_global/GlobalHeader.tsx +0 -55
- package/templates/Projects/default/src/ui/_global/GlobalMain.tsx +0 -15
- package/templates/Projects/default/src/ui/_global/Loading.tsx +0 -13
- package/templates/Projects/default/src/ui/_global/LocaleSwitcher.tsx +0 -38
- package/templates/Projects/default/src/ui/_global/PublicNav.tsx +0 -91
- package/templates/Projects/default/src/ui/_global/ThemeToggle.tsx +0 -53
- package/templates/Projects/default/src/ui/_global/UserNav.tsx +0 -35
- 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
|
-
|
|
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
|

|
|
@@ -7,6 +13,7 @@
|
|
|
7
13
|

|
|
8
14
|

|
|
9
15
|

|
|
16
|
+

|
|
10
17
|
|
|
11
18
|

|
|
12
19
|

|
|
@@ -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
|
-
│ │ ├──
|
|
116
|
+
│ │ ├── Dashboard.json
|
|
109
117
|
│ │ ├── _global_ui.json
|
|
110
118
|
│ │ ├── _home.json
|
|
111
|
-
│ │ ├──
|
|
112
|
-
│ │ ├──
|
|
113
|
-
│ │ ├──
|
|
114
|
-
│ │ └──
|
|
119
|
+
│ │ ├── Login.json
|
|
120
|
+
│ │ ├── Register.json
|
|
121
|
+
│ │ ├── Settings.json
|
|
122
|
+
│ │ └── UserInfo.json
|
|
115
123
|
│ ├── en.ts
|
|
116
124
|
│ ├── fr
|
|
117
|
-
│ │ ├──
|
|
125
|
+
│ │ ├── Dashboard.json
|
|
118
126
|
│ │ ├── _global_ui.json
|
|
119
127
|
│ │ ├── _home.json
|
|
120
|
-
│ │ ├──
|
|
121
|
-
│ │ ├──
|
|
122
|
-
│ │ ├──
|
|
123
|
-
│ │ └──
|
|
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
|
-
│
|
|
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
|
-
│ │ │
|
|
145
|
-
│ │ │
|
|
146
|
-
│ │ │
|
|
147
|
-
│ │ │
|
|
148
|
-
│ │ │
|
|
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
|
-
│ │ │ │ ├──
|
|
163
|
+
│ │ │ │ ├── Login
|
|
165
164
|
│ │ │ │ │ └── page.tsx
|
|
166
|
-
│ │ │ │ └──
|
|
165
|
+
│ │ │ │ └── Register
|
|
167
166
|
│ │ │ │ └── page.tsx
|
|
168
167
|
│ │ │ └── (user)
|
|
169
|
-
│ │ │ ├──
|
|
168
|
+
│ │ │ ├── Dashboard
|
|
170
169
|
│ │ │ │ ├── error.tsx
|
|
171
170
|
│ │ │ │ ├── loading.tsx
|
|
172
171
|
│ │ │ │ └── page.tsx
|
|
173
172
|
│ │ │ ├── layout.tsx
|
|
174
|
-
│ │ │ ├──
|
|
173
|
+
│ │ │ ├── Settings
|
|
175
174
|
│ │ │ │ ├── loading.tsx
|
|
176
175
|
│ │ │ │ └── page.tsx
|
|
177
|
-
│ │ │ └──
|
|
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
|
-
│ │
|
|
191
|
-
│ │
|
|
192
|
-
│ │
|
|
193
|
-
│ │
|
|
190
|
+
│ │ ├── i18n
|
|
191
|
+
│ │ │ ├── navigation.ts
|
|
192
|
+
│ │ │ ├── request.ts
|
|
193
|
+
│ │ │ └── routing.ts
|
|
194
|
+
│ │ └── utils.ts
|
|
194
195
|
│ └── ui
|
|
195
|
-
│ ├──
|
|
196
|
-
│ │ ├──
|
|
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
|
-
│
|
|
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
|
|
216
|
-
-
|
|
217
|
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
-
|
|
221
|
-
-
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
-
|
|
226
|
-
-
|
|
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
|
|
238
|
-
├──
|
|
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
|
|
243
|
-
├──
|
|
256
|
+
├── package.json
|
|
257
|
+
├── public
|
|
258
|
+
│ ├── cnp-banner.svg
|
|
259
|
+
│ └── logo.svg
|
|
244
260
|
├── src
|
|
245
|
-
│ ├── index.ts
|
|
246
|
-
│ ├──
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
276
|
-
|
|
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
|
-
>
|
|
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
|
-
- [
|
|
312
|
-
- [
|
|
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
|
-
- [
|
|
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
|