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

@bc-subscriptions/types

v0.1.0

Published

Shared TypeScript types for bc-subscriptions — D1 row shapes, status enums, adapter contract types. Source of truth: apps/api/migrations/0001_init.sql + the BC-native MIT path spec (D17). Consumed by apps/api and prototype; future consumers: apps/admin, p

Readme

@bc-subscriptions/types

Shared TypeScript types for the bc-subscriptions monorepo — D1 row shapes, status enums, adapter contract types, primitives.

What lives here

| Category | Examples | Source of truth | |---|---|---| | Row types (snake_case, column-exact) | SubscriptionRow, ChargeRow, CustomerRow, PlanRow, … | apps/api/migrations/schema/0001_init.sql | | Status enums | SubscriptionStatus, ChargeStatus, MitSubtype, ChainPosition, … | CHECK constraints in the same migration | | Adapter contract | ChargeContext, ChargeResult | apps/api/HACKATHON-SCOPE.md + D17 spec | | Primitives | StoreHash, Money | — |

What deliberately doesn't live here

  • Worker Env — app-specific binding shape; lives in apps/api/src/types.ts.
  • BcSignedJwtPayload — BC platform integration shape; lives in apps/api/src/types.ts.
  • Adapter implementations — only the contract types are shared; gateway-specific adapter code stays in its host app.

Consumers

  • apps/api/ — re-exports the row + enum + contract types from apps/api/src/types.ts for backwards compatibility, while Env and BcSignedJwtPayload stay app-local.
  • prototype/prototype/src/lib/api-client.ts imports row types directly; previously inlined them (since prototype/ had its own tsconfig and we'd punted on a shared types package per decision 45886741).
  • Future: apps/admin/, packages/storefront-* — will import from this package once they land (per ADR-0012 and ADR-0013).

Wiring

The package is consumed via file: protocol in each consumer's package.json:

{
  "dependencies": {
    "@bc-subscriptions/types": "file:../../packages/types"
  }
}

npm install symlinks the built dist/ output into the consumer's node_modules. There's no root npm-workspaces config in this repo — each package keeps its own lockfile (per the precedent set by apps/i18n/).

Build

npm install
npm run build

Outputs dist/index.js (effectively empty — types-only) + dist/index.d.ts. Consumers resolve types via the exports map in package.json.

Updating the types

When apps/api/migrations/schema/*.sql changes (column added, enum extended, table added):

  1. Update src/index.ts here to match.
  2. npm run build.
  3. Run npm run typecheck in both apps/api/ and prototype/ to surface drift.

Drift is the whole point of this package — a schema change should fail typecheck in every consumer at the next build, not surface as a runtime "field unavailable" rendering bug.

Why a shared package vs. cross-app paths mapping

Two apps consume the row types today (apps/api/, prototype/); two more will soon (apps/admin/, packages/storefront-*). TypeScript paths mapping requires every consumer's tsconfig.json to coordinate; a published package decouples them. The file: protocol lets us evolve the types in lockstep with the migrations without setting up a registry.