Skip to content

Commit

Permalink
feat: add commitlint and husky
Browse files Browse the repository at this point in the history
  • Loading branch information
viniarruda committed Dec 26, 2019
1 parent 98bfcc7 commit e781c1b
Show file tree
Hide file tree
Showing 8 changed files with 549 additions and 37 deletions.
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']};
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"typescript": "^3.7.4"
},
"devDependencies": {
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"husky": "^3.1.0",
"@types/jest": "^24.0.25",
"@types/node": "^13.1.1",
"@types/react": "^16.9.17",
Expand All @@ -44,6 +47,16 @@
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"workspaces": {
"packages": [
"packages/*"
]
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"browserslist": {
"production": [
">0.2%",
Expand Down
20 changes: 9 additions & 11 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import React from "react";
import { render } from "react-dom";
import Root from "./modules/root";
import "@fortawesome/fontawesome-free/css/all.css";
import "animate.css";
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
import React from 'react';
import {render} from 'react-dom';
import Root from './modules/root';
import '@fortawesome/fontawesome-free/css/all.css';
import 'animate.css';
import 'slick-carousel/slick/slick.css';
import 'slick-carousel/slick/slick-theme.css';

import registerServiceWorker from "./registerServiceWorker";
import registerServiceWorker from './registerServiceWorker';

// let store = configureStore();

render(<Root />, document.getElementById("root"));
render(<Root />, document.getElementById('root'));
registerServiceWorker();
20 changes: 12 additions & 8 deletions src/modules/root/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
import React from 'react';
// import {Provider} from 'react-redux';
import {Provider} from 'react-redux';
import {BrowserRouter as Router, Route, Switch} from 'react-router-dom';

import store from '../store';

import Home from '../../modules/views/home';

const Root = () => {
return (
<Router>
<>
<Switch>
<Route exact path="/" component={Home} />
</Switch>
</>
</Router>
<Provider store={store}>
<Router>
<>
<Switch>
<Route exact path="/" component={Home} />
</Switch>
</>
</Router>
</Provider>
);
};

Expand Down
13 changes: 13 additions & 0 deletions src/modules/store/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {createStore, applyMiddleware} from 'redux';
import createSagaMiddleware from 'redux-saga';

import reducers from './reducers';
import sagas from './sagas';

const sagaMiddleware = createSagaMiddleware();

const store = createStore(reducers(), applyMiddleware(sagaMiddleware));

sagaMiddleware.run(sagas);

export default store;
3 changes: 3 additions & 0 deletions src/modules/store/reducers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {combineReducers} from 'redux';

export default () => combineReducers({});
5 changes: 5 additions & 0 deletions src/modules/store/sagas.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {all} from 'redux-saga/effects';

export default function* rootSaga() {
yield all([]);
}
Loading

0 comments on commit e781c1b

Please sign in to comment.