Skip to content

Commit 90788b7

Browse files
author
Adam Gajzlerowicz
committed
Init
0 parents  commit 90788b7

14 files changed

+284
-0
lines changed

Diff for: .DS_Store

8 KB
Binary file not shown.

Diff for: .babelrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"es2015", "stage-2"
4+
]
5+
}

Diff for: .gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
.idea
3+
.vscode
4+
coverage

Diff for: app/.DS_Store

6 KB
Binary file not shown.

Diff for: app/Page.jsx

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {render} from 'react-dom'
2+
import React from 'react';
3+
import {ThemeProvider} from 'react-css-themr';
4+
import inlineCss from './page.scss';
5+
6+
const contextTheme = {
7+
Item: require('./theme/ItemVendor.scss'),
8+
};
9+
10+
export const Page = () => {
11+
return (
12+
<div>
13+
<Item />
14+
<ThemeProvider theme={contextTheme}>
15+
<Item />
16+
</ThemeProvider>
17+
<Item theme={inlineCss}/>
18+
</div>
19+
)
20+
};
21+

Diff for: app/components/Item.jsx

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import {render} from 'react-dom'
2+
import React from 'react';
3+
import { themr } from 'react-css-themr';
4+
import defaultTheme from './Item.scss';
5+
6+
const Button = ({theme}) => {
7+
return (
8+
<div className={theme.button} >
9+
11 lkdsflk
10+
</div>
11+
)
12+
};
13+
14+
export const Item = themr('Item', defaultTheme)(Button);

Diff for: app/components/Item.scss

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.button {
2+
color: deeppink;
3+
padding: 10px;
4+
}
5+

Diff for: app/index.jsx

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import {render} from 'react-dom'
2+
import React from 'react';
3+
import {Provider} from 'react-redux';
4+
import {AppBar, Checkbox, IconButton} from 'react-toolbox';
5+
import {Layout, NavDrawer, Panel, Sidebar, Dropdown} from 'react-toolbox';
6+
import 'react-toolbox/lib/commons.scss';
7+
import {Page} from './Page';
8+
9+
10+
render((
11+
<Page />
12+
), document.getElementById('app'));

Diff for: app/page.scss

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.button{
2+
background: black;
3+
}

Diff for: app/templates/favicon.ico

1.12 KB
Binary file not shown.

Diff for: app/templates/index_default.html

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html class="no-js" lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
8+
<title>Redux</title>
9+
<meta name=”twitter:title” content="React Speed Coding | ReactSpeed.com">
10+
<style>
11+
@import 'https://fonts.googleapis.com/css?family=Roboto';
12+
*{
13+
font-family: 'Roboto', sans-serif;
14+
}
15+
16+
</style>
17+
</head>
18+
<body>
19+
20+
<div id="app"></div>
21+
22+
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
23+
24+
</body>
25+
</html>

Diff for: app/theme/ItemVendor.scss

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.button{
2+
color:blueviolet;
3+
}

