roast-my-design-system 4.2.3 → 4.2.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roast-my-design-system",
3
- "version": "4.2.3",
3
+ "version": "4.2.4",
4
4
  "description": "Your AI can write the UI. This makes sure it writes your UI. A deterministic scanner counts every colour, spacing value and duplicate component, scores you 0-100 against 34 public repos, scopes the scan with .roastignore, injects agent rules with --apply.",
5
5
  "keywords": [
6
6
  "design-system",
@@ -160,10 +160,19 @@ export function profileRepo(root, files) {
160
160
  const knownLib = KNOWN_LIBRARIES.find((d) => deps[d.pkg]);
161
161
  const homegrown = files.code.filter((f) => /(^|\/)components\//.test(f) && !/\/components\/ui\//.test(f) && /\.(tsx|jsx)$/.test(f));
162
162
 
163
+ // A design system does not have to arrive through npm. A stylesheet defining
164
+ // a real set of CSS custom properties IS one — arguably the purest form —
165
+ // and calling it "none" undersells exactly the discipline the ideal asks for.
166
+ const tokenDefs = files.styles.slice(0, 8).reduce((sum, f) => {
167
+ const css = read(join(root, f));
168
+ return sum + (css ? (css.match(/--[A-Za-z0-9_-]+\s*:/g) ?? []).length : 0);
169
+ }, 0);
170
+
163
171
  let designSystem;
164
172
  if (isShadcn) designSystem = { kind: 'shadcn', name: 'shadcn/ui', confidence: 'high' };
165
173
  else if (knownLib) designSystem = { kind: 'library', name: knownLib.name, pkg: knownLib.pkg, confidence: 'high' };
166
174
  else if (homegrown.length >= 3) designSystem = { kind: 'custom', name: 'custom (unrecognized)', confidence: 'low' };
175
+ else if (tokenDefs >= 5) designSystem = { kind: 'custom', name: 'CSS tokens', confidence: 'medium' };
167
176
  else designSystem = { kind: 'none', confidence: 'high' };
168
177
 
169
178
  // Import alias from tsconfig paths or components.json
@@ -175,7 +184,10 @@ export function profileRepo(root, files) {
175
184
  if (key) alias = key.replace('/*', '');
176
185
  }
177
186
 
178
- const styling = STYLING_DEPS.filter((s) => deps[s.pkg]).map((s) => s.label);
187
+ // No toolchain in package.json does not mean no styling: if the walk found
188
+ // real stylesheets, plain CSS is what is there — say so, not "none detected".
189
+ let styling = STYLING_DEPS.filter((s) => deps[s.pkg]).map((s) => s.label);
190
+ if (!styling.length && files.styles.length) styling = ['plain CSS'];
179
191
 
180
192
  // The git remote is a far better identity than package.json's name field
181
193
  // ("chatbot" vs "vercel/ai-chatbot"). Parsed from .git/config, no git exec.
@@ -1,4 +1,4 @@
1
1
  // Single version constant for the engine — imported by diagnose (report
2
2
  // footer) and rules (generated-by line). This is the bump spot that used to
3
3
  // live as a const inside diagnose/index.mjs.
4
- export const VERSION = '4.2.3';
4
+ export const VERSION = '4.2.4';