create-next-pro-cli 0.1.30 → 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 +16 -6
- package/create-next-pro-completion.sh +4 -3
- package/create-next-pro-completion.zsh +3 -3
- package/dist/bin.bun.js +514 -118
- package/dist/bin.node.js +579 -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-addapi/SKILL.md +61 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-addcomponent/SKILL.md +67 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-addlanguage/SKILL.md +68 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-addlib/SKILL.md +65 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-addpage/SKILL.md +89 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-addtext/SKILL.md +63 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-create-project/SKILL.md +76 -0
- package/templates/Projects/default/.agents/skills/create-next-pro-rmpage/SKILL.md +67 -0
- package/templates/Projects/default/.github/workflows/quality.yml +2 -1
- package/templates/Projects/default/AGENTS.md +91 -0
- package/templates/Projects/default/README.md +29 -9
- 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/consumer/validate-template.ts +2 -0
- package/templates/Projects/default/tests/unit/audit-policy.test.ts +152 -0
- package/templates/Projects/default/tests/unit/template-baseline.test.ts +9 -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
|
|
|
@@ -132,9 +134,15 @@ The Next.js route and its interface are separate: `src/app` owns routing while `
|
|
|
132
134
|
|
|
133
135
|
```text
|
|
134
136
|
my-app/
|
|
137
|
+
├── .agents/
|
|
138
|
+
│ └── skills/
|
|
139
|
+
│ ├── create-next-pro-create-project/
|
|
140
|
+
│ ├── create-next-pro-addpage/
|
|
141
|
+
│ └── ...
|
|
135
142
|
├── .env.example
|
|
136
143
|
├── .gitignore
|
|
137
144
|
├── .prettierignore
|
|
145
|
+
├── AGENTS.md
|
|
138
146
|
├── bun.lock
|
|
139
147
|
├── cnp.config.json
|
|
140
148
|
├── messages/
|
|
@@ -202,6 +210,8 @@ my-app/
|
|
|
202
210
|
|
|
203
211
|
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.
|
|
204
212
|
|
|
213
|
+
Generated projects also include concise root guidance in `AGENTS.md` and eight instruction-only command skills under `.agents/skills`. Agents should prefer the deterministic `--json` contract and read the matching skill before invoking a project mutation.
|
|
214
|
+
|
|
205
215
|
## CLI architecture
|
|
206
216
|
|
|
207
217
|
```text
|
|
@@ -326,7 +336,7 @@ The versioned document has stable status, event, next-step, and error fields:
|
|
|
326
336
|
|
|
327
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.
|
|
328
338
|
|
|
329
|
-
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`.
|
|
330
340
|
|
|
331
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.
|
|
332
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
|
|