Skip to content

Import localization composable from support#16

Open
swarakaka wants to merge 1 commit intolaravilt:masterfrom
swarakaka:fix-import-translation-composable
Open

Import localization composable from support#16
swarakaka wants to merge 1 commit intolaravilt:masterfrom
swarakaka:fix-import-translation-composable

Conversation

@swarakaka
Copy link
Contributor

@swarakaka swarakaka commented Feb 25, 2026

Update localization imports to use @laravilt/support/composables across field components

Fix

Summary by CodeRabbit

  • Refactor
    • Updated internal code organization and consolidated shared dependencies across form components for improved maintainability and code consistency.

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

📝 Walkthrough

Walkthrough

The PR updates the import path for the useLocalization composable from a local path to an external package across four Vue field components. CheckboxList.vue also removes an unused Collapsible component import.

Changes

Cohort / File(s) Summary
Localization Import Migration
resources/js/components/fields/KeyValue.vue, resources/js/components/fields/Repeater.vue, resources/js/components/fields/Select.vue
Updated useLocalization import path from @/composables/useLocalization to @laravilt/support/composables.
Import Path Update and Cleanup
resources/js/components/fields/CheckboxList.vue
Updated useLocalization import path and removed unused Collapsible component import.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 Import paths shuffle left and right,
From local homes to package light,
Composables now share a common space,
Four components find their place,
Cleaner code, a tidy sight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Import localization composable from support' clearly and directly summarizes the main change: updating import paths for the localization composable to use @laravilt/support/composables across multiple field components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@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 (3)
resources/js/components/fields/Select.vue (1)

30-30: Same import-resolution verification applies here.

Line 30 follows the same migration already validated via the shared dependency/export check.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@resources/js/components/fields/Select.vue` at line 30, Confirm and, if
necessary, update the import of useLocalization in Select.vue: verify that the
symbol useLocalization is exported from the package
`@laravilt/support/composables` and adjust the import path or re-export
accordingly so the statement "import { useLocalization } from
'@laravilt/support/composables'" resolves correctly; if the package layout
changed during migration, replace with the new module path or add a proper
re-export in the support package so Select.vue can import useLocalization
without runtime/module resolution errors.
resources/js/components/fields/CheckboxList.vue (1)

5-5: Same import-resolution verification applies here.

Line 5 is the same migration pattern already covered in resources/js/components/fields/KeyValue.vue Line 7.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@resources/js/components/fields/CheckboxList.vue` at line 5, Verify and, if
necessary, update the import for the useLocalization composable in
CheckboxList.vue: locate the import statement "import { useLocalization } from
'@laravilt/support/composables'" and ensure the module path/alias resolves the
same way you fixed in KeyValue.vue (the composable name useLocalization should
point to the correct file/export); modify the import to match the verified
working path used in KeyValue.vue so the composable resolves at runtime.
resources/js/components/fields/Repeater.vue (1)

31-31: Same import-resolution verification applies here.

Line 31 has the same external composable import migration already covered in the root verification note.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@resources/js/components/fields/Repeater.vue` at line 31, The import of
useLocalization in Repeater.vue currently points to
'@laravilt/support/composables' and must be updated to match the import
resolution used in the root verification; locate the import statement "import {
useLocalization } from '@laravilt/support/composables'" in Repeater.vue and
change it to the project's canonical composables path (the same path you fixed
in the root file), ensuring useLocalization is imported from the
local/composable alias used across the codebase so the module resolves
correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@resources/js/components/fields/KeyValue.vue`:
- Line 7: The project imports useLocalization from `@laravilt/support` (see
KeyValue.vue and the other migrated components Repeater.vue, Select.vue,
CheckboxList.vue, SheetContent.vue) but that package is not declared in
package.json; add "@laravilt/support" to the dependencies in package.json
(choose the appropriate semver version used elsewhere or the latest compatible
release), then run your package manager install (npm/yarn/pnpm) so the import
resolves and the build succeeds.

---

Duplicate comments:
In `@resources/js/components/fields/CheckboxList.vue`:
- Line 5: Verify and, if necessary, update the import for the useLocalization
composable in CheckboxList.vue: locate the import statement "import {
useLocalization } from '@laravilt/support/composables'" and ensure the module
path/alias resolves the same way you fixed in KeyValue.vue (the composable name
useLocalization should point to the correct file/export); modify the import to
match the verified working path used in KeyValue.vue so the composable resolves
at runtime.

