Files
zeekay ec6f6b50c1 chore: kill ALL posthog — zero refs, zero filenames (1452 -> 0)
We own the ingestion server (hanzoai/insights: Django + rust/capture + nodejs
plugin) AND this SDK, so there is no external wire contract to preserve. The
server is already 100% posthog-free; this SDK was the last laggard.

- $last_posthog_reset -> $last_insights_reset. This FIXES A LIVE MISMATCH: the
  server taxonomy (insights/taxonomy/taxonomy.py, insights/insightsql/ai.py)
  already expected the insights form while the SDK emitted the posthog form.
- __PosthogExtensions__ -> __InsightsExtensions__; all PostHog/posthog/POSTHOG
  identifiers -> Insights/insights/INSIGHTS (src, tests, playground, playwright,
  scripts, rrweb subpackages, package.json keywords).
- Hosts: DEFAULT_PLUGIN_HOST + DEFAULT_NUXT_HOST + the core host default pointed
  at PostHog's cloud (us.i.posthog.com) — a real bug. All -> insights.hanzo.ai.
- Removed the us-assets/eu-assets CDN split in getRemoteConfig (PostHog-specific;
  Hanzo serves remote config from the same host) — it had degenerated to a no-op.
- Fixed generate-docs writing to a stray references/@hanzo/ subdir.
- Renamed the 3 posthog-named test files; dropped 58MB of stale reference
  snapshots named for upstream posthog versions we never shipped (they are
  generated output — references/ is now gitignored).

Verified: typecheck errors 42 (HEAD) -> 18 (all pre-existing test-mock
looseness); types package 0; every package.json valid with @hanzo/* names.
Guard: grep -rioE 'posthog' packages ... | wc -l  => 0
2026-07-16 09:09:18 -07:00

78 lines
1.9 KiB
JavaScript

import { external, babel, resolve, commonjs, json, dts, plugins } from '@hanzo/insights-tooling-rollup-utils'
import packageJson from './package.json' with { type: 'json' }
const configs = []
const extensions = ['.js', '.jsx', '.ts', '.tsx']
const externalDeps = external(packageJson)
configs.push({
input: `./src/index.ts`,
output: [
{
file: packageJson.main,
sourcemap: true,
exports: 'named',
format: `cjs`,
interop: 'auto',
},
{
file: packageJson.module,
sourcemap: true,
format: `es`,
},
],
external: externalDeps,
plugins: plugins(extensions),
})
configs.push({
input: `./src/index.ts`,
output: [{ file: `./dist/index.d.ts`, format: 'es' }],
external: externalDeps,
plugins: [resolve({ extensions }), dts()],
})
// Add submodule builds for insights-ai
const providers = ['anthropic', 'openai', 'vercel', 'langchain', 'gemini', 'otel', 'openai-agents']
providers.forEach((provider) => {
configs.push({
input: `./src/${provider}/index.ts`,
output: [
{
file: `./dist/${provider}/index.cjs`,
sourcemap: true,
exports: 'named',
format: 'cjs',
interop: 'auto',
},
{
file: `./dist/${provider}/index.mjs`,
sourcemap: true,
format: 'es',
},
],
external: externalDeps,
plugins: [
resolve({ extensions }),
commonjs(),
json(),
babel({
extensions,
babelHelpers: 'bundled',
include: ['./src/**/*.{js,jsx,ts,tsx}'],
presets: [['@babel/preset-env', { targets: { node: '20.0' } }], '@babel/preset-typescript'],
}),
],
})
configs.push({
input: `./src/${provider}/index.ts`,
output: [{ file: `./dist/${provider}/index.d.ts`, format: 'es' }],
external: externalDeps,
plugins: [resolve({ extensions }), dts()],
})
})
export default configs