IAPL rename: gate checks, and two breaks they found on an unedited 1.16.7 site
- pnpm legacy:site (scripts/legacy-site-check.mjs): the reference site of v1.16.7, unedited, installed against this build — old commands, doctor without errors, import map unchanged, tsc, builds with webpack and Turbopack - test/legacyNameForms.test.ts: the remaining spellings with 'ipal' as a closed list; a new one fails - found by legacy:site and fixed: 'ipal-tokens --check' called a tokens.css written before 1.17.0 out of date (its header names the command); the doctor's env-example rule did not accept IPAL_* in .env.example - the doctor's seed rules catch IPAL_SEED_ALLOW_FULL=1 as before - PROGRAMISTA: the new release check Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
b91984fbcd
commit
926ba4a67e
@@ -46,6 +46,9 @@ async function loadTokens(file: string): Promise<TokensInput> {
|
||||
}
|
||||
}
|
||||
|
||||
/** The two header lines of a generated file that name the command (`ipal-tokens` before 1.17.0). */
|
||||
const LEGACY_HEADER = /^ \* (?:GENERATED by `ipal-tokens` from|`pnpm exec ipal-tokens`\.) .*$/gm
|
||||
|
||||
/** 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')) {
|
||||
@@ -64,7 +67,8 @@ export async function runTokensCli(args: string[], { cwd = process.cwd(), log =
|
||||
const current = existsSync(output) ? readFileSync(output, 'utf8') : null
|
||||
let code = 0
|
||||
if (args.includes('--check')) {
|
||||
if (current !== css) {
|
||||
// A file written before 1.17.0 names the command `ipal-tokens` in its header: the same tokens, not out of date.
|
||||
if (current !== css && current?.replace(LEGACY_HEADER, (line) => line.replace('ipal-tokens', 'iapl-tokens')) !== css) {
|
||||
log(`✗ ${relative(cwd, output)} is out of date — run \`pnpm exec iapl-tokens\``)
|
||||
code = 1
|
||||
} else {log(`✓ ${relative(cwd, output)} is up to date`)}
|
||||
|
||||
Reference in New Issue
Block a user