feat(core-analytics): add React provider and useAnalytics hook

Adds a ./react subpath export to @repo/core-analytics containing
<AnalyticsProvider value={IAnalytics}> and useAnalytics(): IAnalytics.
useAnalytics() throws AnalyticsContextError when called outside a provider.
React Testing Library test verifies track() flows through context using
RecordingAnalytics. Switches vitest config to pick up .tsx test files
via environmentMatchGlobs and extends tsconfig to react-library.json
for JSX support.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 15:54:30 +00:00
parent 065ca1b6aa
commit a7e0bf290d
8 changed files with 138 additions and 26 deletions

View File

@@ -1,18 +1,18 @@
{
"generatedAt": "2026-05-18T15:19:07.787Z",
"commit": "81f75f7",
"generatedAt": "2026-05-18T15:54:10.661Z",
"commit": "065ca1b",
"repo": {
"statements": 95.89,
"branches": 89.07,
"statements": 95.92,
"branches": 89.18,
"functions": 100,
"lines": 95.89,
"lines": 95.92,
"counts": {
"lf": 3140,
"lh": 3011,
"brf": 494,
"brh": 440,
"fnf": 149,
"fnh": 149
"lf": 3165,
"lh": 3036,
"brf": 499,
"brh": 445,
"fnf": 152,
"fnh": 152
}
},
"byPackage": {
@@ -50,12 +50,12 @@
"functions": 100,
"lines": 100,
"counts": {
"lf": 27,
"lh": 27,
"brf": 7,
"brh": 7,
"fnf": 7,
"fnh": 7
"lf": 52,
"lh": 52,
"brf": 12,
"brh": 12,
"fnf": 10,
"fnh": 10
}
},
"@repo/marketing-pages": {