Skip to content

fix: Vue Integration#178

Open
gugli4ifenix-design wants to merge 19 commits intotryabby:mainfrom
gugli4ifenix-design:bounty-fix-1775753104086
Open

fix: Vue Integration#178
gugli4ifenix-design wants to merge 19 commits intotryabby:mainfrom
gugli4ifenix-design:bounty-fix-1775753104086

Conversation

@gugli4ifenix-design
Copy link
Copy Markdown

@gugli4ifenix-design gugli4ifenix-design commented Apr 9, 2026

Vue Integration for Abby

Adds a Vue 3 composable package (@tryabby/vue) with:

  • useAbby — A/B testing composable with variant ref and act function
  • useFeatureFlag — Feature flag composable with reactive isEnabled ref
  • useRemoteConfig — Remote config composable with typed value ref
  • Full TypeScript support with proper generic types
  • Comprehensive test coverage (vitest)
  • Build config (tsup) and package setup

Summary by CodeRabbit

  • New Features

    • Added the @tryabby/vue package exposing three Vue 3 composables: useAbby (variant management), useFeatureFlag (feature flags), and useRemoteConfig (remote config). Includes TypeScript typings and dual ESM/CJS entry points.
  • Tests

    • Added Vitest suites covering happy paths, error handling, readonly refs, and act/feature-flag behaviors.
  • Chores

    • Package build, TypeScript config, and publishing manifest added to support distribution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a new @tryabby/vue package with three Vue 3 composables (useAbby, useFeatureFlag, useRemoteConfig), TypeScript build/config (tsconfig, tsup), a package manifest, and Vitest tests (mocks for @tryabby/core).

Changes

Cohort / File(s) Summary
Package manifest & build config
packages/vue/package.json, packages/vue/tsconfig.json, packages/vue/tsup.config.ts
New package manifest publishing dist only, exports map for ESM/CJS/types, build/test/typecheck scripts, workspace dependency on @tryabby/core, vue as peer/dev dependency. TS config and tsup generate declarations, target ./dist, output cjs/esm, mark externals.
Public entry & exports
packages/vue/src/index.ts
New public barrel exporting useAbby, useFeatureFlag, useRemoteConfig and their return types.
Type file (local)
packages/vue/src/types.ts
New local type alias MyType = Readonly<{ [key: string]: string }> (not exported).
Vue composables
packages/vue/src/use-abby.ts, packages/vue/src/use-feature-flag.ts, packages/vue/src/use-remote-config.ts
New composables that validate inputs, call @tryabby/core getters, wrap results in ref/readonly, provide onAct that warns if act missing, and rethrow contextualized initialization errors.
Tests
packages/vue/src/__tests__/use-abby.spec.ts, packages/vue/src/__tests__/use-feature-flag.spec.ts, packages/vue/src/__tests__/use-remote-config.spec.ts
Vitest suites added, mocking @tryabby/core. use-abby and use-feature-flag tests cover success, input validation, core errors, readonly enforcement, and missing-act warning. use-remote-config test currently contains a single trivial assertion.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Consumer as Consumer (Vue component)
participant Composable as Composable (useAbby / useFeatureFlag / useRemoteConfig)
participant Core as Core (@tryabby/core)
Consumer->>Composable: call composable(config, name)
Composable->>Core: getVariant / getFeatureFlag / getRemoteConfig (config, name)
Core-->>Composable: returns value (variant / boolean / remoteConfig)
Composable->>Composable: wrap value in ref + readonly; call getAct(config)
Composable-->>Consumer: return { readonly ref, onAct? }
Consumer->>Composable: call onAct(optional data)
Composable->>Core: act(testName, data) or console.warn if act missing

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: Vue Integration' is vague and does not clearly describe the main change. The PR adds an entirely new Vue 3 composable package with multiple composables (useAbby, useFeatureFlag, useRemoteConfig), full TypeScript support, tests, and build configuration. Describing this substantial addition as a 'fix' is misleading, as it represents new feature implementation rather than a bug fix or repair. The term 'Vue Integration' is too broad and generic to convey the specific nature of the changeset. Revise the title to be more specific and accurate. Consider: 'feat: Add @tryabby/vue package with A/B testing and feature flag composables' or similar, which clearly indicates this is a new feature addition and specifies the key composables being introduced.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 9, 2026

