From 6813fd2264cc9f3d4bf9e9fdf0efaeb2e7bf3b3e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 19 Aug 2020 11:27:35 +0200 Subject: [PATCH 1/7] upgrade from rollup v1 to v2 so we can use ?. optional chaining --- package.json | 2 +- scripts/build.mjs | 6 +++--- yarn.lock | 24 +++++++++++------------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 9395b831..389fce6f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "postcss-import": "^12.0.1", "postcss-url": "^8.0.0", "regenerator-runtime": "^0.13.7", - "rollup": "^1.15.6", + "rollup": "^2.26.4", "rollup-plugin-cleanup": "^3.1.1", "serve-static": "^1.13.2", "xxhash": "^0.3.0" diff --git a/scripts/build.mjs b/scripts/build.mjs index fc7e223b..892e27f0 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -20,7 +20,7 @@ import fsRoot from "fs"; const fs = fsRoot.promises; import path from "path"; import XXHash from 'xxhash'; -import rollup from 'rollup'; +import { rollup } from 'rollup'; import postcss from "postcss"; import postcssImport from "postcss-import"; import { fileURLToPath } from 'url'; @@ -174,7 +174,7 @@ async function buildHtml(doc, version, assetPaths, manifestPath) { async function buildJs() { // create js bundle - const bundle = await rollup.rollup({ + const bundle = await rollup({ input: 'src/main.js', plugins: [removeJsComments({comments: "none"})] }); @@ -209,7 +209,7 @@ async function buildJsLegacy() { input: ['src/legacy-polyfill.js', 'src/main.js'], plugins: [multi(), commonjs(), nodeResolve(), babelPlugin, removeJsComments({comments: "none"})] }; - const bundle = await rollup.rollup(rollupConfig); + const bundle = await rollup(rollupConfig); const {output} = await bundle.generate({ format: 'iife', name: `${PROJECT_ID}Bundle` diff --git a/yarn.lock b/yarn.lock index d5ce21eb..dd71d67d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -902,11 +902,6 @@ dependencies: "@types/node" "*" -acorn@^7.1.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf" - integrity sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg== - ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -1252,6 +1247,11 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= +fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" @@ -1810,14 +1810,12 @@ rollup-pluginutils@^2.3.3: dependencies: estree-walker "^0.6.1" -rollup@^1.15.6: - version "1.32.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.32.1.tgz#4480e52d9d9e2ae4b46ba0d9ddeaf3163940f9c4" - integrity sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A== - dependencies: - "@types/estree" "*" - "@types/node" "*" - acorn "^7.1.0" +rollup@^2.26.4: + version "2.26.4" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.26.4.tgz#a8350fd6bd56fce9873a7db2bd9547d40de3992b" + integrity sha512-6+qsGuP0MXGd7vlYmk72utm1MrgZj5GfXibGL+cRkKQ9+ZL/BnFThDl0D5bcl7AqlzMjAQXRAwZX1HVm22M/4Q== + optionalDependencies: + fsevents "~2.1.2" safe-buffer@~5.1.1: version "5.1.2" From 2526198251c27271473b6159d2528e548320d6d0 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 19 Aug 2020 11:36:43 +0200 Subject: [PATCH 2/7] replace usage of readPath with ?. --- .../session/room/timeline/tiles/ImageTile.js | 29 ++--- src/matrix/Sync.js | 5 +- .../room/timeline/entries/EventEntry.js | 3 +- src/matrix/storage/idb/utils.js | 7 +- src/utils/validate.js | 117 ------------------ 5 files changed, 19 insertions(+), 142 deletions(-) delete mode 100644 src/utils/validate.js diff --git a/src/domain/session/room/timeline/tiles/ImageTile.js b/src/domain/session/room/timeline/tiles/ImageTile.js index 61746097..8bdaa514 100644 --- a/src/domain/session/room/timeline/tiles/ImageTile.js +++ b/src/domain/session/room/timeline/tiles/ImageTile.js @@ -15,7 +15,6 @@ limitations under the License. */ import {MessageTile} from "./MessageTile.js"; -import {readPath, Type} from "../../../../../utils/validate.js"; const MAX_HEIGHT = 300; const MAX_WIDTH = 400; @@ -27,40 +26,38 @@ export class ImageTile extends MessageTile { } get thumbnailUrl() { - try { - const mxcUrl = readPath(this._getContent(), ["url"], Type.String); + const mxcUrl = this._getContent()?.url; + if (typeof mxcUrl === "string") { return this._room.mxcUrlThumbnail(mxcUrl, this.thumbnailWidth, this.thumbnailHeight, "scale"); - } catch (err) { - return null; } + return null; } get url() { - try { - const mxcUrl = readPath(this._getContent(), ["url"], Type.String); + const mxcUrl = this._getContent()?.url; + if (typeof mxcUrl === "string") { return this._room.mxcUrl(mxcUrl); - } catch (err) { - return null; } + return null; } _scaleFactor() { - const {info} = this._getContent(); - const scaleHeightFactor = MAX_HEIGHT / info.h; - const scaleWidthFactor = MAX_WIDTH / info.w; + const info = this._getContent()?.info; + const scaleHeightFactor = MAX_HEIGHT / info?.h; + const scaleWidthFactor = MAX_WIDTH / info?.w; // take the smallest scale factor, to respect all constraints // we should not upscale images, so limit scale factor to 1 upwards return Math.min(scaleWidthFactor, scaleHeightFactor, 1); } get thumbnailWidth() { - const {info} = this._getContent(); - return Math.round(info.w * this._scaleFactor()); + const info = this._getContent()?.info; + return Math.round(info?.w * this._scaleFactor()); } get thumbnailHeight() { - const {info} = this._getContent(); - return Math.round(info.h * this._scaleFactor()); + const info = this._getContent()?.info; + return Math.round(info?.h * this._scaleFactor()); } get label() { diff --git a/src/matrix/Sync.js b/src/matrix/Sync.js index 2e1d577e..73eeb7c1 100644 --- a/src/matrix/Sync.js +++ b/src/matrix/Sync.js @@ -18,7 +18,6 @@ limitations under the License. import {AbortError} from "./error.js"; import {ObservableValue} from "../observable/ObservableValue.js"; import {createEnum} from "../utils/enum.js"; -import {readPath, Type} from "../utils/validate.js"; const INCREMENTAL_TIMEOUT = 30000; const SYNC_EVENT_LIMIT = 10; @@ -47,8 +46,8 @@ function parseRooms(roomsSection, roomCallback) { function timelineIsEmpty(roomResponse) { try { - const events = readPath(roomResponse, ["timeline", "events"], Type.Array); - return events.length === 0; + const events = roomResponse?.timeline?.events; + return Array.isArray(events) && events.length === 0; } catch (err) { return true; } diff --git a/src/matrix/room/timeline/entries/EventEntry.js b/src/matrix/room/timeline/entries/EventEntry.js index d4843bca..ead383fa 100644 --- a/src/matrix/room/timeline/entries/EventEntry.js +++ b/src/matrix/room/timeline/entries/EventEntry.js @@ -35,8 +35,7 @@ export class EventEntry extends BaseEntry { } get prevContent() { - const unsigned = this._eventEntry.event.unsigned; - return unsigned && unsigned.prev_content; + return this._eventEntry.event.unsigned?.prev_content; } get eventType() { diff --git a/src/matrix/storage/idb/utils.js b/src/matrix/storage/idb/utils.js index 18126177..f9d98d4a 100644 --- a/src/matrix/storage/idb/utils.js +++ b/src/matrix/storage/idb/utils.js @@ -15,13 +15,12 @@ limitations under the License. */ import { StorageError } from "../common.js"; -import { readPath } from "../../../utils/validate.js"; class WrappedDOMException extends StorageError { constructor(request) { - // protect against browsers not implementing any of these properties by using readPath - const storeName = readPath(request, ["source", "name"], ""); - const databaseName = readPath(request, ["source", "transaction", "db", "name"], ""); + const source = request?.source; + const storeName = source?.name || ""; + const databaseName = source?.transaction?.db?.name || ""; super(`Failed IDBRequest on ${databaseName}.${storeName}`, request.error); this.storeName = storeName; this.databaseName = databaseName; diff --git a/src/utils/validate.js b/src/utils/validate.js deleted file mode 100644 index c185ad5c..00000000 --- a/src/utils/validate.js +++ /dev/null @@ -1,117 +0,0 @@ -/* -Copyright 2020 The Matrix.org Foundation C.I.C. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -export class InvalidPathError extends Error { - constructor(obj, path, field) { - super(`Could not read path ${path.join("/")}, stopped at ${field}. Base value is ${obj}`); - } - - get name() { - return "InvalidPathError"; - } -} - -export class InvalidTypeError extends Error { - constructor(path, fieldValue, validator) { - super(`Value ${path.join("/")} is not of type ${getTypeName(validator)} but is: ${fieldValue}`); - } - - get name() { - return "InvalidTypeError"; - } -} - -function getTypeName(validator) { - if (validator === Type.Array) { - return "Array"; - } - if (validator === Type.Integer) { - return "Integer"; - } - if (validator === Type.String) { - return "String"; - } - if (validator === Type.Object) { - return "Object"; - } - if (typeof validator === "function") { - return "Custom"; - } - return "None"; -} - -export function readPath(obj, path, typeOrDefaultValue) { - if (!obj) { - throw new InvalidPathError(obj, path); - } - const hasDefaultValue = typeof typeOrDefaultValue !== "function"; - let currentValue = obj; - for (const field of path) { - currentValue = currentValue[field]; - if (typeof currentValue === "undefined") { - if (hasDefaultValue) { - return typeOrDefaultValue; - } else { - throw new InvalidPathError(obj, path, field); - } - } - } - if (!hasDefaultValue) { - const validator = typeOrDefaultValue; - if (!validator(currentValue)) { - throw new InvalidTypeError(path, currentValue, validator); - } - } - return currentValue; -} - -export const Type = Object.freeze({ - "Array": Array.isArray, - "Integer": Number.isSafeInteger, - "Boolean": value => value === true || value === false, - "String": value => typeof value === "string", - "Object": value => value !== null && typeof value === "object", -}); - -export function tests() { - return { - "readPath value at top level": assert => { - assert.strictEqual(readPath({a: 5}, ["a"]), 5); - }, - "readPath value at deep level": assert => { - assert.strictEqual(readPath({a: {b: {c: 5}}}, ["a", "b", "c"]), 5); - }, - "readPath value with correct type": assert => { - assert.strictEqual(readPath({a: 5}, ["a"], Type.Integer), 5); - }, - "readPath value with failing type": assert => { - assert.throws( - () => readPath({a: 5}, ["a"], Type.String), - {name: "InvalidTypeError"} - ); - }, - "readPath value with failing path with intermediate field not being an object": assert => { - assert.throws( - () => readPath({a: {b: "bar"}}, ["a", "b", "c"], Type.Integer), - {name: "InvalidPathError"} - ); - }, - "readPath returns default value for incomplete path": assert => { - assert.strictEqual(readPath({a: {b: "bar"}}, ["a", "b", "c"], 5), 5); - }, - - } -} From 74e9313a7847eef05890fa7d91e6b89a14b3028e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 19 Aug 2020 11:38:07 +0200 Subject: [PATCH 3/7] upgrade @rollup/plugin-node-resolve --- package.json | 2 +- yarn.lock | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 389fce6f..4952c791 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@rollup/plugin-babel": "^5.1.0", "@rollup/plugin-commonjs": "^14.0.0", "@rollup/plugin-multi-entry": "^3.0.1", - "@rollup/plugin-node-resolve": "^8.4.0", + "@rollup/plugin-node-resolve": "^9.0.0", "cheerio": "^1.0.0-rc.3", "commander": "^6.0.0", "core-js": "^3.6.5", diff --git a/yarn.lock b/yarn.lock index dd71d67d..32d9bfcb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -858,15 +858,14 @@ dependencies: matched "^1.0.2" -"@rollup/plugin-node-resolve@^8.4.0": - version "8.4.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-8.4.0.tgz#261d79a680e9dc3d86761c14462f24126ba83575" - integrity sha512-LFqKdRLn0ShtQyf6SBYO69bGE1upV6wUhBX0vFOUnLAyzx5cwp8svA0eHUnu8+YU57XOkrMtfG63QOpQx25pHQ== +"@rollup/plugin-node-resolve@^9.0.0": + version "9.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz#39bd0034ce9126b39c1699695f440b4b7d2b62e6" + integrity sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg== dependencies: "@rollup/pluginutils" "^3.1.0" "@types/resolve" "1.17.1" builtin-modules "^3.1.0" - deep-freeze "^0.0.1" deepmerge "^4.2.2" is-module "^1.0.0" resolve "^1.17.0" @@ -1076,11 +1075,6 @@ debug@^4.1.0: dependencies: ms "^2.1.1" -deep-freeze@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/deep-freeze/-/deep-freeze-0.0.1.tgz#3a0b0005de18672819dfd38cd31f91179c893e84" - integrity sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ= - deepmerge@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" From 7756da78d736c0211d4c61f75dc7f0a66dd003ea Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 19 Aug 2020 11:39:04 +0200 Subject: [PATCH 4/7] upgrade @rollup/plugin-commonjs --- package.json | 2 +- yarn.lock | 35 ++++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 4952c791..81303257 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@babel/core": "^7.11.1", "@babel/preset-env": "^7.11.0", "@rollup/plugin-babel": "^5.1.0", - "@rollup/plugin-commonjs": "^14.0.0", + "@rollup/plugin-commonjs": "^15.0.0", "@rollup/plugin-multi-entry": "^3.0.1", "@rollup/plugin-node-resolve": "^9.0.0", "cheerio": "^1.0.0-rc.3", diff --git a/yarn.lock b/yarn.lock index 32d9bfcb..bf22dbd6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -838,18 +838,18 @@ "@babel/helper-module-imports" "^7.10.4" "@rollup/pluginutils" "^3.1.0" -"@rollup/plugin-commonjs@^14.0.0": - version "14.0.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-14.0.0.tgz#4285f9ec2db686a31129e5a2b415c94aa1f836f0" - integrity sha512-+PSmD9ePwTAeU106i9FRdc+Zb3XUWyW26mo5Atr2mk82hor8+nPwkztEjFo8/B1fJKfaQDg9aM2bzQkjhi7zOw== +"@rollup/plugin-commonjs@^15.0.0": + version "15.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-15.0.0.tgz#690d15a9d54ba829db93555bff9b98ff34e08574" + integrity sha512-8uAdikHqVyrT32w1zB9VhW6uGwGjhKgnDNP4pQJsjdnyF4FgCj6/bmv24c7v2CuKhq32CcyCwRzMPEElaKkn0w== dependencies: - "@rollup/pluginutils" "^3.0.8" + "@rollup/pluginutils" "^3.1.0" commondir "^1.0.1" - estree-walker "^1.0.1" - glob "^7.1.2" - is-reference "^1.1.2" - magic-string "^0.25.2" - resolve "^1.11.0" + estree-walker "^2.0.1" + glob "^7.1.6" + is-reference "^1.2.1" + magic-string "^0.25.7" + resolve "^1.17.0" "@rollup/plugin-multi-entry@^3.0.1": version "3.0.1" @@ -870,7 +870,7 @@ is-module "^1.0.0" resolve "^1.17.0" -"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": +"@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== @@ -1196,6 +1196,11 @@ estree-walker@^1.0.1: resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== +estree-walker@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.1.tgz#f8e030fb21cefa183b44b7ad516b747434e7a3e0" + integrity sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg== + esutils@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" @@ -1256,7 +1261,7 @@ gensync@^1.0.0-beta.1: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== -glob@^7.1.2: +glob@^7.1.2, glob@^7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -1390,7 +1395,7 @@ is-module@^1.0.0: resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= -is-reference@^1.1.2: +is-reference@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== @@ -1472,7 +1477,7 @@ loose-envify@^1.0.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" -magic-string@^0.25.1, magic-string@^0.25.2: +magic-string@^0.25.1, magic-string@^0.25.7: version "0.25.7" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== @@ -1782,7 +1787,7 @@ resolve@^1.1.7: dependencies: path-parse "^1.0.6" -resolve@^1.11.0, resolve@^1.17.0, resolve@^1.3.2: +resolve@^1.17.0, resolve@^1.3.2: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== From 5748b8ba45c3c0185388616731e9d8888d401905 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 19 Aug 2020 11:39:48 +0200 Subject: [PATCH 5/7] upgrade @rollup/plugin-multi-entry --- package.json | 2 +- yarn.lock | 139 +++++++-------------------------------------------- 2 files changed, 20 insertions(+), 121 deletions(-) diff --git a/package.json b/package.json index 81303257..6d5ff177 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@babel/preset-env": "^7.11.0", "@rollup/plugin-babel": "^5.1.0", "@rollup/plugin-commonjs": "^15.0.0", - "@rollup/plugin-multi-entry": "^3.0.1", + "@rollup/plugin-multi-entry": "^4.0.0", "@rollup/plugin-node-resolve": "^9.0.0", "cheerio": "^1.0.0-rc.3", "commander": "^6.0.0", diff --git a/yarn.lock b/yarn.lock index bf22dbd6..68f5caae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -851,12 +851,13 @@ magic-string "^0.25.7" resolve "^1.17.0" -"@rollup/plugin-multi-entry@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@rollup/plugin-multi-entry/-/plugin-multi-entry-3.0.1.tgz#e23357a408d01dff514b68552392879e74d17cd9" - integrity sha512-Gcp9E8y68Kx+Jo8zy/ZpiiAkb0W01cSqnxOz6h9bPR7MU3gaoTEdRf7xXYplwli1SBFEswXX588ESj+50Brfxw== +"@rollup/plugin-multi-entry@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-multi-entry/-/plugin-multi-entry-4.0.0.tgz#8e105f16ec1bb26639eb3302c8db5665f44b9939" + integrity sha512-1Sw86rwFxrNS7ECY3iSZ7T940xKnruNGpmQDgSDVTp+VTa1g5cPXNzBgp+IoOer41CiVeGFLwYwvicVoJLHEDQ== dependencies: - matched "^1.0.2" + "@rollup/plugin-virtual" "^2.0.3" + matched "^5.0.0" "@rollup/plugin-node-resolve@^9.0.0": version "9.0.0" @@ -870,6 +871,11 @@ is-module "^1.0.0" resolve "^1.17.0" +"@rollup/plugin-virtual@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@rollup/plugin-virtual/-/plugin-virtual-2.0.3.tgz#0afc88d75c1e1378ab290b8e9898d4edb5be0d74" + integrity sha512-pw6ziJcyjZtntQ//bkad9qXaBx665SgEL8C8KI5wO8G5iU5MPxvdWrQyVaAvjojGm9tJoS8M9Z/EEepbqieYmw== + "@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" @@ -908,16 +914,6 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -async-array-reduce@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/async-array-reduce/-/async-array-reduce-0.2.1.tgz#c8be010a2b5cd00dea96c81116034693dfdd82d1" - integrity sha1-yL4BCitc0A3qlsgRFgNGk9/dgtE= - babel-plugin-dynamic-import-node@^2.3.3: version "2.3.3" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" @@ -1211,13 +1207,6 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= -expand-tilde@^2.0.0, expand-tilde@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" - integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= - dependencies: - homedir-polyfill "^1.0.1" - extend@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -1261,7 +1250,7 @@ gensync@^1.0.0-beta.1: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" integrity sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg== -glob@^7.1.2, glob@^7.1.6: +glob@^7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== @@ -1273,26 +1262,6 @@ glob@^7.1.2, glob@^7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" -global-modules@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" - integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== - dependencies: - global-prefix "^1.0.1" - is-windows "^1.0.1" - resolve-dir "^1.0.0" - -global-prefix@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" - integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= - dependencies: - expand-tilde "^2.0.2" - homedir-polyfill "^1.0.1" - ini "^1.3.4" - is-windows "^1.0.1" - which "^1.2.14" - globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" @@ -1303,25 +1272,11 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= -has-glob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-glob/-/has-glob-1.0.0.tgz#9aaa9eedbffb1ba3990a7b0010fb678ee0081207" - integrity sha1-mqqe7b/7G6OZCnsAEPtnjuAIEgc= - dependencies: - is-glob "^3.0.0" - has-symbols@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== -homedir-polyfill@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" - integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== - dependencies: - parse-passwd "^1.0.0" - htmlparser2@^3.9.1: version "3.10.1" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" @@ -1366,11 +1321,6 @@ inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -ini@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" @@ -1378,18 +1328,6 @@ invariant@^2.2.2, invariant@^2.2.4: dependencies: loose-envify "^1.0.0" -is-extglob@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-glob@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - is-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" @@ -1402,21 +1340,6 @@ is-reference@^1.2.1: dependencies: "@types/estree" "*" -is-valid-glob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" - integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= - -is-windows@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - js-cleanup@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/js-cleanup/-/js-cleanup-1.0.1.tgz#1d38080c7ee92e1d2d2b94054d0a33c48951e0df" @@ -1484,17 +1407,13 @@ magic-string@^0.25.1, magic-string@^0.25.7: dependencies: sourcemap-codec "^1.4.4" -matched@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/matched/-/matched-1.0.2.tgz#1d95d77dd5f1b5075a9e94acde5462ffd85f317a" - integrity sha512-7ivM1jFZVTOOS77QsR+TtYHH0ecdLclMkqbf5qiJdX2RorqfhsL65QHySPZgDE0ZjHoh+mQUNHTanNXIlzXd0Q== +matched@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/matched/-/matched-5.0.0.tgz#4b10735a89f87b6f9bf457136472631e19df05d7" + integrity sha512-O0LCuxYYBNBjP2dmAg0i6PME0Mb0dvjulpMC0tTIeMRh6kXYsugOT5GOWpFkSzqjQjgOUs/eiyvpVhXdN2La4g== dependencies: - arr-union "^3.1.0" - async-array-reduce "^0.2.1" - glob "^7.1.2" - has-glob "^1.0.0" - is-valid-glob "^1.0.0" - resolve-dir "^1.0.0" + glob "^7.1.6" + picomatch "^2.2.1" mdn-polyfills@^5.20.0: version "5.20.0" @@ -1591,11 +1510,6 @@ once@^1.3.0: dependencies: wrappy "1" -parse-passwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" - integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= - parse5@^3.0.1: version "3.0.3" resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" @@ -1623,7 +1537,7 @@ perf-regexes@^1.0.1: resolved "https://registry.yarnpkg.com/perf-regexes/-/perf-regexes-1.0.1.tgz#6da1d62f5a94bf9353a0451bccacf69068b75d0b" integrity sha512-L7MXxUDtqr4PUaLFCDCXBfGV/6KLIuSEccizDI7JxT+c9x1G1v04BQ4+4oag84SHaCdrBgQAIs/Cqn+flwFPng== -picomatch@^2.2.2: +picomatch@^2.2.1, picomatch@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== @@ -1772,14 +1686,6 @@ regjsparser@^0.6.4: dependencies: jsesc "~0.5.0" -resolve-dir@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" - integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= - dependencies: - expand-tilde "^2.0.0" - global-modules "^1.0.0" - resolve@^1.1.7: version "1.15.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" @@ -1959,13 +1865,6 @@ util-deprecate@^1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= -which@^1.2.14: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" From 67c94ee99db1cb90e5861bb5df49156524cc9938 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 19 Aug 2020 11:40:17 +0200 Subject: [PATCH 6/7] upgrade postcss --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6d5ff177..58e3b940 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "finalhandler": "^1.1.1", "impunity": "^0.0.11", "mdn-polyfills": "^5.20.0", - "postcss": "^7.0.18", + "postcss": "^7.0.32", "postcss-css-variables": "^0.17.0", "postcss-flexbugs-fixes": "^4.2.1", "postcss-import": "^12.0.1", diff --git a/yarn.lock b/yarn.lock index 68f5caae..1f3e276b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1599,7 +1599,7 @@ postcss@^6.0.8: source-map "^0.6.1" supports-color "^5.4.0" -postcss@^7.0.1, postcss@^7.0.18: +postcss@^7.0.1: version "7.0.27" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.27.tgz#cc67cdc6b0daa375105b7c424a85567345fc54d9" integrity sha512-WuQETPMcW9Uf1/22HWUWP9lgsIC+KEHg2kozMflKjbeUtw9ujvFX6QmIfozaErDkmLWS9WEnEdEe6Uo9/BNTdQ== @@ -1608,7 +1608,7 @@ postcss@^7.0.1, postcss@^7.0.18: source-map "^0.6.1" supports-color "^6.1.0" -postcss@^7.0.2, postcss@^7.0.26: +postcss@^7.0.2, postcss@^7.0.26, postcss@^7.0.32: version "7.0.32" resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.32.tgz#4310d6ee347053da3433db2be492883d62cec59d" integrity sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw== From f4acf7f8b18bdaee8dfe1cef24c549527e6f1bb6 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 19 Aug 2020 11:50:26 +0200 Subject: [PATCH 7/7] update ecmascript version to 2020 so eslint permits optional chaining --- .eslintrc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 521ea791..24bbb049 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -5,10 +5,10 @@ module.exports = { }, "extends": "eslint:recommended", "parserOptions": { - "ecmaVersion": 2018, + "ecmaVersion": 2020, "sourceType": "module" }, "rules": { "no-console": "off" } -}; \ No newline at end of file +};