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
@@ -194,6 +194,20 @@ describe('iapl-tokens CLI', () => {
|
||||
expect(lines.join('\n')).toMatch(/out of date/)
|
||||
})
|
||||
|
||||
test('a file generated before 1.17.0 (header names `ipal-tokens`) is up to date; a changed value is not', async () => {
|
||||
writeFileSync(path.join(dir, 'tokens.json'), JSON.stringify({ color: { light: { primary: '#1d4ed8' } } }))
|
||||
const args = ['--in', 'tokens.json', '--out', 'out/tokens.css']
|
||||
expect(await runTokensCli(args, { cwd: dir, log })).toBe(0)
|
||||
const file = path.join(dir, 'out/tokens.css')
|
||||
const old = readFileSync(file, 'utf8').replaceAll('iapl-tokens', 'ipal-tokens')
|
||||
expect(old).toContain('GENERATED by `ipal-tokens`')
|
||||
writeFileSync(file, old)
|
||||
expect(await runTokensCli([...args, '--check'], { cwd: dir, log })).toBe(0)
|
||||
expect(readFileSync(file, 'utf8')).toBe(old) // --check writes nothing
|
||||
writeFileSync(file, old.replace('#1d4ed8', '#000000'))
|
||||
expect(await runTokensCli([...args, '--check'], { cwd: dir, log })).toBe(1)
|
||||
})
|
||||
|
||||
test('fails on a contrast error unless --warn-only', async () => {
|
||||
writeFileSync(path.join(dir, 'tokens.json'), JSON.stringify({ color: { light: { primary: '#ffeb3b' } } }))
|
||||
const args = ['--in', 'tokens.json', '--out', 'tokens.css']
|
||||
|
||||
Reference in New Issue
Block a user