@solapi/ui-kit 1.0.1 → 1.0.2
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 +36 -3
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -9,6 +9,15 @@ Solapi 공용 UI 컴포넌트 라이브러리.
|
|
|
9
9
|
npm install @solapi/ui-kit
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
+
## Module Federation Exposes
|
|
13
|
+
|
|
14
|
+
| 모듈 | 경로 | 설명 |
|
|
15
|
+
|------|------|------|
|
|
16
|
+
| `./ui` | `src/export/index.ts` | 전체 export (컴포넌트, 훅, Provider, 테마) |
|
|
17
|
+
| `./provider` | `src/export/provider.ts` | GlobalUIProvider, ThemeProvider |
|
|
18
|
+
| `./hooks` | `src/export/hooks.ts` | useSnackbar, useModal, useConfirm, useEnhancedMutation |
|
|
19
|
+
| `./createMutationConfig` | `src/lib/createMutationConfig.ts` | MFA 처리 포함 Mutation 설정 유틸 |
|
|
20
|
+
|
|
12
21
|
## Quick Start (Federation + npm Fallback)
|
|
13
22
|
|
|
14
23
|
### 1. Remote 등록
|
|
@@ -23,7 +32,7 @@ const remoteApps = {
|
|
|
23
32
|
### 2. GlobalUIProvider 감싸기
|
|
24
33
|
|
|
25
34
|
```tsx
|
|
26
|
-
// src/
|
|
35
|
+
// src/uiKit/safeProviderLoader.tsx
|
|
27
36
|
import { createSafeProviderLoader } from '@solapi/ui-kit/federation'
|
|
28
37
|
|
|
29
38
|
const UI_KIT_PROVIDER = async () => {
|
|
@@ -60,7 +69,7 @@ import { createSafeComponentLoader } from '@solapi/ui-kit/federation'
|
|
|
60
69
|
|
|
61
70
|
const UI_KIT_COMP = async () => {
|
|
62
71
|
try {
|
|
63
|
-
return await import('@solapi-frontend/ui-kit/
|
|
72
|
+
return await import('@solapi-frontend/ui-kit/ui')
|
|
64
73
|
} catch {
|
|
65
74
|
return await import('@solapi/ui-kit')
|
|
66
75
|
}
|
|
@@ -109,7 +118,30 @@ export const useConfirm = createSafeHookLoader(UI_KIT_HOOKS, 'useConfirm', {
|
|
|
109
118
|
})
|
|
110
119
|
```
|
|
111
120
|
|
|
112
|
-
### 5.
|
|
121
|
+
### 5. MFA Mutation 설정
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
// src/uiKit/safeFunctionLoader.ts
|
|
125
|
+
const loadModule = async () => {
|
|
126
|
+
try {
|
|
127
|
+
return await import('@solapi-frontend/ui-kit/createMutationConfig')
|
|
128
|
+
} catch {
|
|
129
|
+
return await import('@solapi/ui-kit/createMutationConfig')
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export const loadCreateMutationConfig = async () => {
|
|
134
|
+
const mod = await loadModule()
|
|
135
|
+
return mod?.createMutationConfig ?? null
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export const loadConfigureMfa = async () => {
|
|
139
|
+
const mod = await loadModule()
|
|
140
|
+
return mod?.configureMfa ?? null
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### 6. 사용
|
|
113
145
|
|
|
114
146
|
```tsx
|
|
115
147
|
import { Tabs, TextInput, Button, Box } from 'uiKit/safeCompLoader'
|
|
@@ -149,5 +181,6 @@ function MyPage() {
|
|
|
149
181
|
| [사용 가이드](docs/usage-guide.md) | Federation + npm Fallback 상세 가이드, 마이그레이션 |
|
|
150
182
|
| [Federation API](docs/federation-api.md) | createSafeProviderLoader, createSafeComponentLoader, createSafeHookLoader |
|
|
151
183
|
| [GlobalUIProvider](docs/global-ui-provider.md) | Props, Portal, MFA, 로컬 개발 설정 |
|
|
184
|
+
| [createMutationConfig](docs/create-mutation-config.md) | MFA 처리, Snackbar 연동, Federation 환경 사용법 |
|
|
152
185
|
| [컴포넌트 추가](docs/contributing.md) | 새 UI 컴포넌트/Hook 추가 가이드 |
|
|
153
186
|
| [안티패턴](docs/anti-patterns.md) | 흔한 실수와 올바른 대안 |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solapi/ui-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -23,6 +23,16 @@
|
|
|
23
23
|
},
|
|
24
24
|
"./styles": "./dist/ui-kit.css"
|
|
25
25
|
},
|
|
26
|
+
"typesVersions": {
|
|
27
|
+
"*": {
|
|
28
|
+
"federation": [
|
|
29
|
+
"./dist/federation.d.ts"
|
|
30
|
+
],
|
|
31
|
+
"createMutationConfig": [
|
|
32
|
+
"./dist/lib/createMutationConfig.d.ts"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
26
36
|
"files": [
|
|
27
37
|
"dist"
|
|
28
38
|
],
|