Skip to content

Commit 64a4310

Browse files
authored
Merge pull request #4 from iamvijaydev/next
Next
2 parents e2518c9 + 107dbf3 commit 64a4310

Some content is hidden

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

68 files changed

+10056
-16991
lines changed

.babelrc

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
{
22
"presets": [
33
[
4-
"env",
4+
"@babel/preset-env",
55
{
66
"targets": {
77
"browsers": [
88
"last 2 versions"
9-
]
9+
],
1010
}
1111
}
1212
],
13-
"react"
13+
"@babel/preset-react"
1414
],
1515
"plugins": [
16-
"transform-object-rest-spread",
17-
"transform-class-properties",
1816
"react-hot-loader/babel",
19-
"syntax-dynamic-import",
17+
"@babel/plugin-syntax-dynamic-import",
18+
"@babel/plugin-proposal-class-properties",
2019
[
21-
"import-inspector",
20+
"babel-plugin-styled-components",
2221
{
23-
"serverSideRequirePath": true
22+
"displayName": true
2423
}
2524
]
2625
],
2726
"env": {
2827
"test": {
29-
"plugins": [
30-
"dynamic-import-node"
31-
]
28+
"plugins": ["@babel/plugin-transform-runtime"]
3229
}
3330
}
3431
}

.eslintrc.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"globals": {
1111
"env": true
1212
},
13-
"extends": "airbnb",
13+
"extends": ["airbnb", "prettier"],
1414
"rules": {
1515
"linebreak-style": "off",
1616
"import/prefer-default-export": "off",
@@ -22,5 +22,18 @@
2222
"aspects": ["noHref", "invalidHref", "preferButton"]
2323
}],
2424
"react/sort-comp": "off"
25+
},
26+
"settings": {
27+
"import/resolver": {
28+
"alias": {
29+
"map": [
30+
["Components", "./src/components/"],
31+
["Pages", "./src/pages/"],
32+
["Models", "./src/models/"],
33+
["Services", "./src/services/"],
34+
["Config", "./config/"]
35+
],
36+
}
37+
}
2538
}
2639
}

.prettierrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ An opinionated and scalable base tech stack for a modern React app.
1212

1313
## Tech Stack
1414
- **react:** The main UI library
15-
- **redux:** The main state management library
15+
- **rematch:** The main state management framework powered by Redux
1616
- **styled-components:** The styling and theming library
1717
- **react-router-dom:** The routing library
1818
- **react-loadable:** The lazy loading library
@@ -26,7 +26,8 @@ An opinionated and scalable base tech stack for a modern React app.
2626
- **/src/components:** Shareable components that never connects to redux store
2727
- **/src/pages:** Individual route pages
2828
- **/src/services:** Wrapped services for the App, e.g: fetch, validation. Available as an API, so the actual implementation can change
29-
- **/src/store:** Redux store
29+
- **/src/store:** Rematch redux store
30+
- **/src/models:** Rematch shared models
3031
- **/dist:** Complied code ready to deployed
3132

3233
## Get the code

TODO.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
### Todo items for next version
22

3-
- [ ] Update logic for gathering the protected routes list in `protectRoutes` from the `getMenu`, both in `/service`
3+
4+
- [x] Upgrade all packages to next version
5+
- [x] Add error overlay to show errors on the page
6+
- [*] Add Rematch the Redux framework
7+
- [*] Add Redux dev tools
8+
- [*] Add Prettier
9+
- [*] Proper demo components with styles that can be removed quickly
10+
- [ ] Create a protected route component
411
- [ ] Add new component for showing the notifications
5-
- [ ] Improved Tabble component that can recive data like these `<Table header={object[]} body={any[][]} minWidth={number} />`
12+
- [ ] Add table component that can recieve data like these `<Table header={object[]} body={any[][]} minWidth={number} />`
613
- [ ] Proper step-by-step instructions to use this repo for a new project

build/intl/translator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable */
2-
import * as fs from 'fs';
3-
import { sync as globSync } from 'glob';
4-
import { sync as mkdirpSync } from 'mkdirp';
2+
const fs = require('fs');
3+
const { sync: globSync } = require('glob');
4+
const { sync: mkdirpSync } = require('mkdirp');
55

66
const outputLanguageDataDir = './config/locale/';
77

build/webpack/webpack.common.js

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,71 @@
1+
const path = require('path');
12
const webpack = require('webpack');
23
const HtmlWebpackPlugin = require('html-webpack-plugin');
34
const { BaseHrefWebpackPlugin } = require('base-href-webpack-plugin');
45
const CopyWebpackPlugin = require('copy-webpack-plugin');
6+
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
57

6-
const baseHref = "/";
8+
const baseHref = '/';
79

