From ae2f9c6332b910c3d22cb5f74e519a7cd8a3de9e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 24 Sep 2020 11:15:15 +0200 Subject: [PATCH] extract manifest out of build script and have both (non)-maskable icons also make PWA standalone instead of fullscreen as that doesn't seem to play well with the onscreen keyboard on mobile --- icon.png => assets/icon-maskable.png | Bin icon.svg => assets/icon-maskable.svg | 0 assets/icon.png | Bin 0 -> 15862 bytes assets/icon.svg | 4 +++ assets/manifest.json | 12 +++++++ scripts/build.mjs | 49 ++++++++++----------------- 6 files changed, 34 insertions(+), 31 deletions(-) rename icon.png => assets/icon-maskable.png (100%) rename icon.svg => assets/icon-maskable.svg (100%) create mode 100644 assets/icon.png create mode 100644 assets/icon.svg create mode 100644 assets/manifest.json diff --git a/icon.png b/assets/icon-maskable.png similarity index 100% rename from icon.png rename to assets/icon-maskable.png diff --git a/icon.svg b/assets/icon-maskable.svg similarity index 100% rename from icon.svg rename to assets/icon-maskable.svg diff --git a/assets/icon.png b/assets/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b6c70c00a4957f34bda8d23ef1dd258f074f8764 GIT binary patch literal 15862 zcmdUW^;=Zk_x2eE29TDN4gu+*m2zlM5Tpe`IwYkPgdwCs5R{Vc5Tu5N0SW0wx{;FZ zeh<&*`%k<-3|!aDK6|gT_u8xOdxfgMP$alVeGdQt0%avR4FG^3?>;y%@SE(;s%G#X zu9MO$7XTpqb@zdEI_8^$Up{b^*K^f$v~=|_akcE3Sr$wQkjiOP;RWPuc9rAWqmai|294;jDZd0&!62Qc3A zuk6c4?=Ph5S%1mJVbDlV(>Ha<+L zI-T+wxO|@~wI)G7P~T+3ewosEGGz;q!C?v{{{Q3874{?{V_-a+L|ozK1H+dPAWo5h zQh}rYP^WOm3Rv$yJT`I;)WAf5z#I+?*3eGed>N}$q>MjB6u6H`kDdDt=zvHN z$}IyC*y=Dwu~w!F$lN`3QKSR2Yk*BStQj&$gL%zo+F-Qsn~O8^P0zT9gV43$y+sil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uSqRN|4}Md2lvFA#j5A{4cR!9R-0d% z%TnYMmKMo$Em;8!yn8* zRge{6qtgH%iU>Ekw{(J~e+WxKe%*&zh4e!5@KZO~0jaXdecMzVd2GK8b>vgb^eF|l zfKO-2m&J3ozzX+zG^H?xRCKwh%kL0KLXp60f=3geVICE($Ikx zuInK=P8&-|!m z92Y9jXC(8{8FTe7le?$;S+1n-8t?w=z!1hp+nre-^7AueA$@-(QLN>%GgQ$joP8Do z%AQNj`sn>jvK!zD0^3QbQmg3^&YVbr>6kVHe4sKS!n#EFU7ipkI_N=+kk7p z-eV;BCx886gQusTokugBlELX3|0DT+I_1j$T;B1HF$rTK0A=<*Y@eFs2c{W0NAW+S z7%xuv8ePa>G>p+Z11!hhhUh3F&()d5zWd2S8Ysau48^<(kx-KZH(&s{J}L2?{qnxc zn=(2T98i+x;ewaKb(;aykMRRf1T_bY!4IGr2A qfVzsY#sho9|9{$wab70fFboWBRw7m9=)sZ(pe+AFu0+Pz|Nj9m=!OOW literal 0 HcmV?d00001 diff --git a/assets/icon.svg b/assets/icon.svg new file mode 100644 index 00000000..134a3f7e --- /dev/null +++ b/assets/icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/manifest.json b/assets/manifest.json new file mode 100644 index 00000000..01728ff9 --- /dev/null +++ b/assets/manifest.json @@ -0,0 +1,12 @@ +{ + "name": "Hydrogen", + "short_name": "Hydrogen", + "display": "standalone", + "description": "Lightweight matrix client with legacy and mobile browser support", + "start_url": "index.html", + "icons": [ + {"src": "assets/icon.png", "sizes": "384x384", "type": "image/png"}, + {"src": "assets/icon-maskable.png", "sizes": "384x384", "type": "image/png", "purpose": "maskable"} + ], + "theme_color": "#0DBD8B" +} diff --git a/scripts/build.mjs b/scripts/build.mjs index c2909283..e3006349 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -93,16 +93,9 @@ async function build() { const cssBundlePaths = await buildCssBundles(legacy ? buildCssLegacy : buildCss, themes, themeAssets); let manifestPath; - // copy icons - let iconPng = await fs.readFile(path.join(projectDir, "icon.png")); - let iconPngPath = resource("icon.png", iconPng); - await fs.writeFile(iconPngPath, iconPng); - let iconSvg = await fs.readFile(path.join(projectDir, "icon.svg")); - let iconSvgPath = resource("icon.svg", iconSvg); - await fs.writeFile(iconSvgPath, iconSvg); const assetPaths = createAssetPaths(jsBundlePath, jsLegacyBundlePath, jsWorkerPath, - iconPngPath, iconSvgPath, cssBundlePaths, themeAssets); + cssBundlePaths, themeAssets); if (offline) { manifestPath = await buildOffline(version, assetPaths); @@ -112,13 +105,14 @@ async function build() { console.log(`built ${PROJECT_ID} ${version} successfully`); } -function createAssetPaths(jsBundlePath, jsLegacyBundlePath, jsWorkerPath, iconPngPath, iconSvgPath, cssBundlePaths, themeAssets) { - function trim(path) { - if (!path.startsWith(targetDir)) { - throw new Error("invalid target path: " + targetDir); - } - return path.substr(targetDir.length); +function trim(path) { + if (!path.startsWith(targetDir)) { + throw new Error("invalid target path: " + targetDir); } + return path.substr(targetDir.length); +} + +function createAssetPaths(jsBundlePath, jsLegacyBundlePath, jsWorkerPath, cssBundlePaths, themeAssets) { return { jsBundle: () => trim(jsBundlePath), jsLegacyBundle: () => trim(jsLegacyBundlePath), @@ -127,8 +121,6 @@ function createAssetPaths(jsBundlePath, jsLegacyBundlePath, jsWorkerPath, iconPn cssThemeBundle: themeName => trim(cssBundlePaths.themes[themeName]), cssThemeBundles: () => Object.values(cssBundlePaths.themes).map(a => trim(a)), otherAssets: () => Object.values(themeAssets).map(a => trim(a)), - iconSvgPath: () => trim(iconSvgPath), - iconPngPath: () => trim(iconPngPath), }; } @@ -263,13 +255,20 @@ function buildWorkerJsLegacy(inputFile, outputName) { } async function buildOffline(version, assetPaths) { + // write web manifest + const webManifest = JSON.parse(await fs.readFile(path.join(projectDir, "assets/manifest.json"), "utf8")); + for (const icon of webManifest.icons) { + let iconData = await fs.readFile(path.join(projectDir, icon.src)); + let iconPath = resource(path.basename(icon.src), iconData); + await fs.writeFile(iconPath, iconData); + icon.src = trim(iconPath); + } // write offline availability const offlineFiles = [ assetPaths.cssMainBundle(), "index.html", - assetPaths.iconPngPath(), - assetPaths.iconSvgPath(), - ].concat(assetPaths.cssThemeBundles()); + ].concat(assetPaths.cssThemeBundles()) + .concat(webManifest.icons.map(i => i.src)); // write appcache manifest const appCacheLines = [ @@ -289,18 +288,6 @@ async function buildOffline(version, assetPaths) { swSource = swSource.replace(`"%%OFFLINE_FILES%%"`, JSON.stringify(swOfflineFiles)); swSource = swSource.replace(`"%%CACHE_FILES%%"`, JSON.stringify(assetPaths.otherAssets())); await fs.writeFile(path.join(targetDir, "sw.js"), swSource, "utf8"); - // write web manifest - const webManifest = { - name:PROJECT_NAME, - short_name: PROJECT_SHORT_NAME, - display: "fullscreen", - start_url: "index.html", - icons: [ - {"src": assetPaths.iconPngPath(), "sizes": "384x384", "type": "image/png"}, - {"src": assetPaths.iconSvgPath(), "type": "image/svg+xml"}, - ], - theme_color: "#0DBD8B" - }; const manifestJson = JSON.stringify(webManifest); const manifestPath = resource("manifest.json", manifestJson); await fs.writeFile(manifestPath, manifestJson, "utf8");