build(proto): mark the package as ESM so the Payload CLI loads the config (MITHOME-136)
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Canceled after 0s
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Canceled after 0s
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Canceled after 0s
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Canceled after 0s
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Canceled after 0s
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Canceled after 0s

The Payload CLI failed with ERR_REQUIRE_ASYNC_MODULE on Node 22 and 26 alike:
without "type": "module" it loaded payload.config.ts as CommonJS and could
not require the top-level-await ESM @payloadcms/richtext-lexical. Following
the official Payload template: "type": "module", CommonJS jest files and the
content schema renamed to .cjs, ESLint globs updated. Next's standalone
server.js is ESM and starts; 516 unit tests, tsc, lint and build are green.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Do Siki
2026-09-29 21:55:31 +02:00
co-authored by Claude Opus 5.5
parent 66b169cf06
commit a3d6cbe404
17 changed files with 29 additions and 25 deletions
@@ -37,7 +37,8 @@
### D2: Sémamigrációk és eszközök
- A kiinduló migráció a teljes jelenlegi config sémája: `payload migrate:create initial`. A `src/migrations/index.ts` ezzel indul újra.
- A Payload parancssori eszköze helyben `npx -y node@22 ./node_modules/.bin/payload …` alakban fut. Ehhez kerül egy npm script (`payload:node22`). A típus- és import-map-generálás is erre áll át; a mostani `--input-type=module` kerülőút megszűnik.
- **A parancssori eszköz hibájának valódi oka** (az 1.1-es feladatban derült ki): nem a Node-verzió. A `proto/package.json`-ban nem volt `"type": "module"`, ezért a Payload parancssori eszköze a configot CommonJS-ként töltötte be, és nem tudta behúzni az ESM-es, top-level await-es `@payloadcms/richtext-lexical`-t. Node 22 alatt is ugyanez a hiba jött.
- **Megoldás:** `"type": "module"`, ahogy a Payload hivatalos sablonja is csinálja. A CommonJS jest-fájlok és a `src/content/schema.js` `.cjs` kiterjesztést kaptak. Ellenőrizve: a parancssori eszköz Node 26-on is betölti a configot; a Next `standalone` `server.js` ESM-es, és elindul. A `--input-type=module` kerülőút megszűnik.
- A Mongo-adatmigrációk (8 fájl) és a segédfüggvényeik törlődnek. Az általuk elért állapot a stagingadatban van, és azt a D3 hozza át.
### D3: Egyszeri adatmigráció (`proto/scripts/migrate-mongo-to-postgres.ts`)