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

@ortha/admin-platform-plugin-registry

v0.0.4

Published

The foundational types and service factories for the Ortha admin plugin system. Every admin package depends on this — it defines the plugin contract, provides the plugin registry, routing and slot services, validation, and topological sort for dependency

Readme

@ortha/admin-platform-plugin-registry

The foundational types and service factories for the Ortha admin plugin system. Every admin package depends on this — it defines the plugin contract, provides the plugin registry, routing and slot services, validation, and topological sort for dependency resolution.

Installation

Internal monorepo dependency — import directly:

import type {
    AdminPlugin,
    AdminPluginContext
} from '@ortha/admin-platform-plugin-registry';
import {
    pluginRegistry,
    routerService,
    slotService
} from '@ortha/admin-platform-plugin-registry';

Usage

Defining a plugin

import type { AdminPlugin } from '@ortha/admin-platform-plugin-registry';

const myPlugin = (): AdminPlugin =>
    Object.freeze({
        id: 'my-plugin',
        name: 'My Plugin',
        dependencies: ['core'],
        setup(ctx) {
            ctx.router.addRoute({
                path: '/my-page',
                component: MyPage
            });
            ctx.slots.fill(SLOT_TOPBAR_NAV_MAIN_ACTIONS, MyNavButton, {
                order: 10
            });
        }
    });

Creating services

import {
    pluginRegistry,
    routerService,
    slotService,
    pluginContext
} from '@ortha/admin-platform-plugin-registry';

const registry = pluginRegistry();
const router = routerService();
const slots = slotService();

// Create a scoped context for a specific plugin
const ctx = pluginContext({
    pluginId: 'my-plugin',
    registry,
    router,
    slots,
    config: {}
});

Validation and load ordering

import {
    validate,
    resolveLoadOrder
} from '@ortha/admin-platform-plugin-registry';

// Validate plugins before setup
validate(plugins);

// Resolve topological order based on dependencies
const sorted = resolveLoadOrder(plugins);

API Reference

Types

| Export | Kind | Description | | --------------------- | ---- | ------------------------------------------------------------------------ | | AdminPlugin | type | Contract every plugin must satisfy (id, name, setup) | | AdminPluginContext | type | DI context passed to setup()registry, router, slots, config | | AdminPluginRegistry | type | Central registry — register(), get(), getAll(), isRegistered() | | RouteDefinition | type | Route descriptor (path, component, meta) | | SlotDefinition | type | Slot fill descriptor (key, component, order) | | SlotFill | type | Resolved fill stored by SlotService | | RouterService | type | Route collection — addRoute(), getRoutes() | | SlotService | type | Slot management — fill(), getSlot(), getAll() | | AdminConfig | type | Open config object (basePath, debug, extensible) |

Factories

| Export | Kind | Description | | ------------------ | ------- | --------------------------------------------------------- | | pluginRegistry() | factory | Creates a Map-backed plugin registry | | routerService() | factory | Creates a route collection service | | slotService() | factory | Creates a slot management service (auto-sorts by order) | | pluginContext() | factory | Creates a scoped context for a single plugin's setup() |

Utilities

| Export | Kind | Description | | -------------------- | ---- | ------------------------------------------------------------ | | validate() | util | Checks required fields, duplicate IDs, and resolvable deps | | resolveLoadOrder() | util | Topological sort via Kahn's algorithm; detects circular deps |

Internal Structure

src/lib/
├── types/index.ts              # All shared type definitions
├── pluginRegistry/index.ts     # Map-backed registry factory
├── pluginContext/index.ts       # Scoped context builder
├── services/
│   ├── index.ts                # Barrel
│   ├── routerService/index.ts  # Route collection
│   └── slotService/index.ts    # Slot fill management
└── utils/
    ├── index.ts                # Barrel
    ├── validate/index.ts       # Plugin validation
    └── resolveLoadOrder/index.ts # Kahn's topological sort

Key Patterns

  • All factory return values are frozen with Object.freeze().
  • validate() runs before any services are instantiated — fail fast.
  • resolveLoadOrder() uses Kahn's algorithm; throws on circular dependencies.
  • pluginContext() wraps SlotService.fill() to auto-inject the calling plugin's ID.
  • Plugins must never import each other directly — all cross-plugin communication goes through context services.

Building

nx build admin-platform-plugin-registry