From 39ee2d8f286579fd14ff09862c3ed5b92e962828 Mon Sep 17 00:00:00 2001 From: Gregory Luneau Date: Mon, 20 Jan 2025 21:42:36 -0500 Subject: [PATCH 1/4] install biome - remove eslint and prettier --- biome.json | 86 ++++ package.json | 22 +- yarn.lock | 1101 +++++--------------------------------------------- 3 files changed, 194 insertions(+), 1015 deletions(-) create mode 100644 biome.json diff --git a/biome.json b/biome.json new file mode 100644 index 00000000..e88bcb82 --- /dev/null +++ b/biome.json @@ -0,0 +1,86 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }, + "files": { + "ignoreUnknown": false, + "ignore": [ + "*.json", + "*.txt", + "*.snap", + "*.wasm", + "*.html", + "*.md", + "*.gitignore", + "*.yml", + "*.tsbuildinfo", + "**/node_modules/**" + ] + }, + "formatter": { + "enabled": true, + "useEditorconfig": true, + "formatWithErrors": false, + "indentStyle": "tab", + "indentWidth": 2, + "lineEnding": "lf", + "lineWidth": 120, + "attributePosition": "auto", + "bracketSpacing": true, + "ignore": [ + "**/tsconfig.tsbuildinfo", + "**/.gitignore", + "**/.yarn", + "**/*.yml", + "**/*.md", + "**/node_modules/**" + ] + }, + "organizeImports": { "enabled": true }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "suspicious": { + "noExplicitAny": "off", + "noAssignInExpressions": "off" + }, + "style": { + "noUnusedTemplateLiteral": "off", + "noNonNullAssertion": "off", + "noParameterAssign": "off" + }, + "complexity": { + "noForEach": "off", + "useLiteralKeys": "off" + } + }, + "ignore": [ + "**/node_modules/" + ] + }, + "javascript": { + "formatter": { + "jsxQuoteStyle": "double", + "quoteProperties": "asNeeded", + "trailingCommas": "all", + "semicolons": "asNeeded", + "arrowParentheses": "always", + "bracketSameLine": false, + "quoteStyle": "single", + "attributePosition": "auto", + "bracketSpacing": true + } + }, + "overrides": [ + { + "include": ["**/*.test.ts", "packages/web-test"], + "linter": { + "rules": { + "style": { + "noNonNullAssertion": "off" + } + } + } + } + ] +} diff --git a/package.json b/package.json index 6a3a19e8..b34d5ae4 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "name": "e2e-tests", "private": true, "scripts": { - "lint": "tsc --noEmit && eslint .", - "fix": "eslint . --fix", + "lint": "tsc --noEmit && biome check .", + "fix": "biome check --write .", "test": "vitest", "test:ui": "vitest --ui", "update-env": "tsx scripts/update-env.ts", @@ -36,32 +36,18 @@ "vitest": "^2.1.6" }, "devDependencies": { - "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "^9.16.0", + "@biomejs/biome": "1.9.4", "@types/lodash": "^4.17.13", "@types/node": "^22.10.3", "@vitest/ui": "^2.1.8", "dotenv": "^16.4.5", - "eslint": "^9.15.0", - "eslint-config-prettier": "^9.1.0", - "eslint-import-resolver-typescript": "^3.6.3", - "eslint-plugin-import-x": "^4.4.3", "husky": "^9.1.7", "lint-staged": "^15.2.10", - "prettier": "^3.3.3", "tsx": "^4.19.2", - "typescript-eslint": "^8.16.0", "unplugin-swc": "^1.5.1", "vite-tsconfig-paths": "^5.1.3" }, "lint-staged": { - "*.{js,ts}": "yarn fix" - }, - "prettier": { - "printWidth": 120, - "endOfLine": "lf", - "semi": false, - "tabWidth": 2, - "singleQuote": true + "*.{js,ts}": "biome check --write --no-errors-on-unmatched" } } diff --git a/yarn.lock b/yarn.lock index ed2f0d00..fde9ef30 100644 --- a/yarn.lock +++ b/yarn.lock @@ -106,6 +106,97 @@ __metadata: languageName: node linkType: hard +"@biomejs/biome@npm:1.9.4": + version: 1.9.4 + resolution: "@biomejs/biome@npm:1.9.4" + dependencies: + "@biomejs/cli-darwin-arm64": "npm:1.9.4" + "@biomejs/cli-darwin-x64": "npm:1.9.4" + "@biomejs/cli-linux-arm64": "npm:1.9.4" + "@biomejs/cli-linux-arm64-musl": "npm:1.9.4" + "@biomejs/cli-linux-x64": "npm:1.9.4" + "@biomejs/cli-linux-x64-musl": "npm:1.9.4" + "@biomejs/cli-win32-arm64": "npm:1.9.4" + "@biomejs/cli-win32-x64": "npm:1.9.4" + dependenciesMeta: + "@biomejs/cli-darwin-arm64": + optional: true + "@biomejs/cli-darwin-x64": + optional: true + "@biomejs/cli-linux-arm64": + optional: true + "@biomejs/cli-linux-arm64-musl": + optional: true + "@biomejs/cli-linux-x64": + optional: true + "@biomejs/cli-linux-x64-musl": + optional: true + "@biomejs/cli-win32-arm64": + optional: true + "@biomejs/cli-win32-x64": + optional: true + bin: + biome: bin/biome + checksum: 10c0/b5655c5aed9a6fffe24f7d04f15ba4444389d0e891c9ed9106fab7388ac9b4be63185852cc2a937b22940dac3e550b71032a4afd306925cfea436c33e5646b3e + languageName: node + linkType: hard + +"@biomejs/cli-darwin-arm64@npm:1.9.4": + version: 1.9.4 + resolution: "@biomejs/cli-darwin-arm64@npm:1.9.4" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@biomejs/cli-darwin-x64@npm:1.9.4": + version: 1.9.4 + resolution: "@biomejs/cli-darwin-x64@npm:1.9.4" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@biomejs/cli-linux-arm64-musl@npm:1.9.4": + version: 1.9.4 + resolution: "@biomejs/cli-linux-arm64-musl@npm:1.9.4" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@biomejs/cli-linux-arm64@npm:1.9.4": + version: 1.9.4 + resolution: "@biomejs/cli-linux-arm64@npm:1.9.4" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@biomejs/cli-linux-x64-musl@npm:1.9.4": + version: 1.9.4 + resolution: "@biomejs/cli-linux-x64-musl@npm:1.9.4" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@biomejs/cli-linux-x64@npm:1.9.4": + version: 1.9.4 + resolution: "@biomejs/cli-linux-x64@npm:1.9.4" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@biomejs/cli-win32-arm64@npm:1.9.4": + version: 1.9.4 + resolution: "@biomejs/cli-win32-arm64@npm:1.9.4" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@biomejs/cli-win32-x64@npm:1.9.4": + version: 1.9.4 + resolution: "@biomejs/cli-win32-x64@npm:1.9.4" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@e2e-test/kusama@workspace:packages/kusama": version: 0.0.0-use.local resolution: "@e2e-test/kusama@workspace:packages/kusama" @@ -474,85 +565,6 @@ __metadata: languageName: node linkType: hard -"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0": - version: 4.4.1 - resolution: "@eslint-community/eslint-utils@npm:4.4.1" - dependencies: - eslint-visitor-keys: "npm:^3.4.3" - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - checksum: 10c0/2aa0ac2fc50ff3f234408b10900ed4f1a0b19352f21346ad4cc3d83a1271481bdda11097baa45d484dd564c895e0762a27a8240be7a256b3ad47129e96528252 - languageName: node - linkType: hard - -"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.12.1": - version: 4.12.1 - resolution: "@eslint-community/regexpp@npm:4.12.1" - checksum: 10c0/a03d98c246bcb9109aec2c08e4d10c8d010256538dcb3f56610191607214523d4fb1b00aa81df830b6dffb74c5fa0be03642513a289c567949d3e550ca11cdf6 - languageName: node - linkType: hard - -"@eslint/config-array@npm:^0.19.0": - version: 0.19.1 - resolution: "@eslint/config-array@npm:0.19.1" - dependencies: - "@eslint/object-schema": "npm:^2.1.5" - debug: "npm:^4.3.1" - minimatch: "npm:^3.1.2" - checksum: 10c0/43b01f596ddad404473beae5cf95c013d29301c72778d0f5bf8a6699939c8a9a5663dbd723b53c5f476b88b0c694f76ea145d1aa9652230d140fe1161e4a4b49 - languageName: node - linkType: hard - -"@eslint/core@npm:^0.10.0": - version: 0.10.0 - resolution: "@eslint/core@npm:0.10.0" - dependencies: - "@types/json-schema": "npm:^7.0.15" - checksum: 10c0/074018075079b3ed1f14fab9d116f11a8824cdfae3e822badf7ad546962fafe717a31e61459bad8cc59cf7070dc413ea9064ddb75c114f05b05921029cde0a64 - languageName: node - linkType: hard - -"@eslint/eslintrc@npm:^3.2.0": - version: 3.2.0 - resolution: "@eslint/eslintrc@npm:3.2.0" - dependencies: - ajv: "npm:^6.12.4" - debug: "npm:^4.3.2" - espree: "npm:^10.0.1" - globals: "npm:^14.0.0" - ignore: "npm:^5.2.0" - import-fresh: "npm:^3.2.1" - js-yaml: "npm:^4.1.0" - minimatch: "npm:^3.1.2" - strip-json-comments: "npm:^3.1.1" - checksum: 10c0/43867a07ff9884d895d9855edba41acf325ef7664a8df41d957135a81a477ff4df4196f5f74dc3382627e5cc8b7ad6b815c2cea1b58f04a75aced7c43414ab8b - languageName: node - linkType: hard - -"@eslint/js@npm:9.18.0, @eslint/js@npm:^9.16.0": - version: 9.18.0 - resolution: "@eslint/js@npm:9.18.0" - checksum: 10c0/3938344c5ac7feef4b73fcb30f3c3e753570cea74c24904bb5d07e9c42fcd34fcbc40f545b081356a299e11f360c9c274b348c05fb0113fc3d492e5175eee140 - languageName: node - linkType: hard - -"@eslint/object-schema@npm:^2.1.5": - version: 2.1.5 - resolution: "@eslint/object-schema@npm:2.1.5" - checksum: 10c0/5320691ed41ecd09a55aff40ce8e56596b4eb81f3d4d6fe530c50fdd6552d88102d1c1a29d970ae798ce30849752a708772de38ded07a6f25b3da32ebea081d8 - languageName: node - linkType: hard - -"@eslint/plugin-kit@npm:^0.2.5": - version: 0.2.5 - resolution: "@eslint/plugin-kit@npm:0.2.5" - dependencies: - "@eslint/core": "npm:^0.10.0" - levn: "npm:^0.4.1" - checksum: 10c0/ba9832b8409af618cf61791805fe201dd62f3c82c783adfcec0f5cd391e68b40beaecb47b9a3209e926dbcab65135f410cae405b69a559197795793399f61176 - languageName: node - linkType: hard - "@gar/promisify@npm:^1.0.1": version: 1.1.3 resolution: "@gar/promisify@npm:1.1.3" @@ -560,44 +572,6 @@ __metadata: languageName: node linkType: hard -"@humanfs/core@npm:^0.19.1": - version: 0.19.1 - resolution: "@humanfs/core@npm:0.19.1" - checksum: 10c0/aa4e0152171c07879b458d0e8a704b8c3a89a8c0541726c6b65b81e84fd8b7564b5d6c633feadc6598307d34564bd53294b533491424e8e313d7ab6c7bc5dc67 - languageName: node - linkType: hard - -"@humanfs/node@npm:^0.16.6": - version: 0.16.6 - resolution: "@humanfs/node@npm:0.16.6" - dependencies: - "@humanfs/core": "npm:^0.19.1" - "@humanwhocodes/retry": "npm:^0.3.0" - checksum: 10c0/8356359c9f60108ec204cbd249ecd0356667359b2524886b357617c4a7c3b6aace0fd5a369f63747b926a762a88f8a25bc066fa1778508d110195ce7686243e1 - languageName: node - linkType: hard - -"@humanwhocodes/module-importer@npm:^1.0.1": - version: 1.0.1 - resolution: "@humanwhocodes/module-importer@npm:1.0.1" - checksum: 10c0/909b69c3b86d482c26b3359db16e46a32e0fb30bd306a3c176b8313b9e7313dba0f37f519de6aa8b0a1921349e505f259d19475e123182416a506d7f87e7f529 - languageName: node - linkType: hard - -"@humanwhocodes/retry@npm:^0.3.0": - version: 0.3.1 - resolution: "@humanwhocodes/retry@npm:0.3.1" - checksum: 10c0/f0da1282dfb45e8120480b9e2e275e2ac9bbe1cf016d046fdad8e27cc1285c45bb9e711681237944445157b430093412b4446c1ab3fc4bb037861b5904101d3b - languageName: node - linkType: hard - -"@humanwhocodes/retry@npm:^0.4.1": - version: 0.4.1 - resolution: "@humanwhocodes/retry@npm:0.4.1" - checksum: 10c0/be7bb6841c4c01d0b767d9bb1ec1c9359ee61421ce8ba66c249d035c5acdfd080f32d55a5c9e859cdd7868788b8935774f65b2caf24ec0b7bd7bf333791f063b - languageName: node - linkType: hard - "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -644,40 +618,6 @@ __metadata: languageName: node linkType: hard -"@nodelib/fs.scandir@npm:2.1.5": - version: 2.1.5 - resolution: "@nodelib/fs.scandir@npm:2.1.5" - dependencies: - "@nodelib/fs.stat": "npm:2.0.5" - run-parallel: "npm:^1.1.9" - checksum: 10c0/732c3b6d1b1e967440e65f284bd06e5821fedf10a1bea9ed2bb75956ea1f30e08c44d3def9d6a230666574edbaf136f8cfd319c14fd1f87c66e6a44449afb2eb - languageName: node - linkType: hard - -"@nodelib/fs.stat@npm:2.0.5, @nodelib/fs.stat@npm:^2.0.2": - version: 2.0.5 - resolution: "@nodelib/fs.stat@npm:2.0.5" - checksum: 10c0/88dafe5e3e29a388b07264680dc996c17f4bda48d163a9d4f5c1112979f0ce8ec72aa7116122c350b4e7976bc5566dc3ddb579be1ceaacc727872eb4ed93926d - languageName: node - linkType: hard - -"@nodelib/fs.walk@npm:^1.2.3": - version: 1.2.8 - resolution: "@nodelib/fs.walk@npm:1.2.8" - dependencies: - "@nodelib/fs.scandir": "npm:2.1.5" - fastq: "npm:^1.6.0" - checksum: 10c0/db9de047c3bb9b51f9335a7bb46f4fcfb6829fb628318c12115fbaf7d369bfce71c15b103d1fc3b464812d936220ee9bc1c8f762d032c9f6be9acc99249095b1 - languageName: node - linkType: hard - -"@nolyfill/is-core-module@npm:1.0.39": - version: 1.0.39 - resolution: "@nolyfill/is-core-module@npm:1.0.39" - checksum: 10c0/34ab85fdc2e0250879518841f74a30c276bca4f6c3e13526d2d1fe515e1adf6d46c25fcd5989d22ea056d76f7c39210945180b4859fc83b050e2da411aa86289 - languageName: node - linkType: hard - "@npmcli/agent@npm:^3.0.0": version: 3.0.0 resolution: "@npmcli/agent@npm:3.0.0" @@ -1599,27 +1539,13 @@ __metadata: languageName: node linkType: hard -"@types/doctrine@npm:^0.0.9": - version: 0.0.9 - resolution: "@types/doctrine@npm:0.0.9" - checksum: 10c0/cdaca493f13c321cf0cacd1973efc0ae74569633145d9e6fc1128f32217a6968c33bea1f858275239fe90c98f3be57ec8f452b416a9ff48b8e8c1098b20fa51c - languageName: node - linkType: hard - -"@types/estree@npm:1.0.6, @types/estree@npm:^1.0.0, @types/estree@npm:^1.0.6": +"@types/estree@npm:1.0.6, @types/estree@npm:^1.0.0": version: 1.0.6 resolution: "@types/estree@npm:1.0.6" checksum: 10c0/cdfd751f6f9065442cd40957c07fd80361c962869aa853c1c2fd03e101af8b9389d8ff4955a43a6fcfa223dd387a089937f95be0f3eec21ca527039fd2d9859a languageName: node linkType: hard -"@types/json-schema@npm:^7.0.15": - version: 7.0.15 - resolution: "@types/json-schema@npm:7.0.15" - checksum: 10c0/a996a745e6c5d60292f36731dd41341339d4eeed8180bb09226e5c8d23759067692b1d88e5d91d72ee83dfc00d3aca8e7bd43ea120516c17922cbcb7c3e252db - languageName: node - linkType: hard - "@types/lodash@npm:^4.17.13": version: 4.17.14 resolution: "@types/lodash@npm:4.17.14" @@ -1636,118 +1562,6 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:8.21.0": - version: 8.21.0 - resolution: "@typescript-eslint/eslint-plugin@npm:8.21.0" - dependencies: - "@eslint-community/regexpp": "npm:^4.10.0" - "@typescript-eslint/scope-manager": "npm:8.21.0" - "@typescript-eslint/type-utils": "npm:8.21.0" - "@typescript-eslint/utils": "npm:8.21.0" - "@typescript-eslint/visitor-keys": "npm:8.21.0" - graphemer: "npm:^1.4.0" - ignore: "npm:^5.3.1" - natural-compare: "npm:^1.4.0" - ts-api-utils: "npm:^2.0.0" - peerDependencies: - "@typescript-eslint/parser": ^8.0.0 || ^8.0.0-alpha.0 - eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <5.8.0" - checksum: 10c0/4601d21ec35b9fa5cfc1ad0330733ab40d6c6822c7fc15c3584a16f678c9a72e077a1725a950823fe0f499a15f3981795b1ea5d1e7a1be5c7b8296ea9ae6327c - languageName: node - linkType: hard - -"@typescript-eslint/parser@npm:8.21.0": - version: 8.21.0 - resolution: "@typescript-eslint/parser@npm:8.21.0" - dependencies: - "@typescript-eslint/scope-manager": "npm:8.21.0" - "@typescript-eslint/types": "npm:8.21.0" - "@typescript-eslint/typescript-estree": "npm:8.21.0" - "@typescript-eslint/visitor-keys": "npm:8.21.0" - debug: "npm:^4.3.4" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <5.8.0" - checksum: 10c0/aadebd50ca7aa2d61ad85d890c0d7010f2c293ec4d50a7833ef9674f232f0bc7118faa93a898771fbea50f02d542d687cf3569421b23f72fe6fed6895d5506fc - languageName: node - linkType: hard - -"@typescript-eslint/scope-manager@npm:8.21.0, @typescript-eslint/scope-manager@npm:^8.1.0": - version: 8.21.0 - resolution: "@typescript-eslint/scope-manager@npm:8.21.0" - dependencies: - "@typescript-eslint/types": "npm:8.21.0" - "@typescript-eslint/visitor-keys": "npm:8.21.0" - checksum: 10c0/ea405e79dc884ea1c76465604db52f9b0941d6cbb0bde6bce1af689ef212f782e214de69d46503c7c47bfc180d763369b7433f1965e3be3c442b417e8c9f8f75 - languageName: node - linkType: hard - -"@typescript-eslint/type-utils@npm:8.21.0": - version: 8.21.0 - resolution: "@typescript-eslint/type-utils@npm:8.21.0" - dependencies: - "@typescript-eslint/typescript-estree": "npm:8.21.0" - "@typescript-eslint/utils": "npm:8.21.0" - debug: "npm:^4.3.4" - ts-api-utils: "npm:^2.0.0" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <5.8.0" - checksum: 10c0/617f5dfe83fd9a7c722b27fa4e7f0c84f29baa94f75a4e8e5ccfd5b0a373437f65724e21b9642870fb0960f204b1a7f516a038200a12f8118f21b1bf86315bf3 - languageName: node - linkType: hard - -"@typescript-eslint/types@npm:8.21.0": - version: 8.21.0 - resolution: "@typescript-eslint/types@npm:8.21.0" - checksum: 10c0/67dfd300cc614d7b02e94d0dacfb228a7f4c3fd4eede29c43adb9e9fcc16365ae3df8d6165018da3c123dce65545bef03e3e8183f35e9b3a911ffc727e3274c2 - languageName: node - linkType: hard - -"@typescript-eslint/typescript-estree@npm:8.21.0": - version: 8.21.0 - resolution: "@typescript-eslint/typescript-estree@npm:8.21.0" - dependencies: - "@typescript-eslint/types": "npm:8.21.0" - "@typescript-eslint/visitor-keys": "npm:8.21.0" - debug: "npm:^4.3.4" - fast-glob: "npm:^3.3.2" - is-glob: "npm:^4.0.3" - minimatch: "npm:^9.0.4" - semver: "npm:^7.6.0" - ts-api-utils: "npm:^2.0.0" - peerDependencies: - typescript: ">=4.8.4 <5.8.0" - checksum: 10c0/0cf5b0382524f4af54fb5ec71ca7e939ec922711f2d77b383740b28dd4b21407b0ab5dded62df6819d01c12c0b354e95667e3c7025a5d27d05b805161ab94855 - languageName: node - linkType: hard - -"@typescript-eslint/utils@npm:8.21.0, @typescript-eslint/utils@npm:^8.1.0": - version: 8.21.0 - resolution: "@typescript-eslint/utils@npm:8.21.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:8.21.0" - "@typescript-eslint/types": "npm:8.21.0" - "@typescript-eslint/typescript-estree": "npm:8.21.0" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <5.8.0" - checksum: 10c0/d8347dbe9176417220aa62902cfc1b2007a9246bb7a8cccdf8590120903eb50ca14cb668efaab4646d086277f2367559985b62230e43ebd8b0723d237eeaa2f2 - languageName: node - linkType: hard - -"@typescript-eslint/visitor-keys@npm:8.21.0": - version: 8.21.0 - resolution: "@typescript-eslint/visitor-keys@npm:8.21.0" - dependencies: - "@typescript-eslint/types": "npm:8.21.0" - eslint-visitor-keys: "npm:^4.2.0" - checksum: 10c0/b3f1412f550e35c0d7ae0410db616951116b365167539f9b85710d8bc2b36b322c5e637caee84cc1ae5df8f1d961880250d52ffdef352b31e5bdbef74ba6fea9 - languageName: node - linkType: hard - "@vitest/expect@npm:2.1.8": version: 2.1.8 resolution: "@vitest/expect@npm:2.1.8" @@ -1860,15 +1674,6 @@ __metadata: languageName: node linkType: hard -"acorn-jsx@npm:^5.3.2": - version: 5.3.2 - resolution: "acorn-jsx@npm:5.3.2" - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: 10c0/4c54868fbef3b8d58927d5e33f0a4de35f59012fe7b12cf9dfbb345fb8f46607709e1c4431be869a23fb63c151033d84c4198fa9f79385cec34fcb1dd53974c1 - languageName: node - linkType: hard - "acorn@npm:^8.14.0": version: 8.14.0 resolution: "acorn@npm:8.14.0" @@ -1913,18 +1718,6 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.12.4": - version: 6.12.6 - resolution: "ajv@npm:6.12.6" - dependencies: - fast-deep-equal: "npm:^3.1.1" - fast-json-stable-stringify: "npm:^2.0.0" - json-schema-traverse: "npm:^0.4.1" - uri-js: "npm:^4.2.2" - checksum: 10c0/41e23642cbe545889245b9d2a45854ebba51cda6c778ebced9649420d9205f2efb39cb43dbc41e358409223b1ea43303ae4839db682c848b891e4811da1a5a71 - languageName: node - linkType: hard - "ansi-escapes@npm:^7.0.0": version: 7.0.0 resolution: "ansi-escapes@npm:7.0.0" @@ -2183,13 +1976,6 @@ __metadata: languageName: node linkType: hard -"callsites@npm:^3.0.0": - version: 3.1.0 - resolution: "callsites@npm:3.1.0" - checksum: 10c0/fff92277400eb06c3079f9e74f3af120db9f8ea03bad0e84d9aede54bbe2d44a56cccb5f6cf12211f93f52306df87077ecec5b712794c5a9b5dac6d615a3f301 - languageName: node - linkType: hard - "chai@npm:^5.1.2": version: 5.1.2 resolution: "chai@npm:5.1.2" @@ -2401,7 +2187,7 @@ __metadata: languageName: node linkType: hard -"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.6": +"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.3": version: 7.0.6 resolution: "cross-spawn@npm:7.0.6" dependencies: @@ -2433,7 +2219,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.7, debug@npm:~4.4.0": +"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.7, debug@npm:~4.4.0": version: 4.4.0 resolution: "debug@npm:4.4.0" dependencies: @@ -2445,15 +2231,6 @@ __metadata: languageName: node linkType: hard -"debug@npm:^3.2.7": - version: 3.2.7 - resolution: "debug@npm:3.2.7" - dependencies: - ms: "npm:^2.1.1" - checksum: 10c0/37d96ae42cbc71c14844d2ae3ba55adf462ec89fd3a999459dec3833944cd999af6007ff29c780f1c61153bcaaf2c842d1e4ce1ec621e4fc4923244942e4a02a - languageName: node - linkType: hard - "decompress-response@npm:^6.0.0": version: 6.0.0 resolution: "decompress-response@npm:6.0.0" @@ -2477,13 +2254,6 @@ __metadata: languageName: node linkType: hard -"deep-is@npm:^0.1.3": - version: 0.1.4 - resolution: "deep-is@npm:0.1.4" - checksum: 10c0/7f0ee496e0dff14a573dc6127f14c95061b448b87b995fc96c017ce0a1e66af1675e73f1d6064407975bc4ea6ab679497a29fff7b5b9c4e99cb10797c1ad0b4c - languageName: node - linkType: hard - "define-data-property@npm:^1.0.1": version: 1.1.4 resolution: "define-data-property@npm:1.1.4" @@ -2541,15 +2311,6 @@ __metadata: languageName: node linkType: hard -"doctrine@npm:^3.0.0": - version: 3.0.0 - resolution: "doctrine@npm:3.0.0" - dependencies: - esutils: "npm:^2.0.2" - checksum: 10c0/c96bdccabe9d62ab6fea9399fdff04a66e6563c1d6fb3a3a063e8d53c3bb136ba63e84250bbf63d00086a769ad53aef92d2bd483f03f837fc97b71cbee6b2520 - languageName: node - linkType: hard - "dotenv@npm:^16.0.3, dotenv@npm:^16.4.5, dotenv@npm:^16.4.7": version: 16.4.7 resolution: "dotenv@npm:16.4.7" @@ -2561,25 +2322,18 @@ __metadata: version: 0.0.0-use.local resolution: "e2e-tests@workspace:." dependencies: + "@biomejs/biome": "npm:1.9.4" "@e2e-test/networks": "workspace:*" - "@eslint/eslintrc": "npm:^3.2.0" - "@eslint/js": "npm:^9.16.0" "@swc/core": "npm:^1.10.4" "@types/lodash": "npm:^4.17.13" "@types/node": "npm:^22.10.3" "@vitest/ui": "npm:^2.1.8" dotenv: "npm:^16.4.5" - eslint: "npm:^9.15.0" - eslint-config-prettier: "npm:^9.1.0" - eslint-import-resolver-typescript: "npm:^3.6.3" - eslint-plugin-import-x: "npm:^4.4.3" husky: "npm:^9.1.7" lint-staged: "npm:^15.2.10" lodash: "npm:^4.17.21" - prettier: "npm:^3.3.3" tsx: "npm:^4.19.2" typescript: "npm:^5.6.3" - typescript-eslint: "npm:^8.16.0" unplugin-swc: "npm:^1.5.1" vite-tsconfig-paths: "npm:^5.1.3" vitest: "npm:^2.1.6" @@ -2632,16 +2386,6 @@ __metadata: languageName: node linkType: hard -"enhanced-resolve@npm:^5.15.0, enhanced-resolve@npm:^5.17.1": - version: 5.18.0 - resolution: "enhanced-resolve@npm:5.18.0" - dependencies: - graceful-fs: "npm:^4.2.4" - tapable: "npm:^2.2.0" - checksum: 10c0/5fcc264a6040754ab5b349628cac2bb5f89cee475cbe340804e657a5b9565f70e6aafb338d5895554eb0ced9f66c50f38a255274a0591dcb64ee17c549c459ce - languageName: node - linkType: hard - "env-paths@npm:^2.2.0": version: 2.2.1 resolution: "env-paths@npm:2.2.1" @@ -2868,185 +2612,6 @@ __metadata: languageName: node linkType: hard -"eslint-config-prettier@npm:^9.1.0": - version: 9.1.0 - resolution: "eslint-config-prettier@npm:9.1.0" - peerDependencies: - eslint: ">=7.0.0" - bin: - eslint-config-prettier: bin/cli.js - checksum: 10c0/6d332694b36bc9ac6fdb18d3ca2f6ac42afa2ad61f0493e89226950a7091e38981b66bac2b47ba39d15b73fff2cd32c78b850a9cf9eed9ca9a96bfb2f3a2f10d - languageName: node - linkType: hard - -"eslint-import-resolver-node@npm:^0.3.9": - version: 0.3.9 - resolution: "eslint-import-resolver-node@npm:0.3.9" - dependencies: - debug: "npm:^3.2.7" - is-core-module: "npm:^2.13.0" - resolve: "npm:^1.22.4" - checksum: 10c0/0ea8a24a72328a51fd95aa8f660dcca74c1429806737cf10261ab90cfcaaf62fd1eff664b76a44270868e0a932711a81b250053942595bcd00a93b1c1575dd61 - languageName: node - linkType: hard - -"eslint-import-resolver-typescript@npm:^3.6.3": - version: 3.7.0 - resolution: "eslint-import-resolver-typescript@npm:3.7.0" - dependencies: - "@nolyfill/is-core-module": "npm:1.0.39" - debug: "npm:^4.3.7" - enhanced-resolve: "npm:^5.15.0" - fast-glob: "npm:^3.3.2" - get-tsconfig: "npm:^4.7.5" - is-bun-module: "npm:^1.0.2" - is-glob: "npm:^4.0.3" - stable-hash: "npm:^0.0.4" - peerDependencies: - eslint: "*" - eslint-plugin-import: "*" - eslint-plugin-import-x: "*" - peerDependenciesMeta: - eslint-plugin-import: - optional: true - eslint-plugin-import-x: - optional: true - checksum: 10c0/b1dec542a31486b3b5730f71f08a8ee2ac4915dbc4aa1493fd15bc8fcadcb029772ab39a425824c235045b3a7e629290a339d4a7e7f3dd32b24e715106352d40 - languageName: node - linkType: hard - -"eslint-plugin-import-x@npm:^4.4.3": - version: 4.6.1 - resolution: "eslint-plugin-import-x@npm:4.6.1" - dependencies: - "@types/doctrine": "npm:^0.0.9" - "@typescript-eslint/scope-manager": "npm:^8.1.0" - "@typescript-eslint/utils": "npm:^8.1.0" - debug: "npm:^4.3.4" - doctrine: "npm:^3.0.0" - enhanced-resolve: "npm:^5.17.1" - eslint-import-resolver-node: "npm:^0.3.9" - get-tsconfig: "npm:^4.7.3" - is-glob: "npm:^4.0.3" - minimatch: "npm:^9.0.3" - semver: "npm:^7.6.3" - stable-hash: "npm:^0.0.4" - tslib: "npm:^2.6.3" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - checksum: 10c0/08ea85d7dc096f3998c05237c93cd14e0cb072c66ee500fa69f5ce37a81ffc8c76cf682ec53156b09f2ed2071308eb93e53bd7741e0cfd8c56e12f09ae24be82 - languageName: node - linkType: hard - -"eslint-scope@npm:^8.2.0": - version: 8.2.0 - resolution: "eslint-scope@npm:8.2.0" - dependencies: - esrecurse: "npm:^4.3.0" - estraverse: "npm:^5.2.0" - checksum: 10c0/8d2d58e2136d548ac7e0099b1a90d9fab56f990d86eb518de1247a7066d38c908be2f3df477a79cf60d70b30ba18735d6c6e70e9914dca2ee515a729975d70d6 - languageName: node - linkType: hard - -"eslint-visitor-keys@npm:^3.4.3": - version: 3.4.3 - resolution: "eslint-visitor-keys@npm:3.4.3" - checksum: 10c0/92708e882c0a5ffd88c23c0b404ac1628cf20104a108c745f240a13c332a11aac54f49a22d5762efbffc18ecbc9a580d1b7ad034bf5f3cc3307e5cbff2ec9820 - languageName: node - linkType: hard - -"eslint-visitor-keys@npm:^4.2.0": - version: 4.2.0 - resolution: "eslint-visitor-keys@npm:4.2.0" - checksum: 10c0/2ed81c663b147ca6f578312919483eb040295bbab759e5a371953456c636c5b49a559883e2677112453728d66293c0a4c90ab11cab3428cf02a0236d2e738269 - languageName: node - linkType: hard - -"eslint@npm:^9.15.0": - version: 9.18.0 - resolution: "eslint@npm:9.18.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.2.0" - "@eslint-community/regexpp": "npm:^4.12.1" - "@eslint/config-array": "npm:^0.19.0" - "@eslint/core": "npm:^0.10.0" - "@eslint/eslintrc": "npm:^3.2.0" - "@eslint/js": "npm:9.18.0" - "@eslint/plugin-kit": "npm:^0.2.5" - "@humanfs/node": "npm:^0.16.6" - "@humanwhocodes/module-importer": "npm:^1.0.1" - "@humanwhocodes/retry": "npm:^0.4.1" - "@types/estree": "npm:^1.0.6" - "@types/json-schema": "npm:^7.0.15" - ajv: "npm:^6.12.4" - chalk: "npm:^4.0.0" - cross-spawn: "npm:^7.0.6" - debug: "npm:^4.3.2" - escape-string-regexp: "npm:^4.0.0" - eslint-scope: "npm:^8.2.0" - eslint-visitor-keys: "npm:^4.2.0" - espree: "npm:^10.3.0" - esquery: "npm:^1.5.0" - esutils: "npm:^2.0.2" - fast-deep-equal: "npm:^3.1.3" - file-entry-cache: "npm:^8.0.0" - find-up: "npm:^5.0.0" - glob-parent: "npm:^6.0.2" - ignore: "npm:^5.2.0" - imurmurhash: "npm:^0.1.4" - is-glob: "npm:^4.0.0" - json-stable-stringify-without-jsonify: "npm:^1.0.1" - lodash.merge: "npm:^4.6.2" - minimatch: "npm:^3.1.2" - natural-compare: "npm:^1.4.0" - optionator: "npm:^0.9.3" - peerDependencies: - jiti: "*" - peerDependenciesMeta: - jiti: - optional: true - bin: - eslint: bin/eslint.js - checksum: 10c0/7f592ad228b9bd627a24870fdc875bacdab7bf535d4b67316c4cb791e90d0125130a74769f3c407b0c4b7027b3082ef33864a63ee1024552a60a17db60493f15 - languageName: node - linkType: hard - -"espree@npm:^10.0.1, espree@npm:^10.3.0": - version: 10.3.0 - resolution: "espree@npm:10.3.0" - dependencies: - acorn: "npm:^8.14.0" - acorn-jsx: "npm:^5.3.2" - eslint-visitor-keys: "npm:^4.2.0" - checksum: 10c0/272beeaca70d0a1a047d61baff64db04664a33d7cfb5d144f84bc8a5c6194c6c8ebe9cc594093ca53add88baa23e59b01e69e8a0160ab32eac570482e165c462 - languageName: node - linkType: hard - -"esquery@npm:^1.5.0": - version: 1.6.0 - resolution: "esquery@npm:1.6.0" - dependencies: - estraverse: "npm:^5.1.0" - checksum: 10c0/cb9065ec605f9da7a76ca6dadb0619dfb611e37a81e318732977d90fab50a256b95fee2d925fba7c2f3f0523aa16f91587246693bc09bc34d5a59575fe6e93d2 - languageName: node - linkType: hard - -"esrecurse@npm:^4.3.0": - version: 4.3.0 - resolution: "esrecurse@npm:4.3.0" - dependencies: - estraverse: "npm:^5.2.0" - checksum: 10c0/81a37116d1408ded88ada45b9fb16dbd26fba3aadc369ce50fcaf82a0bac12772ebd7b24cd7b91fc66786bf2c1ac7b5f196bc990a473efff972f5cb338877cf5 - languageName: node - linkType: hard - -"estraverse@npm:^5.1.0, estraverse@npm:^5.2.0": - version: 5.3.0 - resolution: "estraverse@npm:5.3.0" - checksum: 10c0/1ff9447b96263dec95d6d67431c5e0771eb9776427421260a3e2f0fdd5d6bd4f8e37a7338f5ad2880c9f143450c9b1e4fc2069060724570a49cf9cf0312bd107 - languageName: node - linkType: hard - "estree-walker@npm:^2.0.2": version: 2.0.2 resolution: "estree-walker@npm:2.0.2" @@ -3063,13 +2628,6 @@ __metadata: languageName: node linkType: hard -"esutils@npm:^2.0.2": - version: 2.0.3 - resolution: "esutils@npm:2.0.3" - checksum: 10c0/9a2fe69a41bfdade834ba7c42de4723c97ec776e40656919c62cbd13607c45e127a003f05f724a1ea55e5029a4cf2de444b13009f2af71271e42d93a637137c7 - languageName: node - linkType: hard - "eventemitter3@npm:^5.0.1": version: 5.0.1 resolution: "eventemitter3@npm:5.0.1" @@ -3122,40 +2680,6 @@ __metadata: languageName: node linkType: hard -"fast-deep-equal@npm:^3.1.1, fast-deep-equal@npm:^3.1.3": - version: 3.1.3 - resolution: "fast-deep-equal@npm:3.1.3" - checksum: 10c0/40dedc862eb8992c54579c66d914635afbec43350afbbe991235fdcb4e3a8d5af1b23ae7e79bef7d4882d0ecee06c3197488026998fb19f72dc95acff1d1b1d0 - languageName: node - linkType: hard - -"fast-glob@npm:^3.3.2": - version: 3.3.3 - resolution: "fast-glob@npm:3.3.3" - dependencies: - "@nodelib/fs.stat": "npm:^2.0.2" - "@nodelib/fs.walk": "npm:^1.2.3" - glob-parent: "npm:^5.1.2" - merge2: "npm:^1.3.0" - micromatch: "npm:^4.0.8" - checksum: 10c0/f6aaa141d0d3384cf73cbcdfc52f475ed293f6d5b65bfc5def368b09163a9f7e5ec2b3014d80f733c405f58e470ee0cc451c2937685045cddcdeaa24199c43fe - languageName: node - linkType: hard - -"fast-json-stable-stringify@npm:^2.0.0": - version: 2.1.0 - resolution: "fast-json-stable-stringify@npm:2.1.0" - checksum: 10c0/7f081eb0b8a64e0057b3bb03f974b3ef00135fbf36c1c710895cd9300f13c94ba809bb3a81cf4e1b03f6e5285610a61abbd7602d0652de423144dfee5a389c9b - languageName: node - linkType: hard - -"fast-levenshtein@npm:^2.0.6": - version: 2.0.6 - resolution: "fast-levenshtein@npm:2.0.6" - checksum: 10c0/111972b37338bcb88f7d9e2c5907862c280ebf4234433b95bc611e518d192ccb2d38119c4ac86e26b668d75f7f3894f4ff5c4982899afced7ca78633b08287c4 - languageName: node - linkType: hard - "fast-redact@npm:^3.1.1": version: 3.5.0 resolution: "fast-redact@npm:3.5.0" @@ -3170,15 +2694,6 @@ __metadata: languageName: node linkType: hard -"fastq@npm:^1.6.0": - version: 1.18.0 - resolution: "fastq@npm:1.18.0" - dependencies: - reusify: "npm:^1.0.4" - checksum: 10c0/7be87ecc41762adbddf558d24182f50a4b1a3ef3ee807d33b7623da7aee5faecdcc94fce5aa13fe91df93e269f383232bbcdb2dc5338cd1826503d6063221f36 - languageName: node - linkType: hard - "fdir@npm:^6.4.2": version: 6.4.3 resolution: "fdir@npm:6.4.3" @@ -3208,15 +2723,6 @@ __metadata: languageName: node linkType: hard -"file-entry-cache@npm:^8.0.0": - version: 8.0.0 - resolution: "file-entry-cache@npm:8.0.0" - dependencies: - flat-cache: "npm:^4.0.0" - checksum: 10c0/9e2b5938b1cd9b6d7e3612bdc533afd4ac17b2fc646569e9a8abbf2eb48e5eb8e316bc38815a3ef6a1b456f4107f0d0f055a614ca613e75db6bf9ff4d72c1638 - languageName: node - linkType: hard - "file-uri-to-path@npm:1.0.0": version: 1.0.0 resolution: "file-uri-to-path@npm:1.0.0" @@ -3233,27 +2739,7 @@ __metadata: languageName: node linkType: hard -"find-up@npm:^5.0.0": - version: 5.0.0 - resolution: "find-up@npm:5.0.0" - dependencies: - locate-path: "npm:^6.0.0" - path-exists: "npm:^4.0.0" - checksum: 10c0/062c5a83a9c02f53cdd6d175a37ecf8f87ea5bbff1fdfb828f04bfa021441bc7583e8ebc0872a4c1baab96221fb8a8a275a19809fb93fbc40bd69ec35634069a - languageName: node - linkType: hard - -"flat-cache@npm:^4.0.0": - version: 4.0.1 - resolution: "flat-cache@npm:4.0.1" - dependencies: - flatted: "npm:^3.2.9" - keyv: "npm:^4.5.4" - checksum: 10c0/2c59d93e9faa2523e4fda6b4ada749bed432cfa28c8e251f33b25795e426a1c6dbada777afb1f74fcfff33934fdbdea921ee738fcc33e71adc9d6eca984a1cfc - languageName: node - linkType: hard - -"flatted@npm:^3.2.9, flatted@npm:^3.3.1": +"flatted@npm:^3.3.1": version: 3.3.2 resolution: "flatted@npm:3.3.2" checksum: 10c0/24cc735e74d593b6c767fe04f2ef369abe15b62f6906158079b9874bdb3ee5ae7110bb75042e70cd3f99d409d766f357caf78d5ecee9780206f5fdc5edbad334 @@ -3351,13 +2837,6 @@ __metadata: languageName: node linkType: hard -"function-bind@npm:^1.1.2": - version: 1.1.2 - resolution: "function-bind@npm:1.1.2" - checksum: 10c0/d8680ee1e5fcd4c197e4ac33b2b4dce03c71f4d91717292785703db200f5c21f977c568d28061226f9b5900cbcd2c84463646134fd5337e7925e0942bc3f46d5 - languageName: node - linkType: hard - "gauge@npm:^4.0.3": version: 4.0.4 resolution: "gauge@npm:4.0.4" @@ -3395,7 +2874,7 @@ __metadata: languageName: node linkType: hard -"get-tsconfig@npm:^4.7.3, get-tsconfig@npm:^4.7.5": +"get-tsconfig@npm:^4.7.5": version: 4.9.0 resolution: "get-tsconfig@npm:4.9.0" dependencies: @@ -3411,24 +2890,6 @@ __metadata: languageName: node linkType: hard -"glob-parent@npm:^5.1.2": - version: 5.1.2 - resolution: "glob-parent@npm:5.1.2" - dependencies: - is-glob: "npm:^4.0.1" - checksum: 10c0/cab87638e2112bee3f839ef5f6e0765057163d39c66be8ec1602f3823da4692297ad4e972de876ea17c44d652978638d2fd583c6713d0eb6591706825020c9ee - languageName: node - linkType: hard - -"glob-parent@npm:^6.0.2": - version: 6.0.2 - resolution: "glob-parent@npm:6.0.2" - dependencies: - is-glob: "npm:^4.0.3" - checksum: 10c0/317034d88654730230b3f43bb7ad4f7c90257a426e872ea0bf157473ac61c99bf5d205fad8f0185f989be8d2fa6d3c7dce1645d99d545b6ea9089c39f838e7f8 - languageName: node - linkType: hard - "glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.3.7": version: 10.4.5 resolution: "glob@npm:10.4.5" @@ -3473,13 +2934,6 @@ __metadata: languageName: node linkType: hard -"globals@npm:^14.0.0": - version: 14.0.0 - resolution: "globals@npm:14.0.0" - checksum: 10c0/b96ff42620c9231ad468d4c58ff42afee7777ee1c963013ff8aabe095a451d0ceeb8dcd8ef4cbd64d2538cef45f787a78ba3a9574f4a634438963e334471302d - languageName: node - linkType: hard - "globalthis@npm:^1.0.1": version: 1.0.4 resolution: "globalthis@npm:1.0.4" @@ -3511,20 +2965,13 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6": +"graceful-fs@npm:^4.2.6": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: 10c0/386d011a553e02bc594ac2ca0bd6d9e4c22d7fa8cfbfc448a6d148c59ea881b092db9dbe3547ae4b88e55f1b01f7c4a2ecc53b310c042793e63aa44cf6c257f2 languageName: node linkType: hard -"graphemer@npm:^1.4.0": - version: 1.4.0 - resolution: "graphemer@npm:1.4.0" - checksum: 10c0/e951259d8cd2e0d196c72ec711add7115d42eb9a8146c8eeda5b8d3ac91e5dd816b9cd68920726d9fd4490368e7ed86e9c423f40db87e2d8dfafa00fa17c3a31 - languageName: node - linkType: hard - "has-flag@npm:^4.0.0": version: 4.0.0 resolution: "has-flag@npm:4.0.0" @@ -3548,15 +2995,6 @@ __metadata: languageName: node linkType: hard -"hasown@npm:^2.0.2": - version: 2.0.2 - resolution: "hasown@npm:2.0.2" - dependencies: - function-bind: "npm:^1.1.2" - checksum: 10c0/3769d434703b8ac66b209a4cca0737519925bbdb61dd887f93a16372b14694c63ff4e797686d87c90f08168e81082248b9b028bad60d4da9e0d1148766f56eb9 - languageName: node - linkType: hard - "help-me@npm:^5.0.0": version: 5.0.0 resolution: "help-me@npm:5.0.0" @@ -3667,23 +3105,6 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.2.0, ignore@npm:^5.3.1": - version: 5.3.2 - resolution: "ignore@npm:5.3.2" - checksum: 10c0/f9f652c957983634ded1e7f02da3b559a0d4cc210fca3792cb67f1b153623c9c42efdc1c4121af171e295444459fc4a9201101fb041b1104a3c000bccb188337 - languageName: node - linkType: hard - -"import-fresh@npm:^3.2.1": - version: 3.3.0 - resolution: "import-fresh@npm:3.3.0" - dependencies: - parent-module: "npm:^1.0.0" - resolve-from: "npm:^4.0.0" - checksum: 10c0/7f882953aa6b740d1f0e384d0547158bc86efbf2eea0f1483b8900a6f65c5a5123c2cf09b0d542cc419d0b98a759ecaeb394237e97ea427f2da221dc3cd80cc3 - languageName: node - linkType: hard - "imurmurhash@npm:^0.1.4": version: 0.1.4 resolution: "imurmurhash@npm:0.1.4" @@ -3739,31 +3160,6 @@ __metadata: languageName: node linkType: hard -"is-bun-module@npm:^1.0.2": - version: 1.3.0 - resolution: "is-bun-module@npm:1.3.0" - dependencies: - semver: "npm:^7.6.3" - checksum: 10c0/2966744188fcd28e0123c52158c7073973f88babfa9ab04e2846ec5862d6b0f8f398df6413429d930f7c5ee6111ce2cbfb3eb8652d9ec42d4a37dc5089a866fb - languageName: node - linkType: hard - -"is-core-module@npm:^2.13.0, is-core-module@npm:^2.16.0": - version: 2.16.1 - resolution: "is-core-module@npm:2.16.1" - dependencies: - hasown: "npm:^2.0.2" - checksum: 10c0/898443c14780a577e807618aaae2b6f745c8538eca5c7bc11388a3f2dc6de82b9902bcc7eb74f07be672b11bbe82dd6a6edded44a00cb3d8f933d0459905eedd - languageName: node - linkType: hard - -"is-extglob@npm:^2.1.1": - version: 2.1.1 - resolution: "is-extglob@npm:2.1.1" - checksum: 10c0/5487da35691fbc339700bbb2730430b07777a3c21b9ebaecb3072512dfd7b4ba78ac2381a87e8d78d20ea08affb3f1971b4af629173a6bf435ff8a4c47747912 - languageName: node - linkType: hard - "is-fullwidth-code-point@npm:^3.0.0": version: 3.0.0 resolution: "is-fullwidth-code-point@npm:3.0.0" @@ -3787,15 +3183,6 @@ __metadata: languageName: node linkType: hard -"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3": - version: 4.0.3 - resolution: "is-glob@npm:4.0.3" - dependencies: - is-extglob: "npm:^2.1.1" - checksum: 10c0/17fb4014e22be3bbecea9b2e3a76e9e34ff645466be702f1693e8f1ee1adac84710d0be0bd9f967d6354036fd51ab7c2741d954d6e91dae6bb69714de92c197a - languageName: node - linkType: hard - "is-lambda@npm:^1.0.1": version: 1.0.1 resolution: "is-lambda@npm:1.0.1" @@ -3869,27 +3256,6 @@ __metadata: languageName: node linkType: hard -"json-buffer@npm:3.0.1": - version: 3.0.1 - resolution: "json-buffer@npm:3.0.1" - checksum: 10c0/0d1c91569d9588e7eef2b49b59851f297f3ab93c7b35c7c221e288099322be6b562767d11e4821da500f3219542b9afd2e54c5dc573107c1126ed1080f8e96d7 - languageName: node - linkType: hard - -"json-schema-traverse@npm:^0.4.1": - version: 0.4.1 - resolution: "json-schema-traverse@npm:0.4.1" - checksum: 10c0/108fa90d4cc6f08243aedc6da16c408daf81793bf903e9fd5ab21983cda433d5d2da49e40711da016289465ec2e62e0324dcdfbc06275a607fe3233fde4942ce - languageName: node - linkType: hard - -"json-stable-stringify-without-jsonify@npm:^1.0.1": - version: 1.0.1 - resolution: "json-stable-stringify-without-jsonify@npm:1.0.1" - checksum: 10c0/cb168b61fd4de83e58d09aaa6425ef71001bae30d260e2c57e7d09a5fd82223e2f22a042dedaab8db23b7d9ae46854b08bb1f91675a8be11c5cffebef5fb66a5 - languageName: node - linkType: hard - "json-stringify-safe@npm:^5.0.1": version: 5.0.1 resolution: "json-stringify-safe@npm:5.0.1" @@ -3909,25 +3275,6 @@ __metadata: languageName: node linkType: hard -"keyv@npm:^4.5.4": - version: 4.5.4 - resolution: "keyv@npm:4.5.4" - dependencies: - json-buffer: "npm:3.0.1" - checksum: 10c0/aa52f3c5e18e16bb6324876bb8b59dd02acf782a4b789c7b2ae21107fab95fab3890ed448d4f8dba80ce05391eeac4bfabb4f02a20221342982f806fa2cf271e - languageName: node - linkType: hard - -"levn@npm:^0.4.1": - version: 0.4.1 - resolution: "levn@npm:0.4.1" - dependencies: - prelude-ls: "npm:^1.2.1" - type-check: "npm:~0.4.0" - checksum: 10c0/effb03cad7c89dfa5bd4f6989364bfc79994c2042ec5966cb9b95990e2edee5cd8969ddf42616a0373ac49fac1403437deaf6e9050fbbaa3546093a59b9ac94e - languageName: node - linkType: hard - "lilconfig@npm:~3.1.3": version: 3.1.3 resolution: "lilconfig@npm:3.1.3" @@ -3976,22 +3323,6 @@ __metadata: languageName: node linkType: hard -"locate-path@npm:^6.0.0": - version: 6.0.0 - resolution: "locate-path@npm:6.0.0" - dependencies: - p-locate: "npm:^5.0.0" - checksum: 10c0/d3972ab70dfe58ce620e64265f90162d247e87159b6126b01314dd67be43d50e96a50b517bce2d9452a79409c7614054c277b5232377de50416564a77ac7aad3 - languageName: node - linkType: hard - -"lodash.merge@npm:^4.6.2": - version: 4.6.2 - resolution: "lodash.merge@npm:4.6.2" - checksum: 10c0/402fa16a1edd7538de5b5903a90228aa48eb5533986ba7fa26606a49db2572bf414ff73a2c9f5d5fd36b31c46a5d5c7e1527749c07cbcf965ccff5fbdf32c506 - languageName: node - linkType: hard - "lodash@npm:^4.17.21": version: 4.17.21 resolution: "lodash@npm:4.17.21" @@ -4110,14 +3441,7 @@ __metadata: languageName: node linkType: hard -"merge2@npm:^1.3.0": - version: 1.4.1 - resolution: "merge2@npm:1.4.1" - checksum: 10c0/254a8a4605b58f450308fc474c82ac9a094848081bf4c06778200207820e5193726dc563a0d2c16468810516a5c97d9d3ea0ca6585d23c58ccfff2403e8dbbeb - languageName: node - linkType: hard - -"micromatch@npm:^4.0.8, micromatch@npm:~4.0.8": +"micromatch@npm:~4.0.8": version: 4.0.8 resolution: "micromatch@npm:4.0.8" dependencies: @@ -4164,7 +3488,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": +"minimatch@npm:^3.1.1": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -4173,7 +3497,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.3, minimatch@npm:^9.0.4": +"minimatch@npm:^9.0.4": version: 9.0.5 resolution: "minimatch@npm:9.0.5" dependencies: @@ -4355,7 +3679,7 @@ __metadata: languageName: node linkType: hard -"ms@npm:^2.0.0, ms@npm:^2.1.1, ms@npm:^2.1.3": +"ms@npm:^2.0.0, ms@npm:^2.1.3": version: 2.1.3 resolution: "ms@npm:2.1.3" checksum: 10c0/d924b57e7312b3b63ad21fc5b3dc0af5e78d61a1fc7cfb5457edaf26326bf62be5307cc87ffb6862ef1c2b33b0233cdb5d4f01c4c958cc0d660948b65a287a48 @@ -4389,13 +3713,6 @@ __metadata: languageName: node linkType: hard -"natural-compare@npm:^1.4.0": - version: 1.4.0 - resolution: "natural-compare@npm:1.4.0" - checksum: 10c0/f5f9a7974bfb28a91afafa254b197f0f22c684d4a1731763dda960d2c8e375b36c7d690e0d9dc8fba774c537af14a7e979129bca23d88d052fbeb9466955e447 - languageName: node - linkType: hard - "negotiator@npm:^0.6.2": version: 0.6.4 resolution: "negotiator@npm:0.6.4" @@ -4588,38 +3905,6 @@ __metadata: languageName: node linkType: hard -"optionator@npm:^0.9.3": - version: 0.9.4 - resolution: "optionator@npm:0.9.4" - dependencies: - deep-is: "npm:^0.1.3" - fast-levenshtein: "npm:^2.0.6" - levn: "npm:^0.4.1" - prelude-ls: "npm:^1.2.1" - type-check: "npm:^0.4.0" - word-wrap: "npm:^1.2.5" - checksum: 10c0/4afb687a059ee65b61df74dfe87d8d6815cd6883cb8b3d5883a910df72d0f5d029821f37025e4bccf4048873dbdb09acc6d303d27b8f76b1a80dd5a7d5334675 - languageName: node - linkType: hard - -"p-limit@npm:^3.0.2": - version: 3.1.0 - resolution: "p-limit@npm:3.1.0" - dependencies: - yocto-queue: "npm:^0.1.0" - checksum: 10c0/9db675949dbdc9c3763c89e748d0ef8bdad0afbb24d49ceaf4c46c02c77d30db4e0652ed36d0a0a7a95154335fab810d95c86153105bb73b3a90448e2bb14e1a - languageName: node - linkType: hard - -"p-locate@npm:^5.0.0": - version: 5.0.0 - resolution: "p-locate@npm:5.0.0" - dependencies: - p-limit: "npm:^3.0.2" - checksum: 10c0/2290d627ab7903b8b70d11d384fee714b797f6040d9278932754a6860845c4d3190603a0772a663c8cb5a7b21d1b16acb3a6487ebcafa9773094edc3dfe6009a - languageName: node - linkType: hard - "p-map@npm:^4.0.0": version: 4.0.0 resolution: "p-map@npm:4.0.0" @@ -4643,15 +3928,6 @@ __metadata: languageName: node linkType: hard -"parent-module@npm:^1.0.0": - version: 1.0.1 - resolution: "parent-module@npm:1.0.1" - dependencies: - callsites: "npm:^3.0.0" - checksum: 10c0/c63d6e80000d4babd11978e0d3fee386ca7752a02b035fd2435960ffaa7219dc42146f07069fb65e6e8bf1caef89daf9af7535a39bddf354d78bf50d8294f556 - languageName: node - linkType: hard - "parse5-htmlparser2-tree-adapter@npm:^6.0.0": version: 6.0.1 resolution: "parse5-htmlparser2-tree-adapter@npm:6.0.1" @@ -4675,13 +3951,6 @@ __metadata: languageName: node linkType: hard -"path-exists@npm:^4.0.0": - version: 4.0.0 - resolution: "path-exists@npm:4.0.0" - checksum: 10c0/8c0bd3f5238188197dc78dced15207a4716c51cc4e3624c44fc97acf69558f5ebb9a2afff486fe1b4ee148e0c133e96c5e11a9aa5c48a3006e3467da070e5e1b - languageName: node - linkType: hard - "path-is-absolute@npm:^1.0.0": version: 1.0.1 resolution: "path-is-absolute@npm:1.0.1" @@ -4703,13 +3972,6 @@ __metadata: languageName: node linkType: hard -"path-parse@npm:^1.0.7": - version: 1.0.7 - resolution: "path-parse@npm:1.0.7" - checksum: 10c0/11ce261f9d294cc7a58d6a574b7f1b935842355ec66fba3c3fd79e0f036462eaf07d0aa95bb74ff432f9afef97ce1926c720988c6a7451d8a584930ae7de86e1 - languageName: node - linkType: hard - "path-scurry@npm:^1.11.1": version: 1.11.1 resolution: "path-scurry@npm:1.11.1" @@ -4857,22 +4119,6 @@ __metadata: languageName: node linkType: hard -"prelude-ls@npm:^1.2.1": - version: 1.2.1 - resolution: "prelude-ls@npm:1.2.1" - checksum: 10c0/b00d617431e7886c520a6f498a2e14c75ec58f6d93ba48c3b639cf241b54232d90daa05d83a9e9b9fef6baa63cb7e1e4602c2372fea5bc169668401eb127d0cd - languageName: node - linkType: hard - -"prettier@npm:^3.3.3": - version: 3.4.2 - resolution: "prettier@npm:3.4.2" - bin: - prettier: bin/prettier.cjs - checksum: 10c0/99e076a26ed0aba4ebc043880d0f08bbb8c59a4c6641cdee6cdadf2205bdd87aa1d7823f50c3aea41e015e99878d37c58d7b5f0e663bba0ef047f94e36b96446 - languageName: node - linkType: hard - "proc-log@npm:^5.0.0": version: 5.0.0 resolution: "proc-log@npm:5.0.0" @@ -4935,20 +4181,6 @@ __metadata: languageName: node linkType: hard -"punycode@npm:^2.1.0": - version: 2.3.1 - resolution: "punycode@npm:2.3.1" - checksum: 10c0/14f76a8206bc3464f794fb2e3d3cc665ae416c01893ad7a02b23766eb07159144ee612ad67af5e84fa4479ccfe67678c4feb126b0485651b302babf66f04f9e9 - languageName: node - linkType: hard - -"queue-microtask@npm:^1.2.2": - version: 1.2.3 - resolution: "queue-microtask@npm:1.2.3" - checksum: 10c0/900a93d3cdae3acd7d16f642c29a642aea32c2026446151f0778c62ac089d4b8e6c986811076e1ae180a694cedf077d453a11b58ff0a865629a4f82ab558e102 - languageName: node - linkType: hard - "quick-format-unescaped@npm:^4.0.3": version: 4.0.4 resolution: "quick-format-unescaped@npm:4.0.4" @@ -5002,13 +4234,6 @@ __metadata: languageName: node linkType: hard -"resolve-from@npm:^4.0.0": - version: 4.0.0 - resolution: "resolve-from@npm:4.0.0" - checksum: 10c0/8408eec31a3112ef96e3746c37be7d64020cda07c03a920f5024e77290a218ea758b26ca9529fd7b1ad283947f34b2291c1c0f6aa0ed34acfdda9c6014c8d190 - languageName: node - linkType: hard - "resolve-pkg-maps@npm:^1.0.0": version: 1.0.0 resolution: "resolve-pkg-maps@npm:1.0.0" @@ -5016,32 +4241,6 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.22.4": - version: 1.22.10 - resolution: "resolve@npm:1.22.10" - dependencies: - is-core-module: "npm:^2.16.0" - path-parse: "npm:^1.0.7" - supports-preserve-symlinks-flag: "npm:^1.0.0" - bin: - resolve: bin/resolve - checksum: 10c0/8967e1f4e2cc40f79b7e080b4582b9a8c5ee36ffb46041dccb20e6461161adf69f843b43067b4a375de926a2cd669157e29a29578191def399dd5ef89a1b5203 - languageName: node - linkType: hard - -"resolve@patch:resolve@npm%3A^1.22.4#optional!builtin": - version: 1.22.10 - resolution: "resolve@patch:resolve@npm%3A1.22.10#optional!builtin::version=1.22.10&hash=c3c19d" - dependencies: - is-core-module: "npm:^2.16.0" - path-parse: "npm:^1.0.7" - supports-preserve-symlinks-flag: "npm:^1.0.0" - bin: - resolve: bin/resolve - checksum: 10c0/52a4e505bbfc7925ac8f4cd91fd8c4e096b6a89728b9f46861d3b405ac9a1ccf4dcbf8befb4e89a2e11370dacd0160918163885cbc669369590f2f31f4c58939 - languageName: node - linkType: hard - "restore-cursor@npm:^5.0.0": version: 5.1.0 resolution: "restore-cursor@npm:5.1.0" @@ -5059,13 +4258,6 @@ __metadata: languageName: node linkType: hard -"reusify@npm:^1.0.4": - version: 1.0.4 - resolution: "reusify@npm:1.0.4" - checksum: 10c0/c19ef26e4e188f408922c46f7ff480d38e8dfc55d448310dfb518736b23ed2c4f547fb64a6ed5bdba92cd7e7ddc889d36ff78f794816d5e71498d645ef476107 - languageName: node - linkType: hard - "rfdc@npm:^1.4.1": version: 1.4.1 resolution: "rfdc@npm:1.4.1" @@ -5181,15 +4373,6 @@ __metadata: languageName: node linkType: hard -"run-parallel@npm:^1.1.9": - version: 1.2.0 - resolution: "run-parallel@npm:1.2.0" - dependencies: - queue-microtask: "npm:^1.2.2" - checksum: 10c0/200b5ab25b5b8b7113f9901bfe3afc347e19bb7475b267d55ad0eb86a62a46d77510cb0f232507c9e5d497ebda569a08a9867d0d14f57a82ad5564d991588b39 - languageName: node - linkType: hard - "rxjs@npm:^7.8.1": version: 7.8.1 resolution: "rxjs@npm:7.8.1" @@ -5241,7 +4424,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.2, semver@npm:^7.3.5, semver@npm:^7.6.0, semver@npm:^7.6.3": +"semver@npm:^7.3.2, semver@npm:^7.3.5": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -5481,13 +4664,6 @@ __metadata: languageName: node linkType: hard -"stable-hash@npm:^0.0.4": - version: 0.0.4 - resolution: "stable-hash@npm:0.0.4" - checksum: 10c0/53d010d2a1b014fb60d398c095f43912c353b7b44774e55222bb26fd428bc75b73d7bdfcae509ce927c23ca9c5aff2dc1bc82f191d30e57a879550bc2952bdb0 - languageName: node - linkType: hard - "stackback@npm:0.0.2": version: 0.0.2 resolution: "stackback@npm:0.0.2" @@ -5599,20 +4775,6 @@ __metadata: languageName: node linkType: hard -"supports-preserve-symlinks-flag@npm:^1.0.0": - version: 1.0.0 - resolution: "supports-preserve-symlinks-flag@npm:1.0.0" - checksum: 10c0/6c4032340701a9950865f7ae8ef38578d8d7053f5e10518076e6554a9381fa91bd9c6850193695c141f32b21f979c985db07265a758867bac95de05f7d8aeb39 - languageName: node - linkType: hard - -"tapable@npm:^2.2.0": - version: 2.2.1 - resolution: "tapable@npm:2.2.1" - checksum: 10c0/bc40e6efe1e554d075469cedaba69a30eeb373552aaf41caeaaa45bf56ffacc2674261b106245bd566b35d8f3329b52d838e851ee0a852120acae26e622925c9 - languageName: node - linkType: hard - "tar-fs@npm:^2.0.0": version: 2.1.2 resolution: "tar-fs@npm:2.1.2" @@ -5754,15 +4916,6 @@ __metadata: languageName: node linkType: hard -"ts-api-utils@npm:^2.0.0": - version: 2.0.0 - resolution: "ts-api-utils@npm:2.0.0" - peerDependencies: - typescript: ">=4.8.4" - checksum: 10c0/6165e29a5b75bd0218e3cb0f9ee31aa893dbd819c2e46dbb086c841121eb0436ed47c2c18a20cb3463d74fd1fb5af62e2604ba5971cc48e5b38ebbdc56746dfc - languageName: node - linkType: hard - "tsconfck@npm:^3.0.3": version: 3.1.4 resolution: "tsconfck@npm:3.1.4" @@ -5777,7 +4930,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.1.0, tslib@npm:^2.5.0, tslib@npm:^2.6.3, tslib@npm:^2.7.0, tslib@npm:^2.8.0, tslib@npm:^2.8.1": +"tslib@npm:^2.1.0, tslib@npm:^2.5.0, tslib@npm:^2.7.0, tslib@npm:^2.8.0, tslib@npm:^2.8.1": version: 2.8.1 resolution: "tslib@npm:2.8.1" checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62 @@ -5809,15 +4962,6 @@ __metadata: languageName: node linkType: hard -"type-check@npm:^0.4.0, type-check@npm:~0.4.0": - version: 0.4.0 - resolution: "type-check@npm:0.4.0" - dependencies: - prelude-ls: "npm:^1.2.1" - checksum: 10c0/7b3fd0ed43891e2080bf0c5c504b418fbb3e5c7b9708d3d015037ba2e6323a28152ec163bcb65212741fa5d2022e3075ac3c76440dbd344c9035f818e8ecee58 - languageName: node - linkType: hard - "type-fest@npm:^0.13.1": version: 0.13.1 resolution: "type-fest@npm:0.13.1" @@ -5905,20 +5049,6 @@ __metadata: languageName: node linkType: hard -"typescript-eslint@npm:^8.16.0": - version: 8.21.0 - resolution: "typescript-eslint@npm:8.21.0" - dependencies: - "@typescript-eslint/eslint-plugin": "npm:8.21.0" - "@typescript-eslint/parser": "npm:8.21.0" - "@typescript-eslint/utils": "npm:8.21.0" - peerDependencies: - eslint: ^8.57.0 || ^9.0.0 - typescript: ">=4.8.4 <5.8.0" - checksum: 10c0/44e5c341ad7f0b41dce3b4ca7a4c0a399ebe51a5323d930750db1e308367b4813a620f4c2332a5774a1dccd0047ebbaf993a8b7effd67389e9069b29b5701520 - languageName: node - linkType: hard - "typescript@npm:^5.6.3": version: 5.7.3 resolution: "typescript@npm:5.7.3" @@ -6005,15 +5135,6 @@ __metadata: languageName: node linkType: hard -"uri-js@npm:^4.2.2": - version: 4.4.1 - resolution: "uri-js@npm:4.4.1" - dependencies: - punycode: "npm:^2.1.0" - checksum: 10c0/4ef57b45aa820d7ac6496e9208559986c665e49447cb072744c13b66925a362d96dd5a46c4530a6b8e203e5db5fe849369444440cb22ecfc26c679359e5dfa3c - languageName: node - linkType: hard - "util-deprecate@npm:^1.0.1": version: 1.0.2 resolution: "util-deprecate@npm:1.0.2" @@ -6211,13 +5332,6 @@ __metadata: languageName: node linkType: hard -"word-wrap@npm:^1.2.5": - version: 1.2.5 - resolution: "word-wrap@npm:1.2.5" - checksum: 10c0/e0e4a1ca27599c92a6ca4c32260e8a92e8a44f4ef6ef93f803f8ed823f486e0889fc0b93be4db59c8d51b3064951d25e43d434e95dc8c960cc3a63d65d00ba20 - languageName: node - linkType: hard - "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0, wrap-ansi@npm:^7.0.0": version: 7.0.0 resolution: "wrap-ansi@npm:7.0.0" @@ -6347,13 +5461,6 @@ __metadata: languageName: node linkType: hard -"yocto-queue@npm:^0.1.0": - version: 0.1.0 - resolution: "yocto-queue@npm:0.1.0" - checksum: 10c0/dceb44c28578b31641e13695d200d34ec4ab3966a5729814d5445b194933c096b7ced71494ce53a0e8820685d1d010df8b2422e5bf2cdea7e469d97ffbea306f - languageName: node - linkType: hard - "zod@npm:^3.24.1": version: 3.24.1 resolution: "zod@npm:3.24.1" From a23647ebfa7d17b8d9722928534d09cf22af93be Mon Sep 17 00:00:00 2001 From: Gregory Luneau Date: Mon, 20 Jan 2025 22:12:25 -0500 Subject: [PATCH 2/4] yarn fix --- .editorconfig | 2 +- .github/command-runner/comment.cjs | 50 ++-- .github/command-runner/merge.cjs | 82 +++--- .github/command-runner/postBump.cjs | 49 ++-- .github/command-runner/runOrBump.cjs | 235 +++++++++-------- .github/command-runner/utils.cjs | 54 ++-- biome.json | 13 +- eslint.config.mjs | 49 ++-- .../kusama/src/assetHubKusama.karura.test.ts | 4 +- packages/kusama/src/basilisk.karura.test.ts | 54 ++-- .../kusama/src/coretimeKusama.kusama.test.ts | 2 +- packages/kusama/src/karura.kusama.test.ts | 2 +- packages/kusama/src/karura.shiden.test.ts | 8 +- packages/kusama/src/kusama.shiden.test.ts | 2 +- .../kusama/src/kusamaGovernance.e2e.test.ts | 2 +- packages/kusama/src/peopleKusama.e2e.test.ts | 2 +- .../kusama/src/peopleKusama.kusama.test.ts | 2 +- packages/networks/src/captureSnapshot.ts | 2 +- packages/networks/src/chains/astar.ts | 2 +- packages/networks/src/chains/polkadot.ts | 4 +- packages/networks/src/createNetwork.ts | 2 +- packages/networks/src/defineChain.ts | 2 +- packages/networks/src/types.ts | 2 +- .../src/acala.assetHubPolkadot.test.ts | 4 +- packages/polkadot/src/acala.astar.test.ts | 8 +- packages/polkadot/src/acala.moonbeam.test.ts | 6 +- packages/polkadot/src/acala.polkadot.test.ts | 2 +- .../src/assetHubPolkadot.polkadot.test.ts | 4 +- packages/polkadot/src/astar.polkadot.test.ts | 2 +- .../src/coretimePolkadot.polkadot.test.ts | 2 +- .../polkadot/src/hydration.moonbeam.test.ts | 43 ++- .../polkadot/src/peoplePolkadot.e2e.test.ts | 2 +- .../src/peoplePolkadot.polkadot.test.ts | 2 +- .../src/polkadotGovernance.e2e.test.ts | 2 +- packages/shared/src/api/index.ts | 2 +- packages/shared/src/api/query.ts | 2 +- packages/shared/src/governance.ts | 248 +++++++++--------- packages/shared/src/helpers/index.ts | 2 +- packages/shared/src/index.ts | 2 +- packages/shared/src/people.ts | 23 +- packages/shared/src/setup.ts | 2 +- packages/shared/src/xcm/runXcmPalletDown.ts | 8 +- .../shared/src/xcm/runXcmPalletHorizontal.ts | 8 +- packages/shared/src/xcm/runXcmPalletUp.ts | 8 +- packages/shared/src/xcm/runXtokensUp.ts | 8 +- .../shared/src/xcm/runXtokenstHorizontal.ts | 8 +- packages/shared/src/xcm/types.ts | 4 +- scripts/update-env.ts | 10 +- vitest.config.mts | 11 +- 49 files changed, 525 insertions(+), 524 deletions(-) diff --git a/.editorconfig b/.editorconfig index 0c38c8fe..0278f6d4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,7 @@ root = true [*] indent_style=tab -indent_size=tab +indent_size=2 tab_width=2 end_of_line=lf charset=utf-8 diff --git a/.github/command-runner/comment.cjs b/.github/command-runner/comment.cjs index c6115655..05b11f98 100644 --- a/.github/command-runner/comment.cjs +++ b/.github/command-runner/comment.cjs @@ -1,27 +1,27 @@ module.exports = class Comment { - constructor({ github, context, commentId }) { - this.github = github - this.context = context - this.commentId = commentId || null; - } + constructor({ github, context, commentId }) { + this.github = github + this.context = context + this.commentId = commentId || null + } - async createOrUpdateComment(body) { - const actionUrl = `/~https://github.com/${this.context.payload.repository.full_name}/actions/runs/${this.context.runId}` - if (!this.commentId) { - const result = await this.github.rest.issues.createComment({ - issue_number: this.context.issue.number, - owner: this.context.repo.owner, - repo: this.context.repo.repo, - body: `${body}` + `\n[view details](${actionUrl})` - }) - this.commentId = result.data.id - } - await this.github.rest.issues.updateComment({ - comment_id: this.commentId, - issue_number: this.context.issue.number, - owner: this.context.repo.owner, - repo: this.context.repo.repo, - body: `${body}` + `\n[view details](${actionUrl})` - }) - } -} \ No newline at end of file + async createOrUpdateComment(body) { + const actionUrl = `/~https://github.com/${this.context.payload.repository.full_name}/actions/runs/${this.context.runId}` + if (!this.commentId) { + const result = await this.github.rest.issues.createComment({ + issue_number: this.context.issue.number, + owner: this.context.repo.owner, + repo: this.context.repo.repo, + body: `${body}` + `\n[view details](${actionUrl})`, + }) + this.commentId = result.data.id + } + await this.github.rest.issues.updateComment({ + comment_id: this.commentId, + issue_number: this.context.issue.number, + owner: this.context.repo.owner, + repo: this.context.repo.repo, + body: `${body}` + `\n[view details](${actionUrl})`, + }) + } +} diff --git a/.github/command-runner/merge.cjs b/.github/command-runner/merge.cjs index 260f937d..4cecb773 100644 --- a/.github/command-runner/merge.cjs +++ b/.github/command-runner/merge.cjs @@ -1,11 +1,12 @@ module.exports = async ({ github, context, command, core, commentId }) => { - const Comment = require('./comment.cjs') - const comment = new Comment({ github, context, commentId }) + const Comment = require('./comment.cjs') + const comment = new Comment({ github, context, commentId }) - if (command === 'merge') { - console.log('Run merge') + if (command === 'merge') { + console.log('Run merge') - const { repository } = await github.graphql(` + const { repository } = await github.graphql( + ` query($owner: String!, $repo: String!, $pullNumber: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $pullNumber) { @@ -13,14 +14,17 @@ module.exports = async ({ github, context, command, core, commentId }) => { } } } - `, { - ...context.repo, - pullNumber: context.issue.number, - }) + `, + { + ...context.repo, + pullNumber: context.issue.number, + }, + ) const pullRequestId = repository.pullRequest.id - await github.graphql(` + await github.graphql( + ` mutation($pullRequestId: ID!) { enablePullRequestAutoMerge(input: { pullRequestId: $pullRequestId, mergeMethod: SQUASH }) { pullRequest { @@ -30,11 +34,13 @@ module.exports = async ({ github, context, command, core, commentId }) => { } } } - `, { - pullRequestId: pullRequestId - }) + `, + { + pullRequestId: pullRequestId, + }, + ) - let pendingReview = await github.rest.pulls.createReview({ + const pendingReview = await github.rest.pulls.createReview({ ...context.repo, pull_number: context.issue.number, }) @@ -43,24 +49,25 @@ module.exports = async ({ github, context, command, core, commentId }) => { ...context.repo, pull_number: context.issue.number, event: 'APPROVE', - review_id: pendingReview.data.id + review_id: pendingReview.data.id, }) - await comment.createOrUpdateComment(` Auto-merge enabled`) - core.info('Auto-merge enabled') - return - } + await comment.createOrUpdateComment(` Auto-merge enabled`) + core.info('Auto-merge enabled') + return + } - if (command === 'cancel-merge') { - console.log('Run cancel-merge') + if (command === 'cancel-merge') { + console.log('Run cancel-merge') await github.rest.pulls.submitReview({ ...context.repo, pull_number: context.issue.number, event: 'REQUEST_CHANGES', - body: 'Dismissed' + body: 'Dismissed', }) - const { repository } = await github.graphql(` + const { repository } = await github.graphql( + ` query($owner: String!, $repo: String!, $pullNumber: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $pullNumber) { @@ -68,14 +75,17 @@ module.exports = async ({ github, context, command, core, commentId }) => { } } } - `, { - ...context.repo, - pullNumber: context.issue.number, - }) + `, + { + ...context.repo, + pullNumber: context.issue.number, + }, + ) const pullRequestId = repository.pullRequest.id - await github.graphql(` + await github.graphql( + ` mutation($pullRequestId: ID!) { disablePullRequestAutoMerge(input: { pullRequestId: $pullRequestId }) { pullRequest { @@ -84,12 +94,14 @@ module.exports = async ({ github, context, command, core, commentId }) => { } } } - `, { - pullRequestId: pullRequestId - }) - await comment.createOrUpdateComment(` Auto-merge disabled`) + `, + { + pullRequestId: pullRequestId, + }, + ) + await comment.createOrUpdateComment(` Auto-merge disabled`) - core.info('Auto-merge disabled') - return - } + core.info('Auto-merge disabled') + return + } } diff --git a/.github/command-runner/postBump.cjs b/.github/command-runner/postBump.cjs index a724269b..0a51fc2b 100644 --- a/.github/command-runner/postBump.cjs +++ b/.github/command-runner/postBump.cjs @@ -1,33 +1,32 @@ module.exports = async ({ github, context, exec, commentId, core, testResult }) => { - const Comment = require('./comment.cjs') - const comment = new Comment({ github, context, commentId }) + const Comment = require('./comment.cjs') + const comment = new Comment({ github, context, commentId }) - if(testResult !== 'success') { - return comment.createOrUpdateComment(` Test failed`) - } + if (testResult !== 'success') { + return comment.createOrUpdateComment(` Test failed`) + } - const diffResult = await exec.exec('git diff --exit-code', null, { ignoreReturnCode: true }) + const diffResult = await exec.exec('git diff --exit-code', null, { ignoreReturnCode: true }) - if (!diffResult) { - core.info('KNOWN_GOOD_BLOCK_NUMBERS.env not updated') - return comment.createOrUpdateComment(` KNOWN_GOOD_BLOCK_NUMBERS.env not updated`) - } + if (!diffResult) { + core.info('KNOWN_GOOD_BLOCK_NUMBERS.env not updated') + return comment.createOrUpdateComment(` KNOWN_GOOD_BLOCK_NUMBERS.env not updated`) + } - await exec.exec(`git config --global user.name 'github-actions[bot]'`) - await exec.exec(`git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'`) - await exec.exec(`git add KNOWN_GOOD_BLOCK_NUMBERS.env`) - await exec.exec(`git`, ['commit', '-am', '[ci skip] Update KNOWN_GOOD_BLOCK_NUMBERS']) - await exec.exec('git push') + await exec.exec(`git config --global user.name 'github-actions[bot]'`) + await exec.exec(`git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'`) + await exec.exec(`git add KNOWN_GOOD_BLOCK_NUMBERS.env`) + await exec.exec(`git`, ['commit', '-am', '[ci skip] Update KNOWN_GOOD_BLOCK_NUMBERS']) + await exec.exec('git push') - let commitId = '' - await exec.exec('git', ['rev-parse', 'HEAD'], { - listeners: { - stdout: (data) => { - commitId += data.toString(); - } - } - }) + let commitId = '' + await exec.exec('git', ['rev-parse', 'HEAD'], { + listeners: { + stdout: (data) => { + commitId += data.toString() + }, + }, + }) - return comment.createOrUpdateComment(`**KNOWN_GOOD_BLOCK_NUMBERS.env has been updated**
**Commit**: ${commitId}`) + return comment.createOrUpdateComment(`**KNOWN_GOOD_BLOCK_NUMBERS.env has been updated**
**Commit**: ${commitId}`) } - diff --git a/.github/command-runner/runOrBump.cjs b/.github/command-runner/runOrBump.cjs index 4ef91e13..2b0cbdc6 100644 --- a/.github/command-runner/runOrBump.cjs +++ b/.github/command-runner/runOrBump.cjs @@ -1,132 +1,139 @@ module.exports = async ({ github, core, context, commentId, exec, env, command, args }) => { - const Comment = require('./comment.cjs') - const comment = new Comment({ github, context, commentId }) - const { runCommand, createResult, writeNewEnv } = require('./utils.cjs') - - const excuteUpdateKnownGood = async () => { - const execCommand = `yarn update-known-good` - const result = await runCommand({ cmd: execCommand, comment, exec }) - - if (result.exitCode) { - core.setFailed('Failed to update known good blocks') - await comment.createOrUpdateComment(createResult({ - context, - command: execCommand, - result: result.errorOutput + '\n' + result.output, - extra: `**Test Result**: \`Failed to update known good blocks\`` - })) - - process.exit(1) - } - - - return result - } - - const excuteTest = async ({ update, env }) => { - const execCommand = update ? - `yarn test --reporter default ${update ? '-u' : ''}` : - `yarn test --reporter default ${args.trim()}` - - const result = await runCommand({ cmd: execCommand, comment, exec }) - - if (result.exitCode) { - core.setFailed('Tests failed') - await comment.createOrUpdateComment(createResult({ - context, - command: execCommand, - result: (env ? `${env}\n` : '') + (result.errorOutput + '\n' + result.output), - extra: `**Test Result**: \`Failed\`` - })) - process.exit(1) - } - - return result - } - - if (command === 'run') { - const updateKnownGoodResult = await excuteUpdateKnownGood(); - - let newEnv = updateKnownGoodResult.output - - if (env) { - newEnv = writeNewEnv({ env }) - } - - const testResult = await excuteTest({ update: false, env: newEnv }); - core.info('Tests Passed') - const output = newEnv + `\n${testResult.output}` - return comment.createOrUpdateComment(createResult({ - context, - command: testResult.cmd, - result: output, - extra: `**Test Result**: \`Passed\`` - })) - } - - if (command === 'bump') { + const Comment = require('./comment.cjs') + const comment = new Comment({ github, context, commentId }) + const { runCommand, createResult, writeNewEnv } = require('./utils.cjs') + + const excuteUpdateKnownGood = async () => { + const execCommand = `yarn update-known-good` + const result = await runCommand({ cmd: execCommand, comment, exec }) + + if (result.exitCode) { + core.setFailed('Failed to update known good blocks') + await comment.createOrUpdateComment( + createResult({ + context, + command: execCommand, + result: `${result.errorOutput}\n${result.output}`, + extra: `**Test Result**: \`Failed to update known good blocks\``, + }), + ) + + process.exit(1) + } + + return result + } + + const excuteTest = async ({ update, env }) => { + const execCommand = update + ? `yarn test --reporter default ${update ? '-u' : ''}` + : `yarn test --reporter default ${args.trim()}` + + const result = await runCommand({ cmd: execCommand, comment, exec }) + + if (result.exitCode) { + core.setFailed('Tests failed') + await comment.createOrUpdateComment( + createResult({ + context, + command: execCommand, + result: `${env ? `${env}\n` : ''}${result.errorOutput}\n${result.output}`, + extra: `**Test Result**: \`Failed\``, + }), + ) + process.exit(1) + } + + return result + } + + if (command === 'run') { + const updateKnownGoodResult = await excuteUpdateKnownGood() + + let newEnv = updateKnownGoodResult.output + + if (env) { + newEnv = writeNewEnv({ env }) + } + + const testResult = await excuteTest({ update: false, env: newEnv }) + core.info('Tests Passed') + const output = `${newEnv}\n${testResult.output}` + return comment.createOrUpdateComment( + createResult({ + context, + command: testResult.cmd, + result: output, + extra: `**Test Result**: \`Passed\``, + }), + ) + } + + if (command === 'bump') { if (env.trim().length) { core.setFailed('env is not supported in bump command') return comment.createOrUpdateComment(` ENV is not supported in bump command`) } - const updateKnownGoodResult = await excuteUpdateKnownGood(); + const updateKnownGoodResult = await excuteUpdateKnownGood() - await exec.exec(`git config --global user.name 'github-actions[bot]'`) - await exec.exec(`git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'`) - await exec.exec(`git add KNOWN_GOOD_BLOCK_NUMBERS.env`) - const diffCachedResult = await exec.exec('git diff --cached --exit-code', null, { ignoreReturnCode: true }) + await exec.exec(`git config --global user.name 'github-actions[bot]'`) + await exec.exec(`git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'`) + await exec.exec(`git add KNOWN_GOOD_BLOCK_NUMBERS.env`) + const diffCachedResult = await exec.exec('git diff --cached --exit-code', null, { ignoreReturnCode: true }) - if (!diffCachedResult) { - core.setFailed('KNOWN_GOOD_BLOCK_NUMBERS.env not updated') - await comment.createOrUpdateComment(` **KNOWN_GOOD_BLOCK_NUMBERS.env not updated**`) - process.exit(1) - } + if (!diffCachedResult) { + core.setFailed('KNOWN_GOOD_BLOCK_NUMBERS.env not updated') + await comment.createOrUpdateComment(` **KNOWN_GOOD_BLOCK_NUMBERS.env not updated**`) + process.exit(1) + } - const testResult = await excuteTest({ update: true, env: updateKnownGoodResult.output }); - const output = updateKnownGoodResult.output + `\n${testResult.output}` + const testResult = await excuteTest({ update: true, env: updateKnownGoodResult.output }) + const output = `${updateKnownGoodResult.output}\n${testResult.output}` - const diffResult = await exec.exec('git diff --exit-code', null, { ignoreReturnCode: true }) + const diffResult = await exec.exec('git diff --exit-code', null, { ignoreReturnCode: true }) - if (!diffResult) { - core.info('snapshot not updated') - // dispatch update-known-good workflow to having it to update the snapshot - await github.rest.actions.createWorkflowDispatch({ + if (!diffResult) { + core.info('snapshot not updated') + // dispatch update-known-good workflow to having it to update the snapshot + await github.rest.actions.createWorkflowDispatch({ owner: context.repo.owner, repo: context.repo.repo, workflow_id: 'update-known-good.yml', ref: 'master', }) - return comment.createOrUpdateComment(createResult({ - context, - command: testResult.cmd, - result: output, - extra: `
Triggered update-known-good workflow to update the snapshot` - })) - } else { - const branchName = `Update-SnapShot-${commentId}` - await exec.exec(`git checkout -b ${branchName}`) - await exec.exec(`git`, ['commit', '-am', '[ci skip] Update snapshots']) - - - const commentUrl = `/~https://github.com/${context.payload.repository.full_name}/issues/${context.issue.number}#issuecomment-${commentId}` - await exec.exec(`git push origin HEAD:${branchName}`) - const result = await github.rest.pulls.create({ - owner: context.repo.owner, - repo: context.repo.repo, - title: branchName, - head: branchName, - base: 'master', - body: `Update Snapshots (${commentUrl})`, - }) - core.info(`The Pull request #${result.data.number} has been created to update the snapshot`) - return comment.createOrUpdateComment(createResult({ - context, - command: testResult.cmd, - result: output, - extra: `
**The Pull request #${result.data.number} has been created to update the snapshot**` - })) - } - } + return comment.createOrUpdateComment( + createResult({ + context, + command: testResult.cmd, + result: output, + extra: `
Triggered update-known-good workflow to update the snapshot`, + }), + ) + } + const branchName = `Update-SnapShot-${commentId}` + await exec.exec(`git checkout -b ${branchName}`) + await exec.exec(`git`, ['commit', '-am', '[ci skip] Update snapshots']) + + const commentUrl = `/~https://github.com/${context.payload.repository.full_name}/issues/${context.issue.number}#issuecomment-${commentId}` + await exec.exec(`git push origin HEAD:${branchName}`) + const result = await github.rest.pulls.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: branchName, + head: branchName, + base: 'master', + body: `Update Snapshots (${commentUrl})`, + }) + core.info(`The Pull request #${result.data.number} has been created to update the snapshot`) + return comment.createOrUpdateComment( + createResult({ + context, + command: testResult.cmd, + result: output, + extra: `
**The Pull request #${result.data.number} has been created to update the snapshot**`, + }), + ) + } } diff --git a/.github/command-runner/utils.cjs b/.github/command-runner/utils.cjs index 2a99c6da..7c16289e 100644 --- a/.github/command-runner/utils.cjs +++ b/.github/command-runner/utils.cjs @@ -1,5 +1,5 @@ function createResult({ command, context, result, extra }) { - return `**Request**: \`${context.payload.comment.body.trim()}\` + return `**Request**: \`${context.payload.comment.body.trim()}\` **Command**: \`${command}\` ${extra} @@ -14,32 +14,32 @@ ${result} } async function runCommand({ cmd, comment, exec }) { - let output = ''; - let errorOutput = ''; - await comment.createOrUpdateComment(`Running: \`${cmd}\``) - - const exitCode = await exec.exec(cmd, null, { - ignoreReturnCode: true, - listeners: { - stdline: (data) => { - output += `${data}\n`; - }, - errline: (data) => { - errorOutput += `${data}\n`; - } - } - }); - - return { - output: output.replace(/\x1b\[[0-9;]*m/g, ''), - errorOutput: errorOutput.replace(/\x1b\[[0-9;]*m/g, ''), - exitCode, - cmd, - } + let output = '' + let errorOutput = '' + await comment.createOrUpdateComment(`Running: \`${cmd}\``) + + const exitCode = await exec.exec(cmd, null, { + ignoreReturnCode: true, + listeners: { + stdline: (data) => { + output += `${data}\n` + }, + errline: (data) => { + errorOutput += `${data}\n` + }, + }, + }) + + return { + output: output.replace(/\x1b\[[0-9;]*m/g, ''), + errorOutput: errorOutput.replace(/\x1b\[[0-9;]*m/g, ''), + exitCode, + cmd, + } } function writeNewEnv({ env }) { - const fs = require('fs') + const fs = require('node:fs') const envContent = fs.readFileSync('KNOWN_GOOD_BLOCK_NUMBERS.env', 'utf8').toString() @@ -53,7 +53,7 @@ ${envContent} } module.exports = { - createResult, - runCommand, - writeNewEnv + createResult, + runCommand, + writeNewEnv, } diff --git a/biome.json b/biome.json index e88bcb82..6e27230b 100644 --- a/biome.json +++ b/biome.json @@ -26,14 +26,7 @@ "lineWidth": 120, "attributePosition": "auto", "bracketSpacing": true, - "ignore": [ - "**/tsconfig.tsbuildinfo", - "**/.gitignore", - "**/.yarn", - "**/*.yml", - "**/*.md", - "**/node_modules/**" - ] + "ignore": ["**/tsconfig.tsbuildinfo", "**/.gitignore", "**/.yarn", "**/*.yml", "**/*.md", "**/node_modules/**"] }, "organizeImports": { "enabled": true }, "linter": { @@ -54,9 +47,7 @@ "useLiteralKeys": "off" } }, - "ignore": [ - "**/node_modules/" - ] + "ignore": ["**/node_modules/"] }, "javascript": { "formatter": { diff --git a/eslint.config.mjs b/eslint.config.mjs index e2168293..9c7539ae 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,8 +1,8 @@ -import eslintConfigPrettier from "eslint-config-prettier"; -import tseslint from 'typescript-eslint'; -import eslintPluginImportX from "eslint-plugin-import-x"; -import js from "@eslint/js"; +import js from '@eslint/js' import tsParser from '@typescript-eslint/parser' +import eslintConfigPrettier from 'eslint-config-prettier' +import eslintPluginImportX from 'eslint-plugin-import-x' +import tseslint from 'typescript-eslint' export default tseslint.config( js.configs.recommended, @@ -17,31 +17,34 @@ export default tseslint.config( ecmaVersion: 'latest', sourceType: 'module', parserOptions: { - projectService: true, - tsconfigRootDir: import.meta.dirname, - }, + projectService: true, + tsconfigRootDir: import.meta.dirname, + }, }, rules: { - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-non-null-assertion": "off", + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', - "@typescript-eslint/no-unused-vars": ["warn", { - argsIgnorePattern: "^_", - varsIgnorePattern: "^_", - caughtErrorsIgnorePattern: "^_", - }], + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, + ], }, }, { ignores: [ - "eslint.config.mjs", - "**/node_modules/", - "**/vitest.config.mts", - ".yarn/", - ".github/command-runner/", // TODO: enable lint for those files + 'eslint.config.mjs', + '**/node_modules/', + '**/vitest.config.mts', + '.yarn/', + '.github/command-runner/', // TODO: enable lint for those files ], - } + }, ) diff --git a/packages/kusama/src/assetHubKusama.karura.test.ts b/packages/kusama/src/assetHubKusama.karura.test.ts index 58eea2bb..2bf1e609 100644 --- a/packages/kusama/src/assetHubKusama.karura.test.ts +++ b/packages/kusama/src/assetHubKusama.karura.test.ts @@ -1,10 +1,10 @@ import { describe } from 'vitest' -import { assetHubKusama, karura } from '@e2e-test/networks/chains' import { defaultAccounts } from '@e2e-test/networks' +import { assetHubKusama, karura } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXcmPalletHorizontal, runXtokenstHorizontal } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('assetHubKusama & karura', async () => { const [assetHubKusamaClient, karuraClient] = await setupNetworks(assetHubKusama, karura) diff --git a/packages/kusama/src/basilisk.karura.test.ts b/packages/kusama/src/basilisk.karura.test.ts index 27c7a1cc..81747fa4 100644 --- a/packages/kusama/src/basilisk.karura.test.ts +++ b/packages/kusama/src/basilisk.karura.test.ts @@ -1,10 +1,10 @@ import { describe } from 'vitest' -import { basilisk, karura, kusama } from '@e2e-test/networks/chains' import { defaultAccounts } from '@e2e-test/networks' +import { basilisk, karura, kusama } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXtokenstHorizontal } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('basilisk & karura', async () => { const [karuraClient, basiliskClient, kusamaClient] = await setupNetworks(karura, basilisk, kusama) @@ -22,28 +22,36 @@ describe('basilisk & karura', async () => { } }) - runXtokenstHorizontal('basilisk transfer KSM to karura', async () => { - return { - fromChain: basiliskClient, - toChain: karuraClient, - routeChain: kusamaClient, - isCheckUmp: true, - toAccount: defaultAccounts.bob, - fromBalance: query.tokens(basilisk.custom.relayToken), - toBalance: query.tokens(karura.custom.ksm), - tx: tx.xtokens.transfer(basilisk.custom.relayToken, 10n ** 12n, tx.xtokens.parachainV4(karura.paraId!)), - } - }, { skip: true }) // TODO: somehow pjs is generate invalid signature + runXtokenstHorizontal( + 'basilisk transfer KSM to karura', + async () => { + return { + fromChain: basiliskClient, + toChain: karuraClient, + routeChain: kusamaClient, + isCheckUmp: true, + toAccount: defaultAccounts.bob, + fromBalance: query.tokens(basilisk.custom.relayToken), + toBalance: query.tokens(karura.custom.ksm), + tx: tx.xtokens.transfer(basilisk.custom.relayToken, 10n ** 12n, tx.xtokens.parachainV4(karura.paraId!)), + } + }, + { skip: true }, + ) // TODO: somehow pjs is generate invalid signature - runXtokenstHorizontal('basilisk transfer BSX to karura', async () => { - return { - fromChain: basiliskClient, - toChain: karuraClient, - fromBalance: query.balances, - toBalance: query.tokens(karura.custom.bsx), - tx: tx.xtokens.transfer(basilisk.custom.bsx, 10n ** 15n, tx.xtokens.parachainV4(karura.paraId!)), - } - }, { skip: true }) // TODO: somehow pjs is generate invalid signature + runXtokenstHorizontal( + 'basilisk transfer BSX to karura', + async () => { + return { + fromChain: basiliskClient, + toChain: karuraClient, + fromBalance: query.balances, + toBalance: query.tokens(karura.custom.bsx), + tx: tx.xtokens.transfer(basilisk.custom.bsx, 10n ** 15n, tx.xtokens.parachainV4(karura.paraId!)), + } + }, + { skip: true }, + ) // TODO: somehow pjs is generate invalid signature runXtokenstHorizontal('karura transfer BSX to basilisk', async () => { await karuraClient.dev.setStorage({ diff --git a/packages/kusama/src/coretimeKusama.kusama.test.ts b/packages/kusama/src/coretimeKusama.kusama.test.ts index f2bdddc8..5eeb92e0 100644 --- a/packages/kusama/src/coretimeKusama.kusama.test.ts +++ b/packages/kusama/src/coretimeKusama.kusama.test.ts @@ -1,9 +1,9 @@ import { describe } from 'vitest' import { coretimeKusama, kusama } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXcmPalletDown, runXcmPalletUp } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('kusama & coretimeKusama', async () => { const [kusamaClient, coretimeClient] = await setupNetworks(kusama, coretimeKusama) diff --git a/packages/kusama/src/karura.kusama.test.ts b/packages/kusama/src/karura.kusama.test.ts index 163b9b73..12c7c801 100644 --- a/packages/kusama/src/karura.kusama.test.ts +++ b/packages/kusama/src/karura.kusama.test.ts @@ -1,9 +1,9 @@ import { describe } from 'vitest' import { karura, kusama } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXcmPalletDown, runXtokensUp } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('karura & kusama', async () => { const [karuraClient, kusamaClient] = await setupNetworks(karura, kusama) diff --git a/packages/kusama/src/karura.shiden.test.ts b/packages/kusama/src/karura.shiden.test.ts index e5cd4be0..6eeeaa16 100644 --- a/packages/kusama/src/karura.shiden.test.ts +++ b/packages/kusama/src/karura.shiden.test.ts @@ -1,9 +1,9 @@ import { describe } from 'vitest' import { karura, shiden } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXtokenstHorizontal } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('karura & shiden', async () => { const [shidenClient, karuraClient] = await setupNetworks(shiden, karura) @@ -14,11 +14,7 @@ describe('karura & shiden', async () => { toChain: karuraClient, fromBalance: query.assets(shiden.custom.kar), toBalance: query.balances, - tx: tx.xtokens.transfer( - shiden.custom.kar, - 1e12, - tx.xtokens.parachainV3(karura.paraId!), - ), + tx: tx.xtokens.transfer(shiden.custom.kar, 1e12, tx.xtokens.parachainV3(karura.paraId!)), } }) diff --git a/packages/kusama/src/kusama.shiden.test.ts b/packages/kusama/src/kusama.shiden.test.ts index d4ce592a..4502184d 100644 --- a/packages/kusama/src/kusama.shiden.test.ts +++ b/packages/kusama/src/kusama.shiden.test.ts @@ -1,9 +1,9 @@ import { describe } from 'vitest' import { kusama, shiden } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXcmPalletDown, runXtokensUp } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('kusama & shiden', async () => { const [kusamaClient, shidenClient] = await setupNetworks(kusama, shiden) diff --git a/packages/kusama/src/kusamaGovernance.e2e.test.ts b/packages/kusama/src/kusamaGovernance.e2e.test.ts index 6130e792..eca82947 100644 --- a/packages/kusama/src/kusamaGovernance.e2e.test.ts +++ b/packages/kusama/src/kusamaGovernance.e2e.test.ts @@ -2,4 +2,4 @@ import { kusama } from '@e2e-test/networks/chains' import { governanceE2ETests } from '@e2e-test/shared' -governanceE2ETests(kusama, { testSuiteName: "Kusama Governance", addressEncoding: 2}) +governanceE2ETests(kusama, { testSuiteName: 'Kusama Governance', addressEncoding: 2 }) diff --git a/packages/kusama/src/peopleKusama.e2e.test.ts b/packages/kusama/src/peopleKusama.e2e.test.ts index 9a1f2870..f5c222fd 100644 --- a/packages/kusama/src/peopleKusama.e2e.test.ts +++ b/packages/kusama/src/peopleKusama.e2e.test.ts @@ -2,4 +2,4 @@ import { kusama, peopleKusama } from '@e2e-test/networks/chains' import { peopleChainE2ETests } from '@e2e-test/shared' -peopleChainE2ETests(kusama, peopleKusama, { testSuiteName: "Kusama People", addressEncoding: 2}) +peopleChainE2ETests(kusama, peopleKusama, { testSuiteName: 'Kusama People', addressEncoding: 2 }) diff --git a/packages/kusama/src/peopleKusama.kusama.test.ts b/packages/kusama/src/peopleKusama.kusama.test.ts index bb7fb090..50dcdcfc 100644 --- a/packages/kusama/src/peopleKusama.kusama.test.ts +++ b/packages/kusama/src/peopleKusama.kusama.test.ts @@ -2,9 +2,9 @@ import { describe } from 'vitest' import { defaultAccounts } from '@e2e-test/networks' import { kusama, peopleKusama } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXcmPalletDown, runXcmPalletUp } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('kusama & peopleKusama', async () => { const [kusamaClient, peopleClient] = await setupNetworks(kusama, peopleKusama) diff --git a/packages/networks/src/captureSnapshot.ts b/packages/networks/src/captureSnapshot.ts index 2e47915f..8ee5a439 100644 --- a/packages/networks/src/captureSnapshot.ts +++ b/packages/networks/src/captureSnapshot.ts @@ -1,4 +1,4 @@ -import { Client } from './createNetwork.js' +import type { Client } from './createNetwork.js' export function captureSnapshot(...clients: Client[]) { const heads = clients.map((client) => [client.chain.head, client.chain] as const) diff --git a/packages/networks/src/chains/astar.ts b/packages/networks/src/chains/astar.ts index ccfa4bd6..0b8dee92 100644 --- a/packages/networks/src/chains/astar.ts +++ b/packages/networks/src/chains/astar.ts @@ -31,7 +31,7 @@ const getInitStorages = (config: typeof custom.astar | typeof custom.shiden) => Assets: { account: [ [[config.relayToken, defaultAccounts.alice.address], { balance: 10 * 1e12 }], - [[('aca' in config ? config.aca : config.kar), defaultAccounts.alice.address], { balance: 20 * 1e12 }], + [['aca' in config ? config.aca : config.kar, defaultAccounts.alice.address], { balance: 20 * 1e12 }], ], }, Sudo: { diff --git a/packages/networks/src/chains/polkadot.ts b/packages/networks/src/chains/polkadot.ts index a10abd5a..c8f0481c 100644 --- a/packages/networks/src/chains/polkadot.ts +++ b/packages/networks/src/chains/polkadot.ts @@ -12,9 +12,7 @@ const custom = { const getInitStorages = () => ({ System: { - Account: [ - [[defaultAccounts.alice.address], { providers: 1, data: { free: 1000 * 1e10 } }], - ], + Account: [[[defaultAccounts.alice.address], { providers: 1, data: { free: 1000 * 1e10 } }]], }, ParasDisputes: { // these can makes block building super slow diff --git a/packages/networks/src/createNetwork.ts b/packages/networks/src/createNetwork.ts index 81684d04..065f8108 100644 --- a/packages/networks/src/createNetwork.ts +++ b/packages/networks/src/createNetwork.ts @@ -1,7 +1,7 @@ import { connectParachains, connectVertical } from '@acala-network/chopsticks' import { setupContext } from '@acala-network/chopsticks-testing' -import { Chain } from './types.js' +import type { Chain } from './types.js' export async function createNetwork(chainConfig: T) { const network = await setupContext(chainConfig) diff --git a/packages/networks/src/defineChain.ts b/packages/networks/src/defineChain.ts index 7cd27572..ac11d261 100644 --- a/packages/networks/src/defineChain.ts +++ b/packages/networks/src/defineChain.ts @@ -1,4 +1,4 @@ -import { Chain, ChainConfig } from './types.js' +import type { Chain, ChainConfig } from './types.js' const toNumber = (value: string | undefined): number | undefined => { if (value === undefined) { diff --git a/packages/networks/src/types.ts b/packages/networks/src/types.ts index 7a50d668..494d2e25 100644 --- a/packages/networks/src/types.ts +++ b/packages/networks/src/types.ts @@ -1,4 +1,4 @@ -import { SetupOption } from '@acala-network/chopsticks-testing' +import type { SetupOption } from '@acala-network/chopsticks-testing' interface ChainConfigRelaychain { isRelayChain: true diff --git a/packages/polkadot/src/acala.assetHubPolkadot.test.ts b/packages/polkadot/src/acala.assetHubPolkadot.test.ts index 3d9b7285..98ad6a31 100644 --- a/packages/polkadot/src/acala.assetHubPolkadot.test.ts +++ b/packages/polkadot/src/acala.assetHubPolkadot.test.ts @@ -1,10 +1,10 @@ import { describe } from 'vitest' -import { acala, assetHubPolkadot } from '@e2e-test/networks/chains' import { defaultAccounts } from '@e2e-test/networks' +import { acala, assetHubPolkadot } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXcmPalletHorizontal, runXtokenstHorizontal } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('acala & assetHubPolkadot', async () => { const [assetHubPolkadotClient, acalaClient] = await setupNetworks(assetHubPolkadot, acala) diff --git a/packages/polkadot/src/acala.astar.test.ts b/packages/polkadot/src/acala.astar.test.ts index 2b183c4e..0824ede9 100644 --- a/packages/polkadot/src/acala.astar.test.ts +++ b/packages/polkadot/src/acala.astar.test.ts @@ -1,9 +1,9 @@ import { describe } from 'vitest' import { acala, astar } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXtokenstHorizontal } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('acala & astar', async () => { const [astarClient, acalaClient] = await setupNetworks(astar, acala) @@ -14,11 +14,7 @@ describe('acala & astar', async () => { toChain: acalaClient, fromBalance: query.assets(astar.custom.aca), toBalance: query.balances, - tx: tx.xtokens.transfer( - astar.custom.aca, - 1e12, - tx.xtokens.parachainV3(acala.paraId!), - ), + tx: tx.xtokens.transfer(astar.custom.aca, 1e12, tx.xtokens.parachainV3(acala.paraId!)), } }) diff --git a/packages/polkadot/src/acala.moonbeam.test.ts b/packages/polkadot/src/acala.moonbeam.test.ts index d5be76b3..ed1b07bf 100644 --- a/packages/polkadot/src/acala.moonbeam.test.ts +++ b/packages/polkadot/src/acala.moonbeam.test.ts @@ -1,10 +1,10 @@ import { describe } from 'vitest' -import { acala, moonbeam, polkadot } from '@e2e-test/networks/chains' import { defaultAccounts } from '@e2e-test/networks' -import { query, tx } from '@e2e-test/shared/api' -import { runXtokenstHorizontal, runXcmPalletHorizontal } from '@e2e-test/shared/xcm' +import { acala, moonbeam, polkadot } from '@e2e-test/networks/chains' import { setupNetworks } from '@e2e-test/shared' +import { query, tx } from '@e2e-test/shared/api' +import { runXcmPalletHorizontal, runXtokenstHorizontal } from '@e2e-test/shared/xcm' describe('acala & moonbeam', async () => { const [acalaClient, moonbeamClient, polkadotClient] = await setupNetworks(acala, moonbeam, polkadot) diff --git a/packages/polkadot/src/acala.polkadot.test.ts b/packages/polkadot/src/acala.polkadot.test.ts index af23732e..873f4207 100644 --- a/packages/polkadot/src/acala.polkadot.test.ts +++ b/packages/polkadot/src/acala.polkadot.test.ts @@ -1,9 +1,9 @@ import { describe } from 'vitest' import { acala, polkadot } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXcmPalletDown, runXtokensUp } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('acala & polkadot', async () => { const [polkadotClient, acalaClient] = await setupNetworks(polkadot, acala) diff --git a/packages/polkadot/src/assetHubPolkadot.polkadot.test.ts b/packages/polkadot/src/assetHubPolkadot.polkadot.test.ts index 75442497..63b745c0 100644 --- a/packages/polkadot/src/assetHubPolkadot.polkadot.test.ts +++ b/packages/polkadot/src/assetHubPolkadot.polkadot.test.ts @@ -1,10 +1,10 @@ import { describe } from 'vitest' -import { assetHubPolkadot, polkadot } from '@e2e-test/networks/chains' import { defaultAccounts } from '@e2e-test/networks' +import { assetHubPolkadot, polkadot } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXcmPalletDown, runXcmPalletUp } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('asset hub & polkadot', async () => { const [polkadotClient, ahClient] = await setupNetworks(polkadot, assetHubPolkadot) diff --git a/packages/polkadot/src/astar.polkadot.test.ts b/packages/polkadot/src/astar.polkadot.test.ts index 5d03523c..6df67270 100644 --- a/packages/polkadot/src/astar.polkadot.test.ts +++ b/packages/polkadot/src/astar.polkadot.test.ts @@ -1,9 +1,9 @@ import { describe } from 'vitest' import { astar, polkadot } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXcmPalletDown, runXtokensUp } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('astar & polkadot', async () => { const [polkadotClient, astarClient] = await setupNetworks(polkadot, astar) diff --git a/packages/polkadot/src/coretimePolkadot.polkadot.test.ts b/packages/polkadot/src/coretimePolkadot.polkadot.test.ts index 57f339bc..4b2b55b8 100644 --- a/packages/polkadot/src/coretimePolkadot.polkadot.test.ts +++ b/packages/polkadot/src/coretimePolkadot.polkadot.test.ts @@ -1,9 +1,9 @@ import { describe } from 'vitest' import { coretimePolkadot, polkadot } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXcmPalletDown, runXcmPalletUp } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('polkadot & coretimePolkadot', async () => { const [polkadotClient, coretimeClient] = await setupNetworks(polkadot, coretimePolkadot) diff --git a/packages/polkadot/src/hydration.moonbeam.test.ts b/packages/polkadot/src/hydration.moonbeam.test.ts index ac3c4a2c..7fcef896 100644 --- a/packages/polkadot/src/hydration.moonbeam.test.ts +++ b/packages/polkadot/src/hydration.moonbeam.test.ts @@ -2,9 +2,9 @@ import { describe } from 'vitest' import { defaultAccounts } from '@e2e-test/networks' import { hydration, moonbeam, polkadot } from '@e2e-test/networks/chains' -import { query, tx } from '@e2e-test/shared/api' -import { runXtokenstHorizontal, runXcmPalletHorizontal } from '@e2e-test/shared/xcm' import { setupNetworks } from '@e2e-test/shared' +import { query, tx } from '@e2e-test/shared/api' +import { runXcmPalletHorizontal, runXtokenstHorizontal } from '@e2e-test/shared/xcm' describe('hydration & moonbeam', async () => { const [hydrationClient, moonbeamClient, polkadotClient] = await setupNetworks(hydration, moonbeam, polkadot) @@ -30,31 +30,28 @@ describe('hydration & moonbeam', async () => { } }) - runXcmPalletHorizontal( - 'moonbeam transfer DOT to hydration', - async () => { - await moonbeamClient.dev.setStorage({ - Assets: { - account: [[[moonbeamDot, defaultAccounts.alith.address], { balance: 10e12 }]], - }, - }) + runXcmPalletHorizontal('moonbeam transfer DOT to hydration', async () => { + await moonbeamClient.dev.setStorage({ + Assets: { + account: [[[moonbeamDot, defaultAccounts.alith.address], { balance: 10e12 }]], + }, + }) - return { - fromChain: moonbeamClient, - fromBalance: query.assets(moonbeamDot), - fromAccount: defaultAccounts.alith, + return { + fromChain: moonbeamClient, + fromBalance: query.assets(moonbeamDot), + fromAccount: defaultAccounts.alith, - toChain: hydrationClient, - toBalance: query.tokens(hydrationDot), - toAccount: defaultAccounts.bob, + toChain: hydrationClient, + toBalance: query.tokens(hydrationDot), + toAccount: defaultAccounts.bob, - routeChain: polkadotClient, - isCheckUmp: true, + routeChain: polkadotClient, + isCheckUmp: true, - tx: tx.xcmPallet.transferAssetsV3(moonbeam.custom.xcmDot, 2e10, tx.xcmPallet.parachainV3(1, hydration.paraId!)), - } - }, - ) + tx: tx.xcmPallet.transferAssetsV3(moonbeam.custom.xcmDot, 2e10, tx.xcmPallet.parachainV3(1, hydration.paraId!)), + } + }) runXtokenstHorizontal('hydration transfer GLMR to moonbeam', async () => { await hydrationClient.dev.setStorage({ diff --git a/packages/polkadot/src/peoplePolkadot.e2e.test.ts b/packages/polkadot/src/peoplePolkadot.e2e.test.ts index 5e937a2e..22cc8982 100644 --- a/packages/polkadot/src/peoplePolkadot.e2e.test.ts +++ b/packages/polkadot/src/peoplePolkadot.e2e.test.ts @@ -2,4 +2,4 @@ import { peoplePolkadot, polkadot } from '@e2e-test/networks/chains' import { peopleChainE2ETests } from '@e2e-test/shared' -peopleChainE2ETests(polkadot, peoplePolkadot, { testSuiteName: "Polkadot People", addressEncoding: 0}) +peopleChainE2ETests(polkadot, peoplePolkadot, { testSuiteName: 'Polkadot People', addressEncoding: 0 }) diff --git a/packages/polkadot/src/peoplePolkadot.polkadot.test.ts b/packages/polkadot/src/peoplePolkadot.polkadot.test.ts index 37e48c61..df4da9f8 100644 --- a/packages/polkadot/src/peoplePolkadot.polkadot.test.ts +++ b/packages/polkadot/src/peoplePolkadot.polkadot.test.ts @@ -2,9 +2,9 @@ import { describe } from 'vitest' import { defaultAccounts } from '@e2e-test/networks' import { peoplePolkadot, polkadot } from '@e2e-test/networks/chains' +import { setupNetworks } from '@e2e-test/shared' import { query, tx } from '@e2e-test/shared/api' import { runXcmPalletDown, runXcmPalletUp } from '@e2e-test/shared/xcm' -import { setupNetworks } from '@e2e-test/shared' describe('polkadot & peoplePolkadot', async () => { const [polkadotClient, peopleClient] = await setupNetworks(polkadot, peoplePolkadot) diff --git a/packages/polkadot/src/polkadotGovernance.e2e.test.ts b/packages/polkadot/src/polkadotGovernance.e2e.test.ts index e37ceab4..455e0df1 100644 --- a/packages/polkadot/src/polkadotGovernance.e2e.test.ts +++ b/packages/polkadot/src/polkadotGovernance.e2e.test.ts @@ -2,4 +2,4 @@ import { polkadot } from '@e2e-test/networks/chains' import { governanceE2ETests } from '@e2e-test/shared' -governanceE2ETests(polkadot, { testSuiteName: "Polkadot Governance", addressEncoding: 0}) +governanceE2ETests(polkadot, { testSuiteName: 'Polkadot Governance', addressEncoding: 0 }) diff --git a/packages/shared/src/api/index.ts b/packages/shared/src/api/index.ts index 20c47f53..26218717 100644 --- a/packages/shared/src/api/index.ts +++ b/packages/shared/src/api/index.ts @@ -1,4 +1,4 @@ -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' export const xtokens = { relaychainV3: (acc: any) => ({ diff --git a/packages/shared/src/api/query.ts b/packages/shared/src/api/query.ts index 21b54863..f250d83e 100644 --- a/packages/shared/src/api/query.ts +++ b/packages/shared/src/api/query.ts @@ -1,4 +1,4 @@ -import { ApiPromise } from '@polkadot/api' +import type { ApiPromise } from '@polkadot/api' export const queryBalance = (api: ApiPromise, address: string) => { return api.query.system.account(address) diff --git a/packages/shared/src/governance.ts b/packages/shared/src/governance.ts index ad4de79b..65ed5697 100644 --- a/packages/shared/src/governance.ts +++ b/packages/shared/src/governance.ts @@ -1,21 +1,21 @@ import { BN } from 'bn.js' import { assert, describe, test } from 'vitest' -import { Chain, defaultAccounts } from '@e2e-test/networks' +import { type Chain, defaultAccounts } from '@e2e-test/networks' import { setupNetworks } from '@e2e-test/shared' import { check, checkEvents } from './helpers/index.js' import { sendTransaction } from '@acala-network/chopsticks-testing' -import { +import type { Option, u32 } from '@polkadot/types' +import type { PalletConvictionVotingVoteCasting, PalletConvictionVotingVoteVoting, PalletReferendaDeposit, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumStatusConvictionVotingTally, } from '@polkadot/types/lookup' -import { ITuple } from '@polkadot/types/types' -import { Option, u32 } from '@polkadot/types' +import type { ITuple } from '@polkadot/types/types' import { encodeAddress } from '@polkadot/util-crypto' /** @@ -71,7 +71,7 @@ function referendumCmp( if (errorMsg === null || errorMsg === undefined) { errorMessage = msg } else { - errorMessage = errorMsg + '\n' + msg + errorMessage = `${errorMsg}\n${msg}` } assert(cmp, errorMessage) } @@ -141,7 +141,7 @@ export async function referendumLifecycleTest< await relayClient.dev.newBlock() // Fields to be removed, check comment below. - let unwantedFields = new RegExp('index') + let unwantedFields = /index/ await checkEvents(submissionEvents, 'referenda') .redact({ removeKeys: unwantedFields }) .toMatchSnapshot('referendum submission events') @@ -158,7 +158,7 @@ export async function referendumLifecycleTest< // snapshot. // These fields contain epoch-sensitive data, which will cause spurious test failures // periodically. - unwantedFields = new RegExp('alarm|submitted') + unwantedFields = /alarm|submitted/ await check(referendumData) .redact({ removeKeys: unwantedFields }) .toMatchSnapshot('referendum info before decision deposit') @@ -214,7 +214,7 @@ export async function referendumLifecycleTest< // Once more, fields containing temporally-contigent information - block numbers - must be excised // from test data to avoid spurious failures after updating block numbers. - unwantedFields = new RegExp("alarm|index|submitted") + unwantedFields = /alarm|index|submitted/ await checkEvents(decisiondepEvents, 'referenda') .redact({ removeKeys: unwantedFields }) @@ -263,15 +263,15 @@ export async function referendumLifecycleTest< for (let i = 0; i < smallTipper[1].preparePeriod.toNumber() - 2; i++) { await relayClient.dev.newBlock() - referendumDataOpt = await relayClient.api.query.referenda.referendumInfoFor(referendumIndex) - assert(referendumDataOpt.isSome, "referendum's data cannot be `None`") - referendumData = referendumDataOpt.unwrap() - assert(referendumData.isOngoing) - refPost = referendumData.asOngoing + referendumDataOpt = await relayClient.api.query.referenda.referendumInfoFor(referendumIndex) + assert(referendumDataOpt.isSome, "referendum's data cannot be `None`") + referendumData = referendumDataOpt.unwrap() + assert(referendumData.isOngoing) + refPost = referendumData.asOngoing - referendumCmp(refPre, refPost, [], `Failed on iteration number ${i}.`) + referendumCmp(refPre, refPost, [], `Failed on iteration number ${i}.`) - refPre = refPost + refPre = refPost } await relayClient.dev.newBlock() @@ -279,7 +279,7 @@ export async function referendumLifecycleTest< referendumDataOpt = await relayClient.api.query.referenda.referendumInfoFor(referendumIndex) const refNowDeciding = referendumDataOpt.unwrap().asOngoing - unwantedFields = new RegExp("alarm|submitted|since") + unwantedFields = /alarm|submitted|since/ await check(refNowDeciding) .redact({ removeKeys: unwantedFields }) @@ -289,10 +289,12 @@ export async function referendumLifecycleTest< assert(refNowDeciding.alarm.unwrap()[0].eq(smallTipper[1].decisionPeriod.add(decisionPeriodStartBlock))) - assert(refNowDeciding.deciding.eq({ - since: decisionPeriodStartBlock, - confirming: null - })) + assert( + refNowDeciding.deciding.eq({ + since: decisionPeriodStartBlock, + confirming: null, + }), + ) referendumCmp(refPost!, refNowDeciding, ['alarm', 'deciding']) @@ -316,13 +318,13 @@ export async function referendumLifecycleTest< await relayClient.dev.newBlock() - unwantedFields = new RegExp("alarm|when|since|submitted") + unwantedFields = /alarm|when|since|submitted/ // Filtering for events only from the `convictionVoting` pallet would leave them empty. // Voting events were only introduced in // /~https://github.com/paritytech/polkadot-sdk/pull/4613, and will take a few releases until they // are visible here - this will trigger a failure in tests, which can then be addressed. - await checkEvents(voteEvents, "convictionVoting", "referenda") + await checkEvents(voteEvents, 'convictionVoting', 'referenda') .redact({ removeKeys: unwantedFields, redactKeys: unwantedFields }) .toMatchSnapshot("events for charlie's vote") @@ -344,17 +346,14 @@ export async function referendumLifecycleTest< // Check Charlie's locked funds const charlieClassLocks = await relayClient.api.query.convictionVoting.classLocksFor(defaultAccounts.charlie.address) - const localCharlieClassLocks = [ - [ - smallTipper[0], - ayeVote - ] - ] + const localCharlieClassLocks = [[smallTipper[0], ayeVote]] assert(charlieClassLocks.eq(localCharlieClassLocks)) // , and overall account's votes - const votingByCharlie: PalletConvictionVotingVoteVoting = - await relayClient.api.query.convictionVoting.votingFor(defaultAccounts.charlie.address, smallTipper[0]) + const votingByCharlie: PalletConvictionVotingVoteVoting = await relayClient.api.query.convictionVoting.votingFor( + defaultAccounts.charlie.address, + smallTipper[0], + ) assert(votingByCharlie.isCasting, "charlie's votes are cast, not delegated") const charlieCastVotes: PalletConvictionVotingVoteCasting = votingByCharlie.asCasting @@ -362,7 +361,9 @@ export async function referendumLifecycleTest< // which must be removed. const unwantedRefIx = new RegExp(`${referendumIndex},`) - await check(charlieCastVotes.votes[0][1]).redact({ removeKeys: unwantedRefIx}).toMatchSnapshot("charlie's votes after casting his") + await check(charlieCastVotes.votes[0][1]) + .redact({ removeKeys: unwantedRefIx }) + .toMatchSnapshot("charlie's votes after casting his") assert(charlieCastVotes.votes.length === 1) assert(charlieCastVotes.votes[0][0].eq(referendumIndex)) @@ -393,7 +394,7 @@ export async function referendumLifecycleTest< await relayClient.dev.newBlock() - await checkEvents(voteEvents, "convictionVoting", "referenda") + await checkEvents(voteEvents, 'convictionVoting', 'referenda') .redact({ removeKeys: unwantedFields }) .toMatchSnapshot("events for dave's vote") @@ -420,12 +421,16 @@ export async function referendumLifecycleTest< // Check Dave's overall votes - const votingByDave: PalletConvictionVotingVoteVoting = - await relayClient.api.query.convictionVoting.votingFor(defaultAccounts.dave.address, smallTipper[0]) + const votingByDave: PalletConvictionVotingVoteVoting = await relayClient.api.query.convictionVoting.votingFor( + defaultAccounts.dave.address, + smallTipper[0], + ) assert(votingByDave.isCasting, "dave's votes are cast, not delegated") const daveCastVotes: PalletConvictionVotingVoteCasting = votingByDave.asCasting - await check(daveCastVotes.votes[0][1]).redact({ removeKeys: unwantedRefIx}).toMatchSnapshot("dave's votes after casting his") + await check(daveCastVotes.votes[0][1]) + .redact({ removeKeys: unwantedRefIx }) + .toMatchSnapshot("dave's votes after casting his") assert(daveCastVotes.votes.length === 1) assert(daveCastVotes.votes[0][0].eq(referendumIndex)) @@ -459,7 +464,7 @@ export async function referendumLifecycleTest< await relayClient.dev.newBlock() - await checkEvents(voteEvents, "convictionVoting", "referenda") + await checkEvents(voteEvents, 'convictionVoting', 'referenda') .redact({ removeKeys: unwantedFields }) .toMatchSnapshot("events for eve's vote") @@ -467,9 +472,7 @@ export async function referendumLifecycleTest< assert(referendumDataOpt.isSome, "referendum's data cannot be `None`") referendumData = referendumDataOpt.unwrap() - await check(referendumData) - .redact({ removeKeys: unwantedFields }) - .toMatchSnapshot("referendum info after eve's vote") + await check(referendumData).redact({ removeKeys: unwantedFields }).toMatchSnapshot("referendum info after eve's vote") assert(referendumData.isOngoing) const ongoingRefThirdVote = referendumData.asOngoing @@ -486,12 +489,16 @@ export async function referendumLifecycleTest< // Check Eve's overall votes - const votingByEve: PalletConvictionVotingVoteVoting = - await relayClient.api.query.convictionVoting.votingFor(defaultAccounts.eve.address, smallTipper[0]) + const votingByEve: PalletConvictionVotingVoteVoting = await relayClient.api.query.convictionVoting.votingFor( + defaultAccounts.eve.address, + smallTipper[0], + ) assert(votingByEve.isCasting, "eve's votes are cast, not delegated") const eveCastVotes: PalletConvictionVotingVoteCasting = votingByEve.asCasting - await check(eveCastVotes.votes[0][1]).redact({ removeKeys: unwantedRefIx}).toMatchSnapshot("eve's votes after casting hers") + await check(eveCastVotes.votes[0][1]) + .redact({ removeKeys: unwantedRefIx }) + .toMatchSnapshot("eve's votes after casting hers") assert(eveCastVotes.votes.length === 1) assert(eveCastVotes.votes[0][0].eq(referendumIndex)) @@ -500,7 +507,6 @@ export async function referendumLifecycleTest< assert(eveVote.nay.eq(nayVote)) assert(eveVote.abstain.eq(abstainVote)) - // AFter a vote the referendum's alarm is set to the block following the one the vote tx was // included in. ongoingRefThirdVote.alarm.unwrap()[0].eq(ongoingRefSecondVote.deciding.unwrap().since.add(new BN(1))) @@ -511,14 +517,13 @@ export async function referendumLifecycleTest< referendumCmp(ongoingRefSecondVote, ongoingRefThirdVote, ['tally', 'alarm']) // Attempt to cancel the referendum with a signed origin - this should fail. - + const cancelRefCall = relayClient.api.tx.referenda.cancel(referendumIndex) const cancelRefEvents = await sendTransaction(cancelRefCall.signAsync(defaultAccounts.alice)) await relayClient.dev.newBlock() - await checkEvents(cancelRefEvents, 'referenda', 'system') - .toMatchSnapshot('cancelling referendum with signed origin') + await checkEvents(cancelRefEvents, 'referenda', 'system').toMatchSnapshot('cancelling referendum with signed origin') // Cancel the referendum using the scheduler pallet to simulate a root origin @@ -555,11 +560,11 @@ export async function referendumLifecycleTest< const events = await relayClient.api.query.system.events() const referendaEvents = events.filter((record) => { - const { event } = record; + const { event } = record return event.section === 'referenda' - }); + }) - assert(referendaEvents.length === 1, "cancelling a referendum should emit 1 event") + assert(referendaEvents.length === 1, 'cancelling a referendum should emit 1 event') const cancellationEvent = referendaEvents[0] assert(relayClient.api.events.referenda.Cancelled.is(cancellationEvent.event)) @@ -574,33 +579,34 @@ export async function referendumLifecycleTest< // cancelling a referendum does not remove it from storage assert(referendumDataOpt.isSome, "referendum's data cannot be `None`") - assert(referendumDataOpt.unwrap().isCancelled, "referendum should be cancelled!") - const cancelledRef: ITuple<[u32, Option, Option]> = referendumDataOpt.unwrap().asCancelled + assert(referendumDataOpt.unwrap().isCancelled, 'referendum should be cancelled!') + const cancelledRef: ITuple<[u32, Option, Option]> = + referendumDataOpt.unwrap().asCancelled cancelledRef[0].eq(referendumIndex) // Check that the referendum's submission deposit was refunded to Alice cancelledRef[1].unwrap().eq({ who: encodeAddress(defaultAccounts.alice.address, addressEncoding), - amount: relayClient.api.consts.referenda.submissionDeposit + amount: relayClient.api.consts.referenda.submissionDeposit, }) // Check that the referendum's submission deposit was refunded to Bob cancelledRef[2].unwrap().eq({ who: encodeAddress(defaultAccounts.bob.address, addressEncoding), - amount: smallTipper[1].decisionDeposit + amount: smallTipper[1].decisionDeposit, }) const testAccounts = { - 'charlie': { + charlie: { classLocks: charlieClassLocks, localClassLocks: localCharlieClassLocks, votingBy: votingByCharlie, }, - 'dave': { + dave: { classLocks: daveLockedFunds, localClassLocks: localDaveClassLocks, votingBy: votingByDave, }, - 'eve': { + eve: { classLocks: eveLockedFunds, localClassLocks: localEveClassLocks, votingBy: votingByEve, @@ -609,11 +615,12 @@ export async function referendumLifecycleTest< // Check that cancelling the referendum has no effect on each voter's class locks for (const account of Object.keys(testAccounts)) { - testAccounts[account].classLocks = - await relayClient.api.query.convictionVoting.classLocksFor(defaultAccounts[account].address) + testAccounts[account].classLocks = await relayClient.api.query.convictionVoting.classLocksFor( + defaultAccounts[account].address, + ) assert( testAccounts[account].classLocks.eq(testAccounts[account].localClassLocks), - `${account}'s class locks should be unaffected by referendum cancellation` + `${account}'s class locks should be unaffected by referendum cancellation`, ) } @@ -621,18 +628,15 @@ export async function referendumLifecycleTest< // storage item. for (const account of Object.keys(testAccounts)) { const postCancellationVoting: PalletConvictionVotingVoteVoting = - await relayClient.api.query.convictionVoting.votingFor( - (defaultAccounts[account].address as string), - smallTipper[0] - ) + await relayClient.api.query.convictionVoting.votingFor(defaultAccounts[account].address as string, smallTipper[0]) assert(postCancellationVoting.isCasting, `pre-referendum cancellation, ${account}'s votes were cast, not delegated`) const postCancellationCastVotes: PalletConvictionVotingVoteCasting = postCancellationVoting.asCasting assert( postCancellationVoting.eq(testAccounts[account].votingBy), - `${account}'s votes should be unaffected by referendum cancellation` + `${account}'s votes should be unaffected by referendum cancellation`, ) - await check((postCancellationCastVotes).votes[0][1]) - .redact({ removeKeys: unwantedRefIx}) + await check(postCancellationCastVotes.votes[0][1]) + .redact({ removeKeys: unwantedRefIx }) .toMatchSnapshot(`${account}'s votes after referendum's cancellation`) } @@ -644,12 +648,12 @@ export async function referendumLifecycleTest< const removeDaveVoteAsCharlie = relayClient.api.tx.convictionVoting.removeOtherVote( defaultAccounts.dave.address, smallTipper[0], - referendumIndex + referendumIndex, ).method const removeEveVoteAsCharlie = relayClient.api.tx.convictionVoting.removeOtherVote( defaultAccounts.eve.address, smallTipper[0], - referendumIndex + referendumIndex, ).method const batchAllTx = relayClient.api.tx.utility.batchAll([ @@ -663,7 +667,7 @@ export async function referendumLifecycleTest< await relayClient.dev.newBlock() await checkEvents(batchEvents) - .redact({ removeKeys: new RegExp('who') }) + .redact({ removeKeys: /who/ }) .toMatchSnapshot('removal of votes in cancelled referendum') // Check that each voter's class locks remain unaffected by vote removal - these are subject to a @@ -671,16 +675,21 @@ export async function referendumLifecycleTest< // // Also check that voting for each account is appropriately empty. for (const account of Object.keys(testAccounts)) { - testAccounts[account].classLocks = - await relayClient.api.query.convictionVoting.classLocksFor(defaultAccounts[account].address) + testAccounts[account].classLocks = await relayClient.api.query.convictionVoting.classLocksFor( + defaultAccounts[account].address, + ) assert( testAccounts[account].classLocks.eq(testAccounts[account].localClassLocks), - `${account}'s class locks should be unaffected by vote removal` + `${account}'s class locks should be unaffected by vote removal`, + ) + await check(testAccounts[account].classLocks).toMatchSnapshot( + `${account}'s class locks after their vote's rescission`, ) - await check(testAccounts[account].classLocks).toMatchSnapshot(`${account}'s class locks after their vote's rescission`) - testAccounts[account].votingBy = - await relayClient.api.query.convictionVoting.votingFor(defaultAccounts[account].address, smallTipper[0]) + testAccounts[account].votingBy = await relayClient.api.query.convictionVoting.votingFor( + defaultAccounts[account].address, + smallTipper[0], + ) assert(testAccounts[account].votingBy.isCasting) const castVotes = testAccounts[account].votingBy.asCasting await check(castVotes).toMatchSnapshot(`${account}'s votes after rescission`) @@ -697,11 +706,11 @@ export async function referendumLifecycleTest< await relayClient.dev.newBlock() await checkEvents(submissionRefundEvents, 'referenda') - .redact({ removeKeys: new RegExp('index') }) + .redact({ removeKeys: /index/ }) .toMatchSnapshot('refund of submission deposit') await checkEvents(decisionRefundEvents, 'referenda') - .redact({ removeKeys: new RegExp('index') }) + .redact({ removeKeys: /index/ }) .toMatchSnapshot('refund of decision deposit') } @@ -772,7 +781,7 @@ export async function referendumLifecycleKillTest< await relayClient.dev.newBlock() // Attempt to kill the referendum with a signed origin - + const killRefCall = relayClient.api.tx.referenda.kill(referendumIndex) const killRefEvents = await sendTransaction(killRefCall.signAsync(defaultAccounts.alice)) @@ -780,7 +789,6 @@ export async function referendumLifecycleKillTest< await checkEvents(killRefEvents, 'referenda', 'system').toMatchSnapshot('killing referendum with signed origin') - /** * Kill the referendum using the scheduler pallet to simulate a root origin for the call. */ @@ -815,24 +823,26 @@ export async function referendumLifecycleKillTest< // Retrieve the events for the latest block const events = await relayClient.api.query.system.events() - + const referendaEvents = events.filter((record) => { - const { event } = record; + const { event } = record return event.section === 'referenda' - }); + }) - assert(referendaEvents.length === 3, "killing a referendum should emit 3 events") + assert(referendaEvents.length === 3, 'killing a referendum should emit 3 events') referendaEvents.forEach((record) => { - const { event } = record; + const { event } = record if (relayClient.api.events.referenda.Killed.is(event)) { const [index, tally] = event.data assert(index.eq(referendumIndex)) - assert(tally.eq({ - ayes: 0, - nays: 0, - support: 0, - })) + assert( + tally.eq({ + ayes: 0, + nays: 0, + support: 0, + }), + ) } else if (relayClient.api.events.referenda.DepositSlashed.is(event)) { const [who, amount] = event.data @@ -841,7 +851,7 @@ export async function referendumLifecycleKillTest< } else if (who.eq(encodeAddress(defaultAccounts.bob.address, addressEncoding))) { assert(amount.eq(smallTipper[1].decisionDeposit)) } else { - assert(false, "malformed decision slashed events") + assert(false, 'malformed decision slashed events') } } }) @@ -849,7 +859,7 @@ export async function referendumLifecycleKillTest< const referendumDataOpt = await relayClient.api.query.referenda.referendumInfoFor(referendumIndex) // killing a referendum does not remove it from storage, though it does prune most of its data. assert(referendumDataOpt.isSome, "referendum's data cannot be `None`") - assert(referendumDataOpt.unwrap().isKilled, "referendum should be cancelled!") + assert(referendumDataOpt.unwrap().isKilled, 'referendum should be cancelled!') // The only information left from the killed referendum is the block number when it was killed. const blockNumber = (await relayClient.api.rpc.chain.getHeader()).number.toNumber() @@ -879,12 +889,10 @@ export async function preimageTest< * Query noted preimage */ - let preimage = await relayClient.api.query.preimage.preimageFor( - [ - encodedProposal.hash.toHex(), - encodedProposal.encodedLength - ] - ) + let preimage = await relayClient.api.query.preimage.preimageFor([ + encodedProposal.hash.toHex(), + encodedProposal.encodedLength, + ]) assert(preimage.isSome) assert(preimage.unwrap().toHex() === encodedProposal.toHex()) @@ -904,12 +912,10 @@ export async function preimageTest< * Query unnoted preimage, and verify it is absent */ - preimage = await relayClient.api.query.preimage.preimageFor( - [ - encodedProposal.hash.toHex(), - encodedProposal.encodedLength - ] - ) + preimage = await relayClient.api.query.preimage.preimageFor([ + encodedProposal.hash.toHex(), + encodedProposal.encodedLength, + ]) assert(preimage.isNone) } @@ -917,28 +923,18 @@ export async function preimageTest< export function governanceE2ETests< TCustom extends Record | undefined, TInitStoragesRelay extends Record> | undefined, ->( - relayChain: Chain, - testConfig: { testSuiteName: string, addressEncoding: number, } -) { - - describe(testConfig.testSuiteName, function () { - test( - 'referendum lifecycle test - submission, decision deposit, various voting should all work', - async () => { - await referendumLifecycleTest(relayChain, testConfig.addressEncoding) - }) - - test( - 'referendum lifecycle test 2 - submission, decision deposit, and killing should work', - async () => { - await referendumLifecycleKillTest(relayChain, testConfig.addressEncoding) - }) - - test( - 'preimage submission, query and removal works', - async() => { - await preimageTest(relayChain) - }) +>(relayChain: Chain, testConfig: { testSuiteName: string; addressEncoding: number }) { + describe(testConfig.testSuiteName, () => { + test('referendum lifecycle test - submission, decision deposit, various voting should all work', async () => { + await referendumLifecycleTest(relayChain, testConfig.addressEncoding) + }) + + test('referendum lifecycle test 2 - submission, decision deposit, and killing should work', async () => { + await referendumLifecycleKillTest(relayChain, testConfig.addressEncoding) + }) + + test('preimage submission, query and removal works', async () => { + await preimageTest(relayChain) + }) }) } diff --git a/packages/shared/src/helpers/index.ts b/packages/shared/src/helpers/index.ts index 5c4bced0..eddae243 100644 --- a/packages/shared/src/helpers/index.ts +++ b/packages/shared/src/helpers/index.ts @@ -1,5 +1,5 @@ -import { expect } from 'vitest' import { withExpect } from '@acala-network/chopsticks-testing' +import { expect } from 'vitest' const { check, checkEvents, checkHrmp, checkSystemEvents, checkUmp } = withExpect((x: any) => ({ toMatchSnapshot(msg?: string): void { diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index d0458cd5..bffe6590 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -2,4 +2,4 @@ export * from './setup.js' export * from './people.js' export * from './governance.js' -export * from './types.js' \ No newline at end of file +export * from './types.js' diff --git a/packages/shared/src/people.ts b/packages/shared/src/people.ts index c1ae1d51..e4a5f522 100644 --- a/packages/shared/src/people.ts +++ b/packages/shared/src/people.ts @@ -10,15 +10,15 @@ import { assert, describe, test } from 'vitest' -import { StorageValues } from '@acala-network/chopsticks' +import type { StorageValues } from '@acala-network/chopsticks' import { sendTransaction } from '@acala-network/chopsticks-testing' -import { Chain, defaultAccounts } from '@e2e-test/networks' +import { type Chain, defaultAccounts } from '@e2e-test/networks' -import { ApiPromise } from '@polkadot/api' -import { PalletIdentityLegacyIdentityInfo, PalletIdentityRegistration } from '@polkadot/types/lookup' +import type { ApiPromise } from '@polkadot/api' +import type { u128 } from '@polkadot/types' +import type { PalletIdentityLegacyIdentityInfo, PalletIdentityRegistration } from '@polkadot/types/lookup' import { encodeAddress } from '@polkadot/util-crypto' -import { u128 } from '@polkadot/types' import { setupNetworks } from '@e2e-test/shared' import { check, checkEvents } from './helpers/index.js' @@ -568,8 +568,7 @@ export async function addRegistrarViaRelayAsRoot< await peopleClient.dev.newBlock() // The recorded event should be `ExtrinsicFailed` with a `BadOrigin`. - await checkEvents(addRegistrarEvents, 'identity', 'system') - .toMatchSnapshot('call add registrar with wrong origin') + await checkEvents(addRegistrarEvents, 'identity', 'system').toMatchSnapshot('call add registrar with wrong origin') /** * XCM from relay chain @@ -626,11 +625,11 @@ export async function addRegistrarViaRelayAsRoot< const events = await peopleClient.api.query.system.events() const peopleEvents = events.filter((record) => { - const { event } = record; + const { event } = record return event.section === 'identity' - }); + }) - assert(peopleEvents.length === 1, "adding a registrar should emit 1 event") + assert(peopleEvents.length === 1, 'adding a registrar should emit 1 event') const registrarEvent = peopleEvents[0] assert(peopleClient.api.events.identity.RegistrarAdded.is(registrarEvent.event)) @@ -753,9 +752,9 @@ export function peopleChainE2ETests< >( relayChain: Chain, peopleChain: Chain, - testConfig: { testSuiteName: string, addressEncoding: number, } + testConfig: { testSuiteName: string; addressEncoding: number }, ) { - describe(testConfig.testSuiteName, function () { + describe(testConfig.testSuiteName, () => { test('setting on-chain identity and requesting judgement should work', async () => { await setIdentityThenRequestAndProvideJudgement(peopleChain) }) diff --git a/packages/shared/src/setup.ts b/packages/shared/src/setup.ts index 3c434ca3..5822104b 100644 --- a/packages/shared/src/setup.ts +++ b/packages/shared/src/setup.ts @@ -1,6 +1,6 @@ import { afterAll, beforeEach } from 'vitest' -import { Chain, captureSnapshot, createNetworks } from '@e2e-test/networks' +import { type Chain, captureSnapshot, createNetworks } from '@e2e-test/networks' /** * Sets up blockchain networks for testing with automatic snapshot restore and cleanup. diff --git a/packages/shared/src/xcm/runXcmPalletDown.ts b/packages/shared/src/xcm/runXcmPalletDown.ts index 709652c2..a4ba1172 100644 --- a/packages/shared/src/xcm/runXcmPalletDown.ts +++ b/packages/shared/src/xcm/runXcmPalletDown.ts @@ -1,10 +1,10 @@ -import { type KeyringPair } from '@polkadot/keyring/types' -import { it } from 'vitest' import { sendTransaction } from '@acala-network/chopsticks-testing' +import type { KeyringPair } from '@polkadot/keyring/types' +import { it } from 'vitest' -import { Client, defaultAccounts } from '@e2e-test/networks' -import { GetBalance, Tx } from './types.js' +import { type Client, defaultAccounts } from '@e2e-test/networks' import { check, checkEvents, checkSystemEvents } from '../helpers/index.js' +import type { GetBalance, Tx } from './types.js' export const runXcmPalletDown = ( name: string, diff --git a/packages/shared/src/xcm/runXcmPalletHorizontal.ts b/packages/shared/src/xcm/runXcmPalletHorizontal.ts index 9bc47700..dea99069 100644 --- a/packages/shared/src/xcm/runXcmPalletHorizontal.ts +++ b/packages/shared/src/xcm/runXcmPalletHorizontal.ts @@ -1,10 +1,10 @@ -import { type KeyringPair } from '@polkadot/keyring/types' -import { it } from 'vitest' import { sendTransaction } from '@acala-network/chopsticks-testing' +import type { KeyringPair } from '@polkadot/keyring/types' +import { it } from 'vitest' -import { Client, defaultAccounts } from '@e2e-test/networks' -import { GetBalance, Tx } from './types.js' +import { type Client, defaultAccounts } from '@e2e-test/networks' import { check, checkEvents, checkHrmp, checkSystemEvents, checkUmp } from '../helpers/index.js' +import type { GetBalance, Tx } from './types.js' export const runXcmPalletHorizontal = ( name: string, diff --git a/packages/shared/src/xcm/runXcmPalletUp.ts b/packages/shared/src/xcm/runXcmPalletUp.ts index 88f96aa8..4c64d681 100644 --- a/packages/shared/src/xcm/runXcmPalletUp.ts +++ b/packages/shared/src/xcm/runXcmPalletUp.ts @@ -1,10 +1,10 @@ -import { type KeyringPair } from '@polkadot/keyring/types' -import { it } from 'vitest' import { sendTransaction } from '@acala-network/chopsticks-testing' +import type { KeyringPair } from '@polkadot/keyring/types' +import { it } from 'vitest' -import { Client, defaultAccounts } from '@e2e-test/networks' -import { GetBalance, Tx } from './types.js' +import { type Client, defaultAccounts } from '@e2e-test/networks' import { check, checkEvents, checkSystemEvents, checkUmp } from '../helpers/index.js' +import type { GetBalance, Tx } from './types.js' export const runXcmPalletUp = ( name: string, diff --git a/packages/shared/src/xcm/runXtokensUp.ts b/packages/shared/src/xcm/runXtokensUp.ts index 6abc1867..aa3f54ae 100644 --- a/packages/shared/src/xcm/runXtokensUp.ts +++ b/packages/shared/src/xcm/runXtokensUp.ts @@ -1,10 +1,10 @@ -import { type KeyringPair } from '@polkadot/keyring/types' -import { it } from 'vitest' import { sendTransaction } from '@acala-network/chopsticks-testing' +import type { KeyringPair } from '@polkadot/keyring/types' +import { it } from 'vitest' -import { Client, defaultAccounts } from '@e2e-test/networks' -import { GetBalance, Tx } from './types.js' +import { type Client, defaultAccounts } from '@e2e-test/networks' import { check, checkEvents, checkSystemEvents, checkUmp } from '../helpers/index.js' +import type { GetBalance, Tx } from './types.js' export const runXtokensUp = ( name: string, diff --git a/packages/shared/src/xcm/runXtokenstHorizontal.ts b/packages/shared/src/xcm/runXtokenstHorizontal.ts index c4c5e235..d12b0567 100644 --- a/packages/shared/src/xcm/runXtokenstHorizontal.ts +++ b/packages/shared/src/xcm/runXtokenstHorizontal.ts @@ -1,10 +1,10 @@ -import { type KeyringPair } from '@polkadot/keyring/types' -import { it } from 'vitest' import { sendTransaction } from '@acala-network/chopsticks-testing' +import type { KeyringPair } from '@polkadot/keyring/types' +import { it } from 'vitest' -import { Client, defaultAccounts } from '@e2e-test/networks' -import { GetBalance, Tx } from './types.js' +import { type Client, defaultAccounts } from '@e2e-test/networks' import { check, checkEvents, checkHrmp, checkSystemEvents, checkUmp } from '../helpers/index.js' +import type { GetBalance, Tx } from './types.js' export const runXtokenstHorizontal = ( name: string, diff --git a/packages/shared/src/xcm/types.ts b/packages/shared/src/xcm/types.ts index 80a8bf14..3e2b4d83 100644 --- a/packages/shared/src/xcm/types.ts +++ b/packages/shared/src/xcm/types.ts @@ -1,5 +1,5 @@ -import { type ApiPromise } from '@polkadot/api' -import { type SubmittableExtrinsic } from '@polkadot/api/types' +import type { ApiPromise } from '@polkadot/api' +import type { SubmittableExtrinsic } from '@polkadot/api/types' export type Tx = ({ api }: { api: ApiPromise }, acc: any) => SubmittableExtrinsic<'promise'> export type GetBalance = ({ api }: { api: ApiPromise }, address: string) => Promise diff --git a/scripts/update-env.ts b/scripts/update-env.ts index c3632fcd..88e20a2c 100644 --- a/scripts/update-env.ts +++ b/scripts/update-env.ts @@ -1,6 +1,6 @@ -import { fileURLToPath } from 'url' -import fs from 'fs' -import path, { dirname } from 'path' +import fs from 'node:fs' +import path, { dirname } from 'node:path' +import { fileURLToPath } from 'node:url' const __filename = fileURLToPath(import.meta.url) import * as chains from '@e2e-test/networks/chains' @@ -45,9 +45,9 @@ const main = async () => { const blockNumbersStr = (await Promise.all(blockNumbers)).join('\n') if (isUpdateKnownGood) { - envFile = blockNumbersStr + '\n' + envFile = `${blockNumbersStr}\n` } else { - envFile = blockNumbersStr + '\n\n' + envFile + envFile = `${blockNumbersStr}\n\n${envFile}` } console.log(blockNumbersStr) diff --git a/vitest.config.mts b/vitest.config.mts index a81ce662..7ad0d1d6 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -1,12 +1,12 @@ -import { defineConfig } from 'vitest/config' import swc from 'unplugin-swc' +import { defineConfig } from 'vitest/config' -import { resolve } from 'path'; +import { resolve } from 'node:path' +import dotenv from 'dotenv' import tsconfigPaths from 'vite-tsconfig-paths' -import dotenv from 'dotenv'; -dotenv.config(); -dotenv.config({ path: resolve(__dirname, 'KNOWN_GOOD_BLOCK_NUMBERS.env') }); +dotenv.config() +dotenv.config({ path: resolve(__dirname, 'KNOWN_GOOD_BLOCK_NUMBERS.env') }) if (process.env.LOG_LEVEL === undefined) { process.env.LOG_LEVEL = 'error' } @@ -25,4 +25,3 @@ export default defineConfig({ }, plugins: [tsconfigPaths(), swc.vite()], }) - From 2c825b72cd032e889c86c0de4f262ab0732629ed Mon Sep 17 00:00:00 2001 From: Gregory Luneau Date: Mon, 20 Jan 2025 22:21:43 -0500 Subject: [PATCH 3/4] ANSI code stripping --- .github/command-runner/utils.cjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/command-runner/utils.cjs b/.github/command-runner/utils.cjs index 7c16289e..967d2f7a 100644 --- a/.github/command-runner/utils.cjs +++ b/.github/command-runner/utils.cjs @@ -31,8 +31,8 @@ async function runCommand({ cmd, comment, exec }) { }) return { - output: output.replace(/\x1b\[[0-9;]*m/g, ''), - errorOutput: errorOutput.replace(/\x1b\[[0-9;]*m/g, ''), + output: output.replace(new RegExp(`${ANSI_ESCAPE}\\[[0-9;]*m`, 'g'), ''), + errorOutput: errorOutput.replace(new RegExp(`${ANSI_ESCAPE}\\[[0-9;]*m`, 'g'), ''), exitCode, cmd, } From 694b0b7fcf7fb421f735a04e2ad3195c22452cba Mon Sep 17 00:00:00 2001 From: Gregory Luneau Date: Mon, 20 Jan 2025 22:27:52 -0500 Subject: [PATCH 4/4] .editorconfig now cjs with tab width=2 --- .editorconfig | 2 +- .github/command-runner/comment.cjs | 48 ++--- .github/command-runner/merge.cjs | 116 ++++++------ .github/command-runner/postBump.cjs | 48 ++--- .github/command-runner/runOrBump.cjs | 274 +++++++++++++-------------- .github/command-runner/utils.cjs | 60 +++--- 6 files changed, 274 insertions(+), 274 deletions(-) diff --git a/.editorconfig b/.editorconfig index 0278f6d4..718403ff 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,6 +15,6 @@ indent_size=2 tab_width=8 end_of_line=lf -[*.{js,ts}] +[*.{js,ts,cjs}] indent_style=space tab_width=2 diff --git a/.github/command-runner/comment.cjs b/.github/command-runner/comment.cjs index 05b11f98..13c07b8b 100644 --- a/.github/command-runner/comment.cjs +++ b/.github/command-runner/comment.cjs @@ -1,27 +1,27 @@ module.exports = class Comment { - constructor({ github, context, commentId }) { - this.github = github - this.context = context - this.commentId = commentId || null - } + constructor({ github, context, commentId }) { + this.github = github + this.context = context + this.commentId = commentId || null + } - async createOrUpdateComment(body) { - const actionUrl = `/~https://github.com/${this.context.payload.repository.full_name}/actions/runs/${this.context.runId}` - if (!this.commentId) { - const result = await this.github.rest.issues.createComment({ - issue_number: this.context.issue.number, - owner: this.context.repo.owner, - repo: this.context.repo.repo, - body: `${body}` + `\n[view details](${actionUrl})`, - }) - this.commentId = result.data.id - } - await this.github.rest.issues.updateComment({ - comment_id: this.commentId, - issue_number: this.context.issue.number, - owner: this.context.repo.owner, - repo: this.context.repo.repo, - body: `${body}` + `\n[view details](${actionUrl})`, - }) - } + async createOrUpdateComment(body) { + const actionUrl = `/~https://github.com/${this.context.payload.repository.full_name}/actions/runs/${this.context.runId}` + if (!this.commentId) { + const result = await this.github.rest.issues.createComment({ + issue_number: this.context.issue.number, + owner: this.context.repo.owner, + repo: this.context.repo.repo, + body: `${body}` + `\n[view details](${actionUrl})`, + }) + this.commentId = result.data.id + } + await this.github.rest.issues.updateComment({ + comment_id: this.commentId, + issue_number: this.context.issue.number, + owner: this.context.repo.owner, + repo: this.context.repo.repo, + body: `${body}` + `\n[view details](${actionUrl})`, + }) + } } diff --git a/.github/command-runner/merge.cjs b/.github/command-runner/merge.cjs index 4cecb773..81a4fe8e 100644 --- a/.github/command-runner/merge.cjs +++ b/.github/command-runner/merge.cjs @@ -1,12 +1,12 @@ module.exports = async ({ github, context, command, core, commentId }) => { - const Comment = require('./comment.cjs') - const comment = new Comment({ github, context, commentId }) + const Comment = require('./comment.cjs') + const comment = new Comment({ github, context, commentId }) - if (command === 'merge') { - console.log('Run merge') + if (command === 'merge') { + console.log('Run merge') - const { repository } = await github.graphql( - ` + const { repository } = await github.graphql( + ` query($owner: String!, $repo: String!, $pullNumber: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $pullNumber) { @@ -15,16 +15,16 @@ module.exports = async ({ github, context, command, core, commentId }) => { } } `, - { - ...context.repo, - pullNumber: context.issue.number, - }, - ) + { + ...context.repo, + pullNumber: context.issue.number, + }, + ) - const pullRequestId = repository.pullRequest.id + const pullRequestId = repository.pullRequest.id - await github.graphql( - ` + await github.graphql( + ` mutation($pullRequestId: ID!) { enablePullRequestAutoMerge(input: { pullRequestId: $pullRequestId, mergeMethod: SQUASH }) { pullRequest { @@ -35,39 +35,39 @@ module.exports = async ({ github, context, command, core, commentId }) => { } } `, - { - pullRequestId: pullRequestId, - }, - ) + { + pullRequestId: pullRequestId, + }, + ) - const pendingReview = await github.rest.pulls.createReview({ - ...context.repo, - pull_number: context.issue.number, - }) + const pendingReview = await github.rest.pulls.createReview({ + ...context.repo, + pull_number: context.issue.number, + }) - await github.rest.pulls.submitReview({ - ...context.repo, - pull_number: context.issue.number, - event: 'APPROVE', - review_id: pendingReview.data.id, - }) + await github.rest.pulls.submitReview({ + ...context.repo, + pull_number: context.issue.number, + event: 'APPROVE', + review_id: pendingReview.data.id, + }) - await comment.createOrUpdateComment(` Auto-merge enabled`) - core.info('Auto-merge enabled') - return - } + await comment.createOrUpdateComment(` Auto-merge enabled`) + core.info('Auto-merge enabled') + return + } - if (command === 'cancel-merge') { - console.log('Run cancel-merge') - await github.rest.pulls.submitReview({ - ...context.repo, - pull_number: context.issue.number, - event: 'REQUEST_CHANGES', - body: 'Dismissed', - }) + if (command === 'cancel-merge') { + console.log('Run cancel-merge') + await github.rest.pulls.submitReview({ + ...context.repo, + pull_number: context.issue.number, + event: 'REQUEST_CHANGES', + body: 'Dismissed', + }) - const { repository } = await github.graphql( - ` + const { repository } = await github.graphql( + ` query($owner: String!, $repo: String!, $pullNumber: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $pullNumber) { @@ -76,16 +76,16 @@ module.exports = async ({ github, context, command, core, commentId }) => { } } `, - { - ...context.repo, - pullNumber: context.issue.number, - }, - ) + { + ...context.repo, + pullNumber: context.issue.number, + }, + ) - const pullRequestId = repository.pullRequest.id + const pullRequestId = repository.pullRequest.id - await github.graphql( - ` + await github.graphql( + ` mutation($pullRequestId: ID!) { disablePullRequestAutoMerge(input: { pullRequestId: $pullRequestId }) { pullRequest { @@ -95,13 +95,13 @@ module.exports = async ({ github, context, command, core, commentId }) => { } } `, - { - pullRequestId: pullRequestId, - }, - ) - await comment.createOrUpdateComment(` Auto-merge disabled`) + { + pullRequestId: pullRequestId, + }, + ) + await comment.createOrUpdateComment(` Auto-merge disabled`) - core.info('Auto-merge disabled') - return - } + core.info('Auto-merge disabled') + return + } } diff --git a/.github/command-runner/postBump.cjs b/.github/command-runner/postBump.cjs index 0a51fc2b..0ecb2603 100644 --- a/.github/command-runner/postBump.cjs +++ b/.github/command-runner/postBump.cjs @@ -1,32 +1,32 @@ module.exports = async ({ github, context, exec, commentId, core, testResult }) => { - const Comment = require('./comment.cjs') - const comment = new Comment({ github, context, commentId }) + const Comment = require('./comment.cjs') + const comment = new Comment({ github, context, commentId }) - if (testResult !== 'success') { - return comment.createOrUpdateComment(` Test failed`) - } + if (testResult !== 'success') { + return comment.createOrUpdateComment(` Test failed`) + } - const diffResult = await exec.exec('git diff --exit-code', null, { ignoreReturnCode: true }) + const diffResult = await exec.exec('git diff --exit-code', null, { ignoreReturnCode: true }) - if (!diffResult) { - core.info('KNOWN_GOOD_BLOCK_NUMBERS.env not updated') - return comment.createOrUpdateComment(` KNOWN_GOOD_BLOCK_NUMBERS.env not updated`) - } + if (!diffResult) { + core.info('KNOWN_GOOD_BLOCK_NUMBERS.env not updated') + return comment.createOrUpdateComment(` KNOWN_GOOD_BLOCK_NUMBERS.env not updated`) + } - await exec.exec(`git config --global user.name 'github-actions[bot]'`) - await exec.exec(`git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'`) - await exec.exec(`git add KNOWN_GOOD_BLOCK_NUMBERS.env`) - await exec.exec(`git`, ['commit', '-am', '[ci skip] Update KNOWN_GOOD_BLOCK_NUMBERS']) - await exec.exec('git push') + await exec.exec(`git config --global user.name 'github-actions[bot]'`) + await exec.exec(`git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'`) + await exec.exec(`git add KNOWN_GOOD_BLOCK_NUMBERS.env`) + await exec.exec(`git`, ['commit', '-am', '[ci skip] Update KNOWN_GOOD_BLOCK_NUMBERS']) + await exec.exec('git push') - let commitId = '' - await exec.exec('git', ['rev-parse', 'HEAD'], { - listeners: { - stdout: (data) => { - commitId += data.toString() - }, - }, - }) + let commitId = '' + await exec.exec('git', ['rev-parse', 'HEAD'], { + listeners: { + stdout: (data) => { + commitId += data.toString() + }, + }, + }) - return comment.createOrUpdateComment(`**KNOWN_GOOD_BLOCK_NUMBERS.env has been updated**
**Commit**: ${commitId}`) + return comment.createOrUpdateComment(`**KNOWN_GOOD_BLOCK_NUMBERS.env has been updated**
**Commit**: ${commitId}`) } diff --git a/.github/command-runner/runOrBump.cjs b/.github/command-runner/runOrBump.cjs index 2b0cbdc6..9f1bba72 100644 --- a/.github/command-runner/runOrBump.cjs +++ b/.github/command-runner/runOrBump.cjs @@ -1,139 +1,139 @@ module.exports = async ({ github, core, context, commentId, exec, env, command, args }) => { - const Comment = require('./comment.cjs') - const comment = new Comment({ github, context, commentId }) - const { runCommand, createResult, writeNewEnv } = require('./utils.cjs') - - const excuteUpdateKnownGood = async () => { - const execCommand = `yarn update-known-good` - const result = await runCommand({ cmd: execCommand, comment, exec }) - - if (result.exitCode) { - core.setFailed('Failed to update known good blocks') - await comment.createOrUpdateComment( - createResult({ - context, - command: execCommand, - result: `${result.errorOutput}\n${result.output}`, - extra: `**Test Result**: \`Failed to update known good blocks\``, - }), - ) - - process.exit(1) - } - - return result - } - - const excuteTest = async ({ update, env }) => { - const execCommand = update - ? `yarn test --reporter default ${update ? '-u' : ''}` - : `yarn test --reporter default ${args.trim()}` - - const result = await runCommand({ cmd: execCommand, comment, exec }) - - if (result.exitCode) { - core.setFailed('Tests failed') - await comment.createOrUpdateComment( - createResult({ - context, - command: execCommand, - result: `${env ? `${env}\n` : ''}${result.errorOutput}\n${result.output}`, - extra: `**Test Result**: \`Failed\``, - }), - ) - process.exit(1) - } - - return result - } - - if (command === 'run') { - const updateKnownGoodResult = await excuteUpdateKnownGood() - - let newEnv = updateKnownGoodResult.output - - if (env) { - newEnv = writeNewEnv({ env }) - } - - const testResult = await excuteTest({ update: false, env: newEnv }) - core.info('Tests Passed') - const output = `${newEnv}\n${testResult.output}` - return comment.createOrUpdateComment( - createResult({ - context, - command: testResult.cmd, - result: output, - extra: `**Test Result**: \`Passed\``, - }), - ) - } - - if (command === 'bump') { - if (env.trim().length) { - core.setFailed('env is not supported in bump command') - return comment.createOrUpdateComment(` ENV is not supported in bump command`) - } - - const updateKnownGoodResult = await excuteUpdateKnownGood() - - await exec.exec(`git config --global user.name 'github-actions[bot]'`) - await exec.exec(`git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'`) - await exec.exec(`git add KNOWN_GOOD_BLOCK_NUMBERS.env`) - const diffCachedResult = await exec.exec('git diff --cached --exit-code', null, { ignoreReturnCode: true }) - - if (!diffCachedResult) { - core.setFailed('KNOWN_GOOD_BLOCK_NUMBERS.env not updated') - await comment.createOrUpdateComment(` **KNOWN_GOOD_BLOCK_NUMBERS.env not updated**`) - process.exit(1) - } - - const testResult = await excuteTest({ update: true, env: updateKnownGoodResult.output }) - const output = `${updateKnownGoodResult.output}\n${testResult.output}` - - const diffResult = await exec.exec('git diff --exit-code', null, { ignoreReturnCode: true }) - - if (!diffResult) { - core.info('snapshot not updated') - // dispatch update-known-good workflow to having it to update the snapshot - await github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'update-known-good.yml', - ref: 'master', - }) - - return comment.createOrUpdateComment( - createResult({ - context, - command: testResult.cmd, - result: output, - extra: `
Triggered update-known-good workflow to update the snapshot`, - }), - ) - } - const branchName = `Update-SnapShot-${commentId}` - await exec.exec(`git checkout -b ${branchName}`) - await exec.exec(`git`, ['commit', '-am', '[ci skip] Update snapshots']) - - const commentUrl = `/~https://github.com/${context.payload.repository.full_name}/issues/${context.issue.number}#issuecomment-${commentId}` - await exec.exec(`git push origin HEAD:${branchName}`) - const result = await github.rest.pulls.create({ - owner: context.repo.owner, - repo: context.repo.repo, - title: branchName, - head: branchName, - base: 'master', - body: `Update Snapshots (${commentUrl})`, - }) - core.info(`The Pull request #${result.data.number} has been created to update the snapshot`) - return comment.createOrUpdateComment( - createResult({ - context, - command: testResult.cmd, - result: output, - extra: `
**The Pull request #${result.data.number} has been created to update the snapshot**`, - }), - ) - } + const Comment = require('./comment.cjs') + const comment = new Comment({ github, context, commentId }) + const { runCommand, createResult, writeNewEnv } = require('./utils.cjs') + + const excuteUpdateKnownGood = async () => { + const execCommand = `yarn update-known-good` + const result = await runCommand({ cmd: execCommand, comment, exec }) + + if (result.exitCode) { + core.setFailed('Failed to update known good blocks') + await comment.createOrUpdateComment( + createResult({ + context, + command: execCommand, + result: `${result.errorOutput}\n${result.output}`, + extra: `**Test Result**: \`Failed to update known good blocks\``, + }), + ) + + process.exit(1) + } + + return result + } + + const excuteTest = async ({ update, env }) => { + const execCommand = update + ? `yarn test --reporter default ${update ? '-u' : ''}` + : `yarn test --reporter default ${args.trim()}` + + const result = await runCommand({ cmd: execCommand, comment, exec }) + + if (result.exitCode) { + core.setFailed('Tests failed') + await comment.createOrUpdateComment( + createResult({ + context, + command: execCommand, + result: `${env ? `${env}\n` : ''}${result.errorOutput}\n${result.output}`, + extra: `**Test Result**: \`Failed\``, + }), + ) + process.exit(1) + } + + return result + } + + if (command === 'run') { + const updateKnownGoodResult = await excuteUpdateKnownGood() + + let newEnv = updateKnownGoodResult.output + + if (env) { + newEnv = writeNewEnv({ env }) + } + + const testResult = await excuteTest({ update: false, env: newEnv }) + core.info('Tests Passed') + const output = `${newEnv}\n${testResult.output}` + return comment.createOrUpdateComment( + createResult({ + context, + command: testResult.cmd, + result: output, + extra: `**Test Result**: \`Passed\``, + }), + ) + } + + if (command === 'bump') { + if (env.trim().length) { + core.setFailed('env is not supported in bump command') + return comment.createOrUpdateComment(` ENV is not supported in bump command`) + } + + const updateKnownGoodResult = await excuteUpdateKnownGood() + + await exec.exec(`git config --global user.name 'github-actions[bot]'`) + await exec.exec(`git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'`) + await exec.exec(`git add KNOWN_GOOD_BLOCK_NUMBERS.env`) + const diffCachedResult = await exec.exec('git diff --cached --exit-code', null, { ignoreReturnCode: true }) + + if (!diffCachedResult) { + core.setFailed('KNOWN_GOOD_BLOCK_NUMBERS.env not updated') + await comment.createOrUpdateComment(` **KNOWN_GOOD_BLOCK_NUMBERS.env not updated**`) + process.exit(1) + } + + const testResult = await excuteTest({ update: true, env: updateKnownGoodResult.output }) + const output = `${updateKnownGoodResult.output}\n${testResult.output}` + + const diffResult = await exec.exec('git diff --exit-code', null, { ignoreReturnCode: true }) + + if (!diffResult) { + core.info('snapshot not updated') + // dispatch update-known-good workflow to having it to update the snapshot + await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'update-known-good.yml', + ref: 'master', + }) + + return comment.createOrUpdateComment( + createResult({ + context, + command: testResult.cmd, + result: output, + extra: `
Triggered update-known-good workflow to update the snapshot`, + }), + ) + } + const branchName = `Update-SnapShot-${commentId}` + await exec.exec(`git checkout -b ${branchName}`) + await exec.exec(`git`, ['commit', '-am', '[ci skip] Update snapshots']) + + const commentUrl = `/~https://github.com/${context.payload.repository.full_name}/issues/${context.issue.number}#issuecomment-${commentId}` + await exec.exec(`git push origin HEAD:${branchName}`) + const result = await github.rest.pulls.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: branchName, + head: branchName, + base: 'master', + body: `Update Snapshots (${commentUrl})`, + }) + core.info(`The Pull request #${result.data.number} has been created to update the snapshot`) + return comment.createOrUpdateComment( + createResult({ + context, + command: testResult.cmd, + result: output, + extra: `
**The Pull request #${result.data.number} has been created to update the snapshot**`, + }), + ) + } } diff --git a/.github/command-runner/utils.cjs b/.github/command-runner/utils.cjs index 967d2f7a..ad5b9031 100644 --- a/.github/command-runner/utils.cjs +++ b/.github/command-runner/utils.cjs @@ -1,5 +1,5 @@ function createResult({ command, context, result, extra }) { - return `**Request**: \`${context.payload.comment.body.trim()}\` + return `**Request**: \`${context.payload.comment.body.trim()}\` **Command**: \`${command}\` ${extra} @@ -14,37 +14,37 @@ ${result} } async function runCommand({ cmd, comment, exec }) { - let output = '' - let errorOutput = '' - await comment.createOrUpdateComment(`Running: \`${cmd}\``) - - const exitCode = await exec.exec(cmd, null, { - ignoreReturnCode: true, - listeners: { - stdline: (data) => { - output += `${data}\n` - }, - errline: (data) => { - errorOutput += `${data}\n` - }, - }, - }) - - return { - output: output.replace(new RegExp(`${ANSI_ESCAPE}\\[[0-9;]*m`, 'g'), ''), - errorOutput: errorOutput.replace(new RegExp(`${ANSI_ESCAPE}\\[[0-9;]*m`, 'g'), ''), - exitCode, - cmd, - } + let output = '' + let errorOutput = '' + await comment.createOrUpdateComment(`Running: \`${cmd}\``) + + const exitCode = await exec.exec(cmd, null, { + ignoreReturnCode: true, + listeners: { + stdline: (data) => { + output += `${data}\n` + }, + errline: (data) => { + errorOutput += `${data}\n` + }, + }, + }) + + return { + output: output.replace(new RegExp(`${ANSI_ESCAPE}\\[[0-9;]*m`, 'g'), ''), + errorOutput: errorOutput.replace(new RegExp(`${ANSI_ESCAPE}\\[[0-9;]*m`, 'g'), ''), + exitCode, + cmd, + } } function writeNewEnv({ env }) { - const fs = require('node:fs') + const fs = require('node:fs') - const envContent = fs.readFileSync('KNOWN_GOOD_BLOCK_NUMBERS.env', 'utf8').toString() + const envContent = fs.readFileSync('KNOWN_GOOD_BLOCK_NUMBERS.env', 'utf8').toString() - fs.writeFileSync('.env', env) - return `# .env + fs.writeFileSync('.env', env) + return `# .env ${env} # KNOWN_GOOD_BLOCK_NUMBERS.env @@ -53,7 +53,7 @@ ${envContent} } module.exports = { - createResult, - runCommand, - writeNewEnv, + createResult, + runCommand, + writeNewEnv, }