Skip to content

refactor: convert modules.js to TypeScript#811

Closed
pantha704 wants to merge 1 commit intoCircuitVerse:mainfrom
pantha704:ts-modules#661
Closed

refactor: convert modules.js to TypeScript#811
pantha704 wants to merge 1 commit intoCircuitVerse:mainfrom
pantha704:ts-modules#661

Conversation

@pantha704
Copy link
Contributor

@pantha704 pantha704 commented Jan 17, 2026

Closing - file already covered by PR #602

Part of CircuitVerse#661 (1 file per PR rule)

- Added return type annotations for all functions
- Added type annotations for parameters (x: number, size: number)
- Added Record<string, any> type for modules object
- Added JSDoc comments for documentation
- Applied same changes to v1/src
@netlify
Copy link

netlify bot commented Jan 17, 2026

Deploy Preview for circuitverse ready!

Name Link
🔨 Latest commit c40c7e5
🔍 Latest deploy log https://app.netlify.com/projects/circuitverse/deploys/696b3fef67b51e0008504e6f
😎 Deploy Preview https://deploy-preview-811--circuitverse.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 43 (🔴 down 1 from production)
Accessibility: 73 (no change from production)
Best Practices: 92 (no change from production)
SEO: 82 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 17, 2026

Walkthrough

The changes add explicit TypeScript typings and improve code quality in the simulator modules file. The getNextPosition function now includes parameter type annotations with defaults and an explicit return type. The global modules registry is converted from a mutable variable to a typed constant using Record<string, any>. The done variable is similarly typed as Record<number, number>. The changeInputSize function gains explicit parameter and return types along with documentation. Size normalization is updated to use string conversion before integer parsing, and variable declarations are updated to use const instead of var.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: convert modules.js to TypeScript' directly and clearly summarizes the main change - converting a JavaScript file to TypeScript with type annotations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pantha704 pantha704 closed this Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant