Skip to content

Commit e394ef9

Browse files
committed
add client
1 parent 0985af3 commit e394ef9

33 files changed

+63364
-0
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
client/.eslintignore

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
client/.eslintrc.json

.sass-lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
client/.sass-lint.yml

PULL_REQUEST_TEMPLATE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Background
2+
- Include some background information about your PR
3+
4+
5+
## Changes
6+
- Include a list of changes involved in your PR
7+
- If you can add an image
8+
9+
## Test on []()

bin/www

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/usr/bin/env node
2+
3+
/**
4+
* Module dependencies.
5+
*/
6+
7+
var app = require('../dist/app');
8+
var debug = require('debug')('server');
9+
var http = require('http');
10+
11+
debug.log = console.log.bind(console);
12+
13+
/**
14+
* Get port from environment and store in Express.
15+
*/
16+
17+
var port = normalizePort(process.env.PORT || '3000');
18+
app.set('port', port);
19+
20+
/**
21+
* Create HTTP server.
22+
*/
23+
24+
var server = http.createServer(app);
25+
26+
/**
27+
* Listen on provided port, on all network interfaces.
28+
*/
29+
30+
server.listen(port);
31+
server.on('error', onError);
32+
server.on('listening', onListening);
33+
34+
/**
35+
* Normalize a port into a number, string, or false.
36+
*/
37+
38+
function normalizePort(val) {
39+
var port = parseInt(val, 10);
40+
41+
if (isNaN(port)) {
42+
// named pipe
43+
return val;
44+
}
45+
46+
if (port >= 0) {
47+
// port number
48+
return port;
49+
}
50+
51+
return false;
52+
}
53+
54+
/**
55+
* Event listener for HTTP server "error" event.
56+
*/
57+
58+
function onError(error) {
59+
if (error.syscall !== 'listen') {
60+
throw error;
61+
}
62+
63+
var bind = typeof port === 'string'
64+
? 'Pipe ' + port
65+
: 'Port ' + port;
66+
67+
// handle specific listen errors with friendly messages
68+
switch (error.code) {
69+
case 'EACCES':
70+
console.error(bind + ' requires elevated privileges');
71+
process.exit(1);
72+
break;
73+
case 'EADDRINUSE':
74+
console.error(bind + ' is already in use');
75+
process.exit(1);
76+
break;
77+
default:
78+
throw error;
79+
}
80+
}
81+
82+
/**
83+
* Event listener for HTTP server "listening" event.
84+
*/
85+
86+
function onListening() {
87+
var addr = server.address();
88+
var bind = typeof addr === 'string'
89+
? 'pipe ' + addr
90+
: 'port ' + addr.port;
91+
console.log('Listening on ' + bind);
92+
}

client/.babelrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"presets": [
3+
"env",
4+
"es2015",
5+
"es2016",
6+
"es2017",
7+
"stage-1",
8+
"stage-2",
9+
"stage-3",
10+
"react"
11+
],
12+
"plugins": [
13+
"add-module-exports",
14+
"transform-runtime",
15+
"syntax-async-functions"
16+
]
17+
}

client/.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bin
2+
.eslintrc.js
3+
gulpfile.babel.js
4+
webpack.config.babel.js

client/.eslintrc.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "airbnb",
4+
"parserOptions": {
5+
"ecmaVersion": 8,
6+
"sourceType": "module",
7+
"ecmaFeatures": {
8+
"jsx": true,
9+
"experimentalObjectRestSpread": true
10+
}
11+
},
12+
"env": {
13+
"es6": true,
14+
"browser": true,
15+
"node": true,
16+
"mocha": true
17+
},
18+
"plugins": [
19+
"react",
20+
"jsx-a11y",
21+
"import"
22+
],
23+
"rules": {
24+
"brace-style": ["error", "stroustrup"],
25+
"comma-dangle": ["error", "always-multiline"],
26+
"func-names": ["error", "as-needed"],
27+
"max-len": "off",
28+
"no-param-reassign": ["error", { "props": false }],
29+
"no-plusplus": "off",
30+
"no-restricted-syntax": "off",
31+
"quote-props": ["error", "consistent"],
32+
"arrow-parens": ["error", "always"],
33+
"arrow-body-style": "off",
34+
"react/prop-types": ["error", { "ignore": ["children", "className"] }],
35+
"react/require-default-props": "off",
36+
"react/jsx-no-target-blank": "error",
37+
"react/jsx-filename-extension": ["warn", { "extensions": [".js"] }],
38+
"react/jsx-closing-bracket-location": ["error", "tag-aligned"],
39+
"import/no-mutable-exports": "off",
40+
"import/no-unresolved": "off",
41+
"import/extensions": ["error", "never", { "scss": "always" }],
42+
"import/no-absolute-path": "off",
43+
"import/no-extraneous-dependencies": "off",
44+
"import/no-named-as-default": "off"
45+
}
46+
}

client/.sass-lint.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
files:
2+
include:
3+
- 'client/**/*.s+(a|c)ss'
4+
exclude:
5+
- 'node_modules/**'
6+
options:
7+
formatter: stylish
8+
rules:
9+
class-name-format:
10+
- 2
11+
- convention: camelcase
12+
force-pseudo-nesting: 0
13+
hex-length: 0
14+
no-color-literals:
15+
- 2
16+
- allow-rgba: true
17+
property-sort-order: 0

client/.yarnrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry "https://registry.npmjs.org/"

0 commit comments

Comments
 (0)