diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8ccc2b..baf0449 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,11 +32,5 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Check syntax - run: node --check server.js && node --check lib/safe-fetch.js - - - name: Run tests - run: pnpm test - - - name: Audit production dependencies - run: pnpm audit --prod --audit-level=high + - name: Verify project + run: pnpm verify diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..081f596 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,9 @@ +# Repository workflow + +- Use pnpm only. Do not run `npm install` against this workspace. +- Use Node.js 20.18.1 or newer. +- Run `pnpm verify` before publishing a pull request. +- Keep raw extracted metadata separate from sanitized or fallback display values when calculating audit results. +- For UI changes, inspect desktop and 390x844 layouts, missing-image behavior, and browser console errors. +- Before reviewing or creating a pull request, fetch the default branch and review the complete `origin/master...HEAD` diff. +- For outbound-fetch changes, verify redirect and DNS SSRF handling, proxy trust, request bounds, and safe public errors. diff --git a/README.md b/README.md index 7fb4b9f..4f45840 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,12 @@ TRUST_PROXY_HOPS=1 pnpm start pnpm test ``` +Before publishing a pull request, run the same syntax, test, and production dependency checks used by CI: + +```bash +pnpm verify +``` + The test suite covers: - Private-network and DNS-based SSRF rejection diff --git a/package.json b/package.json index b4b2016..94e73e5 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,11 @@ "description": "A Node.js application that performs a basic SEO audit and displays social media previews based on a website's meta tags.", "main": "server.js", "scripts": { + "check:syntax": "node --check server.js && node --check lib/safe-fetch.js", "start": "node server.js", - "test": "node --test" + "test": "node --test", + "test:ui": "node --test test/app.test.js", + "verify": "pnpm run check:syntax && pnpm test && pnpm audit --prod --audit-level=high" }, "packageManager": "pnpm@10.33.0", "engines": {