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

@design-parity/adapter-stitch

v0.1.14

Published

Google Stitch ReferenceAdapter: resolves a component to a Stitch design via design-map.json, fetches HTML+Tailwind through the Stitch SDK, rasterizes a reference image, and normalizes to a DesignReference.

Readme

@design-parity/adapter-stitch

The Google Stitch ReferenceAdapter. Stitch ships @google/stitch-sdk + an MCP server but has no Code Connect equivalent, so — unlike Figma's machine link — correspondence is resolved through the repo's design-map.json. The reference is always produced with linkMethod: "manifest".

What it does

resolve(componentId, ref, ctx):

  1. Resolve the handle. A direct stitch:<projectId>/<screenId> ref is parsed as-is. Otherwise the adapter loads design-map.json (designMapPath, or DESIGN_MAP_FILE, else <repoRoot>/design-map.json) and findByCode maps the component to its Stitch ref — the manifest is the only correspondence layer.
  2. Fetch HTML+Tailwind through the Stitch SDK (one or more screen variants).
  3. Rasterize each screen headlessly to a reference PNG; dimensions are read straight from the PNG IHDR so they can't drift from the bytes the diff engine compares against.
  4. Extract Tailwind-derived tokens — spacing/radius/background off the container, colour + typography off the title and body — into DesignTokens.
  5. Normalize to a DesignReference with linkMethod: "manifest".

Auth

The default SDK client reads a credential from AdapterContext.env, in order: STITCH_API_KEY, STITCH_TOKEN, STITCH_ACCESS_TOKEN, GOOGLE_STITCH_TOKEN.

A missing credential raises StitchAuthError; a rejected one is mapped from the SDK. A component with no matching design-map.json entry raises StitchManifestError; an unparseable ref raises StitchBadRefError.

Usage

import { createStitchAdapter } from "@design-parity/adapter-stitch";

const adapter = createStitchAdapter();

const reference = await adapter.resolve(
  "ui/Card.kt#OfferCard",
  "stitch:design/abc123", // or the code handle, resolved via design-map.json
  { repoRoot: process.cwd(), env: process.env },
);

Injectable seams

Both the SDK and the rasterizer are interfaces, so unit tests run with no live source and no browser (see test/):

  • StitchClient.fetchDesign(ref)StitchDesign ({ screens }). The default createSdkStitchClient lazily drives @google/stitch-sdk, kept out of the package's hard dependencies so install stays clean; absence is a clear StitchSdkError.
  • Rasterizer.rasterize({ html, css }) → PNG bytes. The default browserRasterizer drives a headless Chrome/Chromium found on PATH (or CHROME_PATH) — never a bundled browser-automation dependency, mirroring the candidate renderer.