From 89e23c546b829d7ae47abbbdec045b8ee8a759e0 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 21 Aug 2023 13:03:48 +0200 Subject: [PATCH] degrade execa fixes #1673 --- package.json | 2 +- public/electron.js | 2 - public/ffmpeg.js | 9 +--- script/xcrun-wrapper.mjs | 2 +- yarn.lock | 88 +++++++++++++--------------------------- 5 files changed, 32 insertions(+), 71 deletions(-) diff --git a/package.json b/package.json index ee9963d7..996c9fd2 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "electron-is-dev": "^2.0.0", "electron-store": "5.1.1", "electron-unhandled": "^4.0.1", - "execa": "^7.1.1", + "execa": "5", "file-type": "16", "file-url": "^3.0.0", "fs-extra": "^8.1.0", diff --git a/public/electron.js b/public/electron.js index 30659fa2..93a21198 100644 --- a/public/electron.js +++ b/public/electron.js @@ -257,8 +257,6 @@ const readyPromise = app.whenReady(); (async () => { try { - await ffmpeg.whenImported; - logger.info('Initializing config store'); await configStore.init(); diff --git a/public/ffmpeg.js b/public/ffmpeg.js index 9598de08..2a4dca2f 100644 --- a/public/ffmpeg.js +++ b/public/ffmpeg.js @@ -2,16 +2,10 @@ const { join } = require('path'); const isDev = require('electron-is-dev'); const readline = require('readline'); const stringToStream = require('string-to-stream'); +const execa = require('execa'); const { platform, arch, isWindows, isMac, isLinux } = require('./util'); -const execaPromise = import('execa'); - -let execa; -execaPromise.then((execaNew) => { - ({ execa } = execaNew); -}).catch((err) => console.error(err)); - const runningFfmpegs = new Set(); // setInterval(() => console.log(runningFfmpegs.size), 1000); @@ -507,7 +501,6 @@ function encodeLiveRawStream({ path, inWidth, inHeight, seekTo, streamIndex }) { const runFfmpeg = async (...args) => runFfmpegProcess(...args); module.exports = { - whenImported: execaPromise, setCustomFfPath, abortFfmpegs, getFfmpegPath, diff --git a/script/xcrun-wrapper.mjs b/script/xcrun-wrapper.mjs index 18a6a5c4..c128ac19 100644 --- a/script/xcrun-wrapper.mjs +++ b/script/xcrun-wrapper.mjs @@ -1,4 +1,4 @@ -import { execa } from 'execa'; +import execa from 'execa'; import { readFile } from 'fs/promises'; // we need a wrapper script because altool tends to error out very often diff --git a/yarn.lock b/yarn.lock index 44e61bbe..c4545c9d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4327,20 +4327,20 @@ __metadata: languageName: node linkType: hard -"execa@npm:^7.1.1": - version: 7.1.1 - resolution: "execa@npm:7.1.1" +"execa@npm:5": + version: 5.1.1 + resolution: "execa@npm:5.1.1" dependencies: cross-spawn: ^7.0.3 - get-stream: ^6.0.1 - human-signals: ^4.3.0 - is-stream: ^3.0.0 + get-stream: ^6.0.0 + human-signals: ^2.1.0 + is-stream: ^2.0.0 merge-stream: ^2.0.0 - npm-run-path: ^5.1.0 - onetime: ^6.0.0 - signal-exit: ^3.0.7 - strip-final-newline: ^3.0.0 - checksum: 21fa46fc69314ace4068cf820142bdde5b643a5d89831c2c9349479c1555bff137a291b8e749e7efca36535e4e0a8c772c11008ca2e84d2cbd6ca141a3c8f937 + npm-run-path: ^4.0.1 + onetime: ^5.1.2 + signal-exit: ^3.0.3 + strip-final-newline: ^2.0.0 + checksum: fba9022c8c8c15ed862847e94c252b3d946036d7547af310e344a527e59021fd8b6bb0723883ea87044dc4f0201f949046993124a42ccb0855cae5bf8c786343 languageName: node linkType: hard @@ -4908,7 +4908,7 @@ __metadata: languageName: node linkType: hard -"get-stream@npm:^6.0.1": +"get-stream@npm:^6.0.0": version: 6.0.1 resolution: "get-stream@npm:6.0.1" checksum: e04ecece32c92eebf5b8c940f51468cd53554dcbb0ea725b2748be583c9523d00128137966afce410b9b051eb2ef16d657cd2b120ca8edafcf5a65e81af63cad @@ -5315,10 +5315,10 @@ __metadata: languageName: node linkType: hard -"human-signals@npm:^4.3.0": - version: 4.3.1 - resolution: "human-signals@npm:4.3.1" - checksum: 6f12958df3f21b6fdaf02d90896c271df00636a31e2bbea05bddf817a35c66b38a6fdac5863e2df85bd52f34958997f1f50350ff97249e1dff8452865d5235d1 +"human-signals@npm:^2.1.0": + version: 2.1.0 + resolution: "human-signals@npm:2.1.0" + checksum: b87fd89fce72391625271454e70f67fe405277415b48bcc0117ca73d31fa23a4241787afdc8d67f5a116cf37258c052f59ea82daffa72364d61351423848e3b8 languageName: node linkType: hard @@ -5868,13 +5868,6 @@ __metadata: languageName: node linkType: hard -"is-stream@npm:^3.0.0": - version: 3.0.0 - resolution: "is-stream@npm:3.0.0" - checksum: 172093fe99119ffd07611ab6d1bcccfe8bc4aa80d864b15f43e63e54b7abc71e779acd69afdb854c4e2a67fdc16ae710e370eda40088d1cfc956a50ed82d8f16 - languageName: node - linkType: hard - "is-string@npm:^1.0.5, is-string@npm:^1.0.7": version: 1.0.7 resolution: "is-string@npm:1.0.7" @@ -6448,7 +6441,7 @@ __metadata: eslint-plugin-react: ^7.28.0 eslint-plugin-react-hooks: ^4.3.0 evergreen-ui: ^6.13.1 - execa: ^7.1.1 + execa: 5 fast-xml-parser: ^4.2.5 file-type: 16 file-url: ^3.0.0 @@ -6688,13 +6681,6 @@ __metadata: languageName: node linkType: hard -"mimic-fn@npm:^4.0.0": - version: 4.0.0 - resolution: "mimic-fn@npm:4.0.0" - checksum: 995dcece15ee29aa16e188de6633d43a3db4611bcf93620e7e62109ec41c79c0f34277165b8ce5e361205049766e371851264c21ac64ca35499acb5421c2ba56 - languageName: node - linkType: hard - "mimic-response@npm:^1.0.0": version: 1.0.1 resolution: "mimic-response@npm:1.0.1" @@ -7096,12 +7082,12 @@ __metadata: languageName: node linkType: hard -"npm-run-path@npm:^5.1.0": - version: 5.1.0 - resolution: "npm-run-path@npm:5.1.0" +"npm-run-path@npm:^4.0.1": + version: 4.0.1 + resolution: "npm-run-path@npm:4.0.1" dependencies: - path-key: ^4.0.0 - checksum: dc184eb5ec239d6a2b990b43236845332ef12f4e0beaa9701de724aa797fe40b6bbd0157fb7639d24d3ab13f5d5cf22d223a19c6300846b8126f335f788bee66 + path-key: ^3.0.0 + checksum: 5374c0cea4b0bbfdfae62da7bbdf1e1558d338335f4cacf2515c282ff358ff27b2ecb91ffa5330a8b14390ac66a1e146e10700440c1ab868208430f56b5f4d23 languageName: node linkType: hard @@ -7239,7 +7225,7 @@ __metadata: languageName: node linkType: hard -"onetime@npm:^5.1.0": +"onetime@npm:^5.1.0, onetime@npm:^5.1.2": version: 5.1.2 resolution: "onetime@npm:5.1.2" dependencies: @@ -7248,15 +7234,6 @@ __metadata: languageName: node linkType: hard -"onetime@npm:^6.0.0": - version: 6.0.0 - resolution: "onetime@npm:6.0.0" - dependencies: - mimic-fn: ^4.0.0 - checksum: 0846ce78e440841335d4e9182ef69d5762e9f38aa7499b19f42ea1c4cd40f0b4446094c455c713f9adac3f4ae86f613bb5e30c99e52652764d06a89f709b3788 - languageName: node - linkType: hard - "open@npm:^7.4.2": version: 7.4.2 resolution: "open@npm:7.4.2" @@ -7509,20 +7486,13 @@ __metadata: languageName: node linkType: hard -"path-key@npm:^3.1.0": +"path-key@npm:^3.0.0, path-key@npm:^3.1.0": version: 3.1.1 resolution: "path-key@npm:3.1.1" checksum: 55cd7a9dd4b343412a8386a743f9c746ef196e57c823d90ca3ab917f90ab9f13dd0ded27252ba49dbdfcab2b091d998bc446f6220cd3cea65db407502a740020 languageName: node linkType: hard -"path-key@npm:^4.0.0": - version: 4.0.0 - resolution: "path-key@npm:4.0.0" - checksum: 8e6c314ae6d16b83e93032c61020129f6f4484590a777eed709c4a01b50e498822b00f76ceaf94bc64dbd90b327df56ceadce27da3d83393790f1219e07721d7 - languageName: node - linkType: hard - "path-parse@npm:^1.0.6, path-parse@npm:^1.0.7": version: 1.0.7 resolution: "path-parse@npm:1.0.7" @@ -8704,7 +8674,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^3.0.7": +"signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" checksum: a2f098f247adc367dffc27845853e9959b9e88b01cb301658cfe4194352d8d2bb32e18467c786a7fe15f1d44b233ea35633d076d5e737870b7139949d1ab6318 @@ -9155,10 +9125,10 @@ __metadata: languageName: node linkType: hard -"strip-final-newline@npm:^3.0.0": - version: 3.0.0 - resolution: "strip-final-newline@npm:3.0.0" - checksum: 23ee263adfa2070cd0f23d1ac14e2ed2f000c9b44229aec9c799f1367ec001478469560abefd00c5c99ee6f0b31c137d53ec6029c53e9f32a93804e18c201050 +"strip-final-newline@npm:^2.0.0": + version: 2.0.0 + resolution: "strip-final-newline@npm:2.0.0" + checksum: 69412b5e25731e1938184b5d489c32e340605bb611d6140344abc3421b7f3c6f9984b21dff296dfcf056681b82caa3bb4cc996a965ce37bcfad663e92eae9c64 languageName: node linkType: hard