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

@me1a/tool-open-api-builder

v0.3.3

Published

Generic OpenAPI REST SDK builder (TypeScript + Rust, openapi-typescript + progenitor)

Readme

@me1a/tool-open-api-builder

OpenAPI REST verify, sync-spec, protobuf-backed SDK build, and check (TypeScript + Rust).

Pipeline: cached OpenAPI → normalize → emit .proto + lock files → buf lint / buf generate → TypeScript (protobuf-es schema types + openapi-fetch paths/client) and Rust (prost + progenitor HTTP client).

HTTP wire format stays JSON. Proto fields use json_name when OpenAPI keys differ from snake_case. parseJsonBody / serializeJsonBody rewrite string enums between spec wire values (active) and protobuf JSON names. Bodies use protobuf message types; paths stay typed from OpenAPI (paths.ts). Build stages under .build-staging/ and promotes atomically — never touches extensions/.

Consumer packages should gitignore .build-staging/, .cache/, and local buf cache under .cache/xdg-cache/.

Commands

open-api-builder verify --root path/to/packages/open-api
open-api-builder verify --root path/to/packages/open-api --online
open-api-builder sync-spec --root path/to/packages/open-api
open-api-builder build --root path/to/packages/open-api
open-api-builder build --root path/to/packages/open-api --only admin-core
open-api-builder build --root path/to/packages/open-api --fetch   # sync-spec then build
open-api-builder check --root path/to/packages/open-api
open-api-builder check --root path/to/packages/open-api --git-dirty
open-api-builder init --root path/to/packages/open-api

Requires Node 26+, cargo, and network for buf generate (remote plugins) unless OPEN_API_BUF_LOCAL_PLUGINS=1.

Consumer config

// open-api.config.ts
import { defineConfig } from "@me1a/tool-open-api-builder";

export default defineConfig({
  packageRoot: import.meta.dirname,
  services: [
    {
      id: "auth",
      name: "Auth API",
      specUrl: "https://example.test/openapi/schemas/auth.schema.json",
      auth: { preset: "none" },
    },
  ],
});

Peer dependencies in consumer packages: @bufbuild/protobuf, openapi-fetch.

Layout (per service)

Unified with AsyncAPI builder: docs/specs/sdk-pipeline.md (Layout & CLI).

| Path | Role | |------|------| | specs/<id>.openapi.json | Cached spec (from sync-spec) | | specs/<id>.proto.lock.json | Stable proto field numbers | | proto/<pkg>/ | Generated .proto | | src/sdk/<id>/generated/ | *_pb.ts, paths.ts, client.ts (always regenerated) | | src/sdk/<id>/extensions/ | Optional overrides (init scaffolds) | | rust/sdk/<crate>/ | Rust crate (prost + progenitor) |

verify / build / check print resolved paths. Override any default path in defineConfig if needed.

Toolchain matrix

| Tool | Pin (src/toolchain.ts) | |------|--------------------------| | buf | 1.47.2 | | protoc-gen-es | 2.13.0 | | prost plugin (buf) | v0.5.0 | | openapi-typescript | ^7.6.1 | | progenitor / openapiv3 | 0.8 / 2.0 |

Set OPEN_API_BUF_LOCAL_PLUGINS=1 to use protoc-gen-es / protoc-gen-prost from node_modules/.bin.

OPEN_API_BUF_BREAKING_AGAINST overrides the buf breaking baseline (e.g. .git#subdir=proto). In CI (CI=true) breaking failures fail the build; locally they warn.

Rust: prost schema types live in pb; progenitor HTTP types stay in the generated client module — convert at the boundary when you need both.

Library API

import {
  buildOpenApi,
  verifyOpenApi,
  checkOpenApi,
  syncOpenApiSpecs,
} from "@me1a/tool-open-api-builder";

Develop

git config core.hooksPath .githooks
yarn install
yarn build
yarn test

Integration tests call buf and cargo. By default they skip buf generate (reuse committed *_pb.ts / prost stubs); set OPEN_API_INTEGRATION_BUF=1 to exercise the full remote plugin path. Set OPEN_API_SKIP_CARGO_CHECK=1 to skip cargo check without Rust.

Release

yarn release:minor   # layout change: 0.1 → 0.2+