From d0077fb81a0b6f873554b489ef1bde05702886e4 Mon Sep 17 00:00:00 2001 From: Mateo Miccino Date: Thu, 9 Feb 2023 10:36:50 -0300 Subject: [PATCH] refactor: consume explorer from new desktop artifacts (#147) * refactor: consume from @dcl/explorer instead of @dcl/explorer-desktop * increase version * fix --- README.md | 2 +- electron/updater.ts | 15 ++++++--------- electron/window.ts | 2 +- package-lock.json | 4 ++-- package.json | 4 ++-- public/index.html | 18 ++++-------------- 6 files changed, 16 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 77aa9d3..d9230d8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Decentraland Explorer Desktop Launcher -A launcher to auto update the `explorer-desktop` (https://github.com/decentraland/explorer-desktop) +A launcher to auto update the `unity-renderer` (https://github.com/decentraland/unity-renderer) ## Available Scripts diff --git a/electron/updater.ts b/electron/updater.ts index 025d23c..2e655da 100644 --- a/electron/updater.ts +++ b/electron/updater.ts @@ -38,7 +38,7 @@ const getRemoteVersion = async (launcherPaths: LauncherPaths) => { 'x-debug-rollouts': true } }) - return response.data.map['@dcl/explorer-desktop'].version + return response.data.map['@dcl/explorer'].version } } else { // Dev @@ -52,12 +52,12 @@ const getRemoteVersion = async (launcherPaths: LauncherPaths) => { } const isValidVersion = (version: string) => { + const versionRegex = /commit-[0-9a-f]{7}$/g if (isUsingRollout()) { - const regex = /commit-[0-9a-f]{7}$/g - return version.match(regex) + return version.match(versionRegex) } else { const regex = /[0-9a-f]{40}/g - return version.match(regex) + return version.match(regex) || version.match(versionRegex) } } @@ -88,10 +88,7 @@ const registerVersionEvent = (launcherPaths: LauncherPaths) => { ? JSON.stringify(`dev-desktop-${main.config.desktopBranch}.commit-${remoteVersion.substring(0, 7)}`) : JSON.stringify(`desktop-${remoteVersion}`) - await event.sender.executeJavaScript(`globalThis.ROLLOUTS['@dcl/unity-renderer']['version'] = ${desktopVersion};`) - await event.sender.executeJavaScript( - `globalThis.ROLLOUTS['@dcl/explorer-desktop'] = { 'version': ${desktopVersion} };` - ) + await event.sender.executeJavaScript(`globalThis.ROLLOUTS['@dcl/explorer'] = { 'version': ${desktopVersion} };`) } }) } @@ -210,7 +207,7 @@ const registerExecuteProcessEvent = (rendererPath: string, executablePath: strin const getArtifactUrl = (launcherPaths: LauncherPaths) => { if (isUsingRollout()) { // Rollout - const baseUrl = 'https://cdn.decentraland.org/@dcl/explorer-desktop/' + const baseUrl = 'https://renderer-artifacts.decentraland.org/release-desktop/' return `${baseUrl}${encodeURIComponent(remoteVersion)}/${encodeURIComponent(launcherPaths.artifactUrl)}` } else { // Dev diff --git a/electron/window.ts b/electron/window.ts index acf1c77..b4f2fb2 100644 --- a/electron/window.ts +++ b/electron/window.ts @@ -131,7 +131,7 @@ export const loadDecentralandWeb = async (win: BrowserWindow) => { if (main.isDefaultWeb) await showLoading(win) const stage = main.config.developerMode ? 'zone' : 'org' - const url = new URL(main.config.customUrl || `http://play.decentraland.${stage}/?renderer-version=loading`) + const url = new URL(main.config.customUrl || `http://play.decentraland.${stage}/?`) const customParamObj = new URLSearchParams(main.config.customParams) for (const [key, value] of Array.from(customParamObj.entries())) { diff --git a/package-lock.json b/package-lock.json index d3418cc..6c4b1d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "explorer-desktop-launcher", - "version": "0.1.44", + "version": "0.1.46", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "explorer-desktop-launcher", - "version": "0.1.44", + "version": "0.1.46", "hasInstallScript": true, "dependencies": { "axios": "^1.2.2", diff --git a/package.json b/package.json index d924e7b..31bb3dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "explorer-desktop-launcher", - "version": "0.1.45", + "version": "0.1.46", "author": "decentraland", "description": "Decentraland Desktop Launcher", "homepage": ".", @@ -142,4 +142,4 @@ "last 1 safari version" ] } -} +} \ No newline at end of file diff --git a/public/index.html b/public/index.html index edd21cb..c51cc79 100644 --- a/public/index.html +++ b/public/index.html @@ -94,12 +94,8 @@