In `@resources/js/components/fields/Repeater.vue`:
- Line 31: The import of useLocalization in Repeater.vue currently points to
'@laravilt/support/composables' and must be updated to match the import
resolution used in the root verification; locate the import statement "import {
useLocalization } from '@laravilt/support/composables'" in Repeater.vue and
change it to the project's canonical composables path (the same path you fixed
in the root file), ensuring useLocalization is imported from the
local/composable alias used across the codebase so the module resolves
correctly.

In `@resources/js/components/fields/Select.vue`:
- Line 30: Confirm and, if necessary, update the import of useLocalization in
Select.vue: verify that the symbol useLocalization is exported from the package
`@laravilt/support/composables` and adjust the import path or re-export
accordingly so the statement "import { useLocalization } from
'@laravilt/support/composables'" resolves correctly; if the package layout
changed during migration, replace with the new module path or add a proper
re-export in the support package so Select.vue can import useLocalization
without runtime/module resolution errors.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d880d1f and 41e89f8.

📒 Files selected for processing (4)
  • resources/js/components/fields/CheckboxList.vue
  • resources/js/components/fields/KeyValue.vue
  • resources/js/components/fields/Repeater.vue
  • resources/js/components/fields/Select.vue

import { Plus, X, GripVertical } from 'lucide-vue-next'
import { ref, computed } from 'vue'
import { useLocalization } from '@/composables/useLocalization'
import { useLocalization } from '@laravilt/support/composables'
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Check dependency declaration in package manifests =="
fd -HI '^package\.json$' | while read -r f; do
  echo "--- $f ---"
  rg -n '"@laravilt/support"\s*:' "$f" || true
done

echo
echo "== Check lockfiles for resolved package =="
fd -HI '^(pnpm-lock\.yaml|package-lock\.json|yarn\.lock)$' | while read -r f; do
  echo "--- $f ---"
  rg -n '@laravilt/support' "$f" | head -n 30 || true
done

echo
echo "== Check new import usage across field components =="
rg -n --type vue "from '@laravilt/support/composables'"

echo
echo "== Ensure legacy import path is removed =="
rg -n --type vue "@/composables/useLocalization" || true

Repository: laravilt/forms

Length of output: 277


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Repo structure =="
ls -la
echo

echo "== package.json content =="
if [ -f package.json ]; then
  cat package.json
fi
echo

echo "== Check lockfiles =="
fd -HI '^(pnpm-lock|package-lock|yarn\.lock)' | head -20 || true
echo

echo "== Find all .vue files =="
fd '\.vue$' | head -20
echo

echo "== Search for '@laravilt/support/composables' import in .vue files =="
rg '@laravilt/support/composables' --no-type-list 2>/dev/null || rg '@laravilt/support/composables' || true
echo

echo "== Search for legacy `@/composables/useLocalization` import =="
rg '@/composables/useLocalization' --no-type-list 2>/dev/null || rg '@/composables/useLocalization' || true
echo

echo "== Check the specific file mentioned in review =="
if [ -f "resources/js/components/fields/KeyValue.vue" ]; then
  echo "--- KeyValue.vue exists ---"
  head -20 "resources/js/components/fields/KeyValue.vue"
fi

Repository: laravilt/forms

Length of output: 9707


Add @laravilt/support as a dependency in package.json before merge.

The new import on line 7 references an external package that is not declared in package.json dependencies. All 6 .vue files (KeyValue.vue, Repeater.vue, Select.vue, CheckboxList.vue, and SheetContent.vue) have been consistently migrated to use @laravilt/support/composables, but without this package in the dependency list, the build will fail with an unresolved module error.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@resources/js/components/fields/KeyValue.vue` at line 7, The project imports
useLocalization from `@laravilt/support` (see KeyValue.vue and the other migrated
components Repeater.vue, Select.vue, CheckboxList.vue, SheetContent.vue) but
that package is not declared in package.json; add "@laravilt/support" to the
dependencies in package.json (choose the appropriate semver version used
elsewhere or the latest compatible release), then run your package manager
install (npm/yarn/pnpm) so the import resolves and the build succeeds.

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