IAPL rename, scripted: preferred names in src, bin, scripts, services, tests; bin files and skill folders moved

Replaced by an explicit list of forms only (ten exported names, runtime env names, project file
names and marks, commands, skill names, the log prefix, the brand in prose). Package name, import
paths, routes, CSS tokens, data attributes, custom keys, context flags, the cookie and kv keys are
not touched. package.json keeps the five old bin names beside the five new ones.
The old names stop working in this commit and come back as aliases in the next; docs follow.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 17:24:21 +01:00
co-authored by Claude Fable 5.2
parent 414a4702df
commit 0a4f001797
262 changed files with 955 additions and 950 deletions
+4 -4
View File
@@ -27,7 +27,7 @@ export type EnvRule = {
export type AssertEnvOptions = {
/** Source of values. Default process.env. */
env?: Record<string, string | undefined>
/** Error prefix. Default '[ipal]'. */
/** Error prefix. Default '[iapl]'. */
label?: string
}
@@ -86,8 +86,8 @@ function checkValue(rule: EnvRule, value: string): null | string {
* aggregated error listing every problem at once (not just the first). Call it
* once at boot — in payload.config.ts, or Next's instrumentation.ts register().
*
* import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit'
* assertEnv(ipalEnvRules({ storage: true, turnstile: true }))
* import { assertEnv, iaplEnvRules } from '@intecion/ipal-kit'
* assertEnv(iaplEnvRules({ storage: true, turnstile: true }))
*
* or with hand-written rules:
*
@@ -102,7 +102,7 @@ function checkValue(rule: EnvRule, value: string): null | string {
*/
export function assertEnv(rules: EnvRule[], options: AssertEnvOptions = {}): void {
const env = options.env ?? process.env
const label = options.label ?? '[ipal]'
const label = options.label ?? '[iapl]'
const problems: string[] = []
for (const rule of rules) {
@@ -4,7 +4,7 @@ type TurnstileNames = { secretVar?: string; siteKeyVar?: string }
import { checkDatabaseName } from './databaseName.js'
export type IpalEnvFeatures = {
export type IaplEnvFeatures = {
/**
* Cookie crawl (cookieScanner.crawl): the scanner service URL and the shared
* token (at least 16 characters). Required in production only.
@@ -22,7 +22,7 @@ export type IpalEnvFeatures = {
/** Microsoft Graph e-mail (graphAdapter). Adds the GRAPH_* vars. */
emailGraph?: boolean
/**
* Require IPAL_IP_HEADER in production — the header the rate limit trusts for
* Require IAPL_IP_HEADER in production — the header the rate limit trusts for
* the client IP (see clientIp). Outside production it stays optional.
*/
ipHeader?: boolean
@@ -55,7 +55,7 @@ export type IpalEnvFeatures = {
}
/**
* The env schema for a standard ipal-kit deploy, assembled from the features the
* The env schema for a standard IAPL deploy, assembled from the features the
* project actually uses — so a site on local-disk storage isn't forced to set
* R2_*, and a site with no forms isn't forced to set Turnstile. Opt-in, not a
* fixed required set (A0: the plugin never demands config a project doesn't use).
@@ -64,16 +64,16 @@ export type IpalEnvFeatures = {
* NEXT_PUBLIC_SERVER_URL). DATABASE_URI and PAYLOAD_SECRET are Payload-core.
* Override any name via the options if your project names them differently.
*
* assertEnv(ipalEnvRules({ storage: true, emailGraph: true, turnstile: true }))
* assertEnv(iaplEnvRules({ storage: true, emailGraph: true, turnstile: true }))
*
* Extend with project-specific vars by spreading:
*
* assertEnv([
* ...ipalEnvRules({ storage: true }),
* ...iaplEnvRules({ storage: true }),
* { name: 'MY_API_KEY', description: 'Third-party integration key' },
* ])
*/
export function ipalEnvRules(features: IpalEnvFeatures = {}): EnvRule[] {
export function iaplEnvRules(features: IaplEnvFeatures = {}): EnvRule[] {
const {
cookieCrawl = false,
databaseName = false,
@@ -95,7 +95,7 @@ export function ipalEnvRules(features: IpalEnvFeatures = {}): EnvRule[] {
...(secretMinLength > 0 && process.env.NODE_ENV === 'production' && {
validate: (value: string) =>
value.length >= secretMinLength ||
`${secretVar} must be at least ${secretMinLength} characters in production (got ${value.length}) — use a long random value, or ipalEnvRules({ secretMinLength }) to change the minimum (0 turns the check off)`,
`${secretVar} must be at least ${secretMinLength} characters in production (got ${value.length}) — use a long random value, or iaplEnvRules({ secretMinLength }) to change the minimum (0 turns the check off)`,
}),
},
{ name: serverUrlVar, description: 'Public site origin, e.g. https://example.com', kind: 'url' },
@@ -148,22 +148,22 @@ export function ipalEnvRules(features: IpalEnvFeatures = {}): EnvRule[] {
if (ipHeader) {
rules.push({
name: 'IPAL_IP_HEADER',
name: 'IAPL_IP_HEADER',
description: 'Header holding the real client IP, e.g. cf-connecting-ip (Cloudflare) or x-forwarded-for',
required: process.env.NODE_ENV === 'production',
validate: (v) => (/^[a-z0-9-]+$/i.test(v) ? true : `IPAL_IP_HEADER must be a header name (got "${v}")`),
validate: (v) => (/^[a-z0-9-]+$/i.test(v) ? true : `IAPL_IP_HEADER must be a header name (got "${v}")`),
})
}
if (cookieCrawl) {
const required = process.env.NODE_ENV === 'production'
rules.push(
{ name: 'IPAL_COOKIE_SCAN_URL', description: 'Cookie crawler service base URL, e.g. https://cookie-crawler.example.com', kind: 'url', required },
{ name: 'IAPL_COOKIE_SCAN_URL', description: 'Cookie crawler service base URL, e.g. https://cookie-crawler.example.com', kind: 'url', required },
{
name: 'IPAL_COOKIE_SCAN_TOKEN',
description: 'Token shared with the cookie crawler (this site\'s entry in IPAL_CRAWLER_SITES)',
name: 'IAPL_COOKIE_SCAN_TOKEN',
description: 'Token shared with the cookie crawler (this site\'s entry in IAPL_CRAWLER_SITES)',
required,
validate: (v) => (v.length >= 16 ? true : 'IPAL_COOKIE_SCAN_TOKEN must be at least 16 characters'),
validate: (v) => (v.length >= 16 ? true : 'IAPL_COOKIE_SCAN_TOKEN must be at least 16 characters'),
},
)
}
@@ -183,7 +183,7 @@ export function ipalEnvRules(features: IpalEnvFeatures = {}): EnvRule[] {
}
if (databaseName) {
const { domain, warn = (message: string) => console.warn(`[ipal] ${message}`) } = databaseName === true ? {} : databaseName
const { domain, warn = (message: string) => console.warn(`[iapl] ${message}`) } = databaseName === true ? {} : databaseName
rules.push({
name: databaseVar,
description: 'Database name: <domain without dots>_prod / _dev (warning only)',
+2 -2
View File
@@ -1,5 +1,5 @@
export { assertEnv } from './assertEnv.js'
export type { AssertEnvOptions, EnvKind, EnvRule } from './assertEnv.js'
export { checkDatabaseName, databaseNameFromUri, databaseNamesFor } from './databaseName.js'
export { ipalEnvRules } from './ipalEnvRules.js'
export type { IpalEnvFeatures } from './ipalEnvRules.js'
export { iaplEnvRules } from './iaplEnvRules.js'
export type { IaplEnvFeatures } from './iaplEnvRules.js'