Skip to content

Commit

Permalink
Restructure browser/Node exports separation
Browse files Browse the repository at this point in the history
This helps to avoid missing some common export accidentally
  • Loading branch information
vgrichina committed Jun 19, 2020
1 parent a3e587b commit f1fbf58
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 75 deletions.
39 changes: 2 additions & 37 deletions src/browser-index.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,2 @@
'use strict';

import * as providers from './providers';
import * as utils from './utils';
import * as keyStores from './key_stores/browser-index';
import * as transactions from './transaction';

import { Account } from './account';
import * as accountCreator from './account_creator';
import { Connection } from './connection';
import { Signer, InMemorySigner } from './signer';
import { Contract } from './contract';
import { KeyPair } from './utils/key_pair';
import { connect } from './near';

// TODO: Deprecate and remove WalletAccount
import { WalletAccount, WalletConnection } from './wallet-account';

export {
accountCreator,
keyStores,
providers,
utils,
transactions,

Account,
Connection,
Contract,
InMemorySigner,
Signer,
KeyPair,

connect,

WalletAccount,
WalletConnection
};
export * as keyStores from './key_stores/browser-index';
export * from './common-index';
36 changes: 36 additions & 0 deletions src/common-index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import * as providers from './providers';
import * as utils from './utils';
import * as transactions from './transaction';
import * as validators from './validators';

import { Account } from './account';
import * as accountCreator from './account_creator';
import { Connection } from './connection';
import { Signer, InMemorySigner } from './signer';
import { Contract } from './contract';
import { KeyPair } from './utils/key_pair';
import { connect, Near } from './near';

// TODO: Deprecate and remove WalletAccount
import { WalletAccount, WalletConnection } from './wallet-account';

export {
accountCreator,
providers,
utils,
transactions,
validators,

Account,
Connection,
Contract,
InMemorySigner,
Signer,
KeyPair,

connect,
Near,

WalletAccount,
WalletConnection
};
40 changes: 2 additions & 38 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,2 @@
import * as providers from './providers';
import * as utils from './utils';
import * as keyStores from './key_stores';
import * as transactions from './transaction';
import * as validators from './validators';

import { Account } from './account';
import * as accountCreator from './account_creator';
import { Connection } from './connection';
import { Signer, InMemorySigner } from './signer';
import { Contract } from './contract';
import { KeyPair } from './utils/key_pair';
import { connect, Near } from './near';

// TODO: Deprecate and remove WalletAccount
import { WalletAccount, WalletConnection } from './wallet-account';

export {
accountCreator,
keyStores,
providers,
utils,
transactions,
validators,

Account,
Connection,
Contract,
InMemorySigner,
Signer,
KeyPair,

connect,
Near,

WalletAccount,
WalletConnection
};
export * as keyStores from './key_stores/index';
export * from './common-index';

0 comments on commit f1fbf58

Please sign in to comment.