Diff for: package.json

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"main": "index.js",
3+
"private": true,
4+
"scripts": {
5+
"start": "NODE_ENV=development webpack-dev-server",
6+
"lint": "NODE_ENV=lint webpack-dev-server --config webpack.lint.config.js",
7+
"cover": "NODE_ENV=test babel-node node_modules/.bin/babel-istanbul cover _mocha -- --require test/helpers/browser.js test/**/*.spec.js --reporter dot || true",
8+
"test": "NODE_ENV=test npm run elint && npm run slint && npm run test:mocha",
9+
"test:mocha": "NODE_ENV=test mocha test/helpers/browser.js test/**/*.spec.js --compilers js:babel-core/register",
10+
"build": "NODE_ENV=production webpack --config webpack.prod.config.js",
11+
"build:details": "NODE_ENV=production webpack --config webpack.prod.config.js --display-modules",
12+
"profile": "NODE_ENV=production webpack --config webpack.prod.config.js --profile --json > profile.json",
13+
"elint": "eslint . --ext .js --ext .jsx --cache",
14+
"elint:table": "eslint . --ext .js --ext .jsx --cache --format table || true",
15+
"elint:summary": "eslint . --ext .js --ext .jsx --cache --format 'node_modules/eslint-friendly-formatter' || true",
16+
"slint": "stylelint ./app/styles/**/*.css ./app/style.css --syntax scss",
17+
"storybook": "start-storybook -p 9001 -s ./app/public",
18+
"storybuild": "build-storybook -s ./app/public -o ./.storybook/build",
19+
"src:summary": "sloc app/",
20+
"src:detail": "sloc -d -f cli-table -k total,source,comment app/",
21+
"start-selenium": "java -jar ./../selenium-server-standalone-2.53.1.jar"
22+
},
23+
"dependencies": {
24+
"autoprefixer": "^6.5.0",
25+
"babel-plugin-transform-es2015-modules-commonjs": "^6.16.0",
26+
"deep-freeze-node": "^1.1.2",
27+
"deep-freeze-strict": "^1.1.1",
28+
"expect": "^1.20.2",
29+
"extract-text-webpack-plugin": "^1.0.1",
30+
"firebase": "^3.0.5",
31+
"immutability-helper": "^2.0.0",
32+
"marked": "^0.3.5",
33+
"material-ui": "^0.16.0",
34+
"path": "^0.12.7",
35+
"react": "^15.1.0",
36+
"react-addons-css-transition-group": "^15.3.2",
37+
"react-data-provider": "^1.0.1",
38+
"react-dom": "^15.1.0",
39+
"react-redux": "^4.4.5",
40+
"react-router": "^2.8.1",
41+
"react-select": "^0.9.1",
42+
"react-tap-event-plugin": "^1.0.0",
43+
"react-toolbox": "^1.2.1",
44+
"redux": "^3.5.2",
45+
"rumble-charts": "^1.0.7",
46+
"webdriverio": "^4.2.16"
47+
},
48+
"devDependencies": {
49+
"@kadira/storybook": "^1.28.1",
50+
"autoprefixer": "^6.3.6",
51+
"babel-cli": "^6.9.0",
52+
"babel-core": "^6.17.0",
53+
"babel-eslint": "^6.0.4",
54+
"babel-istanbul": "^0.8.0",
55+
"babel-loader": "^6.2.5",
56+
"babel-plugin-add-module-exports": "^0.2.1",
57+
"babel-plugin-transform-class-properties": "^6.11.5",
58+
"babel-plugin-transform-object-rest-spread": "^6.8.0",
59+
"babel-plugin-transform-runtime": "^6.9.0",
60+
"babel-polyfill": "^6.9.0",
61+
"babel-preset-airbnb": "^2.0.0",
62+
"babel-preset-es2015": "^6.16.0",
63+
"babel-preset-es2015-webpack": "^6.4.3",
64+
"babel-preset-es2017": "^1.4.0",
65+
"babel-preset-react": "^6.5.0",
66+
"babel-preset-react-hmre": "^1.1.0",
67+
"babel-preset-stage-2": "^6.13.0",
68+
"browser-sync": "^2.12.5",
69+
"browser-sync-webpack-plugin": "^1.0.1",
70+
"chai": "^3.5.0",
71+
"chai-immutable": "^1.5.4",
72+
"clean-webpack-plugin": "^0.1.8",
73+
"copy-webpack-plugin": "^2.1.1",
74+
"css-loader": "^0.23.1",
75+
"enzyme": "^2.3.0",
76+
"eslint": "^2.9.0",
77+
"eslint-config-airbnb": "^9.0.1",
78+
"eslint-friendly-formatter": "^2.0.4",
79+
"eslint-loader": "^1.3.0",
80+
"eslint-plugin-import": "^1.7.0",
81+
"eslint-plugin-jsx-a11y": "^1.5.3",
82+
"eslint-plugin-react": "^5.2.2",
83+
"extract-text-webpack-plugin": "^1.0.1",
84+
"flow-bin": "^0.33.0",
85+
"graceful-fs": "^4.1.4",
86+
"html-minifier": "^1.5.0",
87+
"html-webpack-plugin": "^2.15.0",
88+
"jsdom": "^9.1.0",
89+
"json-loader": "^0.5.4",
90+
"jsx-ast-utils": "^1.2.1",
91+
"mocha": "^2.4.5",
92+
"node-sass": "^3.10.1",
93+
"normalize.css": "^4.1.1",
94+
"postcss-easy-import": "^1.0.1",
95+
"postcss-loader": "^0.8.2",
96+
"precss": "^1.4.0",
97+
"pug": "^2.0.0-alpha6",
98+
"pug-load": "^2.0.0",
99+
"react": "^15.3.1",
100+
"react-addons-perf": "^15.1.0",
101+
"react-addons-test-utils": "^15.1.0",
102+
"react-dom": "^15.3.1",
103+
"redux-devtools": "^3.3.1",
104+
"sass-loader": "^4.0.2",
105+
"sinon": "^1.17.4",
106+
"sloc": "^0.1.10",
107+
"style-loader": "^0.13.0",
108+
"stylelint": "^6.3.3",
109+
"stylelint-config-standard": "^7.0.0",
110+
"stylelint-webpack-plugin": "^0.2.0",
111+
"suitcss-utils-display": "^1.0.2",
112+
"suitcss-utils-text": "^1.0.0",
113+
"url-join": "^1.1.0",
114+
"webpack": "^1.13.2",
115+
"webpack-dev-server": "^1.14.1"
116+
}
117+
}

