@nuasite/cli 0.65.2 → 0.66.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 +20 -0
- package/dist/index.js +35719 -35363
- package/dist/types/check-code.d.ts +16 -2
- package/dist/types/check-code.d.ts.map +1 -1
- package/dist/types/check.d.ts +5 -0
- package/dist/types/check.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
- package/src/check-code.ts +96 -5
- package/src/check.ts +42 -3
- package/src/index.ts +3 -1
package/README.md
CHANGED
|
@@ -68,6 +68,8 @@ nua check --json # machine-readable report
|
|
|
68
68
|
nua check --strict # warnings fail too
|
|
69
69
|
nua check --content-only # skip the source parse (and the live schema rules)
|
|
70
70
|
nua check --no-live # skip the live schema rules only
|
|
71
|
+
nua check --fail-on src/styles/site.css,src/pages/index.astro
|
|
72
|
+
# report everything, fail only on errors in these files
|
|
71
73
|
```
|
|
72
74
|
|
|
73
75
|
Run it anywhere in the project: with no `astro.config.*` in the current directory
|
|
@@ -86,6 +88,24 @@ build in `Building static entrypoints`, and reports it at its line in the `.astr
|
|
|
86
88
|
source rather than in generated code. It is a syntax check, not a type check: a
|
|
87
89
|
wrong prop type still needs `astro check` or a build.
|
|
88
90
|
|
|
91
|
+
Stylesheets under the project (not in `public/`, which is copied as it is) go through
|
|
92
|
+
Tailwind's CSS parser, because the build runs every stylesheet through it, Tailwind or
|
|
93
|
+
not. It refuses what a browser quietly repairs: a rule left without its closing `}`,
|
|
94
|
+
a stray `}`, an unterminated string, a declaration without its colon. Only those syntax
|
|
95
|
+
errors are reported. What only the whole project can settle, such as `@apply` of a
|
|
96
|
+
utility its theme defines, is left to the build. The parser is the site's own
|
|
97
|
+
`tailwindcss` when it has one installed, since its strictness changed between
|
|
98
|
+
versions, and the copy this CLI ships otherwise. Loading the site's copy runs the
|
|
99
|
+
project's installed code, so `--no-live` (and `--content-only`) keep to the bundled one.
|
|
100
|
+
|
|
101
|
+
`--fail-on` is for a commit: it still reports every problem, but fails only on errors
|
|
102
|
+
in the files it lists (comma-separated, relative to where the command runs), so a
|
|
103
|
+
change cannot add a broken file while an error it did not touch does not block it.
|
|
104
|
+
With `--strict`, warnings in the listed files fail too. A listed file the syntax pass
|
|
105
|
+
did not read (a `.js`, a file in `public/` or outside every Astro project, a missing
|
|
106
|
+
one) is named in the output rather than counted, so a gate on it does not read as a
|
|
107
|
+
pass; a content entry among them is still checked with its collection.
|
|
108
|
+
|
|
89
109
|
Use it instead of a full build when you only need to know whether the content is
|
|
90
110
|
still valid: `astro build` validates the same things but costs the whole render
|
|
91
111
|
and stops at the first bad entry, while this reports every problem in one pass —
|