Skip to content

Plugin, component resolver, injection accessors - #1

Merged
jakeboone02 merged 3 commits into
mainfrom
idiomaticity
Aug 12, 2026
Merged

Plugin, component resolver, injection accessors#1
jakeboone02 merged 3 commits into
mainfrom
idiomaticity

Conversation

@jakeboone02

@jakeboone02 jakeboone02 commented Aug 12, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Added QueryBuilderPlugin for global component registration with customizable prefixes.
    • Added an unplugin-vue-components resolver.
    • Added injection-based accessors for schema, actions, rules, groups, and paths.
  • Changes
    • Renamed Label exports to QueryBuilderLabel.
    • Improved replacement-control customization and subquery context handling.
  • Bug Fixes
    • Improved reliability of default controls in ESM builds.
  • Documentation
    • Added global registration and customization guidance.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5ff92fb4-9a6d-43c9-8bdd-b9c4e7bcc7da

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e141634-cf6a-43f1-aef8-03b289161f06

📥 Commits

Reviewing files that changed from the base of the PR and between abc1321 and 6714f5f.

📒 Files selected for processing (13)
  • CHANGELOG.md
  • README.md
  • docs/customization.md
  • docs/differences-from-react-querybuilder.md
  • packages/vue-querybuilder/scripts/check-dist-specifiers.ts
  • packages/vue-querybuilder/src/components/slots.test.ts
  • packages/vue-querybuilder/src/composables/accessors.test.ts
  • packages/vue-querybuilder/src/internal/parts.test.ts
  • packages/vue-querybuilder/src/plugin.test.ts
  • packages/vue-querybuilder/src/types/controls.ts
  • packages/vue-querybuilder/src/types/props.ts
  • packages/vue-querybuilder/src/types/types.test-d.ts
  • packages/vue-querybuilder/test/support.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/vue-querybuilder/src/internal/parts.test.ts
  • README.md
  • docs/customization.md
  • packages/vue-querybuilder/scripts/check-dist-specifiers.ts
  • packages/vue-querybuilder/src/plugin.test.ts
  • CHANGELOG.md
  • packages/vue-querybuilder/src/composables/accessors.test.ts
  • packages/vue-querybuilder/src/components/slots.test.ts

📝 Walkthrough

Walkthrough

The Vue package adds QueryBuilderPlugin, a component resolver, injection accessors, centralized control typing, public export changes, and built-package validation. Internal rule components now use provided context.

Changes

Query Builder API updates

