From dc35828f91fdcd077c62167e516f9307d6ef549c Mon Sep 17 00:00:00 2001 From: Adriaan <1079135+adriaandotcom@users.noreply.github.com> Date: Thu, 29 May 2025 16:13:54 +0200 Subject: [PATCH 1/3] Add AGENTS guidance --- AGENTS.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..025d6a0 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,14 @@ +# Agent Instructions + +This repository contains the public scripts for Simple Analytics. When making changes keep the following points in mind. + +## Development + +- Use **Node.js 22.16** (see `.nvmrc`). +- Run `npm run build` to compile the scripts. This generates the files in `dist/` which should be committed. +- Format code with Prettier before committing. You can run `npx prettier -w .`. +- Execute `npm run test:unit` to run the unit tests. + +## References + +Most work happens in `src/` with `compile.js` creating the distributable versions. Read `README.md` for more details about contributing and running scripts locally. From f99b45f84f237d18747723e17db11deb3af986b3 Mon Sep 17 00:00:00 2001 From: Adriaan van Rossum <1079135+adriaanvanrossum@users.noreply.github.com> Date: Thu, 29 May 2025 16:28:42 +0200 Subject: [PATCH 2/3] Improve AGENTS.md --- AGENTS.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 025d6a0..57a0759 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,8 +6,15 @@ This repository contains the public scripts for Simple Analytics. When making ch - Use **Node.js 22.16** (see `.nvmrc`). - Run `npm run build` to compile the scripts. This generates the files in `dist/` which should be committed. -- Format code with Prettier before committing. You can run `npx prettier -w .`. -- Execute `npm run test:unit` to run the unit tests. +- Format code with Prettier before committing. You can run `npx prettier -w .` or validate with `npm run prettier`. + +## Testing + +- Execute `npm run test:unit` to run the unit tests +- When adding a new feature or fixing a bug, please add a test. +- For every change, run `npm run build` to ensure the test uses the latest compiled version. +- Ignore most files in the `dist/` directory when checking for diffs, just check `dist/latest/latest.dev.js` and `dist/latest/auto-events.js` (whichever is relevant). +- Only tests in `test/unit/` are relevant for the AI and agents (it can run without internet access). ## References From fbdd6ee2acfc7fc8b53759d3b354c193f3d9a52f Mon Sep 17 00:00:00 2001 From: Adriaan van Rossum <1079135+adriaanvanrossum@users.noreply.github.com> Date: Thu, 29 May 2025 16:29:27 +0200 Subject: [PATCH 3/3] Add .cursorrules [no ci] --- .cursorrules | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .cursorrules diff --git a/.cursorrules b/.cursorrules new file mode 100644 index 0000000..ddb3f37 --- /dev/null +++ b/.cursorrules @@ -0,0 +1,2 @@ +- Check AGENTS.md for instructions specifically for AI +- Check README.md for instructions