Skip to content

Commit

Permalink
Fixes #2227: Upgrade outdated packages & enable hot-reload
Browse files Browse the repository at this point in the history
  • Loading branch information
akshatnitd authored and fragm3 committed Jun 9, 2019
1 parent 05c3db3 commit ddd6104
Show file tree
Hide file tree
Showing 53 changed files with 696 additions and 725 deletions.
14 changes: 13 additions & 1 deletion .eslintrc
Expand Up @@ -6,15 +6,27 @@
"jsx",
"prettier"
],
"extends": ["plugin:react/recommended", "prettier"],
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"parserOptions": {
"ecmaVersion": 2016,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"react": {
"createClass": "createReactClass",
"pragma": "React",
"version": "16.8.6"
}
},
"env": {
"node": true,
"commonjs": true,
"browser": true,
"jasmine": true,
"es6": true
Expand Down
26 changes: 13 additions & 13 deletions README.md
Expand Up @@ -27,37 +27,37 @@ Our chat channel is to be found on Gitter: https://gitter.im/fossasia/susi_webch

## Requirements
* node --version >= 6
* npm --version >= 3
* yarn --version >= 3

## How to deploy?

### Running on [localhost](./docs/INSTALLATION_LOCAL_ENGLISH.md)

* **Step 1:** Fork the chat.susi.ai repository and clone it to your machine
* **Step 2:** Cd into the cloned folder
* **Step 3:** Install all the dependencies with:```$ npm install```
* **Step 4:** Run on http://localhost:3000 with:```$ npm run start```
* **Step 5:** Build locally with: ```$ npm run build ```
* **Step 6:** To deploy at a URL use: ```$ npm run deploy ```
* **Step 3:** Install all the dependencies with:```$ yarn install```
* **Step 4:** Run on http://localhost:3000 with:```$ yarn run start```
* **Step 5:** Build locally with: ```$ yarn run build ```
* **Step 6:** To deploy at a URL use: ```$ yarn run deploy ```

### Running on [Surge](./docs/INSTALLATION_SURGE_ENGLISH.md)

* **Step 1:** Install Surge:```$ npm install -g surge```
* **Step 1:** Install Surge:```$ yarn install -g surge```
* **Step 2:** Then cd into the cloned chat.susi.ai folder
* **Step 3:** Install the node modules:```$ npm install```(if not already)
* **Step 4:** Build the app:```$ npm run build```
* **Step 3:** Install the node modules:```$ yarn install```(if not already)
* **Step 4:** Build the app:```$ yarn run build```
* **Step 5:** Go to the build directory:```cd build```
* **Step 6:** Run Surge:```surge```
* **Step 7:** Follow the prompts and provide an e-mail address and a password.
* **Step 8:** Go to the URL that appears after the above process is finished, and provide this link in the PR for testing your changes.
* **Step 8:** Go to the URL that appears after the above process is finished, and provide this link in the PR for testing your changes.

Still having problems? Watch this video to clear your doubts [How to setup SUSI web-chat with surge](https://www.youtube.com/watch?v=vM9cD1pHMDQ&t=240s) or watch [How to set it up with Surge](https://www.youtube.com/watch?v=Gvc0uz13U1M)

### Deploying on Firebase
### Deploying on Firebase
[Click Here to read the set up guide](https://github.com/fossasia/chat.susi.ai/blob/master/docs/FIREBASE_DEPLOY.md)

[Click here to watch a video for deploying on Firebase](https://youtu.be/7iVKBwR40N8)

## Speech Recognition and Synthesis

The SUSI.AI WebChat uses [Web Speech API](https://github.com/mdn/web-speech-api/) for speech recognition and synthesis. To test whether your browser supports Text To Speech, open your browser console and run the following:
Expand Down Expand Up @@ -96,7 +96,7 @@ The response from the memory servlet is of the form:
A sample SUSI.AI response is of the form :
```
{
"query" :
"query" :
"answers" : [ {
"data" : [],
"actions" : []
Expand Down Expand Up @@ -156,7 +156,7 @@ chat.susi.ai/
* `src/__tests__/` new tests related to all the components can be created in this folder, this project follows a `jest` testing suite.
* `src/actions/` contains related action types which can be defined in this folder.
* `src/components/` any new component can be added in this folder, given that the file is reused or should be unique in some way. All static files are present in this component as well.
* `src/components/Translate/` has all the pot files required to integrate the project with [Weblate](http://weblate.org).
* `src/components/Translate/` has all the pot files required to integrate the project with [Weblate](http://weblate.org).
* `src/constants/` contains all the action types which are being used in the Application.
* `src/dispatcher/` contains the files to call the Dispatcher Service for the Chat App.
* `src/images/` contains all the static images being used in the App.
Expand Down
148 changes: 77 additions & 71 deletions package.json
@@ -1,121 +1,115 @@
{
"name": "chat.susi.ai",
"version": "0.1.0",
"version": "1.0.0",
"private": true,
"homepage": "https://chat.susi.ai/",
"repository": "https://github.com/fossasia/chat.susi.ai",
"dependencies": {
"@babel/runtime": "7.0.0-beta.42",
"@material-ui/codemod": "^1.1.0",
"@babel/runtime": "^7.4.5",
"@material-ui/codemod": "^4.0.2",
"@material-ui/core": "^4.0.2",
"@material-ui/icons": "^3.0.2",
"@material-ui/icons": "^4.0.1",
"@material-ui/lab": "^3.0.0-alpha.30",
"add-px": "1.0.0",
"antd": "^3.19.1",
"axios": "0.16.1",
"antd": "^3.19.2",
"axios": "0.19.0",
"babel-eslint": "^10.0.1",
"bootstrap": "3.3.7",
"bootstrap": "4.3.1",
"classnames": "^2.2.6",
"connected-react-router": "^6.4.0",
"contrast": "1.0.1",
"country-data": "0.0.31",
"dateformat": "2.0.0",
"eslint": "^5.16.0",
"dateformat": "3.0.3",
"font-awesome": "4.7.0",
"google-maps-react": "2.0.2",
"history": "4.7.2",
"html-entities": "1.2.1",
"html-react-parser": "^0.4.6",
"html-to-text": "3.3.0",
"initials": "3.0.0",
"history": "^4.9.0",
"html-entities": "^1.2.1",
"html-react-parser": "^0.7.1",
"html-to-text": "5.1.1",
"initials": "3.0.1",
"iso-639-1": "^2.0.5",
"keymirror": "0.1.1",
"leaflet": "1.3.1",
"lodash": "4.17.11",
"material-ui": "^0.20.2",
"leaflet": "1.5.1",
"lodash": "^4.17.11",
"material-ui-color-picker": "^3.2.0",
"material-ui-password-field": "2.0.1",
"material-ui-password-field": "2.1.0",
"material-ui-search-bar": "^1.0.0-beta.13",
"md5": "2.2.1",
"moment": "2.22.2",
"npm": "6.3.0",
"prop-types": "15.6.2",
"moment": "^2.24.0",
"npm": "6.9.0",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-ace": "^7.0.1",
"react-bootstrap": "0.31.5",
"react-chartkick": "0.2.1",
"react-color": "2.14.1",
"react-container-dimensions": "1.4.0",
"react-cookie": "2.2.0",
"react-bootstrap": "0.32.4",
"react-chartkick": "0.3.1",
"react-color": "2.17.3",
"react-container-dimensions": "1.4.1",
"react-cookie": "4.0.0",
"react-copy-to-clipboard": "^5.0.1",
"react-custom-scrollbars": "4.2.1",
"react-diff-viewer": "^1.1.0",
"react-dom": "^16.4.0",
"react-emoji-render": "^0.6.0",
"react-emojione": "3.1.10",
"react-emojione": "5.0.1",
"react-fittext": "1.0.0",
"react-flexbox-grid": "2.1.2",
"react-headroom": "2.2.2",
"react-highlight": "0.10.0",
"react-headroom": "2.2.8",
"react-highlight": "0.12.0",
"react-icons": "^3.7.0",
"react-image": "1.3.1",
"react-intl": "2.4.0",
"react-leaflet": "1.9.1",
"react-image": "2.1.3",
"react-intl": "2.9.0",
"react-leaflet": "2.3.0",
"react-linkify": "0.2.2",
"react-loading-animation": "1.4.0",
"react-modal": "2.4.1",
"react-modal": "3.8.1",
"react-orgchart": "^1.0.5",
"react-ratings-declarative": "^3.4.1",
"react-recaptcha": "2.3.10",
"react-redux": "5.0.7",
"react-render-html": "0.5.2",
"react-router": "4.1.1",
"react-router-dom": "4.3.1",
"react-router-redux": "4.0.8",
"react-share": "1.19.1",
"react-slick": "0.14.11",
"react-swipeable-views": "0.12.13",
"react-tap-event-plugin": "2.0.1",
"react-redux": "7.0.3",
"react-render-html": "0.6.0",
"react-router": "^5.0.1",
"react-router-dom": "5.0.1",
"react-share": "3.0.0",
"react-slick": "0.24.0",
"react-swipeable-views": "0.13.3",
"react-tap-event-plugin": "3.0.3",
"react-text-highlight": "0.2.0",
"react-textarea-autosize": "5.2.1",
"react-timezone": "1.0.5",
"react-textarea-autosize": "7.1.0",
"react-timezone": "2.4.0",
"react-tooltip": "^3.10.0",
"react-url-query": "1.4.0",
"react-youtube": "7.6.0",
"react-youtube": "7.9.0",
"recharts": "^1.6.2",
"redux": "3.7.2",
"redux-actions": "2.6.3",
"redux": "4.0.1",
"redux-actions": "2.6.5",
"redux-mock-store": "1.5.3",
"redux-promise": "0.6.0",
"slick-carousel": "^1.8.1",
"styled-components": "^4.2.0",
"surge": "0.20.1",
"universal-cookie": "2.2.0",
"styled-components": "^4.3.1",
"surge": "0.21.3",
"universal-cookie": "4.0.0",
"zxcvbn": "4.4.2"
},
"devDependencies": {
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"eslint-config-prettier": "2.9.0",
"eslint-plugin-babel": "4.1.2",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint": "^5.16.0",
"eslint-config-prettier": "4.3.0",
"eslint-plugin-babel": "5.3.0",
"eslint-plugin-jsx": "0.0.2",
"eslint-plugin-prettier": "2.6.1",
"eslint-plugin-react": "6.10.3",
"gh-pages": "1.2.0",
"husky": "0.14.3",
"lint-staged": "7.2.0",
"prettier": "1.13.5",
"react-scripts": "0.9.5",
"react-test-renderer": "15.6.2"
"eslint-plugin-prettier": "3.1.0",
"eslint-plugin-react": "^7.13.0",
"gh-pages": "2.0.1",
"husky": "2.4.0",
"lint-staged": "8.2.0",
"prettier": "1.18.1",
"react-scripts": "3.0.1",
"react-test-renderer": "16.8.6",
"redux-devtools-extension": "^2.13.8"
},
"peerDependencies": {
"react": "15.6.2",
"react-dom": "15.6.2"
},
"jest": {
"setupFiles": [
"./src/setupTests.js",
"./src/node_modules/react-scripts/config/polyfills.js"
]
"react": "16.8.6",
"react-dom": "16.8.6"
},
"scripts": {
"start": "react-scripts start",
Expand All @@ -136,5 +130,17 @@
"git add ."
]
},
"license": "LGPL-2.1-only"
"license": "LGPL-2.1-only",
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
12 changes: 5 additions & 7 deletions src/App.js
@@ -1,6 +1,5 @@
import React, { Component } from 'react';
import { Switch, Route } from 'react-router-dom';
import { withRouter } from 'react-router';
import PropTypes from 'prop-types';
import { StylesProvider } from '@material-ui/styles';
import { bindActionCreators } from 'redux';
Expand Down Expand Up @@ -214,15 +213,14 @@ function mapDispatchToProps(dispatch) {

function mapStateToProps(store) {
return {
...store.router,
...store.ui,
accessToken: store.app.accessToken,
showCookiePolicy: store.app.showCookiePolicy,
};
}

export default withRouter(
connect(
mapStateToProps,
mapDispatchToProps,
)(App),
);
export default connect(
mapStateToProps,
mapDispatchToProps,
)(App);
6 changes: 2 additions & 4 deletions src/components/Admin/ListSkills/ListSkills.js
Expand Up @@ -662,8 +662,7 @@ class ListSkills extends React.Component {
<DialogTitle>Success</DialogTitle>
<DialogContent>
You successfully restored{' '}
<span className="skillName">{skillName}</span>
!
<span className="skillName">{skillName}</span>!
</DialogContent>
<OkButton />
</Dialog>
Expand All @@ -687,8 +686,7 @@ class ListSkills extends React.Component {
<DialogTitle>Success</DialogTitle>
<DialogContent>
You successfully deleted{' '}
<span className="skillName">{skillName}</span>
!
<span className="skillName">{skillName}</span>!
</DialogContent>
<OkButton />
</Dialog>
Expand Down

0 comments on commit ddd6104

Please sign in to comment.