difftreelog
fix nodejs error with esm module
in: master
14 files changed
.github/workflows/codestyle.ymldiffbeforeafterboth--- a/.github/workflows/codestyle.yml
+++ b/.github/workflows/codestyle.yml
@@ -40,7 +40,7 @@
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v3.5.1
with:
- node-version: 20
+ node-version: 20
- name: Install modules
run: cd js-packages && yarn
- name: Run ESLint
.github/workflows/collator-selection.ymldiffbeforeafterboth--- a/.github/workflows/collator-selection.yml
+++ b/.github/workflows/collator-selection.yml
@@ -146,7 +146,7 @@
- uses: actions/setup-node@v3.5.1
with:
- node-version: 20
+ node-version: 20
- name: Install baedeker
uses: UniqueNetwork/baedeker-action/setup@built
.github/workflows/forkless-update-data.ymldiffbeforeafterboth--- a/.github/workflows/forkless-update-data.yml
+++ b/.github/workflows/forkless-update-data.yml
@@ -122,7 +122,7 @@
- uses: actions/setup-node@v3.5.1
with:
- node-version: 20
+ node-version: 20
- name: Install baedeker
uses: UniqueNetwork/baedeker-action/setup@built
@@ -151,7 +151,7 @@
yarn
../scripts/wait_for_first_block.sh
echo "Executing upgrade"
- yarn ts-node --esm util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm
+ yarn node --no-warnings=ExperimentalWarning --loader 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 }}
.github/workflows/forkless-update-nodata.ymldiffbeforeafterboth1# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586837021/Forkless+update+without+data2# Forkless update without data replication34# Triger: only call from main workflow(re-usable workflows)5on:6 workflow_call:789# A workflow run is made up of one or more jobs that can run sequentially or in parallel10jobs:1112 prepare-execution-matrix:1314 name: execution matrix1516 runs-on: self-hosted-ci17 outputs:18 matrix: ${{ steps.create_matrix.outputs.matrix }}1920 steps:2122 - name: Clean Workspace23 uses: AutoModality/action-clean@v1.1.02425 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it26 - uses: actions/checkout@v3.1.027 with:28 ref: ${{ github.head_ref }} #Checking out head commit2930 - name: Read .env file31 uses: xom9ikk/dotenv@v23233 - name: Create Execution matrix34 uses: CertainLach/create-matrix-action@v435 id: create_matrix36 with:37 matrix: |38 network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, runtime_features {opal-runtime}, wasm_name {opal}39 network {sapphire}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}, runtime_features {sapphire-runtime}, wasm_name {quartz}40 network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, runtime_features {quartz-runtime}, wasm_name {quartz}41 network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, runtime_features {unique-runtime}, wasm_name {unique}4243 forkless-nodata:4445 needs: prepare-execution-matrix46 # The type of runner that the job will run on47 runs-on: [self-hosted-ci,large]4849 timeout-minutes: 13805051 name: ${{ matrix.network }}-nodata5253 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.5455 strategy:56 matrix:57 include: ${{fromJson(needs.prepare-execution-matrix.outputs.matrix)}}5859 steps:6061 - name: Clean Workspace62 uses: AutoModality/action-clean@v1.1.06364 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it65 - uses: actions/checkout@v3.1.066 with:67 ref: ${{ github.head_ref }} #Checking out head commit6869 # Prepare SHA 70 - name: Prepare SHA71 uses: ./.github/actions/prepare7273 - name: Read .env file74 uses: xom9ikk/dotenv@v27576 - name: Log in to Docker Hub77 uses: docker/login-action@v2.1.078 with:79 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}80 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}8182 - name: Generate ENV related extend Dockerfile file for POLKADOT83 uses: cuchi/jinja2-action@v1.2.084 with:85 template: .docker/Dockerfile-polkadot.j286 output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml87 variables: |88 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}89 POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}90 91 - name: Prepare polkadot92 uses: ./.github/actions/buildContainer93 id: polkadot94 with:95 container: uniquenetwork/builder-polkadot96 tag: ${{ matrix.relay_branch }}97 context: .docker98 dockerfile: Dockerfile-polkadot.${{ matrix.relay_branch }}.yml99 dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}100 dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}101102 - name: Prepare mainnet103 uses: ./.github/actions/buildContainer104 id: mainnet105 with:106 container: uniquenetwork/ci-nodata-${{ matrix.network }}107 tag: ${{ matrix.mainnet_branch }}108 context: .docker109 dockerfile: Dockerfile-unique-release110 args: |111 --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }}112 --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}113 --build-arg UNIQUE_VERSION=${{ matrix.mainnet_branch }}114 dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}115 dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}116117 - name: Prepare latest118 uses: ./.github/actions/buildContainer119 id: latest120 with:121 container: uniquenetwork/ci-nodata-${{ matrix.network }}122 tag: ${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}123 context: .124 dockerfile: .docker/Dockerfile-unique125 args: |126 --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }}127 --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}128 dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}129 dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}130131 - name: Extract wasms132 uses: ./.github/actions/extractDocker133 id: wasms134 with:135 image: ${{ steps.latest.outputs.name }}136 directory: /wasm137138 - uses: actions/setup-node@v3.5.1139 with:140 node-version: 20141142 - name: Install baedeker143 uses: UniqueNetwork/baedeker-action/setup@built144145 - name: Setup library146 run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library147148 - name: Start network149 uses: UniqueNetwork/baedeker-action@built150 id: bdk151 with:152 jpath: |153 .baedeker/vendor154 tla-str: |155 relay_spec=rococo-local156 inputs: |157 .baedeker/node-only.jsonnet158 snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}})159 # nodata build uses old runtime, but new chain, thus we use mainnet image for spec generation, and then latest image for nodes.160 snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}}, for_chain = false)161 snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}})162163 - name: "Reconcile: runtime is upgraded"164 working-directory: js-packages/tests165 run: |166 yarn167 ../scripts/wait_for_first_block.sh168 echo "Executing upgrade"169 yarn ts-node --esm util/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm170 env:171 RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}172173 - name: Run Parallel tests after forkless upgrade174 working-directory: js-packages/tests175 run: |176 yarn add mochawesome177 ../scripts/wait_for_first_block.sh178 echo "Ready to start tests"179 NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}180 env:181 RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}182183 - name: Run Sequential tests after forkless upgrade184 if: success() || failure()185 working-directory: js-packages/tests186 run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}187 env:188 RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}189190 - name: Remove builder cache191 if: always() # run this step always192 run: |193 docker system prune -f.github/workflows/governance.ymldiffbeforeafterboth--- a/.github/workflows/governance.yml
+++ b/.github/workflows/governance.yml
@@ -79,7 +79,7 @@
- uses: actions/setup-node@v3.5.1
with:
- node-version: 20
+ node-version: 20
- name: Run tests
working-directory: js-packages/tests
.github/workflows/make-bench.ymldiffbeforeafterboth--- a/.github/workflows/make-bench.yml
+++ b/.github/workflows/make-bench.yml
@@ -36,7 +36,7 @@
- uses: actions/setup-node@v3
with:
- node-version: 20
+ node-version: 20
- name: RUN benchmarking
run: |
@@ -50,8 +50,8 @@
working-directory: js-packages/scripts
run: |
yarn
- yarn ts-node --esm calibrate.ts
- yarn ts-node --esm calibrateApply.ts
+ yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm calibrate.ts
+ yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm calibrateApply.ts
- name: show git diff
run: |
.github/workflows/market-test.ymldiffbeforeafterboth--- a/.github/workflows/market-test.yml
+++ b/.github/workflows/market-test.yml
@@ -103,7 +103,7 @@
- uses: actions/setup-node@v3.5.1
with:
- node-version: 20
+ node-version: 20
- name: Setup TypeScript
working-directory: qa-tests
.github/workflows/node-only-update.ymldiffbeforeafterboth--- a/.github/workflows/node-only-update.yml
+++ b/.github/workflows/node-only-update.yml
@@ -143,7 +143,7 @@
- uses: actions/setup-node@v3.5.1
with:
- node-version: 20
+ node-version: 20
- name: Install baedeker
uses: UniqueNetwork/baedeker-action/setup@built
.github/workflows/polkadot-types.ymldiffbeforeafterboth--- a/.github/workflows/polkadot-types.yml
+++ b/.github/workflows/polkadot-types.yml
@@ -68,7 +68,7 @@
- uses: actions/setup-node@v3.5.1
with:
- node-version: 20
+ node-version: 20
# - name: Install jq
# run: sudo apt install jq -y
.github/workflows/try-runtime.ymldiffbeforeafterboth--- a/.github/workflows/try-runtime.yml
+++ b/.github/workflows/try-runtime.yml
@@ -175,7 +175,7 @@
- uses: actions/setup-node@v3.5.1
with:
- node-version: 20
+ node-version: 20
- name: Log in to Docker Hub
uses: docker/login-action@v2.1.0
.github/workflows/xcm.ymldiffbeforeafterboth--- a/.github/workflows/xcm.yml
+++ b/.github/workflows/xcm.yml
@@ -327,7 +327,7 @@
- uses: actions/setup-node@v3.5.1
with:
- node-version: 20
+ node-version: 20
- name: Install baedeker
uses: UniqueNetwork/baedeker-action/setup@built
@@ -370,7 +370,7 @@
- name: Call HRMP initialization
working-directory: js-packages/tests
run: |
- yarn ts-node --esm util/createHrmp.ts ${{matrix.network}}
+ yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm util/createHrmp.ts ${{matrix.network}}
- name: Run XCM tests
working-directory: js-packages/tests
.github/workflows/xnft.ymldiffbeforeafterboth--- a/.github/workflows/xnft.yml
+++ b/.github/workflows/xnft.yml
@@ -159,7 +159,7 @@
- uses: actions/setup-node@v3.5.1
with:
- node-version: 20
+ node-version: 20
- name: Clone xnft-tests
run: git clone https://github.com/UniqueNetwork/xnft-tests.git
.github/workflows/yarn-dev.ymldiffbeforeafterboth--- a/.github/workflows/yarn-dev.yml
+++ b/.github/workflows/yarn-dev.yml
@@ -59,7 +59,7 @@
- uses: actions/setup-node@v3.5.1
with:
- node-version: 20
+ node-version: 20
- name: Run tests
working-directory: js-packages/tests
@@ -90,13 +90,13 @@
working-directory: js-packages/scripts
run: |
yarn install
- npx ts-node --esm ./benchmarks/mintFee/index.ts
+ node --no-warnings=ExperimentalWarning --loader ts-node/esm ./benchmarks/mintFee/index.ts
- name: Run benchmark opsFee tests
working-directory: js-packages/scripts
run: |
yarn install
- npx ts-node --esm ./benchmarks/opsFee/index.ts
+ node --no-warnings=ExperimentalWarning --loader ts-node/esm ./benchmarks/opsFee/index.ts
- name: Stop running containers
if: always() # run this step always
js-packages/package.jsondiffbeforeafterboth--- 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 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-fetch-metadata": "yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm scripts/fetchMetadata.ts",
+ "polkadot-types-from-defs": "node --no-warnings=ExperimentalWarning --loader ts-node/esm ./node_modules/.bin/polkadot-types-from-defs --endpoint scripts/metadata.json --input types/ --package .",
+ "polkadot-types-from-chain": "node --no-warnings=ExperimentalWarning --loader 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": {