810
module.exports = {
911
resolve: {
10-
extensions: ['.js'],
12+
extensions: ['.js']
1113
},
1214
module: {
1315
rules: [
1416
{
1517
test: /\.js$/,
1618
exclude: /node_modules/,
17-
use: ['babel-loader'],
18-
}, {
19+
use: ['babel-loader']
20+
},
21+
{
1922
test: /\.css$/,
20-
use: ['style-loader', 'css-loader'],
23+
use: ['style-loader', 'css-loader']
2124
}
22-
],
25+
]
2326
},
2427
plugins: [
2528
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
2629
new HtmlWebpackPlugin({
27-
template: './src/index.html',
30+
template: './src/index.html'
2831
}),
29-
new BaseHrefWebpackPlugin({baseHref: baseHref}),
30-
new CopyWebpackPlugin([{
31-
from: 'config/assets',
32-
to: 'assets',
33-
}/** add any other copy/move files or folders */], {
34-
force: true,
35-
flatten: true
36-
})
32+
new BaseHrefWebpackPlugin({ baseHref: baseHref }),
33+
new CopyWebpackPlugin(
34+
[
35+
{
36+
from: 'config/assets',
37+
to: 'assets'
38+
} /** add any other copy/move files or folders */
39+
],
40+
{
41+
force: true,
42+
flatten: true
43+
}
44+
),
45+
new CleanWebpackPlugin()
3746
],
47+
optimization: {
48+
moduleIds: 'hashed',
49+
runtimeChunk: 'single',
50+
splitChunks: {
51+
cacheGroups: {
52+
vendor: {
53+
test: /[\\/]node_modules[\\/]/,
54+
name: 'vendors',
55+
chunks: 'all'
56+
}
57+
}
58+
}
59+
},
60+
resolve: {
61+
alias: {
62+
Components: path.resolve(__dirname, '../../src/components/'),
63+
Pages: path.resolve(__dirname, '../../src/pages/'),
64+
Models: path.resolve(__dirname, '../../src/models/'),
65+
Services: path.resolve(__dirname, '../../src/services/'),
66+
Config: path.resolve(__dirname, '../../config/'),
67+
}
68+
},
3869
node: {
3970
fs: 'empty'
4071
}

build/webpack/webpack.dev.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const webpack = require('webpack');
22
const WriteFilePlugin = require('write-file-webpack-plugin');
3+
const ErrorOverlayPlugin = require('error-overlay-webpack-plugin')
34
const commonPaths = require('./commonPaths');
45

