Use .js imports in src (#5526)

* Use .js imports in src

* Adjust

* Fix imports

* Bump dev

* Adjust with .js imports for typegen

* Adjust

* Adjust

* Remove target override
This commit is contained in:
Jaco
2023-03-09 12:19:12 +02:00
committed by GitHub
parent f233671c27
commit 9fe2798b70
754 changed files with 1873 additions and 1871 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DeriveApi } from '../types';
import type { DeriveApi } from '../types.js';
import { createBlockNumberDerive } from './util';
import { createBlockNumberDerive } from './util.js';
/**
* @name bestNumber
@@ -1,9 +1,9 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DeriveApi } from '../types';
import type { DeriveApi } from '../types.js';
import { createBlockNumberDerive } from './util';
import { createBlockNumberDerive } from './util.js';
/**
* @name bestNumberFinalized
@@ -3,11 +3,11 @@
import type { Observable } from 'rxjs';
import type { BlockNumber } from '@polkadot/types/interfaces';
import type { DeriveApi } from '../types';
import type { DeriveApi } from '../types.js';
import { combineLatest, map } from 'rxjs';
import { memo } from '../util';
import { memo } from '../util/index.js';
/**
* @name bestNumberLag
+4 -4
View File
@@ -3,13 +3,13 @@
import type { Observable } from 'rxjs';
import type { SignedBlockExtended } from '../type/types';
import type { DeriveApi } from '../types';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, of, switchMap } from 'rxjs';
import { createSignedBlockExtended } from '../type';
import { memo } from '../util';
import { getAuthorDetails } from './util';
import { createSignedBlockExtended } from '../type/index.js';
import { memo } from '../util/index.js';
import { getAuthorDetails } from './util.js';
/**
* @name getBlock
@@ -4,11 +4,11 @@
import type { Observable } from 'rxjs';
import type { AnyNumber } from '@polkadot/types/types';
import type { SignedBlockExtended } from '../type/types';
import type { DeriveApi } from '../types';
import type { DeriveApi } from '../types.js';
import { switchMap } from 'rxjs';
import { memo } from '../util';
import { memo } from '../util/index.js';
export function getBlockByNumber (instanceId: string, api: DeriveApi): (blockNumber: AnyNumber) => Observable<SignedBlockExtended> {
return memo(instanceId, (blockNumber: AnyNumber): Observable<SignedBlockExtended> =>
+4 -4
View File
@@ -3,13 +3,13 @@
import type { Observable } from 'rxjs';
import type { HeaderExtended } from '../type/types';
import type { DeriveApi } from '../types';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, switchMap } from 'rxjs';
import { createHeaderExtended } from '../type';
import { memo } from '../util';
import { getAuthorDetails } from './util';
import { createHeaderExtended } from '../type/index.js';
import { memo } from '../util/index.js';
import { getAuthorDetails } from './util.js';
/**
* @name getHeader
+9 -9
View File
@@ -1,12 +1,12 @@
// Copyright 2017-2023 @polkadot/api-derive authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './bestNumber';
export * from './bestNumberFinalized';
export * from './bestNumberLag';
export * from './getHeader';
export * from './getBlock';
export * from './getBlockByNumber';
export * from './subscribeFinalizedHeads';
export * from './subscribeNewBlocks';
export * from './subscribeNewHeads';
export * from './bestNumber.js';
export * from './bestNumberFinalized.js';
export * from './bestNumberLag.js';
export * from './getHeader.js';
export * from './getBlock.js';
export * from './getBlockByNumber.js';
export * from './subscribeFinalizedHeads.js';
export * from './subscribeNewBlocks.js';
export * from './subscribeNewHeads.js';
@@ -3,11 +3,11 @@
import type { Observable } from 'rxjs';
import type { SignedBlockExtended } from '../type/types';
import type { DeriveApi } from '../types';
import type { DeriveApi } from '../types.js';
import { switchMap } from 'rxjs';
import { memo } from '../util';
import { memo } from '../util/index.js';
/**
* @name subscribeFinalizedBlocks
@@ -3,11 +3,11 @@
import type { Observable } from 'rxjs';
import type { Hash, Header } from '@polkadot/types/interfaces';
import type { DeriveApi } from '../types';
import type { DeriveApi } from '../types.js';
import { from, of, switchMap } from 'rxjs';
import { memo } from '../util';
import { memo } from '../util/index.js';
/**
* Returns a header range from startHash to to (not including) endHash, i.e. lastBlock.parentHash === endHash
@@ -3,11 +3,11 @@
import type { Observable } from 'rxjs';
import type { SignedBlockExtended } from '../type/types';
import type { DeriveApi } from '../types';
import type { DeriveApi } from '../types.js';
import { switchMap } from 'rxjs';
import { memo } from '../util';
import { memo } from '../util/index.js';
/**
* @name subscribeNewBlocks
@@ -3,13 +3,13 @@
import type { Observable } from 'rxjs';
import type { HeaderExtended } from '../type/types';
import type { DeriveApi } from '../types';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, of, switchMap } from 'rxjs';
import { createHeaderExtended } from '../type';
import { memo } from '../util';
import { getAuthorDetails } from './util';
import { createHeaderExtended } from '../type/index.js';
import { memo } from '../util/index.js';
import { getAuthorDetails } from './util.js';
/**
* @name subscribeNewHeads
+2 -2
View File
@@ -6,11 +6,11 @@ import type { QueryableStorage } from '@polkadot/api-base/types';
import type { Compact, Vec } from '@polkadot/types';
import type { AccountId, BlockNumber, Header } from '@polkadot/types/interfaces';
import type { Codec, IOption } from '@polkadot/types/types';
import type { DeriveApi } from '../types';
import type { DeriveApi } from '../types.js';
import { combineLatest, map, of } from 'rxjs';
import { memo, unwrapBlockNumber } from '../util';
import { memo, unwrapBlockNumber } from '../util/index.js';
// re-export these - since these needs to be resolvable from api-derive, i.e. without this
// we would emit code with ../<somewhere>/src embedded in the *.d.ts files