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

@websublime/vite-plugin-open-api-devtools

v0.8.0

Published

DevTools SPA for vite-open-api-server - Vue-based debugging interface

Readme

@websublime/vite-plugin-open-api-devtools

Vue-based DevTools SPA for debugging and inspecting the OpenAPI mock server.

Features

  • Routes Page - Browse all available API endpoints from your OpenAPI spec
  • Timeline Page - Monitor request/response traffic in real-time
  • Models Page - View and edit in-memory store data
  • Simulator Page - Simulate errors and slow responses for testing

Installation

pnpm add @websublime/vite-plugin-open-api-devtools

Usage

The DevTools SPA is typically served automatically by the Vite plugin. However, you can also use it standalone for development:

Development

# Start the dev server
pnpm dev

# Build for production
pnpm build

# Type check
pnpm typecheck

Standalone Integration

import { bootstrap } from '@websublime/vite-plugin-open-api-devtools';
import '@websublime/vite-plugin-open-api-devtools/style.css';

// Mount the DevTools SPA
bootstrap();

Architecture

devtools-client/
├── src/
│   ├── App.vue              # Main layout with tabs
│   ├── main.ts              # Entry point
│   ├── router.ts            # Vue Router setup
│   │
│   ├── pages/
│   │   ├── RoutesPage.vue   # Endpoint listing
│   │   ├── TimelinePage.vue # Request/response log
│   │   ├── ModelsPage.vue   # Store data editor
│   │   └── SimulatorPage.vue# Error simulation
│   │
│   ├── components/          # Reusable UI components
│   │
│   ├── composables/
│   │   ├── useWebSocket.ts  # WebSocket connection (TODO)
│   │   └── useTheme.ts      # Dark/light mode
│   │
│   ├── stores/              # Pinia stores
│   │
│   └── assets/
│       └── main.css         # Global styles with OpenProps

Tech Stack

  • Vue 3 - Composition API with <script setup>
  • Pinia - State management
  • Vue Router - Navigation with hash history (for iframe compatibility)
  • OpenProps - CSS design tokens
  • Lucide Vue Next - Icon library
  • TypeScript - Type safety

Theming

The DevTools support both light and dark modes, automatically respecting system preferences. The theme can also be toggled programmatically:

import { useTheme } from '@websublime/vite-plugin-open-api-devtools';

const { isDark, toggleTheme, setTheme } = useTheme();

// Toggle between light and dark
toggleTheme();

// Set explicit theme
setTheme('dark');

// Use system preference
setTheme('system');

CSS Custom Properties

The DevTools expose CSS custom properties for customization:

:root {
  --devtools-primary: var(--blue-6);
  --devtools-bg: var(--gray-0);
  --devtools-surface: var(--gray-1);
  --devtools-text: var(--gray-9);
  /* ... and more */
}

API Reference

bootstrap()

Creates and mounts the Vue application. This function is idempotent - calling it multiple times has no effect after the first successful call.

import { bootstrap } from '@websublime/vite-plugin-open-api-devtools';
import '@websublime/vite-plugin-open-api-devtools/style.css';

const app = bootstrap();

Returns: App | null - The Vue app instance on first call, or null if already bootstrapped.

Notes:

  • Auto-bootstraps when #app element exists in DOM
  • Logs warning in development if called multiple times

useTheme()

Composable for theme management. Must be called within a Vue component's setup() function.

import { useTheme } from '@websublime/vite-plugin-open-api-devtools';

const { isDark, toggleTheme, setTheme, resetToSystem } = useTheme();

Returns:

| Property | Type | Description | |----------|------|-------------| | themeMode | ComputedRef<ThemeMode> | Current theme setting ('light', 'dark', or 'system') | | effectiveTheme | ComputedRef<'light' \| 'dark'> | Resolved theme after applying system preference | | isDark | ComputedRef<boolean> | Whether dark mode is currently active | | systemPrefersDark | ComputedRef<boolean> | Whether system prefers dark mode | | setTheme | (mode: ThemeMode) => void | Set theme to 'light', 'dark', or 'system' | | toggleTheme | () => void | Toggle between light and dark mode | | resetToSystem | () => void | Reset to follow system preference | | initialize | () => void | Manually initialize (for SSR hydration) |

Type:

type ThemeMode = 'light' | 'dark' | 'system';

Persistence: Theme preference is persisted to localStorage under the key openapi-devtools-theme.

Requirements

  • Node.js: ^20.19.0 || >=22.12.0
  • pnpm: 9.x

Related Packages

| Package | Description | |---------|-------------| | @websublime/vite-plugin-open-api-server | Vite plugin (main package) | | @websublime/vite-plugin-open-api-core | Core server, store, router, generator |

License

MIT