Skip to content

Commit 12f52bf

Browse files
committed
initial commit
0 parents  commit 12f52bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3018
-0
lines changed

.babelrc

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"env": {
3+
"development": {
4+
"plugins": ["dynamic-import-node"]
5+
}
6+
},
7+
"plugins": [
8+
[
9+
"module-resolver",
10+
{
11+
"root": ["./", "./src"]
12+
}
13+
],
14+
[
15+
"babel-plugin-styled-components",
16+
{
17+
"ssr": true
18+
}
19+
],
20+
"add-module-exports",
21+
"loadable-components/babel",
22+
"react-hot-loader/babel"
23+
],
24+
"presets": [
25+
[
26+
"@babel/preset-env",
27+
{
28+
"targets": {
29+
"browsers": "last 2 versions",
30+
"node": "current"
31+
},
32+
"useBuiltIns": "usage"
33+
}
34+
],
35+
["@babel/preset-stage-0", { "decoratorsLegacy": true }],
36+
"@babel/preset-react",
37+
"@babel/preset-flow"
38+
]
39+
}

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/*
2+
coverage/*
3+
flow-typed/*

.eslintrc

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"extends": [
3+
"airbnb",
4+
"prettier",
5+
"prettier/react",
6+
"plugin:react/recommended"
7+
],
8+
"rules": {
9+
"no-new": 0,
10+
"global-require": 0,
11+
"class-methods-use-this": 0,
12+
"import/no-extraneous-dependencies": 0,
13+
"react/no-danger": 0,
14+
"react/jsx-filename-extension": 0,
15+
"react/no-array-index-key": 0,
16+
"react/require-default-props": 0
17+
},
18+
"plugins": ["react", "prettier", "flowtype"],
19+
"parser": "babel-eslint",
20+
"env": {
21+
"es6": true,
22+
"node": true,
23+
"browser": true,
24+
"jest": true
25+
},
26+
"settings": {
27+
"import/resolver": {
28+
"babel-module": {
29+
"extensions": [".js"]
30+
}
31+
}
32+
},
33+
"parserOptions": {
34+
"ecmaVersion": 9,
35+
"sourceType": "module"
36+
},
37+
"globals": {
38+
"shallow": true,
39+
"render": true,
40+
"mount": true,
41+
"toJson": true,
42+
"importScripts": true
43+
}
44+
}

.flowconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[ignore]
2+
.*/flow-typed/.*
3+
.*/node_modules/.*
4+
5+
[include]
6+
7+
[libs]
8+
./tools/flow/global.js
9+
10+
[options]
11+
esproposal.optional_chaining=ignore
12+
module.system.node.resolve_dirname=node_modules
13+
module.system.node.resolve_dirname=./src
14+
module.system.node.resolve_dirname=.

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules/*
2+
dist/*
3+
coverage/*
4+
flow-typed/*
5+
*.log
6+
yarn.lock
7+
package-lock.json
8+
.DS_Store

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package.json

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5"
4+
}

.stylelintrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"processors": ["stylelint-processor-styled-components"],
3+
"extends": [
4+
"stylelint-config-standard",
5+
"stylelint-config-styled-components",
6+
"stylelint-config-prettier"
7+
],
8+
"rules": {
9+
"comment-empty-line-before": "never",
10+
"declaration-empty-line-before": "never",
11+
},
12+
"syntax": "scss"
13+
}

README.md

Whitespace-only changes.

index.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
if (process.env.NODE_ENV === 'production') {
2+
require('./dist/server');
3+
} else {
4+
require('@babel/register');
5+
6+
require('./src/server');
7+
}

nodemon.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"watch": ["src/server.js", "src/routes.js", "src/utils/renderHtml.js"]
3+
}

package.json

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"name": "react-ssr-starter",
3+
"version": "1.0.0",
4+
"description": "Easy to start ssr with react",
5+
"bugs": {
6+
"url": "https://github.com/osamu38/react-ssr-starter/issues"
7+
},
8+
"license": "MIT",
9+
"author": "osamu38",
10+
"main": "index.js",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/osamu38/react-ssr-starter.git"
14+
},
15+
"scripts": {
16+
"build": "npm run build:client && npm run build:server",
17+
"build:analyze": "npm run build:client:analyze && npm run build:server:analyze",
18+
"build:client": "NODE_ENV=production webpack --progress --env --config ./tools/webpack/webpack.client.babel.js",
19+
"build:client:analyze": "NODE_ENV=production webpack --progress --env.analyze --config ./tools/webpack/webpack.client.babel.js",
20+
"build:server": "NODE_ENV=production webpack --progress --env --config ./tools/webpack/webpack.server.babel.js",
21+
"build:server:analyze": "NODE_ENV=production webpack --progress --env.analyze --config ./tools/webpack/webpack.server.babel.js",
22+
"precommit": "lint-staged",
23+
"postinstall": "flow-typed install --overwrite",
24+
"lint": "eslint . --fix",
25+
"lint:css": "stylelint './src/**/*.js'",
26+
"start": "nodemon index",
27+
"start:prod": "NODE_ENV=production node index",
28+
"storybook": "start-storybook -s ./public -p 2626 -c ./tools/storybook",
29+
"flow": "flow",
30+
"test": "NODE_ENV=test jest",
31+
"test:update": "npm test -- -u",
32+
"test:coverage": "npm test -- --coverage"
33+
},
34+
"jest": {
35+
"setupFiles": [
36+
"raf/polyfill",
37+
"<rootDir>/tools/jest/setup.js"
38+
],
39+
"transform": {
40+
".js": "<rootDir>/node_modules/babel-jest"
41+
}
42+
},
43+
"dependencies": {
44+
"axios": "^0.18.0",
45+
"body-parser": "^1.18.2",
46+
"compression": "^1.7.2",
47+
"cookie-parser": "^1.4.3",
48+
"express": "^4.16.3",
49+
"helmet": "^3.12.0",
50+
"history": "^4.7.2",
51+
"hpp": "^0.2.2",
52+
"html-minifier": "^3.5.15",
53+
"jsonwebtoken": "^8.2.1",
54+
"loadable-components": "^2.1.0",
55+
"morgan": "^1.9.0",
56+
"react": "^16.3.2",
57+
"react-cookie": "^1.0.5",
58+
"react-dom": "^16.3.2",
59+
"react-helmet": "^5.2.0",
60+
"react-hot-loader": "^4.1.3",
61+
"react-redux": "^5.0.7",
62+
"react-router-config": "^1.0.0-beta.4",
63+
"react-router-dom": "^4.2.2",
64+
"react-router-redux": "^5.0.0-alpha.9",
65+
"redux": "^4.0.0",
66+
"redux-logger": "^3.0.6",
67+
"redux-thunk": "^2.2.0",
68+
"serialize-javascript": "^1.5.0",
69+
"serve-favicon": "^2.5.0",
70+
"styled-components": "^3.2.6"
71+
},
72+
"devDependencies": {
73+
"@babel/core": "^7.0.0-beta.46",
74+
"@babel/preset-env": "^7.0.0-beta.46",
75+
"@babel/preset-flow": "^7.0.0-beta.46",
76+
"@babel/preset-react": "^7.0.0-beta.46",
77+
"@babel/preset-stage-0": "^7.0.0-beta.46",
78+
"@babel/register": "^7.0.0-beta.46",
79+
"@storybook/addon-links": "^3.4.4",
80+
"@storybook/react": "^3.4.4",
81+
"babel-core": "^7.0.0-bridge.0",
82+
"babel-eslint": "^8.2.3",
83+
"babel-jest": "^22.4.3",
84+
"babel-loader": "^8.0.0-beta.2",
85+
"babel-plugin-add-module-exports": "^0.2.1",
86+
"babel-plugin-dynamic-import-node": "^1.2.0",
87+
"babel-plugin-module-resolver": "^3.1.1",
88+
"babel-plugin-styled-components": "^1.5.1",
89+
"clean-webpack-plugin": "^0.1.19",
90+
"copy-webpack-plugin": "^4.5.1",
91+
"enzyme": "^3.3.0",
92+
"enzyme-adapter-react-16": "^1.1.1",
93+
"enzyme-to-json": "^3.3.3",
94+
"eslint": "^4.19.1",
95+
"eslint-config-airbnb": "^16.1.0",
96+
"eslint-config-prettier": "^2.9.0",
97+
"eslint-import-resolver-babel-module": "^5.0.0-beta.0",
98+
"eslint-plugin-flowtype": "^2.46.3",
99+
"eslint-plugin-import": "^2.11.0",
100+
"eslint-plugin-jsx-a11y": "^6.0.3",
101+
"eslint-plugin-prettier": "^2.6.0",
102+
"eslint-plugin-react": "^7.8.2",
103+
"flow-bin": "^0.72.0",
104+
"flow-typed": "^2.4.0",
105+
"friendly-errors-webpack-plugin": "^1.7.0",
106+
"husky": "^0.14.3",
107+
"jest": "^23.0.0-beta.2",
108+
"json-loader": "^0.5.7",
109+
"lint-staged": "^7.1.0",
110+
"nodemon": "^1.17.4",
111+
"prettier": "^1.12.1",
112+
"raf": "^3.4.0",
113+
"stylelint": "^8.4.0",
114+
"stylelint-config-prettier": "^3.2.0",
115+
"stylelint-config-standard": "^18.2.0",
116+
"stylelint-config-styled-components": "^0.1.1",
117+
"stylelint-processor-styled-components": "^1.3.1",
118+
"uglify-js": "^3.3.25",
119+
"uglifyjs-webpack-plugin": "^1.2.5",
120+
"webpack": "^3.11.0",
121+
"webpack-bundle-analyzer": "^2.11.3",
122+
"webpack-dev-middleware": "^2.0.6",
123+
"webpack-hot-middleware": "^2.22.2",
124+
"webpack-node-externals": "^1.7.2",
125+
"workbox-sw": "^3.2.0",
126+
"workbox-webpack-plugin": "^3.2.0"
127+
},
128+
"lint-staged": {
129+
"*.js": [
130+
"eslint --fix",
131+
"git add"
132+
]
133+
}
134+
}

