Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev Tools UI #1582

Merged
merged 73 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
219bd60
chore: new package (work-in-progress)
jaybuidl May 17, 2024
ccdf188
Merge branch 'dev' into feat/devtools
kemuru Jun 17, 2024
4a1ae9e
Merge branch 'dev' into feat/devtools
jaybuidl Jul 3, 2024
bf9972a
Merge branch 'dev' into feat/devtools
nikhilverma360 Jul 16, 2024
3e78cc5
chore(devtools): setup nextjs app
nikhilverma360 Jul 2, 2024
c3ad571
chore(devtools): setup layout, header, footer
nikhilverma360 Jul 2, 2024
7c6ac30
chore(devtools): added necessary svgs
nikhilverma360 Jul 2, 2024
1e40626
feat(devtools): ruler ui
nikhilverma360 Jul 3, 2024
a6db67f
fix(devtools): fixed typings
nikhilverma360 Jul 3, 2024
72f9895
fix(devtools): fix footer to render client side
nikhilverma360 Jul 3, 2024
4b962d3
fix(webtools): fixed linting issues, and themes
nikhilverma360 Jul 3, 2024
fc1fdcc
chore(devtools): removed unused variables
nikhilverma360 Jul 16, 2024
3e314cc
refactor(devtools): global declaration of theme types
nikhilverma360 Jul 18, 2024
d1b1841
refactor(devtools): dynamic theme types
nikhilverma360 Jul 18, 2024
ba544c2
Merge pull request #1641 from kleros/feat(devtools)/initial-setup-for…
alcercu Jul 18, 2024
a56ccf5
feat(devtools): setup graph-codegen cli
nikhilverma360 Jul 15, 2024
7d557b0
feat(devtools): setup wagmi cli & wagmi generate
nikhilverma360 Jul 15, 2024
38c0944
feat(devtools): ported dispute template editor
nikhilverma360 Jul 15, 2024
27f7439
chore(devtools): json-editor version change
nikhilverma360 Jul 16, 2024
c30af6d
chore(devtools): remove undeclared variable
nikhilverma360 Jul 17, 2024
1856dd5
refactor(devtools): dynamic import graphql-url from env
nikhilverma360 Jul 17, 2024
52e909a
fix(web-devtools): add kleros-sdk secondary resolution path on tsconfig
alcercu Jul 18, 2024
de4cf88
fix(devtools): temporarily ignore build errors
nikhilverma360 Jul 19, 2024
f3b8aed
chore: lockfile
jaybuidl Jul 25, 2024
1e913f2
feat: link to the devtools UI in the Help menu
jaybuidl Jul 25, 2024
aff71fc
Merge pull request #1656 from kleros/feat(devtool)/port-dispute-template
jaybuidl Jul 25, 2024
74bc188
feat(devtools): homepage UI
nikhilverma360 Jul 29, 2024
e73e10d
fix(devtools): fix typo
nikhilverma360 Jul 29, 2024
5dcab4b
Merge pull request #1661 from kleros/feat(devtools)/homepage-ui
jaybuidl Jul 29, 2024
88a507e
feat(devtools): mobile navbar integration & nav links
nikhilverma360 Jul 31, 2024
cab7f77
fix(devtools): fix dispute-template presets
nikhilverma360 Jul 31, 2024
f818bb0
Merge pull request #1664 from kleros/feat(devtools)/mobile-navbar-and…
jaybuidl Jul 31, 2024
dc25764
Merge branch 'dev' into feat/devtools
jaybuidl Aug 7, 2024
61c07b9
Merge branch 'dev' into feat/devtools
nikhilverma360 Aug 12, 2024
bd68a9b
refactor(web-devtools): revamp-ruler-ui
Harman-singh-waraich Sep 11, 2024
57716ac
refactor(web-devtools): update-component-name
Harman-singh-waraich Sep 11, 2024
f5f265e
Merge pull request #1685 from kleros/refactor/revamp-devtools-ruler-ui
alcercu Sep 16, 2024
a3aa4da
chore: ruler deployment
jaybuidl Sep 17, 2024
71e7d66
fix: ruler fix, tests updated, redeployed
jaybuidl Sep 18, 2024
bf8e8b8
feat(web-devtools): ruler-functionality
Harman-singh-waraich Sep 25, 2024
ae1779f
chore(web-devtools): update-yarn-lockfile
Harman-singh-waraich Sep 25, 2024
bb2dbe2
refactor(web-devtools): coderabbit-fixes
Harman-singh-waraich Sep 25, 2024
f360928
fix(web-devtools): wallet-connect-env-name
Harman-singh-waraich Sep 25, 2024
baa186e
refactor(web-devtools): remove-arbitrator-ruler-check
Harman-singh-waraich Sep 25, 2024
4e0b208
feat(web-devtools): add-connect-wallet-button
Harman-singh-waraich Sep 25, 2024
28e2411
chore(web-devtools): configure-typing
Harman-singh-waraich Sep 26, 2024
a5b995a
feat(web-devtools): inputable-dropdown-for-arbitrables-with-storage-s…
Harman-singh-waraich Sep 26, 2024
db886f0
feat(web-devtools): display-copiable-ruler-address
Harman-singh-waraich Sep 27, 2024
d0356d6
fix(web-devtools): remove-incorrect-default-checked-logic-in-radio-bu…
Harman-singh-waraich Sep 27, 2024
6f8cdc7
fix(web-devtools): fix-ruling-modes-enum
Harman-singh-waraich Sep 27, 2024
98eb691
refactor(web-devtools): hide-automatic-preset-options-while-it-is-not…
Harman-singh-waraich Oct 2, 2024
ffe48c5
refactor(web-devtools): single-connect-button-at-top-level
Harman-singh-waraich Oct 2, 2024
9ce49a2
refactor(web-devtools): replace-conflicting-ruling-settings-update-wi…
Harman-singh-waraich Oct 2, 2024
2c62886
refactor(web-devtools): update-labeled-input-style
Harman-singh-waraich Oct 4, 2024
62dac29
feat(web-devtools): tooltip-for-different-sections
Harman-singh-waraich Oct 4, 2024
a3146ab
fix(web-devtools): fix-typo
Harman-singh-waraich Oct 7, 2024
68d128b
Merge pull request #1694 from kleros/feat/devtools-ruler-functionality
alcercu Oct 7, 2024
51a553c
chore: removal of the centralized arbitrator, replaced by the ruler
jaybuidl Oct 7, 2024
d99da6d
Merge branch 'dev' into feat/devtools
jaybuidl Oct 8, 2024
c8a174f
fix: security patch GHSA-gp8f-8m3g-qvj9
jaybuidl Oct 8, 2024
364678a
fix: coderabbitai
jaybuidl Oct 9, 2024
0732520
fix: coderabbit and other type fixes
jaybuidl Oct 10, 2024
e9d5a8b
fix: coderabbit and other type fixes
jaybuidl Oct 10, 2024
144be0e
feat: update versions across v2 apps
kemuru Oct 9, 2024
5c69b6b
fix: type in devtools default url
jaybuidl Oct 10, 2024
3fbb460
fix: many type fixes, eslint bump and config migration
jaybuidl Oct 10, 2024
876f6ff
fix: useSwitchChain isLoading -> isPending
jaybuidl Oct 10, 2024
1d4e45f
fix: setting ignoreBuildErrors back to true
jaybuidl Oct 10, 2024
7faeef3
fix: getGraphqlUrl error handling without dynamic env var keys
jaybuidl Oct 11, 2024
00c933d
fix(web-devtools): type-issues
Harman-singh-waraich Oct 11, 2024
a8a597d
fix(web-devtools): fix-use-dispute-template-from-id-hook
Harman-singh-waraich Oct 11, 2024
d2a8904
chore: web-devtools clean task
jaybuidl Oct 14, 2024
a534252
Merge branch 'dev' into feat/devtools
jaybuidl Oct 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"kleros-sdk",
"subgraph",
"web",
"web-devtools",
"eslint-config",
"prettier-config",
"tsconfig"
Expand Down
15 changes: 15 additions & 0 deletions web-devtools/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8

[*.{html,js,.json,mjs,rjson,ts}]
indent_style = space
indent_size = 2

[*.sol]
indent_style = space
indent_size = 4
166 changes: 166 additions & 0 deletions web-devtools/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"env": {
"es6": true,
"browser": true,
"node": true
},
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"extends": [
"next/core-web-vitals",
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:import/recommended",
"plugin:import/react",
"plugin:security/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"plugins": [
"react",
"react-hooks",
"security",
"import"
],
"ignorePatterns": [
"src/assets"
],
"settings": {
"react": {
"version": "^16.12.0"
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": "./tsconfig.json"
},
"node": {
"extensions": [
".js",
".jsx",
".ts",
".tsx"
]
}
}
},
"rules": {
"max-len": [
"warn",
{
"code": 120
}
],
"react/prop-types": 0,
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"varsIgnorePattern": "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)",
"argsIgnorePattern": "(^_+[0-9]*$)|([iI]gnored$)|(^ignored)"
}
],
"no-console": [
"error",
{
"allow": [
"warn",
"error",
"info",
"debug"
]
}
],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-explicit-any": "off",
"security/detect-object-injection": "off",
"security/detect-non-literal-fs-filename": "off",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never"
}
],
"import/no-unresolved": "off",
"import/order": [
"warn",
{
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index"
],
"pathGroups": [
{
"pattern": "{react,styled-components}",
"group": "external",
"position": "before"
},
{
"pattern": "@kleros/**",
"group": "external",
"position": "after"
},
{
"pattern": "{svgs/**,assets/**}",
"group": "internal",
"position": "after"
},
{
"pattern": "{hooks/**,utils/**,consts/**,types/**,context/**,connectors/**,}",
"group": "internal",
"position": "after"
},
{
"pattern": "{queries/**,}",
"group": "internal",
"position": "after"
},
{
"pattern": "{src/**,}",
"group": "internal",
"position": "after"
},
{
"pattern": "{styles/**,}",
"group": "internal",
"position": "after"
},
{
"pattern": "{layout/**,pages/**,components/**,}",
"group": "internal",
"position": "after"
}
],
"pathGroupsExcludedImportTypes": [
"builtin"
],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
]
}
}
46 changes: 46 additions & 0 deletions web-devtools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# dependencies
/.yarn/*
!/.yarn/versions
!/.yarn/plugins
!/.yarn/releases
!/.yarn/sdks
/.pnp.*
node_modules

# next.js
/.next/
/out/
development
build
dist

# misc
*.pem
.eslintcache
.DS_Store
.env
.env.test
.env.testnet
.env.devnet
.env.local
.env.development.local
.env.test.local
.env.production.local

# generated code
src/hooks/contracts/generated.ts
src/graphql
generatedGitInfo.json
generatedNetlifyInfo.json

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# testing
/coverage

# typescript
*.tsbuildinfo
next-env.d.ts
21 changes: 21 additions & 0 deletions web-devtools/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Kleros

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions web-devtools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Dev Tools Frontend

In construction
6 changes: 6 additions & 0 deletions web-devtools/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { DefaultTheme } from "styled-components";
import { theme } from "styles/Theme";
declare module "styled-components" {
type Theme = typeof theme;
export interface DefaultTheme extends Theme {}
}
14 changes: 14 additions & 0 deletions web-devtools/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Yarn 3 cache does not work out of the box as of Jan 2022. Context:
## https://github.com/netlify/build/issues/1535#issuecomment-1021947989
[build.environment]
NETLIFY_USE_YARN = "true"
NETLIFY_YARN_WORKSPACES = "true"
YARN_ENABLE_GLOBAL_CACHE = "true"
# YARN_CACHE_FOLDER = "$HOME/.yarn_cache"
# YARN_VERSION = "3.2.0"

[functions]
directory = "web-devtools/netlify/functions/"

[dev]
framework = "nextjs"
33 changes: 33 additions & 0 deletions web-devtools/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
compiler: {
styledComponents: true,
},
webpack(config) {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.(".svg"));

config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/, // *.svg?url
},
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
resourceQuery: { not: [...fileLoaderRule.resourceQuery.not, /url/] }, // exclude if *.svg?url
use: ["@svgr/webpack"],
}
);

// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i;

return config;
},
jaybuidl marked this conversation as resolved.
Show resolved Hide resolved
};

export default nextConfig;
38 changes: 38 additions & 0 deletions web-devtools/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "@kleros/kleros-v2-web-devtools",
"version": "0.1.0",
"source": "src/index.html",
"browserslist": "> 0.5%, not dead",
"repository": "",
"author": "",
"license": "MIT",
"packageManager": "[email protected]+sha256.825003a0f561ad09a3b1ac4a3b3ea6207af2796d54f62a9420520915721f5186",
"volta": {
"node": "20.11.0",
"yarn": "4.3.1"
},
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"prettier": "@kleros/kleros-v2-prettier-config",
"devDependencies": {
"@svgr/webpack": "^8.1.0",
"@types/node": "^20",
"@types/react": "18.2.0",
"@types/react-dom": "^18.2.18",
"typescript": "^5.3.3"
},
"dependencies": {
"@kleros/kleros-sdk": "workspace:^",
"@kleros/ui-components-library": "^2.10.0",
"next": "14.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"styled-components": "^5.3.11",
"viem": "^1.21.4",
"wagmi": "^1.4.13"
}
}
Loading
Loading