diff --git a/CHANGELOG.md b/CHANGELOG.md index b54808e617..fce5bbc192 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ Changes: - Add `BlockNumberFor` type mapping - Add Westend 9080 upgrade block - Add `derive.crowdloan.contributions(paraId)` -- Allow building as a completely stand-alone browser bundle +- Allow building as a completely stand-alone browser bundle (experimental) - Update to latest `@polkadot/x-rxjs` with RxJs 7.2 diff --git a/packages/api-contract/package.json b/packages/api-contract/package.json index 4c23e43b74..32ddc28aa1 100644 --- a/packages/api-contract/package.json +++ b/packages/api-contract/package.json @@ -22,7 +22,7 @@ "@babel/runtime": "^7.14.6", "@polkadot/api": "4.17.2-17", "@polkadot/types": "4.17.2-17", - "@polkadot/util": "^6.11.2-13", + "@polkadot/util": "^6.11.2-14", "rxjs": "^7.2.0" } } diff --git a/packages/api-derive/package.json b/packages/api-derive/package.json index c88e0cf3f9..44f07dfafc 100644 --- a/packages/api-derive/package.json +++ b/packages/api-derive/package.json @@ -23,12 +23,12 @@ "@polkadot/api": "4.17.2-17", "@polkadot/rpc-core": "4.17.2-17", "@polkadot/types": "4.17.2-17", - "@polkadot/util": "^6.11.2-13", - "@polkadot/util-crypto": "^6.11.2-13", + "@polkadot/util": "^6.11.2-14", + "@polkadot/util-crypto": "^6.11.2-14", "rxjs": "^7.2.0" }, "devDependencies": { - "@polkadot/keyring": "^6.11.2-13", + "@polkadot/keyring": "^6.11.2-14", "@polkadot/rpc-provider": "4.17.2-17" } } diff --git a/packages/api/package.json b/packages/api/package.json index 11d6a51888..e1f00a9002 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -21,13 +21,13 @@ "dependencies": { "@babel/runtime": "^7.14.6", "@polkadot/api-derive": "4.17.2-17", - "@polkadot/keyring": "^6.11.2-13", + "@polkadot/keyring": "^6.11.2-14", "@polkadot/rpc-core": "4.17.2-17", "@polkadot/rpc-provider": "4.17.2-17", "@polkadot/types": "4.17.2-17", "@polkadot/types-known": "4.17.2-17", - "@polkadot/util": "^6.11.2-13", - "@polkadot/util-crypto": "^6.11.2-13", + "@polkadot/util": "^6.11.2-14", + "@polkadot/util-crypto": "^6.11.2-14", "eventemitter3": "^4.0.7", "rxjs": "^7.2.0" } diff --git a/packages/rpc-core/package.json b/packages/rpc-core/package.json index 1ad7b0f963..2a216d1334 100644 --- a/packages/rpc-core/package.json +++ b/packages/rpc-core/package.json @@ -22,10 +22,10 @@ "@babel/runtime": "^7.14.6", "@polkadot/rpc-provider": "4.17.2-17", "@polkadot/types": "4.17.2-17", - "@polkadot/util": "^6.11.2-13", + "@polkadot/util": "^6.11.2-14", "rxjs": "^7.2.0" }, "devDependencies": { - "@polkadot/keyring": "^6.11.2-13" + "@polkadot/keyring": "^6.11.2-14" } } diff --git a/packages/rpc-provider/package.json b/packages/rpc-provider/package.json index 516a05b692..80766bb9c5 100644 --- a/packages/rpc-provider/package.json +++ b/packages/rpc-provider/package.json @@ -21,15 +21,15 @@ "dependencies": { "@babel/runtime": "^7.14.6", "@polkadot/types": "4.17.2-17", - "@polkadot/util": "^6.11.2-13", - "@polkadot/util-crypto": "^6.11.2-13", - "@polkadot/x-fetch": "^6.11.2-13", - "@polkadot/x-global": "^6.11.2-13", - "@polkadot/x-ws": "^6.11.2-13", + "@polkadot/util": "^6.11.2-14", + "@polkadot/util-crypto": "^6.11.2-14", + "@polkadot/x-fetch": "^6.11.2-14", + "@polkadot/x-global": "^6.11.2-14", + "@polkadot/x-ws": "^6.11.2-14", "eventemitter3": "^4.0.7" }, "devDependencies": { - "@polkadot/keyring": "^6.11.2-13", + "@polkadot/keyring": "^6.11.2-14", "@polkadot/types": "4.17.2-17", "mock-socket": "^9.0.3", "nock": "^13.1.1" diff --git a/packages/typegen/package.json b/packages/typegen/package.json index 15f9acd6be..d572d9455d 100644 --- a/packages/typegen/package.json +++ b/packages/typegen/package.json @@ -32,7 +32,7 @@ "@polkadot/api": "4.17.2-17", "@polkadot/rpc-provider": "4.17.2-17", "@polkadot/types": "4.17.2-17", - "@polkadot/util": "^6.11.2-13", + "@polkadot/util": "^6.11.2-14", "handlebars": "^4.7.7", "websocket": "^1.0.34", "yargs": "^17.0.1" diff --git a/packages/types-known/package.json b/packages/types-known/package.json index 383a1fd8b2..5aa3c2dfab 100644 --- a/packages/types-known/package.json +++ b/packages/types-known/package.json @@ -20,8 +20,8 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types-known#readme", "dependencies": { "@babel/runtime": "^7.14.6", - "@polkadot/networks": "^6.11.2-13", + "@polkadot/networks": "^6.11.2-14", "@polkadot/types": "4.17.2-17", - "@polkadot/util": "^6.11.2-13" + "@polkadot/util": "^6.11.2-14" } } diff --git a/packages/types-known/src/upgrades/index.ts b/packages/types-known/src/upgrades/index.ts index c41e1149ea..6cf0db3f8d 100644 --- a/packages/types-known/src/upgrades/index.ts +++ b/packages/types-known/src/upgrades/index.ts @@ -4,13 +4,15 @@ import type { ChainUpgrades } from '@polkadot/types/types'; import type { ChainUpgradesRaw } from './types'; -import networks from '@polkadot/networks'; +import { selectableNetworks } from '@polkadot/networks'; import { assert, BN, hexToU8a, stringify } from '@polkadot/util'; import kusama from './kusama'; import polkadot from './polkadot'; import westend from './westend'; +const allKnown = { kusama, polkadot, westend }; + // testnets are not available in the networks map const NET_EXTRA: Record = { westend: { @@ -35,7 +37,7 @@ function checkOrder (network: string, versions: ChainUpgradesRaw): [number, numb /** @internal */ function mapRaw ([network, versions]: [string, ChainUpgradesRaw]): ChainUpgrades { - const chain = networks.find((n) => n.network === network) || NET_EXTRA[network]; + const chain = selectableNetworks.find((n) => n.network === network) || NET_EXTRA[network]; assert(chain, () => `Unable to find info for chain ${network}`); @@ -50,6 +52,6 @@ function mapRaw ([network, versions]: [string, ChainUpgradesRaw]): ChainUpgrades } // Type overrides for specific spec types & versions as given in runtimeVersion -const upgrades = Object.entries({ kusama, polkadot, westend }).map(mapRaw); +const upgrades = Object.entries(allKnown).map(mapRaw); export default upgrades; diff --git a/packages/types/package.json b/packages/types/package.json index cc36783598..af502da643 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -20,12 +20,12 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme", "dependencies": { "@babel/runtime": "^7.14.6", - "@polkadot/util": "^6.11.2-13", - "@polkadot/util-crypto": "^6.11.2-13", + "@polkadot/util": "^6.11.2-14", + "@polkadot/util-crypto": "^6.11.2-14", "rxjs": "^7.2.0" }, "devDependencies": { - "@polkadot/keyring": "^6.11.2-13", + "@polkadot/keyring": "^6.11.2-14", "@types/bn.js": "^4.11.6", "bn.js": "^4.11.9" } diff --git a/rollup.config.mjs b/rollup.config.mjs index a429703d14..6fb577638f 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -14,7 +14,6 @@ const pkgs = [ const external = [ ...pkgs, '@polkadot/keyring', - '@polkadot/networks', '@polkadot/util', '@polkadot/util-crypto' ]; @@ -22,7 +21,10 @@ const external = [ const entries = ['api-derive', 'rpc-core', 'rpc-provider', 'types-known'].reduce((all, p) => ({ ...all, [`@polkadot/${p}`]: path.resolve(process.cwd(), `packages/${p}/build/bundle.js`) -}), {}); +}), { + // re-exported in @polkadot/util-crypto, map directly + '@polkadot/networks': '@polkadot/util-crypto' +}); const overrides = {}; diff --git a/test-bundle.html b/test-bundle.html index cd508ae3be..9092e328de 100644 --- a/test-bundle.html +++ b/test-bundle.html @@ -2,34 +2,49 @@ - - + Bundler tests + - Executing bundle tests, see the dev console for output ... -