Skip to content

Commit 267a45a

Browse files
committed
Add docs setup
1 parent c66756d commit 267a45a

File tree

8 files changed

+86
-8
lines changed

8 files changed

+86
-8
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
dist
2-
.site
32
.nyc_output
43
coverage

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
src
2+
docs
23
storybook
3-
.site
4+
webpack.config.js
45
.nyc_output
56
coverage
67
test.js*

docs/App.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from 'react'
2+
import Grid from 'react-css-grid'
3+
import { Box } from 'grid-styled'
4+
import Col from './Col'
5+
6+
const App = props => (
7+
<Box p={3}>
8+
<Grid>
9+
<Col>
10+
<h1>React CSS Grid</h1>
11+
</Col>
12+
<Col>
13+
<p>
14+
React layout component based on CSS Grid Layout and built with styled-components
15+
</p>
16+
</Col>
17+
</Grid>
18+
</Box>
19+
)
20+
21+
export default App

docs/Col.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import styled from 'styled-components'
2+
3+
export default styled.div`
4+
box-shadow: 0 0 0 1px rgba(0, 127, 255, .5);
5+
`

docs/entry.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React from 'react'
2+
import { render } from 'react-dom'
3+
import App from './App'
4+
5+
render(<App />, app)

docs/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!DOCTYPE html>
2+
<meta charset='utf-8'>
3+
<meta name='viewport' content='width=device-width, initial-scale=1'>
4+
<style>*{box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,sans-serif;line-height:1.5;margin:0}</style>
5+
<div id=app></div>
6+
<script src=bundle.js></script>

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
{
22
"name": "react-css-grid",
33
"version": "1.0.0",
4-
"description": "React layout component based on CSS Grid Layout",
4+
"description": "React layout component based on CSS Grid Layout and built with styled-components",
55
"main": "dist/index.js",
66
"scripts": {
77
"prepublish": "babel src -d dist",
8-
"start": "start-storybook -c storybook -p 8000",
9-
"build": "build-storybook -c storybook -o .site",
10-
"deploy": "storybook-to-ghpages",
8+
"start": "webpack-dev-server",
9+
"build": "webpack -p",
1110
"test": "nyc ava"
1211
},
1312
"keywords": [
@@ -27,17 +26,22 @@
2726
},
2827
"devDependencies": {
2928
"@storybook/react": "^3.2.8",
30-
"@storybook/storybook-deployer": "^2.0.0",
3129
"ava": "^0.22.0",
3230
"babel-cli": "^6.26.0",
3331
"babel-core": "^6.26.0",
3432
"babel-preset-env": "^1.6.0",
3533
"babel-preset-react": "^6.24.1",
3634
"babel-register": "^6.26.0",
35+
"grid-styled": "^2.0.0-10",
3736
"nyc": "^11.1.0",
3837
"react": "^15.6.1",
3938
"react-dom": "^15.6.1",
40-
"react-test-renderer": "^15.6.1"
39+
"react-live": "^1.7.0",
40+
"react-test-renderer": "^15.6.1",
41+
"react-x-ray": "^1.0.0-2",
42+
"refunk": "^1.0.0-2",
43+
"webpack": "^3.5.5",
44+
"webpack-dev-server": "^2.7.1"
4145
},
4246
"ava": {
4347
"require": [

webpack.config.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const path = require('path')
2+
const webpack = require('webpack')
3+
4+
module.exports = {
5+
entry: './docs/entry.js',
6+
7+
output: {
8+
path: path.join(__dirname, 'docs'),
9+
filename: 'bundle.js'
10+
},
11+
12+
resolve: {
13+
alias: {
14+
'react-css-grid': path.join(__dirname, 'src')
15+
}
16+
},
17+
18+
module: {
19+
rules: [
20+
{
21+
test: /\.js$/,
22+
exclude: /node_modules/,
23+
loader: 'babel-loader'
24+
}
25+
]
26+
},
27+
28+
plugins: [
29+
new webpack.DefinePlugin({
30+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
31+
})
32+
],
33+
34+
devServer: {
35+
contentBase: 'docs/'
36+
}
37+
}

0 commit comments

Comments
 (0)