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