create-next-pro-cli 0.1.31 → 0.1.32
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 +8 -6
- package/create-next-pro-completion.sh +4 -3
- package/create-next-pro-completion.zsh +3 -3
- package/dist/bin.bun.js +495 -118
- package/dist/bin.node.js +558 -135
- package/dist/bin.node.js.map +1 -1
- package/package.json +6 -5
- package/templates/Page/page-ui.tsx +2 -2
- package/templates/Page/page-ui.user.tsx +17 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-addcomponent/SKILL.md +7 -7
- package/templates/Projects/default/.agents/skills/create-next-pro-addpage/SKILL.md +14 -9
- package/templates/Projects/default/.agents/skills/create-next-pro-rmpage/SKILL.md +7 -6
- package/templates/Projects/default/.github/workflows/quality.yml +2 -1
- package/templates/Projects/default/AGENTS.md +12 -4
- package/templates/Projects/default/README.md +6 -0
- package/templates/Projects/default/bun.lock +114 -106
- package/templates/Projects/default/package.json +7 -5
- package/templates/Projects/default/pnpm-workspace.yaml +2 -1
- package/templates/Projects/default/scripts/audit-policy.ts +376 -0
- package/templates/Projects/default/scripts/audit.ts +72 -3
- package/templates/Projects/default/scripts/package-manager.ts +37 -0
- package/templates/Projects/default/tests/unit/audit-policy.test.ts +152 -0
package/README.md
CHANGED
|
@@ -95,12 +95,12 @@ Run the following commands from the root of a generated project.
|
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
97
|
# Simple or nested pages
|
|
98
|
-
create-next-pro addpage profile
|
|
99
|
-
create-next-pro addpage account.security
|
|
98
|
+
create-next-pro addpage profile --area public
|
|
99
|
+
create-next-pro addpage account.security --area user
|
|
100
100
|
|
|
101
101
|
# Global components or components attached to a page
|
|
102
102
|
create-next-pro addcomponent Alert
|
|
103
|
-
create-next-pro addcomponent PasswordForm --page account.security
|
|
103
|
+
create-next-pro addcomponent PasswordForm --page account.security --area user
|
|
104
104
|
|
|
105
105
|
# Libraries and modules
|
|
106
106
|
create-next-pro addlib analytics
|
|
@@ -114,17 +114,19 @@ create-next-pro addlanguage de
|
|
|
114
114
|
create-next-pro addtext dashboard.welcome "Welcome"
|
|
115
115
|
|
|
116
116
|
# Direct removal
|
|
117
|
-
create-next-pro rmpage account.security
|
|
117
|
+
create-next-pro rmpage account.security --area user
|
|
118
118
|
|
|
119
119
|
# Tree-based autocomplete menu with confirmation
|
|
120
120
|
create-next-pro rmpage
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
+
Every page belongs to an explicit route area. Use `--area public` for routes rendered by the public layout and `--area user` for authenticated routes rendered by the user layout. There is no default area. Direct `addpage` and `rmpage` commands require it, as does `addcomponent --page`; interactive `addpage` asks for it and the `rmpage` menu groups pages by area. Route groups do not alter the public URL.
|
|
124
|
+
|
|
123
125
|
`addlanguage` copies every message file from the configured default locale. The command reports each copied path and emits a required `translate` next step: the copied source-language text must be translated before the locale is ready to ship.
|
|
124
126
|
|
|
125
127
|
`addpage` creates `layout`, `page`, and `loading` files by default. Available long options are `--layout`, `--page`, `--loading`, `--not-found`, `--error`, `--global-error`, `--route`, `--template`, and `--default`. The historical short forms remain available.
|
|
126
128
|
|
|
127
|
-
`rmpage` only lists routes that contain an actual `page.tsx
|
|
129
|
+
`rmpage` only lists routes that contain an actual `page.tsx` in the `(public)` or `(user)` route group. Technical directories remain hidden. Removal is confined to the selected area and project, and it preserves shared parent directories and unrelated files.
|
|
128
130
|
|
|
129
131
|
## Generated project architecture
|
|
130
132
|
|
|
@@ -334,7 +336,7 @@ The versioned document has stable status, event, next-step, and error fields:
|
|
|
334
336
|
|
|
335
337
|
Paths inside events and next steps are relative to their named scope. Applicable absolute roots are exposed as `projectRoot`, `configRoot`, and `homeRoot`. Events never contain file contents, environment values, credentials, or secrets.
|
|
336
338
|
|
|
337
|
-
Command statuses are `success`, `unchanged`, `cancelled`, and `failed`. Successful mutations, idempotent no-op results, and user cancellations exit with code `0`; only `failed` exits with code `1`. Stable error codes include `INVALID_ARGUMENT`, `CONFIG_NOT_FOUND`, `I18N_DISABLED`, `TARGET_EXISTS`, `TARGET_NOT_FOUND`, `TEMPLATE_MISSING`, `UNSAFE_PATH`, `INCONSISTENT_LOCALE`, `FILESYSTEM_ERROR`, `INTERACTIVE_INPUT_REQUIRED`, and `ONBOARDING_REQUIRED`.
|
|
339
|
+
Command statuses are `success`, `unchanged`, `cancelled`, and `failed`. Successful mutations, idempotent no-op results, and user cancellations exit with code `0`; only `failed` exits with code `1`. Stable error codes include `INVALID_ARGUMENT`, `CONFIG_NOT_FOUND`, `I18N_DISABLED`, `TARGET_EXISTS`, `TARGET_NOT_FOUND`, `TEMPLATE_MISSING`, `UNSAFE_PATH`, `INCONSISTENT_ROUTE`, `INCONSISTENT_LOCALE`, `FILESYSTEM_ERROR`, `INTERACTIVE_INPUT_REQUIRED`, and `ONBOARDING_REQUIRED`.
|
|
338
340
|
|
|
339
341
|
Interactive input is never attempted in JSON mode. Pass every required argument explicitly. On a new machine, run the CLI once without `--json` to complete onboarding; `--reconfigure --json` is intentionally rejected.
|
|
340
342
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# Bash completion for create-next-pro.
|
|
2
2
|
_create_next_pro_complete() {
|
|
3
|
-
local cur
|
|
3
|
+
local cur candidates
|
|
4
|
+
local -a prior
|
|
4
5
|
COMPREPLY=()
|
|
5
6
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
6
|
-
command="${COMP_WORDS[1]}"
|
|
7
7
|
if [[ ${COMP_CWORD} -eq 1 ]]; then
|
|
8
8
|
candidates="$(create-next-pro __complete 2>/dev/null)"
|
|
9
9
|
else
|
|
10
|
-
|
|
10
|
+
prior=("${COMP_WORDS[@]:1:$((COMP_CWORD - 1))}")
|
|
11
|
+
candidates="$(create-next-pro __complete "${prior[@]}" 2>/dev/null)"
|
|
11
12
|
fi
|
|
12
13
|
mapfile -t COMPREPLY < <(compgen -W "${candidates}" -- "${cur}")
|
|
13
14
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#compdef create-next-pro
|
|
2
2
|
|
|
3
3
|
_create_next_pro() {
|
|
4
|
-
local
|
|
5
|
-
command="${words[2]}"
|
|
4
|
+
local -a prior
|
|
6
5
|
if (( CURRENT == 2 )); then
|
|
7
6
|
compadd -- ${(f)"$(create-next-pro __complete 2>/dev/null)"}
|
|
8
7
|
else
|
|
9
|
-
|
|
8
|
+
prior=("${(@)words[2,$((CURRENT - 1))]}")
|
|
9
|
+
compadd -- ${(f)"$(create-next-pro __complete "${prior[@]}" 2>/dev/null)"}
|
|
10
10
|
fi
|
|
11
11
|
}
|
|
12
12
|
|