Skip to content

Commit 1906ebd

Browse files
chore: map ModalFooter/ModalFocus to MMDS, retroactively complete ModalBody/ModalOverlay targets, add sync-config auto-promotion
- config.json: map ModalFooter and ModalFocus to @metamask/design-system-react; update mobile Skeleton replacement to @metamask/design-system-react-native; add ModalFocus and ModalFooter to extension currentComponents - scripts/sync-config.js: auto-promote migration-targets entries to complete when the component appears in the MMDS component list, preventing future drift - metrics/migration-targets.json: retroactively mark ModalBody and ModalOverlay as complete (extension 27/48 → 29/48); ModalFocus and ModalFooter remain to_do as they only landed in MMDS this week Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 93c6f7a commit 1906ebd

4 files changed

Lines changed: 52 additions & 10 deletions

File tree

config.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,21 @@
181181
"paths": [
182182
"ui/components/component-library/modal-footer/modal-footer.tsx"
183183
],
184-
"replacement": null,
184+
"replacement": {
185+
"component": "ModalFooter",
186+
"package": "@metamask/design-system-react"
187+
},
185188
"_deprecationMessage": null,
186189
"_autoGenerated": true
187190
},
188191
"ModalFocus": {
189192
"paths": [
190193
"ui/components/component-library/modal-focus/modal-focus.tsx"
191194
],
192-
"replacement": null,
195+
"replacement": {
196+
"component": "ModalFocus",
197+
"package": "@metamask/design-system-react"
198+
},
193199
"_deprecationMessage": null,
194200
"_autoGenerated": true
195201
},
@@ -527,6 +533,8 @@
527533
"Jazzicon",
528534
"Maskicon",
529535
"ModalBody",
536+
"ModalFocus",
537+
"ModalFooter",
530538
"ModalOverlay",
531539
"Text",
532540
"TextButton"
@@ -601,9 +609,8 @@
601609
"app/component-library/components/Skeleton/Skeleton.tsx"
602610
],
603611
"replacement": {
604-
"component": "ComponentsTemp",
605-
"package": "component-library",
606-
"path": "app/component-library/components/ComponentsTemp"
612+
"component": "Skeleton",
613+
"package": "@metamask/design-system-react-native"
607614
},
608615
"_deprecationMessage": "*\n * @deprecated Please update your code to use `Skeleton` from `app/component-library/components-temp/Skeleton`.\n * The API may have changed — compare props before migrating.\n * @see {@link https://github.com/MetaMask/metamask-design-system/blob/main/packages/design-system-react-native/src/components/Skeleton/README.md}\n * @since @metamask/design-system-react-native@0.7.0\n ",
609616
"_autoGenerated": true

dashboard/public/metrics/migration-targets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@
346346
},
347347
{
348348
"name": "ModalBody",
349-
"status": "to_do"
349+
"status": "complete"
350350
},
351351
{
352352
"name": "ModalContent",
@@ -366,7 +366,7 @@
366366
},
367367
{
368368
"name": "ModalOverlay",
369-
"status": "to_do"
369+
"status": "complete"
370370
},
371371
{
372372
"name": "Popover",

metrics/migration-targets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@
346346
},
347347
{
348348
"name": "ModalBody",
349-
"status": "to_do"
349+
"status": "complete"
350350
},
351351
{
352352
"name": "ModalContent",
@@ -366,7 +366,7 @@
366366
},
367367
{
368368
"name": "ModalOverlay",
369-
"status": "to_do"
369+
"status": "complete"
370370
},
371371
{
372372
"name": "Popover",

scripts/sync-config.js

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,42 @@ async function sync(options = {}) {
175175
console.log();
176176
}
177177

178-
// Step 8: Write config (unless --dry-run)
178+
// Step 8: Auto-update migration-targets.json based on MMDS availability
179+
const MIGRATION_TARGETS_PATH = path.join(REPO_ROOT, 'metrics', 'migration-targets.json');
180+
try {
181+
const targetsContent = await fs.readFile(MIGRATION_TARGETS_PATH, 'utf8');
182+
const targets = JSON.parse(targetsContent);
183+
const reactSet = new Set(mmdsComponents.react.map(c => c.toLowerCase()));
184+
const reactNativeSet = new Set(mmdsComponents.reactNative.map(c => c.toLowerCase()));
185+
186+
let targetsChanged = 0;
187+
for (const [project, componentSet] of [['extension', reactSet], ['mobile', reactNativeSet]]) {
188+
if (!targets[project]?.components) continue;
189+
for (const entry of targets[project].components) {
190+
if (entry.status === 'to_do' && componentSet.has(entry.name.toLowerCase())) {
191+
entry.status = 'complete';
192+
targetsChanged++;
193+
console.log(` ✓ migration-targets: [${project}] ${entry.name} → complete (now in MMDS)`);
194+
}
195+
}
196+
}
197+
198+
if (targetsChanged > 0) {
199+
targets.generatedAt = new Date().toISOString();
200+
if (!dryRun) {
201+
await fs.writeFile(MIGRATION_TARGETS_PATH, JSON.stringify(targets, null, 2));
202+
console.log(`\n✅ migration-targets.json updated (${targetsChanged} component(s) marked complete)\n`);
203+
} else {
204+
console.log(`\n🔍 DRY RUN - Would mark ${targetsChanged} component(s) complete in migration-targets.json\n`);
205+
}
206+
} else {
207+
console.log(' ℹ️ migration-targets.json already up to date\n');
208+
}
209+
} catch (err) {
210+
console.warn(' ⚠️ Could not update migration-targets.json:', err.message, '\n');
211+
}
212+
213+
// Step 9: Write config (unless --dry-run)
179214
if (dryRun) {
180215
console.log('🔍 DRY RUN - No changes written to config.json\n');
181216
} else {

0 commit comments

Comments
 (0)