Skip to content

Conversation

@bahulneel
Copy link

Linkled Issue

#1416

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This update leverages getLayerDirectories to build a candidate list of potential folders in layer priority order and then uses findPath to select the first that exists, falling back to the root path. Candidates are generated using resolvePath so that aliases and absolute paths still work, but now all configs can use a path relative to where the app root is. The scan also logs for better transparency.

Using the correct base path for resolution resolves the double registration issue that some people are reporting, as the exclusion path is correct.

  • Bump version from 2.2.0 to 2.2.1-pre.1 in package.json
  • Update @nuxt/kit dependency to ^3.19.2
  • Update @nuxt/schema and @nuxt/test-utils dependencies to ^3.19.0 and ^3.19.2 respectively
  • Add peer dependency for @nuxt/kit
  • Refactor module.ts to improve component directory resolution and logging
  • Introduce findPath for better handling of potential component directories
  • Add a new tarball for the updated module version

πŸ“Έ Screenshots (if appropriate)

Here's the log output

◐ Setting up shadcn-nuxt module { COMPONENT_DIR_PATH: './shadcn/ui',                                shadcn-nuxt 2:54:42 PM
  ROOT_DIR_PATH: '/path/to/project/packages/ui' }
β„Ή Checking { potentialPaths:                                                                       shadcn-nuxt 2:54:42 PM
   [ '/path/to/project/packages/ui/app/shadcn/ui',
     '/path/to/project/packages/shell/app/shadcn/ui',
     '/path/to/project/packages/nuxt-gravity/app/shadcn/ui' ] }
[shadcn-nuxt 2:54:42 PM] β„Ή Decided on { componentsPath: '/path/to/project/packages/ui/app/shadcn/ui' }

πŸ“ Checklist

  • I have linked an issue or discussion.
  • [N/A] I have updated the documentation accordingly.

- Bump version from 2.2.0 to 2.2.1-pre.1 in package.json
- Update @nuxt/kit dependency to ^3.19.2
- Update @nuxt/schema and @nuxt/test-utils dependencies to ^3.19.0 and ^3.19.2 respectively
- Add peer dependency for @nuxt/kit
- Refactor module.ts to improve component directory resolution and logging
- Introduce findPath for better handling of potential component directories
- Add new tarball for the updated module version
@sadeghbarati
Copy link
Collaborator

Hi @bahulneel, can you create a StackBlitz playground for this PR, for testing your package changes, upload/drag your
shadcn-nuxt tarball file into the StackBlitz, for creating tarball file use

pnpm pack

And also create a minimal example for the Nuxt layer features in it

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.

2 participants