Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/application-page…
Browse files Browse the repository at this point in the history
…-redesign
  • Loading branch information
boudra committed Jan 23, 2024
2 parents eb085de + 4119ea2 commit 3c36c7a
Show file tree
Hide file tree
Showing 224 changed files with 11,642 additions and 5,043 deletions.
41 changes: 13 additions & 28 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
<!--
Thank you for your pull request! Please review the requirements below
and ensure your pull request has fulfilled all requirements outlined in the target package.
Before submitting a PR for review, please make sure that all the CI checks are passing.
-->
<!-- Thank you for your pull request! Before marking it as "Ready for review",
please ensure that all items of checklist are satisfied and that CI checks are
passing. -->

## PR checklist
Fixes: #issue

For every PR, make sure that these statements are true:
- [ ] Includes only changes relevant to the original ticket. Significant refactoring needs to be separated.
- [ ] Doesn't contain type casts and non-null assertions.
- [ ] Doesn't add `@ts-ignore`.
- [ ] Doesn't disable lints.
- [ ] Doesn't use `useState` just for computation - use plain variables instead.
- [ ] Splits components into pure components that don't depend on external state or hooks.
- [ ] Avoid embedding components within other components
- [ ] Doesn't propagate optional values without good reason, doesn't mark property values as optional if that doesn't represent reality.
- [ ] Doesn't duplicate existing code.
- [ ] Parses out-of-domain data - this includes user input, API respones, on-chain data etc.
- [ ] Doesn't contain commented out code.
- [ ] Doesn't contain skipped or empty tests.
- [ ] If this PR adds/updates any feature, it adds/updates its test script

Subjective - at the discretion of the reviewers
- Does things as simply as possible, but not simpler.
- Doesn't reinvent the wheel or create premature abstractions.

##### Description
## Description

<!-- Describe your changes here. -->

##### Refers/Fixes
## Checklist

fixes #issuenumber
This PR:

- [ ] Includes only changes relevant to the original ticket. Significant refactoring needs to be separated.
- [ ] Doesn't disable eslint rules.
- [ ] Doesn't work around the type checker (including but not limited to: type casts, non-null assertions, `@ts-ignore`, unjustified optional values).
- [ ] Doesn't contain commented out code.
- [ ] If adding/updating a feature, it adds/updates its test script on Notion.
6 changes: 3 additions & 3 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
- name: Lint Builder
run: |
pnpm b-lint
pnpm lint:builder
- name: Test Builder
run: |
pnpm b-test
pnpm test:builder
- name: Typecheck Builder
run: |
pnpm b-typecheck
pnpm typecheck:builder
6 changes: 5 additions & 1 deletion .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
run: |
pnpm install
- name: Typecheck
run: |
pnpm typecheck:common
- name: Test Common
run: |
pnpm c-test
pnpm test:common
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Data client - Lint & Test & Typecheck
name: Data Layer - Lint & Test & Typecheck
on:
push:
branches:
Expand All @@ -9,7 +9,7 @@ on:
- "**"
jobs:
lint-test-typecheck:
concurrency: ci-data-client-${{ github.head_ref || github.run_id }}
concurrency: ci-data-layer-${{ github.head_ref || github.run_id }}
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -31,15 +31,15 @@ jobs:
pnpm install
# TODO
# - name: Lint Data Client
# - name: Lint Data Layer
# run: |
# pnpm dc-lint
# pnpm lint:data-layer

- name: Test Data Client
- name: Test Data Layer
run: |
pnpm dc-test
pnpm test:data-layer
# TODO
# - name: Typecheck Explorer
# - name: Typecheck Data Layer
# run: |
# pnpm ge-typecheck
# pnpm typecheck:data-layer
6 changes: 3 additions & 3 deletions .github/workflows/grant-explorer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
- name: Lint Explorer
run: |
pnpm ge-lint
pnpm lint:explorer
- name: Test Explorer
run: |
pnpm ge-test
pnpm test:explorer
- name: Typecheck Explorer
run: |
pnpm ge-typecheck
pnpm typecheck:explorer
14 changes: 7 additions & 7 deletions .github/workflows/round-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
- main
- release
- mrelease
pull_request:
branches:
- "**"
Expand All @@ -30,14 +30,14 @@ jobs:
run: |
pnpm install
- name: Lint Explorer
- name: Lint Round Manager
run: |
pnpm rm-lint
pnpm lint:manager
- name: Test Explorer
- name: Test Round Manager
run: |
pnpm rm-test
pnpm test:manager
- name: Typecheck Explorer
- name: Typecheck Round Manager
run: |
pnpm rm-typecheck
pnpm typecheck:manager
2 changes: 1 addition & 1 deletion .github/workflows/verify-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
- name: Test Verify-Env
run: |
pnpm ve-test
pnpm test:verify-env
19 changes: 9 additions & 10 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,37 @@ pre-commit:
run: pnpm format {staged_files}
stage_fixed: true

