feat(core-analytics): add IAnalytics interface, types, and NoopAnalytics
Replaces generator placeholder with IAnalytics interface (track, identify, pageView, flush), AnalyticsAttributeValue + AnalyticsUser types, and NoopAnalytics implementation. Adds sibling tests covering all four methods with 100% coverage. All conformance + coverage gates pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
23
packages/core-analytics/src/noop-analytics.ts
Normal file
23
packages/core-analytics/src/noop-analytics.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type {
|
||||
AnalyticsAttributeValue,
|
||||
AnalyticsUser,
|
||||
IAnalytics,
|
||||
} from "./analytics.interface";
|
||||
|
||||
export class NoopAnalytics implements IAnalytics {
|
||||
track(
|
||||
_event: string,
|
||||
_attributes?: Record<string, AnalyticsAttributeValue>,
|
||||
): void {}
|
||||
identify(
|
||||
_user: AnalyticsUser,
|
||||
_attributes?: Record<string, AnalyticsAttributeValue>,
|
||||
): void {}
|
||||
pageView(
|
||||
_path: string,
|
||||
_attributes?: Record<string, AnalyticsAttributeValue>,
|
||||
): void {}
|
||||
flush(): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user