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

@myrobotaxi/contracts

v0.3.0

Published

Canonical wire-protocol schemas for the MyRoboTaxi platform. JSON Schema (draft-2020-12) + pre-generated TypeScript types. Consumed by SDKs (TS, Swift) and the Go telemetry server.

Readme

@myrobotaxi/contracts

Canonical wire-protocol schemas for the MyRoboTaxi platform.

  • JSON Schema (draft-2020-12) under schemas/ — the language-neutral source of truth.
  • Pre-generated TypeScript types under dist/ (via the ./types subpath) — produced by json-schema-to-typescript and committed to src/generated/ for diff review.

Consumed by @myrobotaxi/sdk, the Go telemetry server, and the react-frontend Next.js app.

Install

npm install @myrobotaxi/contracts

Usage

Type-only import (no runtime payload, tree-shakes to zero bytes):

import type { VehicleState, WebSocketEnvelope } from '@myrobotaxi/contracts/types';

Runtime schemas for Ajv / runtime validation:

import { schemas } from '@myrobotaxi/contracts';
// schemas.vehicleState, schemas.wsMessages, schemas.wsEnvelope

Raw JSON for non-JS consumers (Go, Swift):

./node_modules/@myrobotaxi/contracts/schemas/vehicle-state.schema.json
./node_modules/@myrobotaxi/contracts/schemas/ws-messages.schema.json
./node_modules/@myrobotaxi/contracts/schemas/ws-envelope.schema.json

What's in the generated TypeScript

Custom JSON Schema annotations from the source schemas — x-classification, x-atomic-group, x-unit, x-encrypted, x-tesla-proto-field — are folded into the generated TSDoc comments at codegen time. This means consumers can grep '@classification "P1"' inside their node_modules to find every sensitive field without leaving their editor.

/**
 * GPS latitude. Encrypted at rest (AES-256-GCM) per FR-11.1.
 *
 * @classification "P1"
 * @atomic-group "gps"
 * @encrypted true
 */
latitude: number;

Tool choice: json-schema-to-typescript

We picked json-schema-to-typescript v15+ over quicktype for three reasons:

  1. Matches the telemetry repo's existing convention. The Go-side vehicle-state-schema.md §6.1 already documents json-schema-to-typescript as the TS-side tool. Picking the same one in the contracts package guarantees zero drift between the docs and the actual output.
  2. Pure JS (no Rust binary). Easier to vendor into CI, no platform-specific install issues.
  3. TSDoc-preserving. The description field on each JSON Schema property is copied verbatim into the generated TSDoc comment. quicktype produces leaner runtime helpers (parsers / serializers) but does not preserve descriptions as cleanly, and we don't need its runtime artifacts here.

The trade-off is that quicktype's discriminated-union handling for oneOf payloads is more idiomatic. The current schemas use a nullable-enum-with-explicit-null pattern instead of oneOf, so this doesn't bite us yet. If the schema set grows to need true discriminated unions, we may revisit.

Schema-authoring policy

Schemas in this repo are vendored from myrobotaxi/telemetry/docs/contracts/schemas/ — that repo is the current authoring home.

Until Phase 2 ships, schema changes require a paired PR to this repo (mirroring the change here, re-running codegen, bumping the version).

Phase 2 migration

A planned follow-up moves the schema authoring home from telemetry/docs/contracts/schemas/ into this repo, eliminating the paired-PR requirement. After Phase 2, the telemetry server's Go contract-tester will consume the published @myrobotaxi/contracts package directly.

Versioning policy

  • Major version bump required for any wire-incompatible change (per NFR-3.37 in the telemetry docs).
  • Minor version bump for additive, backwards-compatible additions (new optional fields, new message types, new enum members on append-only enums).
  • Patch version bump for documentation / annotation changes that don't alter the generated TypeScript surface.

Development

npm install
npm run codegen        # regenerate src/generated/ from schemas/
npm run typecheck
npm run test
npm run build          # tsup → dist/

CI runs codegen and fails if src/generated/ drifts from the schemas — every schema bump must be paired with a regenerate-and-commit.

License

MIT