create-next-pro-cli 0.1.28 → 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.
Files changed (50) hide show
  1. package/README.md +17 -3
  2. package/dist/bin.bun.js +16 -2
  3. package/dist/bin.node.js +16 -2
  4. package/dist/bin.node.js.map +1 -1
  5. package/package.json +1 -1
  6. package/templates/Projects/default/.env.example +8 -6
  7. package/templates/Projects/default/.github/workflows/quality.yml +40 -9
  8. package/templates/Projects/default/.gitignore.template +33 -15
  9. package/templates/Projects/default/README.md +38 -9
  10. package/templates/Projects/default/bun.lock +120 -134
  11. package/templates/Projects/default/messages/en/_home.json +9 -2
  12. package/templates/Projects/default/messages/en/settings.json +9 -1
  13. package/templates/Projects/default/messages/en/userInfo.json +6 -1
  14. package/templates/Projects/default/messages/fr/_home.json +9 -2
  15. package/templates/Projects/default/messages/fr/settings.json +9 -1
  16. package/templates/Projects/default/messages/fr/userInfo.json +6 -1
  17. package/templates/Projects/default/next.config.ts +11 -0
  18. package/templates/Projects/default/package.json +7 -1
  19. package/templates/Projects/default/playwright.config.ts +29 -6
  20. package/templates/Projects/default/pnpm-workspace.yaml +2 -0
  21. package/templates/Projects/default/scripts/audit.ts +4 -0
  22. package/templates/Projects/default/scripts/package-manager.ts +68 -0
  23. package/templates/Projects/default/src/app/[locale]/(public)/_home/page.tsx +2 -2
  24. package/templates/Projects/default/src/app/[locale]/(public)/layout.tsx +1 -2
  25. package/templates/Projects/default/src/app/[locale]/(public)/login/page.tsx +6 -1
  26. package/templates/Projects/default/src/app/[locale]/(public)/register/page.tsx +6 -1
  27. package/templates/Projects/default/src/app/[locale]/(user)/userInfo/page.tsx +5 -2
  28. package/templates/Projects/default/src/app/[locale]/page.tsx +1 -4
  29. package/templates/Projects/default/src/lib/github/repository.ts +68 -0
  30. package/templates/Projects/default/src/ui/_global/GlobalMain.tsx +10 -5
  31. package/templates/Projects/default/src/ui/_global/ThemeToggle.tsx +18 -8
  32. package/templates/Projects/default/src/ui/_global/UserNav.tsx +5 -1
  33. package/templates/Projects/default/src/ui/_home/GitHubActions.tsx +57 -0
  34. package/templates/Projects/default/src/ui/_home/page-shell.tsx +16 -0
  35. package/templates/Projects/default/src/ui/_home/page-ui.tsx +24 -13
  36. package/templates/Projects/default/src/ui/dashboard/LogoutButton.tsx +1 -1
  37. package/templates/Projects/default/src/ui/dashboard/StatsCard.tsx +2 -2
  38. package/templates/Projects/default/src/ui/dashboard/WelcomeCard.tsx +4 -2
  39. package/templates/Projects/default/src/ui/dashboard/page-ui.tsx +0 -2
  40. package/templates/Projects/default/src/ui/settings/page-ui.tsx +45 -6
  41. package/templates/Projects/default/src/ui/userInfo/page-ui.tsx +54 -7
  42. package/templates/Projects/default/tests/consumer/validate-template.ts +57 -48
  43. package/templates/Projects/default/tests/e2e/template-remediation.playwright.ts +47 -4
  44. package/templates/Projects/default/tests/unit/csp.test.ts +1 -1
  45. package/templates/Projects/default/tests/unit/github-repository.test.ts +45 -0
  46. package/templates/Projects/default/tests/unit/package-manager.test.ts +51 -0
  47. package/templates/Projects/default/tests/unit/template-baseline.test.ts +52 -0
  48. package/templates/Projects/default/tests/unit/user-nav.test.tsx +52 -0
  49. package/templates/Projects/default/tsconfig.json +2 -1
  50. package/templates/Projects/default/vitest.config.ts +10 -0
