Skip to content

Commit 0f1639c

Browse files
committed
docs-infra-completed
1 parent 3d7eea7 commit 0f1639c

File tree

8 files changed

+184
-0
lines changed

8 files changed

+184
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
yarn-error.log
33
npm-error.log
4+
/docs/node_modules

docs/.babelrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"presets": ["es2015", "stage-0", "react"],
3+
"env": {
4+
"development": {
5+
"plugins": [
6+
["react-transform", {
7+
"transforms": [{
8+
"transform": "react-transform-hmr",
9+
"imports": ["react"],
10+
"locals": ["module"]
11+
}, {
12+
"transform": "react-transform-catch-errors",
13+
"imports": ["react", "redbox-react"]
14+
}]
15+
}]
16+
]
17+
}
18+
}
19+
}

docs/client/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
4+
5+
const App = () => (
6+
<div>
7+
Welcome to Docs
8+
</div>
9+
)
10+
ReactDOM.render((<App
11+
/>), document.getElementById('app'));

docs/package.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "react-lite-docs",
3+
"version": "0.0.1",
4+
"description": "Documentation of react-lite-ui",
5+
"author": "Codebrahma",
6+
"scripts": {
7+
"start": "cross-env NODE_ENV=production UV_THREADPOOL_SIZE=100 node ./server",
8+
"build": "cross-env NODE_ENV=production UV_THREADPOOL_SIZE=100 webpack --config ./webpack.config.production --colors --profile --progress",
9+
"deploy": "gh-pages -d build"
10+
},
11+
"dependencies": {
12+
"babel-loader": "^7.1.4",
13+
"babel-standalone": "^6.7.7",
14+
"classnames": "^2.2.5",
15+
"codemirror": "^5.14.2",
16+
"history": "^2.1.1",
17+
"react": "^16.4.1",
18+
"react-dom": "^16.4.1",
19+
"react-router": "^4.3.1",
20+
"webpack": "^4.12.0"
21+
},
22+
"devDependencies": {
23+
"autoprefixer": "^6.4.0",
24+
"babel-core": "^6.13.2",
25+
"babel-eslint": "^7.1.1",
26+
"babel-loader": "^6.2.4",
27+
"babel-plugin-react-transform": "^2.0.2",
28+
"babel-preset-es2015": "^6.13.2",
29+
"babel-preset-react": "^6.5.0",
30+
"babel-preset-stage-0": "^6.5.0",
31+
"babel-preset-stage-2": "^6.13.0",
32+
"cross-env": "^3.1.3",
33+
"css-loader": "^0.26.1",
34+
"express": "^4.13.4",
35+
"extract-text-webpack-plugin": "^4.0.0-beta.0",
36+
"gh-pages": "^0.12.0",
37+
"highlight-loader": "git://github.com/javivelasco/highlight-loader.git#master",
38+
"highlight.js": "^9.3.0",
39+
"html-loader": "^0.4.3",
40+
"html-webpack-plugin": "^2.16.1",
41+
"markdown-loader": "^0.1.7",
42+
"node-sass": "^3.7.0",
43+
"postcss-loader": "^1.2.1",
44+
"raw-loader": "^0.5.1",
45+
"react-transform-catch-errors": "^1.0.2",
46+
"react-transform-hmr": "^1.0.4",
47+
"redbox-react": "^1.2.4",
48+
"sass-loader": "^4.0.0",
49+
"style-loader": "^0.13.1",
50+
"transfer-webpack-plugin": "^0.1.4",
51+
"webpack-dev-middleware": "^1.6.1",
52+
"webpack-hot-middleware": "^2.10.0"
53+
},
54+
"repository": "https://github.com/Codebrahma/React-Lite-UI",
55+
"license": "MIT"
56+
}

docs/public/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>React Lite Components</title>
6+
</head>
7+
<body>
8+
<div id="app"></div>
9+
<script src="docs.js"></script>
10+
</body>
11+
</html>

docs/public/index.js

Whitespace-only changes.

docs/server.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const path = require('path');
2+
const express = require('express');
3+
const webpack = require('webpack');
4+
const config = require('./webpack.config.development');
5+
6+
const app = express();
7+
const compiler = webpack(config);
8+
9+
app.use(require('webpack-dev-middleware')(compiler, {
10+
noInfo: true,
11+
publicPath: config.output.publicPath,
12+
stats: {
13+
colors: true
14+
}
15+
}));
16+
17+
app.use(require('webpack-hot-middleware')(compiler));
18+
19+
app.get('*', function (req, res) {
20+
res.sendFile(path.join(__dirname, './public/index.html'));
21+
});
22+
23+
app.listen(8001, '0.0.0.0', function (err) {
24+
if (err) {
25+
console.log(err);
26+
return;
27+
}
28+
29+
console.log('Listening at http://0.0.0.0:8001');
30+
});

docs/webpack.config.development.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
const path = require('path');
2+
const webpack = require('webpack');
3+
const autoprefixer = require('autoprefixer');
4+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
5+
const TransferWebpackPlugin = require('transfer-webpack-plugin');
6+
7+
module.exports = {
8+
mode: 'development',
9+
entry: [
10+
'webpack-hot-middleware/client',
11+
'./client/index.js'
12+
],
13+
context: __dirname,
14+
devtool: 'inline-source-map',
15+
output: {
16+
path: path.join(__dirname, 'build'),
17+
filename: 'docs.js',
18+
publicPath: '/'
19+
},
20+
resolve: {
21+
extensions: ['*', '.scss', '.js', '.json', '.md'],
22+
alias: {
23+
'react-lite': path.resolve(__dirname + './../components')
24+
},
25+
},
26+
module: {
27+
rules: [
28+
{
29+
test: /\.js$/,
30+
exclude: /(node_modules)/,
31+
loader: 'babel-loader'
32+
}, {
33+
test: /\.(scss|css)$/,
34+
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap')
35+
}, {
36+
test: /\.(txt)$/,
37+
loader: 'raw-loader',
38+
include: path.resolve(__dirname, './app/components/layout/main/modules')
39+
}, {
40+
test: /\.(md)$/,
41+
loader: 'html-loader!highlight-loader!markdown-loader'
42+
}
43+
]
44+
},
45+
plugins: [
46+
new ExtractTextPlugin('docs.css', { allChunks: true }),
47+
new TransferWebpackPlugin([{
48+
from: 'public/images',
49+
to: 'images'
50+
}], path.resolve(__dirname, './')),
51+
new webpack.HotModuleReplacementPlugin(),
52+
new webpack.DefinePlugin({
53+
'process.env.NODE_ENV': JSON.stringify('development')
54+
})
55+
]
56+
};

0 commit comments

Comments
 (0)