1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

replace imports of q with bluebird

```
find src spec -name '*.js' |
   xargs perl -i -pe 'if (/require\(.q.\)/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'

find src spec -name '*.js' |
   xargs perl -i -pe 'if (/import q/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'
```
This commit is contained in:
Richard van der Hoff
2017-07-10 15:56:31 +01:00
parent 04b71c11e1
commit b96062b6de
36 changed files with 36 additions and 36 deletions

View File

@@ -49,9 +49,9 @@
], ],
"dependencies": { "dependencies": {
"another-json": "^0.2.0", "another-json": "^0.2.0",
"bluebird": "^3.5.0",
"browser-request": "^0.3.3", "browser-request": "^0.3.3",
"content-type": "^1.0.2", "content-type": "^1.0.2",
"q": "^1.4.1",
"regenerator-runtime": "^0.10.5", "regenerator-runtime": "^0.10.5",
"request": "^2.53.0" "request": "^2.53.0"
}, },

View File

@@ -24,7 +24,7 @@ import sdk from '..';
import testUtils from './test-utils'; import testUtils from './test-utils';
import MockHttpBackend from 'matrix-mock-request'; import MockHttpBackend from 'matrix-mock-request';
import expect from 'expect'; import expect from 'expect';
import q from 'q'; import Promise from 'bluebird';
/** /**
* Wrapper for a MockStorageApi, MockHttpBackend and MatrixClient * Wrapper for a MockStorageApi, MockHttpBackend and MatrixClient

View File

@@ -31,7 +31,7 @@ import '../olm-loader';
import expect from 'expect'; import expect from 'expect';
const sdk = require("../.."); const sdk = require("../..");
const q = require("q"); import Promise from 'bluebird';
const utils = require("../../lib/utils"); const utils = require("../../lib/utils");
const testUtils = require("../test-utils"); const testUtils = require("../test-utils");
const TestClient = require('../TestClient').default; const TestClient = require('../TestClient').default;

View File

@@ -1,6 +1,6 @@
"use strict"; "use strict";
import 'source-map-support/register'; import 'source-map-support/register';
const q = require("q"); import Promise from 'bluebird';
const sdk = require("../.."); const sdk = require("../..");
const HttpBackend = require("matrix-mock-request"); const HttpBackend = require("matrix-mock-request");
const utils = require("../test-utils"); const utils = require("../test-utils");

View File

@@ -6,7 +6,7 @@ const HttpBackend = require("matrix-mock-request");
const utils = require("../test-utils"); const utils = require("../test-utils");
import expect from 'expect'; import expect from 'expect';
import q from 'q'; import Promise from 'bluebird';
describe("MatrixClient opts", function() { describe("MatrixClient opts", function() {
const baseUrl = "http://localhost.or.something"; const baseUrl = "http://localhost.or.something";

View File

@@ -5,7 +5,7 @@ const EventStatus = sdk.EventStatus;
const HttpBackend = require("matrix-mock-request"); const HttpBackend = require("matrix-mock-request");
const utils = require("../test-utils"); const utils = require("../test-utils");
import q from 'q'; import Promise from 'bluebird';
import expect from 'expect'; import expect from 'expect';
describe("MatrixClient room timelines", function() { describe("MatrixClient room timelines", function() {

View File

@@ -7,7 +7,7 @@ const MatrixEvent = sdk.MatrixEvent;
const EventTimeline = sdk.EventTimeline; const EventTimeline = sdk.EventTimeline;
import expect from 'expect'; import expect from 'expect';
import q from 'q'; import Promise from 'bluebird';
describe("MatrixClient syncing", function() { describe("MatrixClient syncing", function() {
const baseUrl = "http://localhost.or.something"; const baseUrl = "http://localhost.or.something";

View File

@@ -17,7 +17,7 @@ limitations under the License.
"use strict"; "use strict";
const anotherjson = require('another-json'); const anotherjson = require('another-json');
const q = require('q'); import Promise from 'bluebird';
import expect from 'expect'; import expect from 'expect';
const utils = require('../../lib/utils'); const utils = require('../../lib/utils');

View File

@@ -1,6 +1,6 @@
"use strict"; "use strict";
import expect from 'expect'; import expect from 'expect';
import q from 'q'; import Promise from 'bluebird';
// load olm before the sdk if possible // load olm before the sdk if possible
import './olm-loader'; import './olm-loader';

View File

@@ -5,7 +5,7 @@ import testUtils from '../../test-utils';
import utils from '../../../lib/utils'; import utils from '../../../lib/utils';
import expect from 'expect'; import expect from 'expect';
import q from 'q'; import Promise from 'bluebird';
const signedDeviceList = { const signedDeviceList = {
"failures": {}, "failures": {},

View File

@@ -5,7 +5,7 @@ try {
} }
import expect from 'expect'; import expect from 'expect';
import q from 'q'; import Promise from 'bluebird';
import sdk from '../../../..'; import sdk from '../../../..';
import algorithms from '../../../../lib/crypto/algorithms'; import algorithms from '../../../../lib/crypto/algorithms';

View File

@@ -16,7 +16,7 @@ limitations under the License.
"use strict"; "use strict";
import 'source-map-support/register'; import 'source-map-support/register';
const q = require("q"); import Promise from 'bluebird';
const sdk = require("../.."); const sdk = require("../..");
const utils = require("../test-utils"); const utils = require("../test-utils");

View File

@@ -1,6 +1,6 @@
"use strict"; "use strict";
import 'source-map-support/register'; import 'source-map-support/register';
const q = require("q"); import Promise from 'bluebird';
const sdk = require("../.."); const sdk = require("../..");
const MatrixClient = sdk.MatrixClient; const MatrixClient = sdk.MatrixClient;
const utils = require("../test-utils"); const utils = require("../test-utils");

View File

@@ -2,7 +2,7 @@
/* eslint new-cap: "off" */ /* eslint new-cap: "off" */
import 'source-map-support/register'; import 'source-map-support/register';
const q = require("q"); import Promise from 'bluebird';
const sdk = require("../.."); const sdk = require("../..");
const MatrixScheduler = sdk.MatrixScheduler; const MatrixScheduler = sdk.MatrixScheduler;
const MatrixError = sdk.MatrixError; const MatrixError = sdk.MatrixError;

