From fa79fecc9d8f5109f02b90800fd5f91ba7b81e04 Mon Sep 17 00:00:00 2001 From: Aine Date: Wed, 30 Oct 2024 17:58:33 +0200 Subject: [PATCH] Generate extended manifest.json on build --- public/manifest.json | 15 --------------- vite.config.ts | 29 +++++++++++++++++++++++++++-- yarn.lock | 4 ++-- 3 files changed, 29 insertions(+), 19 deletions(-) delete mode 100644 public/manifest.json diff --git a/public/manifest.json b/public/manifest.json deleted file mode 100644 index 139addd..0000000 --- a/public/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "short_name": "Synapse Admin", - "name": "Synapse Admin", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/vite.config.ts b/vite.config.ts index cb6b044..e8ec15c 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,10 +8,35 @@ export default defineConfig({ plugins: [ react(), vitePluginVersionMark({ + name: "Synapse Admin", command: "git describe --tags || git rev-parse --short HEAD", - ifMeta: true, - ifLog: true, + ifMeta: false, + ifLog: false, ifGlobal: true, + outputFile: (version) => ({ + path: "manifest.json", + content: JSON.stringify({ + name: "Synapse Admin", + version: version, + description: "Synapse Admin is an admin console for synapse Matrix homeserver with additional features.", + categories: ["productivity", "utilities"], + orientation: "landscape", + icons: [{ + src: "favicon.ico", + sizes: "32x32", + type: "image/x-icon" + },{ + src: "images/logo.webp", + sizes: "512x512", + type: "image/webp", + purpose: "any maskable" + }], + start_url: ".", + display: "standalone", + theme_color: "#000000", + background_color: "#ffffff" + }), + }), }), ], }); diff --git a/yarn.lock b/yarn.lock index f42df85..f0453aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4643,7 +4643,7 @@ ra-core@^4.11.2, ra-core@^4.16.2: react-is "^17.0.2" react-query "^3.32.1" -ra-core@^5.3.0, ra-core@^5.3.1: +ra-core@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/ra-core/-/ra-core-5.3.1.tgz#38773ae1cda386064010fc2774c204ccaf6bc325" integrity sha512-1q/h71iOco6kA9kkGNEmChuw+JgUTr+Y6MLfb/N0VcF75xX+v5SjoNMgHee/Jtn6uObOVeWdhAhIJ/bFwHR5sg== @@ -4667,7 +4667,7 @@ ra-i18n-polyglot@^5.3.0, ra-i18n-polyglot@^5.3.1: node-polyglot "^2.2.2" ra-core "^5.3.1" -ra-language-english@^5.3.0, ra-language-english@^5.3.1: +ra-language-english@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/ra-language-english/-/ra-language-english-5.3.1.tgz#823d25cbbf66ae9ba4098e087ae21110f4ffb030" integrity sha512-ttEVhRI06VPA0MEFmCkxQNFa3C4ztGHG14vRnfRtpQ3qSF996genzoYCW/AdkI/JzskHU1zAw5o73qezSdqCuA==