Skip to content

Commit 16ba85a

Browse files
committed
tec hatch libraries changed in order to make tec-ui work, also formatting check tool for clean code
1 parent fe6dc6c commit 16ba85a

File tree

13 files changed

+137
-47
lines changed

13 files changed

+137
-47
lines changed

.babelrc

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,25 @@
55
{
66
"modules": false,
77
"useBuiltIns": "entry",
8-
"core-js": 3,
9-
"shippedProposals": true
8+
"corejs": 3
109
}
11-
]
10+
],
11+
"@babel/preset-react"
1212
],
1313
"plugins": [
14-
"babel-plugin-styled-components"
15-
]
16-
}
14+
["styled-components", { "displayName": true }]
15+
],
16+
"env": {
17+
"test": {
18+
"presets": [
19+
[
20+
"@babel/preset-env",
21+
{
22+
"modules": "commonjs",
23+
"targets": { "node": "current" }
24+
}
25+
]
26+
]
27+
}
28+
}
29+
}

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.eslintrc.json renamed to .eslintrc

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
"browser": true,
44
"es6": true
55
},
6-
"settings": {
7-
"react": {
8-
"version": "detect"
9-
}
10-
},
11-
"extends": ["standard", "standard-react", "plugin:prettier/recommended", "prettier/react"],
6+
"extends": ["standard", "standard-react", "prettier", "prettier/react"],
127
"parser": "babel-eslint",
8+
"parserOptions": {
9+
"ecmaVersion": 6,
10+
"ecmaFeatures": {
11+
"jsx": true
12+
},
13+
"sourceType": "module"
14+
},
1315
"plugins": ["prettier", "react", "react-hooks"],
1416
"rules": {
1517
"valid-jsdoc": "error",
@@ -21,12 +23,15 @@
2123
"semi": false,
2224
"trailingComma": "es5",
2325
"bracketSpacing": true,
24-
"jsxBracketSameLine": false
26+
"jsxBracketSameLine": false,
27+
"tabSize": 2
2528
}
2629
],
27-
"func-style": ["error", "expression"],
30+
"react/jsx-fragments": 0,
31+
"react/jsx-key": 0,
32+
"react/jsx-handler-names": 0,
2833
"react-hooks/rules-of-hooks": "error",
2934
"react-hooks/exhaustive-deps": "warn",
3035
"linebreak-style": ["error", "unix"]
3136
}
32-
}
37+
}

config-overrides.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* config-overrides.js */
2+
3+
const path = require('path')
4+
const { useBabelRc, override, useEslintRc } = require('customize-cra')
5+
6+
module.exports = override(
7+
useBabelRc(),
8+
useEslintRc(path.resolve(__dirname, '.eslintrc'))
9+
)

