From ba24a7080c7001ec5dad86386fcaccac5326177c Mon Sep 17 00:00:00 2001 From: Jaco Date: Sun, 19 Dec 2021 11:19:15 +0100 Subject: [PATCH] Adjust augmentation (#4354) --- packages/api-derive/src/checkTypes.manual.ts | 8 ++++++++ packages/api-derive/src/types.ts | 2 -- packages/api-derive/tsconfig.json | 1 + packages/api-derive/tsconfig.spec.json | 1 + packages/api/src/augment.ts | 2 +- packages/api/src/checkTypes.manual.ts | 2 ++ packages/api/src/types.ts | 2 -- packages/rpc-core/src/types.ts | 2 -- 8 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 packages/api-derive/src/checkTypes.manual.ts diff --git a/packages/api-derive/src/checkTypes.manual.ts b/packages/api-derive/src/checkTypes.manual.ts new file mode 100644 index 0000000000..7265d248a3 --- /dev/null +++ b/packages/api-derive/src/checkTypes.manual.ts @@ -0,0 +1,8 @@ +// Copyright 2017-2021 @polkadot/api-derive authors & contributors +// SPDX-License-Identifier: Apache-2.0 + +import './augment'; + +import { derive } from '.'; + +console.log(derive.chain.bestNumber); diff --git a/packages/api-derive/src/types.ts b/packages/api-derive/src/types.ts index 9e10b63752..2c3913734b 100644 --- a/packages/api-derive/src/types.ts +++ b/packages/api-derive/src/types.ts @@ -1,8 +1,6 @@ // Copyright 2017-2021 @polkadot/api-derive authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './augment'; - import type { ApiInterfaceRx } from '@polkadot/api-base/types'; import type { u32 } from '@polkadot/types'; import type { Balance, BlockNumber, BountyIndex, Hash, Proposal, ProposalIndex, SetIndex, Votes } from '@polkadot/types/interfaces'; diff --git a/packages/api-derive/tsconfig.json b/packages/api-derive/tsconfig.json index 45c215d503..2b11bb0c8f 100644 --- a/packages/api-derive/tsconfig.json +++ b/packages/api-derive/tsconfig.json @@ -7,6 +7,7 @@ }, "exclude": [ "**/test/*", + "**/*.manual.ts", "**/*.spec.ts" ], "references": [ diff --git a/packages/api-derive/tsconfig.spec.json b/packages/api-derive/tsconfig.spec.json index 857b3222fe..e8902a3154 100644 --- a/packages/api-derive/tsconfig.spec.json +++ b/packages/api-derive/tsconfig.spec.json @@ -9,6 +9,7 @@ }, "include": [ "**/test/*", + "**/*.manual.ts", "**/*.spec.ts" ], "references": [ diff --git a/packages/api/src/augment.ts b/packages/api/src/augment.ts index 453f1d19b7..d35cf47a29 100644 --- a/packages/api/src/augment.ts +++ b/packages/api/src/augment.ts @@ -1,5 +1,5 @@ // Copyright 2017-2021 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import '@polkadot/api-augment'; +// import '@polkadot/api-augment'; import '@polkadot/rpc-augment'; diff --git a/packages/api/src/checkTypes.manual.ts b/packages/api/src/checkTypes.manual.ts index 3b85925a17..5a6f9fd18d 100644 --- a/packages/api/src/checkTypes.manual.ts +++ b/packages/api/src/checkTypes.manual.ts @@ -3,6 +3,8 @@ // Simple non-runnable checks to test type definitions in the editor itself +import './augment'; + import type { HeaderExtended } from '@polkadot/api-derive/types'; import type { StorageKey } from '@polkadot/types'; import type { AccountId, Balance, DispatchErrorModule, Event, Header, Index } from '@polkadot/types/interfaces'; diff --git a/packages/api/src/types.ts b/packages/api/src/types.ts index dbf04e5c46..ad94245f4f 100644 --- a/packages/api/src/types.ts +++ b/packages/api/src/types.ts @@ -1,8 +1,6 @@ // Copyright 2017-2021 @polkadot/api authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './augment'; - import type { QueryableConsts } from '@polkadot/api-augment/consts'; import type { DecoratedErrors } from '@polkadot/api-augment/errors'; import type { DecoratedEvents } from '@polkadot/api-augment/events'; diff --git a/packages/rpc-core/src/types.ts b/packages/rpc-core/src/types.ts index 92789dc62b..2747415322 100644 --- a/packages/rpc-core/src/types.ts +++ b/packages/rpc-core/src/types.ts @@ -1,7 +1,5 @@ // Copyright 2017-2021 @polkadot/rpc-core authors & contributors // SPDX-License-Identifier: Apache-2.0 -import './augment'; - export type { RpcInterface } from '@polkadot/rpc-augment/rpc'; export type { AugmentedRpc, RpcInterfaceMethod } from '@polkadot/rpc-augment/types';