pwa

tcmts.examples.reminders.pwa · #d6pl2ycu · ts file

// tcm: namespace reminders
// Reminders as an app to install: its web app manifest. `tcm build` finds it beside the app (`reminders.pwa`, in
// `reminders.App`'s namespace) and makes the app a PWA: the manifest, its icons, and a service worker that keeps the
// build on the device, so the app opens at once, online or not.
import { appicon, icon } from "#codebase/reminders";

/**
 * Reminders' web app manifest, as the spec has it, written as an object. Its icons are files of the codebase, used
 * like any definition: {@link icon} (an .svg, sharp at every size: the tab's) and {@link appicon} (a .png, 512×512:
 * the home screen's, iOS's included). The build reads each file's type and size, and keeps it by its content.
 * Shortcuts' URLs are the app's paths: `/` is the app, wherever it's served.
 */
export const pwa = {
  name: "Reminders",
  short_name: "Reminders",
  description: "Reminders that live on your device: they work offline, and nothing leaves it.",
  theme_color: "#f2f2f7",
  background_color: "#f2f2f7",
  icons: [
    { src: icon },
    { src: appicon },
    // (drawn edge to edge, with the picture in the middle: a home screen can cut it to its own shape)
    { src: appicon, purpose: "maskable" },
  ],
  shortcuts: [
    { name: "Today", url: "/today" },
    { name: "Flagged", url: "/flagged" },
  ],
};

used by