Skip to content

Commit

Permalink
fix: export walletconnect and evm separate (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
helciofranco authored May 9, 2024
1 parent 0c95324 commit 6fb5d3f
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-bears-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuels/connectors": minor
---

fix: bundle only browser-compatible connectors in the main bundle
2 changes: 1 addition & 1 deletion examples/react-app/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
FuelWalletConnector,
FuelWalletDevelopmentConnector,
FueletWalletConnector,
WalletConnectConnector,
} from '@fuels/connectors';
import { WalletConnectConnector } from '@fuels/connectors/walletconnect';
import { FuelProvider } from '@fuels/react';

import * as Toast from '@radix-ui/react-toast';
Expand Down
2 changes: 1 addition & 1 deletion examples/react-next/src/components/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
FuelWalletConnector,
FuelWalletDevelopmentConnector,
FueletWalletConnector,
WalletConnectConnector,
} from '@fuels/connectors';
import { WalletConnectConnector } from '@fuels/connectors/walletconnect';
import { FuelProvider } from '@fuels/react';

const queryClient = new QueryClient();
Expand Down
10 changes: 10 additions & 0 deletions packages/connectors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
"require": "./dist/index.js",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"./walletconnect": {
"require": "./dist/walletconnect-connector/index.js",
"import": "./dist/walletconnect-connector/index.mjs",
"types": "./dist/walletconnect-connector/src/index.d.ts"
},
"./evm": {
"require": "./dist/evm-connector/index.js",
"import": "./dist/evm-connector/index.mjs",
"types": "./dist/evm-connector/src/index.d.ts"
}
},
"files": ["dist"],
Expand Down
2 changes: 0 additions & 2 deletions packages/connectors/src/defaultConnectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { BurnerWalletConnector } from '@fuel-connectors/burner-wallet-connector'
import { FuelWalletDevelopmentConnector } from '@fuel-connectors/fuel-development-wallet';
import { FuelWalletConnector } from '@fuel-connectors/fuel-wallet';
import { FueletWalletConnector } from '@fuel-connectors/fuelet-wallet';
import { WalletConnectConnector } from '@fuel-connectors/walletconnect-connector';
import type { FuelConnector } from 'fuels';

type DefaultConnectors = {
Expand All @@ -15,7 +14,6 @@ export function defaultConnectors({
const connectors = [
new FuelWalletConnector(),
new FueletWalletConnector(),
new WalletConnectConnector(),
new BurnerWalletConnector(),
];

Expand Down
1 change: 1 addition & 0 deletions packages/connectors/src/evm-connector/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@fuel-connectors/evm-connector';
2 changes: 0 additions & 2 deletions packages/connectors/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@ export * from './defaultConnectors';
export * from '@fuel-connectors/fuel-development-wallet';
export * from '@fuel-connectors/fuel-wallet';
export * from '@fuel-connectors/fuelet-wallet';
export * from '@fuel-connectors/evm-connector';
export * from '@fuel-connectors/walletconnect-connector';
export * from '@fuel-connectors/burner-wallet-connector';
1 change: 1 addition & 0 deletions packages/connectors/src/walletconnect-connector/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@fuel-connectors/walletconnect-connector';
6 changes: 5 additions & 1 deletion packages/connectors/tsup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { defineConfig } from 'tsup';

export default defineConfig((options) => ({
...baseConfig(options, { withReact: false }),
entry: ['src/index.ts'],
entry: [
'src/index.ts',
'src/walletconnect-connector/index.ts',
'src/evm-connector/index.ts',
],
external: ['fuels'],
noExternal: [
'@fuel-connectors/fuel-development-wallet',
Expand Down

0 comments on commit 6fb5d3f

Please sign in to comment.