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
+4 -4
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2023 @polkadot/types-codec authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { packageInfo } from './packageInfo';
export { TypeDefInfo } from './types';
export { packageInfo } from './packageInfo.js';
export { TypeDefInfo } from './types/index.js';
export * from './create';
export * from './util';
export * from './create/index.js';
export * from './util/index.js';
+3 -3
View File
@@ -2,13 +2,13 @@
// SPDX-License-Identifier: Apache-2.0
import type { Codec, CodecClass, LookupString, Registry, U8aBitLength, UIntBitLength } from '@polkadot/types-codec/types';
import type { TypeDef } from '../types';
import type { TypeDef } from '../types/index.js';
import { BTreeMap, BTreeSet, Bytes, CodecSet, Compact, DoNotConstruct, Enum, HashMap, Int, Null, Option, Range, RangeInclusive, Result, Struct, Tuple, U8aFixed, UInt, Vec, VecFixed, WrapperKeepOpaque, WrapperOpaque } from '@polkadot/types-codec';
import { isNumber, stringify } from '@polkadot/util';
import { TypeDefInfo } from '../types';
import { getTypeDef } from '../util/getTypeDef';
import { TypeDefInfo } from '../types/index.js';
import { getTypeDef } from '../util/getTypeDef.js';
function getTypeDefType ({ lookupName, type }: TypeDef): string {
return lookupName || type;
+2 -2
View File
@@ -1,5 +1,5 @@
// Copyright 2017-2023 @polkadot/types-create authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './class';
export * from './type';
export * from './class.js';
export * from './type.js';
+2 -2
View File
@@ -2,12 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
import type { Codec, CodecClass, IU8a, Registry } from '@polkadot/types-codec/types';
import type { CreateOptions } from '../types';
import type { CreateOptions } from '../types/index.js';
import { Bytes, Option } from '@polkadot/types-codec';
import { isHex, isU8a, u8aEq, u8aToHex, u8aToU8a } from '@polkadot/util';
import { createClassUnsafe } from './class';
import { createClassUnsafe } from './class.js';
// With isPedantic, actually check that the encoding matches that supplied. This
// is much slower, but verifies that we have the correct types defined
+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-create 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-create authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './index';
export * from './index.js';
+3 -3
View File
@@ -1,9 +1,9 @@
// Copyright 2017-2023 @polkadot/types-create authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './augmentRegistry';
import './augmentRegistry.js';
export type { CodecCreateOptions as CreateOptions } from '@polkadot/types-codec/types';
export * from './lookup';
export * from './types';
export * from './lookup.js';
export * from './types.js';
+1 -1
View File
@@ -3,7 +3,7 @@
import type { Option, Text } from '@polkadot/types-codec';
import type { ICompact, INumber, LookupString } from '@polkadot/types-codec/types';
import type { TypeDef } from './types';
import type { TypeDef } from './types.js';
// A simplified SiType without the need for an interface import
// (while type interfaces are still in @polkadot/types). This provides
@@ -6,7 +6,7 @@ import type { TypeDef } from '@polkadot/types-create/types';
import { isNumber, isUndefined, objectSpread, stringify } from '@polkadot/util';
import { TypeDefInfo } from '../types';
import { TypeDefInfo } from '../types/index.js';
type ToString = { toString: () => string };
+2 -2
View File
@@ -7,8 +7,8 @@ import type { TypeDef } from '@polkadot/types-create/types';
import { sanitize } from '@polkadot/types-codec';
import { isNumber, isString, objectSpread } from '@polkadot/util';
import { TypeDefInfo } from '../types';
import { typeSplit } from './typeSplit';
import { TypeDefInfo } from '../types/index.js';
import { typeSplit } from './typeSplit.js';
interface TypeDefOptions {
name?: string;
+4 -4
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2023 @polkadot/types-create authors & contributors
// SPDX-License-Identifier: Apache-2.0
export * from './encodeTypes';
export * from './getTypeDef';
export * from './typeSplit';
export * from './xcm';
export * from './encodeTypes.js';
export * from './getTypeDef.js';
export * from './typeSplit.js';
export * from './xcm.js';