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

@tachui/registry

v0.8.5-alpha

Published

TachUI Modifier Registry - Singleton registry management for modifiers

Readme

@tachui/registry

Singleton registry management for TachUI modifiers. This package provides the single source of truth for modifier registration and ensures all packages use the same registry instance.

Installation

pnpm add @tachui/registry

Core API

Basic Usage

import { globalModifierRegistry } from '@tachui/registry'

// Register a custom modifier
globalModifierRegistry.register('customModifier', (props) => ({
  type: 'customModifier',
  priority: 100,
  properties: props,
  apply: (node, context) => {
    // Apply modifier logic
    return node
  }
}))

Convenience API

import { 
  registerModifier,
  hasModifier,
  listModifiers,
  validateRegistry,
  getModifier 
} from '@tachui/registry'

// Register a custom glassmorphism modifier
registerModifier('glassmorphism', (intensity: number) => ({
  type: 'glassmorphism',
  priority: 100,
  properties: { intensity },
  apply: (node, context) => {
    node.style.backdropFilter = `blur(${intensity}px)`
    node.style.background = 'rgba(255, 255, 255, 0.1)'
    return node
  }
}))

// Check if modifier exists
if (hasModifier('glassmorphism')) {
  console.log('Glassmorphism modifier is available')
}

// List all modifiers
console.log('Available modifiers:', listModifiers())

// Get registry health
const health = validateRegistry()
console.log(`Registry has ${health.totalModifiers} modifiers`)

Developer Extension Examples

Custom Animation Modifier

import { registerModifier } from '@tachui/registry'

registerModifier('slideIn', ({ direction = 'left', duration = '0.3s' }) => ({
  type: 'slideIn',
  priority: 200,
  properties: { direction, duration },
  apply: (node, context) => {
    const transform = {
      left: 'translateX(-100%)',
      right: 'translateX(100%)',
      up: 'translateY(-100%)',
      down: 'translateY(100%)'
    }[direction]

    node.style.transition = `transform ${duration} ease-out`
    node.style.transform = transform
    
    // Animate in
    requestAnimationFrame(() => {
      node.style.transform = 'translate(0, 0)'
    })
    
    return node
  }
}))

// Usage in components
// Text('Hello').slideIn({ direction: 'right', duration: '0.5s' }).build()

Plugin Development

// @company/tachui-animations package
import { registerModifier } from '@tachui/registry'

export function installAnimationPlugin() {
  registerModifier('fadeIn', createFadeInModifier)
  registerModifier('slideUp', createSlideUpModifier)
  registerModifier('bounce', createBounceModifier)
  
  console.log('Animation plugin installed')
}

function createFadeInModifier({ duration = '0.3s' }) {
  return {
    type: 'fadeIn',
    priority: 150,
    properties: { duration },
    apply: (node, context) => {
      node.style.opacity = '0'
      node.style.transition = `opacity ${duration} ease-in`
      
      requestAnimationFrame(() => {
        node.style.opacity = '1'
      })
      
      return node
    }
  }
}

Modifier Metadata & Type Generation

The registry can store metadata for each modifier. This powers automated type generation and conflict detection.

import { globalModifierRegistry } from '@tachui/registry'

// Enable metadata registration (on by default in development)
globalModifierRegistry.setFeatureFlags({ metadataRegistration: true })

globalModifierRegistry.registerMetadata({
  name: 'padding',
  plugin: '@tachui/core',
  priority: 100,
  signature: '(value: number) => Modifier',
  category: 'layout',
  description: 'Apply uniform padding around the component'
})

// Query metadata for tooling
const layoutModifiers = globalModifierRegistry.getModifiersByCategory('layout')
const conflicts = globalModifierRegistry.getConflicts()

Metadata registration can be disabled via the metadataRegistration feature flag to support incremental rollout.

Plugin Registration

Plugins can register their metadata so tooling can surface provenance and verification details.

globalModifierRegistry.registerPlugin({
  name: '@tachui/animations',
  version: '0.2.0',
  author: 'tachUI Team',
  verified: true
})

const plugins = globalModifierRegistry.listPlugins()
const animationsInfo = globalModifierRegistry.getPluginInfo('@tachui/animations')

Testing Support

import { 
  createIsolatedRegistry,
  resetRegistry,
  clearRegistry 
} from '@tachui/registry'

describe('My Component Tests', () => {
  beforeEach(() => {
    // Clear global registry for each test
    clearRegistry()
  })

  it('should work with isolated registry', () => {
    const isolatedRegistry = createIsolatedRegistry()
    
    // Register test-specific modifiers
    isolatedRegistry.register('testModifier', createTestModifier())
    
    // Test without affecting global registry
    expect(isolatedRegistry.has('testModifier')).toBe(true)
  })

  it('should reset registry completely', () => {
    registerModifier('testMod', createTestModifier())
    expect(listModifiers()).toContain('testMod')
    
    resetRegistry()
    expect(listModifiers()).toHaveLength(0)
  })
})

Development & Debugging

import { validateRegistry } from '@tachui/registry'

// Check registry health in development
if (process.env.NODE_ENV === 'development') {
  const health = validateRegistry()
  
  console.log('Registry Health:', {
    totalModifiers: health.totalModifiers,
    instanceId: health.instanceId,
    duplicates: health.duplicateNames
  })
  
  if (health.duplicateNames.length > 0) {
    console.warn('Duplicate modifiers detected:', health.duplicateNames)
  }
}

Type Safety

import type { ModifierFactory, Modifier } from '@tachui/registry'

// Define typed modifier factory
const createTypedModifier: ModifierFactory<{ size: number; color: string }> = 
  ({ size, color }) => ({
    type: 'typedModifier',
    priority: 100,
    properties: { size, color },
    apply: (node, context) => {
      node.style.fontSize = `${size}px`
      node.style.color = color
      return node
    }
  })

registerModifier('typedModifier', createTypedModifier)

Architecture

The registry uses a singleton pattern that ensures all packages import the same registry instance, regardless of how they're bundled or imported. This solves ESM module isolation issues that can break modifier functionality.

Key Benefits:

  • Single source of truth for all modifiers
  • Prevents duplicate registry instances
  • Supports custom modifier development
  • Provides testing utilities
  • Full TypeScript support

API Reference

Core Functions

  • globalModifierRegistry - The singleton registry instance
  • registerModifier<T>(name, factory) - Register a custom modifier
  • hasModifier(name) - Check if modifier exists
  • getModifier<T>(name) - Get modifier factory
  • listModifiers() - Get all modifier names
  • validateRegistry() - Get registry health information

Testing Functions

  • createIsolatedRegistry() - Create isolated registry for tests
  • resetRegistry() - Reset global registry (test-only)
  • clearRegistry() - Clear all modifiers (dev/test-only)

Types

  • ModifierRegistry - Registry interface
  • ModifierFactory<T> - Modifier factory function type
  • Modifier<T> - Modifier instance interface
  • ModifierContext - Context passed to modifiers
  • RegistryHealth - Registry diagnostic information