public/favicon.ico

3.78 KB
Binary file not shown.

public/manifest.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"lang": "ja",
3+
"display": "standalone",
4+
"short_name": "RSSRS",
5+
"name": "react-ssr-starter",
6+
"icons": [
7+
{
8+
"src": "/static/images/touch/launcher-icon.png",
9+
"type": "image/png",
10+
"sizes": "48x48"
11+
},
12+
{
13+
"src": "/static/images/touch/launcher-icon-2x.png",
14+
"type": "image/png",
15+
"sizes": "96x96"
16+
},
17+
{
18+
"src": "/static/images/touch/launcher-icon-4x.png",
19+
"type": "image/png",
20+
"sizes": "192x192"
21+
}
22+
],
23+
"start_url": "/",
24+
"theme_color": "#f68084",
25+
"background_color": "#f68084"
26+
}
+19
Loading

public/static/images/svg/oct-icon.svg

+12
Loading
2.44 KB
Loading
5.32 KB
Loading
1.1 KB
Loading

src/actions/ui.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/* @flow */
2+
3+
import type { Dispatch } from 'types';
4+
5+
export function openMenu() {
6+
return (dispatch: Dispatch) => {
7+
dispatch({ type: 'OPEN_MENU' });
8+
};
9+
}
10+
export function closeMenu() {
11+
return (dispatch: Dispatch) => {
12+
dispatch({ type: 'CLOSE_MENU' });
13+
};
14+
}
15+
export function showError(error: string) {
16+
return (dispatch: Dispatch) => {
17+
dispatch({
18+
type: 'SHOW_ERROR',
19+
payload: {
20+
error,
21+
},
22+
});
23+
};
24+
}
25+
export function hideError() {
26+
return (dispatch: Dispatch) => {
27+
dispatch({ type: 'HIDE_ERROR' });
28+
};
29+
}

0 commit comments

Comments
 (0)