Refactor: Auto-Discovery Plugin System for Tool Registration#62
Refactor: Auto-Discovery Plugin System for Tool Registration#62Suvam-paul145 wants to merge 15 commits intobetterbugs:developfrom
Conversation
- Created passwordStrengthMeter.tsx component with advanced password analysis - Uses zxcvbn library for realistic entropy-based strength assessment - Displays color-coded strength meter (Very Weak to Very Strong) - Shows detailed crack time estimates for different attack scenarios - Provides warnings and suggestions for password improvement - Includes visibility toggle, copy, and clear functionality - Added comprehensive component configuration to developmentToolsConstant.tsx - Registered component and routes in constants.tsx - Added zxcvbn and @types/zxcvbn dependencies to package.json - Full TypeScript typing with proper null checks - Matches project styling and UI patterns Closes betterbugs#19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
….tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Moves development tool routes and category content to a separate registry module and introduces a pre-build script to generate the registry before starting or building the app. Improves code structure and maintainability by reducing file size and centralizing registry logic.
…gthMeter.tsx" This reverts commit f349721.
This reverts commit f9313c3.
There was a problem hiding this comment.
Pull request overview
Refactors the development tools system toward a build-time, auto-discovered plugin model by introducing per-tool metadata modules that can be aggregated into a generated registry.
Changes:
- Added many co-located
*.meta.tsxfiles exporting structuredmetaobjects for each tool. - Standardized tool routes to reference shared
PATHSconstants within metadata. - Expanded tool page content metadata (hero/about/steps/SEO) to support registry generation and dynamic loading.
Reviewed changes
Copilot reviewed 176 out of 192 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| app/components/developmentToolsComponent/yamlFormatterAndBeautifier.meta.tsx | Adds metadata for the YAML formatter tool |
| app/components/developmentToolsComponent/xorCalculator.meta.tsx | Adds metadata for the XOR calculator tool |
| app/components/developmentToolsComponent/xmlToJsonConverter.meta.tsx | Adds metadata for the XML→JSON converter tool |
| app/components/developmentToolsComponent/xmlEscape.meta.tsx | Adds metadata for the XML escape tool |
| app/components/developmentToolsComponent/xmlCompare.meta.tsx | Adds metadata for the XML compare tool |
| app/components/developmentToolsComponent/whatsMyBrowserSize.meta.tsx | Adds metadata for the “What’s my browser size?” tool |
| app/components/developmentToolsComponent/whatVersionOfSafariDoIHave.meta.tsx | Adds metadata for the Safari version tool |
| app/components/developmentToolsComponent/whatVersionOfMacOSDoIHave.meta.tsx | Adds metadata for the macOS version tool |
| app/components/developmentToolsComponent/whatVersionOfJavaDoIHave.meta.tsx | Adds metadata for the Java version tool |
| app/components/developmentToolsComponent/whatVersionOfIOSDoIHave.meta.tsx | Adds metadata for the iOS version tool |
| app/components/developmentToolsComponent/whatVersionOfFlashDoIHave.meta.tsx | Adds metadata for the Flash version info tool |
| app/components/developmentToolsComponent/whatVersionOfFirefoxDoIHave.meta.tsx | Adds metadata for the Firefox version tool |
| app/components/developmentToolsComponent/whatVersionOfChromeDoIHave.meta.tsx | Adds metadata for the Chrome version tool |
| app/components/developmentToolsComponent/whatVersionOfAndroidDoIHave.meta.tsx | Adds metadata for the Android version tool |
| app/components/developmentToolsComponent/whatIsMyLocalIPAddress.meta.tsx | Adds metadata for the local IP address tool |
| app/components/developmentToolsComponent/urlEncode.meta.tsx | Adds metadata for the URL encode tool |
| app/components/developmentToolsComponent/unicodeToAsciiConverter.meta.tsx | Adds metadata for the Unicode→ASCII tool |
| app/components/developmentToolsComponent/typescriptFormatter.meta.tsx | Adds metadata for the TypeScript formatter tool |
| app/components/developmentToolsComponent/textToCsv.meta.tsx | Adds metadata for the Text→CSV tool |
| app/components/developmentToolsComponent/textRepeater.meta.tsx | Adds metadata for the Text Repeater tool |
| app/components/developmentToolsComponent/textCompare.meta.tsx | Adds metadata for the Text Compare tool |
| app/components/developmentToolsComponent/stripHTML.meta.tsx | Adds metadata for the Strip HTML tool |
| app/components/developmentToolsComponent/stringDiffrenceChecker.meta.tsx | Adds metadata for the String Difference Checker tool |
| app/components/developmentToolsComponent/sqlToJson.meta.tsx | Adds metadata for the SQL→JSON tool |
| app/components/developmentToolsComponent/sqlToCsvConverter.meta.tsx | Adds metadata for the SQL→CSV tool |
| app/components/developmentToolsComponent/sqlMinify.meta.tsx | Adds metadata for the SQL minify tool |
| app/components/developmentToolsComponent/sqlFormatterAndBeautifier.meta.tsx | Adds metadata for the SQL formatter tool |
| app/components/developmentToolsComponent/sortingList.meta.tsx | Adds metadata for the Sorting List tool |
| app/components/developmentToolsComponent/shuffleTextLines.meta.tsx | Adds metadata for the Shuffle Text Lines tool |
| app/components/developmentToolsComponent/shuffleLetters.meta.tsx | Adds metadata for the Shuffle Letters tool |
| app/components/developmentToolsComponent/rotationCalculatorComponent.meta.tsx | Adds metadata for the Rotation Calculator tool |
| app/components/developmentToolsComponent/rotateImageTool.meta.tsx | Adds metadata for the Rotate Image tool |
| app/components/developmentToolsComponent/rot13EncoderDecoderComponent.meta.tsx | Adds metadata for the ROT13 tool |
| app/components/developmentToolsComponent/rgbToHexConverter.meta.tsx | Adds metadata for the RGB→HEX tool |
| app/components/developmentToolsComponent/rgbToCmykConverter.meta.tsx | Adds metadata for the RGB→CMYK tool |
| app/components/developmentToolsComponent/remToPxConverter.meta.tsx | Adds metadata for the REM→PX tool |
| app/components/developmentToolsComponent/randomXMLGenerator.meta.tsx | Adds metadata for the Random XML Generator tool |
| app/components/developmentToolsComponent/randomTextFromRegEX.meta.tsx | Adds metadata for the Random Text From Regex tool |
| app/components/developmentToolsComponent/randomIPGenerator.meta.tsx | Adds metadata for the Random IP Generator tool |
| app/components/developmentToolsComponent/randomGUIDGenerator.meta.tsx | Adds metadata for the Random GUID generator tool |
| app/components/developmentToolsComponent/randomCharacterGenerator.meta.tsx | Adds metadata for the Random Character Generator tool |
| app/components/developmentToolsComponent/randomAddressGenerator.meta.tsx | Adds metadata for the Random Address Generator tool |
| app/components/developmentToolsComponent/qrCodeGenerator.meta.tsx | Adds metadata for the QR Code Generator tool |
| app/components/developmentToolsComponent/pythonFormatter.meta.tsx | Adds metadata for the Python formatter tool |
| app/components/developmentToolsComponent/pxToRemConverter.meta.tsx | Adds metadata for the PX→REM tool |
| app/components/developmentToolsComponent/placeholderImageGenerator.meta.tsx | Adds metadata for the Placeholder Image Generator tool |
| app/components/developmentToolsComponent/phpFormatter.meta.tsx | Adds metadata for the PHP formatter tool |
| app/components/developmentToolsComponent/morseCodeTranslator.meta.tsx | Adds metadata for the Morse Code translator tool |
| app/components/developmentToolsComponent/milesToKmConverter.meta.tsx | Adds metadata for the Miles→Kilometers tool |
| app/components/developmentToolsComponent/lineCounterComponent.meta.tsx | Adds metadata for the line counter tool |
| app/components/developmentToolsComponent/kmToMilesConverter.meta.tsx | Adds metadata for the Kilometers→Miles tool |
| app/components/developmentToolsComponent/jwtDecoder.meta.tsx | Adds metadata for the JWT decoder tool |
| app/components/developmentToolsComponent/jsonToXmlConverter.meta.tsx | Adds metadata for the JSON→XML tool |
| app/components/developmentToolsComponent/jsonCompare.meta.tsx | Adds metadata for the JSON compare tool |
| app/components/developmentToolsComponent/javascriptValidatorLinter.meta.tsx | Adds metadata for the JS validator/linter tool |
| app/components/developmentToolsComponent/javascriptTester.meta.tsx | Adds metadata for the JS tester tool |
| app/components/developmentToolsComponent/javascriptRegexTester.meta.tsx | Adds metadata for the JS regex tester tool |
| app/components/developmentToolsComponent/javascriptEscape.meta.tsx | Adds metadata for the JS escape tool |
| app/components/developmentToolsComponent/ipToHexConverter.meta.tsx | Adds metadata for the IP→Hex tool |
| app/components/developmentToolsComponent/htmlViewer.meta.tsx | Adds metadata for the HTML Viewer tool |
| app/components/developmentToolsComponent/htmlToJade.meta.tsx | Adds metadata for the HTML→Jade/Pug tool |
| app/components/developmentToolsComponent/htmlToBBCode.meta.tsx | Adds metadata for the HTML→BBCode tool |
| app/components/developmentToolsComponent/htmlPrettify.meta.tsx | Adds metadata for the HTML prettify tool |
| app/components/developmentToolsComponent/htmlMinify.meta.tsx | Adds metadata for the HTML minify tool |
| app/components/developmentToolsComponent/htmlEscape.meta.tsx | Adds metadata for the HTML escape tool |
| app/components/developmentToolsComponent/htmlCodeGenerator.meta.tsx | Adds metadata for the HTML code generator tool |
| app/components/developmentToolsComponent/hoursToSecounds.meta.tsx | Adds metadata for the hours→seconds tool |
| app/components/developmentToolsComponent/hexToRGBConverter.meta.tsx | Adds metadata for the HEX→RGB tool |
| app/components/developmentToolsComponent/hexToPantone.meta.tsx | Adds metadata for the HEX→Pantone tool |
| app/components/developmentToolsComponent/graphqlFormatter.meta.tsx | Adds metadata for the GraphQL formatter tool |
| app/components/developmentToolsComponent/fibonacciCalculator.meta.tsx | Adds metadata for the Fibonacci calculator tool |
| app/components/developmentToolsComponent/excelCompare.meta.tsx | Adds metadata for the Excel compare tool |
| app/components/developmentToolsComponent/decimalToGrayCode.meta.tsx | Adds metadata for the Decimal→Gray code tool |
| app/components/developmentToolsComponent/csvToExcelFileConvertor.meta.tsx | Adds metadata for the CSV→Excel tool |
| app/components/developmentToolsComponent/cssValidator.meta.tsx | Adds metadata for the CSS validator tool |
| app/components/developmentToolsComponent/cssToStylus.meta.tsx | Adds metadata for the CSS→Stylus tool |
| app/components/developmentToolsComponent/cssToSass.meta.tsx | Adds metadata for the CSS→SASS tool |
| app/components/developmentToolsComponent/cssToLess.meta.tsx | Adds metadata for the CSS→LESS tool |
| app/components/developmentToolsComponent/cssPrettify.meta.tsx | Adds metadata for the CSS prettify tool |
| app/components/developmentToolsComponent/cssMinify.meta.tsx | Adds metadata for the CSS minify tool |
| app/components/developmentToolsComponent/crontabGenerator.meta.tsx | Adds metadata for the crontab generator tool |
| app/components/developmentToolsComponent/colorPickerTool.meta.tsx | Adds metadata for the color picker tool |
| app/components/developmentToolsComponent/colorInvertor.meta.tsx | Adds metadata for the color inverter tool |
| app/components/developmentToolsComponent/cmykToRgbConverter.meta.tsx | Adds metadata for the CMYK→RGB tool |
| app/components/developmentToolsComponent/binaryToDecimalConverter.meta.tsx | Adds metadata for the Binary→Decimal tool |
| app/components/developmentToolsComponent/bcdToDecimalConverter.meta.tsx | Adds metadata for the BCD→Decimal tool |
| app/components/developmentToolsComponent/base64Encoder.meta.tsx | Adds metadata for the Base64 encoder tool |
| app/components/developmentToolsComponent/base64Decoder.meta.tsx | Adds metadata for the Base64 decoder tool |
| app/components/developmentToolsComponent/asciiToUnicodeConverter.meta.tsx | Adds metadata for the ASCII→Unicode tool |
| app/components/developmentToolsComponent/asciiToDecimalConverter.meta.tsx | Adds metadata for the ASCII→Decimal tool |
| app/components/developmentToolsComponent/apiKeyGenerator.meta.tsx | Adds metadata for the API key generator tool |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
app/components/developmentToolsComponent/yamlFormatterAndBeautifier.meta.tsx
Outdated
Show resolved
Hide resolved
app/components/developmentToolsComponent/yamlFormatterAndBeautifier.meta.tsx
Outdated
Show resolved
Hide resolved
app/components/developmentToolsComponent/whatIsMyLocalIPAddress.meta.tsx
Outdated
Show resolved
Hide resolved
| development_tools_list: [ | ||
| { tool: 'JavaScript Validator & Linter', url: PATHS.JAVASCRIPT_TESTER }, | ||
| { tool: 'HTML Escape', url: PATHS.HTML_ESCAPE }, | ||
| { tool: 'HTML Unescape', url: PATHS.HTML_UNESCAPE }, | ||
| { tool: 'Text to One Line', url: PATHS.TEXT_TO_ONE_LINE }, | ||
| ], |
There was a problem hiding this comment.
'JavaScript Validator & Linter' is linked to PATHS.JAVASCRIPT_TESTER, which appears to be a different tool. Point this entry to the validator/linter route (e.g., the corresponding PATHS constant for that tool) so the related-tools navigation doesn’t misroute.
app/components/developmentToolsComponent/rgbToCmykConverter.meta.tsx
Outdated
Show resolved
Hide resolved
app/components/developmentToolsComponent/typescriptFormatter.meta.tsx
Outdated
Show resolved
Hide resolved
| point: [ | ||
| { | ||
| title: 'Optimization', | ||
| description: 'Keep code readable and consistent across teams.', | ||
| }, | ||
| { | ||
| title: 'Optimization', | ||
| description: 'Minify CSS for faster load times.', | ||
| }, | ||
| { | ||
| title: 'Diff clarity', | ||
| description: 'Minified CSS leads to cleaner diffs.', | ||
| }, | ||
| ], |
There was a problem hiding this comment.
The first point is labeled 'Optimization' but its description ('Keep code readable...') reads like a prettify/formatting benefit, and 'Optimization' is duplicated. Consider renaming the first title (e.g., 'Consistency') or adjusting the description so each point is unique and matches the minify tool’s purpose.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…eta.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@SyedFahad7 review my code |
…ta.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ifier.meta.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ifier.meta.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…s.meta.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Hey, thanks for the effort here. This PR is way too large for us to reasonably review. It touches 192 files and introduces major architectural changes. It also includes merge commits, reverts, and unresolved conflicts. We are not going to move forward with this in its current form. If you would like to contribute, please open smaller, focused PRs with clear scope and prior discussion for any architectural changes. Closing this for now. |
Problem Description
The existing tool registration system relied on a monolithic manual registry pattern:
constants.tsxfile containing hardcoded tool definitions.developmentToolsConstant.tsx.This architecture caused:
Solution Overview
The system has been refactored into a build-time auto-discovery plugin architecture.
The new model:
This creates a scalable and modular plugin-based tool system.
Architecture After Refactor
::contentReference[oaicite:0]{index=0}
Key Changes Made
1. Isolated
PATHSConstantProblem
PATHSwas embedded inside the registry system, creating circular dependency issues.Solution
Extracted
PATHSinto a standalone module.New File
This ensures:
2. Automated Tool Registry (Build-Time Generated)
Problem
Manual tool registration inside:
This required:
Solution
Created an auto-generated registry:
New File
Modified Files
The registry is now generated at build-time using metadata discovered from tool directories.
3. Co-Located Metadata Plugin Model
Each tool now manages its own metadata.
New Pattern
Each
.meta.tsxfile exports structured metadata only.Benefits
4. Build-Time Registry Generator
A script aggregates all
.meta.tsxfiles and generates a typed registry.New File
Modified
Added pre-build hooks:
Build Flow
closes #44
What Changed (File-Level Summary)
New Files
app/libs/paths.tsdevelopmentToolsRegistry.tsx(auto-generated)scripts/generateRegistry.jsapp/components/developmentToolsComponent/*.meta.tsxModified Files
constants.tsxdevelopmentToolsConstant.tsxpackage.jsonRemoved Responsibilities
Performance Improvements
Before
After
next/dynamicAutomated Build Verification
Result:
Workflow Diagram (What This GPT Performs)
::contentReference[oaicite:1]{index=1}
Step-by-Step Workflow
How to Add a New Tool
PATHSfrom:No manual registry edits required.
Architectural Impact
Final Outcome
The tool system is now modular, scalable, and future-proof.