Bump deps (& remove unused overrides) (#5549)

This commit is contained in:
Jaco
2023-03-18 11:59:42 +02:00
committed by GitHub
parent ac8446b30c
commit cf1fabaecf
53 changed files with 138 additions and 170 deletions
+1 -1
View File
@@ -218,7 +218,7 @@ function generateLookupTypes (registry: Registry, filtered: [PortableType, TypeD
writeFile(path.join(destDir, 'index.ts'), () => generateLookupIndexTmpl({ headerType: 'defs' }), true);
}
function generateRegistry (registry: Registry, filtered: [PortableType, TypeDef][], destDir: string, subPath: string): void {
function generateRegistry (_registry: Registry, filtered: [PortableType, TypeDef][], destDir: string, subPath: string): void {
writeFile(path.join(destDir, `${subPath}.ts`), (): string => {
const items = filtered
.map(([, { lookupName }]) => lookupName)
+3 -5
View File
@@ -32,8 +32,7 @@ export function createGetter (definitions: Record<string, ModuleTypes>, name = '
}
/** @internal */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function errorUnhandled (_: Registry, definitions: Record<string, ModuleTypes>, def: TypeDef, imports: TypeImports): string {
function errorUnhandled (_: Registry, _definitions: Record<string, ModuleTypes>, def: TypeDef, _imports: TypeImports): string {
throw new Error(`Generate: ${def.name || ''}: Unhandled type ${TypeDefInfo[def.info]}`);
}
@@ -96,7 +95,7 @@ function tsInt (_: Registry, definitions: Record<string, ModuleTypes>, def: Type
}
/** @internal */
function tsNull (registry: Registry, definitions: Record<string, ModuleTypes>, { lookupIndex = -1, name }: TypeDef, imports: TypeImports): string {
function tsNull (_registry: Registry, definitions: Record<string, ModuleTypes>, { lookupIndex = -1, name }: TypeDef, imports: TypeImports): string {
setImports(definitions, imports, ['Null']);
// * @description extends [[${base}]]
@@ -151,8 +150,7 @@ function tsResult (registry: Registry, definitions: Record<string, ModuleTypes>,
}
/** @internal */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function tsSi (registry: Registry, definitions: Record<string, ModuleTypes>, typeDef: TypeDef, imports: TypeImports): string {
function tsSi (_registry: Registry, _definitions: Record<string, ModuleTypes>, typeDef: TypeDef, _imports: TypeImports): string {
// FIXME
return `// SI: ${JSON.stringify(typeDef)}`;
}
+7 -9
View File
@@ -1,8 +1,6 @@
// Copyright 2017-2023 @polkadot/typegen authors & contributors
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/no-unused-vars */
import type { AnyString, Registry } from '@polkadot/types/types';
import type { LookupString } from '@polkadot/types-codec/types';
import type { TypeDef } from '@polkadot/types-create/types';
@@ -139,13 +137,13 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
return singleParamNotation(registry, 'Compact', typeDef, definitions, imports, withShortcut);
},
[TypeDefInfo.DoNotConstruct]: (registry: Registry, { lookupName }: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
[TypeDefInfo.DoNotConstruct]: (_registry: Registry, _typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, _withShortcut: boolean) => {
setImports(definitions, imports, ['DoNotConstruct']);
return 'DoNotConstruct';
},
[TypeDefInfo.Enum]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
[TypeDefInfo.Enum]: (_registry: Registry, typeDef: TypeDef, _definitions: Record<string, ModuleTypes>, _imports: TypeImports, _withShortcut: boolean) => {
if (typeDef.lookupName) {
return typeDef.lookupName;
}
@@ -153,15 +151,15 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
throw new Error(`TypeDefInfo.Enum: Parameter formatting not implemented on ${stringify(typeDef)}`);
},
[TypeDefInfo.Int]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
[TypeDefInfo.Int]: (_registry: Registry, typeDef: TypeDef, _definitions: Record<string, ModuleTypes>, _imports: TypeImports, _withShortcut: boolean) => {
throw new Error(`TypeDefInfo.Int: Parameter formatting not implemented on ${stringify(typeDef)}`);
},
[TypeDefInfo.UInt]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
[TypeDefInfo.UInt]: (_registry: Registry, typeDef: TypeDef, _definitions: Record<string, ModuleTypes>, _imports: TypeImports, _withShortcut: boolean) => {
throw new Error(`TypeDefInfo.UInt: Parameter formatting not implemented on ${stringify(typeDef)}`);
},
[TypeDefInfo.Null]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
[TypeDefInfo.Null]: (_registry: Registry, _typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, _withShortcut: boolean) => {
setImports(definitions, imports, ['Null']);
return 'Null';
@@ -171,7 +169,7 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
return singleParamNotation(registry, 'Option', typeDef, definitions, imports, withShortcut);
},
[TypeDefInfo.Plain]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
[TypeDefInfo.Plain]: (_registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, _withShortcut: boolean) => {
setImports(definitions, imports, [typeDef.type]);
return typeDef.type;
@@ -185,7 +183,7 @@ const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, def
return singleParamNotation(registry, 'RangeInclusive', typeDef, definitions, imports, withShortcut);
},
[TypeDefInfo.Set]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
[TypeDefInfo.Set]: (_registry: Registry, typeDef: TypeDef, _definitions: Record<string, ModuleTypes>, _imports: TypeImports, _withShortcut: boolean) => {
throw new Error(`TypeDefInfo.Set: Parameter formatting not implemented on ${stringify(typeDef)}`);
},
+3
View File
@@ -36,6 +36,9 @@ async function getWsData <T> (endpoint: string, method: 'rpc_methods' | 'state_g
websocket.close();
};
} catch (error) {
console.error();
console.error(error);
console.error();
process.exit(1);
}
});