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

@tailor-platform/sdk-plugin-frontend

v0.1.0

Published

Build and deploy frontend assets after Tailor Platform deployments

Readme

Frontend Plugin

frontendPlugin builds frontend assets and uploads them to Static Websites after tailor deploy applies your application. It can provide deployed URLs and public OAuth client IDs as build environment variables.

Installation

pnpm add -D @tailor-platform/sdk-plugin-frontend

Use an SDK version that supports onDeployed hooks. When testing a PR before that SDK release, install both the SDK and frontend plugin from the same pkg.pr.new commit.

Monorepo example

Given this layout:

apps/
  backend/
    tailor.config.ts
  web/
    package.json
    dist/

Register the plugin in apps/backend/tailor.config.ts:

import { defineConfig, definePlugins, defineStaticWebSite } from "@tailor-platform/sdk";
import { frontendPlugin } from "@tailor-platform/sdk-plugin-frontend";

const website = defineStaticWebSite("my-frontend", { description: "Web app" });

export default defineConfig({
  name: "my-app",
  staticWebsites: [website],
});

export const plugins = definePlugins(
  frontendPlugin({
    site: website,
    workingDir: "../web",
    build: "pnpm run build",
    distDir: "dist",
    env: ({ site, application }) => ({
      ...(application.url ? { VITE_TAILOR_APP_URL: application.url } : {}),
      VITE_SITE_URL: site.url,
      VITE_OAUTH2_CLIENT_ID:
        application.auth?.oauth2Clients.find((client) => client.name === "web")?.clientId ?? "",
    }),
  }),
);

Run tailor deploy --config apps/backend/tailor.config.ts from the repository root. workingDir is where build runs, relative to the config's directory, so this example builds in apps/web. distDir is the directory your build writes its assets to, relative to workingDir, so this example publishes apps/web/dist. Set it to match your build tool's output setting; the plugin does not change where the build writes. Omitting workingDir uses the config's directory. Absolute paths are also accepted.

site accepts either a defineStaticWebSite() result or a site name. The site must be declared in staticWebsites of the same config that registers frontendPlugin. With multiple configs, register each frontend in the config that declares its site; a site from another config fails before the build starts. The env callback can still read the URLs of other configs' sites from applications.

Build environment

env is an optional function that returns environment variables, synchronously or asynchronously. Its values override matching variables inherited from the parent process. Choose variable names for your frontend framework; the plugin does not add a prefix.

The callback receives the destination site, the registering application, all applications in the deploy, and workspaceId. Each application lists its static websites by name under staticWebsites, so application.staticWebsites.admin?.url reads another site of the same config. Only public OAuth client IDs are provided. Values embedded into browser assets are visible to visitors, so supply only values intended for public use.

Build commands run in a shell. Their stdout and stderr both go to stderr, keeping tailor deploy --json stdout available for the JSON result. Builds have no timeout.

Upload existing assets

Omit build to upload an existing directory:

export const plugins = definePlugins(
  frontendPlugin({ site: "my-frontend", workingDir: "../web", distDir: "dist" }),
);

For multiple frontends, pass each one as another argument, as in frontendPlugin(web, admin); register the plugin only once. Each site may appear only once. Frontends are built and uploaded sequentially, in argument order. At least one frontend is required, and each distDir must be non-empty. A build that is empty or only whitespace is rejected; omit build instead to publish without building.

Deploy behavior and failures

The plugin runs even if no platform resources changed. It does not run during dry-run, build-only, generation, or migration test deployments. Dry-run lists the plugin as a pending deploy hook.

An unknown site, a site declared in another config, failed build, missing output directory, or failed upload stops later frontends and deploy hooks. Platform resources have already been applied; fix the error and run tailor deploy again. Successfully uploaded frontends are not rolled back. Skipped upload files produce warnings and are listed in the result.

With --json, the result contains a deployedHooks entry for @tailor-platform/frontend. Its outputs.frontends array contains each site's site, published url, and skippedFiles.

The same deploy result includes workspaceId and applications, including each config's Static Website URLs, AI Gateway URLs, and public OAuth client IDs. The application endpoint URL and domain are present when a Platform Application with the config's name exists. Read these directly from tailor deploy --json; a separate show command is not required.