Gopherium's admin kit
GodMin is the base layer for a React admin application built on the WordPress Design System. It handles the groundwork such an application needs before its first screen renders: loading the design tokens, ordering the CSS, keeping overlays on top, and preparing your bundler and your test runner.
The design system already ships the tokens, the primitives, the data screens and the page chrome. Inside WordPress, the glue underneath them comes from WordPress itself. An application that is not WordPress gets nothing, and ends up hand-writing that glue. GodMin is the glue as a package, and nothing more.
pnpm add @gopherium/godminThe design system packages are peer dependencies, so your application resolves and pins them. GodMin never redistributes them.
Import the stylesheet once at your entry point, then mount AdminRoot around
your tree.
import '@gopherium/godmin/base.css'
import { AdminRoot } from '@gopherium/godmin'
createRoot(document.getElementById('app')!).render(
<AdminRoot>
<YourApp />
</AdminRoot>,
)That is the whole host setup. See the overview for what those two lines do for you.
| Entry point | Contents |
|---|---|
@gopherium/godmin |
AdminRoot, Frame, Page, PageTitle, NavScreen, ErrorNotice, LoadMore, LogList, LogItem, LogTime, LoadingScreen, LoadingRows, Toaster, useToaster, RepeatRows, RowControls, useRowKeys, keyFromLabel, useMediaQuery, useTokenDocument, the breakpoints, SUPPORTED_WPDS |
@gopherium/godmin/base.css |
Cascade layer order, design tokens, host rules, frame and screen styles |
@gopherium/godmin/router |
useCanvas, useFrameLocation, the canvas route static data |
@gopherium/godmin/testing |
installTestEnvironment, renderAdmin, setViewport, getAnnouncement, clearAnnouncements, assertElementPatched, WPDS_IGNORE_SELECTOR |
@gopherium/godmin/vite |
godminDedupe, godminSingleCopy, godminStylesheetFirst, duplicateCopies, hoistStylesheet |
@gopherium/godmin/stylelint |
The design system stylelint rules |
Duplicate packages break the application, and nothing points at the cause. Build configuration covers it.
Two copies of React throw on the first hook. Two copies of @wordpress/theme
render unthemed components with no error. Spread godminDedupe into
resolve.dedupe and add the godminSingleCopy() plugin.
Peer ranges are longhand and single window, for example >=0.22.0 <0.23.0.
The window moves with each design system release train and never widens, so no
release accepts two breaking generations at once. SUPPORTED_WPDS exports the
window this build was tested against.
Still 0.x, so minor releases may break. See the CHANGELOG for what each release
adds. @wordpress/admin-ui remains the thing to watch: GodMin does not wrap
it, because a kit that wraps an API still moving adds a release hop to every
upstream fix.
Apache-2.0, see LICENSE.
The design system packages this kit expects you to install are GPL-2.0-or-later. GodMin declares them as peer dependencies, so your application resolves them and GodMin never redistributes them. Your built bundle combines both, and is conveyed under the terms of the WordPress packages. GodMin's own source stays reusable under plain Apache-2.0. NOTICE carries the same statement for anyone reading only the published tarball.