diff --git a/.cursor/environment.json b/.cursor/environment.json new file mode 100644 index 00000000..57d7f791 --- /dev/null +++ b/.cursor/environment.json @@ -0,0 +1,7 @@ +{ + "installCommand": "yarn install", + "updateCommand": "yarn install", + "node": { + "version": "18" + } +} diff --git a/.cursor/rules/amplitude-sdk.md b/.cursor/rules/amplitude-sdk.md new file mode 100644 index 00000000..14e5c328 --- /dev/null +++ b/.cursor/rules/amplitude-sdk.md @@ -0,0 +1,40 @@ +# Amplitude JavaScript SDK + +This repository contains the JavaScript SDK for Amplitude Analytics. + +## Project Overview + +- **Language**: JavaScript (ES6+) +- **Build Tool**: Rollup +- **Test Framework**: Mocha + Karma +- **Package Manager**: Yarn +- **Main Entry Point**: `src/amplitude-client.js` + +## Key Commands + +- `yarn install` - Install dependencies +- `yarn build` - Build the SDK +- `yarn test` - Run tests +- `yarn lint` - Run linting +- `yarn fix` - Auto-fix linting issues + +## Code Structure + +- `src/` - Source code for the SDK +- `test/` - Test files +- `website/` - Documentation site (Docusaurus) +- `scripts/` - Build and utility scripts + +## Important Notes + +- This is a client-side analytics tracking library +- The main client is defined in `src/amplitude-client.js` +- Configuration options are in `src/options.js` +- The SDK supports both browser and Node.js environments + +## Development Guidelines + +- Follow existing code style (Prettier + ESLint configured) +- Write tests for new features +- Update documentation when adding public APIs +- Keep backwards compatibility in mind