diff --git a/.eslintrc.json b/.eslintrc.json index 88d9bd572..e58c2f737 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -73,7 +73,8 @@ "error", { "prefer": "type-imports", - "disallowTypeAnnotations": true + "disallowTypeAnnotations": true, + "fixStyle": "inline-type-imports" } ], "curly": ["error", "multi-line"] diff --git a/.github/workflows/ci-cd-trigger.yml b/.github/workflows/ci-cd-trigger.yml index ec26eeb56..bdb570d9b 100644 --- a/.github/workflows/ci-cd-trigger.yml +++ b/.github/workflows/ci-cd-trigger.yml @@ -34,7 +34,7 @@ jobs: ${{ runner.os }}-cache-node-modules- - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 if: steps.cache.outputs.cache-hit != 'true' with: node-version-file: '.nvmrc' @@ -57,7 +57,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' # https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions @@ -96,7 +96,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: yarn @@ -128,7 +128,7 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: yarn @@ -182,7 +182,7 @@ jobs: run: | if [[ "${{ github.base_ref }}" == "develop" ]]; then echo "e2e-needed=true" >> $GITHUB_OUTPUT - elif [[ "${{ github.base_ref }}" == "main" ]]; then + elif [[ "${{ github.base_ref }}" == "main" ]]; then echo "e2e-needed=true" >> $GITHUB_OUTPUT elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref_name }}" == *"release/"* ]]; then echo "e2e-needed=true" >> $GITHUB_OUTPUT @@ -205,7 +205,7 @@ jobs: console-e2e: needs: [build-sources, check-e2e-needed] - name: '(CI) console python' + name: '(CI) trading e2e python' uses: ./.github/workflows/console-test-run.yml secrets: inherit if: needs.check-e2e-needed.outputs.run-tests == 'true' && contains(needs.build-sources.outputs.projects, 'trading') diff --git a/.github/workflows/console-test-run.yml b/.github/workflows/console-test-run.yml index 661ba9472..f78a086ee 100644 --- a/.github/workflows/console-test-run.yml +++ b/.github/workflows/console-test-run.yml @@ -10,7 +10,7 @@ on: inputs: console-test-branch: type: choice - description: 'main: v0.72.14, develop: v0.73.0-preview7' + description: 'main: v0.72.14, develop: v0.73.4' options: - main - develop @@ -32,9 +32,9 @@ jobs: # cache node modules #---------------------------------------------- - name: setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '16' + node-version-file: '.nvmrc' cache: yarn - name: Cache node modules @@ -153,25 +153,19 @@ jobs: run: | docker load --input /tmp/console-image.tar docker image ls -a - #---------------------------------------------- - # check-out tests repo + # check-out frontend-monorepo #---------------------------------------------- - - name: Checkout console test repo + - name: Checkout frontend-monorepo uses: actions/checkout@v3 with: - repository: vegaprotocol/console-test - ref: ${{ needs.console-test-branch.outputs.console-branch }} - - - name: Load console test envs - id: console-test-env - uses: falti/dotenv-action@v1.0.4 - with: - path: '.env.${{ needs.console-test-branch.outputs.console-branch }}' - export-variables: true - keys-case: upper - log-variables: true - + ref: ${{ inputs.github-sha || github.sha }} + #---------------------------------------------- + # get vega version + #---------------------------------------------- + - name: Set VEGA_VERSION from .env + id: set_vega_version + run: echo "VEGA_VERSION=$(grep VEGA_VERSION apps/trading/e2e/.env | cut -d '=' -f2)" >> $GITHUB_ENV #---------------------------------------------- # ----- Setup python ----- #---------------------------------------------- @@ -194,22 +188,25 @@ jobs: #---------------------------------------------- - name: Install dependencies run: poetry install --no-interaction --no-root + working-directory: apps/trading/e2e #---------------------------------------------- # install vega binaries #---------------------------------------------- - name: Install vega binaries run: poetry run python -m vega_sim.tools.load_binaries --force --version ${{ env.VEGA_VERSION }} + working-directory: apps/trading/e2e #---------------------------------------------- - # install playwright + # install playwrightworking-directory: apps/trading/e2e #---------------------------------------------- - name: install playwright run: poetry run playwright install --with-deps chromium + working-directory: apps/trading/e2e #---------------------------------------------- # run tests #---------------------------------------------- - name: Run tests run: CONSOLE_IMAGE_NAME=ci/trading:local poetry run pytest -v -s --numprocesses 4 --dist loadfile --durations=15 - + working-directory: apps/trading/e2e #---------------------------------------------- # upload traces #---------------------------------------------- diff --git a/.github/workflows/cypress-live-test.yml b/.github/workflows/cypress-live-test.yml index dcd813036..4c39a6e28 100644 --- a/.github/workflows/cypress-live-test.yml +++ b/.github/workflows/cypress-live-test.yml @@ -18,11 +18,11 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Use Node.js 16 + - name: Use Node.js 20 id: Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: 16.15.1 + node-version-file: '.nvmrc' - name: Run Cypress tests uses: cypress-io/github-action@v4 diff --git a/.github/workflows/cypress-run.yml b/.github/workflows/cypress-run.yml index fe41f1c89..4411bd54b 100644 --- a/.github/workflows/cypress-run.yml +++ b/.github/workflows/cypress-run.yml @@ -57,6 +57,14 @@ jobs: path: './frontend-monorepo' ref: ${{ github.event.pull_request.head.sha || github.sha }} + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version-file: './frontend-monorepo/.nvmrc' + # https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions + cache: yarn + cache-dependency-path: './frontend-monorepo/yarn.lock' + # Restore node_modules from cache if possible - name: Restore node_modules from cache id: cache-node-modules diff --git a/.github/workflows/generate-queries.yml b/.github/workflows/generate-queries.yml index 43db3338c..c4d628947 100644 --- a/.github/workflows/generate-queries.yml +++ b/.github/workflows/generate-queries.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v3 - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' # https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index 8763b67cd..325641ca6 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -18,13 +18,13 @@ jobs: uses: actions/checkout@v3 - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16 + node-version-file: '.nvmrc' - name: Install dependencies run: | - rm package.json + rm package.json npm install --no-save @commitlint/cli @commitlint/config-conventional @commitlint/config-nx-scopes nx - name: Check PR title diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml index 622d25b71..309264f90 100644 --- a/.github/workflows/publish-dist.yml +++ b/.github/workflows/publish-dist.yml @@ -93,7 +93,7 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' # https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 672bb7da0..a40cb66e9 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -29,7 +29,7 @@ jobs: uses: actions/checkout@v3 - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' # https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions diff --git a/.gitignore b/.gitignore index 0a587cc44..6b34d3516 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,12 @@ cypress.env.json /apps/**/cypress/reports/ /apps/**/cypress/downloads/ /apps/**/fixtures/wallet/node** + +#console-test +__pycache__/ +apps/trading/e2e/logs/ +apps/trading/e2e/.pytest_cache/ +apps/trading/e2e/traces/ + +.nx/cache + diff --git a/.nvmrc b/.nvmrc index cb406c60c..f3f52b42d 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.20.2 +20.9.0 diff --git a/.prettierignore b/.prettierignore index 365c3d4f7..2b04963a2 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,3 +8,8 @@ __generated___ apps/static/src/assets/devnet-tranches.json apps/static/src/assets/mainnet-tranches.json apps/static/src/assets/testnet-tranches.json + +/apps/**/cypress/reports/ +/apps/**/cypress/downloads/ + +/.nx/cache diff --git a/CODEOWNERS b/CODEOWNERS index 8117415dd..a63dde642 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,2 +1,4 @@ * @vegaprotocol/frontend +apps/ @vegaprotocol/frontend-qa +libs/ @vegaprotocol/frontend-qa *.graphql @vegaprotocol/core diff --git a/README.md b/README.md index 57c165cd6..9e657a93a 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ The [`docker`](./docker) subfolder has some docker configurations for easily set Using multistage dockerfile dist is compiled using [node](https://hub.docker.com/_/node) image and later packed to nginx as in [dist build](#dist-build). The multistage builds ensures consistent CPU architecture and build toolchains are used so that the result will be identical. ```bash -docker build --build-arg APP=[YOUR APP] --build-arg NODE_VERSION=16.5.1 --build-arg ENV_NAME=mainnet -t [TAG] -f docker/node-inside-docker.Dockerfile . +docker build --build-arg APP=[YOUR APP] --build-arg NODE_VERSION=20.9.1 --build-arg ENV_NAME=mainnet -t [TAG] -f docker/node-inside-docker.Dockerfile . ``` ### Computing ipfs-hash of the build diff --git a/apps/explorer-e2e/.eslintrc.json b/apps/explorer-e2e/.eslintrc.json index 696cb8b12..70128adc7 100644 --- a/apps/explorer-e2e/.eslintrc.json +++ b/apps/explorer-e2e/.eslintrc.json @@ -4,7 +4,9 @@ "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} + "rules": { + "cypress/unsafe-to-chain-command": 0 + } } ] } diff --git a/apps/explorer-e2e/project.json b/apps/explorer-e2e/project.json index f553e9f1b..3e40a7e58 100644 --- a/apps/explorer-e2e/project.json +++ b/apps/explorer-e2e/project.json @@ -17,7 +17,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/explorer-e2e/**/*.{js,ts}"] diff --git a/apps/explorer/project.json b/apps/explorer/project.json index c2aec3281..917e2560e 100644 --- a/apps/explorer/project.json +++ b/apps/explorer/project.json @@ -53,7 +53,7 @@ } }, "lint": { - "executor": "@nx/linter:eslint", + "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": ["apps/explorer/**/*.{ts,tsx,js,jsx}"] @@ -63,14 +63,7 @@ "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/apps/explorer"], "options": { - "jestConfig": "apps/explorer/jest.config.ts", - "passWithNoTests": true - }, - "configurations": { - "ci": { - "ci": true, - "codeCoverage": true - } + "jestConfig": "apps/explorer/jest.config.ts" } }, "generate-types": { diff --git a/apps/explorer/src/app/components/asset-balance/asset-balance.tsx b/apps/explorer/src/app/components/asset-balance/asset-balance.tsx index a64a43623..758fed005 100644 --- a/apps/explorer/src/app/components/asset-balance/asset-balance.tsx +++ b/apps/explorer/src/app/components/asset-balance/asset-balance.tsx @@ -1,5 +1,5 @@ import { useAssetDataProvider } from '@vegaprotocol/assets'; -import { addDecimalsFormatNumber } from '@vegaprotocol/utils'; +import { addDecimalsFixedFormatNumber } from '@vegaprotocol/utils'; import { AssetLink } from '../links'; export type AssetBalanceProps = { @@ -23,12 +23,12 @@ const AssetBalance = ({ const label = !loading && asset && asset.decimals - ? addDecimalsFormatNumber(price, asset.decimals) + ? addDecimalsFixedFormatNumber(price, asset.decimals) : price; return (
+
{t('No order created from this transaction')}
+
| Balance | +Type | +Market | +Asset | +
|---|---|---|---|
|
+ |
+ {AccountTypeMapping[type]} | +
+ {market?.id ? |
+
+ |
+
{t('ListAssetDescription')}
{t('OR')}
+{t('OR')}