Skip to content

Commit 0443687

Browse files
authored
refactor: use export * as ns syntax (#3677)
1 parent 932cfec commit 0443687

File tree

22 files changed

+99
-161
lines changed

22 files changed

+99
-161
lines changed

packages/core-api/src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import * as Contracts from "./interfaces";
2-
import * as Schemas from "./schemas";
1+
export * as Contracts from "./interfaces";
2+
export * as Schemas from "./schemas";
33

44
export * from "./controllers/controller";
55
export * from "./identifiers";
66
export * from "./server";
77
export * from "./service-provider";
8-
9-
export { Contracts, Schemas };

packages/core-cli/src/index.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import * as Actions from "./actions";
2-
import * as Commands from "./commands";
3-
import * as Components from "./component-factory";
4-
import * as Contracts from "./contracts";
5-
import * as Container from "./ioc";
6-
import * as Plugins from "./plugins";
7-
import * as Services from "./services";
8-
import * as Utils from "./utils";
1+
export * as Actions from "./actions";
2+
export * as Commands from "./commands";
3+
export * as Components from "./component-factory";
4+
export * as Contracts from "./contracts";
5+
export * as Container from "./ioc";
6+
export * as Plugins from "./plugins";
7+
export * as Services from "./services";
8+
export * as Utils from "./utils";
99

1010
export * from "./application";
1111
export * from "./input";
@@ -14,5 +14,3 @@ export * from "./output";
1414
export * from "./action-factory";
1515
export * from "./application-factory";
1616
export * from "./component-factory";
17-
18-
export { Actions, Commands, Components, Container, Contracts, Plugins, Services, Utils };

packages/core-database/src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
export * from "./database-service";
22
export * from "./service-provider";
33

4-
import * as Models from "./models";
5-
import * as Repositories from "./repositories";
6-
7-
export { Models, Repositories };
4+
export * as Models from "./models";
5+
export * as Repositories from "./repositories";
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
import * as app from "./app";
2-
import * as serviceProviders from "./service-providers";
3-
4-
export { app, serviceProviders };
1+
export * as app from "./app";
2+
export * as serviceProviders from "./service-providers";
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import * as Blockchain from "./blockchain";
2-
import * as Database from "./database";
3-
import * as Kernel from "./kernel";
4-
import * as P2P from "./p2p";
5-
import * as Search from "./search";
6-
import * as Shared from "./shared";
7-
import * as State from "./state";
8-
import * as TransactionPool from "./transaction-pool";
9-
10-
export { Blockchain, Database, Kernel, Search, P2P, Shared, State, TransactionPool };
1+
export * as Blockchain from "./blockchain";
2+
export * as Database from "./database";
3+
export * as Kernel from "./kernel";
4+
export * as P2P from "./p2p";
5+
export * as Search from "./search";
6+
export * as Shared from "./shared";
7+
export * as State from "./state";
8+
export * as TransactionPool from "./transaction-pool";
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import * as Cache from "./cache";
2-
import * as Config from "./config";
3-
import * as Container from "./container";
4-
import * as Filesystem from "./filesystem";
5-
import * as Logic from "./logic";
6-
import * as Plugins from "./plugins";
7-
import * as Runtime from "./runtime";
8-
import * as Validation from "./validation";
9-
10-
export { Cache, Config, Container, Filesystem, Logic, Plugins, Runtime, Validation };
1+
export * as Cache from "./cache";
2+
export * as Config from "./config";
3+
export * as Container from "./container";
4+
export * as Filesystem from "./filesystem";
5+
export * as Logic from "./logic";
6+
export * as Plugins from "./plugins";
7+
export * as Runtime from "./runtime";
8+
export * as Validation from "./validation";

packages/core-kernel/src/index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Application } from "./application";
2-
import * as Contracts from "./contracts";
3-
import * as Enums from "./enums";
4-
import * as Exceptions from "./exceptions";
5-
import * as Container from "./ioc";
6-
import * as Providers from "./providers";
7-
import * as Services from "./services";
8-
import * as Support from "./support";
9-
import * as Types from "./types";
10-
import * as Utils from "./utils";
2+
export * as Contracts from "./contracts";
3+
export * as Enums from "./enums";
4+
export * as Exceptions from "./exceptions";
5+
export * as Container from "./ioc";
6+
export * as Providers from "./providers";
7+
export * as Services from "./services";
8+
export * as Support from "./support";
9+
export * as Types from "./types";
10+
export * as Utils from "./utils";
1111

12-
export { Application, Container, Contracts, Enums, Exceptions, Providers, Services, Support, Types, Utils };
12+
export { Application };

