diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..5716b8a740 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +# https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 +quote_type = double \ No newline at end of file diff --git a/.github/workflows/build-lint-typecheck-test.yaml b/.github/workflows/build-lint-typecheck-test.yaml index 13f3314e5e..83efbde9e0 100644 --- a/.github/workflows/build-lint-typecheck-test.yaml +++ b/.github/workflows/build-lint-typecheck-test.yaml @@ -47,7 +47,7 @@ jobs: - name: Use Node.js uses: actions/setup-node@v3 with: - node-version: lts/* + node-version-file: .nvmrc registry-url: https://registry.npmjs.org/ cache: "yarn" diff --git a/.github/workflows/functional-tests-imx.yml b/.github/workflows/functional-tests-imx.yml index 39800f9cff..5ece8969f0 100644 --- a/.github/workflows/functional-tests-imx.yml +++ b/.github/workflows/functional-tests-imx.yml @@ -1,41 +1,41 @@ name: Functional Tests (IMX) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] jobs: test: timeout-minutes: 60 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version-file: .nvmrc - - name: Install root dependencies - run: npm install -g yarn && yarn install --immutable + - name: Install root dependencies + run: npm install -g yarn && yarn install --immutable - - name: Build SDK - run: yarn build + - name: Build SDK + run: yarn build - - name: Install functional tests dependencies - run: cd tests/func-tests/imx && yarn install --no-immutable + - name: Install functional tests dependencies + run: cd tests/func-tests/imx && yarn install --no-immutable - - name: Run tests - env: - NETWORK: sepolia - TEST_ALCHEMY_API_KEY: ${{ secrets.TEST_ALCHEMY_API_KEY }} - PUBLIC_API_URL: 'https://api.sandbox.x.immutable.com/v1' - TEST_STARK_CONTRACT_ADDRESS: '0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98' - TEST_REGISTRATION_CONTRACT_ADDRESS: '0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97' - TEST_TOKEN_ADDRESS: '0xfA5539fBEd27887EEbb2515672D80412D1A3ADa3' - TEST_WALLET1_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_PRIVATE_KEY }} - TEST_WALLET1_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_STARK_PRIVATE_KEY }} - TEST_WALLET2_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_PRIVATE_KEY }} - TEST_WALLET2_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_STARK_PRIVATE_KEY }} - TEST_WALLET_BANKER_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_PRIVATE_KEY }} - TEST_WALLET_BANKER_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_STARK_PRIVATE_KEY }} - TEST_STARKEX_BATCH_SIZE: 500 - run: cd tests/func-tests/imx && yarn test:ci + - name: Run tests + env: + NETWORK: sepolia + TEST_ALCHEMY_API_KEY: ${{ secrets.TEST_ALCHEMY_API_KEY }} + PUBLIC_API_URL: "https://api.sandbox.x.immutable.com/v1" + TEST_STARK_CONTRACT_ADDRESS: "0x2d5C349fD8464DA06a3f90b4B0E9195F3d1b7F98" + TEST_REGISTRATION_CONTRACT_ADDRESS: "0xDbA6129C02E69405622fAdc3d5A7f8d23eac3b97" + TEST_TOKEN_ADDRESS: "0xfA5539fBEd27887EEbb2515672D80412D1A3ADa3" + TEST_WALLET1_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_PRIVATE_KEY }} + TEST_WALLET1_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET1_STARK_PRIVATE_KEY }} + TEST_WALLET2_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_PRIVATE_KEY }} + TEST_WALLET2_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET2_STARK_PRIVATE_KEY }} + TEST_WALLET_BANKER_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_PRIVATE_KEY }} + TEST_WALLET_BANKER_STARK_PRIVATE_KEY: ${{ secrets.TEST_WALLET_BANKER_STARK_PRIVATE_KEY }} + TEST_STARKEX_BATCH_SIZE: 500 + run: cd tests/func-tests/imx && yarn test:ci diff --git a/.github/workflows/functional-tests-zkevm.yml b/.github/workflows/functional-tests-zkevm.yml index 4dc8a71497..e0450e68ad 100644 --- a/.github/workflows/functional-tests-zkevm.yml +++ b/.github/workflows/functional-tests-zkevm.yml @@ -1,35 +1,35 @@ name: Functional Tests (zkEVM) on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] jobs: test: timeout-minutes: 60 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version-file: ".nvmrc" - - name: Install root dependencies - run: npm install -g yarn && yarn install --immutable + - name: Install root dependencies + run: npm install -g yarn && yarn install --immutable - - name: Build SDK - run: yarn build + - name: Build SDK + run: yarn build - - name: Install functional tests dependencies - run: cd tests/func-tests/zkevm && yarn install --no-immutable + - name: Install functional tests dependencies + run: cd tests/func-tests/zkevm && yarn install --no-immutable - - name: Run tests - env: - ZKEVM_ORDERBOOK_BANKER: ${{ secrets.ZKEVM_ORDERBOOK_BANKER }} - ZKEVM_ORDERBOOK_ERC721: '0xBE8B131f39825282Ace9eFf99C0Bb14972417b49' - SEAPORT_CONTRACT_ADDRESS: '0x7d117aA8BD6D31c4fa91722f246388f38ab1942c' - ZONE_CONTRACT_ADDRESS: '0x8831867E347AB87FA30199C5B695F0A31604Bb52' - ZKEVM_RPC_ENDPOINT: 'https://rpc.testnet.immutable.com' - ORDERBOOK_MR_API_URL: 'https://api.sandbox.immutable.com' - ZKEVM_CHAIN_NAME: 'imtbl-zkevm-testnet' - run: cd tests/func-tests/zkevm && yarn test:ci + - name: Run tests + env: + ZKEVM_ORDERBOOK_BANKER: ${{ secrets.ZKEVM_ORDERBOOK_BANKER }} + ZKEVM_ORDERBOOK_ERC721: "0xBE8B131f39825282Ace9eFf99C0Bb14972417b49" + SEAPORT_CONTRACT_ADDRESS: "0x7d117aA8BD6D31c4fa91722f246388f38ab1942c" + ZONE_CONTRACT_ADDRESS: "0x8831867E347AB87FA30199C5B695F0A31604Bb52" + ZKEVM_RPC_ENDPOINT: "https://rpc.testnet.immutable.com" + ORDERBOOK_MR_API_URL: "https://api.sandbox.immutable.com" + ZKEVM_CHAIN_NAME: "imtbl-zkevm-testnet" + run: cd tests/func-tests/zkevm && yarn test:ci diff --git a/.github/workflows/passport-sdk-sample-app-deployment.yaml b/.github/workflows/passport-sdk-sample-app-deployment.yaml index 71d36d9131..06c4bb8ddc 100644 --- a/.github/workflows/passport-sdk-sample-app-deployment.yaml +++ b/.github/workflows/passport-sdk-sample-app-deployment.yaml @@ -3,7 +3,7 @@ name: Passport SDK Sample App Deployment on: push: paths: - - 'packages/passport/**' + - "packages/passport/**" branches: - main workflow_dispatch: @@ -64,4 +64,4 @@ jobs: - name: Clear the cloudfront cache run: | - aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_PASSPORT_PROD_DISTRIBUTION_ID }} --paths "/*" + aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_PASSPORT_PROD_DISTRIBUTION_ID }} --paths "/*" diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 11ee8547e6..07b45dad30 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,9 +1,9 @@ name: Playwright Tests on: push: - branches: [ main, master ] + branches: [main, master] pull_request: - branches: [ main, master ] + branches: [main, master] jobs: test: timeout-minutes: 60 @@ -11,33 +11,33 @@ jobs: container: image: mcr.microsoft.com/playwright:v1.40.0-jammy steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version-file: samples/apps/ts-immutable-sample/.nvmrc - - name: Install root dependencies - run: npm install -g yarn && yarn install --immutable + - name: Install root dependencies + run: npm install -g yarn && yarn install --immutable - - name: Build SDK - run: yarn build + - name: Build SDK + run: yarn build - - name: Install sample apps dependencies - run: cd samples/apps/ts-immutable-sample && yarn install --no-immutable + - name: Install sample apps dependencies + run: cd samples/apps/ts-immutable-sample && yarn install --no-immutable - - name: Run Unit tests - run: cd samples/apps/ts-immutable-sample && yarn test - - - name: Run Playwright tests - env: - # Required for Firefox to run - # https://github.com/microsoft/playwright/issues/6500#issuecomment-838515115 - HOME: /root - working-directory: samples/apps/ts-immutable-sample - run: yarn playwright test - - uses: actions/upload-artifact@v3 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 + - name: Run Unit tests + run: cd samples/apps/ts-immutable-sample && yarn test + + - name: Run Playwright tests + env: + # Required for Firefox to run + # https://github.com/microsoft/playwright/issues/6500#issuecomment-838515115 + HOME: /root + working-directory: samples/apps/ts-immutable-sample + run: yarn playwright test + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml index 8894115b78..10f96cf820 100644 --- a/.github/workflows/publish-docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -46,8 +46,8 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: lts/* - cache: 'yarn' + node-version-file: .nvmrc + cache: "yarn" - name: Update SDK package.json version run: | diff --git a/.github/workflows/publish-major-version.yaml b/.github/workflows/publish-major-version.yaml index a54b3b9d14..c0d06c7e7e 100644 --- a/.github/workflows/publish-major-version.yaml +++ b/.github/workflows/publish-major-version.yaml @@ -59,7 +59,7 @@ jobs: id: allowed_actors_check # only allow certain SDK team members to run this workflow if: ${{ contains(fromJson(env.SDK_PUBLISH_MAJOR_VERSION_ACTORS), github.triggering_actor) }} - run: echo "ALLOWED_ACTOR=true" >> $GITHUB_OUTPUT + run: echo "ALLOWED_ACTOR=true" >> $GITHUB_OUTPUT - name: Allowed Actors Filter if: ${{ steps.allowed_actors_check.outputs.ALLOWED_ACTOR != 'true' }} @@ -85,8 +85,8 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: lts/* - cache: 'yarn' + node-version-file: .nvmrc + cache: "yarn" - name: Workout next version string run: | @@ -162,7 +162,7 @@ jobs: # Wait for 30 seconds to make sure the tag is available on GitHub - uses: GuillaumeFalourd/wait-sleep-action@v1 with: - time: '30' + time: "30" - name: Create GitHub Release id: gh_release diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2dc9786160..8025d0732f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -57,8 +57,8 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: lts/* - cache: 'yarn' + node-version-file: .nvmrc + cache: "yarn" - name: Workout next version string run: | @@ -136,7 +136,7 @@ jobs: # Wait for 30 seconds to make sure the tag is available on GitHub - uses: GuillaumeFalourd/wait-sleep-action@v1 with: - time: '30' + time: "30" - name: Create GitHub Release id: gh_release diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..1a2f5bd204 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/* \ No newline at end of file