@ledat-code/client (0.1.0)
Installation
@ledat-code:registry=https://git.ledat96.synology.me/api/packages/ledat-code/npm/npm install @ledat-code/client@0.1.0"@ledat-code/client": "0.1.0"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 @ledat-code/core
Consumer must install peer dependencies declared in package.json: React, React DOM, MUI, Emotion, and MUI icons.
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.1.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 |