@ledat-code/client (0.2.2)
Installation
@ledat-code:registry=https://git.ledat96.synology.me/api/packages/ledat-code/npm/npm install @ledat-code/client@0.2.2"@ledat-code/client": "0.2.2"About this package
@ledat-code/client
Client shared library for GraphQL facade, design tokens, and client contracts.
@ledat-code/client depends on @ledat-code/core and does not depend on @ledat-code/admin.
Install
npm install @ledat-code/client
Root imports (configuration, GraphQL and design tokens) do not require React, React DOM, MUI or Emotion. Core is installed transitively.
UI entry and migration from 0.1.0
Starting in 0.2.0, UI components and UI types are exported only from @ledat-code/client/ui:
import { configureClient, clientShape } from "@ledat-code/client";
import { AppButton, AppCard, type AppButtonTone } from "@ledat-code/client/ui";
Move existing root imports of AppButton, AppCard, AppEmptyState, AppErrorState, AppLoadingState, AppPageHeader, AppStatusChip, AppText, appInputSx, AppButtonTone and AppCardVariant to /ui.
UI consumers must explicitly install React, React DOM, MUI material/icons and Emotion react/styled matching the peer ranges in package.json. These peers are optional at package level, not optional when using /ui; npm cannot express peer requirements for individual subpaths.
Runtime configuration
Configure once before rendering or calling graphqlRequest:
import { configureClient } from "@ledat-code/client";
configureClient({
apiUrl: import.meta.env.VITE_API_URL,
});
For private APIs, provide token access explicitly:
configureClient({
apiUrl: import.meta.env.VITE_API_URL,
getAccessToken: () => authStore.getState().accessToken,
onAuthExpired: () => authStore.getState().clearSession(),
});
Public requests send no token by default. Use includeAuth: false to suppress token for one request. Client never reads import.meta.env, localStorage, or lightnovel.admin.session internally.
For isolated transports, use createClientGraphqlRequest instead of the global facade.
Development and release
Build inside Docker from repository root:
docker compose -f microservice/projects/client-shell/dockers/dev/docker-compose.yml run --rm client-shell sh -lc 'cd /workspace/libs/core && npm install --legacy-peer-deps --ignore-scripts && npm run build && cd /workspace/libs/client && 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.
Dependencies
Dependencies
| ID | Version |
|---|---|
| @ledat-code/core | 0.2.0 |
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 |
| react | ^19.0.0 |
| react-dom | ^19.0.0 |