feat: TypeScript client + goatcounter-stats web component #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/ts-client"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements the
ts-clientOpenSpec change — operator decision wth: headless client + web component as ONE deliverable, contract-locked, in this repo.@byteflavour/goatcounter-stats-client): typed fetchSummary/fetchPages/fetchOpenApi, Result values instead of exceptions, gateway error codes passed through, network/shape failures classified. Zero runtime dependencies, ESM + d.ts.<goatcounter-stats>(…/element): shadow-DOM custom element (total, CSS-bar chart, top pages),data-statelifecycle, styleable via--gcs-*custom properties and named parts — plain HTML, Vue, React, Angular, no adapters.openapi.jsonand asserts path coverage, period/error-code enum equality, and required-field lists. Server and client are now gated on the same snapshot from both sides.packages.ts-client,checks.ts-build,checks.ts-testin the gate.network; bad period →invalid_period..forgejo/pull_request_template.md— this PR is the last one whose creation 404-bursts (fj short-circuits on the first template path from now on).Full
nix flake checkgreen including the new checks.🤖 Generated with Claude Code
https://claude.ai/code/session_01T5j3dAJVcUjZv9k76sRTt9
Headless zero-dependency client (Result-typed, error classification) and a shadow-DOM custom element styleable via custom properties + parts. 18 bun tests incl. a contract-coupling suite asserting types/paths/enums against the committed openapi.json — the client-side half of the snapshot gate. Hermetic toolchain from nixpkgs (tsc build, bun test), no node_modules. packages.ts-client + checks.{ts-build,ts-test}; guarded npm publish in the release workflow (version stamped from tag). Book chapter, demo page, PR template (ends the forgejo-cli 404 burst). Live-verified against dev-goatcounter + gateway: summary/pages typed end-to-end, dead-gateway and invalid-period classified correctly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T5j3dAJVcUjZv9k76sRTt9