Skip to content

Commit

Permalink
fix: add configs files
Browse files Browse the repository at this point in the history
  • Loading branch information
bacher committed May 13, 2019
1 parent 1b4dec3 commit f7651f4
Show file tree
Hide file tree
Showing 22 changed files with 234 additions and 19 deletions.
34 changes: 34 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
presets: ['next/babel'],
plugins: [
[
'module-resolver',
{
root: ['./src'],
},
],
['@babel/plugin-proposal-decorators', { legacy: true }],
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-optional-chaining',
[
'babel-plugin-styled-components',
{
ssr: true,
displayName: false,
},
],
],
env: {
development: {
plugins: [
[
'babel-plugin-styled-components',
{
ssr: true,
displayName: true,
},
],
],
},
},
};
3 changes: 3 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
8 changes: 8 additions & 0 deletions .deployignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.DS_Store
.idea
coverage
node_modules
*.log
vendor
config/*.json
.git
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
tmp
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.json]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/.next
node_modules/
38 changes: 38 additions & 0 deletions .eslintrc.base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: { legacyDecorators: true },
},
extends: ['airbnb', 'prettier', 'prettier/react'],
plugins: ['prettier'],
rules: {
'react/jsx-filename-extension': [
'error',
{
extensions: ['.js'],
},
],
'react/prop-types': ['error', { ignore: ['className', 'children'] }],
'import/imports-first': ['error', 'absolute-first'],
'import/newline-after-import': 'error',
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['hrefLeft', 'hrefRight'],
aspects: ['invalidHref', 'preferButton'],
},
],
'no-console': 'error',
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'],
},
globals: {
window: true,
document: true,
localStorage: true,
FormData: true,
FileReader: true,
Blob: true,
navigator: true,
},
};
32 changes: 32 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const path = require('path');

module.exports = {
extends: require.resolve('./.eslintrc.base.js'),
settings: {
'import/resolver': {
'babel-module': {
alias: {
assets: path.resolve(__dirname, 'src/assets'),
components: path.resolve(__dirname, 'src/components'),
constants: path.resolve(__dirname, 'src/constants'),
containers: path.resolve(__dirname, 'src/containers'),
helpers: path.resolve(__dirname, 'src/helpers'),
locales: path.resolve(__dirname, 'src/locales'),
mocks: path.resolve(__dirname, 'src/mocks'),
pages: path.resolve(__dirname, 'src/pages'),
shared: path.resolve(__dirname, 'src/shared'),
static: path.resolve(__dirname, 'src/static'),
store: path.resolve(__dirname, 'src/store'),
themes: path.resolve(__dirname, 'src/themes'),
utils: path.resolve(__dirname, 'src/utils'),
},
},
node: {
extensions: ['.js'],
},
},
},
rules: {
'react/prop-types': [2, { ignore: ['className', 'children', 'forwardRef', 't'] }],
},
};
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.DS_Store
.idea
coverage
node_modules
*.log
dist
.next
vendor/*
tmp/*
.vscode

.env*
.npmrc
.yarnrc

src/app/static/static/*.js
src/app/static/static/*.json

config/golos.json
config/golos-dev.json
config/local.json
config/process.json
config/process-dev.json
config/process-prod.json

scripts/package-lock.json
scripts/yarn.lock

package-lock.json
6 changes: 6 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
11 changes: 11 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"*.js": [
"stylelint --ignore-pattern '!src'",
"prettier --write",
"git add"
],
"*.md": [
"prettier --write",
"git add"
]
}
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"arrowParens": "avoid",
"trailingComma": "es5",
"useTabs": false,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"tabWidth": 2,
"printWidth": 100
}
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
sudo: required

language: cpp

services:
- docker

before_install:
- echo "$TRAVIS_TAG"
- echo "$TRAVIS_BRANCH"

script:
- if [ -n "${TRAVIS_TAG}" ]; then
cd deploy/;
./deploy.sh;
fi
- docker images

notifications:
slack: goloschain:sLr7BW0VhNtuv1xrMKJ8MSQb
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"cookie-parser": "^1.4.4",
"cyber-country-flag": "^0.0.3",
"counterpart": "^0.18.6",
"cyber-golos": "^1.1.19",
"cyber-client": "^1.1.20",
"cyber-keygen": "^1.3.3",
"dotenv-webpack": "^1.7.0",
"express": "^4.16.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import tt from 'counterpart';
import { getKeyPair } from 'cyber-golos/lib/auth';
import { getKeyPair } from 'cyber-client/lib/auth';

import { getAuth } from 'utils/localStorage';
import { CardContent } from 'components/golos-ui/Card';
Expand Down
4 changes: 2 additions & 2 deletions src/components/userProfile/settings/keys/ResetKey/ResetKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import is from 'styled-is';
import tt from 'counterpart';
import { isEmpty } from 'ramda';
import { Form, Field } from 'react-final-form';
import cyber from 'cyber-golos';
import { generateKeys } from 'cyber-golos/lib/auth';
import cyber from 'cyber-client';
import { generateKeys } from 'cyber-client/lib/auth';
import ToastsManager from 'toasts-manager';

import SplashLoader from 'components/golos-ui/SplashLoader';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { connect } from 'react-redux';
import { isEmpty } from 'ramda';
import { getAccountPermissions } from 'cyber-golos/lib/auth';
import { getAccountPermissions } from 'cyber-client/lib/auth';

import { authProtection } from 'helpers/hoc';
import { fetchSettings, updateSettings } from 'store/actions/gate/settings';
Expand Down
2 changes: 1 addition & 1 deletion src/store/actions/cyberway/permissions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cyber from 'cyber-golos';
import cyber from 'cyber-client';

import { logout } from 'store/actions/gate/auth';
import { CYBERWAY_API, CYBERWAY_RPC } from 'store/middlewares/cyberway-api';
Expand Down
4 changes: 2 additions & 2 deletions src/store/actions/gate/auth.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-shadow */
import cyber from 'cyber-golos';
import { sign } from 'cyber-golos/lib/auth';
import cyber from 'cyber-client';
import { sign } from 'cyber-client/lib/auth';

