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

@profullstack/sh1pt-core

v0.1.11

Published

Core interfaces and contract-test runners for sh1pt adapters.

Readme

@profullstack/sh1pt-core

Core interfaces and contract-test runners for sh1pt adapters.

🌐 Homepage: https://sh1pt.com 📦 Source: https://github.com/profullstack/sh1pt

npm license github

sh1pt is the single command between an idea and global distribution — one codebase → every store, registry, CDN, ad network, cloud provider, and channel. This package is its foundation: the plugin contract every adapter implements, plus the test runners that verify adapters behave.

Install

pnpm add @profullstack/sh1pt-core
# or: npm i, bun add, deno add npm:

Who this is for

You only need this package directly if you're authoring a sh1pt adapter — a social platform, a cloud provider, a payment processor, a package registry. If you just want to use sh1pt, install @profullstack/sh1pt instead.

What's in the box

  • ~16 adapter interfacesTarget, SocialPlatform, Bot, BridgeNetwork, CloudProvider, DnsProvider, MerchProvider, PaymentProvider, AdPlatform, VcsProvider, AgentCLI, CaptchaSolver, WebhookTarget, DocProvider, JurisdictionPack, Recipe
  • defineXxx() constructors — type-safe factories every adapter uses as its export default
  • setup() helperswebhookUrlSetup, tokenSetup, oauthSetup, manualSetup, plus the SetupContext / SetupResult types every adapter uses to auto-persist config to ~/.config/sh1pt/config.json
  • Contract-test runners under @profullstack/sh1pt-core/testing — one-line test setup per adapter

Minimal example: authoring an adapter

import { defineSocial, tokenSetup } from '@profullstack/sh1pt-core';

interface Config {
  username: string;
}

export default defineSocial<Config>({
  id: 'social-my-platform',
  label: 'My Platform',
  requires: { maxBodyChars: 500 },

  async connect(ctx, config) {
    if (!ctx.secret('MY_PLATFORM_TOKEN')) {
      throw new Error('MY_PLATFORM_TOKEN not in vault');
    }
    return { accountId: config.username };
  },

  async post(ctx, post, config) {
    ctx.log(`posting ${post.body.length} chars`);
    if (ctx.dryRun) return { id: 'dry-run', url: '', platform: 'my-platform', publishedAt: new Date().toISOString() };
    // … real API call …
    return { id: `mp_${Date.now()}`, url: '…', platform: 'my-platform', publishedAt: new Date().toISOString() };
  },

  setup: tokenSetup({
    secretKey: 'MY_PLATFORM_TOKEN',
    label: 'My Platform',
    vendorDocUrl: 'https://my-platform.example.com/developers',
    steps: [
      'Go to the developer console',
      'Create an API token with post scope',
      'Copy the token (shown once)',
    ],
  }),
});

Contract tests

Every adapter that implements an interface should run the matching contract-test runner. One line in your test file:

// packages/social/my-platform/src/index.test.ts
import { contractTestSocial } from '@profullstack/sh1pt-core/testing';
import adapter from './index.js';

contractTestSocial(adapter, {
  sampleConfig: { username: 'testuser' },
  requiredSecrets: ['MY_PLATFORM_TOKEN'],
});

The runner verifies:

  • id and label are present and correctly namespaced
  • connect() throws a vault-hint error when required secrets are missing
  • dry-run mode never hits the network
  • Return shapes match the declared types
  • Interface-specific guardrails (GPU cloud providers enforce --max-hourly-price, social adapters with requires.media reject posts without media, etc.)

Config store

@profullstack/sh1pt-core also exports the JSON-on-disk config store every adapter's setup() writes to:

import { getAdapterConfig, setAdapterConfig, configPath } from '@profullstack/sh1pt-core';

const cfg = await getAdapterConfig<MyConfig>('social-my-platform');
await setAdapterConfig('social-my-platform', { username: 'sh1pt' });
console.log('config lives at', configPath()); // ~/.config/sh1pt/config.json

Atomic writes, 0600 perms, respects XDG_CONFIG_HOME.

Links

  • sh1pt: https://sh1pt.com
  • Source: https://github.com/profullstack/sh1pt
  • Issues: https://github.com/profullstack/sh1pt/issues

License

MIT