diff --git a/.github/codecov.yml b/.github/codecov.yml index 0ae07583b..713e5823c 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,30 +1,29 @@ codecov: branch: dev + notify: + after_n_builds: 2 + wait_for_ci: true coverage: - range: 70..90 + range: [70, 90] round: down precision: 2 status: - patch: - enabled: false - project: - enabled: false + patch: false + project: false flag_management: default_rules: carryforward: true statuses: - type: project - target: 70..90 + target: auto + threshold: 1 - type: patch + target: 50 comment: - layout: - - reach - - diff - - flags - - files + layout: 'reach, diff, flags, files' behavior: default parsers: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 810060b20..5ab22d439 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,11 @@ concurrency: jobs: test-and-lint: name: Test and Lint - runs-on: ubuntu-cpu16-ram64 + runs-on: + - ubuntu + - self-hosted + if: (github.event_name == 'pull_request' && !github.event.pull_request.draft) || (github.event_name == 'push' && github.ref == 'refs/heads/dev') + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 @@ -37,12 +41,16 @@ jobs: build: name: Build - runs-on: ubuntu-cpu16-ram64 + runs-on: + - ubuntu + - self-hosted + if: (github.event_name == 'pull_request' && !github.event.pull_request.draft) || (github.event_name == 'push' && github.ref == 'refs/heads/dev') needs: test-and-lint env: FALCONER_ENDPOINT: ${{ secrets.FALCONER_ENDPOINT }} TURNSTILE_SITEKEY: ${{ secrets.TURNSTILE_SITEKEY }} NX_AIRDROP_ENDPOINT: ${{ secrets.NX_AIRDROP_ENDPOINT }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 293cd03d1..88a961c7d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,9 +2,12 @@ name: 'CodeQL' on: push: - branches: ['dev', 'prod'] + branches: + - dev + - prod pull_request: - branches: ['dev'] + branches: + - dev schedule: - cron: '0 8 * * 1' merge_group: diff --git a/.github/workflows/preview-vercel-faucet.yml b/.github/workflows/preview-vercel-faucet.yml index 4f1d4fb1c..700b518fc 100644 --- a/.github/workflows/preview-vercel-faucet.yml +++ b/.github/workflows/preview-vercel-faucet.yml @@ -1,4 +1,4 @@ -name: Faucet Preview Deployment +name: Faucet Deploy on: push: @@ -8,16 +8,18 @@ on: branches: - dev workflow_dispatch: - merge_group: jobs: - Deploy-Preview: - runs-on: ubuntu-cpu16-ram64 + Preview: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_FAUCET_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/preview-vercel-governance.yml b/.github/workflows/preview-vercel-governance.yml deleted file mode 100644 index bd05f6b1b..000000000 --- a/.github/workflows/preview-vercel-governance.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Governance Preview Deployment - -on: - push: - branches: - - dev - pull_request: - branches: - - dev - workflow_dispatch: - merge_group: - -jobs: - Deploy-Preview: - runs-on: ubuntu-cpu16-ram64 - env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_GOVERNANCE_PROJECT_ID }} - NX_SKIP_NX_CACHE: true - GIT_COMMIT_SHA: ${{ github.sha }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - cache: yarn - - name: Install Vercel CLI - run: npm install -g vercel@latest - - name: Pull Vercel Environment Information - run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} - - name: Build Project Artifacts - run: vercel build ./apps/governance --token=${{ secrets.VERCEL_TOKEN }} --local-config vercel-react.json - - name: Deploy Project Artifacts to Vercel - run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --local-config vercel-react.json diff --git a/.github/workflows/preview-vercel-haqq-website.yml b/.github/workflows/preview-vercel-haqq-website.yml index 20e3bc5c9..692d8371c 100644 --- a/.github/workflows/preview-vercel-haqq-website.yml +++ b/.github/workflows/preview-vercel-haqq-website.yml @@ -1,4 +1,4 @@ -name: Haqq-website Preview Deployment +name: Haqq Website Deploy on: push: @@ -8,16 +8,18 @@ on: branches: - dev workflow_dispatch: - merge_group: jobs: - Deploy-Preview: - runs-on: ubuntu-cpu16-ram64 + Preview: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_HAQQ_WEBSITE_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/preview-vercel-islamic-website.yml b/.github/workflows/preview-vercel-islamic-website.yml index 81b8c299f..f7e42bdf0 100644 --- a/.github/workflows/preview-vercel-islamic-website.yml +++ b/.github/workflows/preview-vercel-islamic-website.yml @@ -1,4 +1,4 @@ -name: Islamic-website Preview Deployment +name: Islamic Website Deploy on: push: @@ -8,16 +8,18 @@ on: branches: - dev workflow_dispatch: - merge_group: jobs: - Deploy-Preview: - runs-on: ubuntu-cpu16-ram64 + Preview: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_ISLAMIC_WEBSITE_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/preview-vercel-shell.yml b/.github/workflows/preview-vercel-shell.yml index 770ba03e8..f287d2aea 100644 --- a/.github/workflows/preview-vercel-shell.yml +++ b/.github/workflows/preview-vercel-shell.yml @@ -1,4 +1,4 @@ -name: Shell Preview Deployment +name: Shell Deploy on: push: @@ -8,16 +8,18 @@ on: branches: - dev workflow_dispatch: - merge_group: jobs: - Deploy-Preview: - runs-on: ubuntu-cpu16-ram64 + Preview: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_SHELL_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/preview-vercel-staking.yml b/.github/workflows/preview-vercel-staking.yml deleted file mode 100644 index e64e239fd..000000000 --- a/.github/workflows/preview-vercel-staking.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Staking Preview Deployment - -on: - push: - branches: - - dev - pull_request: - branches: - - dev - workflow_dispatch: - merge_group: - -jobs: - Deploy-Preview: - runs-on: ubuntu-cpu16-ram64 - env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_STAKING_PROJECT_ID }} - NX_SKIP_NX_CACHE: true - GIT_COMMIT_SHA: ${{ github.sha }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - cache: yarn - - name: Install Vercel CLI - run: npm install -g vercel@latest - - name: Pull Vercel Environment Information - run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} - - name: Build Project Artifacts - run: vercel build ./apps/staking --token=${{ secrets.VERCEL_TOKEN }} --local-config vercel-react.json - - name: Deploy Project Artifacts to Vercel - run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} --local-config vercel-react.json diff --git a/.github/workflows/previrew-vercel-storybook.yml b/.github/workflows/preview-vercel-storybook.yml similarity index 90% rename from .github/workflows/previrew-vercel-storybook.yml rename to .github/workflows/preview-vercel-storybook.yml index d647d46f6..50d938f76 100644 --- a/.github/workflows/previrew-vercel-storybook.yml +++ b/.github/workflows/preview-vercel-storybook.yml @@ -1,4 +1,4 @@ -name: Storybook Preview Deployment +name: Storybook Deploy on: push: @@ -8,16 +8,18 @@ on: branches: - dev workflow_dispatch: - merge_group: jobs: - Deploy-Production: - runs-on: ubuntu-cpu16-ram64 + Production: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_STORYBOOK_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/preview-vercel-vesting.yml b/.github/workflows/preview-vercel-vesting.yml index cc7611b84..179c3f0d0 100644 --- a/.github/workflows/preview-vercel-vesting.yml +++ b/.github/workflows/preview-vercel-vesting.yml @@ -1,4 +1,4 @@ -name: Vesting Preview Deployment +name: Vesting Deploy on: push: @@ -8,16 +8,18 @@ on: branches: - dev workflow_dispatch: - merge_group: jobs: - Deploy-Preview: - runs-on: ubuntu-cpu16-ram64 + Preview: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_VESTING_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/production-vercel-faucet.yml b/.github/workflows/production-vercel-faucet.yml index a307afe53..b5da036bb 100644 --- a/.github/workflows/production-vercel-faucet.yml +++ b/.github/workflows/production-vercel-faucet.yml @@ -1,4 +1,4 @@ -name: Faucet Production Deployment +name: Faucet Deploy on: push: @@ -7,13 +7,16 @@ on: workflow_dispatch: jobs: - Deploy-Production: - runs-on: ubuntu-cpu16-ram64 + Production: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_FAUCET_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/production-vercel-governance.yml b/.github/workflows/production-vercel-governance.yml deleted file mode 100644 index adde10551..000000000 --- a/.github/workflows/production-vercel-governance.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Governance Production Deployment - -on: - push: - branches: - - prod - workflow_dispatch: - -jobs: - Deploy-Production: - runs-on: ubuntu-cpu16-ram64 - env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_GOVERNANCE_PROJECT_ID }} - NX_SKIP_NX_CACHE: true - GIT_COMMIT_SHA: ${{ github.sha }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - cache: yarn - - name: Install Vercel CLI - run: npm install -g vercel@latest - - name: Pull Vercel Environment Information - run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - name: Build Project Artifacts - run: vercel build ./apps/governance --prod --token=${{ secrets.VERCEL_TOKEN }} --local-config vercel-react.json - - name: Deploy Project Artifacts to Vercel - run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} --local-config vercel-react.json diff --git a/.github/workflows/production-vercel-haqq-website.yml b/.github/workflows/production-vercel-haqq-website.yml index da9b4f1f8..a7b18cfd6 100644 --- a/.github/workflows/production-vercel-haqq-website.yml +++ b/.github/workflows/production-vercel-haqq-website.yml @@ -1,4 +1,4 @@ -name: Haqq-website Production Deployment +name: Haqq Website Deploy on: push: @@ -7,13 +7,16 @@ on: workflow_dispatch: jobs: - Deploy-Production: - runs-on: ubuntu-cpu16-ram64 + Production: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_HAQQ_WEBSITE_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/production-vercel-islamic-website.yml b/.github/workflows/production-vercel-islamic-website.yml index d722c2347..e26ae1920 100644 --- a/.github/workflows/production-vercel-islamic-website.yml +++ b/.github/workflows/production-vercel-islamic-website.yml @@ -1,4 +1,4 @@ -name: Islamic-website Production Deployment +name: Islamic Website Deploy on: push: @@ -7,13 +7,16 @@ on: workflow_dispatch: jobs: - Deploy-Production: - runs-on: ubuntu-cpu16-ram64 + Production: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_ISLAMIC_WEBSITE_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/production-vercel-shell.yml b/.github/workflows/production-vercel-shell.yml index 12cc22bee..506da4014 100644 --- a/.github/workflows/production-vercel-shell.yml +++ b/.github/workflows/production-vercel-shell.yml @@ -1,4 +1,4 @@ -name: Shell Production Deployment +name: Shell Deploy on: push: @@ -7,13 +7,16 @@ on: workflow_dispatch: jobs: - Deploy-Production: - runs-on: ubuntu-cpu16-ram64 + Production: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_SHELL_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/production-vercel-staking.yml b/.github/workflows/production-vercel-staking.yml deleted file mode 100644 index c44b21596..000000000 --- a/.github/workflows/production-vercel-staking.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Staking Production Deployment - -on: - push: - branches: - - prod - workflow_dispatch: - -jobs: - Deploy-Production: - runs-on: ubuntu-cpu16-ram64 - env: - VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} - VERCEL_PROJECT_ID: ${{ secrets.VERCEL_STAKING_PROJECT_ID }} - NX_SKIP_NX_CACHE: true - GIT_COMMIT_SHA: ${{ github.sha }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - cache: yarn - - name: Install Vercel CLI - run: npm install -g vercel@latest - - name: Pull Vercel Environment Information - run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - name: Build Project Artifacts - run: vercel build ./apps/staking --prod --token=${{ secrets.VERCEL_TOKEN }} --local-config vercel-react.json - - name: Deploy Project Artifacts to Vercel - run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} --local-config vercel-react.json diff --git a/.github/workflows/production-vercel-storybook.yml b/.github/workflows/production-vercel-storybook.yml index 95e2e9fc0..64f8924f7 100644 --- a/.github/workflows/production-vercel-storybook.yml +++ b/.github/workflows/production-vercel-storybook.yml @@ -1,4 +1,4 @@ -name: Storybook Production Deployment +name: Storybook Deploy on: push: @@ -7,13 +7,16 @@ on: workflow_dispatch: jobs: - Deploy-Production: - runs-on: ubuntu-cpu16-ram64 + Production: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_STORYBOOK_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/production-vercel-vesting.yml b/.github/workflows/production-vercel-vesting.yml index e7beef3fd..1a4ce13f5 100644 --- a/.github/workflows/production-vercel-vesting.yml +++ b/.github/workflows/production-vercel-vesting.yml @@ -1,4 +1,4 @@ -name: Vesting Production Deployment +name: Vesting Deploy on: push: @@ -7,13 +7,16 @@ on: workflow_dispatch: jobs: - Deploy-Production: - runs-on: ubuntu-cpu16-ram64 + Production: + runs-on: + - ubuntu + - self-hosted env: VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_PROJECT_ID: ${{ secrets.VERCEL_VESTING_PROJECT_ID }} NX_SKIP_NX_CACHE: true GIT_COMMIT_SHA: ${{ github.sha }} + timeout-minutes: 15 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/README.md b/README.md index a71cc735e..5c71d2540 100644 --- a/README.md +++ b/README.md @@ -17,15 +17,13 @@ ## Applications and websites -| Description | Domain | Source code | -| -------------------- | ------------------------------- | ---------------------------- | -| Shell app | https://shell.haqq.network | [Open](apps/shell) | -| Staking app | https://staking.haqq.network | [Open](apps/staking) | -| Governance app | https://governance.haqq.network | [Open](apps/governance) | -| TestEdge2 Faucet app | https://testedge2.haqq.network | [Open](apps/faucet) | -| Vesting app | https://vesting.haqq.network | [Open](apps/vesting) | -| HAQQ Website | https://haqq.hetwork | [Open](apps/haqq-website) | -| IslamicCoin Website | https://islamiccoin.net | [Open](apps/islamic-website) | +| Description | Domain | Source code | +| -------------------- | ------------------------------ | ---------------------------- | +| Shell app | https://shell.haqq.network | [Open](apps/shell) | +| TestEdge2 Faucet app | https://testedge2.haqq.network | [Open](apps/faucet) | +| Vesting app | https://vesting.haqq.network | [Open](apps/vesting) | +| HAQQ Website | https://haqq.hetwork | [Open](apps/haqq-website) | +| IslamicCoin Website | https://islamiccoin.net | [Open](apps/islamic-website) | test @@ -47,35 +45,3 @@ test
  • NX
  • - -### Usable commands - -`@haqq/staking-app` - -```shell -# start app -yarn nx serve staking -# build app -yarn nx build staking -# run tests -yarn nx test staking -# run e2e tests -yarn nx e2e staking-e2e -# start storybook -yarn nx storybook staking -``` - -`@haqq/ui-kit` - -```shell -# run tests -yarn nx test ui-kit -# start storybook -yarn nx storybook ui-kit -``` - -To create new `Button` component `ui-kit` package - -```shell -yarn nx generate @nx/react:component Button --project=ui-kit --directory=components --export --no-interactive -``` diff --git a/apps/governance-e2e/.eslintrc.json b/apps/governance-e2e/.eslintrc.json deleted file mode 100644 index 696cb8b12..000000000 --- a/apps/governance-e2e/.eslintrc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": ["plugin:cypress/recommended", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/apps/governance-e2e/cypress.config.ts b/apps/governance-e2e/cypress.config.ts deleted file mode 100644 index 941c0a1a7..000000000 --- a/apps/governance-e2e/cypress.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset'; -import { defineConfig } from 'cypress'; - -export default defineConfig({ - e2e: { - ...nxE2EPreset(__dirname), - /** - * TODO(@nx/cypress): In Cypress v12,the testIsolation option is turned on by default. - * This can cause tests to start breaking where not indended. - * You should consider enabling this once you verify tests do not depend on each other - * More Info: https://docs.cypress.io/guides/references/migration-guide#Test-Isolation - **/ - testIsolation: false, - }, -}); diff --git a/apps/governance-e2e/project.json b/apps/governance-e2e/project.json deleted file mode 100644 index c84263ee8..000000000 --- a/apps/governance-e2e/project.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "governance-e2e", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/governance-e2e/src", - "projectType": "application", - "targets": { - "e2e": { - "executor": "@nx/cypress:cypress", - "options": { - "cypressConfig": "apps/governance-e2e/cypress.config.ts", - "devServerTarget": "governance:serve:development", - "testingType": "e2e" - }, - "configurations": { - "production": { - "devServerTarget": "governance:serve:production" - } - } - }, - "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] - } - }, - "tags": ["shell"], - "implicitDependencies": ["governance"] -} diff --git a/apps/governance-e2e/src/e2e/app.cy.ts b/apps/governance-e2e/src/e2e/app.cy.ts deleted file mode 100644 index af48dd7e0..000000000 --- a/apps/governance-e2e/src/e2e/app.cy.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { getGreeting } from '../support/app.po'; - -describe('governance', () => { - beforeEach(() => { - return cy.visit('/'); - }); - - it('should display welcome message', () => { - // Custom command example, see `../support/commands.ts` file - cy.login('my-email@something.com', 'myPassword'); - - // Function helper example, see `../support/app.po.ts` file - getGreeting().contains('Welcome governance'); - }); -}); diff --git a/apps/governance-e2e/src/fixtures/example.json b/apps/governance-e2e/src/fixtures/example.json deleted file mode 100644 index 294cbed6c..000000000 --- a/apps/governance-e2e/src/fixtures/example.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Using fixtures to represent data", - "email": "hello@cypress.io" -} diff --git a/apps/governance-e2e/src/support/app.po.ts b/apps/governance-e2e/src/support/app.po.ts deleted file mode 100644 index 0deacb5a1..000000000 --- a/apps/governance-e2e/src/support/app.po.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const getGreeting = () => { - return cy.get('h1'); -}; diff --git a/apps/governance-e2e/src/support/commands.ts b/apps/governance-e2e/src/support/commands.ts deleted file mode 100644 index 310f1fa0e..000000000 --- a/apps/governance-e2e/src/support/commands.ts +++ /dev/null @@ -1,33 +0,0 @@ -// *********************************************** -// This example commands.js shows you how to -// create various custom commands and overwrite -// existing commands. -// -// For more comprehensive examples of custom -// commands please read more here: -// https://on.cypress.io/custom-commands -// *********************************************** - -// eslint-disable-next-line @typescript-eslint/no-namespace -declare namespace Cypress { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - interface Chainable { - login(email: string, password: string): void; - } -} -// -// -- This is a parent command -- -Cypress.Commands.add('login', (email, password) => { - console.log('Custom command example: Login', email, password); -}); -// -// -- This is a child command -- -// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) -// -// -// -- This is a dual command -- -// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) -// -// -// -- This will overwrite an existing command -- -// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/apps/governance-e2e/src/support/e2e.ts b/apps/governance-e2e/src/support/e2e.ts deleted file mode 100644 index 3d469a6b6..000000000 --- a/apps/governance-e2e/src/support/e2e.ts +++ /dev/null @@ -1,17 +0,0 @@ -// *********************************************************** -// This example support/index.js is processed and -// loaded automatically before your test files. -// -// This is a great place to put global configuration and -// behavior that modifies Cypress. -// -// You can change the location of this file or turn off -// automatically serving support files with the -// 'supportFile' configuration option. -// -// You can read more here: -// https://on.cypress.io/configuration -// *********************************************************** - -// Import commands.js using ES2015 syntax: -import './commands'; diff --git a/apps/governance-e2e/tsconfig.json b/apps/governance-e2e/tsconfig.json deleted file mode 100644 index cc509a730..000000000 --- a/apps/governance-e2e/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "sourceMap": false, - "outDir": "../../dist/out-tsc", - "allowJs": true, - "types": ["cypress", "node"] - }, - "include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"] -} diff --git a/apps/governance/.babelrc b/apps/governance/.babelrc deleted file mode 100644 index 1ea870ead..000000000 --- a/apps/governance/.babelrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "presets": [ - [ - "@nx/react/babel", - { - "runtime": "automatic", - "useBuiltIns": "usage" - } - ] - ], - "plugins": [] -} diff --git a/apps/governance/.browserslistrc b/apps/governance/.browserslistrc deleted file mode 100644 index f1d12df4f..000000000 --- a/apps/governance/.browserslistrc +++ /dev/null @@ -1,16 +0,0 @@ -# This file is used by: -# 1. autoprefixer to adjust CSS to support the below specified browsers -# 2. babel preset-env to adjust included polyfills -# -# For additional information regarding the format and rule options, please see: -# https://github.com/browserslist/browserslist#queries -# -# If you need to support different browsers in production, you may tweak the list below. - -last 1 Chrome version -last 1 Firefox version -last 2 Edge major versions -last 2 Safari major version -last 2 iOS major versions -Firefox ESR -not IE 9-11 # For IE 9-11 support, remove 'not'. \ No newline at end of file diff --git a/apps/governance/.eslintrc.json b/apps/governance/.eslintrc.json deleted file mode 100644 index a39ac5d05..000000000 --- a/apps/governance/.eslintrc.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["plugin:@nx/react", "../../.eslintrc.json"], - "ignorePatterns": ["!**/*"], - "overrides": [ - { - "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], - "rules": {} - }, - { - "files": ["*.ts", "*.tsx"], - "rules": {} - }, - { - "files": ["*.js", "*.jsx"], - "rules": {} - } - ] -} diff --git a/apps/governance/jest.config.ts b/apps/governance/jest.config.ts deleted file mode 100644 index 4f8ec570c..000000000 --- a/apps/governance/jest.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* eslint-disable */ -export default { - displayName: 'governance', - preset: '../../jest.preset.js', - transform: { - '^.+\\.[tj]sx?$': [ - '@swc/jest', - { jsc: { transform: { react: { runtime: 'automatic' } } } }, - ], - }, - moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], - coverageDirectory: '../../coverage/apps/governance', -}; diff --git a/apps/governance/postcss.config.cjs b/apps/governance/postcss.config.cjs deleted file mode 100644 index 93a824c76..000000000 --- a/apps/governance/postcss.config.cjs +++ /dev/null @@ -1,17 +0,0 @@ -const { join } = require('path'); - -module.exports = { - plugins: { - 'postcss-import': {}, - 'tailwindcss/nesting': {}, - tailwindcss: { - config: join(__dirname, 'tailwind.config.js'), - }, - 'postcss-preset-env': { - stage: 3, - features: { - 'nesting-rules': false, - }, - }, - }, -}; diff --git a/apps/governance/project.json b/apps/governance/project.json deleted file mode 100644 index 7f0124cf0..000000000 --- a/apps/governance/project.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "name": "governance", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "sourceRoot": "apps/governance/src", - "projectType": "application", - "targets": { - "build": { - "executor": "@nx/webpack:webpack", - "outputs": ["{options.outputPath}"], - "defaultConfiguration": "production", - "options": { - "compiler": "babel", - "outputPath": "dist/apps/governance", - "index": "apps/governance/src/index.html", - "baseHref": "/", - "main": "apps/governance/src/main.ts", - "polyfills": "apps/governance/src/polyfills.ts", - "tsConfig": "apps/governance/tsconfig.app.json", - "assets": ["apps/governance/src/assets"], - "styles": [], - "scripts": [], - "webpackConfig": "apps/governance/webpack.config.js", - "isolatedConfig": true, - "babelUpwardRootMode": true - }, - "configurations": { - "development": { - "extractLicenses": false, - "optimization": false, - "sourceMap": true, - "vendorChunk": true - }, - "production": { - "fileReplacements": [ - { - "replace": "apps/governance/src/environments/environment.ts", - "with": "apps/governance/src/environments/environment.prod.ts" - } - ], - "optimization": true, - "outputHashing": "all", - "sourceMap": false, - "namedChunks": false, - "extractLicenses": true, - "vendorChunk": true, - "webpackConfig": "apps/governance/webpack.config.prod.js" - } - } - }, - "serve": { - "executor": "@nx/webpack:dev-server", - "defaultConfiguration": "development", - "options": { - "buildTarget": "governance:build", - "hmr": true, - "port": 4200 - }, - "configurations": { - "development": { - "buildTarget": "governance:build:development" - }, - "production": { - "buildTarget": "governance:build:production", - "hmr": false - } - } - }, - "lint": { - "executor": "@nx/eslint:lint", - "outputs": ["{options.outputFile}"] - }, - "test": { - "executor": "@nx/jest:jest", - "outputs": ["{workspaceRoot}/coverage/apps/governance"], - "options": { - "jestConfig": "apps/governance/jest.config.ts" - } - } - }, - "tags": ["shell"] -} diff --git a/apps/governance/src/app/app-wrapper.tsx b/apps/governance/src/app/app-wrapper.tsx deleted file mode 100644 index a04d3118d..000000000 --- a/apps/governance/src/app/app-wrapper.tsx +++ /dev/null @@ -1,283 +0,0 @@ -import { - Fragment, - PropsWithChildren, - useCallback, - useEffect, - useMemo, - useState, -} from 'react'; -import { haqqTestedge2 } from '@wagmi/chains'; -import { useMediaQuery } from 'react-responsive'; -import { useNavigate } from 'react-router-dom'; -import ScrollLock from 'react-scrolllock'; -import { useBalance, useConnect, useNetwork, useSwitchNetwork } from 'wagmi'; -import { - getFormattedAddress, - useAddress, - useSupportedChains, - useWallet, -} from '@haqq/shared'; -import { - Header, - Page, - BurgerButton, - Button, - AccountButton, - SelectChainButton, - SelectWalletModal, - TestedgeBanner, - formatNumber, - CommitSha, - Footer, - SelectChainModal, -} from '@haqq/shell-ui-kit'; -import { environment } from '../environments/environment'; - -function HeaderButtons({ - isMobileMenuOpen, - onMobileMenuOpenChange, -}: { - isMobileMenuOpen: boolean; - onMobileMenuOpenChange: (isMobileMenuOpen: boolean) => void; -}) { - const chains = useSupportedChains(); - const { chain = chains[0] } = useNetwork(); - const { disconnect, openSelectWallet, isNetworkSupported, selectNetwork } = - useWallet(); - const { ethAddress } = useAddress(); - const { data: balanceData } = useBalance({ - address: ethAddress, - chainId: chain.id, - }); - const { switchNetworkAsync } = useSwitchNetwork(); - const isDesktop = useMediaQuery({ - query: `(min-width: 1024px)`, - }); - const navigate = useNavigate(); - - const handleChainSelectClick = useCallback( - async (chainId: number) => { - if (switchNetworkAsync) { - await switchNetworkAsync(chainId); - navigate('/'); - } - }, - [navigate, switchNetworkAsync], - ); - - const balance = useMemo(() => { - if (!balanceData) { - return undefined; - } - - return { - symbol: balanceData.symbol, - value: formatNumber(Number.parseFloat(balanceData.formatted)), - }; - }, [balanceData]); - - const selectChainButtonProps = useMemo(() => { - return { - isSupported: isNetworkSupported, - currentChain: { - name: chain.name.replace('HAQQ', '').trim() ?? '', - id: chain.id ?? 0, - }, - chains: chains.map((chain) => { - return { - name: chain.name.replace('HAQQ', '').trim(), - id: chain.id, - }; - }), - }; - }, [chain.id, chain.name, chains, isNetworkSupported]); - - useEffect(() => { - if (isDesktop) { - onMobileMenuOpenChange(false); - } - }, [isDesktop, onMobileMenuOpenChange]); - - return ( - -
    - {ethAddress ? ( -
    - { - await selectNetwork(chainId); - navigate('/'); - }} - /> - -
    - ) : ( - - )} -
    - -
    - { - onMobileMenuOpenChange(!isMobileMenuOpen); - }} - className="h-[24px] w-[24px] sm:h-[30px] sm:w-[30px]" - /> -
    - - {isMobileMenuOpen && ( - - - -
    -
    - {ethAddress && ( - -
    - -
    - -
    - -
    -
    - )} - -
    - {ethAddress ? ( - - ) : ( - - )} -
    - -
    -
    - -
    -
    -
    -
    -
    - )} -
    - ); -} - -export function AppWrapper({ children }: PropsWithChildren) { - const [isMobileMenuOpen, setMobileMenuOpen] = useState(false); - const [isBlurred, setBlured] = useState(false); - const isDesktop = useMediaQuery({ - query: `(min-width: 1024px)`, - }); - const chains = useSupportedChains(); - const { chain = chains[0] } = useNetwork(); - const { connectAsync, connectors, error, isLoading, pendingConnector } = - useConnect(); - const { - closeSelectWallet, - isSelectWalletOpen, - isSelectChainOpen, - closeSelectChain, - selectNetwork, - } = useWallet(); - - const handleWalletConnect = useCallback( - async (connectorIdx: number) => { - await connectAsync({ connector: connectors[connectorIdx] }); - closeSelectWallet(); - }, - [closeSelectWallet, connectAsync, connectors], - ); - - const handleChainSelect = useCallback( - async (chainId: number) => { - await selectNetwork(chainId); - closeSelectChain(); - }, - [closeSelectChain, selectNetwork], - ); - - useEffect(() => { - function handleScroll() { - const offset = 30; - if (window.scrollY > offset) { - setBlured(true); - } else { - setBlured(false); - } - } - - window.addEventListener('scroll', handleScroll, { passive: true }); - - return () => { - window.removeEventListener('scroll', handleScroll); - }; - }, [isDesktop]); - - const isTestedge = useMemo(() => { - return chain.id === haqqTestedge2.id; - }, [chain.id]); - - const selectWalletModalConnectors = useMemo(() => { - return connectors.map((connector, index) => { - return { - id: index, - name: connector.name, - isPending: isLoading && pendingConnector?.id === connector.id, - }; - }); - }, [connectors, isLoading, pendingConnector?.id]); - - return ( - - } - /> - } - banner={isTestedge && } - footer={