droplinked-web3-ui 0.0.10 โ 0.0.12
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 +511 -74
- package/dist/index.cjs +30 -30
- package/dist/index.d.ts +23 -6
- package/dist/index.js +103472 -103411
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,75 +1,512 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
# ๐ droplinked-web3-ui
|
|
2
|
+
|
|
3
|
+
A React library for Web3 payments and NFT claims on the Droplinked platform.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## ๐ฆ Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install droplinked-web3-ui
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## ๐ Main Dependencies
|
|
19
|
+
|
|
20
|
+
This project uses the following dependencies:
|
|
21
|
+
|
|
22
|
+
| Package | Version | Description |
|
|
23
|
+
|---------|---------|-------------|
|
|
24
|
+
| ๐ `droplinked-web3-kit` | ^1.0.7 | Core Web3 library for blockchain interaction |
|
|
25
|
+
| ๐จ `droplinked-ui-kit` | ^0.0.38 | Shared UI components |
|
|
26
|
+
| โก `@chakra-ui/react` | ^3.32.0 | UI framework |
|
|
27
|
+
| ๐ช `zustand` | ^5.0.11 | State management |
|
|
28
|
+
| ๐ `react-query` | ^3.39.3 | API request management |
|
|
29
|
+
| ๐ก `axios` | ^1.13.5 | HTTP client |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## ๐ณ Component Usage
|
|
34
|
+
|
|
35
|
+
### DroplinkedWeb3Ui - Unified Web3 Component ๐
|
|
36
|
+
|
|
37
|
+
Main component for all Web3 operations. Use the `action` prop to specify the operation type:
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { DroplinkedWeb3Ui, Actions } from 'droplinked-web3-ui';
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
#### Available Actions
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
enum Actions {
|
|
47
|
+
Payment = 'payment', // ๐ณ Cryptocurrency payments
|
|
48
|
+
ClaimNFT = 'claimNFT', // ๐จ NFT claims
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
### 1๏ธโฃ Payment Action ๐ฐ
|
|
55
|
+
|
|
56
|
+
Process cryptocurrency payments:
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { DroplinkedWeb3Ui, Actions } from 'droplinked-web3-ui';
|
|
60
|
+
|
|
61
|
+
function PaymentPage() {
|
|
62
|
+
return (
|
|
63
|
+
<DroplinkedWeb3Ui
|
|
64
|
+
action={Actions.Payment}
|
|
65
|
+
inputs={{
|
|
66
|
+
cartId: "cart-id-here",
|
|
67
|
+
shopId: "shop-id-here",
|
|
68
|
+
price: 100,
|
|
69
|
+
priceInShopCurrency: 100,
|
|
70
|
+
abbreviation: "USD",
|
|
71
|
+
symbol: "$",
|
|
72
|
+
onError: (error) => console.error(error),
|
|
73
|
+
onSuccess: (orderId) => console.log('Success:', orderId),
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### ๐ Payment Inputs
|
|
81
|
+
|
|
82
|
+
| Prop | Type | Description |
|
|
83
|
+
|------|------|-------------|
|
|
84
|
+
| ๐ `cartId` | `string` | Shopping cart ID |
|
|
85
|
+
| ๐ช `shopId` | `string` | Shop ID |
|
|
86
|
+
| ๐ต `price` | `number` | Payment amount |
|
|
87
|
+
| ๐ฑ `priceInShopCurrency` | `number` | Amount in shop currency |
|
|
88
|
+
| ๐ท๏ธ `abbreviation` | `string` | Currency symbol (e.g., USD) |
|
|
89
|
+
| ๐ฒ `symbol` | `string` | Display symbol (e.g., $) |
|
|
90
|
+
| โ `onError` | `(error: string) => void` | Error callback |
|
|
91
|
+
| โ
`onSuccess` | `(orderId?: string) => void` | Success callback |
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### 2๏ธโฃ ClaimNFT Action ๐จ
|
|
96
|
+
|
|
97
|
+
Claim NFTs after payment:
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import { DroplinkedWeb3Ui, Actions } from 'droplinked-web3-ui';
|
|
101
|
+
|
|
102
|
+
function ClaimPage() {
|
|
103
|
+
return (
|
|
104
|
+
<DroplinkedWeb3Ui
|
|
105
|
+
action={Actions.ClaimNFT}
|
|
106
|
+
inputs={{
|
|
107
|
+
orderId: "order-id-here",
|
|
108
|
+
skuId: "sku-id-here",
|
|
109
|
+
buttonText: "Claim NFT",
|
|
110
|
+
isButtonDisabled: false,
|
|
111
|
+
onError: (message) => console.error(message),
|
|
112
|
+
onSuccess: (txHash) => console.log('Claimed:', txHash),
|
|
113
|
+
}}
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
75
117
|
```
|
|
118
|
+
|
|
119
|
+
#### ๐ ClaimNFT Inputs
|
|
120
|
+
|
|
121
|
+
| Prop | Type | Description |
|
|
122
|
+
|------|------|-------------|
|
|
123
|
+
| ๐ `orderId` | `string` | Order ID |
|
|
124
|
+
| ๐ท๏ธ `skuId` | `string` | SKU ID |
|
|
125
|
+
| ๐ `buttonText` | `string` | Button text |
|
|
126
|
+
| ๐ซ `isButtonDisabled` | `boolean` | Button disabled state |
|
|
127
|
+
| โ `onError` | `(message: string) => void` | Error callback |
|
|
128
|
+
| โ
`onSuccess` | `(txHash: string) => void` | Success callback |
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
### Type Safety โจ
|
|
133
|
+
|
|
134
|
+
The component uses TypeScript generics to provide type-safe inputs based on the action:
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
// โ
TypeScript knows inputs should be PaymentInputs
|
|
138
|
+
<DroplinkedWeb3Ui
|
|
139
|
+
action={Actions.Payment}
|
|
140
|
+
inputs={{
|
|
141
|
+
cartId: "...", // Autocomplete works!
|
|
142
|
+
// skuId is NOT suggested here โ
|
|
143
|
+
}}
|
|
144
|
+
/>
|
|
145
|
+
|
|
146
|
+
// โ
TypeScript knows inputs should be ClaimNFTInputs
|
|
147
|
+
<DroplinkedWeb3Ui
|
|
148
|
+
action={Actions.ClaimNFT}
|
|
149
|
+
inputs={{
|
|
150
|
+
orderId: "...", // Autocomplete works!
|
|
151
|
+
// cartId is NOT suggested here โ
|
|
152
|
+
}}
|
|
153
|
+
/>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## ๐ ๏ธ Development
|
|
159
|
+
|
|
160
|
+
### ๐ Project Structure
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
๐ฆ src/
|
|
164
|
+
โโโ ๐ components/
|
|
165
|
+
โ โโโ ๐ modals/ # ๐ช Modals
|
|
166
|
+
โ โ โโโ ๐ wallet-connection/ # ๐ Wallet connection modal
|
|
167
|
+
โ โโโ ๐ pay-with-crypto-element/ # ๐ธ Crypto payment element
|
|
168
|
+
โ โโโ ๐ claim-nft-element/ # ๐จ NFT claim element
|
|
169
|
+
โ โโโ ๐ common/ # ๐ง Shared components
|
|
170
|
+
โโโ ๐ context/
|
|
171
|
+
โ โโโ ๐ dropWeb3Context/ # ๐ Web3 context
|
|
172
|
+
โโโ ๐ hooks/ # โ Custom hooks
|
|
173
|
+
โโโ ๐ stores/ # ๐ช Zustand stores
|
|
174
|
+
โโโ ๐ apis/ # ๐ API services
|
|
175
|
+
โโโ ๐ utils/ # ๐ ๏ธ Utilities
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### ๐ช Modals
|
|
181
|
+
|
|
182
|
+
Modals are located in `src/components/modals/` and managed using the `useModals` hook:
|
|
183
|
+
|
|
184
|
+
```tsx
|
|
185
|
+
const {
|
|
186
|
+
activeModal,
|
|
187
|
+
openConnectModal, // ๐ Open wallet connection modal
|
|
188
|
+
openBrowseWallets, # ๐ฑ Open wallet list modal
|
|
189
|
+
openSelectNetworkModal, # ๐ Open network selection modal
|
|
190
|
+
openWalletConnectionModal, # ๐ Open wallet connection modal
|
|
191
|
+
openManageWalletsModal, # ๐๏ธ Open wallet management modal
|
|
192
|
+
openSelectTokenModal, # ๐ช Open token selection modal
|
|
193
|
+
openPaymentProcessModal, # ๐ณ Open payment process modal
|
|
194
|
+
openClaimProcessModal, # ๐ Open claim process modal
|
|
195
|
+
closeModal, # โ Close active modal
|
|
196
|
+
} = useModals();
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## ๐ช Hooks
|
|
202
|
+
|
|
203
|
+
### ๐ฏ useDropWeb3
|
|
204
|
+
|
|
205
|
+
Main hook to access the `droplinked-web3-kit` library instance:
|
|
206
|
+
|
|
207
|
+
```tsx
|
|
208
|
+
import { useDropWeb3 } from '@/context/dropWeb3Context/useDropWeb3';
|
|
209
|
+
|
|
210
|
+
function MyComponent() {
|
|
211
|
+
const { web3, provider } = useDropWeb3();
|
|
212
|
+
|
|
213
|
+
// web3: instance of DropWeb3 class ๐
|
|
214
|
+
// provider: provider for wallet connections ๐
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
> โ ๏ธ **Note:** This hook must be used inside `DropWeb3Provider`.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
### ๐ณ usePayWithCrypto
|
|
223
|
+
|
|
224
|
+
Hook for managing crypto payments:
|
|
225
|
+
|
|
226
|
+
```tsx
|
|
227
|
+
import { usePayWithCrypto } from '@/hooks/usePayWithCrypto';
|
|
228
|
+
|
|
229
|
+
function MyComponent() {
|
|
230
|
+
const {
|
|
231
|
+
hasConnectedWallets, # โ
boolean - Whether connected wallets exist
|
|
232
|
+
connectedWallets, # ๐ IWallet[] - List of connected wallets
|
|
233
|
+
isLoading, # โณ boolean - Loading state
|
|
234
|
+
loadWallets, # ๐ () => Promise<void> - Load wallets
|
|
235
|
+
} = usePayWithCrypto();
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
### ๐ช useTokenBalances
|
|
242
|
+
|
|
243
|
+
Hook for fetching token balances:
|
|
244
|
+
|
|
245
|
+
```tsx
|
|
246
|
+
import { useTokenBalances } from '@/hooks/useTokenBalances';
|
|
247
|
+
|
|
248
|
+
function MyComponent() {
|
|
249
|
+
useTokenBalances(hasConnectedWallets); # ๐ Updates token balances
|
|
250
|
+
}
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
### ๐ช useModals
|
|
256
|
+
|
|
257
|
+
Hook for managing modals (explained above).
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
### ๐ useWallets
|
|
262
|
+
|
|
263
|
+
Hook for managing wallets.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
### ๐ฐ useFormattedAmount
|
|
268
|
+
|
|
269
|
+
Hook for formatting financial amounts.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## ๐ช Zustand Stores
|
|
274
|
+
|
|
275
|
+
### ๐ณ paymentUiStore
|
|
276
|
+
|
|
277
|
+
Manages payment state:
|
|
278
|
+
|
|
279
|
+
```tsx
|
|
280
|
+
import { usePaymentUiStore } from '@/stores/paymentUiStore';
|
|
281
|
+
|
|
282
|
+
const {
|
|
283
|
+
cartId, # ๐
|
|
284
|
+
price, # ๐ต
|
|
285
|
+
abbreviation, # ๐ท๏ธ
|
|
286
|
+
symbol, # ๐ฒ
|
|
287
|
+
onError, # โ
|
|
288
|
+
onMainProcessSuccess, # โ
|
|
289
|
+
setPaymentUiData, # ๐ (props) => set state
|
|
290
|
+
currentDescription, # ๐ Current process description
|
|
291
|
+
currentError, # โ ๏ธ Current error
|
|
292
|
+
currentErrorDescription, # ๐ Error description
|
|
293
|
+
} = usePaymentUiStore();
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
### ๐จ claimNftStore
|
|
299
|
+
|
|
300
|
+
Manages NFT claim state:
|
|
301
|
+
|
|
302
|
+
```tsx
|
|
303
|
+
import { useClaimNftStore } from '@/stores/claimNftStore';
|
|
304
|
+
|
|
305
|
+
const {
|
|
306
|
+
orderId, # ๐
|
|
307
|
+
skuId, # ๐ท๏ธ
|
|
308
|
+
onError, # โ
|
|
309
|
+
onMainProcessSuccess, # โ
|
|
310
|
+
buttonText, # ๐
|
|
311
|
+
isButtonDisabled, # ๐ซ
|
|
312
|
+
setClaimNftData, # ๐ (data) => set state
|
|
313
|
+
currentDescription, # ๐
|
|
314
|
+
currentError, # โ ๏ธ
|
|
315
|
+
currentErrorDescription, # ๐
|
|
316
|
+
} = useClaimNftStore();
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
### ๐ช modalStore
|
|
322
|
+
|
|
323
|
+
Manages modal state:
|
|
324
|
+
|
|
325
|
+
```tsx
|
|
326
|
+
import { useModalStore } from '@/stores/modalStore';
|
|
327
|
+
|
|
328
|
+
const {
|
|
329
|
+
activeModal, # ๐ช ModalType - Active modal
|
|
330
|
+
openModal, # ๐ (modal) => Open modal
|
|
331
|
+
closeModal, # โ () => Close modal
|
|
332
|
+
closeAndOpen, # ๐ (current, next, data?) => Close and open
|
|
333
|
+
} = useModalStore();
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
#### ๐ ModalType Values
|
|
337
|
+
|
|
338
|
+
| Modal | Description |
|
|
339
|
+
|-------|-------------|
|
|
340
|
+
| ๐ `'connectWallet'` | Connect wallet modal |
|
|
341
|
+
| ๐ฑ `'browseWallets'` | Browse wallets modal |
|
|
342
|
+
| ๐ฅ `'getWallet'` | Get wallet modal |
|
|
343
|
+
| ๐ `'selectNetwork'` | Select network modal |
|
|
344
|
+
| ๐ `'walletConnection'` | Wallet connection modal |
|
|
345
|
+
| ๐๏ธ `'manageWallets'` | Manage wallets modal |
|
|
346
|
+
| ๐ช `'selectToken'` | Select token modal |
|
|
347
|
+
| ๐ณ `'paymentProcess'` | Payment process modal |
|
|
348
|
+
| ๐ `'claimProcess'` | Claim process modal |
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
### ๐ walletStore
|
|
353
|
+
|
|
354
|
+
Manages wallet state:
|
|
355
|
+
|
|
356
|
+
```tsx
|
|
357
|
+
import { useWalletStore } from '@/stores/walletStore';
|
|
358
|
+
|
|
359
|
+
const {
|
|
360
|
+
allWallets, # ๐ฑ IWallet[] - All wallets
|
|
361
|
+
selectedWallet, # ๐ IWallet \| null - Selected wallet
|
|
362
|
+
selectedConnectedWallet, # ๐ IWallet \| null - Selected connected wallet
|
|
363
|
+
setAllWallets, # ๐ (wallets) => set wallets
|
|
364
|
+
setSelectedWallet, # ๐ (wallet) => set selected
|
|
365
|
+
setSelectedConnectedWallet, # ๐
|
|
366
|
+
} = useWalletStore();
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
### ๐ช tokenStore
|
|
372
|
+
|
|
373
|
+
Manages token state:
|
|
374
|
+
|
|
375
|
+
```tsx
|
|
376
|
+
import { useTokenStore } from '@/stores/tokenStore';
|
|
377
|
+
|
|
378
|
+
const {
|
|
379
|
+
selectedToken, # ๐ช Selected token
|
|
380
|
+
setSelectedToken, # ๐ (token) => set token
|
|
381
|
+
} = useTokenStore();
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
### ๐ orderStore
|
|
387
|
+
|
|
388
|
+
Manages order state.
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## ๐งฉ Main Components
|
|
393
|
+
|
|
394
|
+
### ๐ DropWeb3Provider
|
|
395
|
+
|
|
396
|
+
Main provider for Web3 access:
|
|
397
|
+
|
|
398
|
+
```tsx
|
|
399
|
+
import { DropWeb3Provider } from '@/context/dropWeb3Context/DropWeb3Context';
|
|
400
|
+
|
|
401
|
+
<DropWeb3Provider>
|
|
402
|
+
<YourComponents />
|
|
403
|
+
</DropWeb3Provider>
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
> ๐ก This provider is automatically included in `DroplinkedWeb3Ui`.
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
### ๐ธ PayWithCrypto
|
|
411
|
+
|
|
412
|
+
Internal payment UI component used by `DroplinkedWeb3Ui` when `action={Actions.Payment}`. Includes:
|
|
413
|
+
- ๐ Display of connected wallets
|
|
414
|
+
- ๐ช Token selection
|
|
415
|
+
- ๐ณ Payment process
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
### ๐จ ClaimNftUi
|
|
420
|
+
|
|
421
|
+
Internal NFT claim UI component used by `DroplinkedWeb3Ui` when `action={Actions.ClaimNFT}`.
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## ๐ API Services
|
|
426
|
+
|
|
427
|
+
Services are located in `src/apis/`:
|
|
428
|
+
|
|
429
|
+
| Service | Path | Description |
|
|
430
|
+
|---------|------|-------------|
|
|
431
|
+
| ๐ณ Payment | `payment/services.ts` | Payment services |
|
|
432
|
+
| ๐ Orders | `orders/services.ts` | Order services |
|
|
433
|
+
| ๐ Web3 | `web3/services.ts` | Web3 services |
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## ๐ Publishing
|
|
438
|
+
|
|
439
|
+
To publish a new version:
|
|
440
|
+
|
|
441
|
+
### 1๏ธโฃ Update the version
|
|
442
|
+
|
|
443
|
+
```bash
|
|
444
|
+
npm version patch # ๐ง For small changes
|
|
445
|
+
npm version minor # โจ For new features
|
|
446
|
+
npm version major # โ ๏ธ For breaking changes
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
### 2๏ธโฃ Commit and push
|
|
450
|
+
|
|
451
|
+
```bash
|
|
452
|
+
git add .
|
|
453
|
+
git commit -m "chore: bump version to x.x.x"
|
|
454
|
+
git push origin main
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### 3๏ธโฃ Automatic publish โจ
|
|
458
|
+
|
|
459
|
+
When pushing to the `main` branch, GitHub Actions will automatically:
|
|
460
|
+
1. ๐จ Build the project
|
|
461
|
+
2. ๐ Compare the version with npm
|
|
462
|
+
3. ๐ Publish to npm if the version is new
|
|
463
|
+
|
|
464
|
+
> โ ๏ธ **Important notes:**
|
|
465
|
+
> - Only changes to `package.json` or workflow trigger the publish
|
|
466
|
+
> - For manual publish, use `workflow_dispatch` in GitHub Actions
|
|
467
|
+
> - Make sure `NPM_TOKEN` is set in repository secrets ๐
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
## ๐ง Environment Variables
|
|
472
|
+
|
|
473
|
+
This project uses the following variables (in `.env`):
|
|
474
|
+
|
|
475
|
+
```env
|
|
476
|
+
# ๐งช Development
|
|
477
|
+
VITE_BASE_API_URL_DEV=https://apiv3dev.droplinked.com
|
|
478
|
+
|
|
479
|
+
# ๐ Production
|
|
480
|
+
VITE_BASE_API_URL_MAIN=https://apiv3.droplinked.com
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
## ๐ป Development Notes
|
|
486
|
+
|
|
487
|
+
### ๐ฏ Available Scripts
|
|
488
|
+
|
|
489
|
+
| Command | Description |
|
|
490
|
+
|---------|-------------|
|
|
491
|
+
| `npm run dev` | ๐ Start development server |
|
|
492
|
+
| `npm run build` | ๐จ Build for production |
|
|
493
|
+
| `npm run lint` | ๐ Run linter |
|
|
494
|
+
| `npm run preview` | ๐๏ธ Preview production build |
|
|
495
|
+
|
|
496
|
+
### ๐ Debug Mode
|
|
497
|
+
|
|
498
|
+
In `src/utils/variables.ts`, set `appDevelopment` to `true` to display logs ๐
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
## ๐ License
|
|
503
|
+
|
|
504
|
+
MIT ยฉ Droplinked
|
|
505
|
+
|
|
506
|
+
---
|
|
507
|
+
|
|
508
|
+
<div align="center">
|
|
509
|
+
|
|
510
|
+
Made with โค๏ธ by the Droplinked Team
|
|
511
|
+
|
|
512
|
+
</div>
|