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;
27
28pub mod CaptureEvent;
29
30pub mod CaptureHandler;
31
32pub mod CaptureIPC;
33
34pub mod HydrateRuntimeEnvironment;
35
36pub mod Initialize;
37
38pub(crate) mod CaptureAllowed;
39
40pub(crate) mod Client;
41
42pub(crate) mod Constants;
43
44pub(crate) mod DistinctId;