Skip to content

Commit 513285e

Browse files
authored
Merge pull request #69 from kleros/feat/web
Feat: Initial web app for the court
2 parents 0370388 + e281309 commit 513285e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+9395
-209
lines changed

.codeclimate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ engines:
44
checks:
55
quotemark:
66
enabled: false
7+
exclude_paths:
8+
- "web/src/graphql/generated.ts"

.yarn/releases/yarn-3.2.0.cjs

Lines changed: 785 additions & 0 deletions
Large diffs are not rendered by default.

contracts/.npmignore

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
# Exclude everything by default from the package
12
**/*
2-
!/src/**
3-
!/artifacts/@kleros/**
4-
!/artifacts/src/**
5-
!/deployments/*/*.json
3+
4+
# Include this
5+
!/artifacts/**
6+
!/typechain-types/**
7+
!/deployments/**
8+
9+
# Except this
10+
/deployments/localhost/
11+
**/.DS_Store

contracts/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@kleros/kleros-v2-contracts",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Smart contracts for Kleros version 2",
5-
"main": "index.js",
5+
"main": "typechain-types/index.ts",
66
"repository": "git@github.com:kleros/kleros-v2.git",
77
"author": "Kleros",
88
"license": "MIT",
@@ -17,7 +17,8 @@
1717
"deploy:staging": "run-s \"deploy --network rinkeby {@}\" \"deploy --network arbitrumRinkeby {@}\" --",
1818
"test": "hardhat test",
1919
"watch": "hardhat watch",
20-
"docgen": "hardhat docgen"
20+
"docgen": "hardhat docgen",
21+
"publish": "yarn npm publish --access public --tag $(cat package.json | jq .version)"
2122
},
2223
"devDependencies": {
2324
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@0.3.0-beta.13",

netlify.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web/netlify.toml

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"subgraph",
1717
"web"
1818
],
19-
"packageManager": "yarn@3.1.1",
19+
"packageManager": "yarn@3.2.0",
2020
"volta": {
2121
"node": "16.15.1"
2222
},
@@ -33,6 +33,7 @@
3333
"eslint-plugin-node": "^11.1.0",
3434
"eslint-plugin-prettier": "^3.4.1",
3535
"eslint-plugin-promise": "^5.1.1",
36+
"eslint-utils": "^3.0.0",
3637
"husky": "^7.0.0",
3738
"lint-staged": "^11.0.0",
3839
"npm-run-all": "^4.1.5",

subgraph/tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
22
"extends": "@graphprotocol/graph-ts/types/tsconfig.base.json",
3-
"include": [
4-
"src"
5-
]
3+
"include": ["src"]
64
}

web/.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
trim_trailing_whitespace = true
6+
insert_final_newline = true
7+
charset = utf-8
8+
9+
[*.{js,jsx,ts,tsx,json,yml}]
10+
indent_style = space
11+
indent_size = 2

web/.eslintrc.json

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{
2+
"env": {
3+
"es6": true,
4+
"browser": true,
5+
"node": true
6+
},
7+
"root": true,
8+
"parser": "@typescript-eslint/parser",
9+
"parserOptions": {
10+
"ecmaVersion": 2020,
11+
"sourceType": "module",
12+
"ecmaFeatures": {
13+
"jsx": true
14+
}
15+
},
16+
"extends": [
17+
"eslint:recommended",
18+
"plugin:react/recommended",
19+
"plugin:react-hooks/recommended",
20+
"plugin:import/recommended",
21+
"plugin:import/react",
22+
"plugin:security/recommended",
23+
"plugin:@typescript-eslint/recommended",
24+
"plugin:prettier/recommended",
25+
"prettier"
26+
],
27+
"globals": {
28+
"Atomics": "readonly",
29+
"SharedArrayBuffer": "readonly"
30+
},
31+
"plugins": [
32+
"react",
33+
"react-hooks",
34+
"security",
35+
"import"
36+
],
37+
"ignorePatterns": [
38+
"src/assets"
39+
],
40+
"settings": {
41+
"react": {
42+
"version": "^16.12.0"
43+
},
44+
"import/resolver": {
45+
"parcel": {
46+
"rootDir": "src",
47+
"extensions": [
48+
".js",
49+
".jsx",
50+
".ts",
51+
".tsx",
52+
".svg",
53+
".png",
54+
".jpeg"
55+
]
56+
}
57+
}
58+
},
59+
"rules": {
60+
"max-len": [
61+
"warn",
62+
{
63+
"code": 80
64+
}
65+
],
66+
"react/prop-types": 0,
67+
"no-unused-vars": "off",
68+
"@typescript-eslint/no-unused-vars": [
69+
"error",
70+
{
71+
"varsIgnorePattern": "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)",
72+
"argsIgnorePattern": "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)"
73+
}
74+
],
75+
"no-console": [
76+
"error",
77+
{
78+
"allow": [
79+
"warn",
80+
"error",
81+
"info",
82+
"debug"
83+
]
84+
}
85+
],
86+
"@typescript-eslint/no-non-null-assertion": "off",
87+
"@typescript-eslint/no-explicit-any": "off",
88+
"security/detect-object-injection": "off",
89+
"security/detect-non-literal-fs-filename": "off",
90+
"import/extensions": [
91+
"error",
92+
"ignorePackages",
93+
{
94+
"js": "never",
95+
"jsx": "never",
96+
"ts": "never",
97+
"tsx": "never"
98+
}
99+
],
100+
"import/no-unresolved": "off"
101+
}
102+
}