Layer / File(s) Summary
Global registration and resolver
packages/vue-querybuilder/src/plugin.ts, packages/vue-querybuilder/src/resolver.ts, packages/vue-querybuilder/vite.config.ts, packages/vue-querybuilder/src/plugin.test.ts, examples/demo/src/*, README.md
Adds prefixed global component registration, resolver support, a resolver build entry, tests, and demo usage.
Injection context and replacement controls
packages/vue-querybuilder/src/composables/*, packages/vue-querybuilder/src/internal/parts.*, packages/vue-querybuilder/src/internal/Rule*.vue, packages/vue-querybuilder/src/components/{QueryBuilder,Rule,RuleGroup}.vue, docs/customization.md
Adds providers and accessors for schema, actions, rules, groups, paths, and subqueries. Internal components consume injected context instead of template props.
Control contracts and public exports
packages/vue-querybuilder/src/types/*, packages/vue-querybuilder/src/internal/QueryBuilderLabel.*, packages/vue-querybuilder/src/index.ts, packages/vue-querybuilder/src/components/index.ts, packages/vue-querybuilder/src/components/*.vue, docs/differences-from-react-querybuilder.md
Adds shared control typing, renames Label exports to QueryBuilderLabel, removes internal rule component exports, and updates built-in components and tests.
Distribution and module-cycle validation
packages/vue-querybuilder/src/components/defaultControlElements.ts, packages/vue-querybuilder/scripts/*, packages/vue-querybuilder/package.json, AGENTS.md, CHANGELOG.md
Uses getters for self-referential default control elements and validates exports-map targets, specifiers, and built runtime controls.

Estimated code review effort: 4 (Complex) | ~60 minutes

Mergeability Score: ⚪ Minimal · up to 6714f

No actionable merge-blocking risk remains; the PR is merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant App
  participant QueryBuilderPlugin
  participant VueGlobalComponents
  participant QueryBuilderResolver
  App->>QueryBuilderPlugin: install with optional prefix
  QueryBuilderPlugin->>VueGlobalComponents: register prefixed components
  QueryBuilderResolver->>QueryBuilderPlugin: resolve component name
  QueryBuilderPlugin-->>QueryBuilderResolver: return component mapping
Loading
sequenceDiagram
  participant QueryBuilder
  participant Rule
  participant RuleComponents
  participant ReplacementControl
  QueryBuilder->>Rule: provide schema and actions
  Rule->>RuleComponents: provide rule and path context
  RuleComponents->>ReplacementControl: expose reactive accessors
  ReplacementControl-->>RuleComponents: read rule state and actions
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the three primary changes: the plugin, component resolver, and injection accessors.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch idiomaticity

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (1)
packages/vue-querybuilder/src/composables/accessors.test.ts (1)

26-76: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Move test helpers out of src.

fieldNames, Probe, and renderWithProbe are test helpers in packages/vue-querybuilder/src/composables/accessors.test.ts. Move them to packages/vue-querybuilder/test/ and import them into this test file.

As per coding guidelines, “Test helpers belong in packages/vue-querybuilder/test/, not src/.”

🤖 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/vue-querybuilder/src/composables/accessors.test.ts` around lines 26
- 76, Move the test helpers fieldNames, Probe, and renderWithProbe from
accessors.test.ts into a reusable helper module under
packages/vue-querybuilder/test/, then import them into the test. Preserve their
existing behavior and dependencies, including Probe’s injected accessors and
renderWithProbe’s QueryBuilder setup.

Source: Coding guidelines

🤖 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 `@CHANGELOG.md`:
- Around line 30-34: Update the changelog sentence describing RuleComponents,
RuleGroupHeader, RuleGroupBody, and RuleSubQuery to remove the extra “from” in
“read everything they render from through injection,” while preserving the
surrounding breaking-change guidance.

In `@docs/differences-from-react-querybuilder.md`:
- Around line 211-213: Correct the sentence in the section describing
RuleComponents, RuleGroupHeader, RuleGroupBody, and RuleSubQuery by removing the
extraneous “from” so it states that they read everything they render through
provide/inject.

In `@packages/vue-querybuilder/scripts/check-dist-specifiers.ts`:
- Around line 74-78: Update the export-target validation loop in
check-dist-specifiers.ts to resolve each target and require the resolved path to
remain within distDir before checking existence. Record a failure for targets
outside distDir or missing there, while preserving the existing export condition
context in the failure message.

In `@packages/vue-querybuilder/src/internal/parts.test.ts`:
- Around line 14-15: Move the mountBare test helper from the internal source
area into packages/vue-querybuilder/test/, then import and reuse it in
parts.test.ts. Keep its existing rendering behavior unchanged and remove the
local definition from the test file.

In `@packages/vue-querybuilder/src/plugin.test.ts`:
- Around line 13-16: Remove the mountWithPlugin helper from src/plugin.test.ts
and inline its sole call at the test site, or relocate the helper under the
package’s test directory if reuse is needed. Keep the existing render setup and
plugin options behavior unchanged.

In `@README.md`:
- Around line 70-75: Update the README Vite configuration example to import
defineConfig from vite and vue from `@vitejs/plugin-vue` alongside the existing
imports, so the shown plugins array uses resolved identifiers.

---

Nitpick comments:
In `@packages/vue-querybuilder/src/composables/accessors.test.ts`:
- Around line 26-76: Move the test helpers fieldNames, Probe, and
renderWithProbe from accessors.test.ts into a reusable helper module under
packages/vue-querybuilder/test/, then import them into the test. Preserve their
existing behavior and dependencies, including Probe’s injected accessors and
renderWithProbe’s QueryBuilder setup.
🪄 Autofix

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2bac406b-7855-43f6-a8fe-59368ab0d1ee

📥 Commits

Reviewing files that changed from the base of the PR and between 8d019c8 and abc1321.

📒 Files selected for processing (38)
  • AGENTS.md
  • CHANGELOG.md
  • README.md
  • docs/customization.md
  • docs/differences-from-react-querybuilder.md
  • examples/demo/src/App.vue
  • examples/demo/src/main.ts
  • packages/vue-querybuilder/package.json
  • packages/vue-querybuilder/scripts/check-dist-runtime.ts
  • packages/vue-querybuilder/scripts/check-dist-specifiers.ts
  • packages/vue-querybuilder/src/components/ActionElement.vue
  • packages/vue-querybuilder/src/components/NotToggle.vue
  • packages/vue-querybuilder/src/components/QueryBuilder.vue
  • packages/vue-querybuilder/src/components/Rule.vue
  • packages/vue-querybuilder/src/components/RuleGroup.vue
  • packages/vue-querybuilder/src/components/ShiftActions.vue
  • packages/vue-querybuilder/src/components/ValueEditor.vue
  • packages/vue-querybuilder/src/components/defaultControlElements.ts
  • packages/vue-querybuilder/src/components/index.ts
  • packages/vue-querybuilder/src/components/slots.test.ts
  • packages/vue-querybuilder/src/composables/accessors.test.ts
  • packages/vue-querybuilder/src/composables/accessors.ts
  • packages/vue-querybuilder/src/composables/index.ts
  • packages/vue-querybuilder/src/index.ts
  • packages/vue-querybuilder/src/internal/QueryBuilderLabel.test.ts
  • packages/vue-querybuilder/src/internal/QueryBuilderLabel.ts
  • packages/vue-querybuilder/src/internal/RuleComponents.vue
  • packages/vue-querybuilder/src/internal/RuleGroupBody.vue
  • packages/vue-querybuilder/src/internal/RuleGroupHeader.vue
  • packages/vue-querybuilder/src/internal/RuleSubQuery.test.ts
  • packages/vue-querybuilder/src/internal/RuleSubQuery.vue
  • packages/vue-querybuilder/src/internal/parts.test.ts
  • packages/vue-querybuilder/src/internal/parts.ts
  • packages/vue-querybuilder/src/internal/slotToComponent.ts
  • packages/vue-querybuilder/src/plugin.test.ts
  • packages/vue-querybuilder/src/plugin.ts
  • packages/vue-querybuilder/src/resolver.ts
  • packages/vue-querybuilder/vite.config.ts
💤 Files with no reviewable changes (1)
  • packages/vue-querybuilder/src/components/index.ts

Comment thread CHANGELOG.md
Comment thread docs/differences-from-react-querybuilder.md
Comment thread packages/vue-querybuilder/scripts/check-dist-specifiers.ts
Comment thread packages/vue-querybuilder/src/internal/parts.test.ts Outdated
Comment thread packages/vue-querybuilder/src/plugin.test.ts Outdated
Comment thread README.md
@jakeboone02

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@jakeboone02

Copy link
Copy Markdown
Member Author

@coderabbitai did your last review on this PR include commit 6714f5f?

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="react-querybuilder/vue-querybuilder"
pr_number="1"
target_sha="6714f5f9685fbaddd46cac5007f45644351773bf"

echo "=== Pull request ==="
gh api "repos/$repo/pulls/$pr_number" \
  --jq '{head_sha: .head.sha, base_sha: .base.sha, updated_at: .updated_at}'

echo "=== Reviews ==="
gh api --paginate "repos/$repo/pulls/$pr_number/reviews?per_page=100" \
  --jq '.[] | {id, user: .user.login, state, commit_id, submitted_at, body}'

echo "=== Pull request commits ==="
gh api --paginate "repos/$repo/pulls/$pr_number/commits?per_page=100" \
  --jq '.[] | {sha, parents: [.parents[].sha], message: .commit.message}'

echo "=== Target commit ==="
gh api "repos/$repo/commits/$target_sha" \
  --jq '{sha, parents: [.parents[].sha], message: .commit.message, date: .commit.committer.date}'

Length of output: 9825


@jakeboone02 No. The last recorded review covered changes through abc13212fb096b6e06b26ed49aeed692065b6bc7.

Commit 6714f5f9685fbaddd46cac5007f45644351773bf (Component typing refactor) was added later, so that review did not include it.

You are interacting with an AI system.

@jakeboone02

Copy link
Copy Markdown
Member Author

@coderabbitai please do a review that includes commit 6714f5f.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

@jakeboone02 I will review pull request #1, including commit 6714f5f9685fbaddd46cac5007f45644351773bf.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@jakeboone02
jakeboone02 merged commit f8f5912 into main Aug 12, 2026
2 checks passed
@jakeboone02
jakeboone02 deleted the idiomaticity branch August 12, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant