teqo-backup/docs/changelog/2026-08-27-OPS99.md
Francisco Solla e1848f7502 feat(OPS99): generate importMap at build time with dummy S3_* envs
Generate the Payload importMap at build time (Dockerfile) and dev time
(predev hook) with dummy S3_* envs, eliminating the class of bugs where
the admin goes blank because the S3ClientUploadHandler entry is missing
(OPS69/OPS72/OPS73).

Changes:
- Dockerfile: add pnpm generate:importmap with dummy S3_* envs before next build
- scripts/predev-importmap.mjs: predev hook that generates importMap if missing or stale
- Delete scripts/check-importmap-s3.mjs (guard no longer needed)
- Delete tests/unit/importMapS3UploadHandler.unit.spec.ts (unit pin no longer needed)
- Remove check-importmap-s3.mjs step from CI workflows
- Add importMap.js to .gitignore (build artifact, not committed)
- Update AGENTS.md with new contract

Closes #928
2026-08-27 15:47:37 -03:00

1.4 KiB

OPS99 — Generate importMap during build with dummy S3_* envs

Date: 2026-08-27 Issue: #928 Type: ops, bug-fix

Summary

Generate the Payload importMap at build time (Dockerfile) and dev time (predev hook) with dummy S3_* envs, eliminating the class of bugs where the admin goes blank because the S3ClientUploadHandler entry is missing (OPS69/OPS72/OPS73).

Changes

Dockerfile

  • Added pnpm generate:importmap step with dummy S3_* envs BEFORE next build
  • This ensures the production image always has the correct importMap with S3ClientUploadHandler

Scripts

  • Added: scripts/predev-importmap.mjs — predev hook that generates importMap if missing or stale
  • Deleted: scripts/check-importmap-s3.mjs — guard script no longer needed (importMap is now generated at build time)
  • Deleted: tests/unit/importMapS3UploadHandler.unit.spec.ts — unit pin no longer needed

CI/CD

  • Removed check-importmap-s3.mjs step from ci-pr.yml and deploy.yml

Configuration

  • Added src/app/(payload)/admin/importMap.js to .gitignore (build artifact, not committed)
  • Added scripts/check-importmap-s3.mjs to .gitignore (deleted file)

Documentation

  • Updated AGENTS.md with new importMap contract

Verification

  • pnpm typecheck — passed
  • pnpm lint — passed (0 warnings)
  • pnpm format:check — passed
  • pnpm test:unit — 2681 tests passed
  • pnpm build — successful