From 088070aafcccb9d08116d626aa605d2321d88af0 Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Sun, 30 Oct 2022 15:57:38 -0400 Subject: [PATCH 1/3] feat: implement widevine cdm --- package-lock.json | 13 ++++++------- package.json | 2 +- scripts/build-windows.ps1 | 2 +- src/index.ts | 6 ++++++ 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index d018840afe..4d974efa05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -134,7 +134,7 @@ "concurrently": "7.4.0", "cross-env": "7.0.3", "dotenv": "16.0.3", - "electron": "21.2.0", + "electron": "github:castlabs/electron-releases#v21.2.0+wvcus", "electron-builder": "23.6.0", "eslint": "8.25.0", "eslint-config-airbnb": "19.0.4", @@ -10145,11 +10145,11 @@ } }, "node_modules/electron": { - "version": "21.2.0", - "resolved": "https://registry.npmjs.org/electron/-/electron-21.2.0.tgz", - "integrity": "sha512-oKV4fo8l6jlOZ1cYZ4RpZz02ZxLuBo3SO7DH+FrJ8uDyCirP+eVJ/qlzu23odtNe0P7S/mYAZbC6abZHWoqtLg==", + "version": "20.0.0+wvcus", + "resolved": "git+ssh://git@github.com/castlabs/electron-releases.git#94a7d29db760c51944c9d7b40872b6b9c6564ede", "dev": true, "hasInstallScript": true, + "license": "MIT", "dependencies": { "@electron/get": "^1.14.1", "@types/node": "^16.11.26", @@ -35099,10 +35099,9 @@ } }, "electron": { - "version": "21.2.0", - "resolved": "https://registry.npmjs.org/electron/-/electron-21.2.0.tgz", - "integrity": "sha512-oKV4fo8l6jlOZ1cYZ4RpZz02ZxLuBo3SO7DH+FrJ8uDyCirP+eVJ/qlzu23odtNe0P7S/mYAZbC6abZHWoqtLg==", + "version": "git+ssh://git@github.com/castlabs/electron-releases.git#94a7d29db760c51944c9d7b40872b6b9c6564ede", "dev": true, + "from": "electron@github:castlabs/electron-releases#v21.2.0+wvcus", "requires": { "@electron/get": "^1.14.1", "@types/node": "^16.11.26", diff --git a/package.json b/package.json index 64127df2d7..df7cc073cb 100644 --- a/package.json +++ b/package.json @@ -169,7 +169,7 @@ "concurrently": "7.4.0", "cross-env": "7.0.3", "dotenv": "16.0.3", - "electron": "21.2.0", + "electron": "github:castlabs/electron-releases#v21.2.0+wvcus", "electron-builder": "23.6.0", "eslint": "8.25.0", "eslint-config-airbnb": "19.0.4", diff --git a/scripts/build-windows.ps1 b/scripts/build-windows.ps1 index d0c394647e..9d78f763d9 100644 --- a/scripts/build-windows.ps1 +++ b/scripts/build-windows.ps1 @@ -170,7 +170,7 @@ else Write-Host "*************** Building recipes ***************" # Note: 'recipes' is already using only pnpm - can switch to $BASE_CMD AFTER both repos are using pnpm Push-Location recipes -pnpm i && pnpm lint && pnpm reformat-files && pnpm package +pnpm i; pnpm lint; pnpm reformat-files; pnpm package Pop-Location # ----------------------------------------------------------------------------- diff --git a/src/index.ts b/src/index.ts index 97c77d1859..710d59ee26 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,7 @@ import { app, BrowserWindow, + components, globalShortcut, ipcMain, session, @@ -417,6 +418,11 @@ const createWindow = () => { trayIcon._toggleWindow(); }); } + + while (!components.whenReady()) { + debug('components status:', components.status()); + } + debug('components ready:', components.status()); }); }; From dd922051937b5c3975adf0a1ca4b772b0a5687a3 Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Sun, 30 Oct 2022 17:48:42 -0400 Subject: [PATCH 2/3] fix: async await components.whenReady() --- src/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 710d59ee26..224f6b7cab 100644 --- a/src/index.ts +++ b/src/index.ts @@ -406,7 +406,7 @@ const createWindow = () => { mainWindow.show(); } - app.whenReady().then(() => { + app.whenReady().then(async () => { if ( retrieveSettingValue( 'enableGlobalHideShortcut', @@ -419,9 +419,7 @@ const createWindow = () => { }); } - while (!components.whenReady()) { - debug('components status:', components.status()); - } + await components.whenReady(); debug('components ready:', components.status()); }); }; From afd1288274e4b16e3a485035b7ed2dd7312c03a8 Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Sun, 30 Oct 2022 17:50:44 -0400 Subject: [PATCH 3/3] revert: undo changes to Windows build script --- scripts/build-windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-windows.ps1 b/scripts/build-windows.ps1 index 9d78f763d9..d0c394647e 100644 --- a/scripts/build-windows.ps1 +++ b/scripts/build-windows.ps1 @@ -170,7 +170,7 @@ else Write-Host "*************** Building recipes ***************" # Note: 'recipes' is already using only pnpm - can switch to $BASE_CMD AFTER both repos are using pnpm Push-Location recipes -pnpm i; pnpm lint; pnpm reformat-files; pnpm package +pnpm i && pnpm lint && pnpm reformat-files && pnpm package Pop-Location # -----------------------------------------------------------------------------