Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(update dependencies): polkadot-js/api version update to 10.1.4 #537

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,17 @@
"prettier": "^2.7.1"
},
"resolutions": {
"@polkadot/types": "8.9.1",
"node-gyp": "^9.4.0"
"@polkadot/types": "10.1.4",
"@polkadot/api": "10.1.4",
"@polkadot/util": "^11.1.3",
"@polkadot/util-crypto": "^11.1.3",
"@polkadot/keyring": "^11.1.3",
"@types/bn.js": "^5.1.0",
"bn.js": "^5.2.1",
"mocha": "^10",
"chai": "^4",
"node-fetch": "^2",
"ts-node": "^10"
},
"lint-staged": {
"*.ts": "yarn lint --fix"
Expand Down
2 changes: 1 addition & 1 deletion packages/hydra-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"postpack": "rm -f oclif.manifest.json",
"lint": "eslint . --ext .ts",
"prepack": "rm -rf lib && yarn tsc -b && cp -R ./src/templates ./lib/src/templates && oclif-dev manifest",
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\""
"test": "nyc --extension .ts mocha --require ts-node/register --forbid-only \"test/**/*.test.ts\""
},
"dependencies": {
"@inquirer/input": "^0.0.13-alpha.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@joystream/hydra-common": "{{{hydraCommonVersion}}}",
"@polkadot/types": "8.9.1",
"@polkadot/types": "10.1.4",
"@joystream/warthog": "{{{hydraWarthogVersion}}}"
},
"devDependencies": {
Expand Down
7 changes: 4 additions & 3 deletions packages/hydra-e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
"e2e-test": "bash run-tests.sh"
},
"dependencies": {
"@polkadot/api": "8.9.1",
"@polkadot/keyring": "9.5.1",
"@polkadot/api": "10.1.4",
"@polkadot/keyring": "11.1.1",
"@types/node-fetch": "^2.6.11",
"fetch": "^1.1.0",
"graphql-request": "^3.3.0",
"graphql-subscriptions-client": "^0.16.0",
"node-fetch": "^2.6.1",
"node-fetch": "^2",
"p-wait-for": "^3.2.0",
"typedi": "^0.8.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/hydra-indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@joystream/bn-typeorm": "^5.0.0-alpha.7",
"@joystream/hydra-common": "^5.0.0-alpha.7",
"@joystream/hydra-db-utils": "^5.0.0-alpha.7",
"@polkadot/api": "8.9.1",
"@polkadot/api": "10.1.4",
"@types/express": "^4.17.8",
"@types/ioredis": "^4.17.4",
"@types/lodash": "^4.14.161",
Expand Down
2 changes: 1 addition & 1 deletion packages/hydra-processor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
},
"devDependencies": {
"@joystream/hydra-cli": "^5.0.0-alpha.7",
"@polkadot/api": "8.9.1",
"@polkadot/api": "10.1.4",
"@types/async-lock": "^1.1.3",
"@types/bn.js": "^5.1.0",
"@types/chai": "^4.2.19",
Expand Down
4 changes: 2 additions & 2 deletions packages/hydra-typegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"@oclif/command": "^1.8.0",
"@oclif/config": "^1",
"@oclif/errors": "^1.3.3",
"@polkadot/api": "8.9.1",
"@polkadot/typegen": "8.9.1",
"@polkadot/api": "10.1.4",
"@polkadot/typegen": "10.1.4",
"debug": "^4.3.1",
"figlet": "^1.5.2",
"handlebars": "^4.7.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/hydra-typegen/src/generators/gen-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function generateIndex({ modules, dest }: GeneratorConfig): void {
writeFile(path.join(dest, `index.ts`), () =>
formatWithPrettier(
generateIndexTemplate({
modules: modules.map((m) => m.module),
moduleNames: modules.map((m) => m.module.name.toString()),
})
)
)
Expand Down
2 changes: 2 additions & 0 deletions packages/hydra-typegen/src/generators/gen-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type ModuleTemplateProps = {
validateArgs: boolean
imports: ImportsDef
specVersion: number
moduleName: string
} & ExtractedModuleMeta

export function generateModuleTypes(config: GeneratorConfig): void {
Expand Down Expand Up @@ -42,6 +43,7 @@ export function buildModuleProps(
validateArgs,
specVersion,
imports,
moduleName: meta.module.name.toString(),
...meta,
}
}
4 changes: 3 additions & 1 deletion packages/hydra-typegen/src/generators/gen-typesLookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ export async function generateTypesLookup(
'utf8'
)

// remove module augmentation from the file
// remove module augmentation from the file, and export all types and interfaces
const outFile = file
.replace(`declare module '@polkadot/types/lookup' {`, '')
.replace('} // declare module', '')
.replaceAll(' interface ', 'export interface ')
.replaceAll(' type ', 'export type ')

// save the file
writeFile(path.join(dest, TYPES_LOOKUP_FILE_NAME), () =>
Expand Down
4 changes: 2 additions & 2 deletions packages/hydra-typegen/src/templates/index.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */

{{#each modules}}
export * from './{{kebabCase name}}'
{{#each moduleNames}}
export * from './{{kebabCase this}}'
{{/each}}
2 changes: 1 addition & 1 deletion packages/hydra-typegen/src/templates/module.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { typeRegistry } from "./typeRegistry";
* Event parameters: [{{#each args}}{{{this}}}, {{/each}}]
*/
{{/if}}
export class {{@root.module.name}}_{{name}}Event_V{{@root.specVersion}} {
export class {{@root.moduleName}}_{{name}}Event_V{{@root.specVersion}} {
public readonly expectedParamTypes = [{{#each args}}'{{{this}}}', {{/each}}]

constructor(public readonly ctx: SubstrateEvent) {}
Expand Down
2 changes: 1 addition & 1 deletion packages/hydra-typegen/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"outDir": "lib",
"rootDirs": ["./src"],
"strict": true,
"target": "es2017",
"target": "es2021",
"noImplicitAny": false,
"esModuleInterop": true,
"experimentalDecorators": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/mappings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@joystream/hydra-common": "^5.0.0-alpha.7",
"@polkadot/types": "8.9.1"
"@polkadot/types": "10.1.4"
},
"devDependencies": {
"copyfiles": "^2.4.1",
Expand Down
Loading
Loading