View File

@@ -1,6 +1,6 @@
"use strict"; "use strict";
import 'source-map-support/register'; import 'source-map-support/register';
const q = require("q"); import Promise from 'bluebird';
const sdk = require("../.."); const sdk = require("../..");
const EventTimeline = sdk.EventTimeline; const EventTimeline = sdk.EventTimeline;
const TimelineWindow = sdk.TimelineWindow; const TimelineWindow = sdk.TimelineWindow;

View File

@@ -23,7 +23,7 @@ const PushProcessor = require('./pushprocessor');
* @module client * @module client
*/ */
const EventEmitter = require("events").EventEmitter; const EventEmitter = require("events").EventEmitter;
const q = require("q"); import Promise from 'bluebird';
const url = require('url'); const url = require('url');
const httpApi = require("./http-api"); const httpApi = require("./http-api");

View File

@@ -21,7 +21,7 @@ limitations under the License.
* Manages the list of other users' devices * Manages the list of other users' devices
*/ */
import q from 'q'; import Promise from 'bluebird';
import DeviceInfo from './deviceinfo'; import DeviceInfo from './deviceinfo';
import olmlib from './olmlib'; import olmlib from './olmlib';

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import q from 'q'; import Promise from 'bluebird';
import utils from '../utils'; import utils from '../utils';

View File

@@ -21,7 +21,7 @@ limitations under the License.
* @module crypto/algorithms/megolm * @module crypto/algorithms/megolm
*/ */
const q = require("q"); import Promise from 'bluebird';
const utils = require("../../utils"); const utils = require("../../utils");
const olmlib = require("../olmlib"); const olmlib = require("../olmlib");

View File

@@ -20,7 +20,7 @@ limitations under the License.
* *
* @module crypto/algorithms/olm * @module crypto/algorithms/olm
*/ */
const q = require('q'); import Promise from 'bluebird';
const utils = require("../../utils"); const utils = require("../../utils");
const olmlib = require("../olmlib"); const olmlib = require("../olmlib");

View File

@@ -21,7 +21,7 @@ limitations under the License.
*/ */
const anotherjson = require('another-json'); const anotherjson = require('another-json');
const q = require("q"); import Promise from 'bluebird';
import {EventEmitter} from 'events'; import {EventEmitter} from 'events';
const utils = require("../utils"); const utils = require("../utils");

View File

