Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ jobs:
- name: Run tests (content-translator)
run: cd content-translator && pnpm test

- name: Run tests (pages)
run: cd pages && pnpm test:unit

- name: Run tests (vercel-deployments)
run: cd vercel-deployments && pnpm test

Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Every test must justify its existence by verifying meaningful behavior. A test e

Default to integration tests against real Payload / real React rendering. Reach for unit tests only for pure logic with non-trivial branches. Only stub external boundaries: network, filesystem, time, randomness, LLM providers, third-party SDKs. If a test requires mocking the module under test's close collaborators, test at a higher level instead.

Name each test by the behavior it protects in one sentence (*"rejects a confirmation when the tool call id is unknown"*), not by the method it calls (*"calls handleConfirm with false"*).
Name each test by the behavior it protects in one sentence (_"rejects a confirmation when the tool call id is unknown"_), not by the method it calls (_"calls handleConfirm with false"_).

## Changelog

Expand Down
5 changes: 5 additions & 0 deletions alt-text/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

- fix: respect a user-customized `routes.api` in the generate and bulk-generate buttons (the fetch previously hardcoded `/api/alt-text-plugin/...`)
- refactor: use Payload's `formatAdminURL` helper when linking from the health widget to collection lists

## 0.4.4

- style: standardize icons to use Geist icon set (16x16 filled)
Expand Down
9 changes: 9 additions & 0 deletions alt-text/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ export default [
'no-console': 'off', // TODO: remove this rule and use the Payload logger instead
},
},
{
// Test files use `vi.mock` to stub hooks like `useConfig`, `useLocale`, etc.
// The mock arrow functions share names with real hooks, so the rule flags them
// as "useless custom hooks" — but they are intentionally plain mocks.
files: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
rules: {
'@eslint-react/hooks-extra/no-useless-custom-hooks': 'off',
},
},
{
ignores: defaultESLintIgnores,
},
Expand Down
12 changes: 8 additions & 4 deletions alt-text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@
"types": "./src/index.ts",
"scripts": {
"build": "pnpm copyfiles && pnpm build:types && pnpm build:swc",
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
"build:types": "tsc --outDir dist --rootDir ./src",
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths --ignore '**/*.test.ts,**/*.test.tsx'",
"build:types": "tsc --project tsconfig.build.json --outDir dist --rootDir ./src",
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
"clean": "rimraf --glob {dist,*.tsbuildinfo}",
"dev": "tsc -w",
"format": "prettier --write src \"*.{json,md,js,mjs,cjs}\"",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"test": "node --experimental-strip-types --test test/*.test.ts",
"test": "pnpm test:health && pnpm test:components",
"test:components": "vitest run",
"test:health": "node --experimental-strip-types --test test/altTextHealth.test.ts",
"prepublishOnly": "pnpm clean && pnpm build"
},
Expand All @@ -48,13 +49,16 @@
"@payloadcms/translations": "^3.83.0",
"@swc/cli": "^0.8.1",
"@swc/core": "^1.15.26",
"@testing-library/react": "^16.3.2",
"@types/react": "19.2.14",
"@types/react-dom": "19.2.3",
"copyfiles": "2.4.1",
"eslint": "^9.0.0",
"jsdom": "^29.0.2",
"prettier": "^3.8.3",
"rimraf": "6.1.3",
"typescript": "5.9.3"
"typescript": "5.9.3",
"vitest": "^4.1.4"
},
"files": [
"dist"
Expand Down
Loading
Loading