Skip to content

Commit f8ada5f

Browse files
Bill LeoutsakosBill Leoutsakos
authored andcommitted
refactor(design): remove legacy checks and Studio captures
1 parent 8b7f841 commit f8ada5f

48 files changed

Lines changed: 464 additions & 10487 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎biome.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@
168168
},
169169
{
170170
"includes": [
171-
"scripts/design-conformance/catalogue.json",
172171
"scripts/design-conformance/contracts.json",
173172
"scripts/design-conformance/contracts.generated.json"
174173
],

‎bun.lock‎

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,13 @@
174174
"@octokit/rest": "^21.0.0",
175175
"@sim/utils": "workspace:*",
176176
"@types/babel__traverse": "7.28.0",
177-
"@types/aria-query": "5.0.4",
178177
"@types/bun": "1.4.1",
179178
"@types/node": "24.2.1",
180179
"@types/opentype.js": "1.3.10",
181180
"@typescript/native": "npm:typescript@^7.0.2",
182181
"@typescript/typescript6": "^6.0.2",
183182
"@vercel/og": "0.6.8",
184183
"ajv": "8.18.0",
185-
"aria-query": "5.3.2",
186184
"color-name": "1.1.4",
187185
"commander": "^11.1.0",
188186
"concurrently": "10.0.5",
@@ -200,7 +198,6 @@
200198
"remark-gfm": "4.0.1",
201199
"remark-parse": "11.0.0",
202200
"sharp": "0.35.4",
203-
"tailwind-merge": "3.6.0",
204201
"tailwindcss": "4.3.3",
205202
"turbo": "2.9.14",
206203
"unified": "11.0.5",

‎scripts/check-design-conformance-appearance.test.ts‎

Lines changed: 0 additions & 542 deletions
This file was deleted.

‎scripts/check-design-conformance-colour-assignments.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect, test } from 'vitest'
2+
import { inspectControlAnalysis } from '#control-analysis/analysis'
23
import { withoutVerifiedColourUsages } from '#control-analysis/colour-assignments'
34
import type { ControlSource } from '#control-analysis/model'
4-
import { inspectSimplifications } from '#control-analysis/simplifications'
55

66
const css = 'apps/sim/components/sample.css'
77
const ui = 'apps/sim/components/sample.tsx'
@@ -21,7 +21,7 @@ function source(files: Record<string, string>): ControlSource {
2121
}
2222
}
2323
const inspect = (files: Record<string, string>) =>
24-
inspectSimplifications(source({ [tokens]: globals, ...files })).colourAssignments
24+
inspectControlAnalysis(source({ [tokens]: globals, ...files })).colourAssignments
2525
const flagged = (files: Record<string, string>) => inspect(files).findings
2626
const issues = (files: Record<string, string>) => {
2727
const report = inspect(files)
@@ -405,8 +405,8 @@ test('landing remains excluded, source is never executed and discovery order is
405405
[ui]: `throw Error('never execute'); export const View=()=> <span className='[--rest:#ff00ff]'/>`,
406406
'apps/sim/app/(landing)/page.tsx': `export const Page=()=> <span className='[--rest:#00ff00]'/>`,
407407
})
408-
const forward = inspectSimplifications(files).colourAssignments
409-
const reverse = inspectSimplifications(
408+
const forward = inspectControlAnalysis(files).colourAssignments
409+
const reverse = inspectControlAnalysis(
410410
{ ...files, entries: [...files.entries].reverse() },
411411
[],
412412
'reverse'

‎scripts/check-design-conformance-command.test.ts‎

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'nod
33
import os from 'node:os'
44
import path from 'node:path'
55
import { fileURLToPath } from 'node:url'
6-
import { createElement } from 'react'
7-
import { renderToStaticMarkup } from 'react-dom/server'
86
import { afterAll, expect, test } from 'vitest'
9-
import { findingFingerprint } from '#control-analysis/review-ledger'
107
import { ciRefs, warningExitCode } from '#design-conformance/ci'
118
import { repositoryRoot } from '#design-conformance/command'
129
import { ConformanceLinter } from '#design-conformance/conformance'
@@ -630,54 +627,6 @@ test('nested CVA condition arrays finish within the real CLI timeout and remain
630627
).toBe(true)
631628
}, 25_000)
632629

