Skip to content

feat: richer end-of-run summary (skipped shapes, resvg state, CLI version) - #33

Merged
SpotlightOn merged 3 commits into
mainfrom
feature/cli-rsvg-summary
Oct 11, 2026
Merged

SpotlightOn merged 3 commits into
mainfrom
feature/cli-rsvg-summary

Conversation

@SpotlightOn

@SpotlightOn SpotlightOn commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

What

Makes the CLI's skipped-shape reporting consistent and loud instead of silent, and surfaces the state of the optional dimension fallback plus the CLI version itself.

Added

  • Every shape that cannot be processed is written to stderr immediately as Skipping "<file>" (<reason>) and counted on an extra skipped … line in the end-of-run summary:
    • Invalid SVG/XML is reported with the actual parser reason, e.g. Invalid SVG file (Opening and ending tag mismatch: "rect" != "svg"), instead of xmldom's Reporting fatalError … caused … boilerplate. The raw [xmldom fatalError] console noise is gone.
    • SVGs without a determinable size (no viewBox, no width/height) are counted as … without dimensions.
  • The run summary reports whether the optional @resvg/resvg-js dimension-fallback package is installed (resvg available vs. resvg not installed). It is only needed for that unusual shape case: such a shape is skipped with an immediate warning carrying the install command (npm install @resvg/resvg-js), no NaN viewBox values are emitted, and the summary ends with the install recommendation.
  • The summary also reports the CLI version (version svgforge-cli 3.1.0), printed before that install recommendation so the actionable tip still closes the output.

Notes

  • Requires @svgforge/svgforge ≥ 3.1.0 for the shape-skipped event, the parser reasons, the graceful dimension handling and isResvgAvailable(). The dependency is bumped here — the previous ^3.0.0 resolved 3.0.0 from the registry, where @svgforge/svgforge/utils does not export isResvgAvailable() yet, so the CLI could not start in CI. The lockfile is regenerated against the registry (no link:/file: entries).
  • Tests: npm run lint clean, npm test 65/65 green (3 consecutive runs) against the published svgforge@3.1.0.
shapes    2 processed
modes     symbol (inline: no, example: no)
resvg     not installed
output    1 file → dist
elapsed   0.35s (concurrency 4)
version   svgforge-cli 3.1.0
tip       npm install @resvg/resvg-js (enables the dimension fallback)

Skipped shapes are written to stderr and counted in the summary, which
also reports whether @resvg/resvg-js is installed and recommends
installing it when dimensions were missing.
Print a `version` row (`svgforge-cli <version>`) in the summary, before the
resvg install tip so the actionable recommendation still closes the output.

The engine version is not included: `@svgforge/svgforge` does not export
`./package.json`, so reading it would require a resolve-and-walk-up workaround.
The summary reports the `shape-skipped` events with their parser reasons and
whether the `@resvg/resvg-js` dimension fallback is available. Both need
svgforge 3.1.0; the previous `^3.0.0` resolved 3.0.0 from the registry, where
`@svgforge/svgforge/utils` does not export `isResvgAvailable()` yet, so the CLI
failed to start and every test failed in CI.

Regenerate the lockfile against the registry (no `link:`/`file:` entries) and
exclude the fresh 3.1.0 from the minimum release age check.
@SpotlightOn SpotlightOn changed the title feat: report skipped shapes and the resvg fallback state feat: richer end-of-run summary (skipped shapes, resvg state, CLI version) Oct 11, 2026
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​svgforge/​svgforge@​3.0.0 ⏵ 3.1.077100100 +194 +1100

View full report

@github-actions

Copy link
Copy Markdown

Socket Security: Dependency Overview

Review the following changes in direct dependencies. Learn more about socket.dev

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated @svgforge/svgforge@3.1.0 76 100 99 93 100
Replaced @svgforge/svgforge@3.0.0 76 100 99 93 100

@SpotlightOn
SpotlightOn merged commit 6bb1dab into main Oct 11, 2026
8 checks passed
@SpotlightOn
SpotlightOn deleted the feature/cli-rsvg-summary branch October 11, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant