diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index 732e01d370..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: Bug Report -description: File a bug report -labels: [ "bug", "triage" ] -body: - - type: markdown - attributes: - value: | - Thanks for reporting a bug 🐛! - - Please search open/closed issues before submitting. Someone might have had the similar problem before 😉! - - - type: textarea - id: description - attributes: - label: Description - description: A brief description of the issue. - placeholder: | - When I ____, I expected ____ to happen but ____ happened instead. - validations: - required: true - - - type: input - id: link - attributes: - label: Link to the page - description: The link to the page where the issue occurs. - placeholder: https://eth.blockscout.com - validations: - required: true - - - type: textarea - id: steps - attributes: - label: Steps to reproduce - description: | - Explain how to reproduce the issue in the development environment. - value: | - 1. Go to '...' - 2. Click on '...' - 3. Scroll down to '...' - 4. See error - - - type: input - id: version - attributes: - label: App version - description: The version of the front-end app you use. You can find it in the footer of the page. - placeholder: v1.2.0 - validations: - required: true - - - type: input - id: browser - # validations: - # required: true - attributes: - label: Browser - description: What browsers are you seeing the problem on? Please specify browser vendor and its version. - placeholder: Google Chrome 111 - - - type: dropdown - id: operating-system - # validations: - # required: true - attributes: - label: Operating system - description: The operating system this issue occurred with. - options: - - macOS - - Windows - - Linux - - - type: textarea - id: additional-information - attributes: - label: Additional information - description: | - Use this section to provide any additional information you might have (e.g screenshots or screencasts). \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 439bca677d..0000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,11 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Feature Request - url: https://blockscout.canny.io/feature-requests - about: Request a feature or enhancement - - name: Ask a question - url: https://github.com/orgs/blockscout/discussions - about: Ask questions and discuss topics with other community members - - name: Join our Discord Server - url: https://discord.gg/blockscout - about: The official Blockscout Discord community \ No newline at end of file diff --git a/.github/release.yml b/.github/release.yml deleted file mode 100644 index c9de8448b3..0000000000 --- a/.github/release.yml +++ /dev/null @@ -1,21 +0,0 @@ -changelog: - categories: - - title: 🚀 New Features - labels: - - client feature - - feature - - title: 🐛 Bug Fixes - labels: - - bug - - title: ⚡ Performance Improvements - labels: - - performance - - title: 📦 Dependencies Updates - labels: - - dependencies - - title: 🚨 Changes in ENV variables - labels: - - ENVs - - title: ✨ Other Changes - labels: - - "*" \ No newline at end of file diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index 9496bb37e6..0000000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,228 +0,0 @@ -name: Checks -on: - workflow_call: - workflow_dispatch: - pull_request: - types: [ opened, synchronize, unlabeled ] - paths-ignore: - - '.github/ISSUE_TEMPLATE/**' - - '.husky/**' - - '.vscode/**' - - 'deploy/**' - - 'docs/**' - - 'public/**' - - 'stub/**' - - 'tools/**' - -# concurrency: -# group: ${{ github.workflow }}__${{ github.job }}__${{ github.ref }} -# cancel-in-progress: true - -jobs: - code_quality: - name: Code quality - runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip checks') && !(github.event.action == 'unlabeled' && github.event.label.name != 'skip checks') }} - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20.11.0 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Run ESLint - run: yarn lint:eslint - - - name: Compile TypeScript - run: yarn lint:tsc - - envs_validation: - name: ENV variables validation - runs-on: ubuntu-latest - needs: [ code_quality ] - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20.11.0 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Install script dependencies - run: cd ./deploy/tools/envs-validator && yarn --frozen-lockfile --ignore-optional - - - name: Run validation tests - run: | - set +e - cd ./deploy/tools/envs-validator && yarn test - exitcode="$?" - echo "exitcode=$exitcode" >> $GITHUB_OUTPUT - exit "$exitcode" - - jest_tests: - name: Jest tests - needs: [ code_quality, envs_validation ] - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20.11.0 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Run Jest - run: yarn test:jest ${{ github.event_name == 'pull_request' && '--changedSince=origin/main' || '' }} --passWithNoTests - - pw_affected_tests: - name: Resolve affected Playwright tests - runs-on: ubuntu-latest - needs: [ code_quality, envs_validation ] - if: github.event_name == 'pull_request' - steps: - - name: Checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20.11.0 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Install script dependencies - run: cd ./deploy/tools/affected-tests && yarn --frozen-lockfile - - - name: Run script - run: yarn test:pw:detect-affected - - - name: Upload result file - uses: actions/upload-artifact@v4 - with: - name: playwright-affected-tests - path: ./playwright/affected-tests.txt - retention-days: 3 - - pw_tests: - name: 'Playwright tests / Project: ${{ matrix.project }}' - needs: [ code_quality, envs_validation, pw_affected_tests ] - if: | - always() && - needs.code_quality.result == 'success' && - needs.envs_validation.result == 'success' && - (needs.pw_affected_tests.result == 'success' || needs.pw_affected_tests.result == 'skipped') - runs-on: ubuntu-latest - container: - image: mcr.microsoft.com/playwright:v1.41.1-focal - - strategy: - fail-fast: false - matrix: - project: [ default, mobile, dark-color-mode ] - - steps: - - name: Install git-lfs - run: apt-get update && apt-get install git-lfs - - - name: Checkout repo - uses: actions/checkout@v4 - with: - lfs: 'true' - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20.11.0 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Download affected tests list - if: ${{ needs.pw_affected_tests.result == 'success' }} - uses: actions/download-artifact@v4 - continue-on-error: true - with: - name: playwright-affected-tests - path: ./playwright - - - name: Run PlayWright - run: yarn test:pw:ci --affected=${{ github.event_name == 'pull_request' }} --pass-with-no-tests - env: - HOME: /root - PW_PROJECT: ${{ matrix.project }} - - - name: Upload test results - if: always() - uses: actions/upload-artifact@v4 - with: - name: playwright-report-${{ matrix.project }} - path: playwright-report - retention-days: 10 \ No newline at end of file diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml deleted file mode 100644 index a8ed3ee27a..0000000000 --- a/.github/workflows/cleanup.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Cleanup environments - -on: - pull_request: - types: - - closed - - merged - workflow_dispatch: - -jobs: - cleanup_release: - uses: blockscout/blockscout-ci-cd/.github/workflows/cleanup_helmfile.yaml@master - with: - appName: review-l2-$GITHUB_REF_NAME_SLUG - globalEnv: review - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit - cleanup_l2_release: - uses: blockscout/blockscout-ci-cd/.github/workflows/cleanup_helmfile.yaml@master - with: - appName: review-$GITHUB_REF_NAME_SLUG - globalEnv: review - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit - cleanup_docker_image: - uses: blockscout/blockscout-ci-cd/.github/workflows/cleanup_docker.yaml@master - with: - dockerImage: review-$GITHUB_REF_NAME_SLUG - secrets: inherit diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml deleted file mode 100644 index 9e7f11dee9..0000000000 --- a/.github/workflows/deploy-main.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Deploy from main branch - -on: - push: - branches: - - main - paths-ignore: - - '.github/ISSUE_TEMPLATE/**' - - '.husky/**' - - '.vscode/**' - - 'docs/**' - - 'jest/**' - - 'mocks/**' - - 'playwright/**' - - 'stubs/**' - - 'tools/**' - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - publish_image: - name: Publish Docker image - uses: './.github/workflows/publish-image.yml' - secrets: inherit - - deploy_main: - name: Deploy frontend - needs: publish_image - uses: blockscout/blockscout-ci-cd/.github/workflows/deploy_helmfile.yaml@master - with: - appName: front - globalEnv: main - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit - - deploy_l2: - name: Deploy frontend (L2) - needs: publish_image - uses: blockscout/blockscout-ci-cd/.github/workflows/deploy_helmfile.yaml@master - with: - appName: l2-optimism-goerli - globalEnv: optimism-goerli - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit diff --git a/.github/workflows/deploy-review-l2.yml b/.github/workflows/deploy-review-l2.yml deleted file mode 100644 index 02feb3ce64..0000000000 --- a/.github/workflows/deploy-review-l2.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Deploy review environment (L2) - -on: - workflow_dispatch: - -jobs: - make_slug: - name: Make GitHub reference slug - runs-on: ubuntu-latest - outputs: - REF_SLUG: ${{ steps.output.outputs.REF_SLUG }} - steps: - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4.4.1 - - - name: Set output - id: output - run: echo "REF_SLUG=${{ env.GITHUB_REF_NAME_SLUG }}" >> $GITHUB_OUTPUT - - publish_image: - name: Publish Docker image - needs: make_slug - uses: './.github/workflows/publish-image.yml' - with: - tags: ghcr.io/blockscout/frontend:review-${{ needs.make_slug.outputs.REF_SLUG }} - secrets: inherit - - deploy_review_l2: - name: Deploy frontend (L2) - needs: [ make_slug, publish_image ] - uses: blockscout/blockscout-ci-cd/.github/workflows/deploy_helmfile.yaml@master - with: - appName: review-l2-${{ needs.make_slug.outputs.REF_SLUG }} - globalEnv: review - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit diff --git a/.github/workflows/deploy-review.yml b/.github/workflows/deploy-review.yml deleted file mode 100644 index 64bc517804..0000000000 --- a/.github/workflows/deploy-review.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Deploy review environment - -on: - workflow_dispatch: - inputs: - envs_preset: - description: ENVs preset - required: false - default: "" - type: choice - options: - - none - - base - - gnosis - - eth - - eth_sepolia - - eth_goerli - - optimism - - optimism_sepolia - - polygon - - rootstock - - stability - - zkevm - - zksync - -jobs: - make_slug: - name: Make GitHub reference slug - runs-on: ubuntu-latest - outputs: - REF_SLUG: ${{ steps.output.outputs.REF_SLUG }} - steps: - - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4.4.1 - - - name: Set output - id: output - run: echo "REF_SLUG=${{ env.GITHUB_REF_NAME_SLUG }}" >> $GITHUB_OUTPUT - - publish_image: - name: Publish Docker image - needs: make_slug - uses: './.github/workflows/publish-image.yml' - with: - tags: ghcr.io/blockscout/frontend:review-${{ needs.make_slug.outputs.REF_SLUG }} - build_args: ENVS_PRESET=${{ inputs.envs_preset }} - secrets: inherit - - deploy_review: - name: Deploy frontend - needs: [ make_slug, publish_image ] - uses: blockscout/blockscout-ci-cd/.github/workflows/deploy_helmfile.yaml@master - with: - appName: review-${{ needs.make_slug.outputs.REF_SLUG }} - globalEnv: review - helmfileDir: deploy - kubeConfigSecret: ci/data/dev/kubeconfig/k8s-dev - vaultRole: ci-dev - secrets: inherit diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml deleted file mode 100644 index 6aab1f48ff..0000000000 --- a/.github/workflows/e2e-tests.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Run E2E tests k8s - -on: - workflow_dispatch: - workflow_call: - -# concurrency: -# group: ${{ github.workflow }}__${{ github.job }}__${{ github.ref }} -# cancel-in-progress: true - -jobs: - publish_image: - name: Publish Docker image - uses: './.github/workflows/publish-image.yml' - secrets: inherit - - deploy_e2e: - name: Deploy E2E instance - needs: publish_image - runs-on: ubuntu-latest - permissions: write-all - steps: - - name: Get Vault credentials - id: retrieve-vault-secrets - uses: hashicorp/vault-action@v2.4.1 - with: - url: https://vault.k8s.blockscout.com - role: ci-dev - path: github-jwt - method: jwt - tlsSkipVerify: false - exportToken: true - secrets: | - ci/data/dev/github token | WORKFLOW_TRIGGER_TOKEN ; - - name: Trigger deploy - uses: convictional/trigger-workflow-and-wait@v1.6.1 - with: - owner: blockscout - repo: deployment-values - github_token: ${{ env.WORKFLOW_TRIGGER_TOKEN }} - workflow_file_name: deploy_blockscout.yaml - ref: main - wait_interval: 30 - client_payload: '{ "instance": "dev", "globalEnv": "e2e"}' - - test: - name: Run tests - needs: deploy_e2e - uses: blockscout/blockscout-ci-cd/.github/workflows/e2e_new.yaml@master - secrets: inherit \ No newline at end of file diff --git a/.github/workflows/label-issues-in-release.yml b/.github/workflows/label-issues-in-release.yml deleted file mode 100644 index b95fd45616..0000000000 --- a/.github/workflows/label-issues-in-release.yml +++ /dev/null @@ -1,282 +0,0 @@ -name: Label issues in release - -on: - workflow_dispatch: - inputs: - tag: - description: 'Release tag' - required: true - type: string - label_name: - description: 'Name of the label' - required: true - type: string - label_description: - description: 'Description of the label' - default: '' - required: false - type: string - label_color: - description: 'A color of the added label' - default: 'FFFFFF' - required: false - type: string - workflow_call: - inputs: - tag: - description: 'Release tag' - required: true - type: string - label_name: - description: 'Name of the label' - required: true - type: string - label_description: - description: 'Description of the label' - default: '' - required: false - type: string - label_color: - description: 'A color of the added label' - default: 'FFFFFF' - required: false - type: string - outputs: - issues: - description: "JSON encoded list of issues linked to commits in the release" - value: ${{ jobs.run.outputs.issues }} - -# concurrency: -# group: ${{ github.workflow }}__${{ github.job }}__${{ github.ref }} -# cancel-in-progress: true - -jobs: - run: - name: Run - runs-on: ubuntu-latest - outputs: - issues: ${{ steps.linked_issues.outputs.result }} - steps: - - name: Getting tags of the two latestest releases - id: tags - uses: actions/github-script@v7 - env: - TAG: ${{ inputs.tag }} - with: - script: | - const { repository: { releases: { nodes: releases } } } = await github.graphql(` - query ($owner: String!, $repo: String!) { - repository(owner: $owner, name: $repo) { - releases(first: 10, orderBy: { field: CREATED_AT, direction: DESC }) { - nodes { - name - tagName - tagCommit { - oid - } - isPrerelease - isDraft - publishedAt - } - } - } - } - `, - { - owner: context.repo.owner, - repo: context.repo.repo, - } - ); - - if (releases[0].tagName !== process.env.TAG) { - core.info(`Current latest tag: ${ releases[0].tagName }`); - core.setFailed(`Release with tag ${ process.env.TAG } is not latest one.`); - return; - } - - const latestTag = process.env.TAG; - const [ { tagName: previousTag } ] = releases - .slice(1) - .filter(({ isDraft }) => !isDraft); - - core.info('Found following tags:'); - core.info(` latest: ${ latestTag }`); - core.info(` second latest: ${ previousTag }`); - - core.setOutput('latest', latestTag); - core.setOutput('previous', previousTag); - - - name: Looking for commits between two releases - id: commits - uses: actions/github-script@v7 - env: - PREVIOUS_TAG: ${{ steps.tags.outputs.previous }} - LATEST_TAG: ${{ steps.tags.outputs.latest }} - with: - script: | - const { data: { commits: commitsInRelease } } = await github.request('GET /repos/{owner}/{repo}/compare/{basehead}', { - owner: context.repo.owner, - repo: context.repo.repo, - basehead: `${ process.env.PREVIOUS_TAG }...${ process.env.LATEST_TAG }`, - }); - - if (commitsInRelease.length === 0) { - core.notice(`No commits found between ${ process.env.PREVIOUS_TAG } and ${ process.env.LATEST_TAG }`); - return []; - } - - const commits = commitsInRelease.map(({ sha }) => sha); - - core.startGroup(`Found ${ commits.length } commits`); - commits.forEach((sha) => { - core.info(sha); - }) - core.endGroup(); - - return commits; - - - name: Looking for issues linked to commits - id: linked_issues - uses: actions/github-script@v7 - env: - COMMITS: ${{ steps.commits.outputs.result }} - with: - script: | - const commits = JSON.parse(process.env.COMMITS); - - if (commits.length === 0) { - return []; - } - - const map = {}; - - core.startGroup(`Looking for linked issues`); - for (const sha of commits) { - const result = await getLinkedIssuesForCommitPR(sha); - result.forEach((issue) => { - map[issue] = issue; - }); - } - core.endGroup(); - - const issues = Object.values(map); - - if (issues.length > 0) { - core.startGroup(`Found ${ issues.length } unique issues`); - issues.sort().forEach((issue) => { - core.info(`#${ issue } - https://github.com/${ context.repo.owner }/${ context.repo.repo }/issues/${ issue }`); - }) - core.endGroup(); - } else { - core.notice('No linked issues found.'); - } - - return issues; - - async function getLinkedIssuesForCommitPR(sha) { - core.info(`Fetching issues for commit: ${ sha }`); - - const response = await github.graphql(` - query ($owner: String!, $repo: String!, $sha: GitObjectID!) { - repository(owner: $owner, name: $repo) { - object(oid: $sha) { - ... on Commit { - associatedPullRequests(first: 10) { - nodes { - number - title - state - merged - closingIssuesReferences(first: 10) { - nodes { - number - title - closed - } - } - } - } - } - } - } - } - `, { - owner: context.repo.owner, - repo: context.repo.repo, - sha, - }); - - if (!response) { - core.info('Nothing has found.'); - return []; - } - - const { repository: { object: { associatedPullRequests } } } = response; - - const issues = associatedPullRequests - .nodes - .map(({ closingIssuesReferences: { nodes: issues } }) => issues.map(({ number }) => number)) - .flat(); - - core.info(`Found following issues: ${ issues.join(', ') || '-' }\n`); - - return issues; - } - - - name: Creating label - id: label_creating - uses: actions/github-script@v7 - env: - LABEL_NAME: ${{ inputs.label_name }} - LABEL_COLOR: ${{ inputs.label_color }} - LABEL_DESCRIPTION: ${{ inputs.label_description }} - with: - script: | - try { - const result = await github.request('POST /repos/{owner}/{repo}/labels', { - owner: context.repo.owner, - repo: context.repo.repo, - name: process.env.LABEL_NAME, - color: process.env.LABEL_COLOR, - description: process.env.LABEL_DESCRIPTION, - }); - - core.info('Label was created.'); - } catch (error) { - if (error.status === 422) { - core.info('Label already exist.'); - } else { - core.setFailed(error.message); - } - } - - - - name: Adding label to issues - id: labeling_issues - uses: actions/github-script@v7 - env: - LABEL_NAME: ${{ inputs.label_name }} - ISSUES: ${{ steps.linked_issues.outputs.result }} - with: - script: | - const issues = JSON.parse(process.env.ISSUES); - - if (issues.length === 0) { - core.notice('No issues has found. Nothing to label.'); - return; - } - - for (const issue of issues) { - core.info(`Adding label to the issue #${ issue }...`); - await addLabelToIssue(issue, process.env.LABEL_NAME); - core.info('Done.\n'); - } - - async function addLabelToIssue(issue, label) { - return await github.request('POST /repos/{owner}/{repo}/issues/{issue_number}/labels', { - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: issue, - labels: [ label ], - }); - } diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml deleted file mode 100644 index 05155cbd32..0000000000 --- a/.github/workflows/pre-release.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Pre-release - -on: - workflow_dispatch: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+-[a-z]+*' # e.g v1.2.3-alpha.2 - -jobs: - checks: - name: Run code checks - uses: "./.github/workflows/checks.yml" - secrets: inherit - - # publish_image: - # image will be published in e2e-tests.yml workflow - # name: Publish Docker image - # uses: './.github/workflows/publish-image.yml' - # secrets: inherit - - e2e_tests: - name: Run e2e tests - needs: checks - uses: "./.github/workflows/e2e-tests.yml" - secrets: inherit - - version: - name: Pre-release version info - runs-on: ubuntu-latest - outputs: - is_initial: ${{ steps.is_initial.outputs.result }} - steps: - - name: Determine if it is the initial version of the pre-release - id: is_initial - uses: actions/github-script@v7 - env: - TAG: ${{ github.ref_name }} - with: - script: | - const tag = process.env.TAG; - const REGEXP = /^v[0-9]+.[0-9]+.[0-9]+-[a-z]+((\.|-)\d+)?$/i; - const match = tag.match(REGEXP); - const isInitial = match && !match[1] ? true : false; - core.info('is_initial flag value: ', isInitial); - return isInitial; - - label_issues: - name: Add pre-release label to issues - uses: './.github/workflows/label-issues-in-release.yml' - needs: [ version ] - if: ${{ needs.version.outputs.is_initial == 'true' }} - with: - tag: ${{ github.ref_name }} - label_name: 'pre-release' - label_description: Tasks in pre-release right now - secrets: inherit - - # Temporary disable this step because it is broken - # There is an issue with building web3modal deps - upload_source_maps: - name: Upload source maps to Sentry - if: false - uses: './.github/workflows/upload-source-maps.yml' - secrets: inherit diff --git a/.github/workflows/project-management.yml b/.github/workflows/project-management.yml deleted file mode 100644 index 1da733baeb..0000000000 --- a/.github/workflows/project-management.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Project management -on: - issues: - types: [ closed ] - pull_request: - types: [ review_requested ] - -jobs: - not_planned_issue: - name: Update task for not planned issue - if: ${{ github.event.issue && github.event.action == 'closed' && github.event.issue.state_reason == 'not_planned' }} - uses: './.github/workflows/update-project-cards.yml' - with: - project_name: ${{ vars.PROJECT_NAME }} - field_name: Status - field_value: Done - issues: "[${{ github.event.issue.number }}]" - secrets: inherit - - completed_issue: - name: Update task for completed issue - if: ${{ github.event.issue && github.event.action == 'closed' && github.event.issue.state_reason == 'completed' }} - uses: './.github/workflows/update-project-cards.yml' - with: - project_name: ${{ vars.PROJECT_NAME }} - field_name: Status - field_value: Ready For Realease - issues: "[${{ github.event.issue.number }}]" - secrets: inherit - - pr_linked_issues: - name: Get issues linked to PR - runs-on: ubuntu-latest - if: ${{ github.event.pull_request && github.event.action == 'review_requested' }} - outputs: - issues: ${{ steps.linked_issues.outputs.result }} - steps: - - name: Fetching issues linked to pull request - id: linked_issues - uses: actions/github-script@v7 - env: - PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} - with: - script: | - const response = await github.graphql(` - query ($owner: String!, $repo: String!, $pr: Int!) { - repository(owner: $owner, name: $repo) { - pullRequest(number: $pr) { - number - title - closingIssuesReferences(first: 100) { - nodes { - number - title - closed - } - } - } - } - } - `, { - owner: context.repo.owner, - repo: context.repo.repo, - pr: Number(process.env.PULL_REQUEST_NUMBER), - }); - - const { repository: { pullRequest: { closingIssuesReferences } } } = response; - const issues = closingIssuesReferences.nodes.map(({ number }) => number); - - if (!issues.length) { - core.notice(`No linked issues found for pull request #${ process.env.PULL_REQUEST_NUMBER }`); - return; - } - - core.info(`Found ${ issues.length } issue(s): ${ issues.join(', ') || '-' }`); - - return issues; - - issues_in_review: - name: Update status for issues in review - needs: [ pr_linked_issues ] - if: ${{ needs.pr_linked_issues.outputs.issues }} - uses: './.github/workflows/update-project-cards.yml' - secrets: inherit - with: - project_name: ${{ vars.PROJECT_NAME }} - field_name: Status - field_value: Review - issues: ${{ needs.pr_linked_issues.outputs.issues }} - - copy_labels: - name: Copy issues labels to pull request - needs: [ pr_linked_issues ] - if: ${{ needs.pr_linked_issues.outputs.issues }} - uses: './.github/workflows/copy-issues-labels.yml' - secrets: inherit - with: - pr_number: ${{ github.event.pull_request.number }} - issues: ${{ needs.pr_linked_issues.outputs.issues }} diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml deleted file mode 100644 index 97c1102e8f..0000000000 --- a/.github/workflows/publish-image.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Publish Docker image - -on: - workflow_dispatch: - inputs: - tags: - description: Image tags - required: false - type: string - build_args: - description: Build-time variables - required: false - type: string - platforms: - description: Image platforms (you can specify multiple platforms separated by comma) - required: false - type: string - default: linux/amd64 - workflow_call: - inputs: - tags: - description: Image tags - required: false - type: string - build_args: - description: Build-time variables - required: false - type: string - platforms: - description: Image platforms (you can specify multiple platforms separated by comma) - required: false - type: string - default: linux/amd64 - -jobs: - run: - name: Run - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - # Will automatically make nice tags, see the table here https://github.com/docker/metadata-action#basic - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/blockscout/frontend - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Add SHORT_SHA env property with commit short sha - run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV - - - name: Debug - env: - REF_TYPE: ${{ github.ref_type }} - REF_NAME: ${{ github.ref_name }} - run: | - echo "ref_type: $REF_TYPE" - echo "ref_name: $REF_NAME" - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - push: true - cache-from: type=gha - tags: ${{ inputs.tags || steps.meta.outputs.tags }} - platforms: ${{ inputs.platforms }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - GIT_COMMIT_SHA=${{ env.SHORT_SHA }} - GIT_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }} - ${{ inputs.build_args }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index df2c0433b1..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Release - -on: - workflow_dispatch: - release: - types: [ released ] - -jobs: - remove_prerelease_label: - name: Remove pre-release label from issues - runs-on: ubuntu-latest - steps: - - name: Remove label - id: tags - uses: actions/github-script@v7 - env: - LABEL_NAME: pre-release - with: - script: | - const { data: issues } = await github.request('GET /repos/{owner}/{repo}/issues', { - owner: context.repo.owner, - repo: context.repo.repo, - labels: process.env.LABEL_NAME, - state: 'all' - }); - - if (issues.length === 0) { - core.notice(`No issues with label "${ process.env.LABEL_NAME }" found.`); - return; - } - - const issueIds = issues.map(({ node_id }) => node_id); - const labelId = issues[0].labels.find(({ name }) => name === process.env.LABEL_NAME).node_id; - - core.info(`Found ${ issueIds.length } issues with label "${ process.env.LABEL_NAME }"`); - - for (const issueId of issueIds) { - core.info(`Removing label for issue with node_id ${ issueId }...`); - - await github.graphql(` - mutation($input: RemoveLabelsFromLabelableInput!) { - removeLabelsFromLabelable(input: $input) { - clientMutationId - } - } - `, { - input: { - labelIds: [ labelId ], - labelableId: issueId - }, - }); - - core.info('Done.\n'); - } - - - label_released_issues: - name: Label released issues - uses: './.github/workflows/label-issues-in-release.yml' - with: - tag: ${{ github.ref_name }} - label_name: ${{ github.ref_name }} - label_description: Release ${{ github.ref_name }} - secrets: inherit - - update_project_cards: - name: Update project tasks statuses - needs: label_released_issues - uses: './.github/workflows/update-project-cards.yml' - with: - project_name: ${{ vars.PROJECT_NAME }} - field_name: Status - field_value: Released - issues: ${{ needs.label_released_issues.outputs.issues }} - secrets: inherit - - publish_image: - name: Publish Docker image - uses: './.github/workflows/publish-image.yml' - secrets: inherit - with: - platforms: linux/amd64,linux/arm64/v8 - - # Temporary disable this step because it is broken - # There is an issue with building web3modal deps - upload_source_maps: - name: Upload source maps to Sentry - if: false - needs: publish_image - uses: './.github/workflows/upload-source-maps.yml' - secrets: inherit diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml deleted file mode 100644 index bcc1a36ca1..0000000000 --- a/.github/workflows/stale-issues.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Close inactive issues -on: - schedule: - - cron: "55 1 * * *" - -jobs: - close-issues: - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - steps: - - uses: actions/stale@v5 - with: - # issues - only-issue-labels: "need info" - days-before-issue-stale: 14 - days-before-issue-close: 7 - stale-issue-label: "stale" - stale-issue-message: "This issue is stale because it has been open for 14 days with no activity." - close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale." - - # pull requests - days-before-pr-stale: -1 - days-before-pr-close: -1 - - # other settings - repo-token: ${{ secrets.GITHUB_TOKEN }} - close-issue-reason: "not_planned" \ No newline at end of file diff --git a/.github/workflows/update-project-cards.yml b/.github/workflows/update-project-cards.yml deleted file mode 100644 index b071ba61da..0000000000 --- a/.github/workflows/update-project-cards.yml +++ /dev/null @@ -1,240 +0,0 @@ -name: Update project cards for issues - -on: - workflow_dispatch: - inputs: - project_name: - description: Name of the project - default: Front-end tasks - required: true - type: string - field_name: - description: Field name to be updated - default: Status - required: true - type: string - field_value: - description: New value of the field - default: Released - required: true - type: string - issues: - description: JSON encoded list of issue numbers to be updated - required: true - type: string - workflow_call: - inputs: - project_name: - description: Name of the project - required: true - type: string - field_name: - description: Field name to be updated - required: true - type: string - field_value: - description: New value of the field - required: true - type: string - issues: - description: JSON encoded list of issue numbers to be updated - required: true - type: string - -jobs: - run: - name: Run - runs-on: ubuntu-latest - steps: - - name: Getting project info - id: project_info - uses: actions/github-script@v7 - env: - PROJECT_NAME: ${{ inputs.project_name }} - FIELD_NAME: ${{ inputs.field_name }} - FIELD_VALUE: ${{ inputs.field_value }} - with: - github-token: ${{ secrets.BOT_LABEL_ISSUE_TOKEN }} - script: | - const response = await github.graphql(` - query ($login: String!, $q: String!) { - organization(login: $login) { - projectsV2(query: $q, first: 1) { - nodes { - id, - title, - number, - fields(first: 20) { - nodes { - ... on ProjectV2Field { - id - name - } - ... on ProjectV2SingleSelectField { - id - name - options { - id - name - } - } - } - } - } - } - } - } - `, { - login: context.repo.owner, - q: process.env.PROJECT_NAME, - }); - - const { organization: { projectsV2: { nodes: projects } } } = response; - - if (projects.length === 0) { - core.setFailed('Project not found.'); - return; - } - - if (projects.length > 1) { - core.info(`Fould ${ projects.length } with the similar name:`); - projects.forEach((issue) => { - core.info(` #${ projects.number } - ${ projects.title }`); - }) - core.setFailed('Fould multiple projects with the similar name. Cannot determine which one to use.'); - return; - } - - const { id: projectId, fields: { nodes: fields } } = projects[0]; - const field = fields.find((field) => field.name === process.env.FIELD_NAME); - - if (!field) { - core.setFailed(`Field with name "${ process.env.FIELD_NAME }" not found in the project.`); - return; - } - - const option = field.options.find((option) => option.name === process.env.FIELD_VALUE); - - if (!option) { - core.setFailed(`Option with name "${ process.env.FIELD_VALUE }" not found in the field possible values.`); - return; - } - - core.info('Found following info:'); - core.info(` project_id: ${ projectId }`); - core.info(` field_id: ${ field.id }`); - core.info(` field_value_id: ${ option.id }`); - - core.setOutput('id', projectId); - core.setOutput('field_id', field.id); - core.setOutput('field_value_id', option.id); - - - name: Getting project items that linked to the issues - id: items - uses: actions/github-script@v7 - env: - ISSUES: ${{ inputs.issues }} - with: - github-token: ${{ secrets.BOT_LABEL_ISSUE_TOKEN }} - script: | - const result = []; - const issues = JSON.parse(process.env.ISSUES); - - for (const issue of issues) { - const response = await getProjectItemId(issue); - response?.length > 0 && result.push(...response); - } - - return result; - - async function getProjectItemId(issueId) { - core.info(`Fetching project items for issue #${ issueId }...`); - - try { - const response = await github.graphql(` - query ($owner: String!, $repo: String!, $id: Int!) { - repository(owner: $owner, name: $repo) { - issue(number: $id) { - title, - projectItems(first: 10) { - nodes { - id, - } - } - } - } - } - `, - { - owner: context.repo.owner, - repo: context.repo.repo, - id: issueId, - } - ); - - const { repository: { issue: { projectItems: { nodes: projectItems } } } } = response; - - if (projectItems.length === 0) { - core.info('No project items found.\n'); - return []; - } - - const ids = projectItems.map((item) => item.id); - core.info(`Found [ ${ ids.join(', ') } ].\n`); - return ids; - - } catch (error) { - if (error.status === 404) { - core.info('Nothing has found.\n'); - return []; - } - } - } - - - name: Updating field value of the project items - id: updating_items - uses: actions/github-script@v7 - env: - ITEMS: ${{ steps.items.outputs.result }} - PROJECT_ID: ${{ steps.project_info.outputs.id }} - FIELD_ID: ${{ steps.project_info.outputs.field_id }} - FIELD_VALUE_ID: ${{ steps.project_info.outputs.field_value_id }} - with: - github-token: ${{ secrets.BOT_LABEL_ISSUE_TOKEN }} - script: | - const items = JSON.parse(process.env.ITEMS); - - if (items.length === 0) { - core.info('Nothing to update.'); - core.notice('No project items found for provided issues. Nothing to update.'); - return; - } - - for (const item of items) { - core.info(`Changing field value for item ${ item }...`); - await changeItemFieldValue(item); - core.info('Done.\n'); - } - - async function changeItemFieldValue(itemId) { - return await github.graphql( - ` - mutation($input: UpdateProjectV2ItemFieldValueInput!) { - updateProjectV2ItemFieldValue(input: $input) { - clientMutationId - } - } - `, - { - input: { - projectId: process.env.PROJECT_ID, - fieldId: process.env.FIELD_ID, - itemId, - value: { - singleSelectOptionId: process.env.FIELD_VALUE_ID, - }, - }, - } - ); - }; - diff --git a/.github/workflows/upload-source-maps.yml b/.github/workflows/upload-source-maps.yml deleted file mode 100644 index 55b18067fe..0000000000 --- a/.github/workflows/upload-source-maps.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Upload source maps to Sentry -on: - workflow_call: - workflow_dispatch: - -env: - SENTRY_ORG: ${{ vars.SENTRY_ORG }} - SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} - SENTRY_DSN: ${{ secrets.SENTRY_DSN }} - -jobs: - build_and_upload: - name: Build app with source maps and upload to Sentry - runs-on: ubuntu-latest - if: ${{ github.ref_type == 'tag' }} - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20.11.0 - cache: 'yarn' - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-node-modules - with: - path: | - node_modules - key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} - - - name: Install dependencies - if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile --ignore-optional - - - name: Make production build with source maps - run: yarn build - env: - NODE_ENV: production - - - name: Inject Sentry debug ID - run: yarn sentry-cli sourcemaps inject ./.next - - - name: Upload source maps to Sentry - run: yarn sentry-cli sourcemaps upload --release=${{ github.ref_name }} --url-prefix=~/_next/ --validate ./.next \ No newline at end of file diff --git a/package.json b/package.json index 601d5afb2b..222bc727e1 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,9 @@ "dev": "./tools/scripts/dev.sh", "dev:preset": "./tools/scripts/dev.preset.sh", "build": "next build", - "build:docker": "docker build --build-arg GIT_COMMIT_SHA=$(git rev-parse --short HEAD) --build-arg GIT_TAG=$(git describe --tags --abbrev=0) -t blockscout-frontend:local ./", + "build:docker": "docker build --platform linux/amd64 --build-arg GIT_COMMIT_SHA=$(git rev-parse --short HEAD) --build-arg GIT_TAG=$(git describe --tags --abbrev=0) -t lucoadam/blockscout-naut-frontend ./", "start": "next start", - "start:docker:local": "docker run -p 3000:3000 --env-file .env.local blockscout-frontend:local", + "start:docker:local": "docker run -p 3000:3000 --env-file .env.local lucoadam/blockscout-naut-frontend", "start:docker:preset": "./tools/scripts/docker.preset.sh", "lint:eslint": "eslint . --ext .js,.jsx,.ts,.tsx", "lint:eslint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix", @@ -123,6 +123,7 @@ "@types/mixpanel-browser": "^2.38.1", "@types/node": "20.11.0", "@types/phoenix": "^1.5.4", + "@types/pino": "^7.0.5", "@types/qrcode": "^1.5.0", "@types/react": "18.0.9", "@types/react-dom": "18.0.5", diff --git a/public/assets/favicon/android-chrome-192x192.png b/public/assets/favicon/android-chrome-192x192.png new file mode 100644 index 0000000000..55542b97b9 Binary files /dev/null and b/public/assets/favicon/android-chrome-192x192.png differ diff --git a/public/assets/favicon/android-chrome-512x512.png b/public/assets/favicon/android-chrome-512x512.png new file mode 100644 index 0000000000..4ba057af34 Binary files /dev/null and b/public/assets/favicon/android-chrome-512x512.png differ diff --git a/public/assets/favicon/apple-touch-icon-180x180.png b/public/assets/favicon/apple-touch-icon-180x180.png index 06dd66a668..57d7b69534 100644 Binary files a/public/assets/favicon/apple-touch-icon-180x180.png and b/public/assets/favicon/apple-touch-icon-180x180.png differ diff --git a/public/assets/favicon/favicon-16x16.png b/public/assets/favicon/favicon-16x16.png index ee37c4c3a5..790046e3ee 100644 Binary files a/public/assets/favicon/favicon-16x16.png and b/public/assets/favicon/favicon-16x16.png differ diff --git a/public/assets/favicon/favicon-32x32.png b/public/assets/favicon/favicon-32x32.png index f004f2956c..0698a29016 100644 Binary files a/public/assets/favicon/favicon-32x32.png and b/public/assets/favicon/favicon-32x32.png differ diff --git a/public/assets/favicon/favicon.ico b/public/assets/favicon/favicon.ico index 145e61f5ae..703cd6845a 100644 Binary files a/public/assets/favicon/favicon.ico and b/public/assets/favicon/favicon.ico differ diff --git a/public/assets/favicon/mstile-144x144.png b/public/assets/favicon/mstile-144x144.png new file mode 100644 index 0000000000..93ea9afb38 Binary files /dev/null and b/public/assets/favicon/mstile-144x144.png differ diff --git a/public/assets/favicon/mstile-150x150.png b/public/assets/favicon/mstile-150x150.png new file mode 100644 index 0000000000..3c8c1da251 Binary files /dev/null and b/public/assets/favicon/mstile-150x150.png differ diff --git a/public/assets/favicon/mstile-310x150.png b/public/assets/favicon/mstile-310x150.png new file mode 100644 index 0000000000..c976a5de59 Binary files /dev/null and b/public/assets/favicon/mstile-310x150.png differ diff --git a/public/assets/favicon/mstile-310x310.png b/public/assets/favicon/mstile-310x310.png new file mode 100644 index 0000000000..33f041454c Binary files /dev/null and b/public/assets/favicon/mstile-310x310.png differ diff --git a/public/assets/favicon/mstile-70x70.png b/public/assets/favicon/mstile-70x70.png new file mode 100644 index 0000000000..5d561d6a99 Binary files /dev/null and b/public/assets/favicon/mstile-70x70.png differ diff --git a/public/envs.js b/public/envs.js new file mode 100644 index 0000000000..19302bc854 --- /dev/null +++ b/public/envs.js @@ -0,0 +1,21 @@ +window.__envs = { +NEXT_PUBLIC_GIT_TAG: "v1.30.0-alpha", +NEXT_PUBLIC_HOMEPAGE_CHARTS: "[daily_txs]", +NEXT_PUBLIC_API_HOST: "localhost:4000", +NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL: "ws", +NEXT_PUBLIC_NETWORK_ID: "56760454122", +NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL: "NAUT", +NEXT_PUBLIC_GIT_COMMIT_SHA: "7f742762", +NEXT_PUBLIC_VISUALIZE_API_HOST: "http://localhost:8081", +NEXT_PUBLIC_APP_HOST: "localhost", +NEXT_PUBLIC_NETWORK_CURRENCY_DECIMALS: "18", +NEXT_PUBLIC_NETWORK_NAME: "3Base Testnet", +NEXT_PUBLIC_NETWORK_SHORT_NAME: "3Base Testnet", +NEXT_PUBLIC_API_PROTOCOL: "http", +NEXT_PUBLIC_IS_TESTNET: "true", +NEXT_PUBLIC_API_BASE_PATH: "/", +NEXT_PUBLIC_APP_PROTOCOL: "http", +NEXT_PUBLIC_API_SPEC_URL: "https://raw.githubusercontent.com/blockscout/blockscout-api-v2-swagger/main/swagger.yaml", +NEXT_PUBLIC_STATS_API_HOST: "http://localhost:8080", +NEXT_PUBLIC_NETWORK_CURRENCY_NAME: "Naut", +} diff --git a/public/favicon/safari-pinned-tab.svg b/public/favicon/safari-pinned-tab.svg new file mode 100644 index 0000000000..cd9c6452e4 --- /dev/null +++ b/public/favicon/safari-pinned-tab.svg @@ -0,0 +1,3 @@ + + + diff --git a/ui/snippets/footer/Footer.tsx b/ui/snippets/footer/Footer.tsx index cf9eeea0d5..1acecc718e 100644 --- a/ui/snippets/footer/Footer.tsx +++ b/ui/snippets/footer/Footer.tsx @@ -1,5 +1,5 @@ import type { GridProps } from '@chakra-ui/react'; -import { Box, Grid, Flex, Text, Link, VStack, Skeleton } from '@chakra-ui/react'; +import { Box, Grid, Flex, VStack, Skeleton } from '@chakra-ui/react'; import { useQuery } from '@tanstack/react-query'; import React from 'react'; @@ -7,85 +7,79 @@ import type { CustomLinksGroup } from 'types/footerLinks'; import config from 'configs/app'; import type { ResourceError } from 'lib/api/resources'; -import useApiQuery from 'lib/api/useApiQuery'; import useFetch from 'lib/hooks/useFetch'; -import useIssueUrl from 'lib/hooks/useIssueUrl'; import NetworkAddToWallet from 'ui/shared/NetworkAddToWallet'; import FooterLinkItem from './FooterLinkItem'; import IntTxsIndexingStatus from './IntTxsIndexingStatus'; -import getApiVersionUrl from './utils/getApiVersionUrl'; const MAX_LINKS_COLUMNS = 4; -const FRONT_VERSION_URL = `https://github.com/blockscout/frontend/tree/${ config.UI.footer.frontendVersion }`; -const FRONT_COMMIT_URL = `https://github.com/blockscout/frontend/commit/${ config.UI.footer.frontendCommit }`; - const Footer = () => { - const { data: backendVersionData } = useApiQuery('config_backend_version', { - queryOptions: { - staleTime: Infinity, - }, - }); - const apiVersionUrl = getApiVersionUrl(backendVersionData?.backend_version); - const issueUrl = useIssueUrl(backendVersionData?.backend_version); - const BLOCKSCOUT_LINKS = [ - { - icon: 'edit' as const, - iconSize: '16px', - text: 'Submit an issue', - url: issueUrl, - }, - { - icon: 'social/canny' as const, - iconSize: '20px', - text: 'Feature request', - url: 'https://blockscout.canny.io/feature-requests', - }, - { - icon: 'social/git' as const, - iconSize: '18px', - text: 'Contribute', - url: 'https://github.com/blockscout/blockscout', - }, - { - icon: 'social/twitter' as const, - iconSize: '18px', - text: 'X (ex-Twitter)', - url: 'https://www.twitter.com/blockscoutcom', - }, - { - icon: 'social/discord' as const, - iconSize: '24px', - text: 'Discord', - url: 'https://discord.gg/blockscout', - }, - { - icon: 'discussions' as const, - iconSize: '20px', - text: 'Discussions', - url: 'https://github.com/orgs/blockscout/discussions', - }, - { - icon: 'donate' as const, - iconSize: '20px', - text: 'Donate', - url: 'https://github.com/sponsors/blockscout', - }, - ]; - - const frontendLink = (() => { - if (config.UI.footer.frontendVersion) { - return { config.UI.footer.frontendVersion }; - } - - if (config.UI.footer.frontendCommit) { - return { config.UI.footer.frontendCommit }; - } - - return null; - })(); + // const { data: backendVersionData } = useApiQuery('config_backend_version', { + // queryOptions: { + // staleTime: Infinity, + // }, + // }); + // const apiVersionUrl = getApiVersionUrl(backendVersionData?.backend_version); + // const issueUrl = useIssueUrl(backendVersionData?.backend_version); + // const BLOCKSCOUT_LINKS = [ + // { + // icon: 'edit' as const, + // iconSize: '16px', + // text: 'Submit an issue', + // url: issueUrl, + // }, + // { + // icon: 'social/canny' as const, + // iconSize: '20px', + // text: 'Feature request', + // url: 'https://blockscout.canny.io/feature-requests', + // }, + // { + // icon: 'social/git' as const, + // iconSize: '18px', + // text: 'Contribute', + // url: 'https://github.com/blockscout/blockscout', + // }, + // { + // icon: 'social/twitter' as const, + // iconSize: '18px', + // text: 'X (ex-Twitter)', + // url: 'https://www.twitter.com/blockscoutcom', + // }, + // { + // icon: 'social/discord' as const, + // iconSize: '24px', + // text: 'Discord', + // url: 'https://discord.gg/blockscout', + // }, + // { + // icon: 'discussions' as const, + // iconSize: '20px', + // text: 'Discussions', + // url: 'https://github.com/orgs/blockscout/discussions', + // }, + // { + // icon: 'donate' as const, + // iconSize: '20px', + // text: 'Donate', + // url: 'https://github.com/sponsors/blockscout', + // }, + // ]; + + // const frontendLink = (() => { + // if (config.UI.footer.frontendVersion) { + // return { config.UI.footer.frontendVersion }; + // } + + // if (config.UI.footer.frontendCommit) { + // return { config.UI.footer.frontendCommit }; + // } + + // return null; + // })(); const fetch = useFetch(); @@ -115,28 +109,28 @@ const Footer = () => { ); }, []); - const renderProjectInfo = React.useCallback((gridArea?: GridProps['gridArea']) => { - return ( - - blockscout.com - - Blockscout is a tool for inspecting and analyzing EVM based blockchains. Blockchain explorer for Ethereum Networks. - - - { apiVersionUrl && ( - - Backend: { backendVersionData?.backend_version } - - ) } - { frontendLink && ( - - Frontend: { frontendLink } - - ) } - - - ); - }, [ apiVersionUrl, backendVersionData?.backend_version, frontendLink ]); + // const renderProjectInfo = React.useCallback((gridArea?: GridProps['gridArea']) => { + // return ( + // + // blockscout.com + // + // Blockscout is a tool for inspecting and analyzing EVM based blockchains. Blockchain explorer for Ethereum Networks. + // + // + // { apiVersionUrl && ( + // + // Backend: { backendVersionData?.backend_version } + // + // ) } + // { frontendLink && ( + // + // Frontend: { frontendLink } + // + // ) } + // + // + // ); + // }, [ apiVersionUrl, backendVersionData?.backend_version, frontendLink ]); const containerProps: GridProps = { as: 'footer', @@ -153,7 +147,6 @@ const Footer = () => {
{ renderNetworkInfo() } - { renderProjectInfo() }
{ > { ([ - { title: 'Blockscout', links: BLOCKSCOUT_LINKS }, + // { title: 'Blockscout', links: BLOCKSCOUT_LINKS }, ...(linksData || []), ]) .slice(0, colNum) @@ -198,7 +191,6 @@ const Footer = () => { > { renderNetworkInfo({ lg: 'network' }) } - { renderProjectInfo({ lg: 'info' }) } { justifyContent={{ lg: 'flex-end' }} mt={{ base: 8, lg: 0 }} > - { BLOCKSCOUT_LINKS.map(link => ) } + { /* { BLOCKSCOUT_LINKS.map(link => ) } */ } ); diff --git a/yarn.lock b/yarn.lock index a499b76eb7..41e552841c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6251,6 +6251,13 @@ resolved "https://registry.yarnpkg.com/@types/phoenix/-/phoenix-1.5.4.tgz#c08a1da6d7b4e365f6a1fe1ff9aada55f5356d24" integrity sha512-L5eZmzw89eXBKkiqVBcJfU1QGx9y+wurRIEgt0cuLH0hwNtVUxtx+6cu0R2STwWj468sjXyBYPYDtGclUd1kjQ== +"@types/pino@^7.0.5": + version "7.0.5" + resolved "https://registry.yarnpkg.com/@types/pino/-/pino-7.0.5.tgz#1c84a81b924a6a9e263dbb581dffdbad7a3c60c4" + integrity sha512-wKoab31pknvILkxAF8ss+v9iNyhw5Iu/0jLtRkUD74cNfOOLJNnqfFKAv0r7wVaTQxRZtWrMpGfShwwBjOcgcg== + dependencies: + pino "*" + "@types/prettier@^2.1.5": version "2.7.1" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.1.tgz#dfd20e2dc35f027cdd6c1908e80a5ddc7499670e" @@ -13190,6 +13197,14 @@ pino-abstract-transport@^1.0.0, pino-abstract-transport@v1.0.0: readable-stream "^4.0.0" split2 "^4.0.0" +pino-abstract-transport@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/pino-abstract-transport/-/pino-abstract-transport-1.2.0.tgz#97f9f2631931e242da531b5c66d3079c12c9d1b5" + integrity sha512-Guhh8EZfPCfH+PMXAb6rKOjGQEoy0xlAIn+irODG5kgfYV+BQ0rGYYWTIel3P5mmyXqkYkPmdIkywsn6QKUR1Q== + dependencies: + readable-stream "^4.0.0" + split2 "^4.0.0" + pino-abstract-transport@v0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/pino-abstract-transport/-/pino-abstract-transport-0.5.0.tgz#4b54348d8f73713bfd14e3dc44228739aa13d9c0" @@ -13239,6 +13254,28 @@ pino-std-serializers@^6.0.0: resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-6.0.0.tgz#4c20928a1bafca122fdc2a7a4a171ca1c5f9c526" integrity sha512-mMMOwSKrmyl+Y12Ri2xhH1lbzQxwwpuru9VjyJpgFIH4asSj88F2csdMwN6+M5g1Ll4rmsYghHLQJw81tgZ7LQ== +pino-std-serializers@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz#7c625038b13718dbbd84ab446bd673dc52259e3b" + integrity sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA== + +pino@*: + version "9.1.0" + resolved "https://registry.yarnpkg.com/pino/-/pino-9.1.0.tgz#f734617ad096568cc905e6a227266dbd6100c3fb" + integrity sha512-qUcgfrlyOtjwhNLdbhoL7NR4NkHjzykAPw0V2QLFbvu/zss29h4NkRnibyFzBrNCbzCOY3WZ9hhKSwfOkNggYA== + dependencies: + atomic-sleep "^1.0.0" + fast-redact "^3.1.1" + on-exit-leak-free "^2.1.0" + pino-abstract-transport "^1.2.0" + pino-std-serializers "^7.0.0" + process-warning "^3.0.0" + quick-format-unescaped "^4.0.3" + real-require "^0.2.0" + safe-stable-stringify "^2.3.1" + sonic-boom "^4.0.1" + thread-stream "^3.0.0" + pino@7.11.0: version "7.11.0" resolved "https://registry.yarnpkg.com/pino/-/pino-7.11.0.tgz#0f0ea5c4683dc91388081d44bff10c83125066f6" @@ -13539,6 +13576,11 @@ process-warning@^2.0.0: resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-2.0.0.tgz#341dbeaac985b90a04ebcd844d50097c7737b2ee" integrity sha512-+MmoAXoUX+VTHAlwns0h+kFUWFs/3FZy+ZuchkgjyOu3oioLAo2LB5aCfKPh2+P9O18i3m43tUEv3YqttSy0Ww== +process-warning@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-3.0.0.tgz#96e5b88884187a1dce6f5c3166d611132058710b" + integrity sha512-mqn0kFRl0EoqhnL0GQ0veqFHyIN1yig9RHh/InzORTUiZHFRAur+aMtRkELNwGs9aNwKS6tg/An4NYBPGwvtzQ== + process@^0.10.0: version "0.10.1" resolved "https://registry.yarnpkg.com/process/-/process-0.10.1.tgz#842457cc51cfed72dc775afeeafb8c6034372725" @@ -14723,6 +14765,13 @@ sonic-boom@^3.0.0, sonic-boom@^3.1.0: dependencies: atomic-sleep "^1.0.0" +sonic-boom@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-4.0.1.tgz#515b7cef2c9290cb362c4536388ddeece07aed30" + integrity sha512-hTSD/6JMLyT4r9zeof6UtuBDpjJ9sO08/nmS5djaA9eozT9oOlNdpXSnzcgj4FTqpk3nkLrs61l4gip9r1HCrQ== + dependencies: + atomic-sleep "^1.0.0" + source-map-js@^1.0.1, source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" @@ -15292,6 +15341,13 @@ thread-stream@^2.0.0: dependencies: real-require "^0.2.0" +thread-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-3.0.0.tgz#3548327972fe1f5d3c78049d35aeacdce8c21771" + integrity sha512-oUIFjxaUT6knhPtWgDMc29zF1FcSl0yXpapkyrQrCGEfYA2HUZXCilUtKyYIv6HkCyqSPAMkY+EG0GbyIrNDQg== + dependencies: + real-require "^0.2.0" + thriftrw@^3.5.0: version "3.11.4" resolved "https://registry.yarnpkg.com/thriftrw/-/thriftrw-3.11.4.tgz#84c990ee89e926631c0b475909ada44ee9249870"