/tools/peepless/docs/changelog/Appendix C of FChangelogDaybook of peepless 1.0.0-rc.2Days kept in UTC
C
Appendix C · rendered from CHANGELOG.mdCHANGELOG.md on GitHub

Changelog

1.0.0-rc.2

The second release candidate, under next. One addition, so Matt's portfolio sub-sites can run it before 1.0:

  • base (and data-base): the path an app lives under when it shares its host with another, such as example.com/tools/x/ beside example.com/. A page reached from the same host but outside base now counts as a visit, with that hostname as its referrer, so a click from the main site into the tool is counted. Without base, nothing changes. The beacon sends nothing new.

1.0.0-rc.1

The release candidate for 1.0, on npm under the next tag (npm install peepless@next). It runs on real apps for two weeks; if nothing needs to break, it becomes 1.0.0 with one change: the starters import peepless@1. No code changes from 0.5.0.

  • docs/semver.md: what 1.0 promises for the exports, the beacon, the counter names, the tables and the bot and source lists.
  • docs/migrating.md: every breaking change since 0.1, in one place.
  • Prereleases publish under next, so npm install peepless keeps getting the last release.

0.5.0

0.5 is the site: mattblack.space/tools/peepless. Nothing in the package's API changes.

  • The reference is generated: the HTTP half from openapi.yaml (with every replayed example and what it counts), the functions from the package's own source and doc comments. The counters page is docs/counters.md.
  • The site counts itself with peepless and shows its own last 30 days on a public stats page, from a small endpoint on readCounts and summarize that folds countries with fewer than 10 visits into "others".
  • homepage in package.json points at the site.
  • The CHANGELOG, README, llms.txt and SECURITY.md open on the site as appendices.
  • Fixed: the client keeps its engaged-visit state per project, so two apps on one origin (example.com/ and example.com/tools/x/) no longer share it and miss each other's human.

0.4.0

0.4 runs anywhere, for real.

Breaking

  • Node 20 or later (engines.node is >=20). 18 is past end of life and wasn't tested.

Added

  • postgresStore(query) for any Postgres, given a function that runs SQL (pg, postgres.js, Neon), and its migration starters/postgres/0001_peepless.sql.
  • d1Store(db) for Cloudflare D1, its migration and a Cloudflare Workers starter (starters/cloudflare/).
  • A SvelteKit starter. Every starter is now typechecked in CI against the package's own types.
  • peepless/testing: testStore(makeStore) checks a store keeps the store contract. All four built-in stores pass it in CI against real databases (PGlite, Miniflare's D1, and Supabase's SQL functions). docs/stores.md explains how to write one.
  • Campaign tags: campaigns on a project and on the client. On a visit tagged ?ref= or ?utm_source=, a listed tag counts as via:<tag> and anything else as via:other. The client sends other for an unlisted tag, so a raw value never leaves the browser. Adds the beacon field via.
  • respectGPC: true (and data-respect-gpc): send nothing when Global Privacy Control is on. Off by default; the README says why. Reason gains 'gpc'.
  • createHandler options address(req) (which header the rate limit trusts) and isBot(ua) (replace or wrap the built-in filter). The README now says plainly that the rate limit is per instance.
  • The server is smoke-tested on Deno, Bun and workerd as well as Node.

0.3.0

0.3 reads the numbers back. It is also the first release with the 0.2 changes below, which were never published on their own: read their breaking lines when upgrading from 0.1.

  • ReadableStore (Store plus read(project, since, until)); supabaseStore reads through peepless_counts, paging past Supabase's 1,000-row cap, and memoryStore reads too.
  • readCounts(store, { project, since, until }) and summarize(rows, range?): totals, sources, campaigns, countries, pages, events and a per-day series, with zeros for quiet days. Types CountRow, Summary, DayTotals.
  • createStatsHandler({ store, token }): GET ?project=&since=&until= with a bearer token answers a Summary as JSON. A wrong or missing token gets 401; without a token of 16+ characters it answers 503. In openapi.yaml, with replayed examples, and in both starters (app/api/peepless/stats/route.ts, functions/peepless-stats).
  • npx peepless report (the last 30 days in the terminal) and npx peepless doctor (table, key and a test beacon that counts nothing). Node only; nothing added to the browser bundle.
  • memoryStore counts a counter named twice in one call once, as peepless_add does.

0.2.0 (not published; shipped in 0.3.0)

0.2 decides the public surface. Breaking changes are allowed before 1.0; each has a line here saying what to change.

Breaking

  • peepless no longer exports routeOf, blocked, readIgnoreParam, ignored, DEFAULT_ENDPOINT or DEFAULT_IGNORE_PARAM. Use isOptedOut() in place of ignored(), and start(...).reason in place of blocked(host). The others were internal; copy them if you relied on them.
  • peepless/server no longer exports checkProjects, EVENT or utcDay. createHandler still checks its projects and throws on a mistake, so call it to validate a config.
  • history.replaceState to a new path now counts a page view, as pushState does (Next.js router.replace, React Router navigate(to, { replace: true })). A replaceState that only changes the query or hash still doesn't.
  • A page restored from the back/forward cache now counts a page view (not a visit).
  • The localhost console hint names the reason by its code (not-live), and suggests debug: true.

Added

  • host takes a list of hostnames, and data-host a space-separated list.
  • optOut(), optIn() and isOptedOut(), also on window.peepless. Opting in or out takes effect at once.
  • debug: true (and data-debug): log each beacon instead of sending it, on any host.
  • What start returns has counting and reason (a Reason: no-browser, automated, not-live, no-beacon, opted-out or debug).
  • start<'a' | 'b'>() narrows track on what it returns to those event names. Types only.
  • track calls made before start are held (up to 20) and sent once it runs; off the live site they're dropped.
  • openapi.yaml (OpenAPI 3.1) describes the beacon endpoint and ships in the package (peepless/openapi.yaml). npm run check replays its examples against createHandler.
  • docs/counters.md: the grammar of counter names, and the rule that from 1.0 they never change meaning.
  • npm run check compares every public export with scripts/exports.txt.

Fixed

  • The README gave the rate limit as per project; it is per address per project. The size is now "under 2 KB" everywhere, which the build checks.

0.1.1

  • First release published by the release workflow, with npm provenance. No code changes from 0.1.0.

0.1.0

  • First release: the browser client (peepless, and the drop-in dist/peepless.js), the server handler (peepless/server) with the bot filter and country counts, the Supabase and Next.js starters, and llms.txt.