import { CALL_GATE } from 'store/middlewares/gate-api';
import { saveAuth, removeAuth } from 'utils/localStorage';
Expand Down
2 changes: 1 addition & 1 deletion src/store/middlewares/cyberway-api/api.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cyber from 'cyber-golos';
import cyber from 'cyber-client';

import { defaults } from 'utils/common';
import { CALL_GATE } from 'store/middlewares/gate-api';
Expand Down
2 changes: 1 addition & 1 deletion src/store/middlewares/cyberway-api/rpc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cyber from 'cyber-golos';
import cyber from 'cyber-client';

import { defaults } from 'utils/common';

Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3714,22 +3714,22 @@ currently-unhandled@^0.4.1:
dependencies:
array-find-index "^1.0.1"

cyber-country-flag@^0.0.3:
version "0.0.3"
resolved "http://159.69.117.25:4873/cyber-country-flag/-/cyber-country-flag-0.0.3.tgz#10b2a83fea9b0b197f1ea7d26a71e98ad7217422"
integrity sha512-9c4VyZpe23YxWKx57InJLR5aAHpIhSIHyG7Zbdd6K933ZYegFWfMgtnn/WnEs2mJ8OvXsn+rs0KM8lro1dsyuQ==

cyber-golos@^1.1.19:
version "1.1.19"
resolved "http://159.69.117.25:4873/cyber-golos/-/cyber-golos-1.1.19.tgz#199a4079f29db5eb11a291f4c8ffd634c1ead1d3"
integrity sha512-MXASAh3sO3NOyQNK5MNWN2F/fy6krltg+hUxbIpWMR1zlRgZmUnB+hZ5MCjAkIurNIRz3shKliIoIA3t6WnPKA==
cyber-client@^1.1.20:
version "1.1.20"
resolved "http://159.69.117.25:4873/cyber-client/-/cyber-client-1.1.20.tgz#b9ad13adfa51600fbaae8e1bf3192ce9e8c90a7a"
integrity sha512-ChPltRDJNqVeVQcXGQeUPYL7FLBMVh2VkUPisFA08a+3c/hKqS8uz3g+bYveAbvP7Dq5L/7BUNpcsAY4WLX6SA==
dependencies:
"@babel/runtime" "^7.2.0"
cyberwayjs "^20.0.0-beta3.5"
idb "^3.0.2"
node-fetch "^2.3.0"
text-encoding "^0.7.0"

cyber-country-flag@^0.0.3:
version "0.0.3"
resolved "http://159.69.117.25:4873/cyber-country-flag/-/cyber-country-flag-0.0.3.tgz#10b2a83fea9b0b197f1ea7d26a71e98ad7217422"
integrity sha512-9c4VyZpe23YxWKx57InJLR5aAHpIhSIHyG7Zbdd6K933ZYegFWfMgtnn/WnEs2mJ8OvXsn+rs0KM8lro1dsyuQ==

cyber-keygen@^1.3.3:
version "1.3.3"
resolved "http://159.69.117.25:4873/cyber-keygen/-/cyber-keygen-1.3.3.tgz#449753d1dfea5c88f3c83a16de434d8744a84141"
Expand Down

0 comments on commit f7651f4

Please sign in to comment.