refactor(cli/db): extract shared helpers and quickstart snippets#88
Conversation
|
@codex review |
🦋 Changeset detectedLatest commit: 5f57e62 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54eede367d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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-apps review |
Greptile SummaryThis PR extracts duplicated database-command infrastructure into two new shared modules (
Confidence Score: 5/5Safe to merge — all changes are mechanical extractions of existing logic into shared helpers with no functional regressions. Every API call and error-handling path in the new shared helpers is a direct lift of existing, already-shipping code. The cancellation change consistently replaces logger+return/exit patterns with throw UserError across all affected files, and the token/region refactors preserve the same Promise.all parallelism as before. The only findings are two unused imports and a minor inaccuracy in the changeset description — none affect runtime behavior. shell.ts and studio.ts each have an unused TOKEN_TTL_MINUTES import that can be trimmed. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph commands["Command files (consumers)"]
C1[create.ts]
C2[delete.ts]
C3[link.ts]
C4[list.ts]
C5[show.ts]
C6[shell.ts]
C7[studio.ts]
C8[quickstart.ts]
C9[regions/add.ts]
C10[regions/list.ts]
C11[regions/remove.ts]
C12[regions/update.ts]
C13[tokens/create.ts]
C14[tokens/invalidate.ts]
RDB[resolve-db.ts]
end
subgraph shared["New shared modules"]
API[api.ts\nfetchDatabase / fetchAllDatabases\nfetchRegionConfig / fetchDatabaseWithRegions\ngenerateToken / tokenExpiryFromNow\nfetchLiveStatus / liveStatusLabel\nliveMainRegion / regionNameMap]
SNIP[quickstart-snippets.ts\ngetSnippet / QUICKSTART_LANGUAGES]
CONST[constants.ts\nDB_PAGE_SIZE / TOKEN_TTL_MINUTES]
end
C1 & C2 & C3 & C4 & C5 & C6 & C7 --> API
C8 --> API
C8 --> SNIP
C9 & C10 & C11 & C12 --> API
C13 & C14 --> API
RDB --> API
API --> CONST
Reviews (2): Last reviewed commit: "docs: agents" | Re-trigger Greptile |
No description provided.