package.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
"bugs": "https://github.com/TECommons/tec-hatch/issues",
99
"license": "(GPL-3.0-or-later OR MIT)",
1010
"scripts": {
11-
"build": "npm run sync-assets && npm run build:app",
11+
"build": "npm run sync-assets && react-app-rewired build",
1212
"build:app": "parcel build index.html -d ./dist/ --public-url \".\" --no-cache",
1313
"serve": "parcel serve index.html --out-dir ./dist/ --no-cache",
14-
"sync-assets": "copy-aragon-ui-assets ./dist && copyfiles -u 1 './public/**/*' ./dist",
15-
"start": "npm run sync-assets && npm run serve"
14+
"sync-assets": "copy-aragon-ui-assets ./public",
15+
"start": "npm run sync-assets && react-app-rewired start"
1616
},
1717
"dependencies": {
1818
"@aragon/connect": "^0.7.0",
@@ -33,6 +33,7 @@
3333
"react-dom": "^16.3.1",
3434
"react-player": "^2.7.2",
3535
"react-plotly.js": "^2.4.0",
36+
"react-scripts": "^3.4.3",
3637
"react-spring": "^8.0.27",
3738
"rxjs": "^6.5.2",
3839
"styled-components": ">=4.0.0",
@@ -41,14 +42,17 @@
4142
"web3-utils": "^1.2.1"
4243
},
4344
"devDependencies": {
44-
"@babel/core": "^7.10.2",
45+
"@babel/core": "^7.11.1",
46+
"@babel/plugin-proposal-class-properties": "^7.7.4",
47+
"@babel/preset-react": "^7.7.4",
4548
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4",
4649
"@babel/plugin-proposal-optional-chaining": "^7.6.0",
4750
"@babel/preset-env": "^7.10.2",
4851
"babel-eslint": "^10.0.3",
4952
"babel-plugin-styled-components": "^1.10.6",
5053
"copyfiles": "^2.1.1",
5154
"cross-env": "^6.0.2",
55+
"customize-cra": "^1.0.0",
5256
"eslint": "^6.2.2",
5357
"eslint-config-prettier": "^6.1.0",
5458
"eslint-config-standard": "^14.1.0",
@@ -60,8 +64,10 @@
6064
"eslint-plugin-react": "^7.14.3",
6165
"eslint-plugin-react-hooks": "^2.0.1",
6266
"eslint-plugin-standard": "^4.0.1",
63-
"parcel-bundler": "^1.12.3",
64-
"prettier": "^1.18.2"
67+
"prettier": "^1.18.2",
68+
"react-app-polyfill": "^1.0.6",
69+
"react-app-rewired": "^2.1.6",
70+
"react-dev-utils": "^10.2.1"
6571
},
6672
"browserslist": [
6773
">2%",

public/index.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Honey Pot"
11+
/>
12+
13+
<title>Honey Pot</title>
14+
</head>
15+
<body>
16+
<noscript>You need to enable JavaScript to run this app.</noscript>
17+
<div id="root"></div>
18+
</body>
19+
</html>

scripts/build.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env node
2+
3+
const execute = require('child_process').execSync
4+
5+
execute(`rimraf ./build`, { stdio: 'inherit' })
6+
execute(`copy-aragon-ui-assets -n aragon-ui ./build`, {
7+
stdio: 'inherit',
8+
})
9+
10+
execute(
11+
`parcel build src/index.html --out-dir ./build --public-url ./ --no-cache`,
12+
{ stdio: 'inherit' }
13+
)

scripts/start.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env node
2+
3+
const execute = require('child_process').execSync
4+
5+
const clientPort = 3000
6+
7+
execute(`copy-aragon-ui-assets -n aragon-ui ./build`, {
8+
stdio: 'inherit',
9+
})
10+
11+
execute(
12+
`parcel serve src/index.html --port ${clientPort} --out-dir ./build --no-cache`,
13+
{ stdio: 'inherit' }
14+
)

src/components/Account/ScreenConnected.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,16 @@ const AccountScreenConnected = ({ onClosePopover, wallet }) => {
124124
${textStyle('label2')};
125125
`}
126126
>
127-
<IconCheck size="small" css={
128-
`color: ${theme.green};
129-
`}/>
127+
<IconCheck
128+
size="small"
129+
css={`
130+
color: ${theme.green};
131+
`}
132+
/>
130133
<span
131134
css={`
132135
margin-left: ${0.5 * GU}px;
133-
color: ${theme.green}
136+
color: ${theme.green};
134137
`}
135138
>
136139
{`Connected to ${networkName} Network`}

src/components/Account/ScreenProviders.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import React, { useCallback } from 'react'
22
import PropTypes from 'prop-types'
3-
import { ButtonBase, GU, Link, RADIUS, textStyle, useTheme } from '@tecommons/ui'
3+
import {
4+
ButtonBase,
5+
GU,
6+
Link,
7+
RADIUS,
8+
textStyle,
9+
useTheme,
10+
} from '@tecommons/ui'
411
import { getProviderFromUseWalletId } from '../../ethereum-providers'
512
import { getUseWalletProviders } from '../../utils/web3-utils'
613

0 commit comments

Comments
 (0)