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

@tailorkit/app

v0.1.0-beta.33

Published

Readme

TailorKit App

The SDK for building TailorKit extensions.

Apps require Preact 11. Install preact@^11 alongside the SDK.

File routing

New apps register views from src/slots automatically. Only files ending in .view.tsx are views, so supporting components can live beside them.

src/
  root.tsx
  slots/
    panel/
      root.tsx
      layout.tsx
      home.view.tsx
      customers.view.tsx
      customers.layout.tsx
      customers.details.view.tsx
      customer-card.tsx

The slot directory is its literal host slot name, including dots in names such as panel.links. Dots in a view filename separate route segments: customers.details.view.tsx registers /customers/details. Subdirectories also separate segments. customer-card.tsx is an ordinary component and is ignored unless imported. Duplicate view paths in a slot fail the build.

// src/slots/panel/customers.details.view.tsx
import { defineView } from "tailorkit/client";

import CustomerCard from "./customer-card";

export default defineView({ component: CustomerCard });

The builder supplies the slot and route before compiling. You can keep an explicit view to override the filename and infer the precise host context type:

// src/slots/panel/home.view.tsx
import { defineView } from "tailorkit/client";

const view = defineView({ view: "/", component: Home });

function Home() {
  const context = view.useContext();
  return <>Welcome</>;
}

export default view;

There are no special view filenames: index.view.tsx maps to /index. Use a descriptive filename with view: "/" for the slot's home view. An explicit slot, if supplied, must match the containing slot directory. Multi-instance views still provide instances: { dataSchema, resolve }; resolvers are extracted into the private server bundle. Host slot/view support and multiplicity are validated when publishing. An explicit slot also retains the source-level TypeScript checks for that slot's supported views and instances.

Roots and layouts

src/root.tsx is the optional app shell. Init generates a shell with the backend provider:

import { ClientProvider, defineRoute, Route } from "tailorkit/client";

function Shell() {
  return (
    <ClientProvider>
      <Route />
    </ClientProvider>
  );
}

export default defineRoute({ shellComponent: Shell });

Each slot can also have a root.tsx exporting defineRoute({ shellComponent }). It wraps every view in that slot, inside the app shell. A shell can render its children prop instead of <Route />.

layout.tsx wraps the entire slot. customers.layout.tsx wraps /customers and its descendants, with matching at segment boundaries. Layouts follow the resolved view path, including an explicit view override. They do not register views themselves. A layout default-exports an ordinary component (or a defineRoute({ shellComponent }) definition):

import { Route } from "tailorkit/client";

export default function CustomersLayout() {
  return <Route />;
}

For /customers/details, the order is app root → slot root → slot layout → customers layout → details view. Shared shells and layouts stay mounted as the selected view changes; layouts mount and unmount when entering or leaving their route subtree. Layouts do not automatically receive a leaf view's typed context.

Each mounted slot instance has its own shell, provider, and layout state. Two separate host mounts do not share provider state. A provider is disposed when its slot mount is removed.

Build tooling

Run tailorkit init to create an app. Choose Vite+ (recommended) for building, linting, formatting, and testing, or Vite (build only) for a minimal setup. For non-interactive setup, pass --tooling vite-plus or --tooling vite.

Build tooling lives in the separate @tailorkit/vite package. Both options generate vite.config.ts with the TailorKit plugin. Vite+ apps use:

import { tailorkit } from "tailorkit/vite";
import { defineConfig, lazyPlugins } from "vite-plus";

export default defineConfig({
  plugins: lazyPlugins(() => [tailorkit()]),
  lint: { ignorePatterns: ["src/tailorkit.gen.ts", ".tailorkit/**"] },
  fmt: { ignorePatterns: ["src/tailorkit.gen.ts", ".tailorkit/**"] },
});

Vite apps import defineConfig from vite and use plugins: [tailorkit()]. They do not install linting, formatting, or test tooling.

Run your package manager's build script to build either setup. Vite+ apps also include check, fix, format, and test scripts. A global Vite+ installation is not required.

Add aliases, compile-time constants, and custom Vite plugins to vite.config.ts. Custom plugins, aliases, and constants also apply to the private server build. Set build.outDir to change the output directory; the default is .tailorkit. The plugin owns the client entry and the deployable bundle filenames.

The plugin discovers file routes, extracts private instance resolvers, bundles the backend and migrations, copies logos, and writes tailorkit-upload.json. tailorkit deploy builds using the same Vite configuration before uploading. Keep host, app ID, logos, and backend settings in tailorkit.config.ts.

For builds outside the app's directory, pass tailorkit({ cwd: appDirectory }). To use a different TailorKit configuration file, pass configPath to the plugin.

File routing is the app client entry point. Generated entries live in the build output and are cleaned up after builds or when a build watcher closes.