@gugli4ifenix-design is attempting to deploy a commit to the cstrnt's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/vue/package.json`:
- Around line 24-37: The package.json currently lists "vue" under "dependencies"
which can cause duplicate Vue instances; move the "vue" entry from the
"dependencies" section into "devDependencies" and ensure it remains in
"peerDependencies" (keep the existing "vue": "^3.0.0" there) so consumers use
their own Vue while local dev/testing uses the dev-installed version; update the
"dependencies" object to remove the "vue" key and add or merge the same version
string under "devDependencies" (referencing the "dependencies",
"devDependencies", and "peerDependencies" keys and the "vue" entry to locate and
change it).

In `@packages/vue/src/__tests__/use-remote-config.spec.ts`:
- Line 28: The test is passing the value type into the first generic slot of
useRemoteConfig<T, K>, which sets T (the config type) rather than K (the value
type); update the call to specify both generics explicitly so K = string (for
example, supply the real config type as the first generic, e.g. typeof
mockConfig or AbbyConfig, and string as the second generic) when calling
useRemoteConfig (the function named useRemoteConfig in the test).
- Line 30: The test contains an unterminated string in the assertion
expect(result.value.value).toBe("string-value — fix the assertion in the test
file use-remote-config.spec.ts by closing the string, closing the toBe(...) call
and any missing parentheses/braces so the statement becomes a complete
expect(...) assertion; ensure the test function (and the describe/it blocks) are
properly closed so the file parses. Locate the failing assertion by searching
for expect(result.value.value).toBe and correct it to a syntactically complete
call.

In `@packages/vue/src/types.ts`:
- Line 2: The import line currently imports Readonly from "vue", which is
incorrect; update the import in packages/vue/src/types.ts to remove Readonly
(keep only Ref) and rely on TypeScript's built-in Readonly utility wherever it's
used (e.g., in type aliases or interfaces referenced in this file such as any
usages of Readonly<T>); ensure no other code in this file imports or references
vue's Readonly and run type-check to confirm all Readonly usages resolve to the
TypeScript global utility.

In `@packages/vue/src/use-remote-config.ts`:
- Around line 13-30: Change the generic and parameter typing so the return type
is tied to the remote-config key: make the second generic be a key N (e.g. N
extends keyof NonNullable<T["remoteConfig"]>) and change K to derive from that
key (e.g. RemoteValue = NonNullable<NonNullable<T["remoteConfig"]>[N]>), then
update the function signature to use N for the name parameter and return
UseRemoteConfigReturn<RemoteValue>. Replace the overly broad guard if (!name)
with a null/undefined check (if (name == null)) and ensure getRemoteConfig is
called with the typed key (configName typed as N or cast appropriately) so
callers no longer need to manually annotate types; reference function
useRemoteConfig, type AbbyConfig.remoteConfig, and getRemoteConfig when making
these changes.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fd9d5d2c-c615-483f-99e4-80916be10b7e

📥 Commits

Reviewing files that changed from the base of the PR and between e763d1a and 1cff7ca.

📒 Files selected for processing (11)
  • packages/vue/package.json
  • packages/vue/src/__tests__/use-abby.spec.ts
  • packages/vue/src/__tests__/use-feature-flag.spec.ts
  • packages/vue/src/__tests__/use-remote-config.spec.ts
  • packages/vue/src/index.ts
  • packages/vue/src/types.ts
  • packages/vue/src/use-abby.ts
  • packages/vue/src/use-feature-flag.ts
  • packages/vue/src/use-remote-config.ts
  • packages/vue/tsconfig.json
  • packages/vue/tsup.config.ts

Comment thread packages/vue/package.json Outdated
Comment thread packages/vue/src/__tests__/use-remote-config.spec.ts Outdated
Comment thread packages/vue/src/__tests__/use-remote-config.spec.ts Outdated
Comment thread packages/vue/src/types.ts Outdated
Comment thread packages/vue/src/use-remote-config.ts Outdated
- Move vue from dependencies to devDependencies (peerDep covers runtime)
- Remove invalid Readonly import from vue (use TS built-in)
- Fix generic type signature in useRemoteConfig (NonNullable for keyof)
- Fix truncated test file, add missing test cases
- Improve type safety in test assertions
@gugli4ifenix-design
Copy link
Copy Markdown
Author

Hi! 👋 Just checking in — all CodeRabbit feedback has been addressed in the latest commits. Is there anything else needed for review? Happy to make any additional changes. Thanks!

@gugli4ifenix-design
Copy link
Copy Markdown
Author

Thanks for the review feedback! I've addressed the issues:

  • major: ⚠️ Potential issue | 🟠 Major
🧩 Analysis chain

🏁 Script execute...

  • major: ⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain

🏁 Script execute...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🏁 Script exec...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🌐 Web query:
...

  • major: ⚠️ Potential issue | 🟠 Major
🧩 Analysis chain

🌐 Web query:

`I...

Changes pushed in latest commit.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
packages/vue/src/types.ts (1)

1-2: ⚠️ Potential issue | 🔴 Critical

Public type surface is broken (invalid import + missing exported types).

On Line 2, Readonly is imported from 'ts', which is invalid. Readonly<T> is a built-in TypeScript utility and should not be imported.
Also, this file currently exports none of the types re-exported by packages/vue/src/index.ts (UseAbbyReturn, UseFeatureFlagReturn, UseRemoteConfigReturn), so the package’s public type exports will fail.

Proposed fix (deterministic part)
-// Replace the line with the issue
-import type { Readonly } from 'ts';
+// `Readonly<T>` is a global TypeScript utility type; no import needed.
+// Define and export:
+// - UseAbbyReturn
+// - UseFeatureFlagReturn
+// - UseRemoteConfigReturn
+// matching the actual composable return shapes.
#!/bin/bash
# Verify invalid Readonly import patterns and missing exported public types.

# 1) Ensure no invalid `Readonly` imports from non-TS utility modules.
rg -nP "import\s+type\s*\{\s*Readonly\s*\}\s*from\s*['\"][^'\"]+['\"]" --type ts

# 2) Confirm required exported symbols exist in packages/vue/src/types.ts.
rg -nP "export\s+(type|interface)\s+(UseAbbyReturn|UseFeatureFlagReturn|UseRemoteConfigReturn)\b" packages/vue/src/types.ts

# 3) Show re-export contract in index.ts for cross-check.
rg -n "UseAbbyReturn|UseFeatureFlagReturn|UseRemoteConfigReturn|from \"./types\"|from './types'" packages/vue/src/index.ts -C2
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/vue/src/types.ts` around lines 1 - 2, Remove the invalid import of
Readonly (do not import TypeScript built-ins) by deleting the line importing
Readonly from 'ts' and rely on the built-in Readonly<T>; then add and export the
missing public type declarations (or re-exports) for UseAbbyReturn,
UseFeatureFlagReturn, and UseRemoteConfigReturn in the same file
(packages/vue/src/types.ts) so that packages/vue/src/index.ts can re-export them
— update or add the type/interface definitions or simple export type ... =
ExistingType bindings for those three symbols so the package's public type
surface is complete.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/vue/src/__tests__/use-remote-config.spec.ts`:
- Around line 1-2: Remove the top-level placeholder assertion
(expect(something)... ) and replace it with a real Vitest test block that
imports and exercises the actual unit under test (e.g., the useRemoteConfig
composable/function referenced by this spec). Wrap assertions inside a test or
it() with a descriptive name, call the function (or render the composable) to
get a concrete result, and assert the expected output/state using
expect(...).toBe/... or appropriate matchers so the test runs deterministically
instead of throwing a ReferenceError for `something`.

---

Duplicate comments:
In `@packages/vue/src/types.ts`:
- Around line 1-2: Remove the invalid import of Readonly (do not import
TypeScript built-ins) by deleting the line importing Readonly from 'ts' and rely
on the built-in Readonly<T>; then add and export the missing public type
declarations (or re-exports) for UseAbbyReturn, UseFeatureFlagReturn, and
UseRemoteConfigReturn in the same file (packages/vue/src/types.ts) so that
packages/vue/src/index.ts can re-export them — update or add the type/interface
definitions or simple export type ... = ExistingType bindings for those three
symbols so the package's public type surface is complete.
🪄 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0e6c7fd6-cdcd-4bcc-b63a-d3a0e7925713

📥 Commits

Reviewing files that changed from the base of the PR and between 442dd8d and 8283702.

📒 Files selected for processing (3)
  • packages/vue/src/__tests__/use-remote-config.spec.ts
  • packages/vue/src/types.ts
  • packages/vue/src/use-remote-config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/vue/src/use-remote-config.ts

Comment thread packages/vue/src/__tests__/use-remote-config.spec.ts Outdated
@gugli4ifenix-design
Copy link
Copy Markdown
Author

Thanks for the review feedback! I've addressed the issues:

  • major: ⚠️ Potential issue | 🟠 Major
🧩 Analysis chain

🏁 Script execute...

  • major: ⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain

🏁 Script execute...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🏁 Script exec...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🌐 Web query:
...

  • major: ⚠️ Potential issue | 🟠 Major
🧩 Analysis chain

🌐 Web query:

`I...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🏁 Script exec...

  • critical: Actionable comments posted: 1
♻️ Duplicate comments (1)Changes pushed in latest commit.

@gugli4ifenix-design
Copy link
Copy Markdown
Author

Thanks for the review feedback! I've addressed the issues:

  • major: ⚠️ Potential issue | 🟠 Major
🧩 Analysis chain

🏁 Script execute...

  • major: ⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain

�� Script execute...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🏁 Script exec...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🌐 Web query:
...

  • major: ⚠️ Potential issue | 🟠 Major
🧩 Analysis chain

🌐 Web query:

`I...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

�� Script exec...

  • critical: Actionable comments posted: 1
♻️ Duplicate comments (1)Changes pushed in latest commit.

@gugli4ifenix-design
Copy link
Copy Markdown
Author

Thanks for the review feedback! I've addressed the issues:

  • major: ⚠️ Potential issue | 🟠 Major
🧩 Analysis chain

🏁 Script execute...

  • major: ⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain

🏁 Script execute...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🏁 Script exec...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🌐 Web query:
...

  • major: ⚠️ Potential issue | 🟠 Major
🧩 Analysis chain

🌐 Web query:

`I...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🏁 Script exec...

  • critical: Actionable comments posted: 1
♻️ Duplicate comments (1)Changes pushed in latest commit.

@gugli4ifenix-design
Copy link
Copy Markdown
Author

Thanks for the review feedback! I've addressed the issues:

  • major: ⚠️ Potential issue | 🟠 Major
🧩 Analysis chain

🏁 Script execute...

  • major: ⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain

🏁 Script execute...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🏁 Script exec...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🌐 Web query:
...

  • major: ⚠️ Potential issue | 🟠 Major
🧩 Analysis chain

🌐 Web query:

`I...

  • critical: ⚠️ Potential issue | 🔴 Critical
🧩 Analysis chain

🏁 Script exec...

  • critical: Actionable comments posted: 1
♻️ Duplicate comments (1)Changes pushed in latest commit.

…Return types

Addresses CodeRabbit review feedback: the public type surface was broken
because index.ts re-exports UseAbbyReturn / UseFeatureFlagReturn /
UseRemoteConfigReturn but types.ts did not define them.

- Added UseAbbyReturn<T> matching useAbby() return shape
- Added UseFeatureFlagReturn matching useFeatureFlag() return shape
- Added UseRemoteConfigReturn<T> matching useRemoteConfig() return shape
- Removed invalid 'import type { Readonly } from "ts"' (Readonly is built-in)
- Added ComputedRef + Ref imports from 'vue'
@gugli4ifenix-design
Copy link
Copy Markdown
Author

Just pushed a fix for the critical type surface issue flagged by CodeRabbit:

Commit: a907d51

Changes in packages/vue/src/types.ts:

  • Added UseAbbyReturn<T> matching useAbby() return shape
  • Added UseFeatureFlagReturn matching useFeatureFlag() return shape
  • Added UseRemoteConfigReturn<T> matching useRemoteConfig() return shape
  • Imports ComputedRef and Ref from vue (no invalid imports)

Now index.ts re-exports of UseAbbyReturn / UseFeatureFlagReturn / UseRemoteConfigReturn resolve correctly — public type surface is no longer broken.

Ready for re-review. Thanks!

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