Files
ipal-kit/reference/src/payload.config.ts
T
Radosław SmolińskiandClaude Opus 5.5 804a09efed Project starter: ipal-kit create <domain> generates a new site from the reference site
- bin `ipal-kit` (subcommand `create`): the architecture questions (or --answers JSON),
  rendering from reference/ through starter.manifest.json (placeholders, @starter:if variants,
  //: alternatives, demo dropped), answers into AGENTS.md "Project decisions" and ipal-doctor.json,
  local .env with a fresh PAYLOAD_SECRET, install from the shipped lockfile, ipal-skills,
  ipal-tokens, generate:types/importmap, typecheck, ipal-doctor when shipped, secret check,
  first commit
- @intecion/ipal-kit/starter: the building blocks (renderSite, validateAnswers, applyVariants,
  collectBundle, lockfileWithoutPlugin, secretFindings …)
- build:starter packs reference/ into dist/starter/template.json.gz (90 KB);
  starter:gate in prepublishOnly: site from the packed tarball, frozen install, seed, build,
  targeted SEED_ONLY seed in production mode, full seed refused, pnpm start checks
- D15: plugin dependencies pinned exactly (nodemailer 10.3.1)
- reference/: @starter:if markers (runs as before), manifest generate/variants/rewrite
- docs: project-starter.md, AGENT.md, ipal-setup, ipal-site, ipal-reference (+ api.md),
  README, PROGRAMISTA §2, CHANGELOG, docs/README, reference index

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 15:50:44 +01:00

105 lines
3.4 KiB
TypeScript

// @starter:if twoFactor
import { payloadTotp } from '@clocklimited/payload-2fa'
// @starter:endif
import { buildR2Storage, ipalKit, mailAdapter } from '@intecion/ipal-kit'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
import { s3Storage } from '@payloadcms/storage-s3'
import { revalidatePath } from 'next/cache'
import path from 'path'
import { buildConfig } from 'payload'
import sharp from 'sharp'
import { fileURLToPath } from 'url'
// @starter:if caseStudies
import { CaseStudies } from './collections/CaseStudies'
// @starter:endif
import { Media } from './collections/Media'
import { Pages } from './collections/Pages'
// @starter:if posts
import { Posts } from './collections/Posts'
// @starter:endif
import { contentConfig } from './content.config'
import { db } from './db'
import { Company } from './globals/Company'
import { Footer } from './globals/Footer'
import { Header } from './globals/Header'
import { i18nConfig } from './i18n.config'
const dirname = path.dirname(fileURLToPath(import.meta.url))
export default buildConfig({
admin: {
user: 'users',
importMap: { baseDir: path.resolve(dirname) },
},
// absolute URLs in form e-mails (logo, links)
serverURL: process.env.NEXT_PUBLIC_SERVER_URL,
// ipalKit injects `users` (roles + 2FA)
collections: [
Pages,
// @starter:if posts
Posts,
// @starter:endif
// @starter:if caseStudies
CaseStudies,
// @starter:endif
Media,
],
globals: [Header, Footer, Company],
db,
editor: lexicalEditor(),
email: mailAdapter(), // transport from Site integrations (SMTP / Graph); without it form e-mails are not sent
secret: process.env.PAYLOAD_SECRET ?? '',
sharp,
typescript: { outputFile: path.resolve(dirname, 'payload-types.ts') },
plugins: [
ipalKit({
i18n: i18nConfig,
access: { authCollection: 'users' },
pages: { slug: 'pages' },
content: contentConfig,
seo: {
collections: [
'pages',
// @starter:if posts
'posts',
// @starter:endif
// @starter:if caseStudies
'caseStudies',
// @starter:endif
],
},
forms: { redirectRelationships: ['pages'], emailLayout: true },
// @starter:if twoFactor
twoFactor: { issuer: 'Example Studio', plugin: payloadTotp },
// @starter:else
//: twoFactor: false, // turned off by the owner — AGENTS.md → Project decisions, ipal-doctor.json
// @starter:endif
// @starter:if whiteLabel
whiteLabel: true,
// @starter:endif
// @starter:if !adminMeta
//: adminMeta: false, // turned off by the owner — AGENTS.md → Project decisions
// @starter:endif
// @starter:if agencyNone
//: agency: false, // no agency credit (owner's choice)
// @starter:endif
// @starter:if agencyCustom
//: agency: { name: 'Example Agency', url: 'https://agency.example' },
// @starter:endif
indexNow: true,
consentLog: true,
// Privacy → Cookie review: scan + approval; crawl needs IPAL_COOKIE_SCAN_URL / IPAL_COOKIE_SCAN_TOKEN
// @starter:if crawl
cookieScanner: { crawl: true },
// @starter:endif
// @starter:if scannerWithoutCrawl
//: cookieScanner: true,
// @starter:endif
lightbox: true,
revalidatePath,
}),
buildR2Storage(['media'], { s3Storage }), // R2 with the full R2_* set, local disk without it
],
})