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

@kakaocloud/mocking-gui

v1.0.1

Published

GUI library for MSW-based API mocking with an interactive panel

Downloads

131

Readme

Mocking GUI

Mocking GUI is a GUI library based on MSW (Mock Service Worker) that provides a dedicated DevTools panel for managing mocks, testing scenarios, and inspecting Swagger/OpenAPI integrations.

Features

  • MSW Integration: Zero-config mocking based on MSW.
  • GUI Control: Toggle mocks, change response variants, and inject delays in real-time.
  • Swagger/OpenAPI Support: Automatically generate mocks from Swagger JSON.
  • Shareable Scenarios: Group specific mock states into "Scenarios" for easy reproduction.
  • Server-side Sync: Sync browser mock state to server components via cookies (prevents Hydration errors).

Tech Stack

  • React + TypeScript
  • MSW (Mock Service Worker)
  • Tailwind CSS + shadcn/ui
  • Vite

Requirements

  • Node.js >= 22.0.0
  • pnpm >= 9.0.0
  • React >= 19.2.1

Installation

# Install dependency
$ pnpm add -D @kakaocloud/mocking-gui

Usage

1. Configuration (Recommended)

Create a configuration file (e.g., config.ts) to manage your mock settings.

// config.ts
import type { MockingConfig } from '@kakaocloud/mocking-gui';

export const mockingConfig: MockingConfig = {
  // 1. Mocks: Define your manual key-based request handlers
  mocks: [
    // ... your MSW handlers or handler state objects
  ],

  // 2. onDemandHandlers: Native MSW RequestHandlers (NOT GUI Controlled)
  // Useful for GraphQL, WebSocket or handlers that you don't want to control via GUI.
  onDemandHandlers: [...graphqlHandlers],

  // 3. Swagger: Configure Swagger sources for auto-generated mocks
  swagger: [
    {
      name: 'My Service API',
      configUrl: 'https://api.example.com/swagger/doc.json',
      serverUrl: 'https://api.example.com',
    },
  ],

  // 4. Worker: Configure the MSW Service Worker
  worker: {
    serviceWorker: {
      /**
       * The URL path where the MSW Service Worker script is served.
       * Defaults to '/mockServiceWorker.js'.
       */
      url: `${SERVICE_BASE_PATH}/mockServiceWorker.js`,
      options: {
        scope: './',
      },
    },
    onUnhandledRequest: 'bypass',
  },
};

2. Integration

Import MockingGUIBoundary and use it in your root component (e.g., _app.tsx or main.tsx).

import { MockingGUIBoundary } from '@kakaocloud/mocking-gui/browser';
import { MockingConfig } from './mocking-gui.config';

function App() {
  return (
    <>
      <MockingGUIBoundary config={MockingConfig} />
      <AppContent />
    </>
  );
}

Development

# Install dependencies
$ pnpm i

# Initialize MSW
$ npx msw init <PUBLIC_DIR> [options]

# Start development server
$ pnpm dev

# Build
$ pnpm build

Project Structure

src/
├── components/     # UI components
├── hooks/          # Logic hooks (useSetupMockingGUIWorker, etc.)
├── store/          # State management
├── styles/         # CSS files
├── utils/          # Helper functions
├── browser.ts      # Browser entry point
└── index.ts        # Main entry point