diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3dcf2c92..ee5fd367 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,10 @@ jobs: with: node-version: 20 cache: "pnpm" + - run: | + touch .env + echo GH_COMMIT_SHA="${{ github.event.pull_request.head.sha }}" >> .env + echo CODECOV_TOKEN="${{ secrets.CODECOV_TOKEN }}" >> .env - run: pnpm install - run: pnpm build - run: pnpm compile diff --git a/.gitignore b/.gitignore index 694f1381..dc540d7d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ node_modules .turbo dist coverage -_PipelineMapping/ \ No newline at end of file +_PipelineMapping/ +.env \ No newline at end of file diff --git a/package.json b/package.json index 306718a0..51afb2c9 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ }, "resolutions": { "@polkadot/types-codec": "^12.4.2", - "@polkadot/api": "^12.4.2" + "@polkadot/api": "^12.4.2", + "@crypto-dex-sdk/chain": "0.1.2" }, "scripts": { "compile": "turbo run compile", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 9d71f81a..f9fbc3bd 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -48,10 +48,12 @@ "devDependencies": { "@babel/plugin-syntax-import-assertions": "^7.25.6", "@babel/preset-env": "^7.25.4", + "@codecov/rollup-plugin": "0.0.1-beta.12", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-json": "^6.1.0", "@types/node": "^22.5.1", "@vitest/coverage-v8": "^2.0.5", + "dotenv": "^16.4.5", "prettier": "^3.3.3", "rollup": "^4.21.1", "rollup-plugin-dts": "^6.1.1", diff --git a/packages/sdk/rollup.config.js b/packages/sdk/rollup.config.js index 0aada8c9..503988af 100644 --- a/packages/sdk/rollup.config.js +++ b/packages/sdk/rollup.config.js @@ -2,6 +2,10 @@ import typescript from 'rollup-plugin-typescript2' import json from '@rollup/plugin-json' import dts from 'rollup-plugin-dts' import { babel } from '@rollup/plugin-babel' +import { codecovRollupPlugin } from '@codecov/rollup-plugin' +import { config } from 'dotenv' + +config({ path: '../../.env' }) export default [ { @@ -19,6 +23,15 @@ export default [ plugins: ['@babel/plugin-syntax-import-assertions'], babelHelpers: 'bundled', presets: ['@babel/preset-env'] + }), + codecovRollupPlugin({ + enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined, + bundleName: 'sdk', + uploadToken: process.env.CODECOV_TOKEN, + debug: true, + uploadOverrides: { + sha: process.env.GH_COMMIT_SHA + } }) ] }, diff --git a/packages/xcm-analyser/package.json b/packages/xcm-analyser/package.json index e5631873..fae4e948 100644 --- a/packages/xcm-analyser/package.json +++ b/packages/xcm-analyser/package.json @@ -35,9 +35,11 @@ "zod": "^3.23.8" }, "devDependencies": { + "@codecov/rollup-plugin": "0.0.1-beta.12", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-json": "^6.1.0", "@vitest/coverage-v8": "^2.0.5", + "dotenv": "^16.4.5", "rollup": "^4.21.1", "rollup-plugin-dts": "^6.1.1", "rollup-plugin-typescript2": "^0.36.0", diff --git a/packages/xcm-analyser/rollup.config.js b/packages/xcm-analyser/rollup.config.js index f877c1f1..57443cb4 100644 --- a/packages/xcm-analyser/rollup.config.js +++ b/packages/xcm-analyser/rollup.config.js @@ -2,6 +2,10 @@ import typescript from 'rollup-plugin-typescript2'; import json from '@rollup/plugin-json'; import dts from 'rollup-plugin-dts'; import { babel } from '@rollup/plugin-babel'; +import { codecovRollupPlugin } from '@codecov/rollup-plugin'; +import { config } from 'dotenv'; + +config({ path: '../../.env' }); export default [ { @@ -17,6 +21,14 @@ export default [ babelHelpers: 'bundled', presets: ['@babel/preset-env'], }), + codecovRollupPlugin({ + enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined, + bundleName: 'xcm-analyser', + uploadToken: process.env.CODECOV_TOKEN, + uploadOverrides: { + sha: process.env.GH_COMMIT_SHA, + }, + }), ], }, { diff --git a/packages/xcm-router/package.json b/packages/xcm-router/package.json index 02bd8958..b798fb2f 100644 --- a/packages/xcm-router/package.json +++ b/packages/xcm-router/package.json @@ -71,11 +71,13 @@ "@babel/core": "^7.25.2", "@babel/plugin-syntax-import-assertions": "^7.25.6", "@babel/preset-env": "^7.25.4", + "@codecov/rollup-plugin": "0.0.1-beta.12", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-json": "^6.1.0", "@types/lodash-es": "^4.17.12", "@types/node": "^22.5.1", "@vitest/coverage-v8": "^2.0.5", + "dotenv": "^16.4.5", "prettier": "^3.3.3", "rollup": "^4.21.1", "rollup-plugin-dts": "^6.1.1", diff --git a/packages/xcm-router/rollup.config.js b/packages/xcm-router/rollup.config.js index f877c1f1..2af0bcb9 100644 --- a/packages/xcm-router/rollup.config.js +++ b/packages/xcm-router/rollup.config.js @@ -2,6 +2,10 @@ import typescript from 'rollup-plugin-typescript2'; import json from '@rollup/plugin-json'; import dts from 'rollup-plugin-dts'; import { babel } from '@rollup/plugin-babel'; +import { codecovRollupPlugin } from '@codecov/rollup-plugin'; +import { config } from 'dotenv'; + +config({ path: '../../.env' }); export default [ { @@ -17,6 +21,14 @@ export default [ babelHelpers: 'bundled', presets: ['@babel/preset-env'], }), + codecovRollupPlugin({ + enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined, + bundleName: 'xcm-router', + uploadToken: process.env.CODECOV_TOKEN, + uploadOverrides: { + sha: process.env.GH_COMMIT_SHA, + }, + }), ], }, { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8bf16c8a..e5371765 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,7 @@ settings: overrides: '@polkadot/types-codec': ^12.4.2 '@polkadot/api': ^12.4.2 + '@crypto-dex-sdk/chain': 0.1.2 importers: @@ -615,6 +616,9 @@ importers: '@babel/preset-env': specifier: ^7.25.4 version: 7.25.4(@babel/core@7.25.2) + '@codecov/rollup-plugin': + specifier: 0.0.1-beta.12 + version: 0.0.1-beta.12(rollup@4.21.1) '@rollup/plugin-babel': specifier: ^6.0.4 version: 6.0.4(@babel/core@7.25.2)(@types/babel__core@7.20.5)(rollup@4.21.1) @@ -627,6 +631,9 @@ importers: '@vitest/coverage-v8': specifier: ^2.0.5 version: 2.0.5(vitest@2.0.5(@types/node@22.5.1)(jsdom@25.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(sugarss@4.0.1(postcss@8.4.41))(terser@5.31.0)) + dotenv: + specifier: ^16.4.5 + version: 16.4.5 prettier: specifier: ^3.3.3 version: 3.3.3 @@ -652,6 +659,9 @@ importers: specifier: ^3.23.8 version: 3.23.8 devDependencies: + '@codecov/rollup-plugin': + specifier: 0.0.1-beta.12 + version: 0.0.1-beta.12(rollup@4.21.1) '@rollup/plugin-babel': specifier: ^6.0.4 version: 6.0.4(@babel/core@7.25.2)(@types/babel__core@7.20.5)(rollup@4.21.1) @@ -661,6 +671,9 @@ importers: '@vitest/coverage-v8': specifier: ^2.0.5 version: 2.0.5(vitest@2.0.5(@types/node@22.5.1)(jsdom@25.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(sugarss@4.0.1(postcss@8.4.41))(terser@5.31.0)) + dotenv: + specifier: ^16.4.5 + version: 16.4.5 rollup: specifier: ^4.21.1 version: 4.21.1 @@ -701,7 +714,7 @@ importers: specifier: ^0.1.2 version: 0.1.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@crypto-dex-sdk/chain': - specifier: ^0.1.2 + specifier: 0.1.2 version: 0.1.2 '@crypto-dex-sdk/currency': specifier: ^0.1.2 @@ -785,6 +798,9 @@ importers: '@babel/preset-env': specifier: ^7.25.4 version: 7.25.4(@babel/core@7.25.2) + '@codecov/rollup-plugin': + specifier: 0.0.1-beta.12 + version: 0.0.1-beta.12(rollup@4.21.1) '@rollup/plugin-babel': specifier: ^6.0.4 version: 6.0.4(@babel/core@7.25.2)(@types/babel__core@7.20.5)(rollup@4.21.1) @@ -800,6 +816,9 @@ importers: '@vitest/coverage-v8': specifier: ^2.0.5 version: 2.0.5(vitest@2.0.5(@types/node@22.5.1)(jsdom@25.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(sugarss@4.0.1(postcss@8.4.41))(terser@5.31.0)) + dotenv: + specifier: ^16.4.5 + version: 16.4.5 prettier: specifier: ^3.3.3 version: 3.3.3 @@ -1853,6 +1872,16 @@ packages: peerDependencies: '@polkadot/api': ^12.4.2 + '@codecov/bundler-plugin-core@0.0.1-beta.12': + resolution: {integrity: sha512-QZOVp90ZtSCj6p5AO8rnSzee7E4T6PeA5XXd8/miggK5Mi9OtcuB0N1zTPDp3ry5lLLbeWTcdxNVGGnqMHfz8w==} + engines: {node: '>=18.0.0'} + + '@codecov/rollup-plugin@0.0.1-beta.12': + resolution: {integrity: sha512-9URNaTEOgVmCCyXjA/W1msJ3qEnvc65GMYwPAWrHlk9jTI1ASvA4WpeOpEPCbFRBjVPPFg6c+2wGaTHatXMLaw==} + engines: {node: '>=18.0.0'} + peerDependencies: + rollup: 3.x || 4.x + '@colors/colors@1.5.0': resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} @@ -11191,6 +11220,19 @@ snapshots: dependencies: '@polkadot/api': 12.4.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@codecov/bundler-plugin-core@0.0.1-beta.12': + dependencies: + chalk: 4.1.2 + semver: 7.6.3 + unplugin: 1.12.0 + zod: 3.23.8 + + '@codecov/rollup-plugin@0.0.1-beta.12(rollup@4.21.1)': + dependencies: + '@codecov/bundler-plugin-core': 0.0.1-beta.12 + rollup: 4.21.1 + unplugin: 1.12.0 + '@colors/colors@1.5.0': optional: true @@ -13856,7 +13898,7 @@ snapshots: '@noble/hashes': 1.4.0 '@polkadot/networks': 12.6.2 '@polkadot/util': 12.6.2 - '@polkadot/wasm-crypto': 7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2))) + '@polkadot/wasm-crypto': 7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2))) '@polkadot/wasm-util': 7.3.2(@polkadot/util@12.6.2) '@polkadot/x-bigint': 12.6.2 '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)) @@ -13966,11 +14008,11 @@ snapshots: '@polkadot/util': 10.4.2 '@polkadot/x-randomvalues': 10.4.2 - '@polkadot/wasm-bridge@7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)))': + '@polkadot/wasm-bridge@7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)))': dependencies: '@polkadot/util': 12.6.2 '@polkadot/wasm-util': 7.3.2(@polkadot/util@12.6.2) - '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)) + '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)) tslib: 2.7.0 '@polkadot/wasm-bridge@7.3.2(@polkadot/util@13.0.2)(@polkadot/x-randomvalues@13.0.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)))': @@ -14014,14 +14056,14 @@ snapshots: '@polkadot/wasm-crypto-wasm': 6.4.1(@polkadot/util@10.4.2) '@polkadot/x-randomvalues': 10.4.2 - '@polkadot/wasm-crypto-init@7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)))': + '@polkadot/wasm-crypto-init@7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)))': dependencies: '@polkadot/util': 12.6.2 - '@polkadot/wasm-bridge': 7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2))) + '@polkadot/wasm-bridge': 7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2))) '@polkadot/wasm-crypto-asmjs': 7.3.2(@polkadot/util@12.6.2) '@polkadot/wasm-crypto-wasm': 7.3.2(@polkadot/util@12.6.2) '@polkadot/wasm-util': 7.3.2(@polkadot/util@12.6.2) - '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)) + '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)) tslib: 2.7.0 '@polkadot/wasm-crypto-init@7.3.2(@polkadot/util@13.0.2)(@polkadot/x-randomvalues@13.0.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)))': @@ -14089,15 +14131,15 @@ snapshots: '@polkadot/wasm-util': 6.4.1(@polkadot/util@10.4.2) '@polkadot/x-randomvalues': 10.4.2 - '@polkadot/wasm-crypto@7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)))': + '@polkadot/wasm-crypto@7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)))': dependencies: '@polkadot/util': 12.6.2 - '@polkadot/wasm-bridge': 7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2))) + '@polkadot/wasm-bridge': 7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2))) '@polkadot/wasm-crypto-asmjs': 7.3.2(@polkadot/util@12.6.2) - '@polkadot/wasm-crypto-init': 7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2))) + '@polkadot/wasm-crypto-init': 7.3.2(@polkadot/util@12.6.2)(@polkadot/x-randomvalues@12.6.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2))) '@polkadot/wasm-crypto-wasm': 7.3.2(@polkadot/util@12.6.2) '@polkadot/wasm-util': 7.3.2(@polkadot/util@12.6.2) - '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@12.6.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)) + '@polkadot/x-randomvalues': 12.6.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)) tslib: 2.7.0 '@polkadot/wasm-crypto@7.3.2(@polkadot/util@13.0.2)(@polkadot/x-randomvalues@13.0.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2)))': @@ -14197,6 +14239,13 @@ snapshots: '@polkadot/x-global': 12.6.2 tslib: 2.7.0 + '@polkadot/x-randomvalues@12.6.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2))': + dependencies: + '@polkadot/util': 13.0.2 + '@polkadot/wasm-util': 7.3.2(@polkadot/util@13.0.2) + '@polkadot/x-global': 12.6.2 + tslib: 2.7.0 + '@polkadot/x-randomvalues@13.0.2(@polkadot/util@13.0.2)(@polkadot/wasm-util@7.3.2(@polkadot/util@13.0.2))': dependencies: '@polkadot/util': 13.0.2 @@ -20259,7 +20308,7 @@ snapshots: terser@5.31.0: dependencies: '@jridgewell/source-map': 0.3.6 - acorn: 8.11.3 + acorn: 8.12.1 commander: 2.20.3 source-map-support: 0.5.21 diff --git a/turbo.json b/turbo.json index 6b73ef83..5b2dea5f 100644 --- a/turbo.json +++ b/turbo.json @@ -14,6 +14,7 @@ "test:integration": {}, "test:e2e": {}, "build": { + "cache": false, "outputs": ["dist/**"], "dependsOn": ["^build"] }