Upgrade to babel6 and enable some presets.

This commit is contained in:
Aviral Dasgupta 2016-10-02 17:28:24 +05:30
parent 602727b7ad
commit 9174b32ef1
4 changed files with 75 additions and 32 deletions

4
.babelrc Normal file
View File

@ -0,0 +1,4 @@
{
"presets": ["react", "es2015", "es2016", "es2017", "stage-0"],
"plugins": ["transform-runtime"]
}

1
.gitignore vendored
View File

@ -10,3 +10,4 @@
/vector/config.json /vector/config.json
/vector/olm.js /vector/olm.js
.DS_Store .DS_Store
npm-debug.log

View File

@ -37,6 +37,7 @@
}, },
"dependencies": { "dependencies": {
"babel-polyfill": "^6.5.0", "babel-polyfill": "^6.5.0",
"babel-runtime": "^6.11.6",
"browser-request": "^0.3.3", "browser-request": "^0.3.3",
"classnames": "^2.1.2", "classnames": "^2.1.2",
"draft-js": "^0.8.1", "draft-js": "^0.8.1",
@ -61,9 +62,17 @@
"url": "^0.11.0" "url": "^0.11.0"
}, },
"devDependencies": { "devDependencies": {
"babel": "^5.8.23", "babel-cli": "^6.5.2",
"babel-core": "^5.8.25", "babel-core": "^6.14.0",
"babel-loader": "^5.3.2", "babel-eslint": "^6.1.0",
"babel-loader": "^6.2.5",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-polyfill": "^6.5.0",
"babel-preset-es2015": "^6.16.0",
"babel-preset-es2016": "^6.16.0",
"babel-preset-es2017": "^6.16.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-0": "^6.16.0",
"catw": "^1.0.1", "catw": "^1.0.1",
"cpx": "^1.3.2", "cpx": "^1.3.2",
"css-raw-loader": "^0.1.1", "css-raw-loader": "^0.1.1",

View File

@ -26,32 +26,61 @@ limitations under the License.
module.exports.components = require('matrix-react-sdk/lib/component-index').components; module.exports.components = require('matrix-react-sdk/lib/component-index').components;
module.exports.components['structures.BottomLeftMenu'] = require('./components/structures/BottomLeftMenu'); import structures$BottomLeftMenu from './components/structures/BottomLeftMenu';
module.exports.components['structures.CompatibilityPage'] = require('./components/structures/CompatibilityPage'); module.exports.components['structures.BottomLeftMenu'] = structures$BottomLeftMenu;
module.exports.components['structures.LeftPanel'] = require('./components/structures/LeftPanel'); import structures$CompatibilityPage from './components/structures/CompatibilityPage';
module.exports.components['structures.RightPanel'] = require('./components/structures/RightPanel'); module.exports.components['structures.CompatibilityPage'] = structures$CompatibilityPage;
module.exports.components['structures.RoomDirectory'] = require('./components/structures/RoomDirectory'); import structures$LeftPanel from './components/structures/LeftPanel';
module.exports.components['structures.RoomSubList'] = require('./components/structures/RoomSubList'); module.exports.components['structures.LeftPanel'] = structures$LeftPanel;
module.exports.components['structures.SearchBox'] = require('./components/structures/SearchBox'); import structures$RightPanel from './components/structures/RightPanel';
module.exports.components['structures.ViewSource'] = require('./components/structures/ViewSource'); module.exports.components['structures.RightPanel'] = structures$RightPanel;
module.exports.components['views.context_menus.MessageContextMenu'] = require('./components/views/context_menus/MessageContextMenu'); import structures$RoomDirectory from './components/structures/RoomDirectory';
module.exports.components['views.context_menus.NotificationStateContextMenu'] = require('./components/views/context_menus/NotificationStateContextMenu'); module.exports.components['structures.RoomDirectory'] = structures$RoomDirectory;
module.exports.components['views.context_menus.RoomTagContextMenu'] = require('./components/views/context_menus/RoomTagContextMenu'); import structures$RoomSubList from './components/structures/RoomSubList';
module.exports.components['views.dialogs.ChangelogDialog'] = require('./components/views/dialogs/ChangelogDialog'); module.exports.components['structures.RoomSubList'] = structures$RoomSubList;
module.exports.components['views.directory.NetworkDropdown'] = require('./components/views/directory/NetworkDropdown'); import structures$SearchBox from './components/structures/SearchBox';
module.exports.components['views.elements.ImageView'] = require('./components/views/elements/ImageView'); module.exports.components['structures.SearchBox'] = structures$SearchBox;
module.exports.components['views.elements.Spinner'] = require('./components/views/elements/Spinner'); import structures$ViewSource from './components/structures/ViewSource';
module.exports.components['views.globals.GuestWarningBar'] = require('./components/views/globals/GuestWarningBar'); module.exports.components['structures.ViewSource'] = structures$ViewSource;
module.exports.components['views.globals.MatrixToolbar'] = require('./components/views/globals/MatrixToolbar'); import views$context_menus$MessageContextMenu from './components/views/context_menus/MessageContextMenu';
module.exports.components['views.globals.NewVersionBar'] = require('./components/views/globals/NewVersionBar'); module.exports.components['views.context_menus.MessageContextMenu'] = views$context_menus$MessageContextMenu;
module.exports.components['views.login.VectorCustomServerDialog'] = require('./components/views/login/VectorCustomServerDialog'); import views$context_menus$NotificationStateContextMenu from './components/views/context_menus/NotificationStateContextMenu';
module.exports.components['views.login.VectorLoginFooter'] = require('./components/views/login/VectorLoginFooter'); module.exports.components['views.context_menus.NotificationStateContextMenu'] = views$context_menus$NotificationStateContextMenu;
module.exports.components['views.login.VectorLoginHeader'] = require('./components/views/login/VectorLoginHeader'); import views$context_menus$RoomTagContextMenu from './components/views/context_menus/RoomTagContextMenu';
module.exports.components['views.messages.DateSeparator'] = require('./components/views/messages/DateSeparator'); module.exports.components['views.context_menus.RoomTagContextMenu'] = views$context_menus$RoomTagContextMenu;
module.exports.components['views.messages.MessageTimestamp'] = require('./components/views/messages/MessageTimestamp'); import views$dialogs$ChangelogDialog from './components/views/dialogs/ChangelogDialog';
module.exports.components['views.rooms.DNDRoomTile'] = require('./components/views/rooms/DNDRoomTile'); module.exports.components['views.dialogs.ChangelogDialog'] = views$dialogs$ChangelogDialog;
module.exports.components['views.rooms.RoomDropTarget'] = require('./components/views/rooms/RoomDropTarget'); import views$directory$NetworkDropdown from './components/views/directory/NetworkDropdown';
module.exports.components['views.rooms.RoomTooltip'] = require('./components/views/rooms/RoomTooltip'); module.exports.components['views.directory.NetworkDropdown'] = views$directory$NetworkDropdown;
module.exports.components['views.rooms.SearchBar'] = require('./components/views/rooms/SearchBar'); import views$elements$ImageView from './components/views/elements/ImageView';
module.exports.components['views.settings.IntegrationsManager'] = require('./components/views/settings/IntegrationsManager'); module.exports.components['views.elements.ImageView'] = views$elements$ImageView;
module.exports.components['views.settings.Notifications'] = require('./components/views/settings/Notifications'); import views$elements$Spinner from './components/views/elements/Spinner';
module.exports.components['views.elements.Spinner'] = views$elements$Spinner;
import views$globals$GuestWarningBar from './components/views/globals/GuestWarningBar';
module.exports.components['views.globals.GuestWarningBar'] = views$globals$GuestWarningBar;
import views$globals$MatrixToolbar from './components/views/globals/MatrixToolbar';
module.exports.components['views.globals.MatrixToolbar'] = views$globals$MatrixToolbar;
import views$globals$NewVersionBar from './components/views/globals/NewVersionBar';
module.exports.components['views.globals.NewVersionBar'] = views$globals$NewVersionBar;
import views$login$VectorCustomServerDialog from './components/views/login/VectorCustomServerDialog';
module.exports.components['views.login.VectorCustomServerDialog'] = views$login$VectorCustomServerDialog;
import views$login$VectorLoginFooter from './components/views/login/VectorLoginFooter';
module.exports.components['views.login.VectorLoginFooter'] = views$login$VectorLoginFooter;
import views$login$VectorLoginHeader from './components/views/login/VectorLoginHeader';
module.exports.components['views.login.VectorLoginHeader'] = views$login$VectorLoginHeader;
import views$messages$DateSeparator from './components/views/messages/DateSeparator';
module.exports.components['views.messages.DateSeparator'] = views$messages$DateSeparator;
import views$messages$MessageTimestamp from './components/views/messages/MessageTimestamp';
module.exports.components['views.messages.MessageTimestamp'] = views$messages$MessageTimestamp;
import views$rooms$DNDRoomTile from './components/views/rooms/DNDRoomTile';
module.exports.components['views.rooms.DNDRoomTile'] = views$rooms$DNDRoomTile;
import views$rooms$RoomDropTarget from './components/views/rooms/RoomDropTarget';
module.exports.components['views.rooms.RoomDropTarget'] = views$rooms$RoomDropTarget;
import views$rooms$RoomTooltip from './components/views/rooms/RoomTooltip';
module.exports.components['views.rooms.RoomTooltip'] = views$rooms$RoomTooltip;
import views$rooms$SearchBar from './components/views/rooms/SearchBar';
module.exports.components['views.rooms.SearchBar'] = views$rooms$SearchBar;
import views$settings$IntegrationsManager from './components/views/settings/IntegrationsManager';
module.exports.components['views.settings.IntegrationsManager'] = views$settings$IntegrationsManager;
import views$settings$Notifications from './components/views/settings/Notifications';
module.exports.components['views.settings.Notifications'] = views$settings$Notifications;