Skip to content

Commit

Permalink
Merge pull request #1 from codigofalado/development
Browse files Browse the repository at this point in the history
v0.1: First beta version
  • Loading branch information
henriquepw authored Apr 13, 2020
2 parents 90ed15c + 7f75655 commit 62fac72
Show file tree
Hide file tree
Showing 46 changed files with 15,169 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
99 changes: 99 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
module.exports = {
env: {
browser: true,
es6: true,
},
extends: [
'react-app',
'airbnb',
'plugin:react/recommended',
'prettier/react',
'prettier/@typescript-eslint',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
allowImportExportEverywhere: true,
project: './tsconfig.json',
tsconfigRootDir: '.',
},
plugins: [
'react',
'react-hooks',
'prettier',
'@typescript-eslint',
'import-helpers',
],
rules: {
camelcase: 'off',
'object-curly-newline': 'off',
'comma-dangle': 'off',
'arrow-parens': 'off',
'prettier/prettier': 'error',
'global-require': 'off',
'react/prop-types': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-param-reassign': 'off',
'no-underscore-dangle': 'off',
'function-paren-newline': 'off', // temporary
'implicit-arrow-linebreak': 'off', // temporary
indent: 'off', // temporary
'operator-linebreak': 'off', // temporary
'react/jsx-filename-extension': [
'error',
{
extensions: ['.tsx'],
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'import/prefer-default-export': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
ts: 'never',
tsx: 'never',
},
],
'import-helpers/order-imports': [
'warn',
{
newlinesBetween: 'always',
groups: [
'/^(react|styled-components)/',
'module',
['/^~/components/', '/^~/Layout/'],
'/^~/contexts/',
['parent', 'sibling', 'index'],
'/^~/assets/',
'/^(~|.)/styles/',
],
alphabetize: { order: 'asc', ignoreCase: true },
},
],
},
settings: {
'import/extensions': ['js', 'jsx', '.ts', '.tsx'],
'import/resolver': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
alias: {
map: [['~', './src']],
extensions: ['.js', '.ts', '.tsx', '.d.ts', '.json'],
},
},
'import/resolver': {
typescript: {},
},
},
};
69 changes: 69 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variable files
.env*

# gatsby files
.cache/
public

# Mac files
.DS_Store

# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.cache
package.json
package-lock.json
public
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tabWidth": 2,
"endOfLine": "lf",
"singleQuote": true,
"trailingComma": "es5"
}
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2020 Henrique Martins Miranda

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.

6 changes: 6 additions & 0 deletions config/metadata.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
title: 'Github Fight',
description:
'A simple way to compare Github Reactions.',
author: '@henry-ns',
};
1 change: 1 addition & 0 deletions font-preload-cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"timestamp":1585927005472,"hash":"53260b0eb5ca3cf626e0786300172b67","assets":{"/":{"/static/lato-latin-700-1efbd38aa76ddae2580fedf378276333.woff2":true}}}
3 changes: 3 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'typeface-lato';

export { wrapRootElement } from './gatsby/wrapRootElement';
64 changes: 64 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
require('dotenv').config();

const path = require('path');

const siteMetadata = require('./config/metadata');

module.exports = {
siteMetadata,
plugins: [
'gatsby-plugin-react-helmet-async',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'images',
path: `${__dirname}/src/assets`,
},
},
'gatsby-transformer-sharp',
'gatsby-plugin-sharp',
{
resolve: 'gatsby-plugin-manifest',
options: {
name: 'Github Fight',
short_name: 'Github Fight',
start_url: '/',
background_color: '#B23F42',
theme_color: '#B23F42',
display: 'minimal-ui',
icon: 'src/assets/icon.png',
},
},
{
resolve: 'gatsby-source-graphql',
options: {
typeName: 'GitHub',
fieldName: 'github',
url: 'https://api.github.com/graphql',
headers: {
Authorization: `token ${process.env.GITHUB_TOKEN}`,
},
},
},
{
resolve: 'gatsby-plugin-page-creator',
options: {
path: `${__dirname}/src/pages`,
ignore: ['**/styles.ts'],
},
},
'gatsby-plugin-netlify',
'gatsby-plugin-preload-fonts',
'gatsby-plugin-netlify-cache',
'gatsby-plugin-styled-components',
'gatsby-plugin-typescript',
'gatsby-plugin-polished',
{
resolve: 'gatsby-plugin-root-import',
options: {
'~': path.join(__dirname, 'src'),
},
},
// `gatsby-plugin-offline`,
],
};
1 change: 1 addition & 0 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { wrapRootElement } from './gatsby/wrapRootElement';
22 changes: 22 additions & 0 deletions gatsby/wrapRootElement.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React, { FC } from 'react';
import { ApolloProvider } from 'react-apollo';
import { HelmetProvider } from 'react-helmet-async';
import { ThemeProvider } from 'styled-components';

import { client } from '../src/contexts/ApolloContext';
import { RepositoryProvider } from '../src/contexts/RepositoryContext';
import theme from '../src/styles/theme';

interface Props {
element: React.ReactNode;
}

export const wrapRootElement: FC<Props> = ({ element }) => (
<HelmetProvider>
<ThemeProvider theme={theme}>
<ApolloProvider client={client}>
<RepositoryProvider>{element}</RepositoryProvider>
</ApolloProvider>
</ThemeProvider>
</HelmetProvider>
);
Loading

0 comments on commit 62fac72

Please sign in to comment.