npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@webship-js/gatsby-steps

v2.0.0

Published

webship-js test project with custom Gatsby step definitions (gatsby.steps.js), building and testing gatsby-starter-default with gatsby serve

Readme

gatsby-steps

A webship-js test project for Gatsby sites, using the standard webship-js project layout (as installed by webship-js's own scaffolding) with custom Gatsby-aware step definitions in tests/step-definitions/gatsby.steps.js.

By default it tests gatsby-starter-default, built locally by scripts/build-gatsby-site.sh and served with gatsby serve -p 8000 at http://localhost:8000 (exactly what CI does). Point LAUNCH_URL at any other Gatsby site to test it instead.

The target must be a production build (gatsby build && gatsby serve), not gatsby develop: the dev server's live-reload WebSocket/HMR traffic never lets the page go network-idle, which makes webship-js's smart-wait stall for tens of seconds on every navigation.

Published to npm as @webship-js/gatsby-steps.

Layout

This is the layout webship-js's own installer generates — nothing custom, just filled in:

cucumber.js                          # webship-js config (require paths, worldParameters, launchUrl)
playwright.config.ts                 # browser launch/context options
tsconfig.json
tests/
  features/                          # .feature files (this repo's Gatsby main-page scenarios)
  step-definitions/
    gatsby.steps.js                  # custom Gatsby-aware steps — no custom.js
  reports/                           # generated HTML/JSON report (gitignored)
  selectors/                         # named selector registry (empty by default)
scripts/
  build-gatsby-site.sh               # clones + builds gatsby-starter-default into .gatsby-site (gitignored)
.github/workflows/ci.yml             # build + serve + webship-js suite on every push/PR

Custom steps

tests/step-definitions/gatsby.steps.js adds steps for things generic webship-js steps don't know about. The step phrases are deliberately framework-agnostic (no "Gatsby" in the Gherkin text), even though what they check under the hood is specific to how this framework builds and hydrates a page:

| Step | What it checks | | --- | --- | | Then I should( not) see a hydrated page | window.___gatsby is set — the client-side runtime mounted/hydrated | | Then I should( not) see an optimized image | a gatsby-plugin-image ([data-gatsby-image-wrapper]) is on the page | | When I click the link "..." without a full page reload | clicking navigates client-side (the URL path changes with no full page reload) | | Then the page-data for "/path/" should( not) be available | page-data/<segment>/page-data.json for that route returns 200 with a path | | Then I should( not) be on the default 404 page | body text matches gatsby-starter-default's 404: Not Found copy | | Then the page title should( not) be "..." | exact document.title match |

Every Then step takes should or should not, every step takes I, we or no pronoun, and every failure is a friendly message with a hint (no assertion or Playwright stack). Each assertion polls its condition for the minWaitTime.page budget (at least 10 s) instead of reading the page once, so a page that is still hydrating is waited for rather than failed.

See the file for full JSDoc + Gherkin examples per step. npm run test:examples checks that every example matches its own step (and no webship-js core step) and that every feature step is defined exactly once; CI runs it before the suite.

Feature coverage

tests/features/ covers gatsby-starter-default's main pages: /, /page-2/, /using-typescript/, and the 404 fallback. The titles, copy and link texts they assert are the starter's own; swap them for your site's content when you copy a feature.

/using-ssr/ and /using-dsg/ aren't covered yet, though gatsby serve (unlike a plain static file server) does serve them correctly — that's tracked as further test coverage, not a current limitation of the setup.

Running locally

Requires Node.js 22+.

npm install
npx playwright install chromium
bash scripts/build-gatsby-site.sh   # clones + builds gatsby-starter-default into .gatsby-site (gitignored)
(cd .gatsby-site && npx gatsby serve -p 8000 &)
npm test                            # LAUNCH_URL defaults to http://localhost:8000

To test a different Gatsby site instead, point LAUNCH_URL at that site's URL when running npm test.

Continuous integration

.github/workflows/ci.yml runs the same flow on every push/PR to 2.0.x: build gatsby-starter-default, serve it with gatsby serve, install dependencies, run the webship-js suite in tests/features/ against it, and upload the HTML/JSON report as a workflow artifact.

Publishing

Releases are published to npm as @webship-js/gatsby-steps from the 2.0.x branch, following the webship-js 2.0.x line.

License

MIT