This is my blog and home page.
npm installRunning development server:
npm startServer is located at http://localhost:3000
Running tests:
npm testChange buildPath in webpack.config.js, then:
npm run buildEvery site on ciunkos.com loads PostHog from /vendor/posthog/<build>/posthog.js (build = <version>-<sha256 prefix>) with an SRI
hash, never from PostHog. The Workers' /ph/* proxies only pass events and JSON config.
The file is built by scripts/vendor-posthog.mjs from scripts/posthog/entry.ts: PostHog's
TypeScript source at the commit tagged posthog-js@<version> (pinned in versions.json), bundled
and tree-shaken with the pinned esbuild. It keeps only what the sites use (click autocapture,
pageviews, web vitals, exceptions, session replay) and has no external script loader, so it can't
fetch more code. Same queue contract as PostHog's array.js snippet.
posthog-jsis pinned exactly inpackage.json. Dependabot proposes updates weekly, 7 days after release. On its PR,.github/workflows/vendor-posthog.ymlbuilds and commits the newsrc/www/vendor/posthog/<build>/,versions.jsonandsrc/utils/posthog-sdk.mjs.- Manually:
npm ci --ignore-scripts && npm run vendor:posthog. node scripts/vendor-posthog.mjs --check --rebuildproves the vendored file is reproducible.- Old versions stay in
src/www/vendor/posthog/until no Worker points at them. - After the Pages deploy, sync the copies in the other repos and deploy them:
node scripts/check-posthog-copies.mjs --fix.