@lgsm/modules 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/assets/main.css +1 -1
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/main.d.ts +4 -0
- package/dist/main.js +2243 -1417
- package/dist/shared-function/jwtDecodeFunc.d.ts +1 -0
- package/dist/shared-function/loginRedirect.d.ts +1 -0
- package/dist/shared-ui/Modal/index.d.ts +12 -0
- package/dist/shared-ui/Sonner/index.d.ts +1 -0
- package/dist/shared-ui/ui/sonner.d.ts +4 -0
- package/dist/utils/sonnerHelper.d.ts +3 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -41,23 +41,27 @@ Link download : https://www.npmjs.com/package/@lgsm/modules
|
|
|
41
41
|
| `coverage` | Generate a coverage report, with **v8**. |
|
|
42
42
|
|
|
43
43
|
## How to setup API Service
|
|
44
|
-
1.
|
|
44
|
+
1. Installation
|
|
45
|
+
```
|
|
46
|
+
npm i
|
|
47
|
+
```
|
|
48
|
+
2. Create your environment files (eg: '.env.dev' or '.env.prod') and define your base URL
|
|
45
49
|
```
|
|
46
50
|
VITE_BASE_URL=https://your-api-domain.com
|
|
47
51
|
```
|
|
48
|
-
|
|
52
|
+
3. Update your package.json to include appropriate Vite modes for each environment
|
|
49
53
|
```"scripts": {
|
|
50
54
|
"dev": "vite --mode dev [your settings]",
|
|
51
55
|
"prod": "vite --mode prod [your settings]"
|
|
52
56
|
}
|
|
53
57
|
```
|
|
54
|
-
|
|
58
|
+
4. In your main.tsx, (or wherever your app initializes), import and set up the base URL using setupBaseURL.
|
|
55
59
|
```
|
|
56
60
|
import { setupBaseURL } from "@lgsm/modules";
|
|
57
61
|
|
|
58
62
|
setupBaseURL(import.meta.env.VITE_BASE_URL);
|
|
59
63
|
```
|
|
60
|
-
|
|
64
|
+
5. The API client automatically handles certain error codes and displays notifications (popups). To enable this behavior, make sure the NotificationContainer component is rendered at the root level of your app, for example in App.tsx:
|
|
61
65
|
```
|
|
62
66
|
<ErrorBoundary fallback={}>
|
|
63
67
|
<Suspense fallback={<ThreeDotsLoader />}>
|