Skip to content

Kody is live

Watch the launch video — what Kody is, and why it exists.

← 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-fetch/STARTER.md

40 lines · 1.5 KB · Markdown

Starter template (inside package-app-kit)

This directory is the app starter. Prefer kody:@kentcdodds/package-app-kit/create-package-app (with dryRun first).

Layout (platform recipe)

src/app.ts              # Worker entry (kody.app.entry)
src/client/index.ts     # Browser entry (kody.app.client)
public/sw.js            # Assets SW (kody.app.assets) — uses __version.json
src/app/page.ts         # HTML shell (stamps data-client-module / data-pak-config)

package.json declares:

"app": {
  "entry": "./src/app.ts",
  "client": { "entry": "./src/client/index.ts", "externals": ["@remix-run/ui"] },
  "assets": "./public"
}

Worker and client are separate graphs — never import the client entry from the Worker.

Dual-path until Cole #2284 is on every host

When packageContext.clientModuleUrl is non-null, HTML loads that module and SW registers from ${assetBasePath}/sw.js. When null (older platform), HTML falls back to kit-served /client/boot.js and Worker /sw.js.

Scaffolder contract

  1. Copy starter/ into a new Artifacts package.
  2. Rename placeholders: __PACKAGE_NAME__, __PACKAGE_ID__, __APP_TITLE__, __CACHE_NAME__, __KODY_DESCRIPTION__.
  3. Rename *.template.* → final names.
  4. Do not copy this kit's demo src/app.ts.

Icons

Serve kit ./icons at /icons/icon-192.png and /icons/icon-512.png (or copy PNGs under public/ and point the manifest there). Empty icons: [] is not installable from Chromium URL-bar Install.