@ledat-code/admin (0.1.1)
Installation
@ledat-code:registry=https://git.ledat96.synology.me/api/packages/ledat-code/npm/npm install @ledat-code/admin@0.1.1"@ledat-code/admin": "0.1.1"About this package
@ledat-code/admin
Admin shared library for micro-frontends.
Scope
- GraphQL facade and shared operations
- React Admin data provider
- Auth/session/RBAC helpers
- Admin UI, theme, and MFE contracts
@ledat-code/admin depends on @ledat-code/core. It does not depend on @ledat-code/client.
Install
npm install @ledat-code/admin @ledat-code/core
Consumer must install peer dependencies declared in package.json: React, React DOM, MUI, Emotion, React Admin, React Router, React Hook Form, TanStack Query, MUI date pickers/tree view, Polyglot, rich-text input, and Zustand.
Runtime configuration
Configure before rendering any Admin component or calling its GraphQL facade:
import { configureAdmin } from "@ledat-code/admin";
configureAdmin({
apiUrl: import.meta.env.VITE_API_URL,
readerUrl: import.meta.env.VITE_READER_URL,
onAuthExpired: () => authProvider.logout(),
});
apiUrl must be absolute HTTP(S) URL without embedded credentials. Admin session helpers still own Admin token storage; requests receive token explicitly from the data provider/auth flow. onAuthExpired is optional; without it, library dispatches lightnovel-admin:auth-expired in browser environments.
Development and release
Build inside Docker from repository root:
docker compose -f microservice/projects/admin-shell/dockers/dev/docker-compose.yml run --rm admin-shell sh -lc 'cd /workspace/libs/core && npm install --legacy-peer-deps --ignore-scripts && npm run build && cd /workspace/libs/admin && npm install --legacy-peer-deps --ignore-scripts && npm run type-check && npm run build'
Publish @ledat-code/core before this package. See microservice/libs/README.md for Gitea registry setup and release order.
Dependencies
Dependencies
| ID | Version |
|---|---|
| @ledat-code/core | 0.1.2 |
| dayjs | ^1.11.19 |
Peer Dependencies
| ID | Version |
|---|---|
| @emotion/react | ^11.14.0 |
| @emotion/styled | ^11.14.1 |
| @mui/icons-material | ^9.2.0 |
| @mui/material | ^9.2.0 |
| @mui/x-date-pickers | ^9.10.1 |
| @mui/x-tree-view | ^9.8.0 |
| @tanstack/react-query | ^5.90.21 |
| ra-i18n-polyglot | ^5.15.0 |
| ra-input-rich-text | ^5.15.1 |
| react | ^19.0.0 |
| react-admin | ^5.15.1 |
| react-dom | ^19.0.0 |
| react-hook-form | ^7.71.1 |
| react-router | ^7.13.0 |
| react-router-dom | ^7.13.0 |
| zustand | ^5.0.11 |