create-next-pro-cli 0.1.26 → 0.1.27
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/README.md +205 -292
- package/create-next-pro-completion.sh +8 -38
- package/create-next-pro-completion.zsh +13 -0
- package/dist/bin.bun.js +1127 -628
- package/dist/bin.node.js +1170 -617
- package/dist/bin.node.js.map +1 -1
- package/package.json +49 -27
- package/templates/Projects/default/.env.example +17 -0
- package/templates/Projects/default/.github/workflows/quality.yml +24 -0
- package/templates/Projects/default/.gitignore.template +47 -0
- package/templates/Projects/default/.prettierignore +3 -0
- package/templates/Projects/default/README.md +52 -108
- package/templates/Projects/default/bun.lock +1152 -0
- package/templates/Projects/default/eslint.config.mjs +27 -11
- package/templates/Projects/default/messages/en/_global_ui.json +23 -10
- package/templates/Projects/default/messages/en.ts +17 -2
- package/templates/Projects/default/messages/fr/_global_ui.json +23 -10
- package/templates/Projects/default/messages/fr.ts +17 -2
- package/templates/Projects/default/next.config.ts +43 -3
- package/templates/Projects/default/package.json +42 -24
- package/templates/Projects/default/playwright.config.ts +26 -0
- package/templates/Projects/default/pnpm-workspace.yaml +5 -0
- package/templates/Projects/default/public/{cnp-logo.svg → logo.svg} +1 -1
- package/templates/Projects/default/src/app/[locale]/(public)/layout.tsx +8 -1
- package/templates/Projects/default/src/app/[locale]/(public)/login/page.tsx +8 -0
- package/templates/Projects/default/src/app/[locale]/(public)/register/page.tsx +8 -0
- package/templates/Projects/default/src/app/[locale]/(user)/dashboard/error.tsx +25 -0
- package/templates/Projects/default/src/app/[locale]/(user)/dashboard/loading.tsx +5 -0
- package/templates/Projects/default/src/app/[locale]/(user)/{Dashboard → dashboard}/page.tsx +1 -1
- package/templates/Projects/default/src/app/[locale]/(user)/layout.tsx +24 -2
- package/templates/Projects/default/src/app/[locale]/(user)/settings/loading.tsx +5 -0
- package/templates/Projects/default/src/app/[locale]/(user)/{Settings → settings}/page.tsx +1 -2
- package/templates/Projects/default/src/app/[locale]/(user)/userInfo/loading.tsx +5 -0
- package/templates/Projects/default/src/app/[locale]/(user)/{UserInfo → userInfo}/page.tsx +1 -2
- package/templates/Projects/default/src/app/[locale]/layout.tsx +34 -10
- package/templates/Projects/default/src/app/[locale]/loading.tsx +0 -9
- package/templates/Projects/default/src/app/[locale]/not-found.tsx +6 -15
- package/templates/Projects/default/src/app/[locale]/page.tsx +10 -1
- package/templates/Projects/default/src/app/api/auth/[...nextauth]/route.ts +8 -60
- package/templates/Projects/default/src/app/not-found.tsx +1 -1
- package/templates/Projects/default/src/app/sitemap.ts +2 -2
- package/templates/Projects/default/src/app/styles/globals.css +166 -113
- package/templates/Projects/default/src/auth.ts +20 -0
- package/templates/Projects/default/src/config.ts +3 -3
- package/templates/Projects/default/src/env.ts +65 -0
- package/templates/Projects/default/src/lib/i18n/messages.ts +8 -0
- package/templates/Projects/default/src/lib/i18n/request.ts +2 -16
- package/templates/Projects/default/src/lib/security/csp.ts +16 -0
- package/templates/Projects/default/src/lib/utils.ts +2 -1
- package/templates/Projects/default/src/proxy.ts +13 -0
- package/templates/Projects/default/src/ui/_global/BackButton.tsx +4 -2
- package/templates/Projects/default/src/ui/_global/Button.tsx +3 -8
- package/templates/Projects/default/src/ui/_global/GlobalHeader.tsx +10 -28
- package/templates/Projects/default/src/ui/_global/GlobalMain.tsx +1 -1
- package/templates/Projects/default/src/ui/_global/LocaleSwitcher.tsx +9 -10
- package/templates/Projects/default/src/ui/_global/PublicNav.tsx +51 -17
- package/templates/Projects/default/src/ui/_global/ThemeToggle.tsx +45 -39
- package/templates/Projects/default/src/ui/_global/UserNav.tsx +6 -6
- package/templates/Projects/default/src/ui/_home/page-ui.tsx +5 -7
- package/templates/Projects/default/src/ui/{Dashboard → dashboard}/LogoutButton.tsx +9 -7
- package/templates/Projects/default/src/ui/{Dashboard → dashboard}/StatsCard.tsx +4 -4
- package/templates/Projects/default/src/ui/{Dashboard → dashboard}/page-ui.tsx +7 -8
- package/templates/Projects/default/src/ui/login/page-ui.tsx +36 -0
- package/templates/Projects/default/src/ui/register/page-ui.tsx +38 -0
- package/templates/Projects/default/src/ui/settings/page-ui.tsx +15 -0
- package/templates/Projects/default/src/ui/userInfo/page-ui.tsx +15 -0
- package/templates/Projects/default/tailwind.config.ts +81 -1
- package/templates/Projects/default/tests/consumer/validate-template.ts +66 -0
- package/templates/Projects/default/tests/e2e/template-remediation.playwright.ts +106 -0
- package/templates/Projects/default/tests/rendering/verify-rendering.ts +56 -0
- package/templates/Projects/default/tests/unit/csp.test.ts +19 -0
- package/templates/Projects/default/tests/unit/env.test.ts +76 -0
- package/templates/Projects/default/tsconfig.json +6 -6
- package/templates/Projects/default/example.env +0 -8
- package/templates/Projects/default/messages/getMergedMessages.ts +0 -31
- package/templates/Projects/default/middleware.ts +0 -11
- 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]/(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)/Settings/loading.tsx +0 -17
- package/templates/Projects/default/src/app/[locale]/(user)/UserInfo/loading.tsx +0 -17
- package/templates/Projects/default/src/app/api/auth/post-login/route.ts +0 -26
- package/templates/Projects/default/src/app/api/hello/route.ts +0 -5
- package/templates/Projects/default/src/app/layout.tsx +0 -11
- package/templates/Projects/default/src/app/page.tsx +0 -6
- package/templates/Projects/default/src/auth.config.ts +0 -0
- 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/sample/example.ts +0 -3
- package/templates/Projects/default/src/lib/sample/index.ts +0 -3
- 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/messages/en/{Dashboard.json → dashboard.json} +0 -0
- /package/templates/Projects/default/messages/en/{Login.json → login.json} +0 -0
- /package/templates/Projects/default/messages/en/{Register.json → register.json} +0 -0
- /package/templates/Projects/default/messages/en/{Settings.json → settings.json} +0 -0
- /package/templates/Projects/default/messages/en/{UserInfo.json → userInfo.json} +0 -0
- /package/templates/Projects/default/messages/fr/{Dashboard.json → dashboard.json} +0 -0
- /package/templates/Projects/default/messages/fr/{Login.json → login.json} +0 -0
- /package/templates/Projects/default/messages/fr/{Register.json → register.json} +0 -0
- /package/templates/Projects/default/messages/fr/{Settings.json → settings.json} +0 -0
- /package/templates/Projects/default/messages/fr/{UserInfo.json → userInfo.json} +0 -0
- /package/templates/Projects/default/public/{cnp-logo.png → logo.png} +0 -0
- /package/templates/Projects/default/src/ui/{Dashboard → dashboard}/WelcomeCard.tsx +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# dependencies
|
|
2
|
+
/node_modules
|
|
3
|
+
/.pnp
|
|
4
|
+
.pnp.*
|
|
5
|
+
.yarn/*
|
|
6
|
+
!.yarn/patches
|
|
7
|
+
!.yarn/plugins
|
|
8
|
+
!.yarn/releases
|
|
9
|
+
!.yarn/versions
|
|
10
|
+
|
|
11
|
+
# testing
|
|
12
|
+
/coverage
|
|
13
|
+
/artifacts
|
|
14
|
+
/playwright-report
|
|
15
|
+
/test-results
|
|
16
|
+
|
|
17
|
+
# next.js
|
|
18
|
+
/.next/
|
|
19
|
+
/out/
|
|
20
|
+
|
|
21
|
+
# production
|
|
22
|
+
/build
|
|
23
|
+
|
|
24
|
+
# misc
|
|
25
|
+
.DS_Store
|
|
26
|
+
*.pem
|
|
27
|
+
|
|
28
|
+
# debug
|
|
29
|
+
npm-debug.log*
|
|
30
|
+
yarn-debug.log*
|
|
31
|
+
yarn-error.log*
|
|
32
|
+
.pnpm-debug.log*
|
|
33
|
+
|
|
34
|
+
# env files
|
|
35
|
+
.env*
|
|
36
|
+
!.env.example
|
|
37
|
+
|
|
38
|
+
# vercel
|
|
39
|
+
.vercel
|
|
40
|
+
|
|
41
|
+
# typescript
|
|
42
|
+
*.tsbuildinfo
|
|
43
|
+
next-env.d.ts
|
|
44
|
+
|
|
45
|
+
# development
|
|
46
|
+
.cursor
|
|
47
|
+
.vscode
|
|
@@ -1,137 +1,81 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Create Next Pro Template
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Next.js App Router template for `create-next-pro-cli`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Runtime
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This template is Bun-first. Do not use npm, pnpm, or yarn for project scripts.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
npm run dev
|
|
11
|
-
# or
|
|
12
|
-
yarn dev
|
|
13
|
-
# or
|
|
14
|
-
pnpm dev
|
|
15
|
-
# or
|
|
16
|
-
bun dev
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
20
|
-
|
|
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:
|
|
9
|
+
Required:
|
|
40
10
|
|
|
41
11
|
```bash
|
|
42
|
-
|
|
12
|
+
bun --version
|
|
13
|
+
node --version
|
|
43
14
|
```
|
|
44
15
|
|
|
45
|
-
|
|
16
|
+
Node must satisfy `>=24.0.0`.
|
|
46
17
|
|
|
47
|
-
|
|
48
|
-
create-next-pro addpage ParentPage.ChildPage
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Add a component (global):
|
|
18
|
+
## Setup
|
|
52
19
|
|
|
53
20
|
```bash
|
|
54
|
-
|
|
21
|
+
bun install
|
|
22
|
+
cp .env.example .env
|
|
23
|
+
bun run dev
|
|
55
24
|
```
|
|
56
25
|
|
|
57
|
-
|
|
26
|
+
Open `http://localhost:3000`.
|
|
58
27
|
|
|
59
|
-
|
|
60
|
-
create-next-pro addcomponent MyComponent -P MyPage
|
|
61
|
-
```
|
|
28
|
+
## Environment
|
|
62
29
|
|
|
63
|
-
|
|
30
|
+
Auth.js v5 supports Google OAuth when credentials are configured. The public
|
|
31
|
+
application, checks and production build work without OAuth credentials.
|
|
64
32
|
|
|
65
|
-
|
|
66
|
-
create-next-pro addlib mylib
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Add an API route:
|
|
33
|
+
Optional Google OAuth values (set all three together):
|
|
70
34
|
|
|
71
35
|
```bash
|
|
72
|
-
|
|
36
|
+
AUTH_SECRET=
|
|
37
|
+
AUTH_GOOGLE_ID=
|
|
38
|
+
AUTH_GOOGLE_SECRET=
|
|
39
|
+
NEXT_PUBLIC_APP_URL=http://localhost:3000
|
|
40
|
+
AUTH_TRUST_HOST=false
|
|
41
|
+
AUTH_DISABLED=false
|
|
73
42
|
```
|
|
74
43
|
|
|
75
|
-
|
|
44
|
+
The template also accepts the legacy aliases `NEXTAUTH_SECRET`, `NEXTAUTH_URL`, `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, and `PROJECT_PRODUCTION_URL` to ease migration from older generated projects.
|
|
76
45
|
|
|
77
|
-
|
|
78
|
-
create-next-pro addlanguage fr
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Add translation text:
|
|
46
|
+
## Scripts
|
|
82
47
|
|
|
83
48
|
```bash
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
49
|
+
bun run dev
|
|
50
|
+
bun run lint
|
|
51
|
+
bun run typecheck
|
|
52
|
+
bun run build
|
|
53
|
+
bun run verify:rendering
|
|
54
|
+
bun test
|
|
55
|
+
bun run test:e2e
|
|
56
|
+
bun run test:consumer
|
|
57
|
+
bun run audit
|
|
58
|
+
bun run check
|
|
95
59
|
```
|
|
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.
|
|
119
|
-
|
|
120
|
-
## 📚 Learn More
|
|
121
|
-
|
|
122
|
-
To learn more about the technologies used:
|
|
123
|
-
|
|
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/)
|
|
128
60
|
|
|
129
|
-
##
|
|
61
|
+
## Template Features
|
|
130
62
|
|
|
131
|
-
|
|
63
|
+
- Next.js 16 App Router
|
|
64
|
+
- React 19
|
|
65
|
+
- Auth.js v5 through `next-auth@beta`
|
|
66
|
+
- Google OAuth provider
|
|
67
|
+
- Protected user routes
|
|
68
|
+
- `next-intl` locale routing for `en` and `fr`
|
|
69
|
+
- Tailwind CSS 4 theme tokens
|
|
70
|
+
- Playwright smoke captures for desktop and mobile
|
|
132
71
|
|
|
133
|
-
|
|
72
|
+
## Rendering and CSP
|
|
134
73
|
|
|
135
|
-
|
|
74
|
+
Public localized pages are prerendered for `en` and `fr`. Authenticated routes
|
|
75
|
+
and Auth.js handlers stay dynamic. `bun run verify:rendering` checks this boundary
|
|
76
|
+
after every production build.
|
|
136
77
|
|
|
137
|
-
|
|
78
|
+
The default Content Security Policy follows the stable static-rendering setup
|
|
79
|
+
documented by Next.js and allows the framework's inline bootstrap scripts. Projects
|
|
80
|
+
with stricter compliance requirements can adopt a per-request nonce, with the
|
|
81
|
+
tradeoff that nonce-protected pages become dynamically rendered.
|