packages/core-kernel/src/ioc/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import "reflect-metadata";
22

3-
import * as Selectors from "./selectors";
3+
export * as Selectors from "./selectors";
44

55
export * from "inversify";
66

77
export * from "./identifiers";
8-
export { Selectors };
Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import * as Attributes from "./attributes";
2-
import * as Cache from "./cache";
3-
import * as Config from "./config";
4-
import * as Events from "./events";
5-
import * as Filesystem from "./filesystem";
6-
import * as Log from "./log";
7-
import * as Pipeline from "./pipeline";
8-
import * as Queue from "./queue";
9-
import * as Schedule from "./schedule";
10-
import * as Triggers from "./triggers";
11-
import * as Validation from "./validation";
12-
13-
export { Attributes, Cache, Config, Events, Filesystem, Log, Pipeline, Queue, Schedule, Triggers, Validation };
1+
export * as Attributes from "./attributes";
2+
export * as Cache from "./cache";
3+
export * as Config from "./config";
4+
export * as Events from "./events";
5+
export * as Filesystem from "./filesystem";
6+
export * as Log from "./log";
7+
export * as Pipeline from "./pipeline";
8+
export * as Queue from "./queue";
9+
export * as Schedule from "./schedule";
10+
export * as Triggers from "./triggers";
11+
export * as Validation from "./validation";

packages/core-kernel/src/utils/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { getBlockTimeLookup } from "./get-blocktime-lookup";
66
import { getBlockNotChainedErrorMessage, isBlockChained } from "./is-block-chained";
77
import { isWhitelisted } from "./is-whitelisted";
88
import { calculateRound, isNewRound } from "./round-calculator";
9-
import * as Search from "./search";
9+
export * as Search from "./search";
1010
import { calculate } from "./supply-calculator";
11-
import * as Plugins from "./transform-plugins";
11+
export * as Plugins from "./transform-plugins";
1212

1313
export * from "@arkecosystem/utils";
1414
export * from "./expiration-calculator";
@@ -20,4 +20,4 @@ export const roundCalculator = { calculateRound, isNewRound };
2020
export const supplyCalculator = { calculate };
2121
export const forgingInfoCalculator = { calculateForgingInfo, getBlockTimeLookup };
2222

23-
export { formatTimestamp, isBlockChained, getBlockNotChainedErrorMessage, isWhitelisted, Search, Plugins };
23+
export { formatTimestamp, isBlockChained, getBlockNotChainedErrorMessage, isWhitelisted };
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import * as Builders from "./builders";
2-
import * as Enums from "./enums";
3-
import * as Interfaces from "./interfaces";
4-
import * as Transactions from "./transactions";
5-
6-
export { Builders, Enums, Interfaces, Transactions };
1+
export * as Builders from "./builders";
2+
export * as Enums from "./enums";
3+
export * as Interfaces from "./interfaces";
4+
export * as Transactions from "./transactions";
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
import * as Handlers from "./handlers";
1+
export * as Handlers from "./handlers";
22
export * from "./service-provider";
3-
4-
export { Handlers };

packages/core-state/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
export * from "./service-provider";
2-
import * as Wallets from "./wallets";
3-
4-
export { Wallets };
2+
export * as Wallets from "./wallets";
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import * as Factories from "./factories";
1+
export * as Factories from "./factories";
22

33
export * from "./factory-builder";
44
export * from "./types";
55
export * from "./helpers";
6-
7-
export { Factories };

