Skip to content

Commit

Permalink
Pooped.
Browse files Browse the repository at this point in the history
  • Loading branch information
pekkis committed Nov 3, 2016
1 parent 7db5114 commit 69856d2
Show file tree
Hide file tree
Showing 56 changed files with 9,477 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": ["react-app"],
"plugins": [
"transform-flow-strip-types"
]
}
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

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

[*.json]
indent_style = space
indent_size = 2
71 changes: 71 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"extends": "airbnb",

"parser": "babel-eslint",
"plugins": [
"flowtype"
],

rules: {

"arrow-parens": [0],

"new-cap": [2, {
"capIsNewExceptions": [
"List",
"Map",
"Seq",
"Set",
"Range",
"Immutable.Map",
"Immutable.Set",
"Immutable.List",
"Immutable.Seq",
"Immutable.Range"
]
}],

"import/prefer-default-export": [0],
"react/jsx-no-bind": [1],
"react/jsx-filename-extension": [0],
"import/no-extraneous-dependencies": "off",
"react/forbid-prop-types": [1],

"flowtype/define-flow-type": 1,
"flowtype/require-parameter-type": 1,
"flowtype/require-return-type": [
1,
"always",
{
"annotateUndefined": "never"
}
],
"flowtype/space-after-type-colon": [
1,
"always"
],
"flowtype/space-before-type-colon": [
1,
"never"
],
"flowtype/type-id-match": [
1,
"^(([A-Z][a-z0-9]+)+Type)$|^Props$"
],
"flowtype/use-flow-type": 1,
"flowtype/valid-syntax": 1
},

"settings": {
"flowtype": {
"onlyFilesWithFlowAnnotation": true
}
},

"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
},
}

}
12 changes: 12 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[libs]
./node_modules/fbjs/flow/lib

[options]
suppress_type=$FlowIssue
module.name_mapper='.*\(.pcss\)' -> 'empty/object'
module.name_mapper.extension='png' -> '<PROJECT_ROOT>/ImageModule.js.flow'
module.name_mapper.extension='jpg' -> '<PROJECT_ROOT>/ImageModule.js.flow'
module.name_mapper.extension='gif' -> '<PROJECT_ROOT>/ImageModule.js.flow'

[version]
0.34.0
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
config.client.js
config.server.js
dist/*
coverage/
8 changes: 8 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { configure } from '@kadira/storybook';
const req = require.context('../src', true, /\.stories\.js$/);

function loadStories() {
req.keys().forEach((filename) => req(filename));
}

configure(loadStories, module);
21 changes: 21 additions & 0 deletions .storybook/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700" rel="stylesheet">

<style type="text/css">

html {
box-sizing: border-box;
font-family: 'Open Sans';
font-size: 16px;
}

body {
background-color: rgba(0, 0, 0, 0.05);
background-image: repeating-linear-gradient(0deg, transparent, transparent 7px, rgba(0, 0, 0, 0.2) 1px, transparent 8px), repeating-linear-gradient(90deg, transparent, transparent 7px, rgba(0, 0, 0, 0.2) 1px, transparent 8px);
background-size: 8px 8px;
}

*, *:before, *:after {
box-sizing: inherit;
}

</style>
9 changes: 9 additions & 0 deletions .storybook/webpack.config.babel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { getCommonLoaders, getPostCss } from '../webpack.config.babel';

// Do NOT refactor as an export. Breaks the kludge required by Storybook.
module.exports = {
module: {
loaders: getCommonLoaders('development').toJS(),
},
postcss: getPostCss()
};
3 changes: 3 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// This kludge is required because Storybook don't do babel version of config.
require('babel-register');
module.exports = require('./webpack.config.babel.js');
3 changes: 3 additions & 0 deletions ImageModule.js.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module "ImageModule" {
declare export default string;
}
27 changes: 27 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2015 Mikko Forsström & Panu Leppäniemi
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the names of the authors nor the names of contributors may be used
to endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 3 additions & 0 deletions config.client.example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
api: 'http://localhost:8890',
};
3 changes: 3 additions & 0 deletions config.server.example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
port: 8888,
};
37 changes: 37 additions & 0 deletions docs/api.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
server {

listen 80;
# listen 443 ssl http2;
# listen [::]:443 ssl http2;
#ssl on;
#ssl_certificate /etc/letsencrypt/live/hardcore-react-training.tunk.io/fullchain.pem;
#ssl_certificate_key /etc/letsencrypt/live/hardcore-react-training.tunk.io/privkey.pem;

server_name api.hardcore-react-training.tunk.io;
root /home/pekkis/js/hardcore-react-training/dist;

# Default Gzip Configuration (Set Exceptions Per Location)
gzip on;
gzip_comp_level 1;
gzip_http_version 1.1;
gzip_vary On;
gzip_proxied any;
gzip_types text/plain text/css text/xml image/svg+xml application/xml application/xml+rss application/xml+atom text/javascript application/x-javascript application/javascript application/json;
gzip_disable "MSIE [1-6]\.";

location / {

access_log off;
expires -1;
gzip on;
gzip_proxied any;
charset utf-8;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:8890;
proxy_redirect off;
}

}
85 changes: 85 additions & 0 deletions docs/basic.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
server {

listen 80;
server_name hardcore-react-training.tunk.io;
root /Users/pekkis/js/hardcore-react-training/dist;
index index.html;

# Default Gzip Configuration (Set Exceptions Per Location)
gzip on;
gzip_comp_level 1;
gzip_http_version 1.1;
gzip_vary On;
gzip_proxied any;
gzip_types text/plain text/css text/xml image/svg+xml application/xml application/xml+rss application/xml+atom text/javascript application/x-javascript application/javascript application/json;
gzip_disable "MSIE [1-6]\.";

# assets not worth gzipping
location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ {
access_log off;
gzip off;
expires 30d;
}

# assets worth gzipping
location ~* ^.+\.(css|js|map|html|txt)$ {
access_log off;
expires 30d;
gzip on;
charset utf-8;
}

location = /index.html {

#auth_basic "Get out!";
#auth_basic_user_file $document_root/../.htpasswd;

access_log off;
expires -1;
gzip on;
charset utf-8;
}


# Web fonts, must have the CORS header
location ~* ^.+\.(eot|ttf|otf|woff|woff2)$ {
access_log off;
gzip on;
expires 30d;
add_header Access-Control-Allow-Origin *;
}

# archives
location ~* ^.+\.(pdf|gz|bz2|exe|rar|zip|7z)$ {
access_log off;
expires -1;
gzip off;
}

# videos
location ~* ^.+\.(mp4|avi)$ {
expires -1;
access_log off;
gzip off;
}

# evil places
location ~* (\.svn|\.git) {
access_log off;
deny all;
}

location /api/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:8888;
proxy_redirect off;
}

location / {
try_files $uri $uri/ /index.html;
}

}
Loading

0 comments on commit 69856d2

Please sign in to comment.