From d55060a8408fa1d7e905083005cbcae43dd45911 Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 14:49:55 +0000 Subject: [PATCH 01/13] feat: add github actions for auto-gen release notes This adds support for making the auto-generated release notes as automated as possible. --- .github/release.yml | 1 + ...o_project.yml => add-issue-to-project.yml} | 0 ...l_commits.yml => conventional-commits.yml} | 0 .github/workflows/lint-pr.yml | 33 ++++ .../match-labels-for-release-notes.yml | 158 ++++++++++++++++++ ..._management.yml => project-management.yml} | 10 +- 6 files changed, 197 insertions(+), 5 deletions(-) rename .github/workflows/{add_issue_to_project.yml => add-issue-to-project.yml} (100%) rename .github/workflows/{conventional_commits.yml => conventional-commits.yml} (100%) create mode 100644 .github/workflows/lint-pr.yml create mode 100644 .github/workflows/match-labels-for-release-notes.yml rename .github/workflows/{project_management.yml => project-management.yml} (98%) diff --git a/.github/release.yml b/.github/release.yml index d7e4d4d3ae7..5a01dc2c170 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -11,6 +11,7 @@ changelog: - title: Vulnerabilities 🔐 labels: - vulnerability + - security - title: Breaking Changes 🛠 labels: - breaking-change diff --git a/.github/workflows/add_issue_to_project.yml b/.github/workflows/add-issue-to-project.yml similarity index 100% rename from .github/workflows/add_issue_to_project.yml rename to .github/workflows/add-issue-to-project.yml diff --git a/.github/workflows/conventional_commits.yml b/.github/workflows/conventional-commits.yml similarity index 100% rename from .github/workflows/conventional_commits.yml rename to .github/workflows/conventional-commits.yml diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 00000000000..322e14ba1ee --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,33 @@ +--- + + +name: "Verify PR title" + +"on": + pull_request: + types: + - opened + - edited + - reopened + - synchronize + +jobs: + lint_pr: + timeout-minutes: 10 + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + + - name: Setup node + uses: actions/setup-node@v4.0.1 + with: + node-version-file: '.nvmrc' + + - name: Install dependencies + run: | + rm package.json + npm install --no-save @commitlint/cli @commitlint/config-conventional @commitlint/config-nx-scopes nx + + - name: Check PR title + run: echo "${{ github.event.pull_request.title }}" | npx commitlint --config ./commitlint.config-ci.js diff --git a/.github/workflows/match-labels-for-release-notes.yml b/.github/workflows/match-labels-for-release-notes.yml new file mode 100644 index 00000000000..04ac72862b7 --- /dev/null +++ b/.github/workflows/match-labels-for-release-notes.yml @@ -0,0 +1,158 @@ +--- + + +name: "Match labels for auto-gen release notes" + +"on": + pull_request_target: + branches: [develop, master] + types: [opened, closed] + +# Configure the project specific variables +env: + ORGANIZATION: vegaprotocol + PROJECT_NUMBER: 106 + PR_URL: ${{ github.event.pull_request.html_url }} + PR_ID: ${{ github.event.pull_request.node_id }} + GH_TOKEN: ${{ secrets.PROJECT_MANAGE_ACTION }} + USER: ${{ github.actor }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + label-match: + runs-on: ubuntu-latest + permissions: write-all + steps: + + - name: "Get linked issue url" + id: get-linked-issue + run: | + gh api graphql -f query=' + query($pr_url: URI!) { + resource(url: $pr_url) { + ... on PullRequest { + closingIssuesReferences(last: 1) { + nodes { + id + url + } + } + } + } + }' -f pr_url=$PR_URL > data.json + echo 'LINKED_ISSUE_URL='$(jq -r '.data.resource.closingIssuesReferences.nodes[] | .url' data.json) >> $GITHUB_ENV + + - name: "Check issue for applicable labels" + id: get-issue-labels + if: | + env.LINKED_ISSUE_URL != '' + run: | + gh api graphql -f query=' + query($issue_url: URI!) { + resource(url: $issue_url) { + ... on Issue { + labels(last: 10) { + nodes { + id + name + } + } + } + } + }' -f issue_url=$LINKED_ISSUE_URL > data.json + echo 'BUG='$(jq '.data.resource.labels.nodes[] | select(.name== "bug") | .id' data.json) >> $GITHUB_ENV + echo 'BREAKING='$(jq '.data.resource.labels.nodes[] | select(.name== "breaking-change") | .id' data.json) >> $GITHUB_ENV + echo 'DEPRECATE='$(jq '.data.resource.labels.nodes[] | select(.name== "deprecation") | .id' data.json) >> $GITHUB_ENV + echo 'VULNERABILITY='$(jq '.data.resource.labels.nodes[] | select(.name== "vulnerability") | .id' data.json) >> $GITHUB_ENV + echo 'SECURITY='$(jq '.data.resource.labels.nodes[] | select(.name== "security") | .id' data.json) >> $GITHUB_ENV + echo 'ENHANCE='$(jq '.data.resource.labels.nodes[] | select(.name== "enhancement") | .id' data.json) >> $GITHUB_ENV + echo 'FEATURE='$(jq '.data.resource.labels.nodes[] | select(.name== "feature") | .id' data.json) >> $GITHUB_ENV + + - run: env + + - name: "Add bug label" + id: add-bug-label + if: | + env.BUG != '' + run: | + gh api graphql -f query=' + mutation($user:String!, $pr:ID!, $label:[ID!]!) { + addLabelsToLabelable(input: {clientMutationId: $user, labelableId: $pr, labelIds: $label}) { + clientMutationId + } + }' -f label=$BUG -f pr=$PR_ID -f user=$USER + + - name: "Add breaking change label" + id: add-breaking-label + if: | + env.BREAKING != '' + run: | + gh api graphql -f query=' + mutation($user:String!, $pr:ID!, $label:[ID!]!) { + addLabelsToLabelable(input: {clientMutationId: $user, labelableId: $pr, labelIds: $label}) { + clientMutationId + } + }' -f label=$BREAKING -f pr=$PR_ID -f user=$USER + + - name: "Add deprecation label" + id: add-deprecation-label + if: | + env.DEPRECATE != '' + run: | + gh api graphql -f query=' + mutation($user:String!, $pr:ID!, $label:[ID!]!) { + addLabelsToLabelable(input: {clientMutationId: $user, labelableId: $pr, labelIds: $label}) { + clientMutationId + } + }' -f label=$DEPRECATE -f pr=$PR_ID -f user=$USER + + - name: "Add vulnerability label" + id: add-vulnerability-label + if: | + env.VULNERABILITY != '' + run: | + gh api graphql -f query=' + mutation($user:String!, $pr:ID!, $label:[ID!]!) { + addLabelsToLabelable(input: {clientMutationId: $user, labelableId: $pr, labelIds: $label}) { + clientMutationId + } + }' -f label=$VULNERABILITY -f pr=$PR_ID -f user=$USER + + - name: "Add security label" + id: add-security-label + if: | + env.SECURITY != '' + run: | + gh api graphql -f query=' + mutation($user:String!, $pr:ID!, $label:[ID!]!) { + addLabelsToLabelable(input: {clientMutationId: $user, labelableId: $pr, labelIds: $label}) { + clientMutationId + } + }' -f label=$SECURITY -f pr=$PR_ID -f user=$USER + + - name: "Add enhancement label" + id: add-enhancement-label + if: | + env.ENHANCE != '' + run: | + gh api graphql -f query=' + mutation($user:String!, $pr:ID!, $label:[ID!]!) { + addLabelsToLabelable(input: {clientMutationId: $user, labelableId: $pr, labelIds: $label}) { + clientMutationId + } + }' -f label=$ENHANCE -f pr=$PR_ID -f user=$USER + + - name: "Add feature label" + id: add-feature-label + if: | + env.FEATURE != '' + run: | + gh api graphql -f query=' + mutation($user:String!, $pr:ID!, $label:[ID!]!) { + addLabelsToLabelable(input: {clientMutationId: $user, labelableId: $pr, labelIds: $label}) { + clientMutationId + } + }' -f label=$FEATURE -f pr=$PR_ID -f user=$USER diff --git a/.github/workflows/project_management.yml b/.github/workflows/project-management.yml similarity index 98% rename from .github/workflows/project_management.yml rename to .github/workflows/project-management.yml index 39263129cfb..5331be702be 100644 --- a/.github/workflows/project_management.yml +++ b/.github/workflows/project-management.yml @@ -70,7 +70,7 @@ jobs: if: | env.LINKED_ISSUE_ID != '' && contains(github.event.pull_request.labels.*.name, env.EXCLUDE_LABEL) != true - uses: actions/github-script@v6.4.1 + uses: actions/github-script@v7.0.1 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -80,7 +80,7 @@ jobs: if: | steps.bot-pr.outcome == 'success' || env.LINKED_ISSUE_ID == '' && contains(github.event.pull_request.labels.*.name, env.EXCLUDE_LABEL) == true - uses: actions/github-script@v6.4.1 + uses: actions/github-script@v7.0.1 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -88,7 +88,7 @@ jobs: - name: "Fail if no linked issue or exclusion label" id: exclude-linked-error if: steps.linked.outcome == 'skipped' && steps.exclude-linked.outcome == 'skipped' - uses: actions/github-script@v6.4.1 + uses: actions/github-script@v7.0.1 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -97,7 +97,7 @@ jobs: - name: "Fail if linked issue AND exclusion label" id: linked-and-nochangelog if: steps.linked.outcome == 'success' && steps.exclude-linked.outcome == 'success' - uses: actions/github-script@v6.4.1 + uses: actions/github-script@v7.0.1 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -376,7 +376,7 @@ jobs: steps: - name: "Checkout" id: checkout - uses: actions/checkout@v3.5.3 + uses: actions/checkout@v4.1.1 - name: "Check changelog entry" id: check-changelog uses: Zomzog/changelog-checker@v1.3.0 From a955302d575bd6d972c8c0766d84a2eb0f624bbe Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 14:55:25 +0000 Subject: [PATCH 02/13] fix: add missing nvmrc file --- .nvmrc.yaml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nvmrc.yaml diff --git a/.nvmrc.yaml b/.nvmrc.yaml new file mode 100644 index 00000000000..43bff1f8cf9 --- /dev/null +++ b/.nvmrc.yaml @@ -0,0 +1 @@ +20.9.0 \ No newline at end of file From 79b359c526bbe2dfbcbd15119c3fc3d4d2197310 Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 14:58:16 +0000 Subject: [PATCH 03/13] fix: file name and versions --- .github/workflows/lint-pr.yml | 4 ++-- .github/workflows/project-management.yml | 10 +++++----- .nvmrc.yaml => .nvmrc | 0 3 files changed, 7 insertions(+), 7 deletions(-) rename .nvmrc.yaml => .nvmrc (100%) diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index 322e14ba1ee..01133d26464 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -17,10 +17,10 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4 - name: Setup node - uses: actions/setup-node@v4.0.1 + uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' diff --git a/.github/workflows/project-management.yml b/.github/workflows/project-management.yml index 5331be702be..ca17946218c 100644 --- a/.github/workflows/project-management.yml +++ b/.github/workflows/project-management.yml @@ -70,7 +70,7 @@ jobs: if: | env.LINKED_ISSUE_ID != '' && contains(github.event.pull_request.labels.*.name, env.EXCLUDE_LABEL) != true - uses: actions/github-script@v7.0.1 + uses: actions/github-script@v7 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -80,7 +80,7 @@ jobs: if: | steps.bot-pr.outcome == 'success' || env.LINKED_ISSUE_ID == '' && contains(github.event.pull_request.labels.*.name, env.EXCLUDE_LABEL) == true - uses: actions/github-script@v7.0.1 + uses: actions/github-script@v7 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -88,7 +88,7 @@ jobs: - name: "Fail if no linked issue or exclusion label" id: exclude-linked-error if: steps.linked.outcome == 'skipped' && steps.exclude-linked.outcome == 'skipped' - uses: actions/github-script@v7.0.1 + uses: actions/github-script@v7 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -97,7 +97,7 @@ jobs: - name: "Fail if linked issue AND exclusion label" id: linked-and-nochangelog if: steps.linked.outcome == 'success' && steps.exclude-linked.outcome == 'success' - uses: actions/github-script@v7.0.1 + uses: actions/github-script@v7 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | @@ -376,7 +376,7 @@ jobs: steps: - name: "Checkout" id: checkout - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4 - name: "Check changelog entry" id: check-changelog uses: Zomzog/changelog-checker@v1.3.0 diff --git a/.nvmrc.yaml b/.nvmrc similarity index 100% rename from .nvmrc.yaml rename to .nvmrc From 73f22d5165bab43cf76f0ec6e809c71e1fc6698e Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 15:06:26 +0000 Subject: [PATCH 04/13] fix: add package.json --- package.json | 244 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 00000000000..fa975d0ab84 --- /dev/null +++ b/package.json @@ -0,0 +1,244 @@ +{ + "name": "nx-monorepo", + "version": "0.0.0", + "license": "MIT", + "scripts": { + "start": "nx serve", + "build": "nx build", + "test": "nx test", + "postinstall": "husky install", + "test:all": "nx run-many --all --target=test", + "build:all": "nx run-many --all --target=build", + "build-spec:all": "nx run-many --all --target=build-spec", + "lint:all": "nx run-many --all --target=lint", + "e2e:all": "nx run-many --all --target=e2e", + "vegacapsule": "vegacapsule network bootstrap --config-path=../frontend-monorepo/vegacapsule/config.hcl", + "release": "git checkout develop ; git pull ; node scripts/make-release.js", + "trading:test": "cd apps/trading/e2e && poetry run pytest -k", + "trading:test:all": "cd apps/trading/e2e && poetry run pytest -s --numprocesses 6 --dist loadfile" + }, + "engines": { + "node": ">=20.9.0" + }, + "private": true, + "dependencies": { + "@apollo/client": "^3.5.8", + "@blueprintjs/icons": "^3.32.0", + "@coinbase/wallet-sdk": "^3.6.5", + "@radix-ui/react-accordion": "^1.1.0", + "@radix-ui/react-checkbox": "^1.0.1", + "@radix-ui/react-dialog": "^1.0.2", + "@radix-ui/react-dropdown-menu": "^2.0.2", + "@radix-ui/react-icons": "^1.1.1", + "@radix-ui/react-navigation-menu": "^1.1.1", + "@radix-ui/react-popover": "^1.0.3", + "@radix-ui/react-radio-group": "^1.1.1", + "@radix-ui/react-select": "2.0.0-rc.10", + "@radix-ui/react-separator": "^1.0.2", + "@radix-ui/react-slider": "^1.1.0", + "@radix-ui/react-switch": "^1.0.2", + "@radix-ui/react-tabs": "^1.0.2", + "@radix-ui/react-tooltip": "^1.0.7", + "@sentry/nextjs": "^6.19.3", + "@sentry/react": "^6.19.2", + "@sentry/tracing": "^6.19.2", + "@vegaprotocol/wallet-client": "0.1.9", + "@walletconnect/ethereum-provider": "^2.6.0", + "@web3-react/coinbase-wallet": "8.1.2-beta.0", + "@web3-react/core": "^8.1.2-beta.0", + "@web3-react/metamask": "^8.1.2-beta.0", + "@web3-react/walletconnect": "8.1.3-beta.0", + "@web3-react/walletconnect-v2": "^8.1.3-beta.0", + "ag-grid-community": "^31.0.1", + "ag-grid-react": "^31.0.1", + "allotment": "1.19.2", + "alpha-lyrae": "vegaprotocol/alpha-lyrae", + "apollo-link-timeout": "^4.0.0", + "bignumber.js": "^9.0.2", + "classnames": "^2.3.1", + "core-js": "^3.6.5", + "d3-array": "^3.2.4", + "d3-scale": "^4.0.2", + "d3-shape": "^3.2.0", + "date-fns": "^2.28.0", + "date-fns-tz": "^2.0.0", + "duration-js": "^4.0.0", + "ethers": "^5.6.0", + "graphql": "^15.7.2", + "graphql-request": "^5.0.0", + "graphql-ws": "^5.6.3", + "i18next": "23.7.6", + "i18next-browser-languagedetector": "7.2.0", + "i18next-http-backend": "^2.3.1", + "i18next-locize-backend": "^6.4.1", + "immer": "^9.0.12", + "iso8601-duration": "^2.1.1", + "js-sha3": "^0.8.0", + "jsondiffpatch": "^0.4.1", + "lodash": "^4.17.21", + "next": "13.3.0", + "pennant": "^1.15.0", + "react": "18.2.0", + "react-copy-to-clipboard": "5.1.0", + "react-dom": "18.2.0", + "react-hook-form": "^7.27.0", + "react-i18next": "13.5.0", + "react-intersection-observer": "^9.2.2", + "react-markdown": "^8.0.6", + "react-router-dom": "6.11.2", + "react-syntax-highlighter": "^15.4.5", + "react-use-websocket": "^3.0.0", + "react-virtualized-auto-sizer": "^1.0.6", + "react-window": "^1.8.9", + "react-window-infinite-loader": "^1.0.7", + "recharts": "^2.1.2", + "recursive-key-filter": "^1.0.2", + "regenerator-runtime": "0.13.7", + "toml": "^3.0.0", + "tslib": "^2.3.0", + "uuid": "^8.3.2", + "web-vitals": "^2.1.4", + "zod": "^3.20.3", + "zustand": "^4.3.2" + }, + "devDependencies": { + "@apollo/react-testing": "^4.0.0", + "@babel/core": "^7.14.5", + "@babel/plugin-proposal-export-default-from": "^7.18.10", + "@babel/plugin-proposal-private-methods": "^7.18.6", + "@babel/preset-env": "^7.18.10", + "@babel/preset-react": "^7.14.5", + "@babel/preset-typescript": "7.12.13", + "@commitlint/cli": "^16.2.4", + "@commitlint/config-conventional": "^16.2.4", + "@commitlint/config-nx-scopes": "^17.4.2", + "@cypress/grep": "^3.1.0", + "@ethersproject/experimental": "^5.6.0", + "@graphql-codegen/cli": "^2.11.8", + "@graphql-codegen/near-operation-file-preset": "^2.4.1", + "@graphql-codegen/typescript": "^2.7.3", + "@graphql-codegen/typescript-operations": "^2.5.3", + "@graphql-codegen/typescript-react-apollo": "^3.3.3", + "@graphql-inspector/cli": "^3.3.0", + "@graphql-inspector/validate-command": "^3.3.0", + "@nrwl/js": "17.1.2", + "@nx/cypress": "17.1.2", + "@nx/eslint": "17.1.2", + "@nx/eslint-plugin": "17.1.2", + "@nx/jest": "17.1.2", + "@nx/js": "17.1.2", + "@nx/next": "17.1.2", + "@nx/react": "17.1.2", + "@nx/rollup": "17.1.2", + "@nx/storybook": "17.1.2", + "@nx/web": "17.1.2", + "@nx/webpack": "17.1.2", + "@nx/workspace": "17.1.2", + "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7", + "@rollup/plugin-url": "^7.0.0", + "@sentry/webpack-plugin": "^1.18.8", + "@storybook/addon-a11y": "7.5.3", + "@storybook/addon-docs": "7.5.3", + "@storybook/addon-essentials": "7.5.3", + "@storybook/addon-mdx-gfm": "7.5.3", + "@storybook/core-server": "7.5.3", + "@storybook/react": "7.5.3", + "@storybook/react-webpack5": "7.5.3", + "@svgr/rollup": "^8.0.1", + "@svgr/webpack": "^6.1.2", + "@swc-node/register": "~1.6.7", + "@swc/cli": "^0.1.62", + "@swc/core": "~1.3.85", + "@swc/jest": "0.2.20", + "@testing-library/jest-dom": "^5.16.2", + "@testing-library/react": "14.0.0", + "@testing-library/user-event": "^14.4.1", + "@types/classnames": "^2.3.1", + "@types/d3-array": "^3.2.1", + "@types/d3-scale": "^4.0.8", + "@types/d3-shape": "^3.1.5", + "@types/faker": "^5.5.8", + "@types/jest": "29.4.4", + "@types/lodash": "^4.14.171", + "@types/node": "18.14.2", + "@types/prismjs": "^1.26.0", + "@types/react": "18.2.33", + "@types/react-copy-to-clipboard": "5.0.7", + "@types/react-dom": "18.2.14", + "@types/react-router-dom": "^5.3.3", + "@types/react-syntax-highlighter": "^15.5.5", + "@types/react-virtualized-auto-sizer": "^1.0.1", + "@types/react-window": "1.8.8", + "@types/react-window-infinite-loader": "^1.0.6", + "@types/semver": "^7.5.0", + "@types/uuid": "^8.3.4", + "@typescript-eslint/eslint-plugin": "6.11.0", + "@typescript-eslint/parser": "6.11.0", + "autoprefixer": "10.4.13", + "babel-jest": "29.4.3", + "babel-loader": "8.1.0", + "css-loader": "^6.4.0", + "cypress": "^13.0.0", + "cypress-mochawesome-reporter": "^3.3.0", + "cypress-real-events": "^1.8.1", + "dotenv": "^16.0.1", + "env-cmd": "^10.1.0", + "eslint": "8.46.0", + "eslint-config-next": "13.1.1", + "eslint-config-prettier": "9.0.0", + "eslint-plugin-cypress": "2.15.1", + "eslint-plugin-import": "2.27.5", + "eslint-plugin-jest": "^26.1.5", + "eslint-plugin-jsx-a11y": "6.7.1", + "eslint-plugin-react": "7.32.2", + "eslint-plugin-react-hooks": "4.6.0", + "eslint-plugin-storybook": "^0.6.12", + "eslint-plugin-unicorn": "^41.0.0", + "faker": "^5.5.3", + "fetch-mock": "^9.11.0", + "flush-promises": "^1.0.2", + "glob": "^8.0.3", + "husky": "^7.0.4", + "inquirer": "^8.0.0", + "jest": "29.4.3", + "jest-canvas-mock": "^2.3.1", + "jest-environment-jsdom": "^29.4.1", + "jest-websocket-mock": "^2.3.0", + "lint-staged": "^12.3.3", + "mock-apollo-client": "^1.2.0", + "mock-socket": "^9.1.5", + "npmlog": "^6.0.2", + "nx": "17.1.2", + "postcss": "8.4.21", + "prettier": "2.7.1", + "react-refresh": "^0.10.0", + "recast": "^0.21.1", + "regenerator-runtime": "0.13.7", + "replace-in-file": "^6.3.2", + "resize-observer-polyfill": "^1.5.1", + "sass": "1.55.0", + "storybook": "7.0.24", + "storybook-addon-themes": "^6.1.0", + "style-loader": "^3.3.0", + "stylus": "^0.55.0", + "stylus-loader": "^7.1.0", + "tailwindcss": "3.3.3", + "ts-jest": "29.1.0", + "ts-node": "10.9.1", + "tslib": "^2.3.0", + "type-fest": "^3.8.0", + "typescript": "5.2.2", + "url-loader": "^4.1.1", + "webpack": "5.89.0", + "webpack-merge": "^5.8.0" + }, + "lint-staged": { + "*": "yarn nx format:write --uncommitted", + "*.{ts,tsx,js,jsx}": "yarn eslint --fix" + }, + "resolutions": { + "graphql": "15.8.0", + "//": "workaround storybook issue: https://github.com/storybookjs/storybook/issues/21642", + "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.cd77847.0" + } +} \ No newline at end of file From d15589cba29b0286b565d67cd4891ad9e11b1eb4 Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 15:12:08 +0000 Subject: [PATCH 05/13] fix: add commitlint config files should move to config folder later --- commitlint.config-ci.js | 13 +++++++++++++ commitlint.config.js | 1 + 2 files changed, 14 insertions(+) create mode 100644 commitlint.config-ci.js create mode 100644 commitlint.config.js diff --git a/commitlint.config-ci.js b/commitlint.config-ci.js new file mode 100644 index 00000000000..50daaea607f --- /dev/null +++ b/commitlint.config-ci.js @@ -0,0 +1,13 @@ +const { utils } = require('@commitlint/config-nx-scopes'); + +module.exports = { + extends: ['@commitlint/config-conventional', '@commitlint/config-nx-scopes'], + rules: { + 'scope-empty': [2, 'never'], + 'scope-enum': async (ctx) => [ + 2, + 'always', + ['ci', 'docs', 'specs', ...(await utils.getProjects(ctx))], + ], + }, +}; \ No newline at end of file diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000000..3d880289844 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1 @@ +module.exports = { extends: ['@commitlint/config-conventional'] }; \ No newline at end of file From 20c726a9042d54808ca71969933811ca7a56a2f3 Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 16:06:09 +0000 Subject: [PATCH 06/13] fix: make scope optional --- commitlint.config-ci.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/commitlint.config-ci.js b/commitlint.config-ci.js index 50daaea607f..2fbe4184444 100644 --- a/commitlint.config-ci.js +++ b/commitlint.config-ci.js @@ -4,10 +4,6 @@ module.exports = { extends: ['@commitlint/config-conventional', '@commitlint/config-nx-scopes'], rules: { 'scope-empty': [2, 'never'], - 'scope-enum': async (ctx) => [ - 2, - 'always', - ['ci', 'docs', 'specs', ...(await utils.getProjects(ctx))], - ], + 'scope-enum': [], }, }; \ No newline at end of file From 7bbaad9d328f15b3177b259584143b76d8024035 Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 16:08:27 +0000 Subject: [PATCH 07/13] fix: remove scope rules --- commitlint.config-ci.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/commitlint.config-ci.js b/commitlint.config-ci.js index 2fbe4184444..4cdea88858e 100644 --- a/commitlint.config-ci.js +++ b/commitlint.config-ci.js @@ -3,7 +3,5 @@ const { utils } = require('@commitlint/config-nx-scopes'); module.exports = { extends: ['@commitlint/config-conventional', '@commitlint/config-nx-scopes'], rules: { - 'scope-empty': [2, 'never'], - 'scope-enum': [], }, }; \ No newline at end of file From 08111cd76ab5e6dfd82fe76fd47fbf264d710a7c Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 20:18:30 +0000 Subject: [PATCH 08/13] chore: move config to config folder --- .nvmrc => .github/workflows/config/.nvmrc | 0 .../workflows/config/commitlint.config-ci.js | 0 .../workflows/config/commitlint.config.js | 0 .github/workflows/lint-pr.yml | 4 ++-- 4 files changed, 2 insertions(+), 2 deletions(-) rename .nvmrc => .github/workflows/config/.nvmrc (100%) rename commitlint.config-ci.js => .github/workflows/config/commitlint.config-ci.js (100%) rename commitlint.config.js => .github/workflows/config/commitlint.config.js (100%) diff --git a/.nvmrc b/.github/workflows/config/.nvmrc similarity index 100% rename from .nvmrc rename to .github/workflows/config/.nvmrc diff --git a/commitlint.config-ci.js b/.github/workflows/config/commitlint.config-ci.js similarity index 100% rename from commitlint.config-ci.js rename to .github/workflows/config/commitlint.config-ci.js diff --git a/commitlint.config.js b/.github/workflows/config/commitlint.config.js similarity index 100% rename from commitlint.config.js rename to .github/workflows/config/commitlint.config.js diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index 01133d26464..689a2dde7c3 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -22,7 +22,7 @@ jobs: - name: Setup node uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' + node-version-file: '.github/config/.nvmrc' - name: Install dependencies run: | @@ -30,4 +30,4 @@ jobs: npm install --no-save @commitlint/cli @commitlint/config-conventional @commitlint/config-nx-scopes nx - name: Check PR title - run: echo "${{ github.event.pull_request.title }}" | npx commitlint --config ./commitlint.config-ci.js + run: echo "${{ github.event.pull_request.title }}" | npx commitlint --config ./.github/config/commitlint.config-ci.js From 0b4de08bcccab8ea653a22268c8e76c0d1224442 Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 20:20:12 +0000 Subject: [PATCH 09/13] fix: correct paths --- .github/workflows/lint-pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index 689a2dde7c3..67c88b3d6df 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -22,7 +22,7 @@ jobs: - name: Setup node uses: actions/setup-node@v4 with: - node-version-file: '.github/config/.nvmrc' + node-version-file: '.github/workflows/config/.nvmrc' - name: Install dependencies run: | @@ -30,4 +30,4 @@ jobs: npm install --no-save @commitlint/cli @commitlint/config-conventional @commitlint/config-nx-scopes nx - name: Check PR title - run: echo "${{ github.event.pull_request.title }}" | npx commitlint --config ./.github/config/commitlint.config-ci.js + run: echo "${{ github.event.pull_request.title }}" | npx commitlint --config ./.github/workflows/config/commitlint.config-ci.js From a27a2a8788524350c38b4aea24ff9ec8af55b4c6 Mon Sep 17 00:00:00 2001 From: Gordsport <83510148+gordsport@users.noreply.github.com> Date: Tue, 6 Feb 2024 21:46:28 +0000 Subject: [PATCH 10/13] fix: remove unneeded dependancies --- .github/workflows/lint-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml index 67c88b3d6df..13476beafe7 100644 --- a/.github/workflows/lint-pr.yml +++ b/.github/workflows/lint-pr.yml @@ -27,7 +27,7 @@ jobs: - name: Install dependencies run: | rm package.json - npm install --no-save @commitlint/cli @commitlint/config-conventional @commitlint/config-nx-scopes nx + npm install --no-save @commitlint/cli @commitlint/config-conventional - name: Check PR title run: echo "${{ github.event.pull_request.title }}" | npx commitlint --config ./.github/workflows/config/commitlint.config-ci.js From e8c5445dc3276a59fe88daa67485201d2fe9c1c3 Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 21:49:08 +0000 Subject: [PATCH 11/13] test: removal of unneeded dependancies --- package.json | 238 --------------------------------------------------- 1 file changed, 238 deletions(-) diff --git a/package.json b/package.json index fa975d0ab84..9ddbbff2fcf 100644 --- a/package.json +++ b/package.json @@ -1,244 +1,6 @@ { - "name": "nx-monorepo", - "version": "0.0.0", - "license": "MIT", - "scripts": { - "start": "nx serve", - "build": "nx build", - "test": "nx test", - "postinstall": "husky install", - "test:all": "nx run-many --all --target=test", - "build:all": "nx run-many --all --target=build", - "build-spec:all": "nx run-many --all --target=build-spec", - "lint:all": "nx run-many --all --target=lint", - "e2e:all": "nx run-many --all --target=e2e", - "vegacapsule": "vegacapsule network bootstrap --config-path=../frontend-monorepo/vegacapsule/config.hcl", - "release": "git checkout develop ; git pull ; node scripts/make-release.js", - "trading:test": "cd apps/trading/e2e && poetry run pytest -k", - "trading:test:all": "cd apps/trading/e2e && poetry run pytest -s --numprocesses 6 --dist loadfile" - }, "engines": { "node": ">=20.9.0" }, "private": true, - "dependencies": { - "@apollo/client": "^3.5.8", - "@blueprintjs/icons": "^3.32.0", - "@coinbase/wallet-sdk": "^3.6.5", - "@radix-ui/react-accordion": "^1.1.0", - "@radix-ui/react-checkbox": "^1.0.1", - "@radix-ui/react-dialog": "^1.0.2", - "@radix-ui/react-dropdown-menu": "^2.0.2", - "@radix-ui/react-icons": "^1.1.1", - "@radix-ui/react-navigation-menu": "^1.1.1", - "@radix-ui/react-popover": "^1.0.3", - "@radix-ui/react-radio-group": "^1.1.1", - "@radix-ui/react-select": "2.0.0-rc.10", - "@radix-ui/react-separator": "^1.0.2", - "@radix-ui/react-slider": "^1.1.0", - "@radix-ui/react-switch": "^1.0.2", - "@radix-ui/react-tabs": "^1.0.2", - "@radix-ui/react-tooltip": "^1.0.7", - "@sentry/nextjs": "^6.19.3", - "@sentry/react": "^6.19.2", - "@sentry/tracing": "^6.19.2", - "@vegaprotocol/wallet-client": "0.1.9", - "@walletconnect/ethereum-provider": "^2.6.0", - "@web3-react/coinbase-wallet": "8.1.2-beta.0", - "@web3-react/core": "^8.1.2-beta.0", - "@web3-react/metamask": "^8.1.2-beta.0", - "@web3-react/walletconnect": "8.1.3-beta.0", - "@web3-react/walletconnect-v2": "^8.1.3-beta.0", - "ag-grid-community": "^31.0.1", - "ag-grid-react": "^31.0.1", - "allotment": "1.19.2", - "alpha-lyrae": "vegaprotocol/alpha-lyrae", - "apollo-link-timeout": "^4.0.0", - "bignumber.js": "^9.0.2", - "classnames": "^2.3.1", - "core-js": "^3.6.5", - "d3-array": "^3.2.4", - "d3-scale": "^4.0.2", - "d3-shape": "^3.2.0", - "date-fns": "^2.28.0", - "date-fns-tz": "^2.0.0", - "duration-js": "^4.0.0", - "ethers": "^5.6.0", - "graphql": "^15.7.2", - "graphql-request": "^5.0.0", - "graphql-ws": "^5.6.3", - "i18next": "23.7.6", - "i18next-browser-languagedetector": "7.2.0", - "i18next-http-backend": "^2.3.1", - "i18next-locize-backend": "^6.4.1", - "immer": "^9.0.12", - "iso8601-duration": "^2.1.1", - "js-sha3": "^0.8.0", - "jsondiffpatch": "^0.4.1", - "lodash": "^4.17.21", - "next": "13.3.0", - "pennant": "^1.15.0", - "react": "18.2.0", - "react-copy-to-clipboard": "5.1.0", - "react-dom": "18.2.0", - "react-hook-form": "^7.27.0", - "react-i18next": "13.5.0", - "react-intersection-observer": "^9.2.2", - "react-markdown": "^8.0.6", - "react-router-dom": "6.11.2", - "react-syntax-highlighter": "^15.4.5", - "react-use-websocket": "^3.0.0", - "react-virtualized-auto-sizer": "^1.0.6", - "react-window": "^1.8.9", - "react-window-infinite-loader": "^1.0.7", - "recharts": "^2.1.2", - "recursive-key-filter": "^1.0.2", - "regenerator-runtime": "0.13.7", - "toml": "^3.0.0", - "tslib": "^2.3.0", - "uuid": "^8.3.2", - "web-vitals": "^2.1.4", - "zod": "^3.20.3", - "zustand": "^4.3.2" - }, - "devDependencies": { - "@apollo/react-testing": "^4.0.0", - "@babel/core": "^7.14.5", - "@babel/plugin-proposal-export-default-from": "^7.18.10", - "@babel/plugin-proposal-private-methods": "^7.18.6", - "@babel/preset-env": "^7.18.10", - "@babel/preset-react": "^7.14.5", - "@babel/preset-typescript": "7.12.13", - "@commitlint/cli": "^16.2.4", - "@commitlint/config-conventional": "^16.2.4", - "@commitlint/config-nx-scopes": "^17.4.2", - "@cypress/grep": "^3.1.0", - "@ethersproject/experimental": "^5.6.0", - "@graphql-codegen/cli": "^2.11.8", - "@graphql-codegen/near-operation-file-preset": "^2.4.1", - "@graphql-codegen/typescript": "^2.7.3", - "@graphql-codegen/typescript-operations": "^2.5.3", - "@graphql-codegen/typescript-react-apollo": "^3.3.3", - "@graphql-inspector/cli": "^3.3.0", - "@graphql-inspector/validate-command": "^3.3.0", - "@nrwl/js": "17.1.2", - "@nx/cypress": "17.1.2", - "@nx/eslint": "17.1.2", - "@nx/eslint-plugin": "17.1.2", - "@nx/jest": "17.1.2", - "@nx/js": "17.1.2", - "@nx/next": "17.1.2", - "@nx/react": "17.1.2", - "@nx/rollup": "17.1.2", - "@nx/storybook": "17.1.2", - "@nx/web": "17.1.2", - "@nx/webpack": "17.1.2", - "@nx/workspace": "17.1.2", - "@pmmmwh/react-refresh-webpack-plugin": "^0.5.7", - "@rollup/plugin-url": "^7.0.0", - "@sentry/webpack-plugin": "^1.18.8", - "@storybook/addon-a11y": "7.5.3", - "@storybook/addon-docs": "7.5.3", - "@storybook/addon-essentials": "7.5.3", - "@storybook/addon-mdx-gfm": "7.5.3", - "@storybook/core-server": "7.5.3", - "@storybook/react": "7.5.3", - "@storybook/react-webpack5": "7.5.3", - "@svgr/rollup": "^8.0.1", - "@svgr/webpack": "^6.1.2", - "@swc-node/register": "~1.6.7", - "@swc/cli": "^0.1.62", - "@swc/core": "~1.3.85", - "@swc/jest": "0.2.20", - "@testing-library/jest-dom": "^5.16.2", - "@testing-library/react": "14.0.0", - "@testing-library/user-event": "^14.4.1", - "@types/classnames": "^2.3.1", - "@types/d3-array": "^3.2.1", - "@types/d3-scale": "^4.0.8", - "@types/d3-shape": "^3.1.5", - "@types/faker": "^5.5.8", - "@types/jest": "29.4.4", - "@types/lodash": "^4.14.171", - "@types/node": "18.14.2", - "@types/prismjs": "^1.26.0", - "@types/react": "18.2.33", - "@types/react-copy-to-clipboard": "5.0.7", - "@types/react-dom": "18.2.14", - "@types/react-router-dom": "^5.3.3", - "@types/react-syntax-highlighter": "^15.5.5", - "@types/react-virtualized-auto-sizer": "^1.0.1", - "@types/react-window": "1.8.8", - "@types/react-window-infinite-loader": "^1.0.6", - "@types/semver": "^7.5.0", - "@types/uuid": "^8.3.4", - "@typescript-eslint/eslint-plugin": "6.11.0", - "@typescript-eslint/parser": "6.11.0", - "autoprefixer": "10.4.13", - "babel-jest": "29.4.3", - "babel-loader": "8.1.0", - "css-loader": "^6.4.0", - "cypress": "^13.0.0", - "cypress-mochawesome-reporter": "^3.3.0", - "cypress-real-events": "^1.8.1", - "dotenv": "^16.0.1", - "env-cmd": "^10.1.0", - "eslint": "8.46.0", - "eslint-config-next": "13.1.1", - "eslint-config-prettier": "9.0.0", - "eslint-plugin-cypress": "2.15.1", - "eslint-plugin-import": "2.27.5", - "eslint-plugin-jest": "^26.1.5", - "eslint-plugin-jsx-a11y": "6.7.1", - "eslint-plugin-react": "7.32.2", - "eslint-plugin-react-hooks": "4.6.0", - "eslint-plugin-storybook": "^0.6.12", - "eslint-plugin-unicorn": "^41.0.0", - "faker": "^5.5.3", - "fetch-mock": "^9.11.0", - "flush-promises": "^1.0.2", - "glob": "^8.0.3", - "husky": "^7.0.4", - "inquirer": "^8.0.0", - "jest": "29.4.3", - "jest-canvas-mock": "^2.3.1", - "jest-environment-jsdom": "^29.4.1", - "jest-websocket-mock": "^2.3.0", - "lint-staged": "^12.3.3", - "mock-apollo-client": "^1.2.0", - "mock-socket": "^9.1.5", - "npmlog": "^6.0.2", - "nx": "17.1.2", - "postcss": "8.4.21", - "prettier": "2.7.1", - "react-refresh": "^0.10.0", - "recast": "^0.21.1", - "regenerator-runtime": "0.13.7", - "replace-in-file": "^6.3.2", - "resize-observer-polyfill": "^1.5.1", - "sass": "1.55.0", - "storybook": "7.0.24", - "storybook-addon-themes": "^6.1.0", - "style-loader": "^3.3.0", - "stylus": "^0.55.0", - "stylus-loader": "^7.1.0", - "tailwindcss": "3.3.3", - "ts-jest": "29.1.0", - "ts-node": "10.9.1", - "tslib": "^2.3.0", - "type-fest": "^3.8.0", - "typescript": "5.2.2", - "url-loader": "^4.1.1", - "webpack": "5.89.0", - "webpack-merge": "^5.8.0" - }, - "lint-staged": { - "*": "yarn nx format:write --uncommitted", - "*.{ts,tsx,js,jsx}": "yarn eslint --fix" - }, - "resolutions": { - "graphql": "15.8.0", - "//": "workaround storybook issue: https://github.com/storybookjs/storybook/issues/21642", - "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.cd77847.0" - } } \ No newline at end of file From 33096b07e37bbfe9b7cc4f04429f7d87bfc222c8 Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 21:51:50 +0000 Subject: [PATCH 12/13] chore: tidy up config --- .github/workflows/config/commitlint.config-ci.js | 4 +--- .github/workflows/config/commitlint.config.js | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 .github/workflows/config/commitlint.config.js diff --git a/.github/workflows/config/commitlint.config-ci.js b/.github/workflows/config/commitlint.config-ci.js index 4cdea88858e..987b76a3905 100644 --- a/.github/workflows/config/commitlint.config-ci.js +++ b/.github/workflows/config/commitlint.config-ci.js @@ -1,7 +1,5 @@ -const { utils } = require('@commitlint/config-nx-scopes'); - module.exports = { - extends: ['@commitlint/config-conventional', '@commitlint/config-nx-scopes'], + extends: ['@commitlint/config-conventional'], rules: { }, }; \ No newline at end of file diff --git a/.github/workflows/config/commitlint.config.js b/.github/workflows/config/commitlint.config.js deleted file mode 100644 index 3d880289844..00000000000 --- a/.github/workflows/config/commitlint.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { extends: ['@commitlint/config-conventional'] }; \ No newline at end of file From 4801ed615633cc6fa58ede83d57ae5ad18061887 Mon Sep 17 00:00:00 2001 From: gordsport Date: Tue, 6 Feb 2024 22:03:32 +0000 Subject: [PATCH 13/13] fix: json lint error --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9ddbbff2fcf..27bf9931014 100644 --- a/package.json +++ b/package.json @@ -2,5 +2,5 @@ "engines": { "node": ">=20.9.0" }, - "private": true, + "private": true } \ No newline at end of file