From 305a9675b89b445da6ecee54ccf79b399612289b Mon Sep 17 00:00:00 2001 From: Horacio Herrera Date: Mon, 13 Nov 2023 13:14:09 +0100 Subject: [PATCH] add update package properly --- frontend/apps/desktop/package.json | 1 + frontend/apps/desktop/src/update.ts | 4 ++-- yarn.lock | 28 ++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/frontend/apps/desktop/package.json b/frontend/apps/desktop/package.json index 2a2f407b41..214c377d97 100644 --- a/frontend/apps/desktop/package.json +++ b/frontend/apps/desktop/package.json @@ -45,6 +45,7 @@ "react": "18.2.0", "react-dom": "18.2.0", "react-hot-toast": "2.4.1", + "update-electron-app": "^3.0.0", "zod": "3.22.2" }, "devDependencies": { diff --git a/frontend/apps/desktop/src/update.ts b/frontend/apps/desktop/src/update.ts index 25593110c7..7e5a08dabc 100644 --- a/frontend/apps/desktop/src/update.ts +++ b/frontend/apps/desktop/src/update.ts @@ -1,9 +1,9 @@ +import updateApp from 'update-electron-app' + export function setupUpdates() { // We delay this work by 1s to ensure that the // app doesn't have to worry about updating during launch setTimeout(() => { - const updateApp = require('update-electron-app') - updateApp({ repo: 'MintterHypermedia/mintter', updateInterval: '1 hour', diff --git a/yarn.lock b/yarn.lock index 611d109cf2..cd68b733ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4717,6 +4717,7 @@ __metadata: react-hot-toast: 2.4.1 react-native-web-lite: 1.74.21 tamagui: 1.74.21 + update-electron-app: ^3.0.0 vite: 4.4.9 vite-tsconfig-paths: 4.2.0 xvfb-maybe: 0.2.1 @@ -18665,6 +18666,15 @@ __metadata: languageName: node linkType: hard +"github-url-to-object@npm:^4.0.4": + version: 4.0.6 + resolution: "github-url-to-object@npm:4.0.6" + dependencies: + is-url: ^1.1.0 + checksum: 5056c1197cd496e2246217bc2626ab0d10a8dd293c834cb5301181db86282c312dc91831e331933c0b02e75716c87b1c13d8d202dc314d0d23cca0c38f1afb6f + languageName: node + linkType: hard + "glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -20829,6 +20839,13 @@ __metadata: languageName: node linkType: hard +"is-url@npm:^1.1.0, is-url@npm:^1.2.4": + version: 1.2.4 + resolution: "is-url@npm:1.2.4" + checksum: 100e74b3b1feab87a43ef7653736e88d997eb7bd32e71fd3ebc413e58c1cbe56269699c776aaea84244b0567f2a7d68dfaa512a062293ed2f9fdecb394148432 + languageName: node + linkType: hard + "is-utf8@npm:^0.2.0": version: 0.2.1 resolution: "is-utf8@npm:0.2.1" @@ -31417,6 +31434,17 @@ __metadata: languageName: node linkType: hard +"update-electron-app@npm:^3.0.0": + version: 3.0.0 + resolution: "update-electron-app@npm:3.0.0" + dependencies: + github-url-to-object: ^4.0.4 + is-url: ^1.2.4 + ms: ^2.1.1 + checksum: 17b8250a3d8e9b31318d715fd2033e044b3755a257cc941a04c4d3df895f36fe94eca3381e716a89abb0ebf38f51243819fdaa517f66c89094f0eca86141aa67 + languageName: node + linkType: hard + "update-notifier@npm:^2.1.0": version: 2.5.0 resolution: "update-notifier@npm:2.5.0"