feat(scripts): sketch Edge Script statistics command#93
Conversation
🦋 Changeset detectedLatest commit: 0077324 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
6d51b57 to
6454e82
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Greptile SummaryThis PR adds a
Confidence Score: 5/5Safe to merge; the new command is additive and the shared stat utilities are well-tested. The one open inconsistency (spinner cleanup style in stats.ts) is already tracked in a prior review thread. All changed paths are additive. The refactored dns/zone/stats.ts is a drop-in swap of the local helpers for the shared equivalents with identical logic. The core/stats.ts helpers are covered by unit tests including the midnight edge-case. No data mutations, migrations, or auth boundaries are touched. packages/cli/src/commands/scripts/stats.ts — spinner cleanup style is inconsistent with interactive.ts (prior thread); no new blockers here. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant stats as scripts/stats.ts
participant interactive as interactive.ts
participant manifest as loadManifest
participant API as Compute API
User->>stats: bunny scripts stats [id]
stats->>interactive: resolveScriptInteractive(client, id, output)
alt Explicit ID or linked manifest
interactive->>manifest: loadManifest(SCRIPT_MANIFEST)
manifest-->>interactive: id?
interactive->>API: GET /compute/script/id
API-->>interactive: EdgeScript
interactive-->>stats: script, picked false
else No ID and no manifest
alt json output
interactive-->>User: UserError
else interactive
interactive->>API: GET /compute/scripts
API-->>interactive: EdgeScript[]
interactive->>User: prompts select
User-->>interactive: chosen script
interactive-->>stats: script, picked true
end
end
stats->>API: GET /compute/script/id/statistics
API-->>stats: StatisticsData
alt json output
stats-->>User: JSON
else text
stats-->>User: formatKeyValue totals plus renderBarChart
end
alt picked true
stats->>interactive: maybeLinkScript(script, link)
interactive->>User: confirm link
User-->>interactive: yes or no
interactive->>manifest: saveManifest
end
Reviews (2): Last reviewed commit: "apply code suggestions" | Re-trigger Greptile |
Wait until #91 lands