This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paulo Köch
committed
Aug 23, 2022
1 parent
28f393e
commit bbccfce
Showing
67 changed files
with
16,275 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"es6": true, | ||
"es2020": true | ||
}, | ||
"globals": { | ||
"jsdom": true, | ||
"jsSDK": true | ||
}, | ||
"parser": "@babel/eslint-parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
} | ||
}, | ||
"plugins": ["react", "babel"], | ||
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier"], | ||
"settings": { | ||
"react": { | ||
"version": "16.14" | ||
} | ||
}, | ||
"rules": { | ||
// Possible Errors | ||
"no-misleading-character-class": "error", | ||
"no-template-curly-in-string": "error", | ||
"no-console": "warn", | ||
// Best practices | ||
"array-callback-return": "error", | ||
"consistent-return": "error", | ||
"default-case": "error", | ||
"eqeqeq": "error", | ||
"no-eq-null": "error", | ||
"no-param-reassign": "error", | ||
"no-return-assign": "error", | ||
"no-return-await": "error", | ||
"babel/no-unused-expressions": "error", | ||
"require-await": "error", | ||
"radix": "error", | ||
// Variables | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
"argsIgnorePattern": "^_", | ||
"varsIgnorePattern": "^_" | ||
} | ||
], | ||
"no-shadow-restricted-names": "error", | ||
// Stylistic issues | ||
"no-nested-ternary": "error", | ||
"spaced-comment": [ | ||
"error", | ||
"always", | ||
{ | ||
"exceptions": ["-"] | ||
} | ||
], | ||
// ECMAScript 6 | ||
"arrow-body-style": ["error", "as-needed"], | ||
"no-duplicate-imports": "error", | ||
"no-var": "error", | ||
"prefer-const": [ | ||
"error", | ||
{ | ||
"destructuring": "all" | ||
} | ||
], | ||
"prefer-template": "error", | ||
"template-curly-spacing": "off", | ||
// React | ||
"react/prop-types": "off", | ||
"react/no-unescaped-entities": "off", | ||
"no-import-assign": "warn" | ||
}, | ||
"overrides": [ | ||
{ | ||
// https://typescript-eslint.io/docs/linting/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors | ||
"files": ["*.ts", "*.mts", "*.cts", "*.tsx"], | ||
"rules": { | ||
"no-undef": "off" | ||
} | ||
}, | ||
{ | ||
"files": ["src/**/*.ts", "src/**/*.tsx"], | ||
"excludedFiles": [ | ||
"src/components/ui/**/*.ts", | ||
"src/components/ui/**/*.tsx" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true, | ||
"modules": true | ||
}, | ||
"sourceType": "module", | ||
"project": "./tsconfig.json", | ||
"createDefaultProgram": true | ||
}, | ||
"plugins": ["@typescript-eslint", "react", "babel"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking" | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-floating-promises": "warn", | ||
"@typescript-eslint/no-unsafe-assignment": "warn", | ||
"@typescript-eslint/no-unsafe-member-access": "warn", | ||
"@typescript-eslint/no-unsafe-call": "warn", | ||
"@typescript-eslint/no-misused-promises": "warn", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
"argsIgnorePattern": "^_", | ||
"varsIgnorePattern": "^_" | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Pull request | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: master | ||
|
||
# This will cancel previous jobs in case of new push. | ||
concurrency: | ||
group: ${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.13.1 | ||
|
||
- name: Find yarn cache location | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: JS package cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install packages | ||
run: yarn install --pure-lockfile | ||
|
||
- name: Run audit | ||
run: yarn audit-ci | ||
|
||
eslint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.13.1 | ||
|
||
- name: Find yarn cache location | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: JS package cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install packages | ||
run: yarn install --pure-lockfile | ||
|
||
- name: Run linters | ||
run: yarn lint:js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
### Gatsby default | ||
node_modules/ | ||
.cache/ | ||
public | ||
src/gatsby-types.d.ts | ||
|
||
### macOS ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### macOS Patch ### | ||
# iCloud generated files | ||
*.icloud | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
!.vscode/*.code-snippets | ||
|
||
# Local History for Visual Studio Code | ||
.history/ | ||
|
||
# Built Visual Studio Code Extensions | ||
*.vsix | ||
|
||
### VisualStudioCode Patch ### | ||
# Ignore all local history of files | ||
.history | ||
.ionide | ||
|
||
# Support for Project snippet scope | ||
.vscode/*.code-snippets | ||
|
||
# Ignore code-workspaces | ||
*.code-workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# From https://www.gatsbyjs.com/plugins/gatsby-plugin-prettier-eslint/ | ||
**/node_modules/**/* | ||
**/.git/**/* | ||
**/dist/**/* | ||
.cache/**/* | ||
public/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"cSpell.words": ["Typegen", "unconfigured"], | ||
"[typescript]": { | ||
"editor.formatOnSave": false, | ||
"editor.tabSize": 2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,27 @@ | ||
# did-registry-demo-dapp | ||
# Fractal DID Registry demo dapp | ||
|
||
A simple demo dapp for our DID Registry. | ||
|
||
## Stack | ||
|
||
- Gatsby v4 | ||
- Styled components (using web3.fractal.id's theme) | ||
- [web3-react v6](https://github.com/Uniswap/web3-react/tree/v6) | ||
|
||
## Setup | ||
|
||
### Run development mode | ||
|
||
```bash | ||
yarn install | ||
|
||
yarn start | ||
``` | ||
|
||
### Local build | ||
|
||
``` | ||
yarn clean && yarn build | ||
yarn serve | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
"@babel/env", | ||
{ | ||
modules: false, | ||
useBuiltIns: "entry", | ||
forceAllTransforms: true, | ||
corejs: "3", | ||
}, | ||
], | ||
"@babel/react", | ||
"@babel/typescript", | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react"; | ||
|
||
import Web3Provider from "./src/components/common/Web3Provider"; | ||
|
||
export const wrapRootElement = ({ element }: { element: React.ReactNode }) => { | ||
return <Web3Provider>{element}</Web3Provider>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import type { GatsbyConfig } from "gatsby"; | ||
|
||
const config: GatsbyConfig = { | ||
siteMetadata: { | ||
title: `DID registry API demo`, | ||
siteUrl: `https://did-registry.demo.fractal.id/`, | ||
author: "@trustfractal", | ||
image: "/static/icons/favicon-32x32.png", | ||
}, | ||
// More easily incorporate content into your pages through automatic TypeScript type generation and better GraphQL IntelliSense. | ||
// If you use VSCode you can also use the GraphQL plugin | ||
// Learn more at: https://gatsby.dev/graphql-typegen | ||
graphqlTypegen: true, | ||
plugins: [ | ||
"gatsby-plugin-image", | ||
"gatsby-plugin-react-helmet", | ||
"gatsby-plugin-sharp", | ||
"gatsby-plugin-styled-components", | ||
"gatsby-transformer-sharp", | ||
{ | ||
resolve: "gatsby-source-filesystem", | ||
options: { | ||
name: "images", | ||
path: `${__dirname}/src/assets/images/`, | ||
}, | ||
__key: "images", | ||
}, | ||
{ | ||
resolve: "gatsby-plugin-react-svg", | ||
options: { | ||
rule: { | ||
include: /assets/, | ||
}, | ||
}, | ||
}, | ||
{ | ||
resolve: `gatsby-plugin-manifest`, | ||
options: { | ||
name: `DID registry demo`, | ||
short_name: `did-registry-demo`, | ||
start_url: `/`, | ||
background_color: `#FFFFFF`, | ||
theme_color: `#FFFFFF`, | ||
display: `minimal-ui`, | ||
icon: `src/assets/images/logo.png`, // This path is relative to the root of the site. | ||
}, | ||
}, | ||
], | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from "react"; | ||
|
||
import Web3Provider from "./src/components/common/Web3Provider"; | ||
|
||
export const wrapRootElement = ({ element }: { element: React.ReactNode }) => { | ||
return <Web3Provider>{element}</Web3Provider>; | ||
}; |
Oops, something went wrong.