Repository navigation
Feature/library review fixes - #115
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Fix FormTemplateComponent exported type (was aliased to VvFormFieldsGroup) - Export defaultObjectByJSONSchema from the package entry point - VvForm: route external modelValue updates through formDataAdapter so schema defaults and the class option are applied consistently with init - Refactor defaultObjectBySchema to share one implementation across Zod v3/v4 via an internal adapter (~150 fewer duplicated lines, no behavior change) - Add ambient declarations for *.vue and @volverjs/style so type-check passes - Tighten useForm scoped-instance return type - Lint cleanup in docs and browser test specs Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 29 minutes and 16 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughVersion 1.1.3 refactors ChangesCore library fixes and refactors
Dependency and workspace tooling updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
- Fix FormTemplateComponent exported type (was aliased to VvFormFieldsGroup) - Export defaultObjectByJSONSchema from the package entry point - VvForm: route external modelValue updates through formDataAdapter so schema defaults and the class option are applied consistently with init - Refactor defaultObjectBySchema to share one implementation across Zod v3/v4 via an internal adapter (~150 fewer duplicated lines, no behavior change) - Add ambient declarations for *.vue and @volverjs/style so type-check passes - Tighten useForm scoped-instance return type - Lint cleanup in docs and browser test specs Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> # Conflicts: # src/VvForm.ts # src/utils.ts
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/utils.ts (1)
378-423: 💤 Low valueConsider extracting sub-handlers to reduce cognitive complexity.
SonarCloud flags this function with a cognitive complexity of 21 (threshold: 15). While the complexity is inherent to handling multiple Zod schema types (optional, default, nullable, array, record, object), extracting some logic into focused helpers could improve readability:
- Array handling (lines 398-404) →
_resolveArrayEntry- Record handling (lines 405-414) →
_resolveRecordEntryThat said, the current structure is clear and directly mirrors the Zod type hierarchy, so this is optional polish rather than a blocker.
🤖 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 `@src/utils.ts` around lines 378 - 423, The function _resolveShapeEntry has cognitive complexity of 21, exceeding the threshold of 15. Extract the array handling logic (the conditional block checking adapter.isArray where arrayType is handled) into a new helper function named _resolveArrayEntry that accepts adapter, innerType, and originalValue parameters and returns a tuple. Similarly, extract the record handling logic (the conditional block checking adapter.isRecord where valueType is handled) into a new helper function named _resolveRecordEntry with the same signature. Replace the corresponding inline blocks in _resolveShapeEntry with calls to these new helpers to reduce the function's complexity and improve readability without changing behavior.Source: Linters/SAST tools
🤖 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 `@package.json`:
- Around line 76-99: The `engines.node` field in package.json specifies Node.js
>= 16.x, but the upgraded dependencies now require Node.js 20.19.0 or higher.
Locate the `engines.node` configuration field in package.json and update it to
at least `>= 20.19.0` (or `>= 22.12.0` if targeting the strictest requirement
based on Vitest 4.1.9) to accurately reflect the minimum Node.js version
required by Vite, Vitest, Playwright, and ESLint.
In `@pnpm-workspace.yaml`:
- Around line 5-18: The minimumReleaseAgeExclude list in pnpm-workspace.yaml is
ineffective without a configured minimumReleaseAge baseline. Either define
minimumReleaseAge in pnpm-workspace.yaml to establish the supply-chain
protection policy that makes the exclusion list meaningful, or remove the unused
minimumReleaseAgeExclude configuration entirely to clean up the configuration
file.
---
Nitpick comments:
In `@src/utils.ts`:
- Around line 378-423: The function _resolveShapeEntry has cognitive complexity
of 21, exceeding the threshold of 15. Extract the array handling logic (the
conditional block checking adapter.isArray where arrayType is handled) into a
new helper function named _resolveArrayEntry that accepts adapter, innerType,
and originalValue parameters and returns a tuple. Similarly, extract the record
handling logic (the conditional block checking adapter.isRecord where valueType
is handled) into a new helper function named _resolveRecordEntry with the same
signature. Replace the corresponding inline blocks in _resolveShapeEntry with
calls to these new helpers to reduce the function's complexity and improve
readability without changing behavior.
🪄 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: CHILL
Plan: Pro
Run ID: 1e01b2bf-9119-4e8f-bbbb-83e02d0a8660
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
CHANGELOG.mddocs/VvFormField.mdpackage.jsonpnpm-workspace.yamlsrc/VvForm.tssrc/index.tssrc/shims.d.tssrc/utils.tstest-playwright/VvForm.v4.spec.tstest-playwright/VvFormFieldsGroup.v3.spec.tstest-playwright/VvFormFieldsGroup.v4.spec.ts
- bump engines.node to ^20.19.0 || >=22.12.0 to match vite/vitest/eslint - remove inert minimumReleaseAgeExclude (no minimumReleaseAge baseline set) - extract array/record default-value resolution into helpers Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pnpm 11.7.0 enforces a built-in minimumReleaseAge, so the exclude list is required to allow the freshly-bumped dev deps. Removing it broke install with ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|

schema defaults and the class option are applied consistently with init
v3/v4 via an internal adapter (~150 fewer duplicated lines, no behavior change)
Summary by CodeRabbit
New Features
defaultObjectByJSONSchema()for generating default objects from JSON schemas.Bug Fixes
VvFormhandling of externalmodelValueupdates.FormTemplateComponenttype definition.Chores