From 91e4f5b43515671d0e2d414ecd86d2a6b1fcf2ea Mon Sep 17 00:00:00 2001 From: KaiserBh <41852205+KaiserBh@users.noreply.github.com> Date: Mon, 1 May 2023 07:43:13 +1000 Subject: [PATCH] feat(web): make PWA compatible with Vite (#793) * removed react-app type instead use vite. * removed index.html from public since vite uses it from root: read more: https://vitejs.dev/guide/#index-html-and-project-root * yarn.lock update. * added vite config file. With commented rollUp option if we want the build to be called build but using default stuff for now. * updated tsconfig to use vite and include vite.config.ts * changed package json build commands to use vite. * for some reason there is an error in vite config when we put project as tsconfig.json. * build.go updated to use the new dist folder. * refactored as well updated to use dist and web.AssetHandler again. * Fixed issue forcing the frontend to be reloaded for all routes to work if logged in fresh without reloading it will always go back to dashboard. * updated it to use the new function; need to fix the Index for baseUrl I believe, if enabled it works except logs route will crash due to cors. * refactored and default port to 7474, don't think we need the rollUpOptions. * added tmp/ to ignore . * init air.toml, for dev hot reloading both app and backend. https://github.com/cosmtrek/air run it using air but make sure it's in PATH * updated the start command to build and watch for changes, works great with air. * revert * added proxy for vite config. To be used for dev. * fix: This fixes #117 Propagation bug. * refactor: I think this should fix it, when logs route etc getting accessed usually it throws error but by getting rid of the catch-all it should work as intended, since web.RegisterHandler(r) will catch the unmatched ones. * Moved outside static, keep it in public root folder. * refactor to support the changes * Added support for PWA, autoinject which auto updates when there is new "version" instead of prompting user. * fix colour and added the assets. * chore: yarn lock and remove logos. * chore: remove logos, don't think we need em. * chore:added dist folder. --------- Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com> --- web/index.html | 12 +- web/package.json | 4 +- web/public/apple-touch-icon-ipad-76x76.png | Bin 0 -> 5537 bytes .../apple-touch-icon-ipad-retina-152x152.png | Bin 0 -> 12194 bytes web/public/apple-touch-icon-iphone-60x60.png | Bin 0 -> 4223 bytes ...apple-touch-icon-iphone-retina-120x120.png | Bin 0 -> 9316 bytes web/public/{static => }/favicon.ico | Bin web/public/{static => }/logo192.png | Bin web/public/{static => }/logo512.png | Bin web/public/{static => }/manifest.json | 0 web/public/{static => }/robots.txt | 0 web/vite.config.ts | 49 +- web/yarn.lock | 2271 ++++++++++++++++- 13 files changed, 2308 insertions(+), 28 deletions(-) create mode 100644 web/public/apple-touch-icon-ipad-76x76.png create mode 100644 web/public/apple-touch-icon-ipad-retina-152x152.png create mode 100644 web/public/apple-touch-icon-iphone-60x60.png create mode 100644 web/public/apple-touch-icon-iphone-retina-120x120.png rename web/public/{static => }/favicon.ico (100%) rename web/public/{static => }/logo192.png (100%) rename web/public/{static => }/logo512.png (100%) rename web/public/{static => }/manifest.json (100%) rename web/public/{static => }/robots.txt (100%) diff --git a/web/index.html b/web/index.html index 0ba259d..66a0e54 100644 --- a/web/index.html +++ b/web/index.html @@ -2,15 +2,19 @@ - + - + - - + + + + + + autobrr