Add dev-metrics feature and docs alignment#296
Open
lucifer1017 wants to merge 1 commit intorsksmart:mainfrom
Open
Add dev-metrics feature and docs alignment#296lucifer1017 wants to merge 1 commit intorsksmart:mainfrom
lucifer1017 wants to merge 1 commit intorsksmart:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dev-metrics) feature.Changes
1. New
dev-metricscommandAdded
src/commands/devmetrics.ts:table,json, andmarkdown.--ci) which is equivalent to JSON output.--repoand--contractarguments and pairs them intelligently.Updated
bin/index.ts:devmetricsCommand.dev-metricssubcommand with options:-r, --repo <owner/repo>(repeatable)-c, --contract <address>(repeatable)-f, --format <table|json|markdown>(default:table)--ci--github-token <token>(orGITHUB_TOKENenv var)-t, --testnet2. New devmetrics module
Added
src/devmetricswith the following:githubService.ts@octokit/restwith timeouts, rate-limit inspection, and graceful fallback from authenticated to unauthenticated mode.getMetrics(owner, repo)andgetRateLimitStatus().rootstockService.tsViemProviderto gather on-chain metrics for a given contract:types.tsGitHubMetrics,RootstockMetrics,DevMetricsReport, andOutputFormat.validation.tszodto validate:owner/repoformat.0x+ 40 hex chars.validateRepoandvalidateContractAddress.formatters/index.ts:formatDevMetricsReport(reports, format)dispatcher.table.ts: Renders a colorized, table-based CLI report usingcli-table3+chalk.json.ts: Renders a JSON array ofDevMetricsReport.markdown.ts: Renders a Markdown report (suitable for issues, PR comments, docs, etc.).3. Dependencies
Updated
package.jsondependencies to support dev-metrics:Added
@octokit/restzodReused existing dependencies from the project:
cli-table3,chalk,viem, etc.4. Documentation
Updated
README.mdto align with the “plus” edition:Added “Developer Metrics (GitHub + Rootstock)” feature section:
dev-metricsoptions and behavior (including MCP/external usage context).Shifted the RNS Resolve section to feature 13, keeping the feature list consistent with the local edition.
Testing
Steps run locally: