Skip to content

Conversation

@daniel-graham-amplitude
Copy link
Collaborator

@daniel-graham-amplitude daniel-graham-amplitude commented Jan 3, 2026

Summary

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?:

Note

Introduces a simple npm-backed test page and refines file discovery in the dev server.

  • Adds test-server/npm with index.html that imports @amplitude/analytics-browser from node_modules, calls init (with autocapture) and track for a smoke test
  • Includes package.json and package-lock.json to install @amplitude/analytics-browser
  • Updates vite.config.js file-listing plugin to ignore **/node_modules/** when listing *.html

Written by Cursor Bugbot for commit 9934dd0. This will update automatically on new commits. Configure here.

@macroscopeapp
Copy link
Contributor

macroscopeapp bot commented Jan 3, 2026

Add an npm test site that initializes window.amplitude and auto-tracks a 'Testing Event' from index.html to support PNPM migration work

Add a minimal HTML page that ESM-imports @amplitude/analytics-browser, initializes with import.meta.env values, sets autocapture: true, exposes window.amplitude, and immediately tracks a 'Testing Event'. Update the file listing server to ignore **/node_modules/**.

🖇️ Linked Issues

Supports the PNPM migration in AMP-145286 under the NPM security remediations epic AMP-145285 and contributes to the initiative AMP-91393.

📍Where to Start

Start with the test page setup in index.html, then review the ignore pattern change in vite.config.js.


Macroscope summarized 9934dd0.


window.amplitude = amplitude;

const status = document.getElementById('status');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Button has no click handler and status variable unused

The button with id trackEvent labeled "Track Test Event" has no click event listener attached, so clicking it won't explicitly track an event. Additionally, the status variable on line 21 is declared via document.getElementById('status') but never used in the script. Other similar test files like reset-test.html properly wire up click handlers and use status elements for feedback. This appears to be incomplete implementation that was committed.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants