Starter: inherit the reference doctor silences and packageManager; cookieCrawl active in the reference

Same reference/package.json, reference/ipal-doctor.json and ci.yml env lines as claude/ipal-doctor-build,
so the two branches merge cleanly there. ipal-doctor.json of a new site keeps i18n-literals (the /design
styleguide) and audit:collections-present only while posts/caseStudies are in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 16:11:33 +01:00
co-authored by Claude Opus 5.5
parent 0dffb85ec1
commit 01afa6fab8
10 changed files with 59 additions and 12 deletions
+11 -3
View File
@@ -175,11 +175,19 @@ export function renderAgentsMd(reference: string, a: StarterAnswers, ctx: SiteCo
return header + reference.slice(rules, map) + siteMap + start + '\n' + renderDecisions(a, ctx) + reference.slice(to)
}
/** ipal-doctor.json: the domain, not launched yet, and every deliberate difference silenced with its reason. */
export function renderDoctorConfig(a: StarterAnswers, ctx: SiteContext): string {
type DoctorRule = { [key: string]: unknown; off?: boolean; reason: string; until?: string }
/**
* ipal-doctor.json: the domain, not launched yet, and every deliberate difference silenced with its reason —
* the reference site's own silences (`inherited`, from its ipal-doctor.json) while the files they cover are in
* the site, CSP report-only for 28 days, and each module the owner turned off.
*/
export function renderDoctorConfig(a: StarterAnswers, ctx: SiteContext, inherited: Record<string, DoctorRule> = {}): string {
const until = new Date(`${ctx.date}T00:00:00Z`)
until.setUTCDate(until.getUTCDate() + 28)
const rules: Record<string, { off: true; reason: string; until?: string }> = {
const kept = Object.entries(inherited).filter(([id]) => id !== 'audit:collections-present' || a.content.collections.length > 0)
const rules: Record<string, DoctorRule> = {
...Object.fromEntries(kept),
csp: { off: true, reason: 'report-only at the start; switch to enforce once the [csp] reports are clean (security.md → ROLL OUT CSP)', until: until.toISOString().slice(0, 10) },
}
for (const skip of auditSkips(a)) {
+5 -3
View File
@@ -18,9 +18,11 @@ import { fileRole } from './manifest.js'
import { applyPlaceholders, applyVariants, leftoverFakes, type StarterFlags } from './text.js'
/** Files the starter writes from the answers; the manifest lists them under `generate`. */
const GENERATORS: Record<string, (a: StarterAnswers, ctx: SiteContext) => string> = {
type Generator = (a: StarterAnswers, ctx: SiteContext, reference: string | undefined) => string
const GENERATORS: Record<string, Generator> = {
'DESIGN.md': (a) => renderDesignMd(a),
'ipal-doctor.json': renderDoctorConfig,
'ipal-doctor.json': (a, ctx, reference) => renderDoctorConfig(a, ctx, reference ? (JSON.parse(reference) as { rules?: Record<string, { reason: string }> }).rules : {}),
'src/design/tokens.ts': (a) => renderTokens(a),
'src/i18n.config.ts': (a) => renderI18nConfig(a),
}
@@ -83,7 +85,7 @@ export function renderSite(bundle: StarterBundle, a: StarterAnswers, ctx: SiteCo
problems.push(`${path}: listed under "generate" but this ipal-kit has no generator for it`)
continue
}
out[path] = generate(a, ctx)
out[path] = generate(a, ctx, bundle.files[path])
}
if (problems.length) {throw new Error(`rendering the site:\n ${problems.join('\n ')}`)}
out['pnpm-lock.yaml'] = bundle.lockfile