create-next-pro-cli 0.1.25 → 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/dist/create-next-pro +35 -6
- 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 +66 -21
- 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/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,24 @@
|
|
|
1
|
+
name: Quality
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [master]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
validate:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: oven-sh/setup-bun@v2
|
|
14
|
+
with:
|
|
15
|
+
bun-version: 1.3.14
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: 24
|
|
19
|
+
- run: bun install --frozen-lockfile
|
|
20
|
+
- run: bun run check
|
|
21
|
+
- run: bun run audit
|
|
22
|
+
- run: bun run test:consumer
|
|
23
|
+
- run: bunx playwright install --with-deps chromium
|
|
24
|
+
- run: bun run test:e2e
|
|
@@ -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,36 +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
|
+
|
|
7
|
+
This template is Bun-first. Do not use npm, pnpm, or yarn for project scripts.
|
|
8
|
+
|
|
9
|
+
Required:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun --version
|
|
13
|
+
node --version
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Node must satisfy `>=24.0.0`.
|
|
17
|
+
|
|
18
|
+
## Setup
|
|
6
19
|
|
|
7
20
|
```bash
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# or
|
|
12
|
-
pnpm dev
|
|
13
|
-
# or
|
|
14
|
-
bun dev
|
|
21
|
+
bun install
|
|
22
|
+
cp .env.example .env
|
|
23
|
+
bun run dev
|
|
15
24
|
```
|
|
16
25
|
|
|
17
|
-
Open
|
|
26
|
+
Open `http://localhost:3000`.
|
|
18
27
|
|
|
19
|
-
|
|
28
|
+
## Environment
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
Auth.js v5 supports Google OAuth when credentials are configured. The public
|
|
31
|
+
application, checks and production build work without OAuth credentials.
|
|
22
32
|
|
|
23
|
-
|
|
33
|
+
Optional Google OAuth values (set all three together):
|
|
24
34
|
|
|
25
|
-
|
|
35
|
+
```bash
|
|
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
|
|
42
|
+
```
|
|
43
|
+
|
|
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.
|
|
45
|
+
|
|
46
|
+
## Scripts
|
|
47
|
+
|
|
48
|
+
```bash
|
|
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
|
|
59
|
+
```
|
|
26
60
|
|
|
27
|
-
|
|
28
|
-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
61
|
+
## Template Features
|
|
29
62
|
|
|
30
|
-
|
|
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
|
|
31
71
|
|
|
32
|
-
##
|
|
72
|
+
## Rendering and CSP
|
|
33
73
|
|
|
34
|
-
|
|
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.
|
|
35
77
|
|
|
36
|
-
|
|
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.
|