Adds the two test categories the ticket asked for, replacing the old
content-JSON-schema-only testing story now that Payload is the real
source of truth:
1. src/payload-config.test.ts — fast, DB-free unit tests over the
Collection/Global config objects themselves. WHY not importing
payload.config.ts directly: it pulls in the real `payload` and
`@payloadcms/db-mongodb` packages as values (not just types), which
are ESM-only and Jest's default transformIgnorePatterns skips
node_modules entirely — confirmed by trying it
(`SyntaxError: Cannot use import statement outside a module` from
payload's own dist). Individual collection/global files only ever
`import type` from 'payload' (erased at compile time), so they're
safely importable in isolation. Two of the assertions are
deliberate regression guards for real bugs found earlier this
session (MITHOME-121): Media.access.read must stay public, and
Partners.logo must stay optional.
2. scripts/test-payload-local-api.ts (npm run test:payload) — exercises
every src/lib/payload-content.ts getter plus a full
create/findByID/delete cycle against a real, already-migrated
MongoDB. WHY a plain node script instead of a Jest integration
config: same ESM problem as above, and Payload's dependency graph
is too broad to safely add to transformIgnorePatterns — this
follows the same working `node --import tsx` pattern already used
by migrate-content-to-payload.ts. Not wired into
pre-deploy-tests.sh (needs a live, pre-migrated MongoDB, same
reasoning as the removed CMS integration tests); run manually or
before a release.
3. Fixed the pre-existing (Docker-stack-gated, so silently never
caught) staleness in integration.test.ts and e2e-docker.test.ts:
unprefixed routes (/rolunk) → locale-prefixed (/hu/rolunk), and
Mongo assertions against the old site_config/contact_submissions
collections → the real globals/legal-pages/partners/
contact-submissions collections Payload actually uses. Also fixed
an unrelated stale error-message assertion for spam detection that
never matched the route's real string.
Verified: full gate green (tsc, lint, 63 unit tests — 13 new — build),
and separately ran test:payload live against the dev MongoDB (8/8
passed, including the write/read/delete cycle actually hitting Mongo).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
tsx 4.22.4 (the version resolved before this was an explicit
dependency) fails on Node v25.6.1 with "T.registerHooks is not a
function" — its CommonJS-require hook feature-detection finds
node:module's registerHooks but calls it with a shape that version of
Node no longer accepts. This broke both the `payload` CLI (needed for
`generate:importmap`, see next commit) and would have broken
`npm run migrate:content` (MITHOME-87) the same way. 4.23.13 fixes it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Alapinstalláció a Payload CMS-re való áttéréshez (EPIC MITHOME-85):
- payload@3.88.0, @payloadcms/next, @payloadcms/db-mongodb,
@payloadcms/richtext-lexical, graphql, sharp telepítve
- src/payload.config.ts: mongooseAdapter a meglévő MONGODB_URI-ra
(ugyanaz az adatbázis, mint a Mongoose/mongodb rétegnek), lexical
editor, PAYLOAD_SECRET env-ből
- src/collections/Users.ts: minimális auth collection — Payload nem
tud admin felületet renderelni auth collection nélkül. Ez csak a
bootstraphez kell; a valódi access control/jelszó-politika MITHOME-90
feladata.
- App Router route group (src/app/(payload)/): admin UI
([[...segments]]), REST (api/[...slug]), GraphQL + playground route-ok,
root layout — a szokásos Payload v3 Next.js integrációs minta szerint
- next.config.ts: withPayload() wrapper a route handler bundling-hoz
- tsconfig.json: @payload-config path alias -> src/payload.config.ts
(ez oldja fel a webpack/turbopack importot is, nem csak a type-checket)
- PAYLOAD_SECRET env var: generált dev érték a .env.local-ban
(gitignore-olt), changeme placeholder + generálási megjegyzés a
staging/production .env példafájlokban, dokumentálva a CLAUDE.md
env-lista részében
Ismert, még nem javított biztonsági advisory a felvett payload@3.88.0-ban
(GHSA-jg8r-5jh2-v2xj, moderate, CWE-307: az admin account-unlock alapból
más fiókok lockoutját is felold hitelesített usernek) — nincs újabb
patch-elt verzió jelenleg, nyomon követve MITHOME-90 alatt.
Ellenőrizve ezen a commiton: npm run build, npm run lint, tsc --noEmit,
npm test (58 passed) — mind zöld. Az admin bejelentkezés/DB-kapcsolat
élő tesztje MongoDB-t igényel (jelen környezetben Docker daemon nem fut,
ez lokálisan `docker compose -f docker-compose.dev.yml up -d mongodb`
után `npm run dev` + http://localhost:3000/admin-mal ellenőrizhető).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Payload 3.88.0's peer range for `next` is >=15.2.9 <15.3.0 ||
>=15.3.9 <15.4.0 || >=15.4.11 <15.5.0 || >=16.2.6 <17.0.0 — the
project's previous 15.5.23 fell in the unsupported gap between the
15.4.x and 16.2.x ranges. Upgrading to 16.3.4 (React 19.1.0 stays
compatible) unblocks MITHOME-86.
- next.config.ts: drop the removed `eslint.ignoreDuringBuilds` option
(Next 16 no longer runs ESLint during `next build`)
- eslint.config.mjs: import eslint-config-next's native flat-config
arrays directly instead of bridging through FlatCompat, which threw
"Converting circular structure to JSON" under ESLint 9 with the
upgraded config
- tsconfig.json: Next 16's own migration set `jsx: react-jsx` and added
`.next/dev/types/**/*.ts` to `include`
- ThemeProvider.tsx: suppress two react-hooks/set-state-in-effect
false positives (new rule shipped with eslint-config-next 16) —
these effects intentionally sync state from localStorage/DOM on
mount, there is no subscription to move the setState into
Verified: npm run build, npm run lint, tsc --noEmit, npm test (58
passed) all clean on this change alone, before installing Payload.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Updated README.md with project details, quick start instructions, and tech stack.
- Expanded TODO.md to reflect current project status and backlog items, including Linear ticket synchronization.
- Added mobile menu toggle functionality in Header component with corresponding tests for user interactions.
- Configured Next.js for Docker deployment and optimized build settings.