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

@lumeweb/portal-generators

v0.1.0

Published

Code generators for creating new portal plugins and utility libraries in the Lume Web monorepo. Powered by Turbo Gen and Plop.js.

Readme

@lumeweb/portal-generators

Code generators for creating new portal plugins and utility libraries in the Lume Web monorepo. Powered by Turbo Gen and Plop.js.

Features

  • Portal Plugin Generator - Scaffold complete portal plugins with Module Federation, routes, widgets, and optional API client setup
  • Library Generator - Create utility libraries with optional test setup and coverage configuration
  • Automatic Port Assignment - Automatically assigns available dev ports for new plugins
  • Template-Based - Uses Handlebars templates for consistent project structure
  • TypeScript Ready - All generated code includes proper TS configuration

Installation

This package is used as a development dependency in the monorepo. It's automatically available when running generator commands.

Usage

Generate a Portal Plugin

The portal plugin generator creates a full-featured plugin with:

  • Module Federation configuration
  • Vite dev server with automatic port assignment
  • Tailwind CSS setup
  • Optional route templates
  • Optional src-lib for library interface
  • Optional Orval API client generation
  • Widget registration support
pnpm turbo gen portal-plugin

Prompts:

  • Plugin name - Enter the name (e.g., my-plugin)
  • Include route templates? - Add route files (default: yes)
  • Routes - Comma-separated route names (default: dashboard,settings)
  • Include src-lib for library interface? - Add src-lib directory (default: no)
  • Include Orval for API client generation? - Add Orval config (default: no)
  • Include widget registrations? - Add widget setup (default: no)

Generated Structure:

libs/portal-plugin-my-plugin/
├── package.json
├── plugin.config.ts
├── vite.config.ts
├── tsconfig.json
├── tsdown.config.ts
├── tailwind.config.ts
├── postcss.config.cjs
├── orval.config.ts          (if Orval enabled)
├── src/
│   └── index.ts
│   └── capabilities/
│       └── refineConfig.ts
│   └── routes.tsx          (if routes enabled)
│   └── widgetRegistrations.ts
│   └── ui/
│       └── components/
│           └── index.ts
│       └── hooks/
│           └── index.ts
│       └── util/
│           └── index.ts
└── src-lib/                (if src-lib enabled)
    └── index.ts
    └── types/
        └── index.ts
    └── util/
        └── index.ts

Generate a Utility Library

The library generator creates a reusable utility library:

pnpm turbo gen lib

Prompts:

  • Library name - Enter the name (e.g., my-util)
  • Library description - Optional description
  • Include test setup? - Add Vitest configuration (default: yes)
  • Include test coverage configuration? - Add coverage config (default: no)
  • Catalog dependencies - Comma-separated catalog dependencies
  • Module exports - Comma-separated export paths

Generated Structure:

libs/my-util/
├── package.json
├── tsconfig.json
├── tsdown.config.ts
├── vitest.config.ts        (if tests enabled)
└── src/
    └── index.ts
    └── __tests__/
        └── setup.ts        (if tests enabled)

Automatic Port Assignment

The portal plugin generator automatically finds the next available dev port starting from 4178. It scans existing plugins in libs/portal-plugin-* to determine used ports and assigns the next available one.

Templates

Generator templates are located in src/templates/:

Portal Plugin:

  • portal-plugin-package.json.hbs
  • portal-plugin-config.ts.hbs
  • portal-plugin-vite.config.ts.hbs
  • portal-plugin-tsconfig.json.hbs
  • portal-plugin-tsdown.config.ts.hbs
  • portal-plugin-tailwind.config.ts.hbs
  • portal-plugin-postcss.config.cjs.hbs
  • portal-plugin-src-index.ts.hbs
  • portal-plugin-src-capabilities-refineConfig.ts.hbs
  • portal-plugin-src-routes.tsx.hbs
  • portal-plugin-src-widgetRegistrations.ts.hbs

Library:

  • lib-package.json.hbs
  • lib-src-index.ts.hbs
  • lib-vitest.config.ts.hbs
  • lib-tsconfig.json.hbs
  • lib-tsdown.config.ts.hbs

Development

Generators are automatically built as part of the monorepo's prepare script:

pnpm run prepare

API

genPortalPlugin()

Returns a Plop generator configuration for creating portal plugins.

genLib()

Returns a Plop generator configuration for creating utility libraries.

default(plop)

Main entry point that registers generators with Plop.js.

Contributing

When adding new features to generators:

  1. Create or update Handlebars templates in src/templates/
  2. Update generator functions in src/index.ts
  3. Test thoroughly with pnpm turbo gen

License

See LICENSE file for details.