packages/core-test-framework/src/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ export * from "./app";
66
export * from "./cli";
77
// Entity Factories for commonly used entities like blocks and wallets
88
// Generators for commonly used entities like blocks and wallets
9-
import * as Generators from "./app/generators";
10-
import * as Factories from "./factories";
9+
export * as Generators from "./app/generators";
10+
export * as Factories from "./factories";
1111
// Utilities for common tasks like sending HTTP requests or altering wallets
1212
export * from "./utils"; // todo: export as Utils
13-
import * as Mocks from "./mocks"; // todo: export as Utils
14-
15-
export { Factories, Generators, Mocks };
13+
export * as Mocks from "./mocks"; // todo: export as Utils
Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
1-
import * as BlockRepository from "./block-repository";
2-
import * as Blockchain from "./blockchain";
3-
import * as NetworkMonitor from "./network-monitor";
4-
import * as PeerStorage from "./peer-storage";
5-
import * as TransactionPoolQuery from "./query";
6-
import * as RoundRepository from "./round-repository";
7-
import * as ServiceProviderRepository from "./service-provider-repository";
8-
import * as StateStore from "./state-store";
9-
import * as TransactionPoolProcessor from "./transaction-pool-processor";
10-
import * as TransactionRepository from "./transaction-repository";
11-
import * as WalletRepository from "./wallet-respository";
12-
13-
export {
14-
BlockRepository,
15-
Blockchain,
16-
NetworkMonitor,
17-
PeerStorage,
18-
TransactionPoolQuery,
19-
RoundRepository,
20-
ServiceProviderRepository,
21-
StateStore,
22-
TransactionPoolProcessor,
23-
TransactionRepository,
24-
WalletRepository,
25-
};
1+
export * as BlockRepository from "./block-repository";
2+
export * as Blockchain from "./blockchain";
3+
export * as NetworkMonitor from "./network-monitor";
4+
export * as PeerStorage from "./peer-storage";
5+
export * as TransactionPoolQuery from "./query";
6+
export * as RoundRepository from "./round-repository";
7+
export * as ServiceProviderRepository from "./service-provider-repository";
8+
export * as StateStore from "./state-store";
9+
export * as TransactionPoolProcessor from "./transaction-pool-processor";
10+
export * as TransactionRepository from "./transaction-repository";
11+
export * as WalletRepository from "./wallet-respository";

packages/core-test-framework/src/utils/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ export * from "./generic";
33
export * from "./rest-client";
44
export * from "./transaction-factory";
55

6-
import * as Mapper from "./mapper";
7-
8-
export { Mapper };
6+
export * as Mapper from "./mapper";
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TransactionHandlerRegistry } from "./handler-registry";
2-
import * as One from "./one";
2+
export * as One from "./one";
33
import { TransactionHandler, TransactionHandlerConstructor } from "./transaction";
4-
import * as Two from "./two";
4+
export * as Two from "./two";
55

6-
export { One, Two, TransactionHandler, TransactionHandlerConstructor, TransactionHandlerRegistry as Registry };
6+
export { TransactionHandler, TransactionHandlerConstructor, TransactionHandlerRegistry as Registry };
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
export * from "./service-provider";
22

3-
import * as Errors from "./errors";
4-
import * as Handlers from "./handlers";
3+
export * as Errors from "./errors";
4+
export * as Handlers from "./handlers";
55

66
export * from "./transaction-reader";
7-
export { Errors, Handlers };

packages/crypto/src/crypto/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import * as bip38 from "./bip38";
2-
3-
export { bip38 };
1+
export * as bip38 from "./bip38";
42
export { Hash } from "./hash";
53
export { HashAlgorithms } from "./hash-algorithms";
64
export { HDWallet } from "./hdwallet";

packages/crypto/src/index.ts

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
1-
import * as Blocks from "./blocks";
2-
import * as Constants from "./constants";
3-
import * as Crypto from "./crypto";
4-
import * as Enums from "./enums";
5-
import * as Errors from "./errors";
6-
import * as Identities from "./identities";
7-
import * as Interfaces from "./interfaces";
8-
import * as Managers from "./managers";
9-
import * as Networks from "./networks";
10-
import * as Transactions from "./transactions";
11-
import * as Types from "./types";
12-
import * as Utils from "./utils";
13-
import * as Validation from "./validation";
14-
15-
export {
16-
Blocks,
17-
Constants,
18-
Crypto,
19-
Enums,
20-
Errors,
21-
Identities,
22-
Interfaces,
23-
Managers,
24-
Networks,
25-
Transactions,
26-
Types,
27-
Utils,
28-
Validation,
29-
};
1+
export * as Blocks from "./blocks";
2+
export * as Constants from "./constants";
3+
export * as Crypto from "./crypto";
4+
export * as Enums from "./enums";
5+
export * as Errors from "./errors";
6+
export * as Identities from "./identities";
7+
export * as Interfaces from "./interfaces";
8+
export * as Managers from "./managers";
9+
export * as Networks from "./networks";
10+
export * as Transactions from "./transactions";
11+
export * as Types from "./types";
12+
export * as Utils from "./utils";
13+
export * as Validation from "./validation";

packages/crypto/src/transactions/types/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ export * from "./transaction";
22
export * from "./factory";
33
export * from "./internal-transaction-type";
44

5-
import * as One from "./one";
6-
import * as schemas from "./schemas";
7-
import * as Two from "./two";
8-
9-
export { One, Two, schemas };
5+
export * as One from "./one";
6+
export * as schemas from "./schemas";
7+
export * as Two from "./two";

0 commit comments

Comments
 (0)