From 01ea81823e21dc5603d020e4a7c73f0576500d13 Mon Sep 17 00:00:00 2001 From: Labhansh Agrawal Date: Mon, 2 Mar 2020 15:55:27 +0530 Subject: [PATCH] Bump @types/uuid from 3.4.7 to 7.0.0 and fix breaking changes --- app/rpc.ts | 4 ++-- app/ui/window.ts | 6 +++--- lib/reducers/term-groups.ts | 8 ++++---- package.json | 2 +- yarn.lock | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/rpc.ts b/app/rpc.ts index 3b562830..7cd26af7 100644 --- a/app/rpc.ts +++ b/app/rpc.ts @@ -1,6 +1,6 @@ import {EventEmitter} from 'events'; import {ipcMain, BrowserWindow} from 'electron'; -import uuid from 'uuid'; +import {v4 as uuidv4} from 'uuid'; export class Server extends EventEmitter { destroyed = false; @@ -15,7 +15,7 @@ export class Server extends EventEmitter { return; } - const uid = uuid.v4(); + const uid = uuidv4(); this.id = uid; ipcMain.on(uid, this.ipcListener); diff --git a/app/ui/window.ts b/app/ui/window.ts index 2599ca2c..db22b930 100644 --- a/app/ui/window.ts +++ b/app/ui/window.ts @@ -1,7 +1,7 @@ import {app, BrowserWindow, shell, Menu, BrowserWindowConstructorOptions} from 'electron'; import {isAbsolute} from 'path'; import {parse as parseUrl} from 'url'; -import uuid from 'uuid'; +import {v4 as uuidv4} from 'uuid'; import fileUriToPath from 'file-uri-to-path'; import isDev from 'electron-is-dev'; import updater from '../updater'; @@ -21,7 +21,7 @@ export function newWindow( cfg: any, fn?: (win: BrowserWindow) => void ): BrowserWindow { - const classOpts = Object.assign({uid: uuid.v4()}); + const classOpts = Object.assign({uid: uuidv4()}); app.plugins.decorateWindowClass(classOpts); const winOpts = Object.assign( @@ -112,7 +112,7 @@ export function newWindow( }); function createSession(extraOptions: any = {}) { - const uid = uuid.v4(); + const uid = uuidv4(); // remove the rows and cols, the wrong value of them will break layout when init create const defaultOptions = Object.assign( diff --git a/lib/reducers/term-groups.ts b/lib/reducers/term-groups.ts index 5ebba197..769b27d6 100644 --- a/lib/reducers/term-groups.ts +++ b/lib/reducers/term-groups.ts @@ -1,4 +1,4 @@ -import uuid from 'uuid'; +import {v4 as uuidv4} from 'uuid'; import Immutable, {Immutable as ImmutableType} from 'seamless-immutable'; import {TERM_GROUP_EXIT, TERM_GROUP_RESIZE} from '../constants/term-groups'; import {SESSION_ADD, SESSION_SET_ACTIVE, SessionAddAction} from '../constants/sessions'; @@ -86,7 +86,7 @@ const splitGroup = (state: ImmutableType, action: SessionAddAction) // P -> / \ // G G const newSession = TermGroup({ - uid: uuid.v4(), + uid: uuidv4(), sessionUid: uid, parentUid: parentGroup.uid }); @@ -94,7 +94,7 @@ const splitGroup = (state: ImmutableType, action: SessionAddAction) state = state.setIn(['termGroups', newSession.uid], newSession); if (parentGroup.sessionUid) { const existingSession = TermGroup({ - uid: uuid.v4(), + uid: uuidv4(), sessionUid: parentGroup.sessionUid, parentUid: parentGroup.uid }); @@ -205,7 +205,7 @@ const reducer = (state = initialState, action: HyperActions) => { return setActiveGroup(state, action); } - const uid = uuid.v4(); + const uid = uuidv4(); const termGroup = TermGroup({ uid, sessionUid: action.uid diff --git a/package.json b/package.json index 7e8234dd..d624e81d 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "@types/seamless-immutable": "7.1.11", "@types/styled-jsx": "2.2.8", "@types/terser-webpack-plugin": "2.2.0", - "@types/uuid": "3.4.7", + "@types/uuid": "7.0.0", "@types/webpack": "4.41.7", "@types/winreg": "1.2.30", "@typescript-eslint/eslint-plugin": "2.21.0", diff --git a/yarn.lock b/yarn.lock index 64e47ffa..56f5bc4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -775,10 +775,10 @@ dependencies: source-map "^0.6.1" -"@types/uuid@3.4.7": - version "3.4.7" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-3.4.7.tgz#51d42247473bc00e38cc8dfaf70d936842a36c03" - integrity sha512-C2j2FWgQkF1ru12SjZJyMaTPxs/f6n90+5G5qNakBxKXjTBc/YTSelHh4Pz1HUDwxFXD9WvpQhOGCDC+/Y4mIQ== +"@types/uuid@7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-7.0.0.tgz#9f6993ccc8210efa90bda7e1afabbb06a9f860cd" + integrity sha512-RiX1I0lK9WFLFqy2xOxke396f0wKIzk5sAll0tL4J4XDYJXURI7JOs96XQb3nP+2gEpQ/LutBb66jgiT5oQshQ== "@types/webdriverio@^4.8.0": version "4.13.3"