@fayz-ai/plugin-admin

中文文档
0.9.72发布于 2026/11/11MITTypeScriptES Module近 30 天下载 7417

[experimental] Fayz SDK — admin shell settings plugin (read-only foundation)

原始使用文档
文档目录6 节
  1. Foundation status — read this first
  2. What's inside
  3. Install
  4. Usage
  5. Part of the Fayz SDK
  6. Roadmap & contributing

@fayz-ai/plugin-admin

A Panel view onto your app's own shell config — layout, module nav, and branding, at a glance.

npm license

Every SaaS/admin-template app already resolves a shell config — sidebar or topbar layout, rail or tabs for module navigation, a mobile header treatment, whether org/branding settings are shown — from FayzAppConfig (src/config/app.tsx / theme.ts) at build time. Today an operator can't see any of that from the Panel; changing it means hand-editing config files and redeploying. plugin-admin adds an /admin page that reflects the resolved config so it's visible without reading source.

Foundation status — read this first

This is a foundation pass, not a capability-complete plugin. It ships a read-only view of layout / moduleNav / mobileHeader / branding; there is no write path yet. The data provider (mock + Supabase stub) both simply echo back the statically resolved config — there is no shell-config table, and this plugin does not make FayzAppConfig.layout (or any of its siblings) mutable at runtime.

Follow-up: wire real read/write of these fields back into FayzAppConfig once a plugin-editable extension point exists for shell-level config. docs/saas/CUSTOMIZATION.md already names the gap — the saas shell's slot contracts (named layout/menu slots, published like the storefront's) are [planned FAY-1248/FAY-1196], the "persona/slots phase". plugin-admin's write path is a consumer of that phase, not a substitute for it: it should land once shell slots have a published contract to write through, not by having this plugin reach around defineSaas and mutate config ad hoc.

What's inside

  • An /admin page: read-only cards for layout, module navigation style, mobile header treatment, and branding visibility
  • Config mirrors FayzAppConfig 1:1 (layout, moduleNav, mobileHeader, navTransition, orgSettings, branding) — no new config shape
  • An AI tool, getShellSettings, so "what layout is this app using?" already works
  • Mock + Supabase data providers (both stubs today, chosen automatically) and full i18n

Install

npm install @fayz-ai/plugin-admin

Peer deps: react, react-dom. Runtime deps include @fayz-ai/core, @fayz-ai/ui, and @fayz-ai/admin.

Usage

import { defineSaas } from '@fayz-ai/admin'
import { createAdminPlugin } from '@fayz-ai/plugin-admin'

export const app = defineSaas({
  // ...
  layout: 'sidebar',
  moduleNav: 'tabs',
  plugins: [
    createAdminPlugin({
      layout: 'sidebar',
      moduleNav: 'tabs',
      mobileHeader: 'minimal',
      branding: true,
    }),
  ],
})

Pass the same values you already give defineSaas — the plugin doesn't derive them from the app config automatically (no such wiring exists yet); it just renders what you tell it.

Part of the Fayz SDK

Targets the saas/admin-template scaffold only (scaffolds: ['saas']) — this is Panel-side shell config, not a storefront concern. Pairs with whatever settings surface the app already exposes; it adds visibility, not a new settings system.

Roadmap & contributing

Built and evolving in the open. See the Fayz SDK roadmap and docs/saas/CUSTOMIZATION.md (persona/slots phase) for the write-path this is scaffolding toward.

版本与发布记录

@fayz-ai/plugin-admin 共发布 81 个版本,首次发布于 2026/07/14;过去 12 个月发布了 81 个版本。

版本发布日期距今
0.9.72latest2026/11/112 天前
0.9.712026/11/113 天前
0.9.702026/11/113 天前
0.9.692026/11/067 天前
0.9.682026/11/068 天前
0.9.672026/11/068 天前

其他发布通道:next → 0.9.0-next.1,canary → 0.9.63-canary.20261028153856。

关于 @fayz-ai/plugin-admin 的常见问题

@fayz-ai/plugin-admin 是什么?

[experimental] Fayz SDK — admin shell settings plugin (read-only foundation)

如何安装 @fayz-ai/plugin-admin?

在项目目录运行 npm install @fayz-ai/plugin-admin,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.0.0 || ^19.0.0)、zustand(^4.5.0 || ^5.0.0)、react-dom(^18.0.0 || ^19.0.0)、lucide-react(>=0.400.0 <1.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fayz-ai/plugin-admin 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fayz-ai/plugin-admin 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@fayz-ai/plugin-admin 可以商用吗?

@fayz-ai/plugin-admin 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fayz-ai/plugin-admin 的下载量有多少?

根据 npm 官方下载统计,@fayz-ai/plugin-admin 在 2026/10/15 – 2026/11/13 这 30 天内被下载 7,417 次,日均约 247 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fayz-ai/plugin-admin 还在维护吗?

最新版本 0.9.72 发布于 2026/11/11(2 天前);至今共发布 81 个版本,其中过去 12 个月发布了 81 个;首次发布于 2026/07/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。