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

@ripple-ts/adapter-vercel

v0.2.216

Published

Vercel adapter for Ripple metaframework (Build Output API v3)

Readme

@ripple-ts/adapter-vercel

Vercel adapter for the Ripple metaframework.

Deploys your Ripple SSR application to Vercel using the Build Output API v3.

Installation

pnpm add @ripple-ts/adapter-vercel

Usage

ripple.config.ts

import { defineConfig } from '@ripple-ts/vite-plugin';
import { serve, runtime } from '@ripple-ts/adapter-vercel';
import { routes } from './src/routes.ts';

export default defineConfig({
  adapter: { serve, runtime },
  router: { routes },
});

Build & Deploy

The adapter generates Vercel's Build Output API v3 structure.

Option 1: Post-build CLI

pnpm vite build && ripple-adapt-vercel

Or add to your package.json:

{
  "scripts": {
    "build": "vite build",
    "vercel-build": "vite build && ripple-adapt-vercel"
  }
}

Option 2: Use adapt() programmatically

import { adapt } from '@ripple-ts/adapter-vercel';

await adapt({
  outDir: 'dist',
  // options...
});

Options

| Option | Type | Default | Description | | ------------------------ | -------------------- | ------------- | ------------------------------------------------------------------------ | | outDir | string | 'dist' | Build output directory (from vite build) | | serverless | ServerlessConfig | {} | Serverless function configuration | | serverless.runtime | string | auto-detected | Node.js runtime version ('nodejs20.x', 'nodejs22.x', 'nodejs24.x') | | serverless.regions | string[] | undefined | Deployment regions | | serverless.memory | number | undefined | Memory (MB) allocated to the function | | serverless.maxDuration | number | undefined | Maximum execution time (seconds) | | isr | ISRConfig \| false | false | Incremental Static Regeneration config | | isr.expiration | number \| false | — | Seconds before background revalidation (false = never expire) | | isr.bypassToken | string | undefined | Token to bypass the ISR cache | | isr.allowQuery | string[] | undefined | Query params included in the cache key (empty = ignore query) | | images | ImagesConfig | undefined | Vercel Image Optimization config | | headers | VercelHeader[] | [] | Custom response headers | | redirects | VercelRedirect[] | [] | Custom redirects | | rewrites | VercelRewrite[] | [] | Additional rewrites (prepended before catch-all) | | cleanUrls | boolean | true | Remove .html extensions from URLs | | trailingSlash | boolean | undefined | Enforce trailing slash behavior |

How It Works

  1. vite build produces dist/client/ (static assets) and dist/server/entry.js (server bundle)
  2. adapt() restructures the output into .vercel/output/:
    • Copies dist/client/.vercel/output/static/
    • Creates a serverless function at .vercel/output/functions/index.func/
    • Generates .vercel/output/config.json with routing rules
    • Uses @vercel/nft to trace and bundle server dependencies

The generated structure:

.vercel/output/
├── config.json                    # Build Output API v3 config
├── static/                        # Static files (served by Vercel CDN)
│   ├── assets/
│   ├── index.html
│   └── ...
└── functions/
    └── index.func/                # Serverless function
        ├── index.js               # Handler entry point
        ├── .vc-config.json        # Function configuration
        ├── package.json           # ESM marker
        └── ... (traced deps)

Local Development

The adapter re-exports serve and runtime from @ripple-ts/adapter-node, so local development with vite dev and ripple-preview works exactly the same as with adapter-node.

Incremental Static Regeneration (ISR)

Enable ISR to let Vercel cache serverless responses at the edge and revalidate them in the background:

await adapt({
  isr: {
    // Re-generate cached pages every 60 seconds
    expiration: 60,
  },
});

Never-expiring cache (only revalidated via on-demand revalidation):

await adapt({
  isr: {
    expiration: false,
    bypassToken: process.env.REVALIDATION_TOKEN,
  },
});

Cache key control — only include specific query parameters:

await adapt({
  isr: {
    expiration: 300,
    allowQuery: ['page', 'q'], // /search?q=foo and /search?q=bar are cached separately
  },
});

The ISR config is emitted as a prerender field in the function's .vc-config.json, following Vercel's Build Output API v3 prerender configuration.

Vercel Configuration

No vercel.json configuration is needed — the adapter generates all necessary routing rules via the Build Output API.

If you do have a vercel.json, the adapter respects your buildCommand and outputDirectory settings. Set your build command to run the adapter:

{
  "buildCommand": "pnpm vite build && pnpm ripple-adapt-vercel"
}