Skip to content

Commit 29398d4

Browse files
committed
chore: init commit with scaffolding and dependencies
0 parents  commit 29398d4

File tree

12 files changed

+279
-0
lines changed

12 files changed

+279
-0
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["es2015", "react", "stage-1"],
3+
"plugins": ["transform-decorators-legacy"]
4+
}

.eslintrc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"ecmaFeatures": {
3+
"modules": true,
4+
"experimentalObjectRestSpread": true,
5+
"jsx": true
6+
},
7+
8+
"parser": "babel-eslint",
9+
10+
"env": {
11+
"browser": true,
12+
"es6": true,
13+
"node": true,
14+
"mocha": true
15+
},
16+
17+
"extends": "eslint-config-standard",
18+
19+
"plugins": [
20+
"standard",
21+
"react"
22+
],
23+
24+
"globals": {
25+
"expect": false,
26+
"sinon": false,
27+
"inject": false
28+
},
29+
30+
"rules": {
31+
"react/display-name": 1,
32+
"react/forbid-prop-types": 1,
33+
"react/jsx-boolean-value": 1,
34+
"react/jsx-closing-bracket-location": 0,
35+
"react/jsx-curly-spacing": 1,
36+
"react/jsx-indent-props": 1,
37+
"react/jsx-max-props-per-line": 0,
38+
"react/jsx-no-bind": 1,
39+
"react/jsx-no-duplicate-props": 1,
40+
"react/jsx-no-literals": 0,
41+
"react/jsx-no-undef": 1,
42+
"jsx-quotes": 0,
43+
"react/jsx-sort-prop-types": 0,
44+
"react/jsx-sort-props": 0,
45+
"react/jsx-uses-react": 1,
46+
"react/jsx-uses-vars": 1,
47+
"react/no-danger": 1,
48+
"react/no-did-mount-set-state": 1,
49+
"react/no-did-update-set-state": 1,
50+
"react/no-direct-mutation-state": 1,
51+
"react/no-multi-comp": 1,
52+
"react/no-set-state": 0,
53+
"react/no-unknown-property": 1,
54+
"react/prefer-es6-class": 1,
55+
"react/prop-types": 1,
56+
"react/react-in-jsx-scope": 1,
57+
"react/require-extension": 1,
58+
"react/self-closing-comp": 1,
59+
"react/sort-comp": 1,
60+
"react/wrap-multilines": 1,
61+
"no-console": 1
62+
}
63+
}

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Coverage directory used by tools like istanbul
11+
coverage
12+
13+
# Compiled binary addons (http://nodejs.org/api/addons.html)
14+
build/Release
15+
16+
# Dependency directory
17+
# Commenting this out is preferred by some people, see
18+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
19+
node_modules
20+
21+
# Users Environment Variables
22+
.lock-wscript
23+
dist

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 KEVIN PURNELLE
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
# Handling react forms with mobx
3+
4+
This is a small app to explain how to tackle forms in React with Mobx.
5+
6+
It is to be used with the [Handling forms in React with Mobx article](https://blog.risingstack.com/handling-react-forms-with-mobx-observables/) on the [RisingStack blog](https://blog.risingstack.com/).
7+
8+
9+
## Following the article
10+
The repo has various tags that correspond to a step in the article.
11+
As we progress in the article, I indicate which tag should be checked out.
12+
13+
14+
## How to run the app
15+
16+
* git clone
17+
* npm install
18+
* npm start

package.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "mobx-react-boilerplate",
3+
"version": "1.0.0",
4+
"description": "Small app to show form handling with mobx and React for the article https://blog.risingstack.com/handling-react-forms-with-mobx-observables/",
5+
"scripts": {
6+
"start": "node server.js",
7+
"lint": "eslint src"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": ""
12+
},
13+
"keywords": [
14+
"mobservable",
15+
"mobx",
16+
"react",
17+
"reactjs",
18+
"boilerplate",
19+
"webpack"
20+
],
21+
"author": "Kevin Purnelle <[email protected]> (http://github.com/aodev)",
22+
"license": "MIT",
23+
"bugs": {
24+
"url": "https://github.com/AoDev/react-forms-mobx/issues"
25+
},
26+
"homepage": "https://github.com/AoDev/react-forms-mobx",
27+
"devDependencies": {
28+
"babel-core": "6.8.0",
29+
"babel-eslint": "6.0.4",
30+
"babel-loader": "6.2.4",
31+
"babel-plugin-transform-decorators-legacy": "1.3.4",
32+
"babel-preset-es2015": "6.6.0",
33+
"babel-preset-react": "6.5.0",
34+
"babel-preset-stage-1": "6.5.0",
35+
"babel-register": "6.8.0",
36+
"classnames": "2.2.5",
37+
"css-loader": "0.23.1",
38+
"eslint": "2.10.1",
39+
"eslint-config-standard": "5.3.1",
40+
"eslint-plugin-promise": "1.1.0",
41+
"eslint-plugin-react": "5.1.1",
42+
"eslint-plugin-standard": "1.3.2",
43+
"html-webpack-plugin": "2.17.0",
44+
"mobx": "2.1.6",
45+
"mobx-react": "3.1.0",
46+
"react": "15.0.2",
47+
"react-dom": "15.0.2",
48+
"react-hot-loader": "1.3.0",
49+
"webpack": "1.13.0",
50+
"webpack-dev-server": "1.14.1"
51+
}
52+
}

server.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
var webpack = require('webpack')
2+
var WebpackDevServer = require('webpack-dev-server')
3+
var config = require('./webpack.config')
4+
var PORT = process.env.PORT || 3333
5+
6+
new WebpackDevServer(webpack(config), {
7+
publicPath: config.output.publicPath,
8+
hot: true,
9+
historyApiFallback: true
10+
})
11+
.listen(PORT, 'localhost', function (err, result) {
12+
if (err) {
13+
console.log(err)
14+
}
15+
console.log('Listening at localhost:' + PORT)
16+
})

src/App/App.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React, {Component} from 'react'
2+
3+
export default class App extends Component {
4+
render () {
5+
return (
6+
<div className="container">
7+
<h1>React • Mobx • Webpack</h1>
8+
<hr/>
9+
</div>
10+
)
11+
}
12+
}
13+
14+
App.propTypes = {
15+
16+
}
17+
18+
App.defaultProps = {
19+
20+
}

src/App/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {default} from './App'

src/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en" data-framework="react">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Handling forms with React and Mobx</title>
7+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
8+
</head>
9+
<body>
10+
<div id="app-root"></div>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)