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

@ptahjs/admin-vue-vapor

v0.0.3

Published

Readme

@ptahjs/admin-vue-vapor

Vue 3.6 (vapor / JSX) adapter for @ptahjs/admin-core. Bridges the framework-neutral Engine and its stores to Vue's reactivity, and ships the layout components and composable hooks that a Vue admin app needs.

Features

  • createAdminApp(config) — Vue plugin that instantiates AdminApp (with framework: "vue" default), injects framework-level i18n (admin.* namespace), and optionally wires the auth-refresh strategy
  • useEngineStore(store) — bridges any core store (router / auth / tabs / preferences / menu / ...) to a Vue ref; subscribes immediately (no timing gap) and auto-cleans up via onScopeDispose
  • Composable hooksuseAdminEngine / useI18n / useMenus / useTabs / usePreferences / useAuth / useRouter / usePermissionConfig / useLoading / useNotify / usePermission
  • Layout componentsAdmin, MenuTree, TabsBar, Breadcrumb, ErrorBoundary, LoadingBar, NotifyHost, AccessControl, ExceptionPage, EngineRouterView
  • Access directive + global error handler — installed as part of createAdminApp
  • Re-exports getEngine from @ptahjs/admin-core for convenience

Installation

pnpm add @ptahjs/admin-vue-vapor

Dependencies: @ptahjs/admin-core, vue (catalog), vue-jsx (catalog), @ptahjs/build.

Quick start

// main.js
import { createApp } from "vue";
import { createAdminApp } from "@ptahjs/admin-vue-vapor";
import { authApi, setAuthStrategy } from "./business/auth"; // your business layer
import modules from "./modules";

const app = createApp();
app.use(
    createAdminApp({
        modules,
        locale: "zh",
        session: { restore: async () => await fetch("/api/session").then((r) => r.json()) },
        menu: { fetch: async () => await fetch("/api/menus").then((r) => r.json()) },
        auth: { refresh: authApi.refresh, register: setAuthStrategy }, // optional
    }),
);
app.mount("#app");
<script setup>
import { useAuth, useMenus, useTabs } from "@ptahjs/admin-vue-vapor";

const auth = useAuth();
const menus = useMenus();
const tabs = useTabs();
</script>

<template>
    <Admin />
</template>

Components

| Component | Description | | ------------------ | ----------------------------------------------------------------------- | | Admin | Root admin shell — wires layout, route outlet, notify host, loading bar | | MenuTree | Sidebar menu tree | | TabsBar | Open tabs bar | | Breadcrumb | Current-location breadcrumb | | LoadingBar | Top loading bar bound to LoadingStore | | NotifyHost | Notification renderer bound to NotifyStore | | AccessControl | Permission-aware conditional render | | ExceptionPage | 403 / 404 / 500 render | | ErrorBoundary | Captures render errors in children | | EngineRouterView | Route outlet bound to engine.router |

Hooks

import {
    useAdminEngine,
    useI18n,
    useMenus,
    useTabs,
    usePreferences,
    useAuth,
    useRouter,
    usePermissionConfig,
    useLoading,
    useNotify,
    usePermission,
} from "@ptahjs/admin-vue-vapor";

All hooks are thin wrappers around useEngineStore(engine.<store>) plus selectors / actions. useEngineStore is the bridge — use it directly for any custom store:

import { useEngineStore, useAdminEngine } from "@ptahjs/admin-vue-vapor";

const engine = useAdminEngine();
const routerState = useEngineStore(engine.router); // Vue ref

Auth refresh wiring

admin-vue-vapor is a framework core package — it must not import your business auth layer. Instead, inject the refresh API from the host:

createAdminApp({
    auth: {
        refresh: authApi.refresh, // (token) => freshSession
        register: setAuthStrategy, // hook to mount your strategy
    },
});

When both are provided, admin-vue-vapor packages the "on refresh success → login, on failure → logout + notify" engine logic via buildAuthStrategy and hands it to your register. If auth is omitted, no refresh is wired.

License

MIT