fix: clarify init first-success path - #604
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRefactors init command to return structured next steps ({ nextSteps, fallbackSteps }) from buildNextSteps; updates README templates to prioritize SQL-asset-first workflows and adds failure-handling guidance; updates tests and verification script expectations to reference the new model-gen guidance and adjusted command phrasing. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/ztd-cli/src/commands/init.ts (2)
1993-1996: Redundant conditional forwiringStep.Both branches produce the same string. This can be simplified.
♻️ Proposed fix
- const wiringStep = - appShape === 'webapi' - ? `Review ${sqlClientPath} and ${repositoryTelemetryPath} so the first SQL-backed repository has a seam to plug into` - : `Review ${sqlClientPath} and ${repositoryTelemetryPath} so the first SQL-backed repository has a seam to plug into`; + const wiringStep = `Review ${sqlClientPath} and ${repositoryTelemetryPath} so the first SQL-backed repository has a seam to plug into`;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ztd-cli/src/commands/init.ts` around lines 1993 - 1996, The conditional assigning wiringStep is redundant because both branches produce the same string; simplify by assigning wiringStep directly to the shared template using sqlClientPath and repositoryTelemetryPath (remove the ternary on appShape). Update any references to wiringStep accordingly and delete the unused appShape-based branch to keep the code concise.
1978-1979: Redundant ternary forsqlAssetPath.Both branches of the ternary produce the same value
'src/sql/'. This can be simplified to a direct assignment.♻️ Proposed fix
- const sqlAssetPath = appShape === 'webapi' ? 'src/sql/' : 'src/sql/'; + const sqlAssetPath = 'src/sql/';🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ztd-cli/src/commands/init.ts` around lines 1978 - 1979, The ternary for sqlAssetPath is redundant since both branches return 'src/sql/'; replace the conditional assignment of sqlAssetPath with a direct assignment const sqlAssetPath = 'src/sql/'; while leaving the existing sqlClientPath ternary (const sqlClientPath = appShape === 'webapi' ? 'src/infrastructure/db/sql-client.ts' : 'src/db/sql-client.ts') unchanged so behavior for sqlClientPath remains the same.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/ztd-cli/src/commands/init.ts`:
- Around line 1993-1996: The conditional assigning wiringStep is redundant
because both branches produce the same string; simplify by assigning wiringStep
directly to the shared template using sqlClientPath and repositoryTelemetryPath
(remove the ternary on appShape). Update any references to wiringStep
accordingly and delete the unused appShape-based branch to keep the code
concise.
- Around line 1978-1979: The ternary for sqlAssetPath is redundant since both
branches return 'src/sql/'; replace the conditional assignment of sqlAssetPath
with a direct assignment const sqlAssetPath = 'src/sql/'; while leaving the
existing sqlClientPath ternary (const sqlClientPath = appShape === 'webapi' ?
'src/infrastructure/db/sql-client.ts' : 'src/db/sql-client.ts') unchanged so
behavior for sqlClientPath remains the same.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8a3b9fc6-df45-4dba-9699-a30faed1d033
⛔ Files ignored due to path filters (1)
packages/ztd-cli/tests/__snapshots__/init.command.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (4)
packages/ztd-cli/src/commands/init.tspackages/ztd-cli/templates/README.mdpackages/ztd-cli/templates/README.webapi.mdpackages/ztd-cli/tests/init.command.test.ts
Summary
Testing
Summary by CodeRabbit
New Features
Documentation
Tests