From 9fcee857ed25983f130855bdd228a14c7db9b232 Mon Sep 17 00:00:00 2001 From: Konstantin Astakhov Date: Tue, 2 Apr 2024 13:02:18 +0700 Subject: [PATCH] ts-node-esm --- .github/workflows/forkless-update-data.yml | 2 +- .github/workflows/forkless-update-nodata.yml | 2 +- .github/workflows/make-bench.yml | 4 ++-- .github/workflows/xcm.yml | 2 +- .github/workflows/yarn-dev.yml | 4 ++-- js-packages/package.json | 6 +++--- js-packages/scripts/package.json | 12 ++++++------ .../tests/migrations/942057-appPromotion/README.md | 2 +- js-packages/tests/package.json | 6 +++--- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/forkless-update-data.yml b/.github/workflows/forkless-update-data.yml index f7d3b5eff2..1f6692e468 100644 --- a/.github/workflows/forkless-update-data.yml +++ b/.github/workflows/forkless-update-data.yml @@ -152,7 +152,7 @@ jobs: yarn ../scripts/wait_for_first_block.sh echo "Executing upgrade" - yarn node --loader ts-node/esm util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm + yarn ts-node-esm util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} diff --git a/.github/workflows/forkless-update-nodata.yml b/.github/workflows/forkless-update-nodata.yml index f17408fd5e..1b1b9b4ea7 100644 --- a/.github/workflows/forkless-update-nodata.yml +++ b/.github/workflows/forkless-update-nodata.yml @@ -167,7 +167,7 @@ jobs: yarn ../scripts/wait_for_first_block.sh echo "Executing upgrade" - yarn node --loader ts-node/esm util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm + yarn ts-node-esm util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm env: RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }} diff --git a/.github/workflows/make-bench.yml b/.github/workflows/make-bench.yml index 6c6e40aee2..8331c6d9d8 100644 --- a/.github/workflows/make-bench.yml +++ b/.github/workflows/make-bench.yml @@ -50,8 +50,8 @@ jobs: working-directory: js-packages/scripts run: | yarn - yarn node --loader ts-node/esm calibrate.ts - yarn node --loader ts-node/esm calibrateApply.ts + yarn ts-node-esm calibrate.ts + yarn ts-node-esm calibrateApply.ts - name: show git diff run: | diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index f1a5d8eab6..bc8c4cf019 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -336,7 +336,7 @@ jobs: - name: Call HRMP initialization working-directory: js-packages/tests run: | - yarn node --loader ts-node/esm util/createHrmp.ts ${{matrix.network}} + yarn ts-node-esm util/createHrmp.ts ${{matrix.network}} - name: Run XCM tests working-directory: js-packages/tests diff --git a/.github/workflows/yarn-dev.yml b/.github/workflows/yarn-dev.yml index 46c41e5288..dcbbb3b13b 100644 --- a/.github/workflows/yarn-dev.yml +++ b/.github/workflows/yarn-dev.yml @@ -91,13 +91,13 @@ jobs: working-directory: js-packages/scripts run: | yarn install - npx node --loader ts-node/esm ./benchmarks/mintFee/index.ts + npx ts-node-esm ./benchmarks/mintFee/index.ts - name: Run benchmark opsFee tests working-directory: js-packages/scripts run: | yarn install - npx node --loader ts-node/esm ./benchmarks/opsFee/index.ts + npx ts-node-esm ./benchmarks/opsFee/index.ts - name: Stop running containers if: always() # run this step always diff --git a/js-packages/package.json b/js-packages/package.json index 0fda3c76a8..9bda845ff5 100644 --- a/js-packages/package.json +++ b/js-packages/package.json @@ -45,9 +45,9 @@ "prepublish": "yarn tsc", "lint": "eslint --ext .ts .", "fix": "yarn lint --fix", - "polkadot-types-fetch-metadata": "yarn node --loader ts-node/esm scripts/fetchMetadata.ts", - "polkadot-types-from-defs": "node --loader ts-node/esm ./node_modules/.bin/polkadot-types-from-defs --endpoint scripts/metadata.json --input types/ --package .", - "polkadot-types-from-chain": "node --loader ts-node/esm ./node_modules/.bin/polkadot-types-from-chain --endpoint scripts/metadata.json --output types/ --package .", + "polkadot-types-fetch-metadata": "yarn ts-node-esm scripts/fetchMetadata.ts", + "polkadot-types-from-defs": "ts-node-esm ./node_modules/.bin/polkadot-types-from-defs --endpoint scripts/metadata.json --input types/ --package .", + "polkadot-types-from-chain": "ts-node-esm ./node_modules/.bin/polkadot-types-from-chain --endpoint scripts/metadata.json --output types/ --package .", "polkadot-types": "echo \"export default {}\" > types/lookup.ts && yarn polkadot-types-fetch-metadata && yarn polkadot-types-from-defs && yarn polkadot-types-from-defs && yarn polkadot-types-from-chain && rm types/registry.ts" }, "resolutions": { diff --git a/js-packages/scripts/package.json b/js-packages/scripts/package.json index 68f9494197..51c1ab6906 100644 --- a/js-packages/scripts/package.json +++ b/js-packages/scripts/package.json @@ -10,11 +10,11 @@ "version": "1.0.0", "main": "", "scripts": { - "benchMintingFee": "yarn node --loader ts-node/esm benchmarks/mintFee/benchmark.ts", - "loadTransfer": "yarn node --loader ts-node/esm transfer.nload.ts", - "generateEnv": "yarn node --loader ts-node/esm ./generateEnv.ts", - "propose-upgrade": "yarn node --loader ts-node/esm ./proposeupgrade.ts", - "propose-fast-track": "yarn node --loader ts-node/esm ./proposefasttrack.ts", - "council-democracy-proposal": "yarn node --loader ts-node/esm ./councilproposal.ts" + "benchMintingFee": "yarn ts-node-esm benchmarks/mintFee/benchmark.ts", + "loadTransfer": "yarn ts-node-esm transfer.nload.ts", + "generateEnv": "yarn ts-node-esm ./generateEnv.ts", + "propose-upgrade": "yarn ts-node-esm ./proposeupgrade.ts", + "propose-fast-track": "yarn ts-node-esm ./proposefasttrack.ts", + "council-democracy-proposal": "yarn ts-node-esm ./councilproposal.ts" } } diff --git a/js-packages/tests/migrations/942057-appPromotion/README.md b/js-packages/tests/migrations/942057-appPromotion/README.md index 14b4d727b0..6ed601d05a 100644 --- a/js-packages/tests/migrations/942057-appPromotion/README.md +++ b/js-packages/tests/migrations/942057-appPromotion/README.md @@ -38,5 +38,5 @@ To run, you need to set an environment variables: Run the migration by executing the following command: ```sh -npx node --loader ts-node/esm executeMigration.ts +npx ts-node-esm executeMigration.ts ``` diff --git a/js-packages/tests/package.json b/js-packages/tests/package.json index ff31b65a1c..e463e004cd 100644 --- a/js-packages/tests/package.json +++ b/js-packages/tests/package.json @@ -13,9 +13,9 @@ "mocha": "^10.1.0" }, "scripts": { - "setup": "yarn node --loader ts-node/esm ./util/globalSetup.ts", - "setIdentities": "yarn node --loader ts-node/esm ./util/identitySetter.ts", - "checkRelayIdentities": "yarn node --loader ts-node/esm ./util/relayIdentitiesChecker.ts", + "setup": "yarn ts-node-esm ./util/globalSetup.ts", + "setIdentities": "yarn ts-node-esm ./util/identitySetter.ts", + "checkRelayIdentities": "yarn ts-node-esm ./util/relayIdentitiesChecker.ts", "_test": "yarn setup && yarn mocha --timeout 9999999 --loader ts-node/esm", "_testParallel": "yarn setup && yarn mocha --timeout 9999999 --parallel --loader ts-node/esm", "test": "yarn _test './**/*.*test.ts'",