Single module bundle via rollup (#3731)

* Single module bundle via rollup

* use createBundle

* override all

* Update rollup.config.mjs

* Add bundle import

* Remove x-* packages

* Adjust

* Adjust

* Rebuild

* Internal helpers

* Adjust locations

* Bump common

* CHANGELOG

* Update rollup.config.mjs
This commit is contained in:
Jaco
2021-07-07 20:39:49 +02:00
committed by GitHub
parent 8d7b18526c
commit 3c59a4d417
16 changed files with 312 additions and 167 deletions
+3 -3
View File
@@ -20,9 +20,9 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"dependencies": {
"@babel/runtime": "^7.14.6",
"@polkadot/api": "4.17.2-11",
"@polkadot/types": "4.17.2-11",
"@polkadot/util": "^6.11.2-9",
"@polkadot/api": "4.17.2-10",
"@polkadot/types": "4.17.2-10",
"@polkadot/util": "^6.11.2-10",
"rxjs": "^7.2.0"
}
}
+1 -2
View File
@@ -4,8 +4,7 @@
import type { ChainProperties, ContractDisplayName, SiField, SiLookupTypeId, SiType, SiTypeDefArray, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces';
import type { InterfaceTypes, TypeDef } from '@polkadot/types/types';
import { TypeRegistry, withTypeString } from '@polkadot/types/create';
import { TypeDefInfo } from '@polkadot/types/types';
import { TypeDefInfo, TypeRegistry, withTypeString } from '@polkadot/types';
import { assert, isUndefined } from '@polkadot/util';
interface PartialTypeSpec {
+7 -7
View File
@@ -20,15 +20,15 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
"dependencies": {
"@babel/runtime": "^7.14.6",
"@polkadot/api": "4.17.2-11",
"@polkadot/rpc-core": "4.17.2-11",
"@polkadot/types": "4.17.2-11",
"@polkadot/util": "^6.11.2-9",
"@polkadot/util-crypto": "^6.11.2-9",
"@polkadot/api": "4.17.2-10",
"@polkadot/rpc-core": "4.17.2-10",
"@polkadot/types": "4.17.2-10",
"@polkadot/util": "^6.11.2-10",
"@polkadot/util-crypto": "^6.11.2-10",
"rxjs": "^7.2.0"
},
"devDependencies": {
"@polkadot/keyring": "^6.11.2-9",
"@polkadot/rpc-provider": "4.17.2-11"
"@polkadot/keyring": "^6.11.2-10",
"@polkadot/rpc-provider": "4.17.2-10"
}
}
+8 -8
View File
@@ -20,14 +20,14 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
"dependencies": {
"@babel/runtime": "^7.14.6",
"@polkadot/api-derive": "4.17.2-11",
"@polkadot/keyring": "^6.11.2-9",
"@polkadot/rpc-core": "4.17.2-11",
"@polkadot/rpc-provider": "4.17.2-11",
"@polkadot/types": "4.17.2-11",
"@polkadot/types-known": "4.17.2-11",
"@polkadot/util": "^6.11.2-9",
"@polkadot/util-crypto": "^6.11.2-9",
"@polkadot/api-derive": "4.17.2-10",
"@polkadot/keyring": "^6.11.2-10",
"@polkadot/rpc-core": "4.17.2-10",
"@polkadot/rpc-provider": "4.17.2-10",
"@polkadot/types": "4.17.2-10",
"@polkadot/types-known": "4.17.2-10",
"@polkadot/util": "^6.11.2-10",
"@polkadot/util-crypto": "^6.11.2-10",
"eventemitter3": "^4.0.7",
"rxjs": "^7.2.0"
}
+1 -1
View File
@@ -8,7 +8,7 @@ import { jest } from '@jest/globals';
import { createPair } from '@polkadot/keyring/pair';
import { createTestKeyring } from '@polkadot/keyring/testing';
import { MockProvider } from '@polkadot/rpc-provider/mock';
import { TypeRegistry } from '@polkadot/types/create';
import { TypeRegistry } from '@polkadot/types';
import { hexToU8a } from '@polkadot/util';
import { SingleAccountSigner } from '../../test/util';
+4 -4
View File
@@ -20,12 +20,12 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
"dependencies": {
"@babel/runtime": "^7.14.6",
"@polkadot/rpc-provider": "4.17.2-11",
"@polkadot/types": "4.17.2-11",
"@polkadot/util": "^6.11.2-9",
"@polkadot/rpc-provider": "4.17.2-10",
"@polkadot/types": "4.17.2-10",
"@polkadot/util": "^6.11.2-10",
"rxjs": "^7.2.0"
},
"devDependencies": {
"@polkadot/keyring": "^6.11.2-9"
"@polkadot/keyring": "^6.11.2-10"
}
}
+3 -5
View File
@@ -11,9 +11,7 @@ import type { RpcInterface, RpcInterfaceMethod } from './types';
import { Observable, publishReplay, refCount } from 'rxjs';
import { Option } from '@polkadot/types';
import { createClass, createTypeUnsafe } from '@polkadot/types/create';
import jsonrpc from '@polkadot/types/interfaces/jsonrpc';
import { createClass, createTypeUnsafe, Option, rpcDefinitions } from '@polkadot/types';
import { assert, hexToU8a, isFunction, isNull, isUndefined, logger, memoize, u8aToU8a } from '@polkadot/util';
import { drr, refCountDelay } from './util';
@@ -106,7 +104,7 @@ export class RpcCore {
this.#registryDefault = registry;
this.provider = provider;
const sectionNames = Object.keys(jsonrpc);
const sectionNames = Object.keys(rpcDefinitions);
// these are the base keys (i.e. part of jsonrpc)
this.sections.push(...sectionNames);
@@ -157,7 +155,7 @@ export class RpcCore {
Object
.entries({
...this._createInterface(sectionName, jsonrpc[sectionName as 'babe'] || {}),
...this._createInterface(sectionName, rpcDefinitions[sectionName as 'babe'] || {}),
...this._createInterface(sectionName, userRpc[sectionName] || {})
})
.forEach(([key, value]): void => {
+8 -8
View File
@@ -20,17 +20,17 @@
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
"dependencies": {
"@babel/runtime": "^7.14.6",
"@polkadot/types": "4.17.2-11",
"@polkadot/util": "^6.11.2-9",
"@polkadot/util-crypto": "^6.11.2-9",
"@polkadot/x-fetch": "^6.11.2-9",
"@polkadot/x-global": "^6.11.2-9",
"@polkadot/x-ws": "^6.11.2-9",
"@polkadot/types": "4.17.2-10",
"@polkadot/util": "^6.11.2-10",
"@polkadot/util-crypto": "^6.11.2-10",
"@polkadot/x-fetch": "^6.11.2-10",
"@polkadot/x-global": "^6.11.2-10",
"@polkadot/x-ws": "^6.11.2-10",
"eventemitter3": "^4.0.7"
},
"devDependencies": {
"@polkadot/keyring": "^6.11.2-9",
"@polkadot/types": "4.17.2-11",
"@polkadot/keyring": "^6.11.2-10",
"@polkadot/types": "4.17.2-10",
"mock-socket": "^9.0.3",
"nock": "^13.1.1"
}
+4 -4
View File
@@ -29,10 +29,10 @@
"@babel/core": "^7.14.6",
"@babel/register": "^7.14.5",
"@babel/runtime": "^7.14.6",
"@polkadot/api": "4.17.2-11",
"@polkadot/rpc-provider": "4.17.2-11",
"@polkadot/types": "4.17.2-11",
"@polkadot/util": "^6.11.2-9",
"@polkadot/api": "4.17.2-10",
"@polkadot/rpc-provider": "4.17.2-10",
"@polkadot/types": "4.17.2-10",
"@polkadot/util": "^6.11.2-10",
"handlebars": "^4.7.7",
"websocket": "^1.0.34",
"yargs": "^17.0.1"
+3 -3
View File
@@ -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-9",
"@polkadot/types": "4.17.2-11",
"@polkadot/util": "^6.11.2-9"
"@polkadot/networks": "^6.11.2-10",
"@polkadot/types": "4.17.2-10",
"@polkadot/util": "^6.11.2-10"
}
}
+3 -3
View File
@@ -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-9",
"@polkadot/util-crypto": "^6.11.2-9",
"@polkadot/util": "^6.11.2-10",
"@polkadot/util-crypto": "^6.11.2-10",
"rxjs": "^7.2.0"
},
"devDependencies": {
"@polkadot/keyring": "^6.11.2-9",
"@polkadot/keyring": "^6.11.2-10",
"@types/bn.js": "^4.11.6",
"bn.js": "^4.11.9"
}
+5
View File
@@ -1,6 +1,9 @@
// Copyright 2017-2021 @polkadot/types authors & contributors
// SPDX-License-Identifier: Apache-2.0
import * as typeDefinitions from './interfaces/definitions';
import rpcDefinitions from './interfaces/jsonrpc';
export * from './codec';
export * from './create';
export * from './index.types';
@@ -9,3 +12,5 @@ export * from './metadata';
export { TypeDefInfo } from './create/types';
export { packageInfo } from './packageInfo';
export { unwrapStorageType } from './primitive/StorageKey';
export { typeDefinitions, rpcDefinitions };