Skip to content
← Public packages

@kentcdodds/package-app-kit

Design tokens, PWA install/update, About/version, cache helpers, and optional realtime notes sync for Kody package apps.

FollowFork

starter-tanstack/app/controllers/manifest.ts

22 lines · 726 B · TypeScript
import { packageContext } from 'kody:runtime'
import { buildWebManifest } from 'kody:@kentcdodds/package-app-kit/sw'
import { starterManifestIcons } from '../../src/icon-png-bytes.ts'

export async function manifest() {
	const appBasePath = packageContext?.appBasePath ?? ''
	const body = buildWebManifest({
		appBasePath,
		name: '__APP_TITLE__',
		shortName: '__APP_TITLE__',
		description: 'Scaffolded from @kentcdodds/package-app-kit starter-tanstack/.',
		themeColor: '#0a0a0a',
		backgroundColor: '#0a0a0a',
		icons: starterManifestIcons(appBasePath),
	})
	return new Response(JSON.stringify(body), {
		headers: {
			'content-type': 'application/manifest+json; charset=utf-8',
			'cache-control': 'no-store',
		},
	})
}