package/README.md CHANGED
@@ -130,6 +130,9 @@ The Next.js route and its interface are separate: `src/app` owns routing while `
130
130
  ```text
131
131
  my-app/
132
132
  ├── .env.example
133
+ ├── .gitignore
134
+ ├── .prettierignore
135
+ ├── bun.lock
133
136
  ├── cnp.config.json
134
137
  ├── messages/
135
138
  │ ├── en/
@@ -183,11 +186,15 @@ my-app/
183
186
  │ ├── e2e/
184
187
  │ ├── rendering/
185
188
  │ └── unit/
189
+ ├── scripts/
190
+ │ ├── audit.ts
191
+ │ └── package-manager.ts
186
192
  ├── next.config.ts
187
193
  ├── package.json
188
194
  ├── playwright.config.ts
189
195
  ├── pnpm-workspace.yaml
190
- └── tsconfig.json
196
+ ├── tsconfig.json
197
+ └── vitest.config.ts
191
198
  ```
192
199
 
193
200
  Template working files (`.env`, the nested Git repository, caches, screenshots, and test results) are not copied into generated projects. The CLI creates `cnp.config.json` with the project name and selected alias.
@@ -322,13 +329,13 @@ Interactive input is never attempted in JSON mode. Pass every required argument
322
329
 
323
330
  ## Environment and security
324
331
 
325
- Generated projects contain `.env.example`, never the template's local `.env`. Copy it before configuring Auth.js:
332
+ Generated projects contain only the canonical `.env.example`, never the template's local `.env` or other environment copies. Copy it before configuring Auth.js:
326
333
 
327
334
  ```bash
328
335
  cp .env.example .env.local
329
336
  ```
330
337
 
331
- OAuth credentials, nested Git repositories, caches, installed dependencies, Playwright artifacts, and agent context are excluded from generated projects and the npm package. For deployments without authentication, use `AUTH_DISABLED=true`.
338
+ The Google and Auth.js values shipped in `.env.example` are intentionally public, limited development credentials. Replace all of them before production use. Nested Git repositories, caches, installed dependencies, Playwright artifacts, agent context, the local `.env`, and every non-canonical `.env*` file are excluded from generated projects and the npm package. For checks without authentication, use `AUTH_DISABLED=true`.
332
339
 
333
340
  ## Quality
334
341
 
@@ -349,6 +356,13 @@ pnpm run check
349
356
 
350
357
  Validation covers formatting, linting, TypeScript, Vitest, the Next.js build, and the rendering contract. Use `npm pack --dry-run --json` to inspect the CLI's distributable contents.
351
358
 
359
+ The template source keeps one official `bun.lock`. npm and pnpm create their
360
+ manager-specific lockfiles only in consumer worktrees; `.prettierignore` keeps
361
+ those generated locks outside formatting checks. The generated GitHub Actions
362
+ workflow validates all three managers independently and runs its npm job without
363
+ Bun installed. Explicit npm `allowScripts` and pnpm `allowBuilds` policies limit
364
+ native install scripts to the four dependencies required by the toolchain.
365
+
352
366
  ## Development
353
367
 
354
368
  ```bash
