From 40a67ca8fecfedb81333a911d9a5619f1bd76e95 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 13 Apr 2018 00:43:44 +0100 Subject: [PATCH] point imports at the new locations --- scripts/fixup-imports.pl | 27 +++++++++++++++++++ src/components/structures/BottomLeftMenu.js | 6 ++--- .../structures/CompatibilityPage.js | 2 +- src/components/structures/HomePage.js | 4 +-- src/components/structures/LeftPanel.js | 8 +++--- src/components/structures/LoginBox.js | 10 +++---- src/components/structures/RightPanel.js | 18 ++++++------- src/components/structures/RoomDirectory.js | 12 ++++----- src/components/structures/RoomSubList.js | 20 +++++++------- src/components/structures/SearchBox.js | 12 ++++----- .../views/context_menus/MessageContextMenu.js | 18 ++++++------- .../context_menus/PresenceContextMenu.js | 4 +-- .../context_menus/RoomTileContextMenu.js | 18 ++++++------- .../views/context_menus/TagTileContextMenu.js | 10 +++---- .../views/dialogs/BugReportDialog.js | 8 +++--- .../views/dialogs/ChangelogDialog.js | 4 +-- .../views/dialogs/DevtoolsDialog.js | 6 ++--- .../views/dialogs/SetPasswordDialog.js | 6 ++--- .../views/directory/NetworkDropdown.js | 2 +- src/components/views/elements/ImageView.js | 12 ++++----- src/components/views/globals/MatrixToolbar.js | 6 ++--- src/components/views/globals/NewVersionBar.js | 8 +++--- .../views/globals/PasswordNagBar.js | 8 +++--- .../views/globals/UpdateCheckBar.js | 6 ++--- .../views/messages/DateSeparator.js | 4 +-- .../views/messages/MessageTimestamp.js | 2 +- src/components/views/rooms/DNDRoomTile.js | 2 +- src/components/views/rooms/RoomTooltip.js | 2 +- src/components/views/rooms/SearchBar.js | 8 +++--- .../views/settings/IntegrationsManager.js | 6 ++--- .../views/settings/Notifications.js | 12 ++++----- .../VectorPushRulesDefinitions.js | 2 +- 32 files changed, 150 insertions(+), 123 deletions(-) create mode 100755 scripts/fixup-imports.pl diff --git a/scripts/fixup-imports.pl b/scripts/fixup-imports.pl new file mode 100755 index 0000000000..3929ab88c9 --- /dev/null +++ b/scripts/fixup-imports.pl @@ -0,0 +1,27 @@ +#!/usr/bin/perl -pi + +# pass in a list of filenames whose imports should be fixed up to be relative +# to matrix-react-sdk rather than vector-web. +# filenames must be relative to src/ - e.g. ./components/moo/Moo.js + +# run with something like: +# sierra:src matthew$ grep -ril 'require(.matrix-react-sdk' . | xargs ../scripts/fixup-imports.pl +# sierra:src matthew$ grep -ril 'import.*matrix-react-sdk' . | xargs ../scripts/fixup-imports.pl + +# e.g. turning: +# var rate_limited_func = require('matrix-react-sdk/lib/ratelimitedfunc'); +# +# into: +# const rate_limited_func = require('../../ratelimitedfunc'); +# +# ...if the current file is two levels deep inside lib. + +$depth = () = $ARGV =~ m#/#g; +$depth--; +$prefix = $depth > 0 ? ('../' x $depth) : './'; + +s/= require\(['"]matrix-react-sdk\/lib\/(.*?)['"]\)/= require('$prefix$1')/; +s/= require\(['"]matrix-react-sdk['"]\)/= require('${prefix}index')/; + +s/^(import .* from )['"]matrix-react-sdk\/lib\/(.*?)['"]/$1'$prefix$2'/; +s/^(import .* from )['"]matrix-react-sdk['"]/$1'${prefix}index'/; diff --git a/src/components/structures/BottomLeftMenu.js b/src/components/structures/BottomLeftMenu.js index 3271d5aeab..d289ca5da1 100644 --- a/src/components/structures/BottomLeftMenu.js +++ b/src/components/structures/BottomLeftMenu.js @@ -17,11 +17,11 @@ limitations under the License. import React from 'react'; import ReactDOM from 'react-dom'; -import sdk from 'matrix-react-sdk'; -import dis from 'matrix-react-sdk/lib/dispatcher'; +import sdk from '../../index'; +import dis from '../../dispatcher'; import Velocity from 'velocity-vector'; import 'velocity-vector/velocity.ui'; -import SettingsStore from "matrix-react-sdk/lib/settings/SettingsStore"; +import SettingsStore from '../../settings/SettingsStore'; const CALLOUT_ANIM_DURATION = 1000; diff --git a/src/components/structures/CompatibilityPage.js b/src/components/structures/CompatibilityPage.js index 10806f4ffa..4cbaab3dfa 100644 --- a/src/components/structures/CompatibilityPage.js +++ b/src/components/structures/CompatibilityPage.js @@ -17,7 +17,7 @@ limitations under the License. 'use strict'; var React = require('react'); -import { _t } from 'matrix-react-sdk/lib/languageHandler'; +import { _t } from '../../languageHandler'; module.exports = React.createClass({ displayName: 'CompatibilityPage', diff --git a/src/components/structures/HomePage.js b/src/components/structures/HomePage.js index c46ceeba7b..27a0b6bf49 100644 --- a/src/components/structures/HomePage.js +++ b/src/components/structures/HomePage.js @@ -19,9 +19,9 @@ limitations under the License. import React from 'react'; import request from 'browser-request'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; +import { _t } from '../../languageHandler'; import sanitizeHtml from 'sanitize-html'; -import sdk from 'matrix-react-sdk/lib'; +import sdk from '../../index'; module.exports = React.createClass({ displayName: 'HomePage', diff --git a/src/components/structures/LeftPanel.js b/src/components/structures/LeftPanel.js index 0fc3e0259b..5acceb1009 100644 --- a/src/components/structures/LeftPanel.js +++ b/src/components/structures/LeftPanel.js @@ -20,12 +20,12 @@ import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { MatrixClient } from 'matrix-js-sdk'; -import { KeyCode } from 'matrix-react-sdk/lib/Keyboard'; -import sdk from 'matrix-react-sdk'; -import dis from 'matrix-react-sdk/lib/dispatcher'; +import { KeyCode } from '../../Keyboard'; +import sdk from '../../index'; +import dis from '../../dispatcher'; import VectorConferenceHandler from '../../VectorConferenceHandler'; -import SettingsStore from 'matrix-react-sdk/lib/settings/SettingsStore'; +import SettingsStore from '../../settings/SettingsStore'; var LeftPanel = React.createClass({ diff --git a/src/components/structures/LoginBox.js b/src/components/structures/LoginBox.js index 7cacc14e8a..a9ea1f95c6 100644 --- a/src/components/structures/LoginBox.js +++ b/src/components/structures/LoginBox.js @@ -17,11 +17,11 @@ limitations under the License. 'use strict'; var React = require('react'); -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -var sdk = require('matrix-react-sdk') -var dis = require('matrix-react-sdk/lib/dispatcher'); -var rate_limited_func = require('matrix-react-sdk/lib/ratelimitedfunc'); -var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); +import { _t } from '../../languageHandler'; +var sdk = require('../../index') +var dis = require('../../dispatcher'); +var rate_limited_func = require('../../ratelimitedfunc'); +var AccessibleButton = require('../../components/views/elements/AccessibleButton'); module.exports = React.createClass({ displayName: 'LoginBox', diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index 39463a6700..ca1e331d15 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -19,17 +19,17 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import sdk from 'matrix-react-sdk'; -import dis from 'matrix-react-sdk/lib/dispatcher'; +import { _t } from '../../languageHandler'; +import sdk from '../../index'; +import dis from '../../dispatcher'; import { MatrixClient } from 'matrix-js-sdk'; -import Analytics from 'matrix-react-sdk/lib/Analytics'; -import RateLimitedFunc from 'matrix-react-sdk/lib/ratelimitedfunc'; -import AccessibleButton from 'matrix-react-sdk/lib/components/views/elements/AccessibleButton'; -import { showGroupInviteDialog, showGroupAddRoomDialog } from 'matrix-react-sdk/lib/GroupAddressPicker'; -import GroupStoreCache from 'matrix-react-sdk/lib/stores/GroupStoreCache'; +import Analytics from '../../Analytics'; +import RateLimitedFunc from '../../ratelimitedfunc'; +import AccessibleButton from '../../components/views/elements/AccessibleButton'; +import { showGroupInviteDialog, showGroupAddRoomDialog } from '../../GroupAddressPicker'; +import GroupStoreCache from '../../stores/GroupStoreCache'; -import { formatCount } from 'matrix-react-sdk/lib/utils/FormattingUtils'; +import { formatCount } from '../../utils/FormattingUtils'; class HeaderButton extends React.Component { constructor() { diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index 126ae40401..76360383d6 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -18,19 +18,19 @@ limitations under the License. var React = require('react'); -var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); +var MatrixClientPeg = require('../../MatrixClientPeg'); var ContentRepo = require("matrix-js-sdk").ContentRepo; -var Modal = require('matrix-react-sdk/lib/Modal'); -var sdk = require('matrix-react-sdk'); -var dis = require('matrix-react-sdk/lib/dispatcher'); +var Modal = require('../../Modal'); +var sdk = require('../../index'); +var dis = require('../../dispatcher'); var linkify = require('linkifyjs'); var linkifyString = require('linkifyjs/string'); -var linkifyMatrix = require('matrix-react-sdk/lib/linkify-matrix'); +var linkifyMatrix = require('../../linkify-matrix'); var sanitizeHtml = require('sanitize-html'); import Promise from 'bluebird'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; +import { _t } from '../../languageHandler'; import {instanceForInstanceId, protocolNameForInstanceId} from '../../utils/DirectoryUtils'; diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index ed092d94ad..fb82ee067b 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -20,17 +20,17 @@ limitations under the License. var React = require('react'); var ReactDOM = require('react-dom'); var classNames = require('classnames'); -var sdk = require('matrix-react-sdk'); +var sdk = require('../../index'); import { Droppable } from 'react-beautiful-dnd'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -var dis = require('matrix-react-sdk/lib/dispatcher'); -var Unread = require('matrix-react-sdk/lib/Unread'); -var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); -var RoomNotifs = require('matrix-react-sdk/lib/RoomNotifs'); -var FormattingUtils = require('matrix-react-sdk/lib/utils/FormattingUtils'); -var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); -import Modal from 'matrix-react-sdk/lib/Modal'; -import { KeyCode } from 'matrix-react-sdk/lib/Keyboard'; +import { _t } from '../../languageHandler'; +var dis = require('../../dispatcher'); +var Unread = require('../../Unread'); +var MatrixClientPeg = require('../../MatrixClientPeg'); +var RoomNotifs = require('../../RoomNotifs'); +var FormattingUtils = require('../../utils/FormattingUtils'); +var AccessibleButton = require('../../components/views/elements/AccessibleButton'); +import Modal from '../../Modal'; +import { KeyCode } from '../../Keyboard'; // turn this on for drop & drag console debugging galore diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js index 2d6e6ae04c..459df3bd26 100644 --- a/src/components/structures/SearchBox.js +++ b/src/components/structures/SearchBox.js @@ -17,12 +17,12 @@ limitations under the License. 'use strict'; import React from 'react'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import { KeyCode } from 'matrix-react-sdk/lib/Keyboard'; -import sdk from 'matrix-react-sdk'; -import dis from 'matrix-react-sdk/lib/dispatcher'; -import rate_limited_func from 'matrix-react-sdk/lib/ratelimitedfunc'; -import AccessibleButton from 'matrix-react-sdk/lib/components/views/elements/AccessibleButton'; +import { _t } from '../../languageHandler'; +import { KeyCode } from '../../Keyboard'; +import sdk from '../../index'; +import dis from '../../dispatcher'; +import rate_limited_func from '../../ratelimitedfunc'; +import AccessibleButton from '../../components/views/elements/AccessibleButton'; module.exports = React.createClass({ displayName: 'SearchBox', diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 11f14f367e..860d94ea0e 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -19,15 +19,15 @@ limitations under the License. import React from 'react'; -import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; -import dis from 'matrix-react-sdk/lib/dispatcher'; -import sdk from 'matrix-react-sdk'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import Modal from 'matrix-react-sdk/lib/Modal'; -import Resend from "matrix-react-sdk/lib/Resend"; -import SettingsStore from "matrix-react-sdk/lib/settings/SettingsStore"; -import {makeEventPermalink} from 'matrix-react-sdk/lib/matrix-to'; -import { isUrlPermitted } from 'matrix-react-sdk/lib/HtmlUtils'; +import MatrixClientPeg from '../../../MatrixClientPeg'; +import dis from '../../../dispatcher'; +import sdk from '../../../index'; +import { _t } from '../../../languageHandler'; +import Modal from '../../../Modal'; +import Resend from '../../../Resend'; +import SettingsStore from '../../../settings/SettingsStore'; +import {makeEventPermalink} from '../../../matrix-to'; +import { isUrlPermitted } from '../../../HtmlUtils'; module.exports = React.createClass({ displayName: 'MessageContextMenu', diff --git a/src/components/views/context_menus/PresenceContextMenu.js b/src/components/views/context_menus/PresenceContextMenu.js index 3a3dc2fa47..9b10598511 100644 --- a/src/components/views/context_menus/PresenceContextMenu.js +++ b/src/components/views/context_menus/PresenceContextMenu.js @@ -15,8 +15,8 @@ limitations under the License. */ import React from 'react'; -import { _t, _td } from 'matrix-react-sdk/lib/languageHandler'; -import sdk from 'matrix-react-sdk'; +import { _t, _td } from '../../../languageHandler'; +import sdk from '../../../index'; const STATUS_LABELS = { "online": _td("Online"), diff --git a/src/components/views/context_menus/RoomTileContextMenu.js b/src/components/views/context_menus/RoomTileContextMenu.js index 06eb347d6c..77f71fa8fa 100644 --- a/src/components/views/context_menus/RoomTileContextMenu.js +++ b/src/components/views/context_menus/RoomTileContextMenu.js @@ -21,15 +21,15 @@ import Promise from 'bluebird'; import React from 'react'; import classNames from 'classnames'; import PropTypes from 'prop-types'; -import sdk from 'matrix-react-sdk'; -import { _t, _td } from 'matrix-react-sdk/lib/languageHandler'; -import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; -import dis from 'matrix-react-sdk/lib/dispatcher'; -import DMRoomMap from 'matrix-react-sdk/lib/utils/DMRoomMap'; -import * as Rooms from 'matrix-react-sdk/lib/Rooms'; -import * as RoomNotifs from 'matrix-react-sdk/lib/RoomNotifs'; -import Modal from 'matrix-react-sdk/lib/Modal'; -import RoomListActions from 'matrix-react-sdk/lib/actions/RoomListActions'; +import sdk from '../../../index'; +import { _t, _td } from '../../../languageHandler'; +import MatrixClientPeg from '../../../MatrixClientPeg'; +import dis from '../../../dispatcher'; +import DMRoomMap from '../../../utils/DMRoomMap'; +import * as Rooms from '../../../Rooms'; +import * as RoomNotifs from '../../../RoomNotifs'; +import Modal from '../../../Modal'; +import RoomListActions from '../../../actions/RoomListActions'; module.exports = React.createClass({ displayName: 'RoomTileContextMenu', diff --git a/src/components/views/context_menus/TagTileContextMenu.js b/src/components/views/context_menus/TagTileContextMenu.js index 576e8485a8..32f5365b82 100644 --- a/src/components/views/context_menus/TagTileContextMenu.js +++ b/src/components/views/context_menus/TagTileContextMenu.js @@ -16,11 +16,11 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import dis from 'matrix-react-sdk/lib/dispatcher'; -import TagOrderActions from 'matrix-react-sdk/lib/actions/TagOrderActions'; -import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; -import sdk from 'matrix-react-sdk/lib/index'; +import { _t } from '../../../languageHandler'; +import dis from '../../../dispatcher'; +import TagOrderActions from '../../../actions/TagOrderActions'; +import MatrixClientPeg from '../../../MatrixClientPeg'; +import sdk from '../../../index'; export default class TagTileContextMenu extends React.Component { static propTypes = { diff --git a/src/components/views/dialogs/BugReportDialog.js b/src/components/views/dialogs/BugReportDialog.js index 95b5a6a068..8a35c1748c 100644 --- a/src/components/views/dialogs/BugReportDialog.js +++ b/src/components/views/dialogs/BugReportDialog.js @@ -15,10 +15,10 @@ limitations under the License. */ import React from 'react'; -import sdk from 'matrix-react-sdk'; -import SdkConfig from 'matrix-react-sdk/lib/SdkConfig'; -import Modal from 'matrix-react-sdk/lib/Modal'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; +import sdk from '../../../index'; +import SdkConfig from '../../../SdkConfig'; +import Modal from '../../../Modal'; +import { _t } from '../../../languageHandler'; export default class BugReportDialog extends React.Component { constructor(props, context) { diff --git a/src/components/views/dialogs/ChangelogDialog.js b/src/components/views/dialogs/ChangelogDialog.js index 92aeadf8c8..e71fcdb624 100644 --- a/src/components/views/dialogs/ChangelogDialog.js +++ b/src/components/views/dialogs/ChangelogDialog.js @@ -15,9 +15,9 @@ */ import React from 'react'; -import sdk from 'matrix-react-sdk'; +import sdk from '../../../index'; import request from 'browser-request'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; +import { _t } from '../../../languageHandler'; const REPOS = ['vector-im/riot-web', 'matrix-org/matrix-react-sdk', 'matrix-org/matrix-js-sdk']; diff --git a/src/components/views/dialogs/DevtoolsDialog.js b/src/components/views/dialogs/DevtoolsDialog.js index 3ce1dfe7d4..1d3c8ecc09 100644 --- a/src/components/views/dialogs/DevtoolsDialog.js +++ b/src/components/views/dialogs/DevtoolsDialog.js @@ -16,10 +16,10 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; -import sdk from 'matrix-react-sdk'; +import sdk from '../../../index'; import SyntaxHighlight from '../elements/SyntaxHighlight'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; +import { _t } from '../../../languageHandler'; +import MatrixClientPeg from '../../../MatrixClientPeg'; class DevtoolsComponent extends React.Component { static contextTypes = { diff --git a/src/components/views/dialogs/SetPasswordDialog.js b/src/components/views/dialogs/SetPasswordDialog.js index b82d03468c..31c4ad7a3f 100644 --- a/src/components/views/dialogs/SetPasswordDialog.js +++ b/src/components/views/dialogs/SetPasswordDialog.js @@ -15,9 +15,9 @@ limitations under the License. */ import React from 'react'; -import sdk from 'matrix-react-sdk'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import Modal from 'matrix-react-sdk/lib/Modal'; +import sdk from '../../../index'; +import { _t } from '../../../languageHandler'; +import Modal from '../../../Modal'; const WarmFuzzy = function(props) { const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); diff --git a/src/components/views/directory/NetworkDropdown.js b/src/components/views/directory/NetworkDropdown.js index 9c19cdbced..b45bd286f2 100644 --- a/src/components/views/directory/NetworkDropdown.js +++ b/src/components/views/directory/NetworkDropdown.js @@ -15,7 +15,7 @@ limitations under the License. */ import React from 'react'; -import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; +import MatrixClientPeg from '../../../MatrixClientPeg'; import {instanceForInstanceId} from '../../../utils/DirectoryUtils'; const DEFAULT_ICON_URL = "img/network-matrix.svg"; diff --git a/src/components/views/elements/ImageView.js b/src/components/views/elements/ImageView.js index d1a34d02df..f3ad5a9696 100644 --- a/src/components/views/elements/ImageView.js +++ b/src/components/views/elements/ImageView.js @@ -18,14 +18,14 @@ limitations under the License. var React = require('react'); -var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); +var MatrixClientPeg = require('../../../MatrixClientPeg'); -import {formatDate} from 'matrix-react-sdk/lib/DateUtils'; +import {formatDate} from '../../../DateUtils'; var filesize = require('filesize'); -var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); -const Modal = require('matrix-react-sdk/lib/Modal'); -const sdk = require('matrix-react-sdk'); -import { _t } from 'matrix-react-sdk/lib/languageHandler'; +var AccessibleButton = require('../../../components/views/elements/AccessibleButton'); +const Modal = require('../../../Modal'); +const sdk = require('../../../index'); +import { _t } from '../../../languageHandler'; module.exports = React.createClass({ displayName: 'ImageView', diff --git a/src/components/views/globals/MatrixToolbar.js b/src/components/views/globals/MatrixToolbar.js index 06bfa36e9e..f85a30bcdf 100644 --- a/src/components/views/globals/MatrixToolbar.js +++ b/src/components/views/globals/MatrixToolbar.js @@ -17,9 +17,9 @@ limitations under the License. 'use strict'; import React from 'react'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import Notifier from 'matrix-react-sdk/lib/Notifier'; -import AccessibleButton from 'matrix-react-sdk/lib/components/views/elements/AccessibleButton'; +import { _t } from '../../../languageHandler'; +import Notifier from '../../../Notifier'; +import AccessibleButton from '../../../components/views/elements/AccessibleButton'; module.exports = React.createClass({ displayName: 'MatrixToolbar', diff --git a/src/components/views/globals/NewVersionBar.js b/src/components/views/globals/NewVersionBar.js index 2aedf39204..527df5f864 100644 --- a/src/components/views/globals/NewVersionBar.js +++ b/src/components/views/globals/NewVersionBar.js @@ -17,10 +17,10 @@ limitations under the License. 'use strict'; import React from 'react'; -import sdk from 'matrix-react-sdk'; -import Modal from 'matrix-react-sdk/lib/Modal'; -import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; +import sdk from '../../../index'; +import Modal from '../../../Modal'; +import PlatformPeg from '../../../PlatformPeg'; +import { _t } from '../../../languageHandler'; /** * Check a version string is compatible with the Changelog diff --git a/src/components/views/globals/PasswordNagBar.js b/src/components/views/globals/PasswordNagBar.js index a04d48e0c5..93f4fe06e5 100644 --- a/src/components/views/globals/PasswordNagBar.js +++ b/src/components/views/globals/PasswordNagBar.js @@ -17,10 +17,10 @@ limitations under the License. 'use strict'; import React from 'react'; -import sdk from 'matrix-react-sdk'; -import Modal from 'matrix-react-sdk/lib/Modal'; -import dis from 'matrix-react-sdk/lib/dispatcher'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; +import sdk from '../../../index'; +import Modal from '../../../Modal'; +import dis from '../../../dispatcher'; +import { _t } from '../../../languageHandler'; export default React.createClass({ onUpdateClicked: function() { diff --git a/src/components/views/globals/UpdateCheckBar.js b/src/components/views/globals/UpdateCheckBar.js index 926ccbcccf..b169054c5c 100644 --- a/src/components/views/globals/UpdateCheckBar.js +++ b/src/components/views/globals/UpdateCheckBar.js @@ -17,10 +17,10 @@ limitations under the License. 'use strict'; import React from 'react'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg'; +import { _t } from '../../../languageHandler'; +import PlatformPeg from '../../../PlatformPeg'; import {updateCheckStatusEnum} from '../../../vector/platform/VectorBasePlatform'; -import AccessibleButton from 'matrix-react-sdk/lib/components/views/elements/AccessibleButton'; +import AccessibleButton from '../../../components/views/elements/AccessibleButton'; const doneStatuses = [ updateCheckStatusEnum.ERROR, diff --git a/src/components/views/messages/DateSeparator.js b/src/components/views/messages/DateSeparator.js index 2e081bc69b..a0ea704502 100644 --- a/src/components/views/messages/DateSeparator.js +++ b/src/components/views/messages/DateSeparator.js @@ -17,8 +17,8 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import {formatFullDateNoTime} from 'matrix-react-sdk/lib/DateUtils'; +import { _t } from '../../../languageHandler'; +import {formatFullDateNoTime} from '../../../DateUtils'; function getdaysArray() { return [ diff --git a/src/components/views/messages/MessageTimestamp.js b/src/components/views/messages/MessageTimestamp.js index 6d43306708..0bbb3f631e 100644 --- a/src/components/views/messages/MessageTimestamp.js +++ b/src/components/views/messages/MessageTimestamp.js @@ -17,7 +17,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; -import {formatFullDate, formatTime} from 'matrix-react-sdk/lib/DateUtils'; +import {formatFullDate, formatTime} from '../../../DateUtils'; export default class MessageTimestamp extends React.Component { static propTypes = { diff --git a/src/components/views/rooms/DNDRoomTile.js b/src/components/views/rooms/DNDRoomTile.js index d32ecbbb1d..69c2f979ed 100644 --- a/src/components/views/rooms/DNDRoomTile.js +++ b/src/components/views/rooms/DNDRoomTile.js @@ -16,7 +16,7 @@ limitations under the License. import React from 'react'; import { Draggable } from 'react-beautiful-dnd'; -import RoomTile from 'matrix-react-sdk/lib/components/views/rooms/RoomTile'; +import RoomTile from '../../../components/views/rooms/RoomTile'; import classNames from 'classnames'; diff --git a/src/components/views/rooms/RoomTooltip.js b/src/components/views/rooms/RoomTooltip.js index 39d8958d5e..b17f54ef3c 100644 --- a/src/components/views/rooms/RoomTooltip.js +++ b/src/components/views/rooms/RoomTooltip.js @@ -18,7 +18,7 @@ limitations under the License. var React = require('react'); var ReactDOM = require('react-dom'); -var dis = require('matrix-react-sdk/lib/dispatcher'); +var dis = require('../../../dispatcher'); import classNames from 'classnames'; const MIN_TOOLTIP_HEIGHT = 25; diff --git a/src/components/views/rooms/SearchBar.js b/src/components/views/rooms/SearchBar.js index 26bf81e428..a196c5b78d 100644 --- a/src/components/views/rooms/SearchBar.js +++ b/src/components/views/rooms/SearchBar.js @@ -17,11 +17,11 @@ limitations under the License. 'use strict'; var React = require('react'); -var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); -var sdk = require('matrix-react-sdk'); +var MatrixClientPeg = require('../../../MatrixClientPeg'); +var sdk = require('../../../index'); var classNames = require('classnames'); -var AccessibleButton = require('matrix-react-sdk/lib/components/views/elements/AccessibleButton'); -import { _t } from "matrix-react-sdk/lib/languageHandler"; +var AccessibleButton = require('../../../components/views/elements/AccessibleButton'); +import { _t } from '../../../languageHandler'; module.exports = React.createClass({ displayName: 'SearchBar', diff --git a/src/components/views/settings/IntegrationsManager.js b/src/components/views/settings/IntegrationsManager.js index 4a2482f686..29ae4af93d 100644 --- a/src/components/views/settings/IntegrationsManager.js +++ b/src/components/views/settings/IntegrationsManager.js @@ -17,9 +17,9 @@ limitations under the License. 'use strict'; var React = require('react'); -var sdk = require('matrix-react-sdk'); -var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); -var dis = require('matrix-react-sdk/lib/dispatcher'); +var sdk = require('../../../index'); +var MatrixClientPeg = require('../../../MatrixClientPeg'); +var dis = require('../../../dispatcher'); module.exports = React.createClass({ displayName: 'IntegrationsManager', diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js index be03b4d70a..39774778e1 100644 --- a/src/components/views/settings/Notifications.js +++ b/src/components/views/settings/Notifications.js @@ -16,12 +16,12 @@ limitations under the License. import React from 'react'; import Promise from 'bluebird'; -import sdk from 'matrix-react-sdk'; -import { _t } from 'matrix-react-sdk/lib/languageHandler'; -import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; -import UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore'; -import SettingsStore, {SettingLevel} from "matrix-react-sdk/lib/settings/SettingsStore"; -import Modal from 'matrix-react-sdk/lib/Modal'; +import sdk from '../../../index'; +import { _t } from '../../../languageHandler'; +import MatrixClientPeg from '../../../MatrixClientPeg'; +import UserSettingsStore from '../../../UserSettingsStore'; +import SettingsStore, {SettingLevel} from '../../../settings/SettingsStore'; +import Modal from '../../../Modal'; import { NotificationUtils, VectorPushRulesDefinitions, diff --git a/src/notifications/VectorPushRulesDefinitions.js b/src/notifications/VectorPushRulesDefinitions.js index 6f72164265..47e5d56f46 100644 --- a/src/notifications/VectorPushRulesDefinitions.js +++ b/src/notifications/VectorPushRulesDefinitions.js @@ -16,7 +16,7 @@ limitations under the License. 'use strict'; -import { _td } from 'matrix-react-sdk/lib/languageHandler'; +import { _td } from '../languageHandler'; var StandardActions = require('./StandardActions'); var PushRuleVectorState = require('./PushRuleVectorState');