Commits
Added 5 vision APIs and list/object tagging
Enable Vercel Web Analytics integration
# Vercel Web Analytics Integration Report
## Summary
Successfully integrated Vercel Web Analytics into the YENDOR web application, enabling tracking of visitor traffic and page views on the Vercel platform.
## Implementation Details
### Project Structure
- **Framework**: Vite-based vanilla JavaScript/TypeScript web application
- **Target Directory**: `./web/`
- **Application Type**: Canvas/WebGL game application
- **Primary Entry Points**: `index.html`, `src/main.ts`
### Changes Made
#### 1. Added @vercel/analytics Package (`web/package.json`)
- Added `@vercel/analytics` (version `^1.4.0`) to the `dependencies` section
- This package provides the necessary integration utilities for Vercel Web Analytics
- Version 1.4.0 and later includes the Astro component and comprehensive framework support
#### 2. Integrated Analytics Script (`web/index.html`)
- Added Vercel Web Analytics tracking script to the HTML body, immediately before the closing `</body>` tag
- Implemented the standard HTML integration pattern as documented in Vercel Web Analytics guide:
```html
<script>
window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
</script>
<script defer src="/_vercel/insights/script.js"></script>
```
### Why This Approach?
The YENDOR project is a Vite-based vanilla JavaScript application (not a framework like Next.js, React, Vue, Svelte, etc.). For such applications, the recommended approach according to Vercel's documentation is to:
1. Install the `@vercel/analytics` package (provides TypeScript types and utilities)
2. Add the inline script to the HTML that initializes the `window.va` function for tracking
3. Load the Vercel insights script from `/_vercel/insights/script.js`
This approach automatically provides route tracking without requiring custom integration code, as opposed to frameworks where explicit component imports would be needed.
### Verification
- ✅ Build completes successfully with no errors: `npm run build`
- ✅ TypeScript compilation passes with no errors: `npx tsc --noEmit`
- ✅ Dependencies installed successfully using npm
- ✅ Generated dist/index.html includes the analytics scripts correctly
- ✅ No existing functionality was broken
### Next Steps for Deployment
1. Ensure Web Analytics is enabled in the Vercel dashboard (Analytics tab → Enable)
2. Deploy the application to Vercel: `vercel deploy`
3. After deployment, the analytics script at `/_vercel/insights/script.js` will be automatically served by Vercel
4. Once deployed and users visit the site, analytics data will appear in the Vercel dashboard Analytics tab
### Lock Files
- Updated `web/package-lock.json` with new dependency entries
- `web/bun.lock` was also updated to reflect the new dependency
## Files Modified
- `web/package.json` - Added @vercel/analytics dependency
- `web/index.html` - Added analytics tracking scripts
## Files Created
- `web/package-lock.json` - Updated with new dependencies (previously untracked)
## Notes
- The analytics integration is minimal and non-intrusive, designed for compatibility with the existing Vite build process
- The scripts load asynchronously and won't impact application performance
- Route tracking will work automatically when deployed to Vercel
- No custom event tracking is configured by default, but can be added later using the `window.va()` function if needed
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Attempted to add tagged strings/ints to harden string types
Added monster entities (and refactored UI for it to work a lil better)
Added array based particle system and gold pick up particles
Added smoothing to walking to add polish
Added torch like effect around player
# Vercel Web Analytics Integration Report
## Summary
Successfully integrated Vercel Web Analytics into the YENDOR web application, enabling tracking of visitor traffic and page views on the Vercel platform.
## Implementation Details
### Project Structure
- **Framework**: Vite-based vanilla JavaScript/TypeScript web application
- **Target Directory**: `./web/`
- **Application Type**: Canvas/WebGL game application
- **Primary Entry Points**: `index.html`, `src/main.ts`
### Changes Made
#### 1. Added @vercel/analytics Package (`web/package.json`)
- Added `@vercel/analytics` (version `^1.4.0`) to the `dependencies` section
- This package provides the necessary integration utilities for Vercel Web Analytics
- Version 1.4.0 and later includes the Astro component and comprehensive framework support
#### 2. Integrated Analytics Script (`web/index.html`)
- Added Vercel Web Analytics tracking script to the HTML body, immediately before the closing `</body>` tag
- Implemented the standard HTML integration pattern as documented in Vercel Web Analytics guide:
```html
<script>
window.va = window.va || function () { (window.vaq = window.vaq || []).push(arguments); };
</script>
<script defer src="/_vercel/insights/script.js"></script>
```
### Why This Approach?
The YENDOR project is a Vite-based vanilla JavaScript application (not a framework like Next.js, React, Vue, Svelte, etc.). For such applications, the recommended approach according to Vercel's documentation is to:
1. Install the `@vercel/analytics` package (provides TypeScript types and utilities)
2. Add the inline script to the HTML that initializes the `window.va` function for tracking
3. Load the Vercel insights script from `/_vercel/insights/script.js`
This approach automatically provides route tracking without requiring custom integration code, as opposed to frameworks where explicit component imports would be needed.
### Verification
- ✅ Build completes successfully with no errors: `npm run build`
- ✅ TypeScript compilation passes with no errors: `npx tsc --noEmit`
- ✅ Dependencies installed successfully using npm
- ✅ Generated dist/index.html includes the analytics scripts correctly
- ✅ No existing functionality was broken
### Next Steps for Deployment
1. Ensure Web Analytics is enabled in the Vercel dashboard (Analytics tab → Enable)
2. Deploy the application to Vercel: `vercel deploy`
3. After deployment, the analytics script at `/_vercel/insights/script.js` will be automatically served by Vercel
4. Once deployed and users visit the site, analytics data will appear in the Vercel dashboard Analytics tab
### Lock Files
- Updated `web/package-lock.json` with new dependency entries
- `web/bun.lock` was also updated to reflect the new dependency
## Files Modified
- `web/package.json` - Added @vercel/analytics dependency
- `web/index.html` - Added analytics tracking scripts
## Files Created
- `web/package-lock.json` - Updated with new dependencies (previously untracked)
## Notes
- The analytics integration is minimal and non-intrusive, designed for compatibility with the existing Vite build process
- The scripts load asynchronously and won't impact application performance
- Route tracking will work automatically when deployed to Vercel
- No custom event tracking is configured by default, but can be added later using the `window.va()` function if needed
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>