Skip to content

Conversation

@heymaaz
Copy link

@heymaaz heymaaz commented Oct 31, 2025

Summary

The fix addresses both issues:
Issue #8648: Components have /lib/utils hardcoded
Problem: Components get /lib/utils instead of the configured /app/function/lib/utils.
Fix: When a user configures an absolute path ending with /lib/utils (e.g., /app/function/lib/utils), it is preserved.

Issue #7348/#7557: Components default to src/lib/utils instead of src/utils
Problem: Setting "utils": "src/utils" still produces src/lib/utils.
Fix: When the alias doesn't end with /utils, /utils is appended. For relative paths like @/lib/utils or paths without explicit /lib/utils, /lib/utils is replaced with /src/utils.

Behavior

Detects both @/lib/utils and @/src/utils imports.

Uses the configured utils alias from components.json.

Preserves absolute paths: if you configure /app/function/lib/utils, it keeps that path.

Defaults to /src/utils: for relative/alias paths, replaces /lib/utils with /src/utils.

Handles sub-path imports: @/lib/utils/bar and @/src/utils/bar are supported.

Handles re-exports: detects cn in export statements.

All tests pass.

@vercel
Copy link

vercel bot commented Oct 31, 2025

@heymaaz is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

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