JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 59
  • Score
    100M100P100Q62221F
  • License UNLICENSED

CLI generator for React 19 + Ant Design 6 + React Router 7 + Vite 8 management console projects.

Package Exports

  • create-admin-platform

Readme

create-admin-platform

CLI generator for the admin-platform-starter scaffold. Produces a self-contained React 19 + Ant Design 6 + React Router 7 + Vite 8 management console with project-local runtime code.

Quick Start

# pnpm
pnpm create admin-platform my-app

# npm
npm create admin-platform@latest my-app

# yarn
yarn create admin-platform my-app

my-app is created in the current working directory. After generation:

cd my-app
pnpm install
pnpm check     # lint + typecheck + test + build
pnpm dev

CLI Flags

Flag Description Default
--features <list> Comma-separated feature flags: mock, admin, security, form-builder. mock
--router-mode <mode> Router mode: hash or browser. hash
--theme <key> Default theme key: default, compact, dark, … default
--registry <url> Optional package registry written into the generated .npmrc. (none)
--link-workspace-root <p> Override the source root used for source-landing (dev-only). (auto)
--interactive Force interactive prompts even when <project-name> is given. false
-h, --help Show help.
-v, --version Show version.

Legacy --preset minimal | fintech flags are accepted for backward compatibility but trigger a warning and fall back to normal. Operation/platform-side APIs are merged under @/api/enterprise/operation.

Generated Project Layout

src/
  api/                  # auth APIs and business request clients
  components/           # source-landed reusable components
  config/               # app config, menu aggregation, feature flags, themes
  layouts/              # BasicLayout and layout Less
  lib/                  # request / auth / permission / query / branding / dictionary
  pages/                # route pages, page hooks, page-private components
  router/               # route creation, guards, business route adapters
  stores/               # Zustand stores
  styles/               # global Less styles
  utils/                # pure utility functions split by topic
types/                  # project-level global / runtime types
mock/                   # local mock handlers
public/                 # static assets

Generated projects are self-contained: runtime code is copied into normal project directories. Business menus and routes are maintained through src/router/business-route-data.ts; src/router/business-routes.tsx is the typed React Router adapter. src/config/routes.tsx only applies environment-driven base paths and re-exports the generated menu/routes. Preset business pages are grouped by route under src/pages/chain-bill; non-route implementation folders use ordinary names such as components, hooks, and shared.

How It Works

The CLI ships two in-package assets:

  • template/ — the project skeleton that becomes the generated app
  • snapshot/packages/<name>/src/ — frozen source files of admin-core, admin-ui, admin-admin, admin-security, admin-form-builder, preset-normal-corp

Both are produced by scripts/build-assets.mjs during pnpm build and prepublishOnly. After publish the package is fully self-contained and does not require the upstream monorepo at runtime.

Local Development

Inside the admin-platform-starter monorepo:

pnpm install
pnpm --filter create-admin-platform build       # builds template/, snapshot/, dist/
pnpm --filter create-admin-platform test:e2e    # runs the end-to-end generation test

To iterate on the CLI without rebuilding assets:

pnpm --filter create-admin-platform build:assets   # refresh template + snapshot

To validate the published-CLI scenario from outside the monorepo:

node /path/to/admin-platform-starter/packages/create-admin-platform/dist/index.js my-app

The CLI will use the in-package template/ and snapshot/ rather than the monorepo source.

Requirements

  • Node.js >= 20
  • pnpm >= 10 (recommended) or any of npm / yarn

License

UNLICENSED — internal use only.