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-appmy-app is created in the current working directory. After generation:
cd my-app
pnpm install
pnpm check # lint + typecheck + test + build
pnpm devCLI 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/admin/ # source-landed reusable admin components
config/ # app config, menu, business routes, 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 and guards
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 assetsGenerated projects are self-contained: runtime code is copied into normal project directories.
How It Works
The CLI ships two in-package assets:
template/— the project skeleton that becomes the generated appsnapshot/packages/<name>/src/— frozen source files ofadmin-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 testTo iterate on the CLI without rebuilding assets:
pnpm --filter create-admin-platform build:assets # refresh template + snapshotTo validate the published-CLI scenario from outside the monorepo:
node /path/to/admin-platform-starter/packages/create-admin-platform/dist/index.js my-appThe 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.