@nuasite/cli 0.50.1 → 0.52.0
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 +36 -1
- package/dist/index.js +2967 -2689
- package/dist/types/check.d.ts +18 -0
- package/dist/types/check.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/src/check.ts +80 -0
- package/src/index.ts +12 -0
- package/src/tsconfig.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`@nuasite/cli` is the cli tool that powers [Astro](https://astro.build/) projects updated by
|
|
4
4
|
[Nua Site](https://www.nuasite.com). It wraps `astro build`, `astro dev`, and
|
|
5
5
|
`astro preview` with the Nua defaults and adds project-level commands
|
|
6
|
-
(`init`, `clean`, `migrate`).
|
|
6
|
+
(`check`, `init`, `clean`, `migrate`).
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
@@ -58,6 +58,41 @@ Specifically it:
|
|
|
58
58
|
After running, follow the printed next-steps: `bun install`, review the
|
|
59
59
|
config, and run `nua dev`.
|
|
60
60
|
|
|
61
|
+
### `nua check`
|
|
62
|
+
|
|
63
|
+
Validates the content collections without building the site:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
nua check # exit 1 on errors
|
|
67
|
+
nua check --json # machine-readable report
|
|
68
|
+
nua check --strict # warnings fail too
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Run it anywhere in the project: with no `astro.config.*` in the current directory
|
|
72
|
+
it checks every `packages/*` that has one, so a monorepo root works too — which is
|
|
73
|
+
where `bun run build` typically builds something else entirely.
|
|
74
|
+
|
|
75
|
+
It reads `src/content.config.ts`, walks every collection's entries and reports
|
|
76
|
+
frontmatter that does not parse, values that do not match a declared field type
|
|
77
|
+
(`order: ""` where the schema wants a number), missing required fields, and
|
|
78
|
+
`reference()` values pointing at no entry.
|
|
79
|
+
|
|
80
|
+
Use it instead of a full build when you only need to know whether the content is
|
|
81
|
+
still valid: `astro build` validates the same things but costs the whole render
|
|
82
|
+
and stops at the first bad entry, while this reports every problem in one pass —
|
|
83
|
+
under a second on a 1500-entry site. A dangling reference is a warning, because
|
|
84
|
+
it builds green and then renders nothing.
|
|
85
|
+
|
|
86
|
+
`check` is new in 0.51.0. Most projects do not depend on `@nuasite/cli` directly
|
|
87
|
+
— it arrives through `@nuasite/nua`, which pins it exactly — so a project on an
|
|
88
|
+
older `@nuasite/nua` has an older `nua` and answers `Unknown command: check`
|
|
89
|
+
until it bumps. To run it regardless of what the project pins, and from a plain
|
|
90
|
+
shell where `node_modules/.bin` is not on `PATH`:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
bunx @nuasite/cli@latest check
|
|
94
|
+
```
|
|
95
|
+
|
|
61
96
|
### `nua clean`
|
|
62
97
|
|
|
63
98
|
Ejects your project from the Nua toolchain back to a standard Astro setup:
|