Make web-screenshot feel like a real CLI (v2.1.0) - #9
Merged
Conversation
Honor full-page screenshots when width or height is 0, wait for networkidle2 before the extra -t delay, and parse batch lines with quoted argv. Align the README with Commander, replace Travis with GitHub Actions CI, and fix the npm publish workflow. Co-authored-by: Helvio Pedreschi <Helvio88@users.noreply.github.com>
Helvio88
marked this pull request as ready for review
August 13, 2026 04:43
Drop esbuild --minify. Identifier mangling made git diff --exit-code dist fail on GitHub Actions even when the source was current. Co-authored-by: Helvio Pedreschi <Helvio88@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens
@helvio/web-screenshot2.1.0 so the CLI matches its docs and behaves like a real tool, without renaming the package or bin and without dropping existing flags.Compatibility kept
@helvio/web-screenshotweb-screenshot-u/--url,-o/--out,-t/--time,-x/-y/-w/-h,-c/--crop,-b/--batch,-d/--debug,-a/--auth,-p/--path#commentsBehavior
widthorheightis0, as the README already promised. Clip path is unchanged otherwise; default size is still 1920×1080.page.goto(..., { waitUntil: 'networkidle2' }), then the existing-textra wait.-tstill means extra seconds after load."My Screenshots/home.png"work.-t 3) are treated as integers;sanitizeAuthisstring | undefined.--urlor--batchinstead of launching a browser and exiting.Docs / CI
Usage: web-screenshot), documents-p/--path, drops Travis and--unsafe-perm, and explains install vianpm i -g/npx.LICENSEto matchpackage.json(documenting, not relicensing).dist/is up to date.dist/screenshot.jsis bundled without minify so that freshness check is deterministic (esbuild identifier mangling was failing CI).npm run build(esbuild) instead of Node 16 + the stubtscpackage. Not published to npm from this PR.Tests
46 tests covering Sanitizer, CLI help/args, batch quoting, capture planning (clip vs full-page +
networkidle2), and a mocked Puppeteer screenshot flow. No live network required.Dependabot PR #8 (
@sideway/formula) is left alone. After the lockfile refresh that dependency is gone (it came from stalejimplockfile entries).Version
Minor bump to 2.1.0 because 0-size full-page and
waitUntilare user-visible behavior changes. Changelog is inCHANGELOG.md. Please do notnpm publishuntil you want this released.