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

@mimlet/adapter

v0.1.0-beta.8

Published

Capability-aware adapter SDK, inspection and reusable conformance checks for test builders.

Readme

Adapter SDK and conformance

Declare an integration's actual operations while retaining its native schema and Standard Schema input/output types. The core and this SDK do not import or whitelist any schema vendor.

import { defineAdapter, fromAdapter } from '@mimlet/adapter';

const adapter = defineAdapter({
  id: 'my-domain',
  version: '1.0.0',
  standard: MySchema,
  source: MySchema,
  operations: {
    create: (id: string) => ({ id }),
    checkInput: (input: unknown) => isValidDomainInput(input),
    fields: [{ name: 'id', required: true }],
  },
  limitations: ['External identifiers require an application factory'],
});
const value = fromAdapter(adapter).buildValidated('customer-1');

defineAdapter snapshots the capability map and descriptive metadata. It retains native schema/function handles, does not clone executable objects, and does not execute operations to guess capabilities. Operation callbacks are trusted code and should use closures or explicit binding. Do not mutate a native schema or its registries while builders use it. fromFactory supplies an explicit typed escape hatch; fromAdapter requires an actual create capability at compile time. Asynchronous factories remain async-only in the resulting builder types. Both accept a typed defaultSession option for a create or factory whose first parameter is a GenerationSession; builds may then omit the session, and create, patch factories and transforms always receive one. A name option scopes that default session per builder.

adapter.inspect() describes generation, encoding, pure input checking, cloning, field metadata, native arbitrary identity, and explicit limitations. Missing field inspection is null, not an empty object schema. Native arbitrary handles remain opaque: a native Effect arbitrary is not relabelled as a fast-check arbitrary, and a random function is not advertised as a shrinker. Inspection contains no schema, fixture, or executable callback. It is suitable for a local inspector; rendering code must still escape user-controlled labels.

Shared conformance suite

import { assertAdapterConformance } from '@mimlet/adapter/testing';
await assertAdapterConformance(adapter, [
  { name: 'valid id', input: () => ({ id: 'one' }), valid: true },
  { name: 'missing id', input: () => ({}), valid: false },
]);

Cases supply fresh inputs and can supply an output assertion for transformations. The suite compares pure native checks with Standard Schema and validated builder results, verifies unchecked builds do not validate, and counts one Standard Schema call per validated build. It intentionally runs each case through the native and builder paths separately; do not use effectful production validators with a suite intended for tests. Failures identify case names and contract mismatches without printing fixture values or native exception text.

These tests are reusable evidence, not a compatibility certificate. An adapter still needs vendor/version-specific tests for references, codecs, unsupported constructs, recursion, generation, encoding and shrink semantics. Report tested versions and limitations separately rather than publishing a universal badge.

Other exports

  • checkAdapterConformance(adapter, cases) from @mimlet/adapter/testing runs the same suite without throwing on failed cases and resolves to { adapter, passed, cases: [{ name, passed, reason? }] }, where adapter is the inspected adapter id. Reasons are fixed descriptions and never contain fixture values or native exception text.