Skip to content

Commit

Permalink
Merge pull request #3 from baoduy/develop
Browse files Browse the repository at this point in the history
 Finished the Redux integration
  • Loading branch information
baoduy authored Jun 27, 2018
2 parents 5cf05a9 + 366e986 commit b398ead
Show file tree
Hide file tree
Showing 28 changed files with 1,428 additions and 373 deletions.
94 changes: 47 additions & 47 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
{
"presets": [
[
"babel-preset-env",
{
"modules": false,
"targets": {
"browsers": [
">0.25%",
"not ie 10",
"not op_mini all"
]
}
}
"presets": [
[
"env",
{
"modules": false,
"targets": {
"browsers": [
">0.25%",
"not ie 10",
"not op_mini all"
]
}
}
],
"react-latest",
"stage-3"
],
"plugins": [
"babel-plugin-transform-class-properties",
"babel-plugin-transform-class",
"babel-plugin-transform-async-to-generator",
"react-hot-loader/babel", //Enables React code to work with HMR.
[
"module-resolver",
{
"root": [
"./src"
]
}
]
],
"env": {
"test": {
"presets": [
"env",
"react"
],
"react-latest",
"stage-3"
],
"plugins": [
"babel-plugin-transform-class-properties",
"babel-plugin-transform-class",
"babel-plugin-transform-async-to-generator",
"react-hot-loader/babel", //Enables React code to work with HMR.
[
"module-resolver",
{
"root": [
"./src"
]
}
"plugins": [
"transform-es2015-modules-commonjs"
]
],
"env": {
"test": {
"presets": [
"env",
"react"
],
"plugins": [
"transform-es2015-modules-commonjs"
]
},
"production": {
"plugins": [
[
"babel-plugin-webpack-alias"
]
]
}
}
},
"production": {
"plugins": [
[
"babel-plugin-webpack-alias"
]
]
}
}
}
36 changes: 36 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
]
}
};
12 changes: 6 additions & 6 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@

// Enforcing
"bitwise": true, // true: Prohibit bitwise operators (&, |, ^, etc.)
"camelcase": false, // true: Identifiers must be in camelCase
"camelcase": true, // true: Identifiers must be in camelCase
"curly": false, // true: Require {} for every new block or scope
"eqeqeq": true, // true: Require triple equals (===) for comparison
"forin": true, // true: Require filtering for..in loops with obj.hasOwnProperty()
"freeze": true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
"immed": false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
"latedef": true, // true: Require variables/functions to be defined before being used
"newcap": false, // true: Require capitalization of all constructor functions e.g. `new F()`
"newcap": true, // true: Require capitalization of all constructor functions e.g. `new F()`
"noarg": true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
"noempty": true, // true: Prohibit use of empty blocks
"nonbsp": true, // true: Prohibit "non-breaking whitespace" characters.
"nonew": false, // true: Prohibit use of constructors for side-effects (without assignment)
"plusplus": false, // true: Prohibit use of `++` and `--`
"quotmark": false, // Quotation mark consistency:
"quotmark": "double", // Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
// "single" : require single quotes
// "double" : require double quotes
"undef": true, // true: Require all non-global variables to be declared (prevents global leaks)
"unused": true, // Unused variables:
"unused": false, // Unused variables:
// true : all variables, last function parameter
// "vars" : all variables only
// "strict" : all variables, all function parameters
Expand All @@ -43,7 +43,7 @@
"debug": false, // true: Allow debugger statements e.g. browser breakpoints.
"eqnull": false, // true: Tolerate use of `== null`
"esversion": 6, // {int} Specify the ECMAScript version to which the code must adhere.
"moz": false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
"moz": true, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
// (ex: `for each`, multiple try/catch, function expression…)
"evil": false, // true: Tolerate use of `eval` and `new Function()`
"expr": false, // true: Tolerate `ExpressionStatement` as Programs
Expand All @@ -61,7 +61,7 @@
"scripturl": false, // true: Tolerate script-targeted URLs
"shadow": false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
"sub": false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
"supernew": false, // true: Tolerate `new function () { ... };` and `new Object;`
"supernew": true, // true: Tolerate `new function () { ... };` and `new Object;`
"validthis": false, // true: Tolerate using this in a non-constructor function

// Environments
Expand Down
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# React Webpack Babel Starter

Minimal starter kit with hot module replacement (HMR) for rapid development.

* **[React](https://facebook.github.io/react/)** (16.x)
Expand All @@ -8,24 +9,32 @@ Minimal starter kit with hot module replacement (HMR) for rapid development.
* [LESS](http://lesscss.org/)
* [Jest](https://facebook.github.io/jest/) - Testing framework for React applications
* Image loading/minification using [Image Webpack Loader](https://github.com/tcoopman/image-webpack-loader)
* Code quality (linting) for JavaScript and SASS/CSS.
* Code quality (linting) for JavaScript and LESS/CSS.
* [Redux](https://redux.js.org/) Manage the Component states.
* [Redux-Thunk](https://github.com/reduxjs/redux-thunk) The middle-ware of Redux
* [Redux-toolbelt](https://github.com/welldone-software/redux-toolbelt) A set of tools for quicker, easier, less verbose and safer Redux development by [welldone-software](http://welldone-software.com/).
* ESLINT for Javascript and ReactJs
* JSHINT standard configuration.

# Original Source Code

The source had been clone from [vikpe/react-webpack-babel-starter](https://github.com/vikpe/react-webpack-babel-starter) and on top of that I added some useful packages includes the Finished the [Material-Dashboard-React](https://github.com/creativetimofficial/material-dashboard-react) and Redux integration

## Installation

1. Clone/download repo
2. `npm install`

## Usage
**Development**

### Development

`npm run start-dev`

* Build app continously (HMR enabled)
* App served @ `http://localhost:8080`

**Production**
### Production

`npm run start-prod`

Expand All @@ -34,19 +43,20 @@ The source had been clone from [vikpe/react-webpack-babel-starter](https://githu

---

**All commands**
### All commands

| Command | Description |
| -------------------- | ----------------------------------------------------------------------- |
| `npm run start-dev` | Build app continously (HMR enabled) and serve @ `http://localhost:8080` |
| `npm run start-prod` | Build app once (HMR disabled) and serve @ `http://localhost:3000` |
| `npm run build` | Build app to `/dist/` |
| `npm run test` | Run tests |
| `npm run lint` | Run JavaScript and SASS linter |
| `npm run lint:js` | Run JavaScript linter |
| `npm run lint:sass` | Run SASS linter |
| `npm run start` | (alias of `npm run start-dev`) |
| Command | Description |
| -------------------- | ------------------------------------------------------------------------ |
| `npm run start-dev` | Build app continuously (HMR enabled) and serve @ `http://localhost:8080` |
| `npm run start-prod` | Build app once (HMR disabled) and serve @ `http://localhost:3000` |
| `npm run build` | Build app to `/dist/` |
| `npm run test` | Run tests |
| `npm run lint` | Run JavaScript and LESS linter |
| `npm run lint:js` | Run JavaScript linter |
| `npm run lint:less` | Run LESS linter |
| `npm run start` | (alias of `npm run start-dev`) |

## See also

* [React Webpack Typescript Starter](https://github.com/vikpe/react-webpack-typescript-starter)
* [Isomorphic Webapp Starter](https://github.com/vikpe/isomorphic-webapp-starter)
Loading

0 comments on commit b398ead

Please sign in to comment.