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
@@ -3,6 +3,6 @@
export { mapXcmTypes } from '@polkadot/types-create';
export { packageInfo } from './packageInfo';
export { packageInfo } from './packageInfo.js';
export * from './util';
export * from './util.js';
+2 -2
View File
@@ -5,7 +5,7 @@
import { detectPackage } from '@polkadot/util';
import others from './detectOther';
import { packageInfo } from './packageInfo';
import others from './detectOther.js';
import { packageInfo } from './packageInfo.js';
detectPackage(packageInfo, null, others);
+2 -2
View File
@@ -1,6 +1,6 @@
// Copyright 2017-2023 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './detectPackage';
import './detectPackage.js';
export * from './bundle';
export * from './bundle.js';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2023 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index';
export * from './index.js';
+9 -9
View File
@@ -3,15 +3,15 @@
import type { OverrideVersionedType } from '@polkadot/types/types';
import centrifugeChain from './centrifuge-chain';
import kusama from './kusama';
import node from './node';
import nodeTemplate from './node-template';
import polkadot from './polkadot';
import rococo from './rococo';
import shell from './shell';
import statemint from './statemint';
import westend from './westend';
import centrifugeChain from './centrifuge-chain.js';
import kusama from './kusama.js';
import node from './node.js';
import nodeTemplate from './node-template.js';
import polkadot from './polkadot.js';
import rococo from './rococo.js';
import shell from './shell.js';
import statemint from './statemint.js';
import westend from './westend.js';
// Type overrides for specific spec types & versions as given in runtimeVersion
const typesSpec: Record<string, OverrideVersionedType[]> = {
@@ -1,15 +1,17 @@
// Copyright 2017-2023 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@polkadot/dev/node/test/node" />
import type { HexString } from '@polkadot/util/types';
import type { ChainUpgradesExpanded } from '../types';
import type { ChainUpgradesExpanded } from '../types.js';
import fs from 'node:fs';
import { ApiPromise, WsProvider } from '@polkadot/api';
import * as allMan from '../manual';
import * as allGen from '.';
import * as allMan from '../manual/index.js';
import * as allGen from './index.js';
const keys = ['kusama', 'polkadot', 'westend'] as const;
const urls = {
@@ -35,7 +37,7 @@ for (const chain of keys) {
// Auto-generated from on-chain data & manual definitions, do not edit
/* eslint-disable quotes, comma-spacing */
import type { ChainUpgradesExpanded } from '../types';
import type { ChainUpgradesExpanded } from '../types.js';
const upgrades: ChainUpgradesExpanded = ${JSON.stringify(final, null, 2)};
@@ -1,6 +1,6 @@
// Copyright 2017-2023 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { default as kusama } from './kusama';
export { default as polkadot } from './polkadot';
export { default as westend } from './westend';
export { default as kusama } from './kusama.js';
export { default as polkadot } from './polkadot.js';
export { default as westend } from './westend.js';
@@ -4,7 +4,7 @@
// Auto-generated from on-chain data & manual definitions, do not edit
/* eslint-disable quotes, comma-spacing */
import type { ChainUpgradesExpanded } from '../types';
import type { ChainUpgradesExpanded } from '../types.js';
const upgrades: ChainUpgradesExpanded = [
[
@@ -4,7 +4,7 @@
// Auto-generated from on-chain data & manual definitions, do not edit
/* eslint-disable quotes, comma-spacing */
import type { ChainUpgradesExpanded } from '../types';
import type { ChainUpgradesExpanded } from '../types.js';
const upgrades: ChainUpgradesExpanded = [
[
@@ -4,7 +4,7 @@
// Auto-generated from on-chain data & manual definitions, do not edit
/* eslint-disable quotes, comma-spacing */
import type { ChainUpgradesExpanded } from '../types';
import type { ChainUpgradesExpanded } from '../types.js';
const upgrades: ChainUpgradesExpanded = [
[
@@ -3,13 +3,13 @@
/// <reference types="@polkadot/dev/node/test/node" />
import type { ChainUpgradesExpanded, ChainUpgradesRaw } from './types';
import type { ChainUpgradesExpanded, ChainUpgradesRaw } from './types.js';
import { stringify, u8aEq } from '@polkadot/util';
import * as allGen from './e2e';
import * as allMan from './manual';
import all from '.';
import * as allGen from './e2e/index.js';
import * as allMan from './manual/index.js';
import all from './index.js';
interface TestDef {
genesisHash: string;
+2 -2
View File
@@ -3,12 +3,12 @@
import type { ChainUpgrades } from '@polkadot/types/types';
import type { HexString } from '@polkadot/util/types';
import type { ChainUpgradesExpanded } from './types';
import type { ChainUpgradesExpanded } from './types.js';
import { selectableNetworks } from '@polkadot/networks';
import { BN, hexToU8a } from '@polkadot/util';
import * as allKnown from './e2e';
import * as allKnown from './e2e/index.js';
// testnets are not available in the networks map
const NET_EXTRA: Record<string, { genesisHash: HexString[] }> = {
@@ -1,6 +1,6 @@
// Copyright 2017-2023 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { default as kusama } from './kusama';
export { default as polkadot } from './polkadot';
export { default as westend } from './westend';
export { default as kusama } from './kusama.js';
export { default as polkadot } from './polkadot.js';
export { default as westend } from './westend.js';
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ChainUpgradesRaw } from '../types';
import type { ChainUpgradesRaw } from '../types.js';
const upgrades: ChainUpgradesRaw = [
[0, 1020], [26669, 1021], [38245, 1022], [54248, 1023], [59659, 1024],
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ChainUpgradesRaw } from '../types';
import type { ChainUpgradesRaw } from '../types.js';
const upgrades: ChainUpgradesRaw = [
[0, 0], [29231, 1], [188836, 5], [199405, 6], [214264, 7],
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ChainUpgradesRaw } from '../types';
import type { ChainUpgradesRaw } from '../types.js';
const upgrades: ChainUpgradesRaw = [
[214356, 4], [392764, 7], [409740, 8], [809976, 20], [877581, 24],
+3 -3
View File
@@ -9,9 +9,9 @@ import type { BN } from '@polkadot/util';
import { bnToBn, objectSpread } from '@polkadot/util';
import typesChain from './chain';
import typesSpec from './spec';
import upgrades from './upgrades';
import typesChain from './chain/index.js';
import typesSpec from './spec/index.js';
import upgrades from './upgrades/index.js';
/**
* @description Perform the callback function using the stringified spec/chain