Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
moersoy committed Feb 10, 2019
0 parents commit 2349928
Show file tree
Hide file tree
Showing 53 changed files with 12,464 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"plugins": [
"@babel/transform-runtime",
"@babel/proposal-class-properties"
],
"presets": [
[
"@babel/env",
{
"modules": false
}
],
"@babel/react"
],
"env": {
"production": {
"compact": false,
"only": [
"src"
],
"plugins": [
"transform-react-remove-prop-types",
"@babel/transform-react-inline-elements",
"@babel/transform-react-constant-elements"
]
},
"development" : {
"compact": false
}
}
}
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# editorconfig.org

root = true

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

[*.md]
trim_trailing_whitespace = false
86 changes: 86 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
const fs = require('fs');
const path = require('path');

const prettierOptions = JSON.parse(
fs.readFileSync(path.resolve(__dirname, '.prettierrc'), 'utf8')
);

module.exports = {
parser: 'babel-eslint',
extends: ['airbnb', 'prettier'],
plugins: ['prettier', 'react', 'jsx-a11y'],
env: {
jest: true,
browser: true,
node: true,
es6: true
},
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
rules: {
'prettier/prettier': ['error', prettierOptions],
'arrow-body-style': [2, 'as-needed'],
'class-methods-use-this': 0,
'import/imports-first': 0,
'import/newline-after-import': 0,
'import/no-dynamic-require': 0,
'import/no-extraneous-dependencies': 0,
'import/no-named-as-default': 0,
'import/no-unresolved': 2,
'import/no-webpack-loader-syntax': 0,
'import/prefer-default-export': 0,
indent: [
2,
2,
{
SwitchCase: 1
}
],
'jsx-a11y/aria-props': 2,
'jsx-a11y/heading-has-content': 0,
'jsx-a11y/label-has-associated-control': [
2,
{
// NOTE: If this error triggers, either disable it or add
// your custom components, labels and attributes via these options
// See https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-associated-control.md
controlComponents: ['Input']
}
],
'jsx-a11y/label-has-for': 0,
'jsx-a11y/mouse-events-have-key-events': 2,
'jsx-a11y/role-has-required-aria-props': 2,
'jsx-a11y/role-supports-aria-props': 2,
'max-len': 0,
'newline-per-chained-call': 0,
'no-confusing-arrow': 0,
'no-console': 1,
'no-unused-vars': 2,
'no-use-before-define': 0,
'prefer-template': 2,
'react/destructuring-assignment': 0,
'react/jsx-closing-tag-location': 0,
'react/forbid-prop-types': 0,
'react/jsx-first-prop-new-line': [2, 'multiline'],
'react/jsx-filename-extension': 0,
'react/jsx-no-target-blank': 0,
'react/jsx-uses-vars': 2,
'react/require-default-props': 0,
'react/require-extension': 0,
'react/self-closing-comp': 0,
'react/sort-comp': 0,
'require-yield': 0
},
settings: {
'import/resolver': {
webpack: {
config: './config/webpack.prod.babel.js'
}
}
}
};
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true
}
7 changes: 7 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"processors": ["stylelint-processor-styled-components"],
"extends": [
"stylelint-config-recommended",
"stylelint-config-styled-components"
]
}
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome",
"url": "http://localhost:3000",
"webRoot": "${workspaceRoot}/src",
"sourceMapPathOverrides": {
"webpack:///./app/*": "${webRoot}/*",
"webpack:///app/*": "${webRoot}/*"
}
}
]
}
33 changes: 33 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"editor.wordWrap": "on",
"editor.wordWrapColumn": 80,

// Files
"files.associations": {
".babelrc": "jsonc",
".eslintrc": "jsonc",
".flowconfig": "ini",
"*.js": "javascriptreact"
},
"files.exclude": {
"**/*.log": true,
"**/*.log*": true,
"**/dist": true,
"**/coverage": true
},

// Linting:
"eslint.enable": true,
"eslint.validate": ["javascript", "javascriptreact", "vue"],
"stylelint.enable": true,

// Set the default
"editor.formatOnSave": false,
// Enable per-language
"[javascript]": {
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.formatOnSave": true
}
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

### `npm start`

Runs the app in the development mode.<br>

### `npm run build`

Builds the app for production to the `build` folder.<br>
92 changes: 92 additions & 0 deletions config/webpack.base.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/**
* COMMON WEBPACK CONFIGURATION
*/

const path = require('path');
const webpack = require('webpack');

process.noDeprecation = true;

module.exports = options => ({
mode: options.mode,
entry: options.entry,
output: Object.assign(
{
path: path.resolve(process.cwd(), 'build'),
publicPath: '/'
},
options.output
),
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: options.babelQuery
}
},
{
// Preprocess our own .scss files
test: /\.scss$/,
exclude: /node_modules/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
// Preprocess 3rd party .css files located in node_modules
test: /\.css$/,
include: /node_modules/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(eot|svg|otf|ttf|woff|woff2)$/,
use: 'file-loader'
},
{
test: /\.(jpg|png|gif)$/,
use: 'file-loader'
},
{
test: /\.html$/,
use: 'html-loader'
},
{
test: /\.(mp4|webm)$/,
use: {
loader: 'url-loader',
options: {
limit: 10000
}
}
}
]
},
plugins: options.plugins.concat([
new webpack.ProvidePlugin({
// make fetch available
fetch: 'exports-loader?self.fetch!whatwg-fetch'
}),

new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV)
}
})
]),
resolve: {
modules: ['app', 'node_modules'],
extensions: ['.js', '.jsx', '.scss', '.react.js'],
mainFields: ['browser', 'jsnext:main', 'main']
},
devtool: options.devtool,
target: 'web',
performance: options.performance || {},
optimization: {
namedModules: true,
splitChunks: {
name: 'vendor',
minChunks: 2
}
}
});
39 changes: 39 additions & 0 deletions config/webpack.dev.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* DEVELOPMENT WEBPACK CONFIGURATION
*/

const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');

module.exports = require('./webpack.base.babel')({
mode: 'development',
entry: [
'eventsource-polyfill', // Necessary for hot reloading with IE
'webpack-hot-middleware/client?reload=true',
path.join(process.cwd(), 'src/index.js')
],

output: {
filename: '[name].js',
chunkFilename: '[name].chunk.js'
},

plugins: [
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
inject: true,
template: 'static/index.html'
}),
new CircularDependencyPlugin({
exclude: /a\.js|node_modules/, // exclude node_modules
failOnError: false
})
],
devtool: 'inline-source-map', // 'eval-source-map',

performance: {
hints: false
}
});
Loading

0 comments on commit 2349928

Please sign in to comment.