feat: Enterprise DSS architecture implementation
Some checks failed
DSS Project Analysis / dss-context-update (push) Has been cancelled

Complete implementation of enterprise design system validation:

Phase 1 - @dss/rules npm package:
- CLI with validate and init commands
- 16 rules across 5 categories (colors, spacing, typography, components, a11y)
- dss-ignore support (inline and next-line)
- Break-glass [dss-skip] for emergency merges
- CI workflow templates (Gitea, GitHub, GitLab)

Phase 2 - Metrics dashboard:
- FastAPI metrics API with SQLite storage
- Portfolio-wide metrics aggregation
- Project drill-down with file:line:column violations
- Trend charts and history tracking

Phase 3 - Local analysis cache:
- LocalAnalysisCache for offline-capable validation
- Mode detection (LOCAL/REMOTE/CI)
- Stale cache warnings with recommendations

Phase 4 - Project onboarding:
- dss-init command for project setup
- Creates ds.config.json, .dss/ folder structure
- Updates .gitignore and package.json scripts
- Optional CI workflow setup

Architecture decisions:
- No commit-back: CI uploads to dashboard, not git
- Three-tier: Dashboard (read-only) → CI (authoritative) → Local (advisory)
- Pull-based rules via npm for version control

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
DSS
2025-12-11 09:41:36 -03:00
parent ab8769933d
commit 9dbd56271e
27 changed files with 3888 additions and 398 deletions

View File

@@ -10,7 +10,7 @@
{
"id": "use-design-system-components",
"name": "Use Design System Components",
"description": "Prefer design system components over custom implementations",
"description": "Prefer design system components over native HTML or custom implementations",
"severity": "error",
"components": {
"required": {
@@ -44,17 +44,12 @@
"severity": "error",
"validation": {
"Button": {
"requiredProps": ["variant", "size"],
"conditionalProps": {
"loading": ["loadingText"],
"icon": ["aria-label"]
}
"requiredProps": ["variant"],
"conditionalProps": { "loading": ["loadingText"], "icon": ["aria-label"] }
},
"Input": {
"requiredProps": ["label", "name"],
"conditionalProps": {
"error": ["errorMessage"]
}
"conditionalProps": { "error": ["errorMessage"] }
},
"Modal": {
"requiredProps": ["title", "onClose"],
@@ -62,52 +57,15 @@
}
}
},
{
"id": "component-composition",
"name": "Component Composition Patterns",
"description": "Follow recommended composition patterns for complex UIs",
"severity": "info",
"patterns": {
"forms": {
"structure": ["Form", "FormField", "Input/Select", "Button"],
"guidelines": [
"Wrap inputs in FormField for consistent labeling",
"Use Form component for validation handling",
"Place submit button inside Form"
]
},
"lists": {
"structure": ["List", "ListItem"],
"guidelines": [
"Use semantic list components for accessibility",
"Implement virtualization for 50+ items"
]
},
"navigation": {
"structure": ["Nav", "NavItem", "NavLink"],
"guidelines": [
"Use Nav component for main navigation",
"Implement active state handling"
]
}
}
},
{
"id": "no-inline-styles",
"name": "No Inline Styles on Components",
"description": "Components should use className/variant props, not style attribute",
"severity": "warning",
"patterns": {
"forbidden": [
"style={{",
"style={{"
],
"exceptions": [
"dynamic positioning",
"animations",
"calculated values"
]
}
"forbidden": ["style={{", "style={"]
},
"exceptions": ["dynamic positioning", "animations", "calculated values"]
}
],
"adoption": {
@@ -116,10 +74,6 @@
"target": 80,
"excellent": 95
},
"metrics": [
"percentage_using_ds_components",
"custom_component_count",
"token_compliance_rate"
]
"metrics": ["percentage_using_ds_components", "custom_component_count", "token_compliance_rate"]
}
}