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

@bota-apps/types

v0.10.3

Published

Framework-free TypeScript contracts shared across @bota-apps packages: schema-driven form/detail/domain types, Money, feature-management (fm) boundary types, config shapes, and the minimal constraints expected on API-owned types. Zero runtime, zero depend

Readme

@bota-apps/types

Framework-free TypeScript contracts shared across the @bota-apps/* packages. Zero runtime, zero dependencies — just types. Its Zod runtime counterpart is @bota-apps/schema-utils, whose schemas are proven at build time (via satisfies z.ZodType<T> + Equal<> assertions) to match these types exactly, so the contracts and their validators can never silently drift.

Domain data — users, organizations, domain entities, audit entries, pagination envelopes — is owned by the API, not this package. @bota-apps/types defines only the framework's own contracts and the minimal structural CONSTRAINTS it expects on API-owned types (e.g. SessionUser); apps register their real API-owned types once via declaration merging (AuthRegister).

Install

pnpm add -D @bota-apps/types

Types-only, so a dev dependency is enough.

Usage

import type {
  TypedRegistrationSchema,
  TypedDetailSchema,
  DynamicFieldSchema,
  DomainDefinition,
  Money,
  CurrencyCode,
  BadgeTone,
} from "@bota-apps/types";
import type { FeatureBoundaryOptions, FeatureNodeDef } from "@bota-apps/types/fm";
import type { SessionUser, AuthState } from "@bota-apps/types/auth";

type ProjectInput = { name: string; budget: Money };

const schema: TypedRegistrationSchema<ProjectInput> = {
  id: "project",
  key: "project",
  name: "Project",
  fields: [{ name: "name", label: "Name", type: "text" }],
};

Discriminated unions, not optional bags

State contracts model mutually-exclusive shapes as unions discriminated by a literal status, so narrowing the discriminant narrows the payload:

import type { AuthState } from "@bota-apps/types/auth";

function greet(state: AuthState) {
  if (state.status === "authenticated") {
    return `Hi ${state.user.name}`; // `user` is present in this member only
  }
  return "Please sign in";
}

Registering your API-owned user type

Apps map their real user type onto the framework's SessionUser constraint once, via declaration merging, so every auth surface is typed app-wide without call-site generics:

import type { SessionUser } from "@bota-apps/types/auth";

declare module "@bota-apps/types/auth" {
  interface AuthRegister {
    user: MyApiUser; // must structurally satisfy SessionUser
  }
}

Subpaths

| Import | Contents | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | @bota-apps/types | Schema-driven forms (DynamicFieldSchema, DynamicFieldType, DynamicFieldOption, RegistrationSchema, TypedRegistrationSchema<T>, TypedDetailSchema<T>, FormSection), the DomainDefinition family (DomainDefinition, EntityDefinition, CreateInputDefinition, DomainFieldDefinition), Money/CurrencyCode/CurrencyInfo/FormatCurrencyOptions, BadgeTone | | @bota-apps/types/fm | Feature-management + app-manifest shapes: FeatureNodeDef, FeatureBoundaryOptions<T>, FeatureOptionsInput, ExpectedStatusMap, ResolvedFeature, FeatureCollector, AppManifest, FeatureRuntime, AppErrorLike, runtime seam types | | @bota-apps/types/auth | Cookie-session auth contracts: SessionUser constraint, AuthState/AuthStatus discriminated union, AuthStore/AuthClient, SessionPaths/SessionEndpoint, and the AuthRegister declaration-merging seam |

Part of the @bota-apps packages monorepo.