56
module.exports = {
@@ -10,7 +11,7 @@ module.exports = {
1011
output: {
1112
filename: '[name].[hash].js'
1213
},
13-
devtool: 'cheap-eval-source-map',
14+
devtool: 'cheap-module-source-map',
1415
devServer: {
1516
host: 'localhost',
1617
port: process.env.PORT || 8080,
@@ -20,6 +21,7 @@ module.exports = {
2021
publicPath: '/',
2122
},
2223
plugins: [
24+
new ErrorOverlayPlugin(),
2325
new webpack.HotModuleReplacementPlugin(),
2426
new WriteFilePlugin(),
2527
]

config/locale/en-US/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"app/modal_header": "Modal header",
33
"app/modal_text_line_1": "This is an example of a modal!",
4-
"app/modal_text_line_2": "<code>Esc</code> works too, if onClose is passed ;)",
4+
"app/modal_text_line_2": "<code>Esc</code> works too, if `onClose` is passed &#9786;",
55
"app/modal_heading": "Modal example (via React Portal)",
66
"app/open_modal": "Open modal",
77
"app/switch_theme": "Switch theme",

config/locale/fr-FR/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"app/modal_header": "En-tête modal",
33
"app/modal_text_line_1": "Ceci est un exemple d'un modal!",
4-
"app/modal_text_line_2": "<code>Esc</code> fonctionne aussi, si onClose est passé ;)",
4+
"app/modal_text_line_2": "<code>Esc</code> fonctionne aussi, si `onClose` est passé &#9786;",
55
"app/modal_heading": "Exemple modal (via React Portal)",
66
"app/open_modal": "Ouvrir modal",
77
"app/switch_theme": "Changer de thème",

config/locale/ja-JP/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"app/modal_header": "モーダルヘッダ",
33
"app/modal_text_line_1": "これはモーダルの例です!",
4-
"app/modal_text_line_2": "<code>Esc</code> \"onClose\" が渡された場合でも動作します ;)",
4+
"app/modal_text_line_2": "<code>Esc</code> `onClose` が渡された場合でも動作します &#9786;",
55
"app/modal_heading": "モーダルの例(React Portal経由)",
66
"app/open_modal": "オープンモーダル",
77
"app/switch_theme": "テーマを切り替える",

config/theme/colors.js

Lines changed: 82 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,87 @@ const colors = {
22
white: '#fff',
33
black: '#000',
44

5-
gray100: '#eee',
6-
gray200: '#aaa',
7-
gray300: '#555',
8-
gray400: '#111',
9-
10-
yellow: '#ffbf00',
11-
green: '#36ba4e',
12-
red: '#f05323',
5+
grey100: '#F5F5F5',
6+
grey200: '#EEEEEE',
7+
grey300: '#E0E0E0',
8+
grey400: '#BDBDBD',
9+
grey500: '#9E9E9E',
10+
grey600: '#757575',
11+
grey700: '#616161',
12+
grey800: '#424242',
13+
grey900: '#212121',
14+
15+
red400: '#Ef5350',
16+
red500: '#F44336',
17+
red600: '#E53935',
18+
19+
pink400: '#EC407A',
20+
pink500: '#E91E63',
21+
pink600: '#D81B60',
22+
23+
purple400: '#AB47BC',
24+
purple500: '#9C27B0',
25+
purple600: '#8E24AA',
26+
27+
deepPurple400: '#7E57C2',
28+
deepPurple500: '#673AB7',
29+
deepPurple600: '#5E35B1',
30+
31+
indigo400: '#5C6BC0',
32+
indigo500: '#3F51B5',
33+
indigo600: '#3949AB',
34+
35+
blue400: '#42A5F5',
36+
blue500: '#2196F3',
37+
blue600: '#1E88E5',
38+
39+
lightBlue400: '#29B6F6',
40+
lightBlue500: '#03A9F4',
41+
lightBlue600: '#039BE5',
42+
43+
cyan400: '#26C6DA',
44+
cyan500: '#00BCD4',
45+
cyan600: '#00ACC1',
46+
47+
teal400: '#26A69A',
48+
teal500: '#009688',
49+
teal600: '#00897B',
50+
51+
green400: '#66BB6A',
52+
green500: '#4CAF50',
53+
green600: '#43A047',
54+
55+
lightGreen400: '#9CCC65',
56+
lightGreen500: '#8BC34A',
57+
lightGreen600: '#7CB342',
58+
59+
lime400: '#D4E157',
60+
lime500: '#CDDC39',
61+
lime600: '#C0CA33',
62+
63+
yellow400: '#FFEE58',
64+
yellow500: '#FFEB3B',
65+
yellow600: '#FDD835',
66+
67+
amber400: '#FFCA28',
68+
amber500: '#FFC107',
69+
amber600: '#FFB300',
70+
71+
orange400: '#FFA726',
72+
orange500: '#FF9800',
73+
orange600: '#FB8C00',
74+
75+
deepOrange400: '#FF7043',
76+
deepOrange500: '#FF5722',
77+
deepOrange600: '#F4511E',
78+
79+
brown400: '#8D6E63',
80+
brown500: '#795548',
81+
brown600: '#6D4C41',
82+
83+
blueGrey400: '#78909C',
84+
blueGrey500: '#607D8B',
85+
blueGrey600: '#546E7A',
1386
};
1487

15-
export { colors as default };
88+
export default colors;

config/theme/darktheme.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,30 @@ const darktheme = {
1919
textColor: colors.white,
2020

2121
/* for UI elements */
22-
primaryColor: colors.green,
23-
secondaryColor: colors.yellow,
24-
alternativeColor: colors.red,
22+
primaryColor: colors.green500,
23+
secondaryColor: colors.yellow500,
24+
alternativeColor: colors.red500,
2525

2626
/* status colors */
27-
errorColor: colors.red,
28-
successColor: colors.green,
29-
notifColor: colors.green,
30-
neutralColor: colors.gray200,
27+
errorColor: colors.red500,
28+
successColor: colors.green500,
29+
notifColor: colors.green500,
30+
neutralColor: colors.grey200,
3131

3232
/* link colors */
33-
linkColor: colors.red,
34-
linkActiveColor: colors.yellow,
35-
linkVisitedColor: colors.green,
33+
linkColor: colors.blue500,
34+
linkActiveColor: colors.blue600,
35+
linkVisitedColor: colors.indigo500,
3636

3737
/* theme specific fonts */
3838
primaryFont: fonts.sans,
3939
secondaryFont: fonts.serif,
4040
alternativeFont: fonts.mono,
4141

4242
/* font weights */
43-
bold: 700,
44-
medium: 400,
45-
light: 100,
43+
bold: fonts.bold,
44+
medium: fonts.medium,
45+
light: fonts.light,
4646
};
4747

4848
export { darktheme as default };

0 commit comments

Comments
 (0)