@@ -20,7 +20,7 @@ limitations under the License.
* Utilities common to olm encryption algorithms * Utilities common to olm encryption algorithms
*/ */
const q = require('q'); import Promise from 'bluebird';
const anotherjson = require('another-json'); const anotherjson = require('another-json');
const utils = require("../utils"); const utils = require("../utils");

View File

@@ -1,4 +1,4 @@
import q from 'q'; import Promise from 'bluebird';
import utils from '../../utils'; import utils from '../../utils';
export const VERSION = 1; export const VERSION = 1;

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import q from 'q'; import Promise from 'bluebird';
import MemoryCryptoStore from './memory-crypto-store'; import MemoryCryptoStore from './memory-crypto-store';
import * as IndexedDBCryptoStoreBackend from './indexeddb-crypto-store-backend'; import * as IndexedDBCryptoStoreBackend from './indexeddb-crypto-store-backend';

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import q from 'q'; import Promise from 'bluebird';
import utils from '../../utils'; import utils from '../../utils';

View File

@@ -18,7 +18,7 @@ limitations under the License.
* This is an internal module. See {@link MatrixHttpApi} for the public class. * This is an internal module. See {@link MatrixHttpApi} for the public class.
* @module http-api * @module http-api
*/ */
const q = require("q"); import Promise from 'bluebird';
const parseContentType = require('content-type').parse; const parseContentType = require('content-type').parse;
const utils = require("./utils"); const utils = require("./utils");

View File

@@ -17,7 +17,7 @@ limitations under the License.
"use strict"; "use strict";
/** @module interactive-auth */ /** @module interactive-auth */
const q = require("q"); import Promise from 'bluebird';
const url = require("url"); const url = require("url");
const utils = require("./utils"); const utils = require("./utils");

View File

@@ -20,7 +20,7 @@ limitations under the License.
* @module scheduler * @module scheduler
*/ */
const utils = require("./utils"); const utils = require("./utils");
const q = require("q"); import Promise from 'bluebird';
const DEBUG = false; // set true to enable console logging. const DEBUG = false; // set true to enable console logging.

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import q from "q"; import Promise from 'bluebird';
import SyncAccumulator from "../sync-accumulator"; import SyncAccumulator from "../sync-accumulator";
import utils from "../utils"; import utils from "../utils";

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import q from "q"; import Promise from 'bluebird';
/** /**
* An IndexedDB store backend where the actual backend sits in a web * An IndexedDB store backend where the actual backend sits in a web

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import q from "q"; import Promise from 'bluebird';
import LocalIndexedDBStoreBackend from "./indexeddb-local-backend.js"; import LocalIndexedDBStoreBackend from "./indexeddb-local-backend.js";
/** /**

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import q from "q"; import Promise from 'bluebird';
import {MatrixInMemoryStore} from "./memory"; import {MatrixInMemoryStore} from "./memory";
import utils from "../utils"; import utils from "../utils";
import LocalIndexedDBStoreBackend from "./indexeddb-local-backend.js"; import LocalIndexedDBStoreBackend from "./indexeddb-local-backend.js";

View File

@@ -21,7 +21,7 @@ limitations under the License.
*/ */
const utils = require("../utils"); const utils = require("../utils");
const User = require("../models/user"); const User = require("../models/user");
const q = require("q"); import Promise from 'bluebird';
/** /**
* Construct a new in-memory data store for the Matrix Client. * Construct a new in-memory data store for the Matrix Client.

View File

@@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
"use strict"; "use strict";
import q from "q"; import Promise from 'bluebird';
/** /**
* This is an internal module. * This is an internal module.
* @module store/stub * @module store/stub

View File

@@ -24,7 +24,7 @@ limitations under the License.
* an alternative syncing API, we may want to have a proper syncing interface * an alternative syncing API, we may want to have a proper syncing interface
* for HTTP and WS at some point. * for HTTP and WS at some point.
*/ */
const q = require("q"); import Promise from 'bluebird';
const User = require("./models/user"); const User = require("./models/user");
const Room = require("./models/room"); const Room = require("./models/room");
const utils = require("./utils"); const utils = require("./utils");

View File

@@ -17,7 +17,7 @@ limitations under the License.
/** @module timeline-window */ /** @module timeline-window */
const q = require("q"); import Promise from 'bluebird';
const EventTimeline = require("./models/event-timeline"); const EventTimeline = require("./models/event-timeline");
/** /**