create-next-pro-cli 0.1.25 → 0.1.26
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/dist/create-next-pro
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
#!/usr/bin/env sh
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
# Resolve $0 in absolute real path (handle PATH + symlinks)
|
|
5
|
+
resolve_self() {
|
|
6
|
+
_self="$1"
|
|
7
|
+
case "$_self" in
|
|
8
|
+
/*) : ;; # already absolute
|
|
9
|
+
*) _self="$(command -v -- "$_self" || printf '%s' "$_self")" ;;
|
|
10
|
+
esac
|
|
11
|
+
# follow symlinks
|
|
12
|
+
while [ -L "$_self" ]; do
|
|
13
|
+
_dir="$(cd -- "$(dirname -- "$_self")" && pwd -P)"
|
|
14
|
+
_link="$(readlink -- "$_self")"
|
|
15
|
+
case "$_link" in
|
|
16
|
+
/*) _self="$_link" ;;
|
|
17
|
+
*) _self="$_dir/$_link" ;;
|
|
18
|
+
esac
|
|
19
|
+
done
|
|
20
|
+
_dir="$(cd -- "$(dirname -- "$_self")" && pwd -P)"
|
|
21
|
+
printf '%s/%s\n' "$_dir" "$(basename -- "$_self")"
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
SELF_PATH="$(resolve_self "$0")" # …/create-next-pro
|
|
25
|
+
DIST_DIR="$(cd -- "$(dirname -- "$SELF_PATH")" && pwd -P)" # …/dist
|
|
26
|
+
PKG_DIR="$(cd -- "$DIST_DIR/.." && pwd -P)" # …/create-next-pro-cli
|
|
27
|
+
|
|
28
|
+
# (optional) debug
|
|
29
|
+
# echo "SELF_PATH=$SELF_PATH"; echo "DIST_DIR=$DIST_DIR"; echo "PKG_DIR=$PKG_DIR" >&2
|
|
30
|
+
|
|
31
|
+
# Launch your real entrypoint from the right folder
|
|
32
|
+
if command -v bun >/dev/null 2>&1 && [ -f "$DIST_DIR/bin.bun.js" ]; then
|
|
33
|
+
exec bun "$DIST_DIR/bin.bun.js" "$@"
|
|
34
|
+
elif command -v node >/dev/null 2>&1 && [ -f "$DIST_DIR/bin.node.js" ]; then
|
|
35
|
+
exec node "$DIST_DIR/bin.node.js" "$@"
|
|
7
36
|
else
|
|
8
|
-
echo "Error: need bun or node in PATH, or
|
|
37
|
+
echo "Error: need bun or node in PATH, or entry file not found" >&2
|
|
9
38
|
exit 1
|
|
10
39
|
fi
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# My Next.js Project
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-pro`](https://github.com/Rising-Corporation/create-next-pro-cli).
|
|
4
|
+
|
|
5
|
+
## 🚀 Getting Started
|
|
4
6
|
|
|
5
7
|
First, run the development server:
|
|
6
8
|
|
|
@@ -16,21 +18,120 @@ bun dev
|
|
|
16
18
|
|
|
17
19
|
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
18
20
|
|
|
19
|
-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
|
21
|
+
You can start editing the page by modifying `src/app/[locale]/page.tsx`. The page auto-updates as you edit the file.
|
|
22
|
+
|
|
23
|
+
## ✨ Features
|
|
24
|
+
|
|
25
|
+
This project comes with the following features pre-configured:
|
|
26
|
+
|
|
27
|
+
- **🌍 Internationalization (i18n)** - Using `next-intl` with locale-based routing
|
|
28
|
+
- **🎨 Tailwind CSS** - Utility-first CSS framework
|
|
29
|
+
- **⚡ TypeScript** - Type-safe development
|
|
30
|
+
- **🔐 Authentication** - NextAuth.js integration
|
|
31
|
+
- **📱 Responsive Design** - Mobile-first approach
|
|
32
|
+
- **⚙️ ESLint & Prettier** - Code quality and formatting
|
|
33
|
+
- **🎯 App Router** - Latest Next.js routing system
|
|
34
|
+
|
|
35
|
+
## 🛠️ CLI Commands
|
|
36
|
+
|
|
37
|
+
You can use `create-next-pro` to add and manage your project structure:
|
|
38
|
+
|
|
39
|
+
### Add a new page:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
create-next-pro addpage MyPage
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Add a nested page:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
create-next-pro addpage ParentPage.ChildPage
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Add a component (global):
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
create-next-pro addcomponent MyComponent
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Add a component in a specific page:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
create-next-pro addcomponent MyComponent -P MyPage
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Add a library:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
create-next-pro addlib mylib
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Add an API route:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
create-next-pro addapi hello
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Add a new language (i18n):
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
create-next-pro addlanguage fr
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Add translation text:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
create-next-pro addtext MyPage.welcome "Welcome to my page"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Remove a page:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
create-next-pro rmpage MyPage
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## 📁 Project Structure
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
src/
|
|
97
|
+
├── app/
|
|
98
|
+
│ ├── [locale]/ # Internationalization routing
|
|
99
|
+
│ │ ├── (public)/ # Public pages (login, register)
|
|
100
|
+
│ │ └── (user)/ # Protected pages (dashboard, settings)
|
|
101
|
+
│ └── api/ # API routes
|
|
102
|
+
├── lib/ # Utility libraries
|
|
103
|
+
│ ├── auth/ # Authentication helpers
|
|
104
|
+
│ └── i18n/ # Internationalization config
|
|
105
|
+
└── ui/ # UI components organized by page
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 🌐 Internationalization
|
|
109
|
+
|
|
110
|
+
The project supports multiple languages through the `messages/` directory:
|
|
111
|
+
|
|
112
|
+
- `messages/en/` - English translations
|
|
113
|
+
- `messages/fr/` - French translations
|
|
114
|
+
- Add more languages with `create-next-pro addlanguage <locale>`
|
|
115
|
+
|
|
116
|
+
## 🔐 Authentication
|
|
117
|
+
|
|
118
|
+
Authentication is configured with NextAuth.js. Check `src/auth.config.ts` for configuration and `/api/auth/` for auth routes.
|
|
20
119
|
|
|
21
|
-
|
|
120
|
+
## 📚 Learn More
|
|
22
121
|
|
|
23
|
-
|
|
122
|
+
To learn more about the technologies used:
|
|
24
123
|
|
|
25
|
-
|
|
124
|
+
- [Next.js Documentation](https://nextjs.org/docs)
|
|
125
|
+
- [Tailwind CSS](https://tailwindcss.com/docs)
|
|
126
|
+
- [next-intl Documentation](https://next-intl-docs.vercel.app/)
|
|
127
|
+
- [NextAuth.js Documentation](https://next-auth.js.org/)
|
|
26
128
|
|
|
27
|
-
|
|
28
|
-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
129
|
+
## 🚀 Deploy on Vercel
|
|
29
130
|
|
|
30
|
-
|
|
131
|
+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new) from the creators of Next.js.
|
|
31
132
|
|
|
32
|
-
|
|
133
|
+
Check out the [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
|
33
134
|
|
|
34
|
-
|
|
135
|
+
---
|
|
35
136
|
|
|
36
|
-
|
|
137
|
+
Created with ❤️ using [create-next-pro](https://github.com/Rising-Corporation/create-next-pro-cli)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
PORT=3000
|
|
2
|
+
PROJECT_PRODUCTION_URL=your-production-url.com
|
|
3
|
+
NEXTAUTH_URL=http://localhost:3000/api/auth
|
|
4
|
+
NEXTAUTH_SECRET=ONGGG2GIf5Mc4LpWv69WR8J+WazM8BmGa8hSex1dEvg=# generate a new secret using `openssl rand -base64 32`
|
|
5
|
+
APP_JWT_SECRET=3bsnnr4PqTaXBvDMstnSjhd2FdYbi1CgSjXMF9s446c=# generate a new secret using `openssl rand -base64 32`
|
|
6
|
+
|
|
7
|
+
GOOGLE_CLIENT_ID=# your Google Client ID , you can get it from https://console.cloud.google.com/apis/credentials
|
|
8
|
+
GOOGLE_CLIENT_SECRET=# your Google Client Secret , you can get it from https://console.cloud.google.com/apis/credentials
|