refactor(types): simplify definition helpers#566
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)
📝 WalkthroughWalkthroughThis PR refactors the Gunshi type system by introducing ChangesType System Refactoring
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Deploying gunshi with
|
| Latest commit: |
8709a15
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://42c4d8e5.gunshi.pages.dev |
| Branch Preview URL: | https://refactor-types.gunshi.pages.dev |
@gunshi/bone
@gunshi/combinators
@gunshi/definition
@gunshi/docs
gunshi
@gunshi/plugin
@gunshi/plugin-completion
@gunshi/plugin-dryrun
@gunshi/plugin-global
@gunshi/plugin-i18n
@gunshi/plugin-renderer
@gunshi/resources
@gunshi/shared
commit: |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/gunshi/src/type.test-d.ts (1)
63-75: ⚡ Quick winAdd branch-complete coverage for
NormalizeToGunshiParams.This block validates 3 branches well; add explicit cases for
GunshiParamspassthrough and default fallback to lock all conditional paths.Proposed test additions
test('NormalizeToGunshiParams', () => { expectTypeOf<NormalizeToGunshiParams<{ args: typeof _args1 }>>().toEqualTypeOf< GunshiParams<{ args: typeof _args1; extensions: {} }> >() expectTypeOf<NormalizeToGunshiParams<{ extensions: { foo: Extension1 } }>>().toEqualTypeOf< GunshiParams<{ args: Args; extensions: { foo: Extension1 } }> >() expectTypeOf< NormalizeToGunshiParams<{ args: typeof _args1; extensions: { foo: Extension2 } }> >().toEqualTypeOf<GunshiParams<{ args: typeof _args1; extensions: { foo: Extension2 } }>>() + + expectTypeOf< + NormalizeToGunshiParams<GunshiParams<{ args: typeof _args1; extensions: { foo: Extension1 } }>> + >().toEqualTypeOf<GunshiParams<{ args: typeof _args1; extensions: { foo: Extension1 } }>>() + + expectTypeOf<NormalizeToGunshiParams<{}>>().toEqualTypeOf<DefaultGunshiParams>() })🤖 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/gunshi/src/type.test-d.ts` around lines 63 - 75, Add two additional type-level test cases to fully cover NormalizeToGunshiParams branches: one asserting that NormalizeToGunshiParams<GunshiParams<{ args: typeof _args1; extensions: { foo: Extension2 } }>>() equals the same GunshiParams type (passthrough branch), and one asserting that NormalizeToGunshiParams<{}>() equals GunshiParams<{ args: Args; extensions: {} }> (default fallback branch); place these new expectTypeOf checks alongside the existing tests so all conditional paths of NormalizeToGunshiParams are exercised.
🤖 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.
Nitpick comments:
In `@packages/gunshi/src/type.test-d.ts`:
- Around line 63-75: Add two additional type-level test cases to fully cover
NormalizeToGunshiParams branches: one asserting that
NormalizeToGunshiParams<GunshiParams<{ args: typeof _args1; extensions: { foo:
Extension2 } }>>() equals the same GunshiParams type (passthrough branch), and
one asserting that NormalizeToGunshiParams<{}>() equals GunshiParams<{ args:
Args; extensions: {} }> (default fallback branch); place these new expectTypeOf
checks alongside the existing tests so all conditional paths of
NormalizeToGunshiParams are exercised.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 6c898005-cf57-41a7-a6a8-01976bfd47a3
📒 Files selected for processing (4)
packages/gunshi/src/definition.tspackages/gunshi/src/plugin/core.tspackages/gunshi/src/type.test-d.tspackages/gunshi/src/types.ts
Description
Linked Issues
Additional context
Summary by CodeRabbit
Refactor
Exports
Tests