Skip to content

Commit 10987cc

Browse files
author
Mostafa Kamal
committed
rrb
1 parent 6301c3b commit 10987cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+7282
-2
lines changed

.babelrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"presets": [
3+
"react",
4+
["env", {
5+
"modules": false,
6+
"targets": {
7+
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
8+
}
9+
}],
10+
"stage-2"
11+
],
12+
"plugins": ["transform-runtime"],
13+
"env": {
14+
"test": {
15+
"presets": ["env", "stage-2"],
16+
"plugins": ["istanbul"]
17+
}
18+
}
19+
}

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/*.js
2+
config/*.js

.eslintrc.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// // https://eslint.org/docs/user-guide/configuring
2+
//
3+
// module.exports = {
4+
// root: true,
5+
// parser: 'babel-eslint',
6+
// parserOptions: {
7+
// sourceType: 'module'
8+
// },
9+
// env: {
10+
// browser: true,
11+
// },
12+
// // https://github.com/standard/standard/blob/master/docs/RULES-en.md
13+
// extends: 'standard',
14+
// // required to lint *.vue files
15+
// plugins: [
16+
// 'html'
17+
// ],
18+
// // add your custom rules here
19+
// 'rules': {
20+
// // allow paren-less arrow functions
21+
// 'arrow-parens': 0,
22+
// // allow async-await
23+
// 'generator-star-spacing': 0,
24+
// // allow debugger during development
25+
// 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
26+
// }
27+
// }

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.DS_Store
2+
node_modules/
3+
dist/
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Editor directories and files
9+
.idea
10+
.vscode
11+
*.suo
12+
*.ntvs*
13+
*.njsproj
14+
*.sln

.postcssrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// https://github.com/michael-ciniawsky/postcss-load-config
2+
3+
module.exports = {
4+
"plugins": {
5+
// to edit target browsers: use "browserslist" field in package.json
6+
"autoprefixer": {}
7+
}
8+
}

.reactql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
1-
# react-redux-boss
2-
React Redux Boss Mini Boilerplate of React
1+
# react-redux-boss (RRB)
2+
RRB is a mini React Redux boilerplate .
3+
4+
<p align="center" ><img src="./src/assets/rrb1.png"></p>
5+
6+
# Main Feature:
7+
8+
- React
9+
- React Router Dom
10+
- Redux (coming soon)
11+
- Axios
12+
- Bulma
13+
14+
# How use RRB
15+
16+
* `Clone RRB project`
17+
* `yarn install` or `npm install`
18+
* `npm run dev`
19+
20+
# Our React Atom Packages:
21+
- `apm install atom-react`
22+
- `apm install atom-axios`
23+
24+
25+
[![code4k](https://img.shields.io/badge/Powered-By-blue.svg)]()
26+
<a href="https://hellolaravel.org" ><img src="https://img.shields.io/badge/Hello-Laravel-red.svg" >
27+
<a href="https://twitter.com/code4mk" ><img src="https://img.shields.io/badge/%40-code4mk-brightgreen.svg" >

build/build.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
'use strict'
2+
require('./check-versions')()
3+
4+
process.env.NODE_ENV = 'production'
5+
6+
const ora = require('ora')
7+
const rm = require('rimraf')
8+
const path = require('path')
9+
const chalk = require('chalk')
10+
const webpack = require('webpack')
11+
const config = require('../config')
12+
const webpackConfig = require('./webpack.prod.conf')
13+
14+
const spinner = ora('building for production...')
15+
spinner.start()
16+
17+
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18+
if (err) throw err
19+
webpack(webpackConfig, function (err, stats) {
20+
spinner.stop()
21+
if (err) throw err
22+
process.stdout.write(stats.toString({
23+
colors: true,
24+
modules: false,
25+
children: false,
26+
chunks: false,
27+
chunkModules: false
28+
}) + '\n\n')
29+
30+
if (stats.hasErrors()) {
31+
console.log(chalk.red(' Build failed with errors.\n'))
32+
process.exit(1)
33+
}
34+
35+
console.log(chalk.cyan(' Build complete.\n'))
36+
console.log(chalk.yellow(
37+
' Tip: built files are meant to be served over an HTTP server.\n' +
38+
' Opening index.html over file:// won\'t work.\n'
39+
))
40+
})
41+
})

build/check-versions.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
'use strict'
2+
const chalk = require('chalk')
3+
const semver = require('semver')
4+
const packageConfig = require('../package.json')
5+
const shell = require('shelljs')
6+
function exec (cmd) {
7+
return require('child_process').execSync(cmd).toString().trim()
8+
}
9+
10+
const versionRequirements = [
11+
{
12+
name: 'node',
13+
currentVersion: semver.clean(process.version),
14+
versionRequirement: packageConfig.engines.node
15+
}
16+
]
17+
18+
if (shell.which('npm')) {
19+
versionRequirements.push({
20+
name: 'npm',
21+
currentVersion: exec('npm --version'),
22+
versionRequirement: packageConfig.engines.npm
23+
})
24+
}
25+
26+
module.exports = function () {
27+
const warnings = []
28+
for (let i = 0; i < versionRequirements.length; i++) {
29+
const mod = versionRequirements[i]
30+
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
31+
warnings.push(mod.name + ': ' +
32+
chalk.red(mod.currentVersion) + ' should be ' +
33+
chalk.green(mod.versionRequirement)
34+
)
35+
}
36+
}
37+
38+
if (warnings.length) {
39+
console.log('')
40+
console.log(chalk.yellow('To use this template, you must update following to modules:'))
41+
console.log()
42+
for (let i = 0; i < warnings.length; i++) {
43+
const warning = warnings[i]
44+
console.log(' ' + warning)
45+
}
46+
console.log()
47+
process.exit(1)
48+
}
49+
}

0 commit comments

Comments
 (0)