lint-ge:
lint-builder:
root: "packages/builder"
glob: "**/*.{js,ts,jsx,tsx}"
run: pnpm --filter "builder" lint:local {staged_files}
stage_fixed: true

lint-rm:
lint-manager:
root: "packages/round-manager"
glob: "**/*.{js,ts,jsx,tsx}"
run: pnpm --filter "round-manager" lint:local {staged_files}
stage_fixed: true

lint-builder:
lint-explorer:
root: "packages/grant-explorer"
glob: "**/*.{js,ts,jsx,tsx}"
run: pnpm --filter "grant-explorer" lint:local {staged_files}
stage_fixed: true

lint-data-client:
root: "packages/grants-stack-data-client"
lint-data-layer:
root: "packages/data-layer"
glob: "**/*.{js,ts,jsx,tsx}"
# TODO: harmonize command name with others
run: pnpm --filter "grants-stack-data-client" lint {staged_files}
run: pnpm --filter "data-layer" lint {staged_files}
stage_fixed: true


pre-push:
parallel: true
commands:
typecheck:
run: turbo run typecheck
run: pnpm turbo run typecheck
build:
run: turbo run build
run: pnpm turbo run build
test:
run: turbo run test --concurrency=50%
run: pnpm turbo run test --concurrency=50%
45 changes: 21 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,32 @@
"test": "pnpm turbo run test --no-cache --concurrency=50%",
"typecheck": "turbo run typecheck",
"format": "prettier --write",
"// round manager script": "====== packages/round-manager specific ======",
"rm-build": "pnpm --filter round-manager run build",
"rm-test": "turbo run test --filter=round-manager",
"rm-start": "pnpm --filter round-manager run start",
"rm-lint": "turbo run lint:ci --filter=round-manager",
"rm-typecheck": "turbo run typecheck --filter=round-manager",
"// grant explorer script": "====== packages/grant-explorer specific ======",
"ge-build": "turbo run build --filter=grant-explorer",
"ge-test": "turbo run test --filter=grant-explorer",
"ge-start": "pnpm --filter grant-explorer run start",
"ge-typecheck": "turbo run typecheck --filter=grant-explorer",
"ge-lint": "turbo run lint:ci --filter=grant-explorer",
"// builder script": "====== packages/builder specific ======",
"b-start": "pnpm --filter builder run start",
"b-lint": "turbo run lint:ci --filter=builder",
"b-test": "pnpm test --filter=builder",
"b-typecheck": "turbo run typecheck --filter=builder",
"c-test": "turbo run test --filter=common",
"ve-test": "turbo run test --filter=verify-env",
"// data client script": "====== packages/builder specific ======",
"dc-test": "turbo run test --filter=grants-stack-data-client"
"build:manager": "pnpm --filter round-manager run build",
"test:manager": "turbo run test --filter=round-manager",
"start:manager": "pnpm --filter round-manager run start",
"lint:manager": "turbo run lint:ci --filter=round-manager",
"typecheck:manager": "turbo run typecheck --filter=round-manager",
"build:explorer": "turbo run build --filter=grant-explorer",
"test:explorer": "turbo run test --filter=grant-explorer",
"start:explorer": "pnpm --filter grant-explorer run start",
"typecheck:explorer": "turbo run typecheck --filter=grant-explorer",
"lint:explorer": "turbo run lint:ci --filter=grant-explorer",
"start:builder": "pnpm --filter builder run start",
"lint:builder": "turbo run lint:ci --filter=builder",
"test:builder": "pnpm test --filter=builder",
"typecheck:builder": "turbo run typecheck --filter=builder",
"test:common": "turbo run test --filter=common",
"typecheck:common": "turbo run typecheck --filter=common",
"test:verify-env": "turbo run test --filter=verify-env",
"test:data-layer": "turbo run test --filter=data-layer"
},
"devDependencies": {
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0"
"@commitlint/config-conventional": "^17.7.0",
"turbo": "^1.11.0"
},
"dependencies": {
"prettier": "^3.0.3",
"turbo": "^1.10.15"
"prettier": "^3.0.3"
},
"pnpm": {
"overrides": {
Expand Down
7 changes: 5 additions & 2 deletions packages/builder/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ REACT_APP_DEBUG_MODE=false

# URL of the indexer. http://localhost:8080 for local indexer
REACT_APP_ALLO_API_URL="https://indexer-production.fly.dev"
# URL where the Grants Stack Data Client should point to
REACT_APP_GRANTS_STACK_DATA_CLIENT_BASE_URL="https://gitcoin-search-dev.fly.dev"
# Search API URL where the Data Layer should point to
REACT_APP_GRANTS_STACK_SEARCH_API_BASE_URL="https://d2n9vtjeq685yt.cloudfront.net"

# Subgraph URLs
REACT_APP_SUBGRAPH_ARBITRUM_API="https://api.thegraph.com/subgraphs/name/gitcoinco/gitcoin-grants-arbitrum-one"
Expand All @@ -44,6 +44,9 @@ REACT_APP_SUBGRAPH_PGN_API="https://graph-gitcoin-mainnet.hirenodes.io/subgraphs
REACT_APP_SUBGRAPH_PGN_TESTNET_API="https://graph-gitcoin-testnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_POLYGON_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-polygon"
REACT_APP_SUBGRAPH_POLYGON_MUMBAI_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-mumbai"
REACT_APP_SUBGRAPH_ZKSYNC_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-zkync-era-testnet"
REACT_APP_SUBGRAPH_ZKSYNC_MAINNET_API="https://api.studio.thegraph.com/query/45391/grants-round-zkera/v0.0.2"
REACT_APP_SUBGRAPH_BASE_API="https://api.studio.thegraph.com/query/45391/grants-round-base/v0.0.1"

# Variables below are optional for local development
REACT_APP_DATADOG_APPLICATION_ID=
Expand Down
26 changes: 26 additions & 0 deletions packages/builder/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
REACT_APP_SUBGRAPH_ARBITRUM_API="https://api.thegraph.com/subgraphs/name/gitcoinco/gitcoin-grants-arbitrum-one"
REACT_APP_SUBGRAPH_ARBITRUM_GOERLI_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-arbitrum-goerli"
REACT_APP_SUBGRAPH_AVALANCHE_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-avalanche-mainnet"
REACT_APP_SUBGRAPH_DEV1_API="http://local.local"
REACT_APP_SUBGRAPH_DEV2_API="http://local.local"
REACT_APP_SUBGRAPH_FANTOM_MAINNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fantom-mainnet"
REACT_APP_SUBGRAPH_FANTOM_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fantom-testnet"
REACT_APP_SUBGRAPH_FUJI_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-fuji-testnet"
REACT_APP_SUBGRAPH_GOERLI_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-goerli-testnet"
REACT_APP_SUBGRAPH_MAINNET_API="https://api.thegraph.com/subgraphs/name/vacekj/allo-mainnet"
REACT_APP_SUBGRAPH_OPTIMISM_MAINNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-optimism-mainnet"
REACT_APP_SUBGRAPH_PGN_API="https://graph-gitcoin-mainnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_PGN_TESTNET_API="https://graph-gitcoin-testnet.hirenodes.io/subgraphs/name/gitcoin/allo"
REACT_APP_SUBGRAPH_POLYGON_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-polygon"
REACT_APP_SUBGRAPH_POLYGON_MUMBAI_API="https://api.thegraph.com/subgraphs/name/allo-protocol/grants-round-mumbai"
REACT_APP_SUBGRAPH_ZKSYNC_TESTNET_API="https://api.thegraph.com/subgraphs/name/gitcoinco/grants-round-zkync-era-testnet"
REACT_APP_SUBGRAPH_ZKSYNC_MAINNET_API="https://api.studio.thegraph.com/query/45391/grants-round-zkera/v0.0.2"
REACT_APP_GRANTS_STACK_SEARCH_API_BASE_URL="https://gitcoin-search-dev.fly.dev"
REACT_APP_SUBGRAPH_BASE_API="https://api.studio.thegraph.com/query/45391/grants-round-base/v0.0.1"

REACT_APP_PINATA_GATEWAY="https://pinata-gateway.com"
REACT_APP_PINATA_JWT="abcedfg"
REACT_APP_IPFS_BASE_URL="https://local-ipfs.dev"
REACT_APP_PINATA_BASE_URL="https://local-pinata.dev"
REACT_APP_PINATA_JWT="test-token"
REACT_APP_WALLETCONNECT_PROJECT_ID="1234"
6 changes: 0 additions & 6 deletions packages/builder/.jest/setEnvVars.js

This file was deleted.

28 changes: 28 additions & 0 deletions packages/builder/craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,35 @@ const path = require("path");
const CracoEsbuildPlugin = require("craco-esbuild");
const { VerifyEnvPlugin } = require("verify-env");

const esmModules = [
"@rainbow-me",
"@spruceid",
"wagmi",
"@wagmi",
"github\\.com\\+gitcoinco\\+allo\\-indexer\\-client",
];

module.exports = {
jest: {
configure: () => ({
preset: "ts-jest/presets/js-with-ts",
testEnvironment: "jsdom",
clearMocks: true,
resetMocks: true,
coverageProvider: "v8",
verbose: true,
// @rainbow-me/rainbowkit is already an ESM module and
// it trips Jest when it tries to transform it, this ignores it
transformIgnorePatterns: [
`/node_modules/.pnpm/(?!(${esmModules.join("|")}))`,
],
moduleNameMapper: {
"\\.(css|styl|less|sass|scss|png|jpg|svg|ttf|woff|woff2)$":
require.resolve("jest-transform-stub"),
},
setupFilesAfterEnv: ["./src/setupTests.ts"],
}),
},
webpack: {
plugins: {
add: [new VerifyEnvPlugin()],
Expand Down
28 changes: 0 additions & 28 deletions packages/builder/jest.config.js

This file was deleted.

Loading

0 comments on commit 3c36c7a

Please sign in to comment.