Files
ipal-kit/reference/src/instrumentation.ts
T
Radosław Smoliński 6d7d39bc95 Merge claude/project-starter-build: ipal-kit create (project starter)
ipal-kit create <domain> generates a new site from the reference site (bin
ipal-kit, /starter entry, gzipped template bundle built at prepublishOnly,
starter:gate); exact pins of the plugin's own four dependencies (D15, nodemailer
10.3.1); the single-language / non-pl-default refusal; reference/ @starter:if
markers, packageManager, cookieCrawl.

Conflicts resolved:
- reference/src/instrumentation.ts: the starter's multi-line ipalEnvRules with
  the @starter:if markers (the doctor's cookieCrawl comment line merged above
  assertEnv already).
- reference/ipal-doctor.json: the doctor's version, keeping the four live-seo
  silences (until 2026-11-30) — the starter's side was the pre-silence copy.
- docs/agent/skills/ipal-reference/resources/api.md: both /starter and /doctor.
- docs/CHANGELOG.md: both sides in both hunks; one Unreleased section.
- docs/agent/reference-site/INDEX.md: regenerated with pnpm reference:index.
2026-10-29 16:16:49 +01:00

28 lines
1.4 KiB
TypeScript

import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'
export function register() {
if (process.env.NEXT_RUNTIME !== 'nodejs') {return}
// storage: R2 is required in production. ALLOW_LOCAL_MEDIA=1 lets a production build run on local disk for
// local checks and CI only — never set it in Coolify.
// cookieCrawl: IPAL_COOKIE_SCAN_URL / IPAL_COOKIE_SCAN_TOKEN in production (cookieScanner.crawl, the shared service).
// databaseName: DATABASE_URI must name example-studiopl_dev / example-studiopl_prod (databaseNamesFor).
// R2_PUBLIC_URL optional: media are served through the app by default (storage.md, env.md).
assertEnv(
ipalEnvRules({
// @starter:if crawl
cookieCrawl: true, // IPAL_COOKIE_SCAN_URL / IPAL_COOKIE_SCAN_TOKEN in production — the shared cookie-crawler service
// @starter:endif
databaseName: { domain: 'example-studio.pl' },
// @starter:if graph
//: emailGraph: true, // GRAPH_* — e-mail through Microsoft Graph
// @starter:endif
ipHeader: true,
// @starter:if r2
storage: process.env.ALLOW_LOCAL_MEDIA !== '1',
// @starter:else
//: storage: false, // media on local disk — a Coolify persistent volume (AGENTS.md → Project decisions)
// @starter:endif
}).map((rule) => (rule.name === 'R2_PUBLIC_URL' ? { ...rule, required: false } : rule)),
)
}