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
+2 -2
View File
@@ -139,7 +139,7 @@ export const FLUID_TOKENS = [
export type FluidToken = (typeof FLUID_TOKENS)[number]
export type IpalTokenName = `${(typeof LEGACY_DARK_ROLES)[number]}-dark` | ColorRole | FluidToken | StaticToken
export type IaplTokenName = `${(typeof LEGACY_DARK_ROLES)[number]}-dark` | ColorRole | FluidToken | StaticToken
/** Standard breakpoints in rem (Tailwind 4 defaults). CSS variables can't be used in `@media`. */
export const IPAL_BREAKPOINTS = { '2xl': 96, lg: 64, md: 48, sm: 40, xl: 80 } as const
export const IAPL_BREAKPOINTS = { '2xl': 96, lg: 64, md: 48, sm: 40, xl: 80 } as const
+6 -6
View File
@@ -6,9 +6,9 @@ import { contrastReport, type ContrastRow } from './contrast.js'
import { tokensToCss } from './css.js'
import { defineTokens, type TokensInput } from './define.js'
export const TOKENS_CLI_USAGE = `Usage: ipal-tokens [--in src/design/tokens.ts] [--out src/design/tokens.css] [--check] [--report] [--warn-only]
export const TOKENS_CLI_USAGE = `Usage: iapl-tokens [--in src/design/tokens.ts] [--out src/design/tokens.css] [--check] [--report] [--warn-only]
Generates the brand CSS from the tokens file and checks WCAG contrast.
--check fail when the CSS file is out of date (CI, ipal-doctor); writes nothing
--check fail when the CSS file is out of date (CI, iapl-doctor); writes nothing
--report print every checked pair (for DESIGN.md), not only the failures
--warn-only report contrast failures without failing`
@@ -46,7 +46,7 @@ async function loadTokens(file: string): Promise<TokensInput> {
}
}
/** The `ipal-tokens` command. Returns the exit code. */
/** The `iapl-tokens` command. Returns the exit code. */
export async function runTokensCli(args: string[], { cwd = process.cwd(), log = (line: string) => process.stdout.write(`${line}\n`) }: { cwd?: string; log?: Log } = {}): Promise<number> {
if (args.includes('--help') || args.includes('-h')) {
log(TOKENS_CLI_USAGE)
@@ -56,7 +56,7 @@ export async function runTokensCli(args: string[], { cwd = process.cwd(), log =
const input = resolve(cwd, arg(args, '--in', 'src/design/tokens.ts'))
const output = resolve(cwd, arg(args, '--out', 'src/design/tokens.css'))
if (!existsSync(input)) {
log(`ipal-tokens: ${relative(cwd, input)} not found (copy the template from .agents/skills/ipal-setup/resources/tokens.ts)`)
log(`iapl-tokens: ${relative(cwd, input)} not found (copy the template from .agents/skills/iapl-setup/resources/tokens.ts)`)
return 1
}
const tokens = defineTokens(await loadTokens(input))
@@ -65,7 +65,7 @@ export async function runTokensCli(args: string[], { cwd = process.cwd(), log =
let code = 0
if (args.includes('--check')) {
if (current !== css) {
log(`✗ ${relative(cwd, output)} is out of date — run \`pnpm exec ipal-tokens\``)
log(`✗ ${relative(cwd, output)} is out of date — run \`pnpm exec iapl-tokens\``)
code = 1
} else {log(`✓ ${relative(cwd, output)} is up to date`)}
} else if (current !== css) {
@@ -85,7 +85,7 @@ export async function runTokensCli(args: string[], { cwd = process.cwd(), log =
}
return code
} catch (error) {
log(`ipal-tokens: ${(error as Error).message}`)
log(`iapl-tokens: ${(error as Error).message}`)
return 1
}
}
+1 -1
View File
@@ -51,7 +51,7 @@ const INVERSE_PAIRS: Pair[] = [
/**
* WCAG contrast for every text/background pair the token roles promise, in each
* theme and inside the inverse scope. `ipal-tokens` prints it and fails on an error row.
* theme and inside the inverse scope. `iapl-tokens` prints it and fails on an error row.
*/
export function contrastReport(input: TokensInput = {}): ContrastRow[] {
const themes = input.theme === 'light' || input.theme === 'dark' ? [input.theme] : (['light', 'dark'] as const)
+4 -4
View File
@@ -54,7 +54,7 @@ export function defaultTokensCss(): string {
*
* Light values on :root, dark values on [data-theme="dark"] (on <html> set by <ThemeScript>,
* storage key "theme"; on any element for a dark panel). A brand overrides them in src/design/tokens.css, generated by
* \`ipal-tokens\` from src/design/tokens.ts and imported after this file.
* \`iapl-tokens\` from src/design/tokens.ts and imported after this file.
* Components read only the role names, never "-dark": the roles switch with the theme.
* The type and space scale is in fluid.css / fluid-wide.css — import one of them as well.
*/`,
@@ -84,14 +84,14 @@ const changed = (theme: 'dark' | 'light', colors: Record<ColorRole, string>): En
/**
* The brand's CSS: only what differs from the defaults in tokens.css. This is what
* `ipal-tokens` writes to src/design/tokens.css.
* `iapl-tokens` writes to src/design/tokens.css.
*/
export function tokensToCss(input: TokensInput, { source = 'src/design/tokens.ts' }: { source?: string } = {}): string {
const theme = input.theme ?? 'both'
const { dark, light } = resolveColors(input)
const header = `/*
* GENERATED by \`ipal-tokens\` from ${source} — do not edit; change ${source} and run
* \`pnpm exec ipal-tokens\`. Import it in styles.css after @intecion/ipal-kit/tokens.css (and tailwind.css).
* GENERATED by \`iapl-tokens\` from ${source} — do not edit; change ${source} and run
* \`pnpm exec iapl-tokens\`. Import it in styles.css after @intecion/ipal-kit/tokens.css (and tailwind.css).
*/`
const statics = Object.entries(staticOverrides(input))
const parts = [header]
+2 -2
View File
@@ -48,7 +48,7 @@ export const BRAND_ROLES: readonly ColorRole[] = [
function check(keys: Iterable<string>, known: Record<string, unknown>, where: string) {
for (const key of keys) {
if (!(key in known)) {throw new Error(`ipal-kit tokens: unknown ${where} "${key}"`)}
if (!(key in known)) {throw new Error(`IAPL tokens: unknown ${where} "${key}"`)}
}
}
@@ -62,7 +62,7 @@ export function defineTokens<T extends TokensInput>(input: T): T {
check(Object.keys(input.fs ?? {}).map((k) => `fs-${k}`), FLUID_SCALE, 'fs size')
check(Object.keys(input.space ?? {}).map((k) => `space-${k}`), FLUID_SCALE, 'space size')
if (input.theme && !['both', 'dark', 'light'].includes(input.theme)) {
throw new Error(`ipal-kit tokens: theme must be 'both', 'light' or 'dark'`)
throw new Error(`IAPL tokens: theme must be 'both', 'light' or 'dark'`)
}
return input
}
+1 -1
View File
@@ -40,7 +40,7 @@ const ROOT_PX = 16
export function toRem(value: RemValue): number {
if (typeof value === 'number') {return value}
const m = /^\s*(-?(?:\d+(?:\.\d+)?|\.\d+))\s*(?:(rem|px)\s*)?$/.exec(value)
if (!m) {throw new Error(`ipal-kit tokens: "${value}" is not a size in rem or px`)}
if (!m) {throw new Error(`IAPL tokens: "${value}" is not a size in rem or px`)}
return m[2] === 'px' ? Number(m[1]) / ROOT_PX : Number(m[1])
}
+3 -3
View File
@@ -1,5 +1,5 @@
export { COLOR_DEFAULTS, FLUID_TOKENS, INVERSE_SCOPE, IPAL_BREAKPOINTS, LEGACY_DARK_ROLES, STATIC_DEFAULTS } from './catalog.js'
export type { ColorRole, IpalTokenName } from './catalog.js'
export { COLOR_DEFAULTS, FLUID_TOKENS, INVERSE_SCOPE, IAPL_BREAKPOINTS, LEGACY_DARK_ROLES, STATIC_DEFAULTS } from './catalog.js'
export type { ColorRole, IaplTokenName } from './catalog.js'
export { contrastRatio, parseColor } from './color.js'
export { contrastReport } from './contrast.js'
export type { ContrastRow } from './contrast.js'
@@ -8,4 +8,4 @@ export { defineTokens, resolveColors } from './define.js'
export type { ColorInput, TokensInput } from './define.js'
export { FLUID_RANGES, FLUID_SCALE, fluidClamp } from './fluid.js'
export type { FluidRange, RemValue } from './fluid.js'
export { IPAL_TOKENS, ipalVar } from './names.js'
export { IAPL_TOKENS, iaplVar } from './names.js'
+7 -7
View File
@@ -1,7 +1,7 @@
import {
COLOR_DEFAULTS,
FLUID_TOKENS,
type IpalTokenName,
type IaplTokenName,
LEGACY_DARK_ROLES,
STATIC_DEFAULTS,
} from './catalog.js'
@@ -11,17 +11,17 @@ const NAMES = [
...FLUID_TOKENS,
...Object.keys(STATIC_DEFAULTS),
...LEGACY_DARK_ROLES.map((role) => `${role}-dark`),
] as IpalTokenName[]
] as IaplTokenName[]
/**
* Every token as a ready `var(--ipal-…)` string, keyed by name without the prefix —
* for inline styles, charts, canvas or a styleguide page: `IPAL_TOKENS.primary`.
* for inline styles, charts, canvas or a styleguide page: `IAPL_TOKENS.primary`.
*/
export const IPAL_TOKENS = Object.freeze(
Object.fromEntries(NAMES.map((name) => [name, `var(--ipal-${name})`])) as Record<IpalTokenName, string>,
export const IAPL_TOKENS = Object.freeze(
Object.fromEntries(NAMES.map((name) => [name, `var(--ipal-${name})`])) as Record<IaplTokenName, string>,
)
/** `var(--ipal-<name>)`, with an optional fallback: `ipalVar('surface', '#fff')`. */
export function ipalVar(name: IpalTokenName, fallback?: string): string {
/** `var(--ipal-<name>)`, with an optional fallback: `iaplVar('surface', '#fff')`. */
export function iaplVar(name: IaplTokenName, fallback?: string): string {
return fallback === undefined ? `var(--ipal-${name})` : `var(--ipal-${name}, ${fallback})`
}