@utopia-studio-design/design-system-cli 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Ceramic QA repair release — 2026-09-06
|
|
2
|
+
|
|
3
|
+
Release branch: `codex/qa-fixes-round-12`.
|
|
4
|
+
|
|
5
|
+
Includes the accumulated documented QA repairs through Round 12, plus the shared no-scrollbar-chrome contract. Native wheel, touch and keyboard scrolling remain enabled. Studio tabs and combobox hover states no longer opt back into visible scrollbars.
|
|
6
|
+
|
|
7
|
+
Development validation: Vitest 13 files / 79 tests passed; CLI generation and MCP protocol, component contracts, semantic page ownership and workspace setup audits passed. Generated Dashboard Composer consumer build passed. Playwright asset concurrency, validation, retry and scrollbar regression suites: 20 passed across desktop/mobile Chromium and English/Arabic scrollbar cases. An initial run was interrupted by concurrent package rebuild; the isolated rerun passed all 20 cases.
|
|
8
|
+
|
|
9
|
+
Rams quick_review was attempted but the workspace review credits were exhausted. The pre-commit review_files attempt failed at the provider transport; no score was obtained.
|
|
10
|
+
|
|
11
|
+
This release does not mark independent QA reports closed. Server Designer Agent activation remains disabled under the existing production configuration.
|
package/lib/template-runtime.mjs
CHANGED
|
@@ -1 +1,56 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const TEMPLATE_MODES = ['exact', 'adapt', 'explore']
|
|
2
|
+
|
|
3
|
+
const MODE_POLICIES = {
|
|
4
|
+
exact: {
|
|
5
|
+
locked: ['sectionOrder', 'componentTree', 'layoutGrid', 'spacingScale', 'typeScale', 'responsiveRules'],
|
|
6
|
+
editable: ['content', 'media', 'approvedData'],
|
|
7
|
+
},
|
|
8
|
+
adapt: {
|
|
9
|
+
locked: ['sectionOrder', 'componentTree', 'layoutGrid', 'responsiveRules'],
|
|
10
|
+
editable: ['content', 'media', 'semanticTheme', 'approvedVariants', 'approvedData'],
|
|
11
|
+
},
|
|
12
|
+
explore: {
|
|
13
|
+
locked: ['semanticRoles', 'accessibility', 'componentAllowlist'],
|
|
14
|
+
editable: ['content', 'media', 'semanticTheme', 'approvedVariants', 'sectionOrder', 'optionalSections'],
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function resolveTemplateContract(template, { mode = 'adapt', theme = 'utopia-default' } = {}) {
|
|
19
|
+
if (!TEMPLATE_MODES.includes(mode)) throw new Error(`Unknown template mode "${mode}".`)
|
|
20
|
+
const contract = template.executionContract
|
|
21
|
+
if (!contract) throw new Error(`Template "${template.id}" has no executionContract.`)
|
|
22
|
+
const modePolicy = contract.modes?.[mode] ?? MODE_POLICIES[mode]
|
|
23
|
+
return {
|
|
24
|
+
apiVersion: 1,
|
|
25
|
+
templateId: template.id,
|
|
26
|
+
mode,
|
|
27
|
+
theme,
|
|
28
|
+
locked: [...new Set([...(contract.alwaysLocked ?? []), ...(modePolicy.locked ?? [])])],
|
|
29
|
+
editable: modePolicy.editable ?? [],
|
|
30
|
+
componentAllowlist: contract.componentAllowlist ?? [],
|
|
31
|
+
tokenPolicy: contract.tokenPolicy,
|
|
32
|
+
contentPolicy: contract.contentPolicy,
|
|
33
|
+
validation: contract.validation,
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function validateTemplateArtifact(contract, artifact) {
|
|
38
|
+
const errors = []
|
|
39
|
+
const allowed = new Set(contract.componentAllowlist ?? [])
|
|
40
|
+
for (const component of artifact.components ?? []) {
|
|
41
|
+
if (allowed.size && !allowed.has(component)) errors.push(`Unknown component: ${component}`)
|
|
42
|
+
}
|
|
43
|
+
if (contract.validation?.allowAdHocColors === false && (artifact.adHocColors?.length ?? 0) > 0) {
|
|
44
|
+
errors.push('Ad-hoc colors are not allowed.')
|
|
45
|
+
}
|
|
46
|
+
if (contract.validation?.allowAdHocSpacing === false && (artifact.adHocSpacing?.length ?? 0) > 0) {
|
|
47
|
+
errors.push('Ad-hoc spacing is not allowed.')
|
|
48
|
+
}
|
|
49
|
+
if (contract.locked.includes('sectionOrder') && artifact.sectionOrder) {
|
|
50
|
+
const expected = contract.contentPolicy?.sectionOrder ?? []
|
|
51
|
+
if (expected.length && JSON.stringify(expected) !== JSON.stringify(artifact.sectionOrder)) {
|
|
52
|
+
errors.push('Section order violates the template contract.')
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return { ok: errors.length === 0, errors }
|
|
56
|
+
}
|