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

@sucoza/devtools-importer

v0.1.9

Published

Simplified Vite plugin for importing and configuring TanStack DevTools plugins

Readme

@sucoza/devtools-importer

A simplified Vite plugin for importing and configuring TanStack DevTools plugins with automatic port management and configuration.

Features

  • Dynamic Plugin Loading: Automatically imports and loads your specified DevTools plugins
  • Port Management: Automatically finds available ports or uses specified ports
  • React Component: Pre-built React component for rendering plugin panels
  • TypeScript Support: Full TypeScript support with proper type definitions
  • Development Optimized: Only loads in development by default (configurable)

Installation

npm install @sucoza/devtools-importer

Usage

⚠️ Important Setup Requirements

  1. The Vite plugin MUST be placed FIRST in the plugins array - This ensures proper initialization before other plugins
  2. The DevToolsManager component should be placed as HIGH as possible in your React tree - Ideally in your root App component or index file

Vite Configuration

// vite.config.js
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { tanstackDevtoolsImporter } from '@sucoza/devtools-importer';

export default defineConfig({
  plugins: [
    // ⚠️ IMPORTANT: tanstackDevtoolsImporter MUST be first!
    tanstackDevtoolsImporter({
      plugins: [
        '@sucoza/api-mock-interceptor-devtools-plugin',
        '@sucoza/websocket-signalr-devtools-plugin',
        '@sucoza/memory-performance-profiler-devtools-plugin'
      ],
      config: {
        defaultOpen: false,
        position: 'bottom-right', // TanStack DevTools position
        hideUntilHover: true,
        panelLocation: 'bottom'
      },
      port: { min: 40000, max: 49999 }, // or specify a fixed port: 3001
    })
  ],
});

React Component

// App.tsx
import React from 'react';
import { DevToolsManager } from '@sucoza/devtools-importer/react';

function App() {
  return (
    <div>
      <h1>My Application</h1>
      
      {/* DevTools configured in vite.config.js, will only render in development */}
      <DevToolsManager />
    </div>
  );
}

export default App;

Advanced Usage

// Custom DevTools setup with error handling
import React from 'react';
import { DevToolsManager } from '@sucoza/devtools-importer/react';

function App() {
  return (
    <div>
      <DevToolsManager
        onError={(error) => console.error('DevTools Error:', error)}
        onPluginLoad={(pluginId) => console.log('Loaded plugin:', pluginId)}
        className="my-devtools"
      />
    </div>
  );
}

Configuration Options

Vite Plugin Options

interface TanstackDevtoolsImporterOptions {
  // Required: List of plugin import paths
  plugins: string[];
  
  // Optional: DevTools core configuration
  config?: Partial<TanStackDevtoolsConfig>;
  
  // Optional: Event bus configuration
  eventBusConfig?: Partial<ServerEventBusConfig>;
  
  // Optional: Enhanced logging toggle
  enhancedLogs?: { enabled: boolean };
  
  // Optional: Port configuration
  port?: number | { min: number; max: number };
  
  // Optional: Enable in production (default: false)
  enableInProd?: boolean;
  
  // Optional: Virtual module ID prefix (default: "virtual:tdi")
  virtualIdBase?: string;
}

React Component Props

interface DevToolsManagerProps {
  // Optional: Custom className
  className?: string;
  
  // Optional: Error handler
  onError?: (error: Error) => void;
  
  // Optional: Plugin load handler
  onPluginLoad?: (pluginId: string) => void;
}

The DevToolsManager uses the TanStack DevTools configuration passed through the Vite plugin, including position, styling, and behavior options.

Virtual Modules

The plugin creates virtual modules that you can import:

// Access plugin loaders
import { pluginLoaders, pluginIds } from 'virtual:tdi/plugins';

// Access resolved configuration
import { devtoolsConfig } from 'virtual:tdi/config';

Examples

Basic Setup

// vite.config.js
export default defineConfig({
  plugins: [
    tanstackDevtoolsImporter({
      plugins: ['@sucoza/api-mock-interceptor-devtools-plugin']
    })
  ]
});

Multiple Plugins with Custom Port

// vite.config.js  
export default defineConfig({
  plugins: [
    tanstackDevtoolsImporter({
      plugins: [
        '@sucoza/api-mock-interceptor-devtools-plugin',
        '@sucoza/websocket-signalr-devtools-plugin',
        '@sucoza/render-waste-detector-devtools-plugin'
      ],
      port: 3001,
      config: {
        defaultOpen: true,
      }
    })
  ]
});

Production Build

// vite.config.js
export default defineConfig({
  plugins: [
    tanstackDevtoolsImporter({
      plugins: ['@sucoza/api-mock-interceptor-devtools-plugin'],
      enableInProd: true, // Enable in production builds
    })
  ]
});

Development

# Install dependencies
npm install

# Build the package
npm run build

# Watch mode for development
npm run dev

# Type checking
npm run typecheck

# Linting
npm run lint

License

MIT