create-next-pro-cli 0.1.27 → 0.1.29
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 +97 -6
- package/dist/bin.bun.js +1933 -947
- package/dist/bin.node.js +2079 -998
- package/dist/bin.node.js.map +1 -1
- package/package.json +3 -2
- package/templates/Projects/default/.env.example +8 -6
- package/templates/Projects/default/.github/workflows/quality.yml +40 -9
- package/templates/Projects/default/.gitignore.template +33 -15
- package/templates/Projects/default/README.md +38 -9
- package/templates/Projects/default/bun.lock +120 -134
- package/templates/Projects/default/messages/en/_home.json +9 -2
- package/templates/Projects/default/messages/en/settings.json +9 -1
- package/templates/Projects/default/messages/en/userInfo.json +6 -1
- package/templates/Projects/default/messages/fr/_home.json +9 -2
- package/templates/Projects/default/messages/fr/settings.json +9 -1
- package/templates/Projects/default/messages/fr/userInfo.json +6 -1
- package/templates/Projects/default/next.config.ts +11 -0
- package/templates/Projects/default/package.json +7 -1
- package/templates/Projects/default/playwright.config.ts +29 -6
- package/templates/Projects/default/pnpm-workspace.yaml +2 -0
- package/templates/Projects/default/scripts/audit.ts +4 -0
- package/templates/Projects/default/scripts/package-manager.ts +68 -0
- package/templates/Projects/default/src/app/[locale]/(public)/_home/page.tsx +2 -2
- package/templates/Projects/default/src/app/[locale]/(public)/layout.tsx +1 -2
- package/templates/Projects/default/src/app/[locale]/(public)/login/page.tsx +6 -1
- package/templates/Projects/default/src/app/[locale]/(public)/register/page.tsx +6 -1
- package/templates/Projects/default/src/app/[locale]/(user)/userInfo/page.tsx +5 -2
- package/templates/Projects/default/src/app/[locale]/page.tsx +1 -4
- package/templates/Projects/default/src/lib/github/repository.ts +68 -0
- package/templates/Projects/default/src/ui/_global/GlobalMain.tsx +10 -5
- package/templates/Projects/default/src/ui/_global/ThemeToggle.tsx +18 -8
- package/templates/Projects/default/src/ui/_global/UserNav.tsx +5 -1
- package/templates/Projects/default/src/ui/_home/GitHubActions.tsx +57 -0
- package/templates/Projects/default/src/ui/_home/page-shell.tsx +16 -0
- package/templates/Projects/default/src/ui/_home/page-ui.tsx +24 -13
- package/templates/Projects/default/src/ui/dashboard/LogoutButton.tsx +1 -1
- package/templates/Projects/default/src/ui/dashboard/StatsCard.tsx +2 -2
- package/templates/Projects/default/src/ui/dashboard/WelcomeCard.tsx +4 -2
- package/templates/Projects/default/src/ui/dashboard/page-ui.tsx +0 -2
- package/templates/Projects/default/src/ui/settings/page-ui.tsx +45 -6
- package/templates/Projects/default/src/ui/userInfo/page-ui.tsx +54 -7
- package/templates/Projects/default/tests/consumer/validate-template.ts +57 -48
- package/templates/Projects/default/tests/e2e/template-remediation.playwright.ts +47 -4
- package/templates/Projects/default/tests/unit/csp.test.ts +1 -1
- package/templates/Projects/default/tests/unit/github-repository.test.ts +45 -0
- package/templates/Projects/default/tests/unit/package-manager.test.ts +51 -0
- package/templates/Projects/default/tests/unit/template-baseline.test.ts +52 -0
- package/templates/Projects/default/tests/unit/user-nav.test.tsx +52 -0
- package/templates/Projects/default/tsconfig.json +2 -1
- package/templates/Projects/default/vitest.config.ts +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-next-pro-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.29",
|
|
4
4
|
"description": "Advanced Next.js project scaffolder with i18n, Tailwind, App Router and more.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,12 +38,13 @@
|
|
|
38
38
|
"format:check": "prettier --check --ignore-unknown .github/workflows/ci.yml .husky scripts bunfig.toml bin.bun.ts bin.node.ts src tsup.config.ts eslint.config.mjs package.json tsconfig.base.json tsconfig.json tsconfig.node.json",
|
|
39
39
|
"lint": "eslint bin.bun.ts bin.node.ts scripts src tsup.config.ts",
|
|
40
40
|
"typecheck": "tsc --project tsconfig.json --noEmit",
|
|
41
|
+
"language:check": "bun scripts/check-public-language.ts",
|
|
41
42
|
"test": "bun test",
|
|
42
43
|
"clean": "rm -rf dist",
|
|
43
44
|
"build": "bun run clean && bun run build:node && bun run build:bun && cp scripts/create-next-pro dist/create-next-pro && chmod +x dist/create-next-pro",
|
|
44
45
|
"build:node": "tsup",
|
|
45
46
|
"build:bun": "bun build bin.bun.ts --outdir dist --target=bun",
|
|
46
|
-
"check": "bun run format:check && bun run lint && bun run typecheck && bun test && bun run build",
|
|
47
|
+
"check": "bun run format:check && bun run lint && bun run typecheck && bun run language:check && bun test && bun run build",
|
|
47
48
|
"prepublishOnly": "bun run check",
|
|
48
49
|
"commitlint:range": "commitlint",
|
|
49
50
|
"release:check": "bun scripts/release.ts check",
|
|
@@ -3,15 +3,17 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000
|
|
|
3
3
|
|
|
4
4
|
# Auth.js v5
|
|
5
5
|
AUTH_URL=http://localhost:3000
|
|
6
|
-
AUTH_SECRET=
|
|
7
|
-
AUTH_GOOGLE_ID=
|
|
8
|
-
AUTH_GOOGLE_SECRET=
|
|
9
|
-
AUTH_TRUST_HOST=
|
|
6
|
+
AUTH_SECRET=5gIEEQCHbA73SpylgkvVBX72k1x3wEOsvXKIos6ajXw= #Generate a random secret with: openssl rand -base64 32
|
|
7
|
+
# AUTH_GOOGLE_ID=
|
|
8
|
+
# AUTH_GOOGLE_SECRET=
|
|
9
|
+
AUTH_TRUST_HOST=true # This is necessary for the local development.
|
|
10
10
|
AUTH_DISABLED=false
|
|
11
11
|
|
|
12
12
|
# Legacy aliases are still accepted by the template code:
|
|
13
13
|
# PROJECT_PRODUCTION_URL=
|
|
14
14
|
# NEXTAUTH_URL=
|
|
15
15
|
# NEXTAUTH_SECRET=
|
|
16
|
-
|
|
17
|
-
#
|
|
16
|
+
|
|
17
|
+
# This credentials are public published from Rising Corporation for the Google OAuth2.0 authentication local development.
|
|
18
|
+
GOOGLE_CLIENT_ID=603158603730-f5rnolm4vnmgocb68msogofd9ujf61t9.apps.googleusercontent.com
|
|
19
|
+
GOOGLE_CLIENT_SECRET=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
|
|
@@ -8,17 +8,48 @@ on:
|
|
|
8
8
|
jobs:
|
|
9
9
|
validate:
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
|
+
timeout-minutes: 30
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
manager: [bun, npm, pnpm]
|
|
11
16
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
17
|
+
- uses: actions/checkout@v6
|
|
18
|
+
- uses: actions/setup-node@v6
|
|
19
|
+
with:
|
|
20
|
+
node-version: 24
|
|
13
21
|
- uses: oven-sh/setup-bun@v2
|
|
22
|
+
if: matrix.manager == 'bun'
|
|
14
23
|
with:
|
|
15
24
|
bun-version: 1.3.14
|
|
16
|
-
- uses:
|
|
25
|
+
- uses: pnpm/action-setup@v4
|
|
26
|
+
if: matrix.manager == 'pnpm'
|
|
17
27
|
with:
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
version: 11
|
|
29
|
+
- name: Verify runtime isolation
|
|
30
|
+
if: matrix.manager != 'bun'
|
|
31
|
+
run: test -z "$(command -v bun || true)"
|
|
32
|
+
- name: Prepare package-manager-neutral checkout
|
|
33
|
+
if: matrix.manager != 'bun'
|
|
34
|
+
run: npm pkg delete packageManager
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: |
|
|
37
|
+
if [ "${{ matrix.manager }}" = bun ]; then
|
|
38
|
+
bun install --frozen-lockfile
|
|
39
|
+
elif [ "${{ matrix.manager }}" = npm ]; then
|
|
40
|
+
npm install
|
|
41
|
+
else
|
|
42
|
+
pnpm install --no-frozen-lockfile
|
|
43
|
+
fi
|
|
44
|
+
- run: ${{ matrix.manager }} run check
|
|
45
|
+
- run: ${{ matrix.manager }} run audit
|
|
46
|
+
- name: Validate an isolated consumer
|
|
47
|
+
env:
|
|
48
|
+
CNP_PACKAGE_MANAGER: ${{ matrix.manager }}
|
|
49
|
+
run: ${{ matrix.manager }} run test:consumer
|
|
50
|
+
- name: Install Chromium
|
|
51
|
+
if: matrix.manager == 'npm'
|
|
52
|
+
run: npx playwright install --with-deps chromium
|
|
53
|
+
- name: Run visual integration tests without Bun
|
|
54
|
+
if: matrix.manager == 'npm'
|
|
55
|
+
run: npm run test:e2e
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# dependencies and package-manager caches
|
|
4
|
+
/node_modules/
|
|
3
5
|
/.pnp
|
|
4
6
|
.pnp.*
|
|
5
7
|
.yarn/*
|
|
@@ -7,41 +9,57 @@
|
|
|
7
9
|
!.yarn/plugins
|
|
8
10
|
!.yarn/releases
|
|
9
11
|
!.yarn/versions
|
|
12
|
+
/.bun/
|
|
10
13
|
|
|
11
14
|
# testing
|
|
12
|
-
/coverage
|
|
13
|
-
/artifacts
|
|
14
|
-
/playwright-report
|
|
15
|
-
/test-results
|
|
15
|
+
/coverage/
|
|
16
|
+
/artifacts/
|
|
17
|
+
/playwright-report/
|
|
18
|
+
/test-results/
|
|
16
19
|
|
|
17
20
|
# next.js
|
|
18
21
|
/.next/
|
|
19
22
|
/out/
|
|
20
23
|
|
|
21
|
-
# production
|
|
22
|
-
/build
|
|
24
|
+
# production and tool caches
|
|
25
|
+
/build/
|
|
26
|
+
/dist/
|
|
27
|
+
/.cache/
|
|
28
|
+
/.turbo/
|
|
29
|
+
.eslintcache
|
|
30
|
+
.stylelintcache
|
|
23
31
|
|
|
24
|
-
#
|
|
32
|
+
# operating system and editor files
|
|
25
33
|
.DS_Store
|
|
34
|
+
Thumbs.db
|
|
35
|
+
*.swp
|
|
36
|
+
*.swo
|
|
37
|
+
*~
|
|
26
38
|
*.pem
|
|
27
39
|
|
|
28
40
|
# debug
|
|
41
|
+
*.log
|
|
29
42
|
npm-debug.log*
|
|
30
43
|
yarn-debug.log*
|
|
31
44
|
yarn-error.log*
|
|
32
45
|
.pnpm-debug.log*
|
|
46
|
+
bun-debug.log*
|
|
33
47
|
|
|
34
|
-
# env files
|
|
48
|
+
# env files (can opt-in for committing if needed)
|
|
35
49
|
.env*
|
|
36
50
|
!.env.example
|
|
37
51
|
|
|
38
|
-
#
|
|
39
|
-
|
|
52
|
+
# deployment metadata
|
|
53
|
+
/.vercel/
|
|
54
|
+
/.netlify/
|
|
55
|
+
/.wrangler/
|
|
40
56
|
|
|
41
57
|
# typescript
|
|
42
58
|
*.tsbuildinfo
|
|
43
59
|
next-env.d.ts
|
|
44
60
|
|
|
45
|
-
# development
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
# local development metadata
|
|
62
|
+
/.cursor/
|
|
63
|
+
/.vscode/
|
|
64
|
+
/.idea/
|
|
65
|
+
/.agent/
|
|
@@ -4,16 +4,25 @@ Next.js App Router template for `create-next-pro-cli`.
|
|
|
4
4
|
|
|
5
5
|
## Runtime
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Choose Bun, npm, or pnpm for dependency installation and project scripts. The
|
|
8
|
+
repository keeps `bun.lock` as its reproducible source lockfile, while npm and
|
|
9
|
+
pnpm consumers create their own lockfiles in their working copies.
|
|
8
10
|
|
|
9
11
|
Required:
|
|
10
12
|
|
|
11
13
|
```bash
|
|
12
|
-
bun --version
|
|
13
14
|
node --version
|
|
15
|
+
bun --version # optional
|
|
16
|
+
npm --version # optional
|
|
17
|
+
pnpm --version # optional
|
|
14
18
|
```
|
|
15
19
|
|
|
16
|
-
Node must satisfy `>=24.0.0`.
|
|
20
|
+
Node must satisfy `>=24.0.0`. Bun must satisfy `>=1.3.14` when selected, and
|
|
21
|
+
pnpm 11 or later is supported.
|
|
22
|
+
|
|
23
|
+
The npm `allowScripts` policy and pnpm `allowBuilds` policy approve only the
|
|
24
|
+
native build steps required by Next.js and the file-watcher toolchain. Security
|
|
25
|
+
overrides are declared for both npm-compatible and pnpm dependency graphs.
|
|
17
26
|
|
|
18
27
|
## Setup
|
|
19
28
|
|
|
@@ -21,16 +30,29 @@ Node must satisfy `>=24.0.0`.
|
|
|
21
30
|
bun install
|
|
22
31
|
cp .env.example .env
|
|
23
32
|
bun run dev
|
|
33
|
+
|
|
34
|
+
# or
|
|
35
|
+
npm install
|
|
36
|
+
cp .env.example .env
|
|
37
|
+
npm run dev
|
|
38
|
+
|
|
39
|
+
# or
|
|
40
|
+
pnpm install
|
|
41
|
+
cp .env.example .env
|
|
42
|
+
pnpm run dev
|
|
24
43
|
```
|
|
25
44
|
|
|
26
45
|
Open `http://localhost:3000`.
|
|
27
46
|
|
|
28
47
|
## Environment
|
|
29
48
|
|
|
30
|
-
Auth.js v5 supports Google OAuth
|
|
31
|
-
|
|
49
|
+
Auth.js v5 supports Google OAuth. The canonical `.env.example` intentionally
|
|
50
|
+
contains public, limited development credentials so a generated project can be
|
|
51
|
+
tested immediately. Treat every value in that file as public and replace all
|
|
52
|
+
authentication credentials before production use.
|
|
32
53
|
|
|
33
|
-
|
|
54
|
+
Auth.js requires the application secret, Google client ID, and Google client
|
|
55
|
+
secret to be set together:
|
|
34
56
|
|
|
35
57
|
```bash
|
|
36
58
|
AUTH_SECRET=
|
|
@@ -41,7 +63,10 @@ AUTH_TRUST_HOST=false
|
|
|
41
63
|
AUTH_DISABLED=false
|
|
42
64
|
```
|
|
43
65
|
|
|
44
|
-
The template also accepts the legacy aliases `NEXTAUTH_SECRET`, `NEXTAUTH_URL`,
|
|
66
|
+
The template also accepts the legacy aliases `NEXTAUTH_SECRET`, `NEXTAUTH_URL`,
|
|
67
|
+
`GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, and `PROJECT_PRODUCTION_URL` to ease
|
|
68
|
+
migration from older generated projects. Set `AUTH_DISABLED=true` when a check
|
|
69
|
+
must run without initializing the Google provider.
|
|
45
70
|
|
|
46
71
|
## Scripts
|
|
47
72
|
|
|
@@ -58,6 +83,10 @@ bun run audit
|
|
|
58
83
|
bun run check
|
|
59
84
|
```
|
|
60
85
|
|
|
86
|
+
Replace `bun run` with `npm run` or `pnpm run` for the selected manager. The
|
|
87
|
+
`audit` and `test:consumer` scripts detect the invoking manager without shell
|
|
88
|
+
commands, including on Windows.
|
|
89
|
+
|
|
61
90
|
## Template Features
|
|
62
91
|
|
|
63
92
|
- Next.js 16 App Router
|
|
@@ -72,8 +101,8 @@ bun run check
|
|
|
72
101
|
## Rendering and CSP
|
|
73
102
|
|
|
74
103
|
Public localized pages are prerendered for `en` and `fr`. Authenticated routes
|
|
75
|
-
and Auth.js handlers stay dynamic. `
|
|
76
|
-
|
|
104
|
+
and Auth.js handlers stay dynamic. `verify:rendering` checks this boundary after
|
|
105
|
+
every production build, regardless of the selected package manager.
|
|
77
106
|
|
|
78
107
|
The default Content Security Policy follows the stable static-rendering setup
|
|
79
108
|
documented by Next.js and allows the framework's inline bootstrap scripts. Projects
|