trdr-ds-install 1.2.1 → 1.2.2

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": "trdr-ds-install",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Installs the TRDR Design System skill for Claude Code",
5
5
  "bin": {
6
6
  "trdr-ds-install": "./bin/install.js"
@@ -89,6 +89,42 @@ Flag any gradient that doesn't reference a TRDR gradient token (`var(--gradient-
89
89
  **H — Hardcoded font-size in px** (should use .trdr-h* / .trdr-body-* text style classes):
90
90
  Search: `font-size:\s*\d+px` in CSS/SCSS files (skip tokens.css itself)
91
91
 
92
+ ### Step 3.5 — Detect component replacement candidates
93
+
94
+ Scan the project for UI patterns that indicate elements replaceable by TRDR implemented components.
95
+
96
+ **Scope:** `*.tsx, *.jsx, *.ts, *.js, *.html, *.vue` — exclude `node_modules/, .next/, dist/, build/, out/`.
97
+
98
+ Use Grep (not Bash grep) to search for the patterns below. Group patterns from the same slug into a single call.
99
+
100
+ **Pattern table per TRDR implemented component:**
101
+
102
+ | Slug | Search patterns |
103
+ |------|----------------|
104
+ | `button` | `<button`, `<Button`, `type="submit"`, `type="button"`, `role="button"` |
105
+ | `text-input` | `<input`, `<TextInput`, `<textarea`, `type="text"`, `type="email"`, `type="password"`, `type="search"` |
106
+ | `checkbox` | `type="checkbox"`, `<Checkbox`, `\.checkbox` |
107
+ | `radio-button` | `type="radio"`, `<RadioButton`, `<Radio[^B]` |
108
+ | `switch` | `<Switch`, `role="switch"`, `\.toggle`, `\.switch` |
109
+ | `dropdown` | `<select`, `<Select`, `<Dropdown`, `role="listbox"`, `role="combobox"` |
110
+ | `combo-input` | `<ComboInput`, `combo.{0,10}input` |
111
+ | `tooltip` | `<Tooltip`, `role="tooltip"`, `data-tooltip` |
112
+ | `abas` | `<Tabs`, `role="tablist"`, `role="tab"`, `\.tabs` |
113
+ | `segmented-control` | `<SegmentedControl`, `\.segmented`, `segment.{0,15}control` |
114
+ | `sub-menu-item` | `<MenuItem`, `<SubMenu`, `\.menu-item`, `\.submenu` |
115
+ | `card` | `<Card`, `\.card`, `<article` |
116
+ | `boleta` | `<Boleta`, `boleta` |
117
+ | `janela` | `<Janela`, `trading.{0,10}window` |
118
+
119
+ **Rules:**
120
+ - For each slug, count the distinct files that matched (not total lines) — one file counts as one occurrence.
121
+ - Discard matches in test files (`*.test.*`, `*.spec.*`) — those don't count as UI usage.
122
+ - Store results as a list of `{ slug, files: ["path:line", ...] }` — used in Step 5 and Phase 2 Step 6.
123
+ - If a slug has zero matches, omit it from the replacement candidates list.
124
+ - `title=""` attribute is too noisy — do NOT use it for tooltip detection; prefer `<Tooltip` / `role="tooltip"` / `data-tooltip`.
125
+
126
+ **Output:** `replacementCandidates[]` — passed to Step 5 template and Phase 2 Step 6.
127
+
92
128
  ### Step 4 — Load component catalog (offline-first)
93
129
 
94
130
  Read the local snapshot from the skill directory:
@@ -180,13 +216,21 @@ Output the following report and **do not proceed** until the developer explicitl
180
216
  | Hardcoded font-size | N | `font-size: 22px` in card.css:99 |
181
217
 
182
218
  ### TRDR COMPONENTS REFERENCED IN PROJECT:
183
- [Cross-reference detected UI patterns with the catalog]
184
-
185
- | Slug | Status | Project usage |
186
- |------|--------|---------------|
187
- | button | implemented | 6 occurrences in Button.tsx, Header.tsx |
188
- | modal | ⚠️ stub (figmaId 1234:5) | 2 occurrences in Modal.tsx — will receive token guidance, not full code |
189
- | (other) | ... | ... |
219
+ (Candidatos detectados no Step 3.5 substituição recomendada)
220
+
221
+ | Componente | Status no catálogo | Arquivos detectados |
222
+ |------------|--------------------|---------------------|
223
+ [For each entry in replacementCandidates[], look up the slug in the loaded catalog:]
224
+ [If c.implemented === true:]
225
+ | [c.name] | implementado | [list of file:line from Step 3.5] |
226
+ [If c.implemented === false:]
227
+ | [c.name] | ⚠️ stub (figmaId [c.figmaId]) | [list of file:line] — receberá banner comment |
228
+ [If replacementCandidates is empty:]
229
+ | — | Nenhum candidato detectado | — |
230
+
231
+ > **Implementados:** o CSS já estará em `components.css` após a Fase 2 — o dev só precisa trocar as classes.
232
+ > **Stubs:** receberão banner comment com tokens recomendados + entrada em `MISSING_COMPONENTS.md`.
233
+ > **Não listados aqui:** componentes específicos da TRDR (boleta, janela) — verificar manualmente se o projeto os usa.
190
234
 
191
235
  ### SCOPE ESTIMATE: [Small / Medium / Large]
192
236
  Small = <10 violations | Medium = 10–50 | Large = 50+
@@ -424,7 +468,7 @@ For each violation found in Phase 1, apply the semantic token replacement.
424
468
 
425
469
  ### Step 6 — Apply component code (smart fallback)
426
470
 
427
- For each detected UI pattern in the project that matches a TRDR component slug:
471
+ Use the `replacementCandidates[]` list built in Phase 1 Step 3.5. For each entry:
428
472
 
429
473
  1. **Look up the component** in the loaded catalog by slug (or by category, if slug is ambiguous).
430
474
  2. **If `c.implemented === true`** and `c.code.css` exists: