From 031ee44571f1744d4135314024fb27732e01a2f9 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 30 Nov 2022 13:51:54 +0000 Subject: [PATCH] Enable noImplicitAny and kill off `request` (#457) * Enable noImplicitAny * Switch from request to node-fetch * Fix node-fetch via patch-package * Add edge to handler * Pin node-fetch to v2 --- package.json | 4 +- src/@types/global.d.ts | 43 +++++------ src/electron-main.ts | 35 +++++---- src/ipc.ts | 2 +- src/language-helper.ts | 2 +- src/protocol.ts | 6 +- src/seshat.ts | 33 ++++---- src/settings.ts | 6 +- src/tray.ts | 18 ++--- src/vectormenu.ts | 4 +- src/webcontents-handler.ts | 10 ++- tsconfig.json | 1 - yarn.lock | 154 +++++++++++++++++++++++++++++++++++-- 13 files changed, 232 insertions(+), 86 deletions(-) diff --git a/package.json b/package.json index 15bae19..db3e283 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,8 @@ "electron-store": "^8.0.2", "electron-window-state": "^5.0.3", "minimist": "^1.2.6", - "png-to-ico": "^2.1.1", - "request": "^2.88.2" + "node-fetch": "^2", + "png-to-ico": "^2.1.1" }, "devDependencies": { "@aws-sdk/client-s3": "^3.213.0", diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index 339cf0e..20dd96f 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -20,27 +20,26 @@ import AutoLaunch from "auto-launch"; import { AppLocalization } from "../language-helper"; +// global type extensions need to use var for whatever reason +/* eslint-disable no-var */ declare global { - namespace NodeJS { - interface Global { - mainWindow: BrowserWindow; - appQuitting: boolean; - appLocalization: AppLocalization; - launcher: AutoLaunch; - vectorConfig: Record; - trayConfig: { - // eslint-disable-next-line camelcase - icon_path: string; - brand: string; - }; - store: Store<{ - warnBeforeExit?: boolean; - minimizeToTray?: boolean; - spellCheckerEnabled?: boolean; - autoHideMenuBar?: boolean; - locale?: string | string[]; - disableHardwareAcceleration?: boolean; - }>; - } - } + var mainWindow: BrowserWindow | null; + var appQuitting: boolean; + var appLocalization: AppLocalization; + var launcher: AutoLaunch; + var vectorConfig: Record; + var trayConfig: { + // eslint-disable-next-line camelcase + icon_path: string; + brand: string; + }; + var store: Store<{ + warnBeforeExit?: boolean; + minimizeToTray?: boolean; + spellCheckerEnabled?: boolean; + autoHideMenuBar?: boolean; + locale?: string | string[]; + disableHardwareAcceleration?: boolean; + }>; } +/* eslint-enable no-var */ diff --git a/src/electron-main.ts b/src/electron-main.ts index 0805ef5..8831fb2 100644 --- a/src/electron-main.ts +++ b/src/electron-main.ts @@ -126,6 +126,8 @@ async function tryPaths(name: string, root: string, rawPaths: string[]): Promise throw new Error(`Failed to find ${name} files`); } +const homeserverProps = ['default_is_url', 'default_hs_url', 'default_server_name', 'default_server_config'] as const; + // Find the webapp resources and set up things that require them async function setupGlobals(): Promise { // find the webapp asar. @@ -168,12 +170,14 @@ async function setupGlobals(): Promise { // If the local config has a homeserver defined, don't use the homeserver from the build // config. This is to avoid a problem where Riot thinks there are multiple homeservers // defined, and panics as a result. - const homeserverProps = ['default_is_url', 'default_hs_url', 'default_server_name', 'default_server_config']; - if (Object.keys(localConfig).find(k => homeserverProps.includes(k))) { + if (Object.keys(localConfig).find(k => homeserverProps.includes(k))) { // Rip out all the homeserver options from the vector config global.vectorConfig = Object.keys(global.vectorConfig) - .filter(k => !homeserverProps.includes(k)) - .reduce((obj, key) => {obj[key] = global.vectorConfig[key]; return obj;}, {}); + .filter(k => !homeserverProps.includes(k)) + .reduce((obj, key) => { + obj[key] = global.vectorConfig[key]; + return obj; + }, {} as Omit, keyof typeof homeserverProps>); } global.vectorConfig = Object.assign(global.vectorConfig, localConfig); @@ -244,7 +248,7 @@ const warnBeforeExit = (event: Event, input: Input): void => { const exitShortcutPressed = input.type === 'keyDown' && exitShortcuts.some(shortcutFn => shortcutFn(input, process.platform)); - if (shouldWarnBeforeExit && exitShortcutPressed) { + if (shouldWarnBeforeExit && exitShortcutPressed && global.mainWindow) { const shouldCancelCloseRequest = dialog.showMessageBoxSync(global.mainWindow, { type: "question", buttons: [_t("Cancel"), _t("Close %(brand)s", { @@ -338,11 +342,11 @@ app.on('ready', async () => { // eslint-disable-next-line @typescript-eslint/no-var-requires const { default: installExt, REACT_DEVELOPER_TOOLS, REACT_PERF } = require('electron-devtools-installer'); installExt(REACT_DEVELOPER_TOOLS) - .then((name) => console.log(`Added Extension: ${name}`)) - .catch((err) => console.log('An error occurred: ', err)); + .then((name: string) => console.log(`Added Extension: ${name}`)) + .catch((err: unknown) => console.log('An error occurred: ', err)); installExt(REACT_PERF) - .then((name) => console.log(`Added Extension: ${name}`)) - .catch((err) => console.log('An error occurred: ', err)); + .then((name: string) => console.log(`Added Extension: ${name}`)) + .catch((err: unknown) => console.log('An error occurred: ', err)); } catch (e) { console.log(e); } @@ -446,6 +450,7 @@ app.on('ready', async () => { if (global.store.get('minimizeToTray', true)) tray.create(global.trayConfig); global.mainWindow.once('ready-to-show', () => { + if (!global.mainWindow) return; mainWindowState.manage(global.mainWindow); if (!argv['hidden']) { @@ -469,12 +474,12 @@ app.on('ready', async () => { // behave, eg. Mail.app) e.preventDefault(); - if (global.mainWindow.isFullScreen()) { - global.mainWindow.once('leave-full-screen', () => global.mainWindow.hide()); + if (global.mainWindow?.isFullScreen()) { + global.mainWindow.once('leave-full-screen', () => global.mainWindow?.hide()); global.mainWindow.setFullScreen(false); } else { - global.mainWindow.hide(); + global.mainWindow?.hide(); } return false; @@ -484,9 +489,9 @@ app.on('ready', async () => { if (process.platform === 'win32') { // Handle forward/backward mouse buttons in Windows global.mainWindow.on('app-command', (e, cmd) => { - if (cmd === 'browser-backward' && global.mainWindow.webContents.canGoBack()) { + if (cmd === 'browser-backward' && global.mainWindow?.webContents.canGoBack()) { global.mainWindow.webContents.goBack(); - } else if (cmd === 'browser-forward' && global.mainWindow.webContents.canGoForward()) { + } else if (cmd === 'browser-forward' && global.mainWindow?.webContents.canGoForward()) { global.mainWindow.webContents.goForward(); } }); @@ -508,7 +513,7 @@ app.on('window-all-closed', () => { }); app.on('activate', () => { - global.mainWindow.show(); + global.mainWindow?.show(); }); function beforeQuit(): void { diff --git a/src/ipc.ts b/src/ipc.ts index f5e3f29..17664f9 100644 --- a/src/ipc.ts +++ b/src/ipc.ts @@ -39,7 +39,7 @@ ipcMain.on('loudNotification', function(): void { if (process.platform === 'win32' && global.mainWindow && !global.mainWindow.isFocused() && !focusHandlerAttached) { global.mainWindow.flashFrame(true); global.mainWindow.once('focus', () => { - global.mainWindow.flashFrame(false); + global.mainWindow?.flashFrame(false); focusHandlerAttached = false; }); focusHandlerAttached = true; diff --git a/src/language-helper.ts b/src/language-helper.ts index 46e8534..b04ba96 100644 --- a/src/language-helper.ts +++ b/src/language-helper.ts @@ -63,7 +63,7 @@ export function _t(text: string, variables: IVariables = {}): string { type Component = () => void; -type TypedStore = Store<{ locale?: string[] }>; +type TypedStore = Store<{ locale?: string | string[] }>; export class AppLocalization { private static readonly STORE_KEY = "locale"; diff --git a/src/protocol.ts b/src/protocol.ts index 1c79184..6f3d6ac 100644 --- a/src/protocol.ts +++ b/src/protocol.ts @@ -52,7 +52,7 @@ function processUrl(url: string): void { global.mainWindow.loadURL(urlToLoad.href); } -function readStore(): object { +function readStore(): Record { try { const s = fs.readFileSync(storePath, { encoding: "utf8" }); const o = JSON.parse(s); @@ -62,7 +62,7 @@ function readStore(): object { } } -function writeStore(data: object): void { +function writeStore(data: Record): void { fs.writeFileSync(storePath, JSON.stringify(data)); } @@ -83,7 +83,7 @@ export function recordSSOSession(sessionID: string): void { export function getProfileFromDeeplink(args: string[]): string | undefined { // check if we are passed a profile in the SSO callback url const deeplinkUrl = args.find(arg => arg.startsWith(PROTOCOL + '//')); - if (deeplinkUrl && deeplinkUrl.includes(SEARCH_PARAM)) { + if (deeplinkUrl?.includes(SEARCH_PARAM)) { const parsedUrl = new URL(deeplinkUrl); if (parsedUrl.protocol === PROTOCOL) { const ssoID = parsedUrl.searchParams.get(SEARCH_PARAM)!; diff --git a/src/seshat.ts b/src/seshat.ts index 3e90659..32af42e 100644 --- a/src/seshat.ts +++ b/src/seshat.ts @@ -81,15 +81,12 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { // We do this here to ensure we get the path after --profile has been resolved const eventStorePath = path.join(app.getPath('userData'), 'EventStore'); - const sendError = (id, e) => { + const sendError = (id: string, e: Error) => { const error = { message: e.message, }; - global.mainWindow.webContents.send('seshatReply', { - id: id, - error: error, - }); + global.mainWindow?.webContents.send('seshatReply', { id, error }); }; const args = payload.args || []; @@ -138,7 +135,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { eventIndex = new Seshat(eventStorePath, { passphrase }); } else { - sendError(payload.id, e); + sendError(payload.id, e); return; } } @@ -153,7 +150,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { try { await index.shutdown(); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } } @@ -182,7 +179,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { try { eventIndex?.addEvent(args[0], args[1]); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } break; @@ -191,7 +188,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { try { ret = await eventIndex?.deleteEvent(args[0]); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } break; @@ -200,7 +197,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { try { ret = await eventIndex?.commit(); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } break; @@ -209,7 +206,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { try { ret = await eventIndex?.search(args[0]); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } break; @@ -221,7 +218,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { ret = await eventIndex.addHistoricEvents( args[0], args[1], args[2]); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } } @@ -233,7 +230,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { try { ret = await eventIndex.getStats(); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } } @@ -245,7 +242,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { try { ret = await eventIndex.removeCrawlerCheckpoint(args[0]); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } } @@ -257,7 +254,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { try { ret = await eventIndex.addCrawlerCheckpoint(args[0]); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } } @@ -269,7 +266,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { try { ret = await eventIndex.loadFileEvents(args[0]); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } } @@ -292,7 +289,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { try { await eventIndex.setUserVersion(args[0]); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } } @@ -304,7 +301,7 @@ ipcMain.on('seshat', async function(_ev: IpcMainEvent, payload): Promise { try { ret = await eventIndex.getUserVersion(); } catch (e) { - sendError(payload.id, e); + sendError(payload.id, e); return; } } diff --git a/src/settings.ts b/src/settings.ts index 497f03f..803d92d 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -44,12 +44,12 @@ export const Settings: Record = { }, "Electron.alwaysShowMenuBar": { // not supported on macOS async read(): Promise { - return !global.mainWindow.autoHideMenuBar; + return !global.mainWindow!.autoHideMenuBar; }, async write(value: any): Promise { global.store.set('autoHideMenuBar', !value); - global.mainWindow.autoHideMenuBar = !value; - global.mainWindow.setMenuBarVisibility(value); + global.mainWindow!.autoHideMenuBar = !value; + global.mainWindow!.setMenuBarVisibility(value); }, }, "Electron.showTrayIcon": { // not supported on macOS diff --git a/src/tray.ts b/src/tray.ts index e015238..9504312 100644 --- a/src/tray.ts +++ b/src/tray.ts @@ -36,12 +36,12 @@ export function destroy(): void { } function toggleWin(): void { - if (global.mainWindow.isVisible() && !global.mainWindow.isMinimized() && global.mainWindow.isFocused()) { + if (global.mainWindow?.isVisible() && !global.mainWindow.isMinimized() && global.mainWindow.isFocused()) { global.mainWindow.hide(); } else { - if (global.mainWindow.isMinimized()) global.mainWindow.restore(); - if (!global.mainWindow.isVisible()) global.mainWindow.show(); - global.mainWindow.focus(); + if (global.mainWindow?.isMinimized()) global.mainWindow.restore(); + if (!global.mainWindow?.isVisible()) global.mainWindow?.show(); + global.mainWindow?.focus(); } } @@ -60,11 +60,11 @@ export function create(config: IConfig): void { initApplicationMenu(); trayIcon.on('click', toggleWin); - let lastFavicon = null; - global.mainWindow.webContents.on('page-favicon-updated', async function(ev, favicons) { + let lastFavicon: string | null = null; + global.mainWindow?.webContents.on('page-favicon-updated', async function(ev, favicons) { if (!favicons || favicons.length <= 0 || !favicons[0].startsWith('data:')) { if (lastFavicon !== null) { - global.mainWindow.setIcon(defaultIcon); + global.mainWindow?.setIcon(defaultIcon); trayIcon?.setImage(defaultIcon); lastFavicon = null; } @@ -89,10 +89,10 @@ export function create(config: IConfig): void { } trayIcon?.setImage(newFavicon); - global.mainWindow.setIcon(newFavicon); + global.mainWindow?.setIcon(newFavicon); }); - global.mainWindow.webContents.on('page-title-updated', function(ev, title) { + global.mainWindow?.webContents.on('page-title-updated', function(ev, title) { trayIcon?.setToolTip(title); }); } diff --git a/src/vectormenu.ts b/src/vectormenu.ts index 69c08ec..acc0fc1 100644 --- a/src/vectormenu.ts +++ b/src/vectormenu.ts @@ -98,7 +98,7 @@ export function buildMenuTemplate(): Menu { // in macOS the Preferences menu item goes in the first menu ...(!isMac ? [{ label: _t('Preferences'), - click() { global.mainWindow.webContents.send('preferences'); }, + click() { global.mainWindow?.webContents.send('preferences'); }, }] : []), { role: 'togglefullscreen', @@ -153,7 +153,7 @@ export function buildMenuTemplate(): Menu { { label: _t('Preferences') + '…', accelerator: 'Command+,', // Mac-only accelerator - click() { global.mainWindow.webContents.send('preferences'); }, + click() { global.mainWindow?.webContents.send('preferences'); }, }, { type: 'separator' }, { diff --git a/src/webcontents-handler.ts b/src/webcontents-handler.ts index b885431..ccd6d31 100644 --- a/src/webcontents-handler.ts +++ b/src/webcontents-handler.ts @@ -31,7 +31,8 @@ import { } from 'electron'; import url from 'url'; import fs from 'fs'; -import request from 'request'; +import fetch from 'node-fetch'; +import { pipeline } from 'stream'; import path from 'path'; import { _t } from './language-helper'; @@ -154,7 +155,10 @@ function onLinkContextMenu(ev: Event, params: ContextMenuParams, webContents: We if (url.startsWith("data:")) { await writeNativeImage(filePath, nativeImage.createFromDataURL(url)); } else { - request.get(url).pipe(fs.createWriteStream(filePath)); + const resp = await fetch(url); + if (!resp.ok) throw new Error(`unexpected response ${resp.statusText}`); + if (!resp.body) throw new Error(`unexpected response has no body ${resp.statusText}`); + pipeline(resp.body, fs.createWriteStream(filePath)); } } catch (err) { console.error(err); @@ -224,7 +228,7 @@ function cutCopyPasteSelectContextMenus(params: ContextMenuParams): MenuItemCons return options; } -function onSelectedContextMenu(ev, params) { +function onSelectedContextMenu(ev: Event, params: ContextMenuParams) { const items = cutCopyPasteSelectContextMenus(params); const popupMenu = Menu.buildFromTemplate(items); diff --git a/tsconfig.json b/tsconfig.json index 1c42f2e..578c031 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,6 @@ "module": "commonjs", "moduleResolution": "node", "target": "es2016", - "noImplicitAny": false, "sourceMap": false, "outDir": "./lib", "rootDir": "./src", diff --git a/yarn.lock b/yarn.lock index b32d241..fb7ea73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2882,6 +2882,11 @@ "@typescript-eslint/types" "5.45.0" eslint-visitor-keys "^3.3.0" +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -3649,7 +3654,7 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.1: +chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3692,6 +3697,11 @@ chromium-pickle-js@^0.2.0: resolved "https://registry.yarnpkg.com/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz#04a106672c18b085ab774d983dfa3ea138f22205" integrity sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw== +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + ci-info@^3.2.0, ci-info@^3.4.0: version "3.7.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.7.0.tgz#6d01b3696c59915b6ce057e4aa4adfc2fa25f5ef" @@ -3924,6 +3934,17 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" @@ -4812,6 +4833,13 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" +find-yarn-workspace-root@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" + integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== + dependencies: + micromatch "^4.0.2" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -4876,6 +4904,15 @@ fs-extra@^10.0.0, fs-extra@^10.1.0: jsonfile "^6.0.1" universalify "^2.0.0" +fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-extra@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" @@ -5107,7 +5144,7 @@ got@^9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.3, graceful-fs@^4.2.9: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.3, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -5401,6 +5438,13 @@ is-callable@^1.1.4, is-callable@^1.2.7: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + is-ci@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.1.tgz#db6ecbed1bd659c43dac0f45661e7674103d1867" @@ -5422,6 +5466,11 @@ is-date-object@^1.0.1: dependencies: has-tostringtag "^1.0.0" +is-docker@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" + integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -5539,6 +5588,13 @@ is-weakref@^1.0.2: dependencies: call-bind "^1.0.2" +is-wsl@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" + integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== + dependencies: + is-docker "^2.0.0" + isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -6116,6 +6172,13 @@ keyv@^3.0.0: dependencies: json-buffer "3.0.0" +klaw-sync@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" + integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== + dependencies: + graceful-fs "^4.1.11" + kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -6335,7 +6398,7 @@ merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -micromatch@^4.0.4: +micromatch@^4.0.2, micromatch@^4.0.4: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== @@ -6539,12 +6602,17 @@ next-tick@1, next-tick@^1.1.0: resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + node-addon-api@^1.6.3: version "1.7.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-1.7.2.tgz#3df30b95720b53c24e59948b49532b662444f54d" integrity sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg== -node-fetch@^2.6.7: +node-fetch@^2, node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -6780,6 +6848,14 @@ onetime@^5.1.2: dependencies: mimic-fn "^2.1.0" +open@^7.4.2: + version "7.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" + integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" + optionator@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" @@ -6797,7 +6873,7 @@ os-homedir@^1.0.0: resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ== -os-tmpdir@^1.0.0: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== @@ -6909,6 +6985,26 @@ parse-json@^5.0.0, parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +patch-package@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.5.0.tgz#feb058db56f0005da59cfa316488321de585e88a" + integrity sha512-tC3EqJmo74yKqfsMzELaFwxOAu6FH6t+FzFOsnWAuARm7/n2xB5AOeOueE221eM9gtMuIKMKpF9tBy/X2mNP0Q== + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + chalk "^4.1.2" + cross-spawn "^6.0.5" + find-yarn-workspace-root "^2.0.0" + fs-extra "^7.0.1" + is-ci "^2.0.0" + klaw-sync "^6.0.0" + minimist "^1.2.6" + open "^7.4.2" + rimraf "^2.6.3" + semver "^5.6.0" + slash "^2.0.0" + tmp "^0.0.33" + yaml "^1.10.2" + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -6924,6 +7020,11 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== + path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" @@ -7027,6 +7128,11 @@ pngjs@^6.0.0: resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-6.0.0.tgz#ca9e5d2aa48db0228a52c419c3308e87720da821" integrity sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg== +postinstall-postinstall@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" + integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ== + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -7432,7 +7538,7 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow== -"semver@2 || 3 || 4 || 5", semver@^5.3.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -7471,6 +7577,13 @@ setimmediate@^1.0.5: resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== + dependencies: + shebang-regex "^1.0.0" + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -7478,6 +7591,11 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== + shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" @@ -7509,6 +7627,11 @@ sisteransi@^1.0.5: resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -7882,6 +8005,13 @@ tmp@0.1.0: dependencies: rimraf "^2.6.3" +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + tmp@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" @@ -8268,6 +8398,13 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" +which@^1.2.9: + 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" + which@^2.0.1, which@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -8339,6 +8476,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yaml@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + yargs-parser@^21.0.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35"