Skip to content

chore: backport security and scaffolding improvements from audit#22

Merged
amrtgaber merged 4 commits into
mainfrom
chore/backport-from-audit
Apr 12, 2026
Merged

chore: backport security and scaffolding improvements from audit#22
amrtgaber merged 4 commits into
mainfrom
chore/backport-from-audit

Conversation

@amrtgaber
Copy link
Copy Markdown
Contributor

@amrtgaber amrtgaber commented Apr 12, 2026

Summary

Backports template-level fixes discovered during a security / analytics / legal audit across projects spawned from this template. Full plan in BACKPORT_FROM_AUDIT.md (templates root).

Changes

Security

  • fix(deps): vite ^8.0.0^8.0.8 for path traversal CVE (GHSA-4w7w-66w2-5vf9). Patch bump within same major.
  • index.html CSP: add form-action 'self', upgrade-insecure-requests, https: to img-src. Preserves existing connect-src 'self' http://localhost:* so first-run dev against a local API still works.
  • .github/workflows/ci.yml: add top-level permissions: contents: read (least-privilege GITHUB_TOKEN).

UX

  • Replace if (auth.isLoading) return null with an AppShellSkeleton that renders a nav + content placeholder during auth hydration. On cold-start backends (Cloud Run scale-to-zero, Railway cold) the blank-screen window was 5-15s; skeleton gives immediate shape feedback.
  • New src/components/ui/skeleton.tsx shadcn primitive (matches template's ComponentProps / data-slot style).

Scaffolding

  • .github/CODEOWNERS placeholder (* @amrtgaber) so spawned projects get review enforcement from day one.
  • .gitignore: add .playwright-mcp/ (MCP session debug logs).
  • src/vite-env.d.ts: type VITE_API_URL and VITE_LOG_LEVEL on ImportMetaEnv for autocomplete and typo detection.
  • New .env.example documenting standard env vars.

Not included

DataTable skeleton rows — no DataTable component exists in this template yet, so nothing to update. Worth revisiting if one gets added.

Test plan

  • pnpm lint — 0 errors (4 pre-existing warnings in src/routes/__root.tsx not introduced by this PR)
  • pnpm format:check — clean
  • pnpm tsc --noEmit — clean
  • pnpm test:run — 2/2 passing
  • pnpm build — clean with vite 8.0.8
  • Manual: spawn a fresh project from this branch and verify pnpm dev still works with local API backend
  • Manual: throttle network to 3G and verify AppShellSkeleton appears instead of blank screen

Addresses GHSA-4w7w-66w2-5vf9 in vite ^8.0.0. Patch-level bump
within the same major; no breaking changes to plugin surface.
Replace blank screen (auth.isLoading returning null) with a
nav + content skeleton. On cold-start backends (scale-to-zero,
Railway cold) the prior behavior showed an empty white screen
for 5-15s; the skeleton gives the user immediate shape feedback.
- CSP: add form-action, upgrade-insecure-requests, img-src https:
- CI: restrict GITHUB_TOKEN to contents:read (least privilege)
- Add .github/CODEOWNERS catch-all placeholder
- .gitignore: .playwright-mcp/ and local review screenshots
- vite-env.d.ts: type VITE_API_URL and VITE_LOG_LEVEL
- .env.example: document standard env vars for new projects
Mobile/tablet review screenshots aren't a common enough artifact
to warrant template-level gitignore entries. Keep .playwright-mcp/
since MCP session logs are tool-generated and ubiquitous.
@amrtgaber amrtgaber merged commit b5d0626 into main Apr 12, 2026
2 checks passed
@amrtgaber amrtgaber deleted the chore/backport-from-audit branch April 12, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant