Skip to content

Commit

Permalink
chore: conditional exports for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
johnson86tw committed Nov 22, 2023
1 parent d3f5690 commit 53fbb5d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
3 changes: 2 additions & 1 deletion app/components/Web3Provider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import '@vue-dapp/vd-board/dist/style.css'
const dappStore = useDappStore()
const { isConnected, user } = storeToRefs(dappStore)
const { onActivated, onChanged, onDeactivated, setDumb } = useWalletStore()
const pinia = usePinia()
const { onActivated, onChanged, onDeactivated, setDumb } = useWalletStore(pinia)
setDumb(false)
onActivated(async ({ address, provider, chainId }) => {
Expand Down
7 changes: 4 additions & 3 deletions app/components/wallet/UserStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ import { useBoardStore } from '@vue-dapp/vd-board'
const { open } = useBoardStore()
const { disconnect } = useWalletStore()
const { connector, status, address, isConnected, dumb } = storeToRefs(useWalletStore())
const pinia = usePinia()
const { disconnect } = useWalletStore(pinia)
const { connector, status, address, isConnected } = storeToRefs(useWalletStore(pinia))
const dappStore = useDappStore()
const { isNetworkUnmatched } = storeToRefs(dappStore)
async function onSwitchChain() {
try {
if (connector.value) {
await connector.value.switchChain?.(dappStore.chainId)
await connector.value.switchChain(dappStore.chainId)
}
} catch (err: any) {
console.error(err)
Expand Down
6 changes: 5 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"module": "./dist/core.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"development": {
"import": "./src/index.ts",
"require": "./src/index.ts"
},
"default": {
"import": "./dist/core.js",
"require": "./dist/core.umd.cjs"
}
Expand Down
10 changes: 8 additions & 2 deletions packages/vd-board/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/vd-board.js",
"require": "./dist/vd-board.umd.cjs"
"development": {
"import": "./src/index.ts",
"require": "./src/index.ts"
},
"default": {
"import": "./dist/vd-board.js",
"require": "./dist/vd-board.umd.cjs"
}
},
"./dist/style.css": "./dist/style.css"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/walletconnect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"module": "./dist/walletconnect.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"development": {
"import": "./src/index.ts",
"require": "./src/index.ts"
},
"default": {
"import": "./dist/walletconnect.js",
"require": "./dist/walletconnect.umd.cjs"
}
Expand Down

0 comments on commit 53fbb5d

Please sign in to comment.