Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
Thank you for following the naming conventions! 🙏 |
@evlog/cli
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIntroduces the ChangesCLI foundation
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant Doctor
participant ProjectResolver
participant CliUi
participant Telemetry
User->>Doctor: run doctor with cwd/json options
Doctor->>ProjectResolver: resolveProject, resolveEvlog, findLogsSink
ProjectResolver-->>Doctor: project and installation details
Doctor->>CliUi: emit report or JSON payload
Doctor->>Telemetry: record summary and project kind
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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. Comment |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/lib/project.ts`:
- Around line 5-34: Add concise JSDoc descriptions to the exported PackageJson
interface, WorkspaceKind type, ProjectInfo interface, and EvlogInstall interface
in project.ts. Document each public API’s purpose, while preserving the existing
member-level comments and type definitions.
- Around line 77-89: Update the ancestor traversal in the project detection flow
so the root is assigned only when detectWorkspaceKind identifies a valid
workspace; remove the unconditional root = dir assignment after the detection
check. Preserve packageDir and packageJson discovery while ensuring unrelated
parent packages cannot become the project root.
In `@packages/cli/test/doctor.test.ts`:
- Around line 118-174: The test should exercise the production --json
serialization path instead of rebuilding a separate payload from runDoctor’s
result. Update the test around runDoctor and the CLI handler/writeJson flow to
invoke the handler while capturing stdout, or reuse the single serializer used
by production, then assert the captured JSON against the schema snapshot.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 1ce29978-2f55-487c-a7be-cd14a328bad6
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (24)
.changeset/cli-skeleton-doctor.md.github/pull_request_template.md.github/workflows/semantic-pull-request.ymlpackages/cli/README.mdpackages/cli/bin/evlog.mjspackages/cli/package.jsonpackages/cli/src/cli.tspackages/cli/src/commands/doctor.tspackages/cli/src/commands/index.tspackages/cli/src/commands/telemetry.tspackages/cli/src/core/brand.tspackages/cli/src/core/context.tspackages/cli/src/core/output.tspackages/cli/src/core/usage.tspackages/cli/src/index.tspackages/cli/src/lib/command.tspackages/cli/src/lib/constants.tspackages/cli/src/lib/project.tspackages/cli/test/brand.test.tspackages/cli/test/doctor.test.tspackages/cli/test/output.test.tspackages/cli/tsconfig.jsonpackages/cli/tsdown.config.tspackages/cli/vitest.config.ts
Packaged installs report production; workspace builds report development. Override via EVLOG_CLI_ENV / EVLOG_TELEMETRY_ENV or VERCEL_ENV.
There was a problem hiding this comment.
♻️ Duplicate comments (3)
packages/cli/src/lib/project.ts (2)
5-35: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winStill missing JSDoc on exported project types.
PackageJson,WorkspaceKind,ProjectInfo, andEvlogInstallremain undocumented, while the newly-addedResolveAttemptin this same file does have JSDoc. As per coding guidelines, "Add JSDoc to all public APIs."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/src/lib/project.ts` around lines 5 - 35, Add JSDoc comments documenting the exported PackageJson interface, WorkspaceKind type, ProjectInfo interface, and EvlogInstall interface in packages/cli/src/lib/project.ts, matching the existing documentation style used by ResolveAttempt and preserving the current API definitions.Source: Coding guidelines
79-129: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRoot promotion bug appears unresolved: unrelated ancestor packages can still become the workspace root.
root = dirstill executes unconditionally after thedetectWorkspaceKindcheck whenever any ancestor has apackage.json, even without a workspace marker (pnpm-workspace.yaml,workspacesfield, etc.). This can resolveevlog/.evlog/logsfrom an unrelated parent directory and report a false-healthy result, matching a previously flagged concern that doesn't appear to have been fixed.🐛 Proposed fix (as previously suggested)
if (!packageDir) { packageDir = dir packageJson = pkg + root = dir } const detected = await detectWorkspaceKind(dir, pkg) if (detected) { root = dir kind = detected break } // Keep walking — a parent may be the workspace root. - root = dir🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/src/lib/project.ts` around lines 79 - 129, Update resolveProject so root is not reassigned for package.json files whose detectWorkspaceKind result is null; remove the unconditional root = dir in that branch. Preserve root promotion only when detectWorkspaceKind identifies a workspace, while retaining the initial cwd root for single-package projects.packages/cli/test/doctor.test.ts (1)
119-178: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winStill rebuilding the JSON payload by hand instead of exercising the real
--jsonoutput path.This test constructs its own
payloadfromrunDoctor()'s result (now also hardcodingenvironment: 'development'andschemaVersion: 2) rather than invoking thedoctorcommand handler and capturing its actual JSON output.doctor.ts's ownui.done()call only passes{project, checks, summary}— theschemaVersion/environmentenvelope fields asserted here are never actually verified against production output, so a real regression in the command's JSON contract could slip through undetected.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/test/doctor.test.ts` around lines 119 - 178, Update the “keeps the --json schema contract” test to invoke the actual doctor command handler with JSON output enabled and capture the payload emitted through its ui.done() path, instead of rebuilding it from runDoctor(). Assert the captured production payload, including schemaVersion and environment, while preserving the existing expected schema and values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@packages/cli/src/lib/project.ts`:
- Around line 5-35: Add JSDoc comments documenting the exported PackageJson
interface, WorkspaceKind type, ProjectInfo interface, and EvlogInstall interface
in packages/cli/src/lib/project.ts, matching the existing documentation style
used by ResolveAttempt and preserving the current API definitions.
- Around line 79-129: Update resolveProject so root is not reassigned for
package.json files whose detectWorkspaceKind result is null; remove the
unconditional root = dir in that branch. Preserve root promotion only when
detectWorkspaceKind identifies a workspace, while retaining the initial cwd root
for single-package projects.
In `@packages/cli/test/doctor.test.ts`:
- Around line 119-178: Update the “keeps the --json schema contract” test to
invoke the actual doctor command handler with JSON output enabled and capture
the payload emitted through its ui.done() path, instead of rebuilding it from
runDoctor(). Assert the captured production payload, including schemaVersion and
environment, while preserving the existing expected schema and values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 94ee6bc1-b3c4-4087-9758-55155e5a7b06
⛔ Files ignored due to path filters (1)
packages/telemetry/test/__snapshots__/telemetry.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (32)
.changeset/cli.md.changeset/evlog-package-json-export.mdpackages/cli/DEBUG-DX.mdpackages/cli/README.mdpackages/cli/src/commands/doctor.tspackages/cli/src/core/brand.tspackages/cli/src/core/context.tspackages/cli/src/core/output.tspackages/cli/src/index.tspackages/cli/src/lib/command.tspackages/cli/src/lib/debug-report.tspackages/cli/src/lib/debug.tspackages/cli/src/lib/environment.tspackages/cli/src/lib/errors.tspackages/cli/src/lib/project.tspackages/cli/src/lib/ui.tspackages/cli/test/debug-report.test.tspackages/cli/test/debug.test.tspackages/cli/test/doctor.test.tspackages/cli/test/environment.test.tspackages/cli/test/output.test.tspackages/cli/test/ui.test.tspackages/evlog/package.jsonpackages/telemetry/src/citty.tspackages/telemetry/src/commands.tspackages/telemetry/src/create.tspackages/telemetry/src/disclosure.tspackages/telemetry/src/enrich.tspackages/telemetry/src/ingest.tspackages/telemetry/src/types.tspackages/telemetry/test/enrich.test.tspackages/telemetry/test/telemetry.test.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/test/doctor.test.ts`:
- Around line 145-151: In the test invocation around doctor.run, remove the
typeof check and await fallback, since defineEvlogCommand provides run as a
plain function. Call doctor.run directly with the existing arguments while
preserving the non-null handling if required by its type.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 4990b244-05fb-4066-880c-d85e848b0c70
📒 Files selected for processing (4)
.changeset/cli.mdpackages/cli/src/lib/project.tspackages/cli/test/doctor.test.tspackages/cli/test/project.test.ts
Summary
@evlog/cli(binaryevlog): citty command tree with registry undercommands/, branded help + per-command header (gradient), opt-out via--no-header/EVLOG_CLI_NO_HEADERevlog doctor(monorepo-aware: workspace root, hoist-awareevlogresolve, stack detect,.evlog/logs) andevlog telemetry status|enable|disablevia@evlog/telemetrycliconventional-commit scope; include changeset for the first minorSummary by CodeRabbit
evlogCLI withdoctordiagnostics andtelemetrymanagement.--debugand--json.doctor --jsonto include environment details and JSON schema v2; improved output/exit-code behavior.telemetry statusnow displays the telemetry data directory.doctor, branding, output/UI/exit behavior, debug reporting, environment resolution, and telemetry.