mirror of
https://github.com/jakejarvis/stanza.git
synced 2026-10-16 07:25:43 -04:00
## Vercel Web Analytics Installation
Successfully installed and configured Vercel Web Analytics for the stanza-web project following the official Vercel documentation.
### Changes Made
#### 1. Package Installation
- Installed `@vercel/analytics` version 2.0.1 using pnpm
- Package added to `apps/web/package.json` dependencies
#### 2. Analytics Component Integration
Modified `apps/web/src/routes/__root.tsx`:
- Added import: `import { Analytics } from "@vercel/analytics/react";`
- Added `<Analytics />` component to the RootComponent's JSX, placed just before the `<Scripts />` component
- This ensures analytics tracking is enabled across all pages of the application
#### 3. Framework-Specific Implementation
The project uses TanStack Start (React-based framework) with Nitro as the server. According to the Vercel documentation, the correct integration approach for React applications is:
- Import `Analytics` from `@vercel/analytics/react`
- Add the `<Analytics />` component to the root layout component
- This integration automatically handles page view tracking for client-side route transitions
### Files Modified
- `apps/web/package.json` - Added @vercel/analytics dependency
- `apps/web/src/routes/__root.tsx` - Added Analytics component import and usage
- `package.json` - Added tsx as a dev dependency for build tooling
- `pnpm-lock.yaml` - Updated with new dependencies
### Verification
✅ Type checking passed (tsc --noEmit)
✅ Linting passed (oxlint) - 0 warnings, 0 errors
✅ Tests passed (vitest) - All 10 tests passing
✅ No breaking changes introduced
✅ Existing code structure preserved
### Next Steps for Activation
To enable analytics tracking in production:
1. Deploy the application to Vercel
2. Enable Web Analytics in the Vercel dashboard (Analytics section)
3. Analytics data will start appearing after user visits
### Notes
- The Analytics component is lightweight and only tracks page views by default
- Custom event tracking is available with Pro/Enterprise plans
- The component automatically detects the environment (development vs production)
- Integration follows React best practices by placing the component at the root level
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
38 lines
1.0 KiB
JSON
38 lines
1.0 KiB
JSON
{
|
|
"name": "stanza",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"description": "Modular monorepo template CLI — shadcn for stacks.",
|
|
"license": "MIT",
|
|
"author": "Jake Jarvis <jakejarvis@gmail.com>",
|
|
"scripts": {
|
|
"build": "turbo run build",
|
|
"dev": "turbo run dev",
|
|
"test": "turbo run test",
|
|
"check-types": "turbo run check-types",
|
|
"lint": "oxlint",
|
|
"lint:fix": "oxlint --fix",
|
|
"fmt": "oxfmt",
|
|
"fmt:check": "oxfmt --check",
|
|
"registry:build": "bun scripts/registry-build.ts",
|
|
"changeset": "changeset",
|
|
"release": "pnpm --filter @stanza/cli --filter create-stanza build && changeset publish"
|
|
},
|
|
"devDependencies": {
|
|
"@changesets/changelog-github": "^0.7.0",
|
|
"@changesets/cli": "^2.31.0",
|
|
"@stanza/registry": "workspace:*",
|
|
"@types/node": "^25.9.1",
|
|
"oxfmt": "^0.51.0",
|
|
"oxlint": "^1.66.0",
|
|
"tsx": "^4.22.3",
|
|
"turbo": "^2.9.14",
|
|
"typescript": "^6.0.3"
|
|
},
|
|
"engines": {
|
|
"node": ">=22",
|
|
"pnpm": ">=10"
|
|
},
|
|
"packageManager": "pnpm@10.33.4"
|
|
}
|