Diff for: webpack.config.js

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
const webpack = require('webpack');
2+
const path = require('path');
3+
const autoprefixer = require('autoprefixer');
4+
const HtmlWebpackPlugin = require('html-webpack-plugin');
5+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
6+
7+
// Constants
8+
const APP = path.join(__dirname, 'app');
9+
const BUILD = path.join(__dirname, 'build');
10+
const TEMPLATE = path.join(__dirname, 'app/templates/index_default.html');
11+
const HOST = process.env.HOST || '0.0.0.0';
12+
const PORT = process.env.PORT || 8081;
13+
14+
module.exports = {
15+
entry: {
16+
app: APP
17+
},
18+
output: {
19+
path: BUILD,
20+
filename: '[name].js',
21+
publicPath: '/'
22+
},
23+
resolve: {
24+
extensions: ['', '.js', '.jsx', '.css', '.scss'],
25+
modulesDirectories: [
26+
'node_modules',
27+
path.resolve(__dirname, './node_modules')
28+
]
29+
},
30+
module: {
31+
loaders: [
32+
{
33+
test: /\.jsx?$/, // Match both .js and .jsx files
34+
exclude: /node_modules/,
35+
loader: 'babel',
36+
query: {
37+
presets: ['react', 'es2015', 'stage-0']
38+
}
39+
},
40+
{
41+
test: /(\.scss|\.css)$/,
42+
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass')
43+
}
44+
]
45+
},
46+
47+
devtool: 'eval-source-map',
48+
// webpack-dev-server configuration
49+
devServer: {
50+
historyApiFallback: true,
51+
// hot: true,
52+
inline: true,
53+
progress: true,
54+
55+
stats: 'errors-only',
56+
57+
host: HOST,
58+
port: PORT,
59+
60+
outputPath: BUILD
61+
},
62+
plugins: [
63+
new ExtractTextPlugin('bundle.css', { allChunks: true }),
64+
new HtmlWebpackPlugin({
65+
template: TEMPLATE,
66+
// JS placed at the bottom of the body element
67+
inject: 'body'
68+
}),
69+
new webpack.DefinePlugin({
70+
'process.env': {
71+
'NODE_ENV': JSON.stringify(process.env.NODE_ENV)
72+
}
73+
}),
74+
]
75+
};

0 commit comments

Comments
 (0)