633-
test.each([
634-
['grid line integer', 'gridColumnStart', 'grid-column-start', '1', 1, ''],
635-
['grid row integer', 'gridRowEnd', 'grid-row-end', '3', 3, ''],
636-
['animation count', 'animationIterationCount', 'animation-iteration-count', '2', 2, ''],
637-
['border image ratio', 'borderImageSlice', 'border-image-slice', '2', 2, ''],
638-
['vendor line clamp', 'WebkitLineClamp', '-webkit-line-clamp', '2', 2, ''],
639-
['font weight', 'fontWeight', 'font-weight', '600', 600, ''],
640-
['ordinary dimension', 'width', 'width', '1', 1, ''],
641-
['numeric string dimension', 'width', 'width', "'1'", '1', ''],
642-
['numeric alias dimension', 'height', 'height', 'size', 4, 'const size=4;'],
643-
['string member dimension', 'height', 'height', 'sizes.small', '4', "const sizes={small:'4'};"],
644-
['typed grid alias', 'gridColumnEnd', 'grid-column-end', 'line', 2, 'const line=2 as const;'],
645-
['numeric custom variable', '--reserve', '--reserve', '1', 1, ''],
646-
] as const)(
647-
'React numeric style serialization survives the real CLI: %s',
648-
(_name, property, cssProperty, value, runtimeValue, prefix) => {
649-
const { repo } = fixture()
650-
writeFileSync(path.join(repo, ui), 'const A=()=> <button/>')
651-
const base = commit(repo)
652-
writeFileSync(
653-
path.join(repo, ui),
654-
`${prefix}const A=()=> <button style={{'${property}':${value}}}/>`
655-
)
656-
const result = run([
657-
'--repo',
658-
repo,
659-
'--base',
660-
base,
661-
'--working-tree',
662-
'--policy',
663-
'appearance',
664-
'--format',
665-
'json',
666-
])
667-
expect(result.status, result.stderr).toBe(1)
668-
const report = JSON.parse(result.stdout) as Report
669-
expect(report.status).toBe('completed')
670-
const rendered = renderToStaticMarkup(
671-
createElement('button', { style: { [property]: runtimeValue } })
672-
)
673-
const reactValue = rendered.match(/style="[^:"]+:([^"]*)"/)?.[1]
674-
expect(reactValue).toBeTypeOf('string')
675-
expect(report.findings.find((finding) => finding.property === cssProperty)?.value).toBe(
676-
JSON.stringify([reactValue])
677-
)
678-
}
679-
)
680-
681630
test('central numeric-looking style references keep their scalar type ambiguity explicit through the real CLI', () => {
682631
const { repo } = fixture()
683632
mkdirSync(path.join(repo, 'packages/emcn/src'), { recursive: true })
@@ -901,31 +850,6 @@ test.each([
901850
30_000
902851
)
903852

904-
test('external review decisions annotate but never remove a diff finding', () => {
905-
const { repo, base } = fixture()
906-
const args = ['--repo', repo, '--base', base, '--format', 'json']
907-
const raw = JSON.parse(run(args).stdout) as Report
908-
const reviews = path.join(temp, 'reviews.json')
909-
const decision = JSON.stringify({
910-
version: '1.0.0',
911-
entries: [
912-
{
913-
fingerprint: findingFingerprint(raw.findings[0]),
914-
status: 'retained-extra',
915-
rationale: 'Reviewed test treatment',
916-
evidence: '/external/review',
917-
},
918-
],
919-
})
920-
writeFileSync(reviews, decision)
921-
const annotated = JSON.parse(run([...args, '--reviews', reviews]).stdout) as Report
922-
expect(annotated.findings).toEqual(raw.findings)
923-
expect(annotated.reviewDecisions?.matches).toHaveLength(1)
924-
const internal = path.join(repo, 'reviews.json')
925-
writeFileSync(internal, decision)
926-
expect(run([...args, '--reviews', internal]).status).toBe(2)
927-
})
928-
929853
test('landing and docs edits stay out of the diff while product reuse restores helper checks', () => {
930854
const repo = mkdtempSync(path.join(temp, 'scope-'))
931855
git(repo, ['init', '-q'])

0 commit comments

Comments
 (0)