← Public packages
@kentcdodds/package-app-kit
Design tokens, PWA install/update, About/version, cache helpers, and optional realtime notes sync for Kody package apps.
starter-remix/app/controllers/manifest.ts
27 lines · 952 B · TypeScriptimport type { BuildAction } from 'remix/router'
import { KodyRuntime } from 'kody:runtime'
import { buildWebManifest } from 'kody:@kentcdodds/package-app-kit/sw'
import { defaultManifestIcons } from 'kody:@kentcdodds/package-app-kit/icons'
import { routes } from '../routes.ts'
export default {
async handler(context) {
const { packageContext } = context.get(KodyRuntime)
const appBasePath = packageContext?.appBasePath ?? ''
const body = buildWebManifest({
appBasePath,
name: '__APP_TITLE__',
shortName: '__APP_TITLE__',
description: 'Scaffolded from @kentcdodds/package-app-kit starter-remix/.',
themeColor: '#0a0a0a',
backgroundColor: '#0a0a0a',
icons: defaultManifestIcons(appBasePath),
})
return new Response(JSON.stringify(body), {
headers: {
'content-type': 'application/manifest+json; charset=utf-8',
'cache-control': 'no-store',
},
})
},
} satisfies BuildAction<'ANY', typeof routes.manifest>