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

@miurajs/miura-vite

v0.1.3

Published

Vite plugins for the miura framework.

Readme

@miurajs/miura-vite

Vite plugins for the miura framework.

islandsPlugin() — Islands prerender

At build time, scans all HTML files for <miura-island> elements and:

  1. Injects <script type="application/json"> with serialised component props when absent.
  2. Adds the hydrate attribute if missing (uses component config default or "load").
  3. Merges config-level default props with any props already in the HTML (HTML wins).
  4. Injects a placeholder element when the island body is otherwise empty.
  5. Emits an islands.manifest.json asset listing every island found across the build.

Quick Start

// vite.config.ts
import { defineConfig } from 'vite';
import { islandsPlugin } from '@miurajs/miura-vite';

export default defineConfig({
  plugins: [
    islandsPlugin({
      components: {
        'my-counter': {
          props: { count: 0 },
          hydrate: 'load',
          placeholder: '<my-counter count="0">0</my-counter>',
        },
        'app-chart': {
          props: { data: [] },
          hydrate: 'visible',
          placeholder: (props) => `<div class="chart-ph">Loading (${props.data?.length ?? 0} items)…</div>`,
        },
        'like-button': {
          props: { liked: false },
          hydrate: 'idle',
        },
      },
      placeholder: (component) => `<span class="island-ph">${component}</span>`,
      manifest: 'islands.manifest.json',
      verbose: true,
    }),
  ],
});

Options

| Option | Type | Default | Description | |---|---|---|---| | components | Record<string, IslandComponentConfig> | {} | Per-component defaults for props, hydrate, and placeholder. | | placeholder | (component, props) => string | — | Global fallback placeholder factory. | | manifest | string \| false | "islands.manifest.json" | Output path for the manifest asset. Set false to disable. | | verbose | boolean | true (if manifest enabled) | Log island summary during build. |

IslandComponentConfig

| Field | Type | Description | |---|---|---| | props | Record<string, unknown> | Default props merged with any already in the HTML. | | hydrate | string | Default hydrate attribute value. | | placeholder | string \| (props) => string | Static HTML or factory to inject when the island body is empty. |

Example Transform

Input HTML (from developer or SSG):

<miura-island component="my-counter"></miura-island>

Output HTML (after Vite build):

<miura-island component="my-counter" hydrate="load">
  <script type="application/json">{"count":0}</script>
  <my-counter count="0">0</my-counter>
</miura-island>

Manifest Output

islands.manifest.json (emitted to outDir):

{
  "generatedAt": "2026-03-12T15:00:00.000Z",
  "total": 3,
  "entries": [
    { "component": "my-counter", "hydrate": "load",    "count": 1 },
    { "component": "app-chart",  "hydrate": "visible", "count": 1 },
    { "component": "like-button","hydrate": "idle",    "count": 1 }
  ]
}

Notes

  • Non-nested islands only — the HTML transform uses a non-greedy regex and does not support <miura-island> elements nested inside other <miura-island> elements. For deeply nested cases, use createIslandHTML() from @miurajs/miura-element/server at the template level.
  • The plugin runs enforce: 'pre' so it processes HTML before other plugins.

License

MIT