Commands
These commands are examples to put in a real app repo. This learn run did not execute package installs or mutate _repos/.
Development
| Task | Example |
|---|---|
| Start dev server | npm run dev |
| Build production assets | npm run build |
| Preview production build | npm run preview |
| Run unit tests | npm test |
| Run browser tests | npx playwright test |
Browser And PWA Checks
| Check | Command or action |
|---|---|
| Serve over HTTPS | Use production preview, localhost exception, or a trusted local cert |
| Inspect manifest | Chrome DevTools, Application, Manifest |
| Inspect service worker | Chrome DevTools, Application, Service workers |
| Inspect caches | Chrome DevTools, Application, Cache storage |
| Inspect IndexedDB | Chrome DevTools, Application, IndexedDB |
| Simulate offline manually | Chrome DevTools, Application or Network offline mode |
| Test offline in automation | Playwright context.setOffline(true) or test option offline: true |
Playwright Examples
import { test, expect } from '@playwright/test';
test.use({
serviceWorkers: 'allow',
});
test('loads the cached app shell while offline', async ({ context, page }) => {
await page.goto('/');
await expect(page.getByRole('heading', { name: /ledger/i })).toBeVisible();
await context.setOffline(true);
await page.reload();
await expect(page.getByText(/offline/i)).toBeVisible();
});
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
permissions: ['notifications'],
serviceWorkers: 'allow',
},
});
Gotcha: Playwright request interception does not see requests already intercepted by a service worker. Use
serviceWorkers: 'block'when testing network routing logic, andserviceWorkers: 'allow'when testing PWA behavior.
Store Packaging Commands
Do not add these until the browser PWA already works:
| Target | Typical tool | Gate before use |
|---|---|---|
| Microsoft Store | PWABuilder package | Partner Center account, package identity, manifest metadata |
| Android Play Store | Bubblewrap or PWABuilder TWA | Digital Asset Links, signing key, Play policy check |
| iOS App Store | Native wrapper or WKWebView-based shell | Apple review policy and native value check |