package/dist/bin.bun.js CHANGED
@@ -6849,6 +6849,7 @@ import path8 from "path";
6849
6849
  var TEMPLATE_DENY_NAMES = new Set([
6850
6850
  ".env",
6851
6851
  ".git",
6852
+ ".gitignore",
6852
6853
  ".agent",
6853
6854
  ".cursor",
6854
6855
  ".next",
@@ -6860,7 +6861,7 @@ var TEMPLATE_DENY_NAMES = new Set([
6860
6861
  ]);
6861
6862
  function isDistributableTemplatePath(relativePath) {
6862
6863
  const segments = relativePath.split(path8.sep);
6863
- return !segments.some((segment) => TEMPLATE_DENY_NAMES.has(segment) || segment.endsWith(".tsbuildinfo") || segment === ".DS_Store");
6864
+ return !segments.some((segment) => TEMPLATE_DENY_NAMES.has(segment) || segment.startsWith(".env") && segment !== ".env.example" || segment.endsWith(".tsbuildinfo") || segment === ".DS_Store");
6864
6865
  }
6865
6866
  async function templateManifest(root, fs) {
6866
6867
  const files = [];
@@ -6891,7 +6892,20 @@ async function templateManifest(root, fs) {
6891
6892
  }
6892
6893
  async function validateScaffoldTemplate(root, fs) {
6893
6894
  const manifest = await templateManifest(root, fs);
6894
- for (const required of ["package.json", "tsconfig.json"]) {
6895
+ for (const required of [
6896
+ "package.json",
6897
+ "tsconfig.json",
6898
+ ".env.example",
6899
+ ".gitignore.template",
6900
+ ".prettierignore",
6901
+ "bun.lock",
6902
+ "pnpm-workspace.yaml",
6903
+ "vitest.config.ts",
6904
+ path8.join("scripts", "audit.ts"),
6905
+ path8.join("scripts", "package-manager.ts"),
6906
+ path8.join("tests", "consumer", "validate-template.ts"),
6907
+ path8.join(".github", "workflows", "quality.yml")
6908
+ ]) {
6895
6909
  if (!manifest.includes(required)) {
6896
6910
  throw new CliError(`Required template file was not found: ${required}.`, {
6897
6911
  code: "TEMPLATE_MISSING",
package/dist/bin.node.js CHANGED
@@ -2070,6 +2070,7 @@ import path8 from "path";
2070
2070
  var TEMPLATE_DENY_NAMES = /* @__PURE__ */ new Set([
2071
2071
  ".env",
2072
2072
  ".git",
2073
+ ".gitignore",
2073
2074
  ".agent",
2074
2075
  ".cursor",
2075
2076
  ".next",
@@ -2082,7 +2083,7 @@ var TEMPLATE_DENY_NAMES = /* @__PURE__ */ new Set([
2082
2083
  function isDistributableTemplatePath(relativePath) {
2083
2084
  const segments = relativePath.split(path8.sep);
2084
2085
  return !segments.some(
2085
- (segment) => TEMPLATE_DENY_NAMES.has(segment) || segment.endsWith(".tsbuildinfo") || segment === ".DS_Store"
2086
+ (segment) => TEMPLATE_DENY_NAMES.has(segment) || segment.startsWith(".env") && segment !== ".env.example" || segment.endsWith(".tsbuildinfo") || segment === ".DS_Store"
2086
2087
  );
2087
2088
  }
2088
2089
  async function templateManifest(root, fs) {
@@ -2114,7 +2115,20 @@ async function templateManifest(root, fs) {
2114
2115
  }
2115
2116
  async function validateScaffoldTemplate(root, fs) {
2116
2117
  const manifest = await templateManifest(root, fs);
2117
- for (const required of ["package.json", "tsconfig.json"]) {
2118
+ for (const required of [
2119
+ "package.json",
2120
+ "tsconfig.json",
2121
+ ".env.example",
2122
+ ".gitignore.template",
2123
+ ".prettierignore",
2124
+ "bun.lock",
2125
+ "pnpm-workspace.yaml",
2126
+ "vitest.config.ts",
2127
+ path8.join("scripts", "audit.ts"),
2128
+ path8.join("scripts", "package-manager.ts"),
2129
+ path8.join("tests", "consumer", "validate-template.ts"),
2130
+ path8.join(".github", "workflows", "quality.yml")
2131
+ ]) {
2118
2132
  if (!manifest.includes(required)) {
2119
2133
  throw new CliError(`Required template file was not found: ${required}.`, {
2120
2134
  code: "TEMPLATE_MISSING",