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

@zhin.js/pagemanager

v2.0.23

Published

Zhin PageManager Host runtime: entries, esbuild pipeline (no UI; contract in @zhin.js/contract)

Readme

@zhin.js/pagemanager

Remote Console Node 侧运行时:PageManager、EntryStore、GET /entries、esbuild 打包与 /@dev 开发资源路由。无 UI;契约在 @zhin.js/contract,浏览器 SDK 在 @zhin.js/client

路径约定:本包位于 packages/console/pagemanager/。源码在 src/node/,构建产物在 lib/node/

分层

Console 栈概览

@zhin.js/contract  →  @zhin.js/pagemanager  →  @zhin.js/client  →  zhin-console(独立仓库)

领域术语与关系图见 CONTEXT.md

安装

Monorepo 内 workspace 依赖;对外发布时:

pnpm add @zhin.js/pagemanager

主要导出

| 导出 | 用途 | |------|------| | PageManager | 控制台服务端运行时;拥有 EntryStore,注册 Console Entry | | mountConsoleRouter | 挂载 entries 与静态/dev 资源路由 | | createInMemoryEntryStore / EntryStore | Entry 目录 | | buildEntriesResponse / rewriteEntriesForClient | 序列化 GET /entries 响应 | | attachConsoleClientHost | 将 Console 路由挂到现有 Koa Host | | serverRuntimeEnv | development / production 运行时标记 |

类型(ConsoleServerOptionsPluginServerRegisterHostApi 等)自 ./consoleServerOptions.js 导出。

Plugin Runtime

@zhin.js/pagemanager/plugin-runtime 提供 snapshot-coherent 的 ConsoleRuntime。一次 runView() 在完整回调期间持有同一 generation lease,route guard、权限过滤、Navigation 树和 Layout fallback chain 都从同一个 Page/Layout projection 读取;回调结束后 catalog 失效,避免浏览器模块 URL 跨 generation 逃逸。

该子路径不引入 React、Router 或客户端编译器。Page 与 Layout 的约定式发现分别由 @zhin.js/page@zhin.js/layout 提供,wire types 来自零依赖 @zhin.js/console-contract

Client Build

@zhin.js/pagemanager/client-build 是可选的 TypeScript AST/build adapter。它静态提取 definePage() 的 JSON-like metadata,生成 content-hash ESM 与 pages.manifest.json,生产 loader 不记录构建机绝对路径。

TypeScript 是 optional peer,不进入默认 PageManager 或 Plugin Runtime 的生产闭包。 选择该子路径的构建 workspace 需要显式安装兼容版本的 typescript

插件注册 Entry

在插件 Node 侧通过 web 上下文获取 PageManager 实例(非静态全局):

useContext('web', (pageManager) => {
  pageManager.addEntry({
    id: 'my-plugin',
    name: 'My Plugin',
    dev: '/@dev/plugins/my-plugin/client/index.tsx',
    prod: '/@assets/my-plugin/client/index.js',
  });
});

浏览器侧由 @zhin.js/clientloadConsoleEntries 拉取并动态 import

构建

pnpm --filter @zhin.js/pagemanager build

相关文档