From d5503b2e6b9ff2e8b53371ab1002b6c533f05de1 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Wed, 4 Aug 2021 16:31:05 -0700 Subject: [PATCH] Rely on snowpack to serve node modules --- src/domain/session/room/timeline/deserialize.ts | 2 +- src/matrix/e2ee/Account.js | 2 +- src/matrix/e2ee/common.js | 2 +- src/mocks/Storage.js | 6 +++--- src/platform/web/LegacyPlatform.js | 2 +- src/platform/web/dom/Crypto.js | 2 +- src/platform/web/parsehtml.js | 2 +- src/platform/web/utils/Base64.js | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/domain/session/room/timeline/deserialize.ts b/src/domain/session/room/timeline/deserialize.ts index d7f81316..1d8ce196 100644 --- a/src/domain/session/room/timeline/deserialize.ts +++ b/src/domain/session/room/timeline/deserialize.ts @@ -343,7 +343,7 @@ export function parseHTMLBody(platform, mediaRepository, html) { return new MessageBody(html, parts); } -import parse from '../../../../../lib/node-html-parser/index.js'; +import parse from 'node-html-parser'; export function tests() { class HTMLParseResult { diff --git a/src/matrix/e2ee/Account.js b/src/matrix/e2ee/Account.js index 9314d590..6274670d 100644 --- a/src/matrix/e2ee/Account.js +++ b/src/matrix/e2ee/Account.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import anotherjson from "../../../lib/another-json/index.js"; +import anotherjson from "another-json"; import {SESSION_KEY_PREFIX, OLM_ALGORITHM, MEGOLM_ALGORITHM} from "./common.js"; // use common prefix so it's easy to clear properties that are not e2ee related during session clear diff --git a/src/matrix/e2ee/common.js b/src/matrix/e2ee/common.js index 52995765..c30e1103 100644 --- a/src/matrix/e2ee/common.js +++ b/src/matrix/e2ee/common.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import anotherjson from "../../../lib/another-json/index.js"; +import anotherjson from "another-json"; import {createEnum} from "../../utils/enum.js"; export const DecryptionSource = createEnum("Sync", "Timeline", "Retry"); diff --git a/src/mocks/Storage.js b/src/mocks/Storage.js index 0cddc7bc..2c905186 100644 --- a/src/mocks/Storage.js +++ b/src/mocks/Storage.js @@ -14,9 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import {FDBFactory, FDBKeyRange} from "../../lib/fake-indexeddb/index.js"; +import fdb from "fake-indexeddb"; import {StorageFactory} from "../matrix/storage/idb/StorageFactory.js"; export function createMockStorage() { - return new StorageFactory(null, new FDBFactory(), FDBKeyRange).create(1); -} \ No newline at end of file + return new StorageFactory(null, new fdb.FDBFactory(), fdb.FDBKeyRange).create(1); +} diff --git a/src/platform/web/LegacyPlatform.js b/src/platform/web/LegacyPlatform.js index e6bf7774..624600ff 100644 --- a/src/platform/web/LegacyPlatform.js +++ b/src/platform/web/LegacyPlatform.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import aesjs from "../../../lib/aes-js/index.js"; +import aesjs from "aes-js"; import {hkdf} from "../../utils/crypto/hkdf.js"; import {Platform as ModernPlatform} from "./Platform.js"; diff --git a/src/platform/web/dom/Crypto.js b/src/platform/web/dom/Crypto.js index b28897fa..441daf31 100644 --- a/src/platform/web/dom/Crypto.js +++ b/src/platform/web/dom/Crypto.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import base64 from "../../../../lib/base64-arraybuffer/index.js"; +import base64 from "base64-arraybuffer"; // turn IE11 result into promise function subtleCryptoResult(promiseOrOp, method) { diff --git a/src/platform/web/parsehtml.js b/src/platform/web/parsehtml.js index 456559d9..fecb464d 100644 --- a/src/platform/web/parsehtml.js +++ b/src/platform/web/parsehtml.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import DOMPurify from "../../../lib/dompurify/index.js" +import DOMPurify from "dompurify" class HTMLParseResult { constructor(bodyNode) { diff --git a/src/platform/web/utils/Base64.js b/src/platform/web/utils/Base64.js index 6c114fe6..83b5ccc5 100644 --- a/src/platform/web/utils/Base64.js +++ b/src/platform/web/utils/Base64.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import base64 from "../../../../lib/base64-arraybuffer/index.js"; +import base64 from "base64-arraybuffer"; export class Base64 { encodeUnpadded(buffer) {