From bb308f87e7bf70eef1ad4f2a879c3f2301efcb02 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 7 Dec 2020 16:41:26 +0100 Subject: [PATCH] Bup dev (import sorting) (#411) --- package.json | 4 +- packages/example-react/src/index.tsx | 3 +- packages/example-vue/src/index.ts | 3 +- packages/exampleReactNative/App.tsx | 3 +- packages/exampleReactNative/index.js | 1 + .../exampleReactNative/nodeGlobalsShim.js | 1 + packages/ledger/src/index.ts | 3 +- packages/react-identicon/src/Demo.tsx | 1 + packages/react-identicon/src/Identicon.tsx | 1 + .../react-identicon/src/icons/Beachball.tsx | 1 + .../react-identicon/src/icons/Jdenticon.tsx | 2 +- .../react-identicon/src/icons/Polkadot.tsx | 2 + packages/react-identicon/src/index.ts | 1 + packages/react-qr/src/Display.tsx | 1 + packages/react-qr/src/DisplayAddress.tsx | 2 +- packages/react-qr/src/DisplayPayload.tsx | 2 +- packages/react-qr/src/NetworkSpecs.tsx | 4 +- packages/react-qr/src/ScanAddress.tsx | 1 + packages/react-qr/src/util.spec.ts | 4 +- .../reactnative-identicon/src/Identicon.tsx | 1 + .../src/icons/Polkadot.tsx | 1 + packages/reactnative-identicon/src/index.ts | 1 + packages/ui-keyring/package.json | 2 +- packages/ui-keyring/src/Keyring.ts | 5 +- packages/ui-keyring/src/defaults.ts | 2 +- .../ui-keyring/src/observable/accounts.ts | 1 - .../ui-keyring/src/observable/addresses.ts | 1 - .../ui-keyring/src/observable/contracts.ts | 1 - .../src/observable/genericSubject.ts | 2 +- packages/ui-keyring/src/options/index.ts | 5 +- packages/ui-keyring/src/stores/Browser.ts | 2 +- packages/ui-keyring/src/stores/File.ts | 3 +- packages/ui-keyring/src/types.ts | 2 +- packages/ui-settings/src/Settings.ts | 3 +- packages/ui-settings/src/defaults/index.ts | 4 +- packages/ui-settings/src/index.ts | 1 + .../src/icons/beachball/colors.spec.ts | 2 +- .../ui-shared/src/icons/beachball/colors.ts | 1 + .../src/icons/beachball/container.ts | 1 + .../ui-shared/src/icons/beachball/defaults.ts | 1 + .../ui-shared/src/icons/beachball/demo.ts | 1 + .../ui-shared/src/icons/beachball/index.ts | 7 +- .../src/icons/beachball/shape/circle.ts | 3 +- .../src/icons/beachball/shape/square.ts | 3 +- .../src/icons/beachball/svg/element.ts | 1 + .../ui-shared/src/icons/beachball/svg/svg.ts | 1 + packages/ui-shared/src/icons/polkadot.ts | 1 + packages/vue-identicon/src/Identicon.ts | 1 + packages/vue-identicon/src/icons/Beachball.ts | 1 + packages/vue-identicon/src/icons/Jdenticon.ts | 2 +- packages/vue-identicon/src/icons/Polkadot.ts | 1 + yarn.lock | 73 +++++++++++++------ 52 files changed, 117 insertions(+), 60 deletions(-) diff --git a/package.json b/package.json index 807bf38a..5b5f8bb5 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "scripts": { "build": "polkadot-dev-build-ts", "build:release": "polkadot-ci-ghact-build", - "lint": "polkadot-dev-run-lint", + "lint": "polkadot-dev-run-lint --fix", "clean": "polkadot-dev-clean-build", "demo:identicon:react": "yarn build && webpack-serve --config packages/react-identicon/webpack.config.js --content packages/react-identicon --port 8080", "demo:identicon:vue": "yarn build && webpack-serve --config packages/vue-identicon/webpack.config.js --content packages/vue-identicon --port 8080", @@ -29,7 +29,7 @@ "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", - "@polkadot/dev": "^0.60.7", + "@polkadot/dev": "^0.60.11", "@polkadot/ts": "^0.3.57", "@types/jest": "^26.0.16", "babel-plugin-transform-vue-template": "^0.4.2", diff --git a/packages/example-react/src/index.tsx b/packages/example-react/src/index.tsx index 8238706e..2dd9731b 100644 --- a/packages/example-react/src/index.tsx +++ b/packages/example-react/src/index.tsx @@ -3,10 +3,11 @@ import React, { useCallback, useEffect, useState } from 'react'; import ReactDOM from 'react-dom'; + import Identicon from '@polkadot/react-identicon'; import keyring from '@polkadot/ui-keyring'; import settings from '@polkadot/ui-settings'; -import { mnemonicGenerate, cryptoWaitReady } from '@polkadot/util-crypto'; +import { cryptoWaitReady, mnemonicGenerate } from '@polkadot/util-crypto'; interface Props { className?: string; diff --git a/packages/example-vue/src/index.ts b/packages/example-vue/src/index.ts index 9cb8174d..187b9af4 100644 --- a/packages/example-vue/src/index.ts +++ b/packages/example-vue/src/index.ts @@ -4,9 +4,10 @@ import type { Prefix } from '@polkadot/util-crypto/address/types'; import Vue, { VNode } from 'vue'; + import keyring from '@polkadot/ui-keyring'; import settings from '@polkadot/ui-settings'; -import { mnemonicGenerate, cryptoWaitReady } from '@polkadot/util-crypto'; +import { cryptoWaitReady, mnemonicGenerate } from '@polkadot/util-crypto'; import Identicon from '@polkadot/vue-identicon'; interface Account { diff --git a/packages/exampleReactNative/App.tsx b/packages/exampleReactNative/App.tsx index f0e8fb8c..c70b899e 100644 --- a/packages/exampleReactNative/App.tsx +++ b/packages/exampleReactNative/App.tsx @@ -4,10 +4,11 @@ import React, { useEffect, useState } from 'react'; import { Button, SafeAreaView, ScrollView, StatusBar, StyleSheet, Text, View } from 'react-native'; import { Colors } from 'react-native/Libraries/NewAppScreen'; + import Identicon from '@polkadot/reactnative-identicon'; import keyring from '@polkadot/ui-keyring'; import settings from '@polkadot/ui-settings'; -import { mnemonicGenerate, cryptoWaitReady } from '@polkadot/util-crypto'; +import { cryptoWaitReady, mnemonicGenerate } from '@polkadot/util-crypto'; const styles = StyleSheet.create({ body: { diff --git a/packages/exampleReactNative/index.js b/packages/exampleReactNative/index.js index 1e11e7a9..047dd622 100644 --- a/packages/exampleReactNative/index.js +++ b/packages/exampleReactNative/index.js @@ -4,6 +4,7 @@ import './nodeGlobalsShim.js'; import { AppRegistry } from 'react-native'; + import App from './App'; import { name as appName } from './app.json'; diff --git a/packages/exampleReactNative/nodeGlobalsShim.js b/packages/exampleReactNative/nodeGlobalsShim.js index 7238430d..b846da49 100644 --- a/packages/exampleReactNative/nodeGlobalsShim.js +++ b/packages/exampleReactNative/nodeGlobalsShim.js @@ -4,6 +4,7 @@ /* eslint-disable no-global-assign */ import 'fast-text-encoding'; + import AsyncStorage from '@react-native-community/async-storage'; class Storage { diff --git a/packages/ledger/src/index.ts b/packages/ledger/src/index.ts index 00665b8e..85ee995c 100644 --- a/packages/ledger/src/index.ts +++ b/packages/ledger/src/index.ts @@ -4,7 +4,8 @@ import type Transport from '@ledgerhq/hw-transport'; import type { AccountOptions, LedgerAddress, LedgerSignature, LedgerTypes, LedgerVersion } from './types'; -import { ResponseBase, SubstrateApp, newKusamaApp, newPolkadotApp } from '@zondax/ledger-polkadot'; +import { newKusamaApp, newPolkadotApp, ResponseBase, SubstrateApp } from '@zondax/ledger-polkadot'; + import transports from '@polkadot/ledger-transports'; import { assert, bufferToU8a, u8aToBuffer, u8aToHex } from '@polkadot/util'; diff --git a/packages/react-identicon/src/Demo.tsx b/packages/react-identicon/src/Demo.tsx index f3263b00..c4db3c66 100644 --- a/packages/react-identicon/src/Demo.tsx +++ b/packages/react-identicon/src/Demo.tsx @@ -3,6 +3,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; + import { encodeAddress, randomAsU8a } from '@polkadot/util-crypto'; import IdentityIcon from '.'; diff --git a/packages/react-identicon/src/Identicon.tsx b/packages/react-identicon/src/Identicon.tsx index c1d5b679..4c46b939 100644 --- a/packages/react-identicon/src/Identicon.tsx +++ b/packages/react-identicon/src/Identicon.tsx @@ -7,6 +7,7 @@ import type { IdentityProps as Props, Props as ComponentProps } from './types'; import React from 'react'; import CopyToClipboard from 'react-copy-to-clipboard'; import styled from 'styled-components'; + import settings, { ICON_DEFAULT_HOST } from '@polkadot/ui-settings'; import { isHex, isU8a, u8aToHex } from '@polkadot/util'; import { decodeAddress, encodeAddress, ethereumEncode } from '@polkadot/util-crypto'; diff --git a/packages/react-identicon/src/icons/Beachball.tsx b/packages/react-identicon/src/icons/Beachball.tsx index 8895d23a..fede3219 100644 --- a/packages/react-identicon/src/icons/Beachball.tsx +++ b/packages/react-identicon/src/icons/Beachball.tsx @@ -4,6 +4,7 @@ import type { Props } from '../types'; import React, { useCallback } from 'react'; + import { beachballIcon } from '@polkadot/ui-shared'; function Beachball ({ address, className = '', size, style }: Props): React.ReactElement { diff --git a/packages/react-identicon/src/icons/Jdenticon.tsx b/packages/react-identicon/src/icons/Jdenticon.tsx index 65803314..0583d827 100644 --- a/packages/react-identicon/src/icons/Jdenticon.tsx +++ b/packages/react-identicon/src/icons/Jdenticon.tsx @@ -3,8 +3,8 @@ import type { Props } from '../types'; -import React from 'react'; import jdenticon from 'jdenticon'; +import React from 'react'; function Jdenticon ({ className = '', publicKey, size, style }: Props): React.ReactElement { return ( diff --git a/packages/react-identicon/src/icons/Polkadot.tsx b/packages/react-identicon/src/icons/Polkadot.tsx index 8911109c..67b7d90d 100644 --- a/packages/react-identicon/src/icons/Polkadot.tsx +++ b/packages/react-identicon/src/icons/Polkadot.tsx @@ -1,5 +1,6 @@ // Copyright 2018-2020 @polkadot/react-identicon authors & contributors // SPDX-License-Identifier: Apache-2.0 + // Copyright 2018 Paritytech via paritytech/oo7/polkadot-identicon // This has been converted from the original version that can be found at @@ -19,6 +20,7 @@ import type { Circle } from '@polkadot/ui-shared/icons/types'; import type { Props } from '../types'; import React from 'react'; + import { polkadotIcon } from '@polkadot/ui-shared'; function renderCircle ({ cx, cy, fill, r }: Circle, key: number): React.ReactNode { diff --git a/packages/react-identicon/src/index.ts b/packages/react-identicon/src/index.ts index a79fb0b9..8b7bc9f2 100644 --- a/packages/react-identicon/src/index.ts +++ b/packages/react-identicon/src/index.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import Identicon from './Identicon'; + export * from './icons'; export default Identicon; diff --git a/packages/react-qr/src/Display.tsx b/packages/react-qr/src/Display.tsx index d9f22540..1ab5b63d 100644 --- a/packages/react-qr/src/Display.tsx +++ b/packages/react-qr/src/Display.tsx @@ -3,6 +3,7 @@ import React, { useEffect, useMemo, useRef, useState } from 'react'; import styled from 'styled-components'; + import { xxhashAsHex } from '@polkadot/util-crypto'; import qrcode from './qrcode'; diff --git a/packages/react-qr/src/DisplayAddress.tsx b/packages/react-qr/src/DisplayAddress.tsx index f3dfc524..4a466d18 100644 --- a/packages/react-qr/src/DisplayAddress.tsx +++ b/packages/react-qr/src/DisplayAddress.tsx @@ -3,8 +3,8 @@ import React, { useMemo } from 'react'; -import { createAddressPayload } from './util'; import QrDisplay from './Display'; +import { createAddressPayload } from './util'; interface Props { address: string; diff --git a/packages/react-qr/src/DisplayPayload.tsx b/packages/react-qr/src/DisplayPayload.tsx index 1b37da2c..ec19aa48 100644 --- a/packages/react-qr/src/DisplayPayload.tsx +++ b/packages/react-qr/src/DisplayPayload.tsx @@ -3,8 +3,8 @@ import React, { useMemo } from 'react'; -import { createSignPayload } from './util'; import QrDisplay from './Display'; +import { createSignPayload } from './util'; interface Props { address: string; diff --git a/packages/react-qr/src/NetworkSpecs.tsx b/packages/react-qr/src/NetworkSpecs.tsx index 61f43fef..6a09d8a8 100644 --- a/packages/react-qr/src/NetworkSpecs.tsx +++ b/packages/react-qr/src/NetworkSpecs.tsx @@ -1,11 +1,11 @@ // Copyright 2017-2020 @polkadot/react-qr authors & contributors // SPDX-License-Identifier: Apache-2.0 +import React, { useMemo } from 'react'; + import { NetworkSpecsStruct } from '@polkadot/ui-settings'; -import React, { useMemo } from 'react'; import QrDisplay from './Display'; - import { encodeString } from './util'; interface Props { diff --git a/packages/react-qr/src/ScanAddress.tsx b/packages/react-qr/src/ScanAddress.tsx index 1b18c4da..467b4408 100644 --- a/packages/react-qr/src/ScanAddress.tsx +++ b/packages/react-qr/src/ScanAddress.tsx @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import React, { useCallback } from 'react'; + import { assert } from '@polkadot/util'; import { decodeAddress } from '@polkadot/util-crypto'; diff --git a/packages/react-qr/src/util.spec.ts b/packages/react-qr/src/util.spec.ts index 0db25ab8..16ecee60 100644 --- a/packages/react-qr/src/util.spec.ts +++ b/packages/react-qr/src/util.spec.ts @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 import { u8aConcat, u8aToHex, u8aToString } from '@polkadot/util'; - -import { createAddressPayload, createSignPayload, createFrames, decodeString, encodeNumber, encodeString } from './util'; import { randomAsU8a } from '@polkadot/util-crypto'; +import { createAddressPayload, createFrames, createSignPayload, decodeString, encodeNumber, encodeString } from './util'; + describe('util', (): void => { describe('Uint8Array <-> string', (): void => { let u8a: Uint8Array; diff --git a/packages/reactnative-identicon/src/Identicon.tsx b/packages/reactnative-identicon/src/Identicon.tsx index 268e46b7..7ceee746 100644 --- a/packages/reactnative-identicon/src/Identicon.tsx +++ b/packages/reactnative-identicon/src/Identicon.tsx @@ -5,6 +5,7 @@ import type { Prefix } from '@polkadot/util-crypto/address/types'; import type { Props as ComponentProps } from './types'; import React from 'react'; + import { isHex, isU8a, u8aToHex } from '@polkadot/util'; import { decodeAddress, encodeAddress } from '@polkadot/util-crypto'; diff --git a/packages/reactnative-identicon/src/icons/Polkadot.tsx b/packages/reactnative-identicon/src/icons/Polkadot.tsx index 1dba33b6..e35f0d35 100644 --- a/packages/reactnative-identicon/src/icons/Polkadot.tsx +++ b/packages/reactnative-identicon/src/icons/Polkadot.tsx @@ -7,6 +7,7 @@ import type { Props } from '../types'; import React from 'react'; import { View } from 'react-native'; import Svg, { Circle as SvgCircle } from 'react-native-svg'; + import { polkadotIcon } from '@polkadot/ui-shared'; function renderCircle ({ cx, cy, fill, r }: CircleType, key: number): React.ReactNode { diff --git a/packages/reactnative-identicon/src/index.ts b/packages/reactnative-identicon/src/index.ts index 58f9df7f..95b7e65a 100644 --- a/packages/reactnative-identicon/src/index.ts +++ b/packages/reactnative-identicon/src/index.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import Identicon from './Identicon'; + export * from './icons'; export default Identicon; diff --git a/packages/ui-keyring/package.json b/packages/ui-keyring/package.json index c7658ba3..ac3bedde 100644 --- a/packages/ui-keyring/package.json +++ b/packages/ui-keyring/package.json @@ -19,7 +19,7 @@ "store": "^2.0.12" }, "devDependencies": { - "@polkadot/types": "^2.9.2-8", + "@polkadot/types": "^2.10.1", "@types/mkdirp": "^1.0.1", "@types/store": "^2.0.2" }, diff --git a/packages/ui-keyring/src/Keyring.ts b/packages/ui-keyring/src/Keyring.ts index ff05a764..ebd7a22f 100644 --- a/packages/ui-keyring/src/Keyring.ts +++ b/packages/ui-keyring/src/Keyring.ts @@ -1,12 +1,13 @@ // Copyright 2017-2020 @polkadot/ui-keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringPair, KeyringPair$Meta, KeyringPair$Json } from '@polkadot/keyring/types'; +import type { KeyringPair, KeyringPair$Json, KeyringPair$Meta } from '@polkadot/keyring/types'; import type { KeypairType } from '@polkadot/util-crypto/types'; import type { AddressSubject, SingleAddress } from './observable/types'; import type { CreateResult, KeyringAddress, KeyringAddressType, KeyringItemType, KeyringJson, KeyringJson$Meta, KeyringOptions, KeyringStruct } from './types'; import BN from 'bn.js'; + import { createPair } from '@polkadot/keyring/pair'; import chains from '@polkadot/ui-settings/defaults/chains'; import { bnToBn, hexToU8a, isHex, isString, u8aSorted } from '@polkadot/util'; @@ -14,7 +15,7 @@ import { base64Decode, createKeyMulti } from '@polkadot/util-crypto'; import env from './observable/development'; import Base from './Base'; -import { accountKey, addressKey, accountRegex, addressRegex, contractKey, contractRegex } from './defaults'; +import { accountKey, accountRegex, addressKey, addressRegex, contractKey, contractRegex } from './defaults'; import { KeyringOption } from './options'; const RECENT_EXPIRY = 24 * 60 * 60; diff --git a/packages/ui-keyring/src/defaults.ts b/packages/ui-keyring/src/defaults.ts index 7c551dcb..132a7591 100644 --- a/packages/ui-keyring/src/defaults.ts +++ b/packages/ui-keyring/src/defaults.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/ui-keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import { u8aToHex } from '@polkadot/util'; import { decodeAddress } from '@polkadot/keyring'; +import { u8aToHex } from '@polkadot/util'; const ACCOUNT_PREFIX = 'account:'; const ADDRESS_PREFIX = 'address:'; diff --git a/packages/ui-keyring/src/observable/accounts.ts b/packages/ui-keyring/src/observable/accounts.ts index 3ed25042..b06c64e0 100644 --- a/packages/ui-keyring/src/observable/accounts.ts +++ b/packages/ui-keyring/src/observable/accounts.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import { accountKey } from '../defaults'; - import genericSubject from './genericSubject'; export default genericSubject(accountKey, true); diff --git a/packages/ui-keyring/src/observable/addresses.ts b/packages/ui-keyring/src/observable/addresses.ts index fcb2b245..e1734364 100644 --- a/packages/ui-keyring/src/observable/addresses.ts +++ b/packages/ui-keyring/src/observable/addresses.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import { addressKey } from '../defaults'; - import genericSubject from './genericSubject'; export default genericSubject(addressKey); diff --git a/packages/ui-keyring/src/observable/contracts.ts b/packages/ui-keyring/src/observable/contracts.ts index 69d98e91..15beee85 100644 --- a/packages/ui-keyring/src/observable/contracts.ts +++ b/packages/ui-keyring/src/observable/contracts.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import { contractKey } from '../defaults'; - import genericSubject from './genericSubject'; export default genericSubject(contractKey); diff --git a/packages/ui-keyring/src/observable/genericSubject.ts b/packages/ui-keyring/src/observable/genericSubject.ts index 4e5b2d02..4b747693 100644 --- a/packages/ui-keyring/src/observable/genericSubject.ts +++ b/packages/ui-keyring/src/observable/genericSubject.ts @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import type { KeypairType } from '@polkadot/util-crypto/types'; -import type { SubjectInfo, AddressSubject, SingleAddress } from './types'; import type { KeyringJson, KeyringStore } from '../types'; +import type { AddressSubject, SingleAddress, SubjectInfo } from './types'; import { BehaviorSubject } from 'rxjs'; diff --git a/packages/ui-keyring/src/options/index.ts b/packages/ui-keyring/src/options/index.ts index 36425935..109fd0ec 100644 --- a/packages/ui-keyring/src/options/index.ts +++ b/packages/ui-keyring/src/options/index.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/ui-keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringStruct } from '../types'; import type { SingleAddress } from '../observable/types'; -import type { KeyringOptions, KeyringOptionInstance, KeyringSectionOption, KeyringSectionOptions } from './types'; +import type { KeyringStruct } from '../types'; +import type { KeyringOptionInstance, KeyringOptions, KeyringSectionOption, KeyringSectionOptions } from './types'; import { BehaviorSubject } from 'rxjs'; + import { assert } from '@polkadot/util'; import observableAll from '../observable'; diff --git a/packages/ui-keyring/src/stores/Browser.ts b/packages/ui-keyring/src/stores/Browser.ts index f8a70260..fa262382 100644 --- a/packages/ui-keyring/src/stores/Browser.ts +++ b/packages/ui-keyring/src/stores/Browser.ts @@ -1,7 +1,7 @@ // Copyright 2017-2020 @polkadot/ui-keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringStore, KeyringJson } from '../types'; +import type { KeyringJson, KeyringStore } from '../types'; import store from 'store'; diff --git a/packages/ui-keyring/src/stores/File.ts b/packages/ui-keyring/src/stores/File.ts index eb48307f..772deb25 100644 --- a/packages/ui-keyring/src/stores/File.ts +++ b/packages/ui-keyring/src/stores/File.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/ui-keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { KeyringStore, KeyringJson } from '../types'; +import type { KeyringJson, KeyringStore } from '../types'; import fs from 'fs'; import mkdirp from 'mkdirp'; import path from 'path'; + import { assert } from '@polkadot/util'; // NOTE untested and unused by any known apps, probably broken in various mysterious ways diff --git a/packages/ui-keyring/src/types.ts b/packages/ui-keyring/src/types.ts index b6285214..3e4511d8 100644 --- a/packages/ui-keyring/src/types.ts +++ b/packages/ui-keyring/src/types.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/ui-keyring authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { KeyringInstance as BaseKeyringInstance, KeyringOptions as KeyringOptionsBase, KeyringPair, KeyringPair$Json, KeyringPair$Meta } from '@polkadot/keyring/types'; import type { Hash } from '@polkadot/types/interfaces'; -import type { KeyringInstance as BaseKeyringInstance, KeyringPair, KeyringPair$Meta, KeyringPair$Json, KeyringOptions as KeyringOptionsBase } from '@polkadot/keyring/types'; import type { KeypairType } from '@polkadot/util-crypto/types'; import type { AddressSubject, SingleAddress } from './observable/types'; diff --git a/packages/ui-settings/src/Settings.ts b/packages/ui-settings/src/Settings.ts index bc0d4d88..98ad4662 100644 --- a/packages/ui-settings/src/Settings.ts +++ b/packages/ui-settings/src/Settings.ts @@ -5,9 +5,10 @@ import type { Option, SettingsStruct } from './types'; import EventEmitter from 'eventemitter3'; import store from 'store'; + import { isUndefined } from '@polkadot/util'; -import { CAMERA_DEFAULT, CAMERA, CRYPTOS, CRYPTOS_ETH, ENDPOINT_DEFAULT, ENDPOINTS, ICON_DEFAULT, ICONS, LANGUAGE_DEFAULT, LEDGER_CONN, LEDGER_CONN_DEFAULT, LOCKING_DEFAULT, LOCKING, PREFIX_DEFAULT, PREFIXES, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from './defaults'; +import { CAMERA, CAMERA_DEFAULT, CRYPTOS, CRYPTOS_ETH, ENDPOINT_DEFAULT, ENDPOINTS, ICON_DEFAULT, ICONS, LANGUAGE_DEFAULT, LEDGER_CONN, LEDGER_CONN_DEFAULT, LOCKING, LOCKING_DEFAULT, PREFIX_DEFAULT, PREFIXES, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from './defaults'; type ChangeCallback = (settings: SettingsStruct) => void; type OnTypes = 'change'; diff --git a/packages/ui-settings/src/defaults/index.ts b/packages/ui-settings/src/defaults/index.ts index 7115266b..02301bf9 100644 --- a/packages/ui-settings/src/defaults/index.ts +++ b/packages/ui-settings/src/defaults/index.ts @@ -4,9 +4,9 @@ import type { Option } from '../types'; import { CRYPTOS, CRYPTOS_ETH } from './crypto'; -import { ENDPOINTS, ENDPOINT_DEFAULT } from './endpoints'; +import { ENDPOINT_DEFAULT, ENDPOINTS } from './endpoints'; import { LEDGER_CONN, LEDGER_CONN_DEFAULT } from './ledger'; -import { PREFIXES, PREFIX_DEFAULT } from './ss58'; +import { PREFIX_DEFAULT, PREFIXES } from './ss58'; import { ICON_DEFAULT, ICON_DEFAULT_HOST, ICONS, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from './ui'; const CAMERA_DEFAULT = 'off'; diff --git a/packages/ui-settings/src/index.ts b/packages/ui-settings/src/index.ts index 5544d3e0..a21b67a2 100644 --- a/packages/ui-settings/src/index.ts +++ b/packages/ui-settings/src/index.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import settings, { Settings } from './Settings'; + export { ENDPOINT_DEFAULT, ICON_DEFAULT, ICON_DEFAULT_HOST, LANGUAGE_DEFAULT, LOCKING_DEFAULT, PREFIX_DEFAULT, UIMODE_DEFAULT, UITHEME_DEFAULT } from './defaults'; export { SettingsStruct, NetworkSpecsStruct } from './types'; diff --git a/packages/ui-shared/src/icons/beachball/colors.spec.ts b/packages/ui-shared/src/icons/beachball/colors.spec.ts index 82cadb67..76a963e6 100644 --- a/packages/ui-shared/src/icons/beachball/colors.spec.ts +++ b/packages/ui-shared/src/icons/beachball/colors.spec.ts @@ -3,8 +3,8 @@ import type { ColorGen } from './types'; -import newSeeder from './seeder'; import newColors from './colors'; +import newSeeder from './seeder'; describe('colors', (): void => { let colors: ColorGen; diff --git a/packages/ui-shared/src/icons/beachball/colors.ts b/packages/ui-shared/src/icons/beachball/colors.ts index 7d0a587c..a86d3303 100644 --- a/packages/ui-shared/src/icons/beachball/colors.ts +++ b/packages/ui-shared/src/icons/beachball/colors.ts @@ -1,5 +1,6 @@ // Copyright 2017-2020 @polkadot/ui-shared authors & contributors // SPDX-License-Identifier: Apache-2.0 + // Copyright 2016 Dan Finlay import type { ColorGen, Seeder } from './types'; diff --git a/packages/ui-shared/src/icons/beachball/container.ts b/packages/ui-shared/src/icons/beachball/container.ts index 98b71289..90260445 100644 --- a/packages/ui-shared/src/icons/beachball/container.ts +++ b/packages/ui-shared/src/icons/beachball/container.ts @@ -1,5 +1,6 @@ // Copyright 2017-2020 @polkadot/ui-shared authors & contributors // SPDX-License-Identifier: Apache-2.0 + // Copyright 2016 Dan Finlay export default function container (diameter: number, background = 'white', className = '', _style: { [index: string]: string } = {}): HTMLElement { diff --git a/packages/ui-shared/src/icons/beachball/defaults.ts b/packages/ui-shared/src/icons/beachball/defaults.ts index 67ec1dd6..5898c9b4 100644 --- a/packages/ui-shared/src/icons/beachball/defaults.ts +++ b/packages/ui-shared/src/icons/beachball/defaults.ts @@ -1,5 +1,6 @@ // Copyright 2017-2020 @polkadot/ui-shared authors & contributors // SPDX-License-Identifier: Apache-2.0 + // Copyright 2016 Dan Finlay const COLORS: string[] = [ diff --git a/packages/ui-shared/src/icons/beachball/demo.ts b/packages/ui-shared/src/icons/beachball/demo.ts index 6256a6be..2531de7a 100644 --- a/packages/ui-shared/src/icons/beachball/demo.ts +++ b/packages/ui-shared/src/icons/beachball/demo.ts @@ -1,5 +1,6 @@ // Copyright 2017-2020 @polkadot/ui-shared authors & contributors // SPDX-License-Identifier: Apache-2.0 + // Copyright 2016 Dan Finlay import { isNull } from '@polkadot/util'; diff --git a/packages/ui-shared/src/icons/beachball/index.ts b/packages/ui-shared/src/icons/beachball/index.ts index bd5e5b0b..4ea41fe0 100644 --- a/packages/ui-shared/src/icons/beachball/index.ts +++ b/packages/ui-shared/src/icons/beachball/index.ts @@ -1,15 +1,16 @@ // Copyright 2017-2020 @polkadot/ui-shared authors & contributors // SPDX-License-Identifier: Apache-2.0 + // Copyright 2016 Dan Finlay import type { Options } from '../types'; -import colors from './colors'; -import newContainer from './container'; -import newSeeder from './seeder'; import newShape from './shape/circle'; import newElement from './svg/element'; +import colors from './colors'; +import newContainer from './container'; import { SHAPE_COUNT } from './defaults'; +import newSeeder from './seeder'; export default function generate (seed: string | Uint8Array, { size = 256 }: Options, className = '', style?: { [index: string]: string }): HTMLElement { const seeder = newSeeder(seed); diff --git a/packages/ui-shared/src/icons/beachball/shape/circle.ts b/packages/ui-shared/src/icons/beachball/shape/circle.ts index 0b954edd..34857377 100644 --- a/packages/ui-shared/src/icons/beachball/shape/circle.ts +++ b/packages/ui-shared/src/icons/beachball/shape/circle.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/ui-shared authors & contributors // SPDX-License-Identifier: Apache-2.0 + // Copyright 2016 Dan Finlay import type { Seeder } from '../types'; -import newCircle from '../svg/circle'; import { SHAPE_COUNT } from '../defaults'; +import newCircle from '../svg/circle'; export default function circle (seeder: Seeder, fill: string, diameter: number, count: number): Element { const center = diameter / 2; diff --git a/packages/ui-shared/src/icons/beachball/shape/square.ts b/packages/ui-shared/src/icons/beachball/shape/square.ts index d901b3ea..59ff5b87 100644 --- a/packages/ui-shared/src/icons/beachball/shape/square.ts +++ b/packages/ui-shared/src/icons/beachball/shape/square.ts @@ -1,11 +1,12 @@ // Copyright 2017-2020 @polkadot/ui-shared authors & contributors // SPDX-License-Identifier: Apache-2.0 + // Copyright 2016 Dan Finlay import type { Seeder } from '../types'; -import newRect from '../svg/rect'; import { SHAPE_COUNT } from '../defaults'; +import newRect from '../svg/rect'; export default function square (seeder: Seeder, fill: string, diameter: number, count: number): Element { const center = diameter / 2; diff --git a/packages/ui-shared/src/icons/beachball/svg/element.ts b/packages/ui-shared/src/icons/beachball/svg/element.ts index 6fb5b918..1860f550 100644 --- a/packages/ui-shared/src/icons/beachball/svg/element.ts +++ b/packages/ui-shared/src/icons/beachball/svg/element.ts @@ -1,5 +1,6 @@ // Copyright 2017-2020 @polkadot/ui-shared authors & contributors // SPDX-License-Identifier: Apache-2.0 + // Copyright 2016 Dan Finlay import createSvg from './svg'; diff --git a/packages/ui-shared/src/icons/beachball/svg/svg.ts b/packages/ui-shared/src/icons/beachball/svg/svg.ts index ad41a5c5..b10a1fc5 100644 --- a/packages/ui-shared/src/icons/beachball/svg/svg.ts +++ b/packages/ui-shared/src/icons/beachball/svg/svg.ts @@ -1,5 +1,6 @@ // Copyright 2017-2020 @polkadot/ui-shared authors & contributors // SPDX-License-Identifier: Apache-2.0 + // Copyright 2016 Dan Finlay const SVG_NS = 'http://www.w3.org/2000/svg'; diff --git a/packages/ui-shared/src/icons/polkadot.ts b/packages/ui-shared/src/icons/polkadot.ts index 4cbe37c0..58e08906 100644 --- a/packages/ui-shared/src/icons/polkadot.ts +++ b/packages/ui-shared/src/icons/polkadot.ts @@ -1,5 +1,6 @@ // Copyright 2018-2020 @polkadot/ui-shared authors & contributors // SPDX-License-Identifier: Apache-2.0 + // Copyright 2018 Paritytech via paritytech/oo7/polkadot-identicon // This has been converted from the original version that can be found at diff --git a/packages/vue-identicon/src/Identicon.ts b/packages/vue-identicon/src/Identicon.ts index 488f0c42..3b9dcb3c 100644 --- a/packages/vue-identicon/src/Identicon.ts +++ b/packages/vue-identicon/src/Identicon.ts @@ -4,6 +4,7 @@ import type { Prefix } from '@polkadot/util-crypto/address/types'; import Vue from 'vue'; + import { isHex, isU8a, u8aToHex } from '@polkadot/util'; import { decodeAddress, encodeAddress } from '@polkadot/util-crypto'; diff --git a/packages/vue-identicon/src/icons/Beachball.ts b/packages/vue-identicon/src/icons/Beachball.ts index fd9a5307..37c8f44b 100644 --- a/packages/vue-identicon/src/icons/Beachball.ts +++ b/packages/vue-identicon/src/icons/Beachball.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import Vue from 'vue'; + import { beachballIcon } from '@polkadot/ui-shared'; interface Data { diff --git a/packages/vue-identicon/src/icons/Jdenticon.ts b/packages/vue-identicon/src/icons/Jdenticon.ts index 08bf9e40..b00d5b18 100644 --- a/packages/vue-identicon/src/icons/Jdenticon.ts +++ b/packages/vue-identicon/src/icons/Jdenticon.ts @@ -1,8 +1,8 @@ // Copyright 2017-2020 @polkadot/vue-identicon authors & contributors // SPDX-License-Identifier: Apache-2.0 -import Vue from 'vue'; import jdenticon from 'jdenticon'; +import Vue from 'vue'; interface Data { svgHtml: string; diff --git a/packages/vue-identicon/src/icons/Polkadot.ts b/packages/vue-identicon/src/icons/Polkadot.ts index ce20ef7a..4051cb76 100644 --- a/packages/vue-identicon/src/icons/Polkadot.ts +++ b/packages/vue-identicon/src/icons/Polkadot.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import Vue from 'vue'; + import { polkadotIcon } from '@polkadot/ui-shared'; interface Data { diff --git a/yarn.lock b/yarn.lock index ab0c26b0..b905402f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2006,9 +2006,9 @@ __metadata: languageName: node linkType: hard -"@polkadot/dev@npm:^0.60.7": - version: 0.60.7 - resolution: "@polkadot/dev@npm:0.60.7" +"@polkadot/dev@npm:^0.60.11": + version: 0.60.11 + resolution: "@polkadot/dev@npm:0.60.11" dependencies: "@babel/cli": ^7.12.8 "@babel/core": ^7.12.9 @@ -2050,6 +2050,7 @@ __metadata: eslint-plugin-promise: ^4.2.1 eslint-plugin-react: ^7.21.5 eslint-plugin-react-hooks: ^4.2.0 + eslint-plugin-simple-import-sort: ^7.0.0-beta.1 eslint-plugin-sort-destructure-keys: ^1.3.5 fs-extra: ^9.0.1 gh-pages: ^3.1.0 @@ -2070,7 +2071,7 @@ __metadata: typedoc-plugin-markdown: ^3.0.11 typedoc-plugin-no-inherit: ^1.2.0 typescript: ^4.1.2 - yargs: ^16.1.1 + yargs: ^16.2.0 bin: polkadot-ci-ghact-build: scripts/polkadot-ci-ghact-build.cjs polkadot-ci-ghact-docs: scripts/polkadot-ci-ghact-docs.cjs @@ -2094,7 +2095,7 @@ __metadata: polkadot-exec-typedoc: scripts/polkadot-exec-typedoc.cjs polkadot-exec-vuepress: scripts/polkadot-exec-vuepress.cjs polkadot-exec-webpack: scripts/polkadot-exec-webpack.cjs - checksum: 0241c5dfd9a9bb334b56712ef5c8caded11d5506753a4a2644dd3532d4159906eb5a1074f1014ca034c0b94c66e5112ad9ffe8d6bc2cc1500351149a30bdf719 + checksum: d583afb3162f8e806d1226ae71cf2860a276fb9e3b2a89c91596d6fec4dd3638555cdfa7568a2f09371bb1a77db485a61d82354aa3867458d8dea60212a99664 languageName: node linkType: hard @@ -2156,17 +2157,17 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/metadata@npm:2.9.2-10": - version: 2.9.2-10 - resolution: "@polkadot/metadata@npm:2.9.2-10" +"@polkadot/metadata@npm:2.10.1": + version: 2.10.1 + resolution: "@polkadot/metadata@npm:2.10.1" dependencies: "@babel/runtime": ^7.12.5 - "@polkadot/types": 2.9.2-10 - "@polkadot/types-known": 2.9.2-10 + "@polkadot/types": 2.10.1 + "@polkadot/types-known": 2.10.1 "@polkadot/util": ^4.2.1 "@polkadot/util-crypto": ^4.2.1 bn.js: ^4.11.9 - checksum: 69874040b7de4d24d2dd2be2c0a14a255ba904b0cd9995212323341f0db7a4feb96c99b1a41c56788e18ca9e6846f3086f8d06a790a8203e58f681f354930d72 + checksum: 4d63d7ea0f54cc41435b0e2d4a0d0529cd62402314bae3f4a89b38a227bd4c24106df50282cc5077aa9021d1d08a05f5e9fe031ece7d2b0e8dfd1abc3c1d6ec2 languageName: node linkType: hard @@ -2257,31 +2258,31 @@ __metadata: languageName: node linkType: hard -"@polkadot/types-known@npm:2.9.2-10": - version: 2.9.2-10 - resolution: "@polkadot/types-known@npm:2.9.2-10" +"@polkadot/types-known@npm:2.10.1": + version: 2.10.1 + resolution: "@polkadot/types-known@npm:2.10.1" dependencies: "@babel/runtime": ^7.12.5 - "@polkadot/types": 2.9.2-10 + "@polkadot/types": 2.10.1 "@polkadot/util": ^4.2.1 bn.js: ^4.11.9 - checksum: 9b613efc1c9fcf0c5e5a947cd73fc699f6ca3bcb75012e31046b0b3714ce685209eb18638b8d3da7ee8c5000c45cd402743ab2b6f0e2c6737ec05ceae91dbf8c + checksum: d8ade5bf38fe06358be3793bb8f3f9bb956060f447c43b3e3a817e2e89be04fe7b039a0588b98116e30ec40df500b9ffc45b0f3b5418a75f9127dcd94478e15e languageName: node linkType: hard -"@polkadot/types@npm:2.9.2-10, @polkadot/types@npm:^2.9.2-8": - version: 2.9.2-10 - resolution: "@polkadot/types@npm:2.9.2-10" +"@polkadot/types@npm:2.10.1, @polkadot/types@npm:^2.10.1": + version: 2.10.1 + resolution: "@polkadot/types@npm:2.10.1" dependencies: "@babel/runtime": ^7.12.5 - "@polkadot/metadata": 2.9.2-10 + "@polkadot/metadata": 2.10.1 "@polkadot/util": ^4.2.1 "@polkadot/util-crypto": ^4.2.1 "@types/bn.js": ^4.11.6 bn.js: ^4.11.9 memoizee: ^0.4.14 rxjs: ^6.6.3 - checksum: 587098fccad5bb4abbd88804653f13f54893160a4f36fdaf22320a28df4502dbb2fcc1cc4f4339805df84c1c43ed74a531a8a3285ed934c145ed517d53c82f35 + checksum: 912eb71dd35c0f007e4aeaba59b6da0aaa12785d3e5d44233ed45b40fe2fba897fc9d6f84eda902d6bca45e1b82361a1530a0c2a55150780b54be347d9677f3c languageName: node linkType: hard @@ -2300,7 +2301,7 @@ __metadata: "@babel/runtime": ^7.12.5 "@polkadot/keyring": ^4.2.1 "@polkadot/ledger": ^0.62.2-20 - "@polkadot/types": ^2.9.2-8 + "@polkadot/types": ^2.10.1 "@polkadot/ui-settings": 0.62.2-20 "@polkadot/util": ^4.2.1 "@types/mkdirp": ^1.0.1 @@ -6673,6 +6674,15 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-simple-import-sort@npm:^7.0.0-beta.1": + version: 7.0.0-beta.1 + resolution: "eslint-plugin-simple-import-sort@npm:7.0.0-beta.1" + peerDependencies: + eslint: ">=5.0.0" + checksum: ca77161eed5babb78a55182478dcc3534ffb2f4bff543ba8746944000eb04191eb53b8c634e1b61e69ee175088e098f50290e75c9bea1db7e3d0843c4155d8e7 + languageName: node + linkType: hard + "eslint-plugin-sort-destructure-keys@npm:^1.3.5": version: 1.3.5 resolution: "eslint-plugin-sort-destructure-keys@npm:1.3.5" @@ -13887,7 +13897,7 @@ fsevents@~2.1.2: dependencies: "@babel/core": ^7.12.9 "@babel/runtime": ^7.12.5 - "@polkadot/dev": ^0.60.7 + "@polkadot/dev": ^0.60.11 "@polkadot/ts": ^0.3.57 "@types/jest": ^26.0.16 babel-plugin-transform-vue-template: ^0.4.2 @@ -16727,7 +16737,7 @@ fsevents@~2.1.2: languageName: node linkType: hard -"yargs@npm:^16.0.3, yargs@npm:^16.1.1": +"yargs@npm:^16.0.3": version: 16.1.1 resolution: "yargs@npm:16.1.1" dependencies: @@ -16742,6 +16752,21 @@ fsevents@~2.1.2: languageName: node linkType: hard +"yargs@npm:^16.2.0": + version: 16.2.0 + resolution: "yargs@npm:16.2.0" + dependencies: + cliui: ^7.0.2 + escalade: ^3.1.1 + get-caller-file: ^2.0.5 + require-directory: ^2.1.1 + string-width: ^4.2.0 + y18n: ^5.0.5 + yargs-parser: ^20.2.2 + checksum: a79ce1f043021cd645de1ffebb6149541d382ba68f4a6b5eca5d2ad65af51893371bbd78e240dc3b6cf0cbb419511ba5bda715dec992e4266e6863ea49f14feb + languageName: node + linkType: hard + "ylru@npm:^1.2.0": version: 1.2.1 resolution: "ylru@npm:1.2.1"