carbon-preprocess-svelte 0.13.0 gives a pipeline the CLI's result to
read: an exit status that says whose fault a failure is,
and --json for the counts.
Changes
- The CLI exits
2when called wrong or given nothing it can prune:
an unknown option or command, no CSS file matching the pattern,
no Carbon import in the project, or no component index.
It exited1for each (b799090).
A script that checks for1checks for2instead;
0still means done.
Features
--json prints the result as one object (b799090).
The counts arrive on stdout:
$ carbon-preprocess-svelte optimize-css "dist/*.css" --dry-run --json
{
"schemaVersion": 1,
"ok": true,
"dryRun": true,
"summary": {
"files": 1,
"pruned": 1,
"before": 47,
"after": 20
},
"files": [
{
"file": "dist/app.css",
"before": 47,
"after": 20,
"removed": 1
}
]
}
A failure prints "ok": false and an error with its kind
and message.
Before, a script read the counts from the size log meant for people.
Also new:
- An unknown option names the closest:
--dry-rngets--dry-run(b799090). --version(or-v) prints the version (b799090).carbon-preprocess-svelte/package.jsonresolves underexports;
it threwERR_PACKAGE_PATH_NOT_EXPORTED(91410cb).
Docs
- The README fits one screen, and each tool's guide has its own page in
docs/: set-ups for every bundler, the options,
and how the pruning reads your installed Carbon (77e567c).