Skip to content

Commit 8313f1d

Browse files
authored
Merge pull request #3 from Codebrahma/docs-infra
Docs infra
2 parents b5a42e7 + 0f8cf3b commit 8313f1d

File tree

10 files changed

+85
-14
lines changed

10 files changed

+85
-14
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
# fallback to using the latest cache if no exact match is found
2727
- v1-dependencies-
2828

29-
- run: yarn install
29+
- run: yarn install && cd docs && yarn install
3030

3131
- save_cache:
3232
paths:

docs/client/App.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react';
2+
import { Route } from 'react-router-dom';
3+
4+
import HomePage from './components/HomePage';
5+
import GettingStartedPage from './components/GettingStartedPage';
6+
import ComponentsPage from './components/ComponentsPage';
7+
import AppNavbar from './components/AppNavbar';
8+
9+
const App = () => (
10+
<div>
11+
<AppNavbar />
12+
<Route exact path="/home" component={HomePage} />
13+
<Route exact path="/getting-started" component={GettingStartedPage} />
14+
<Route exact path="/components" component={ComponentsPage} />
15+
</div>
16+
);
17+
18+
export default App;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react';
2+
import styles from './styles.scss';
3+
4+
const AppBar = () => (
5+
<div className={styles.navbar}>
6+
Navbar
7+
</div>
8+
);
9+
10+
export default AppBar;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:local(.navbar) {
2+
font-size: 20px;
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
3+
const ComponentsPage = () => (
4+
<div>
5+
Components Page
6+
</div>
7+
);
8+
9+
export default ComponentsPage;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
3+
const GettingStartedPage = () => (
4+
<div>
5+
GettingStarted Page
6+
</div>
7+
);
8+
9+
export default GettingStartedPage;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
3+
const HomePage = () => (
4+
<div>
5+
Home Page
6+
</div>
7+
);
8+
9+
export default HomePage;

docs/client/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3+
import { BrowserRouter as Router } from 'react-router-dom';
34

5+
import App from './App';
46

5-
const App = () => (
6-
<div>
7-
Welcome to Docs
8-
</div>
7+
const Routes = () => (
8+
<Router>
9+
<App />
10+
</Router>
911
);
1012

11-
ReactDOM.render((<App />), document.getElementById('app'));
13+
ReactDOM.render((<Routes />), document.getElementById('app'));

docs/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
"babel-standalone": "^6.7.7",
1414
"classnames": "^2.2.5",
1515
"codemirror": "^5.14.2",
16+
"css-loader": "^0.28.11",
1617
"history": "^2.1.1",
18+
"postcss-loader": "^2.1.5",
1719
"react": "^16.4.1",
1820
"react-dom": "^16.4.1",
19-
"react-router": "^4.3.1",
21+
"react-router-dom": "^4.3.1",
2022
"webpack": "^4.12.0"
2123
},
2224
"devDependencies": {
@@ -30,7 +32,7 @@
3032
"babel-preset-stage-0": "^6.5.0",
3133
"babel-preset-stage-2": "^6.13.0",
3234
"cross-env": "^3.1.3",
33-
"css-loader": "^0.26.1",
35+
"css-loader": "^0.28.11",
3436
"express": "^4.13.4",
3537
"extract-text-webpack-plugin": "^4.0.0-beta.0",
3638
"gh-pages": "^0.12.0",
@@ -40,13 +42,13 @@
4042
"html-webpack-plugin": "^2.16.1",
4143
"markdown-loader": "^0.1.7",
4244
"node-sass": "^3.7.0",
43-
"postcss-loader": "^1.2.1",
45+
"postcss-loader": "^2.1.5",
4446
"raw-loader": "^0.5.1",
4547
"react-transform-catch-errors": "^1.0.2",
4648
"react-transform-hmr": "^1.0.4",
4749
"redbox-react": "^1.2.4",
4850
"sass-loader": "^4.0.0",
49-
"style-loader": "^0.13.1",
51+
"style-loader": "^0.21.0",
5052
"transfer-webpack-plugin": "^0.1.4",
5153
"webpack-dev-middleware": "^1.6.1",
5254
"webpack-hot-middleware": "^2.10.0"

docs/webpack.config.development.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,26 @@ module.exports = {
2828
{
2929
test: /\.js$/,
3030
exclude: /(node_modules)/,
31-
loader: 'babel-loader'
31+
use: 'babel-loader'
3232
}, {
3333
test: /\.(scss|css)$/,
34-
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap')
34+
use: [
35+
'style-loader',
36+
{
37+
loader: 'css-loader',
38+
options: {
39+
modules: true,
40+
},
41+
},
42+
],
43+
include: [ path.join(__dirname, 'client')],
3544
}, {
3645
test: /\.(txt)$/,
37-
loader: 'raw-loader',
46+
use: 'raw-loader',
3847
include: path.resolve(__dirname, './app/components/layout/main/modules')
3948
}, {
4049
test: /\.(md)$/,
41-
loader: 'html-loader!highlight-loader!markdown-loader'
50+
use: 'html-loader!highlight-loader!markdown-loader'
4251
}
4352
]
4453
},

0 commit comments

Comments
 (0)