Mountain/Binary/Build/PostHogPlugin.rs
1#![allow(non_snake_case)]
2
3//! # PostHog Plugin
4//!
5//! Debug-only PostHog analytics integration. Captures lifecycle events,
6//! IPC commands, and errors during dev runs; compile-time gated to
7//! `cfg(debug_assertions)` so release builds drop the entire stack.
8//!
9//! Layout (one export per file, file name = identity):
10//! - `Initialize::Fn` - boot the global ingestion client.
11//! - `CaptureEvent::Fn` - generic event emitter with `$app` / `$component`
12//! standard props.
13//! - `CaptureError::Fn` - emit under `land:mountain:error` with tag + message.
14//! - `CaptureIPC::Fn` - emit under `land:mountain:ipc:invoke` with method name.
15//! - `CaptureHandler::Fn` - emit under `land:mountain:handler:complete` with
16//! `feature` + `duration_ms` + `ok`. Powers the Feature Parity dashboard's
17//! Node-vs-Rust handler latency comparison.
18//!
19//! Module-private helpers:
20//! - `Constants` - `Authorize` / `Beam` / `Report` / `Brand` baked from
21//! `.env.Land.PostHog`.
22//! - `Client::CLIENT` - `OnceLock<posthog_rs::Client>` singleton.
23//! - `DistinctId::Fn` - pinned-or-derived dev distinct id.
24//! - `CaptureAllowed::Fn` - `debug_assertions` && `Report != off`.
25
26pub mod CaptureError;
27pub mod CaptureEvent;
28pub mod CaptureHandler;
29pub mod CaptureIPC;
30pub mod HydrateRuntimeEnvironment;
31pub mod Initialize;
32
33pub(crate) mod CaptureAllowed;
34pub(crate) mod Client;
35pub(crate) mod Constants;
36pub(crate) mod DistinctId;