Skip to content

chore(js-ts): Convert store migrations 000-027 to TypeScript#613

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1777472294-js-ts-migrations-000-009
Open

chore(js-ts): Convert store migrations 000-027 to TypeScript#613
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1777472294-js-ts-migrations-000-009

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 29, 2026

Summary

Converts all 28 store migration files (000-027) from JavaScript to TypeScript, plus renames 10 associated test files from .test.js to .test.ts. This is part of the ongoing incremental JS→TS migration effort.

Changes:

  • Renamed app/store/migrations/000.js through 027.js.ts
  • Added state: Record<string, unknown> parameter types to all migrate() functions
  • Used type assertions for nested state.engine.backgroundState.* property access
  • Defined local interfaces where structured data required them (e.g., Token, TransactionMeta, NetworkConfiguration)
  • Migrations 023-026 already used @metamask/utils type guards (isObject, hasProperty) — those patterns were preserved
  • Renamed 10 test files (019-028.test.js.test.ts)
  • No logic changes — types only

Files changed (53):

  • 28 migration files: .js.ts with type annotations
  • 10 test files: .test.js.test.ts (content unchanged)

Review & Testing Checklist for Human

  • Verify that migration type assertions match the expected runtime state shapes (especially migrations 000-018 which use as casts rather than runtime type guards)
  • Confirm test files still pass after rename (test content is unchanged, only extension changed)
  • Verify app/store/migrations/index.ts imports resolve correctly (extensionless imports should pick up .ts files)

Notes

Link to Devin session: https://app.devin.ai/sessions/51734166b8b740daa75579e47f5a94be
Requested by: @lukepage-COG


Devin Review

Status Commit
⚪ Not started

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

…Script

- Rename all 28 migration files (000.js through 027.js) to .ts
- Add type annotations to all migrate() function signatures
- Use Record<string, unknown> for state parameter type
- Add type assertions for nested state.engine.backgroundState.* access
- Define interfaces for structured data (Token, TransactionMeta, etc.)
- Migrations 023-026 already used @metamask/utils type guards (isObject/hasProperty)
- Rename 10 test files (019-028.test.js) to .test.ts
- No logic changes - types only

Co-Authored-By: Luke Page <luke.page@cognition.ai>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants