Import localization composable from support#16
Import localization composable from support#16swarakaka wants to merge 1 commit intolaravilt:masterfrom
Conversation
…ss field components
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ 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 |
There was a problem hiding this comment.
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.vueLine 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.
📒 Files selected for processing (4)
resources/js/components/fields/CheckboxList.vueresources/js/components/fields/KeyValue.vueresources/js/components/fields/Repeater.vueresources/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' |
There was a problem hiding this comment.
🧩 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" || trueRepository: 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"
fiRepository: 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.
Update localization imports to use @laravilt/support/composables across field components
Fix
Summary by CodeRabbit