fix: clean production console CSP and source map noise

Merged
GR
4mo ago
+20-4

Summary

  • Disable production source maps for PWA and Admin Vite builds (removes DevTools CSP noise from *.map requests)
  • Always include favicon.png and app-icon.png in CSP img-src (assets plugin may write them after the CSP scan)
  • Add standard mobile-web-app-capable meta alongside the Apple-specific tag
  • Migrate remaining lit-element imports to lit / lit/decorators.js

Test plan

  • PL_PWA_URL=… PL_SERVER_URL=… pnpm --filter @padloc/pwa run build succeeds
  • Build output contains zero *.map files
  • Built index.html CSP img-src includes /favicon.png and /app-icon.png
  • Built HTML includes mobile-web-app-capable
  • Deploy and confirm browser console is clean on prod unlock page (no CSP map/favicon violations, no lit-element deprecation)

Summary by cubic

Clean up the production browser console by removing CSP and source map warnings in the PWA and Admin builds. Add the mobile-web-app-capable meta and finish migrating off lit-element.

  • Changes

    • Disable prod source maps for PWA/Admin Vite builds.
    • Always include favicon.png and app-icon.png in CSP img-src.
    • Add mobile-web-app-capable meta to PWA/Admin HTML.
    • Replace remaining lit-element imports with lit and lit/decorators.js (e.g., rich-input, tags-input).
  • Testing

    • pnpm --filter @padloc/pwa run build and pnpm --filter @padloc/admin run build succeed.
    • No *.map files in outputs; built HTML includes the new meta and CSP entries.
    • Follow-up: Deploy and verify the production unlock page console is clean (no CSP or deprecation warnings).

Summary by CodeRabbit

  • New Features
    • Added support for installing and launching the web app as a mobile application (mobile web app capability metadata added for both admin and PWA).
  • Bug Fixes
    • Improved favicon and app icon display by ensuring these icons are allowed under the app’s content security settings.
  • Improvements
    • Enhanced consistency and reliability across the admin and PWA experiences.