web/.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/.yarn/*
2+
!/.yarn/versions
3+
!/.yarn/plugins
4+
!/.yarn/releases
5+
!/.yarn/sdks
6+
/.pnp.*
7+
node_modules
8+
9+
# Parcel
10+
.parcel-cache
11+
development
12+
build
13+
dist
14+
parcel-bundle-reports
15+
16+
# misc
17+
.eslintcache
18+
.DS_Store
19+
.env
20+
.env.test
21+
.env.local
22+
.env.development.local
23+
.env.test.local
24+
.env.production.local
25+
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*

web/.parcelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "@parcel/config-default",
3+
"transformers": {
4+
"*.svg": ["...", "@parcel/transformer-svg-react"]
5+
}
6+
}

web/.prettierrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"printWidth": 80,
3+
"endOfLine": "lf",
4+
"overrides": [
5+
{
6+
"files": [
7+
"*.json"
8+
],
9+
"options": {
10+
"parser": "json-stringify"
11+
}
12+
}
13+
]
14+
}

web/.yarnrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nodeLinker: node-modules
2+

web/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Kleros
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

web/codegen.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
schema: https://api.thegraph.com/subgraphs/name/alcercu/kleros-core
2+
documents: './src/hooks/queries/*.ts'
3+
generates:
4+
src/graphql/generated.ts:
5+
plugins:
6+
- typescript
7+
- typescript-operations

web/global.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {} from "styled-components";
2+
import { lightTheme } from "./src/styles/themes";
3+
4+
declare global {
5+
module "*.svg" {
6+
const content: React.FC<React.SVGAttributes<SVGElement>>;
7+
export default content;
8+
}
9+
}
10+
11+
declare module "styled-components" {
12+
type Theme = typeof lightTheme;
13+
//eslint-disable-next-line @typescript-eslint/no-empty-interface
14+
export interface DefaultTheme extends Theme {}
15+
}

web/netlify.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Yarn 3 cache does not work out of the box as of Jan 2022. Context:
2+
## https://github.com/netlify/build/issues/1535#issuecomment-1021947989
3+
[build.environment]
4+
NETLIFY_USE_YARN = "true"
5+
NETLIFY_YARN_WORKSPACES = "true"
6+
YARN_ENABLE_GLOBAL_CACHE = "true"
7+
# YARN_CACHE_FOLDER = "$HOME/.yarn_cache"
8+
# YARN_VERSION = "3.2.0"

web/package.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"name": "@kleros/kleros-v2-web",
3+
"version": "0.1.0",
4+
"source": "src/index.html",
5+
"browserslist": "> 0.5%, not dead",
6+
"repository": "",
7+
"author": "",
8+
"license": "MIT",
9+
"alias": {
10+
"src": "./src",
11+
"assets": "./src/assets",
12+
"components": "./src/components",
13+
"context": "./src/context",
14+
"layout": "./src/layout",
15+
"consts": "./src/consts",
16+
"hooks": "./src/hooks",
17+
"queries": "./src/hooks/queries",
18+
"pages": "./src/pages",
19+
"styles": "./src/styles",
20+
"svgs": "./src/assets/svgs"
21+
},
22+
"packageManager": "yarn@3.2.0",
23+
"scripts": {
24+
"clear": "rm -r .parcel-cache",
25+
"clean": "rm dist/bundle.js",
26+
"start": "parcel",
27+
"build": "parcel build",
28+
"check-style": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
29+
"check-types": "tsc --noEmit",
30+
"generate": "graphql-codegen"
31+
},
32+
"devDependencies": {
33+
"@parcel/transformer-svg-react": "^2.5.0",
34+
"@types/react": "^18.0.0",
35+
"@types/react-dom": "^18.0.0",
36+
"@types/styled-components": "^5.1.21",
37+
"@typescript-eslint/eslint-plugin": "^5.27.0",
38+
"@typescript-eslint/parser": "^5.27.0",
39+
"@typescript-eslint/utils": "^5.27.0",
40+
"eslint": "^8.16.0",
41+
"eslint-config-prettier": "^8.3.0",
42+
"eslint-import-resolver-parcel": "^1.10.6",
43+
"eslint-plugin-import": "^2.25.4",
44+
"eslint-plugin-prettier": "^4.0.0",
45+
"eslint-plugin-react": "^7.28.0",
46+
"eslint-plugin-react-hooks": "^4.3.0",
47+
"eslint-plugin-security": "^1.4.0",
48+
"eslint-utils": "^3.0.0",
49+
"lru-cache": "^7.8.0",
50+
"parcel": "^2.6.0",
51+
"prettier": "^2.5.1",
52+
"typescript": "^4.5.5"
53+
},
54+
"dependencies": {
55+
"@graphql-codegen/cli": "^2.6.2",
56+
"@graphql-codegen/typescript": "^2.4.9",
57+
"@graphql-codegen/typescript-operations": "^2.3.6",
58+
"@kleros/kleros-v2-contracts": "workspace:^",
59+
"@kleros/ui-components-library": "^1.1.0",
60+
"chart.js": "^3.7.1",
61+
"chartjs-adapter-moment": "^1.0.0",
62+
"core-js": "^3.21.1",
63+
"ethers": "^5.6.5",
64+
"graphql": "^16.4.0",
65+
"graphql-request": "^4.2.0",
66+
"moment": "^2.29.3",
67+
"react": "^18.0.0",
68+
"react-chartjs-2": "^4.1.0",
69+
"react-dom": "^18.0.0",
70+
"react-is": "^18.0.0",
71+
"react-router-dom": "6",
72+
"styled-components": "^5.3.5",
73+
"swr": "^1.3.0"
74+
}
75+
}

0 commit comments

Comments
 (0)