github carbon-design-system/carbon-preprocess-svelte v0.13.0

49 minutes ago

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 2 when 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 exited 1 for each (b799090).
    A script that checks for 1 checks for 2 instead;
    0 still 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-rn gets --dry-run (b799090).
  • --version (or -v) prints the version (b799090).
  • carbon-preprocess-svelte/package.json resolves under exports;
    it threw ERR_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).

Don't miss a new carbon-preprocess-svelte release

NewReleases is sending notifications on new releases.