Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change the shadcn-ui directory and remove rarely used components #4626

Merged
merged 1 commit into from
Oct 13, 2024

Conversation

anncwb
Copy link
Collaborator

@anncwb anncwb commented Oct 13, 2024

Description

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs:dev command.
  • Run the tests with pnpm test.
  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced the MenuBadge component for enhanced menu item notifications.
    • Added a centralized export file for streamlined access to various UI components.
  • Bug Fixes

    • Updated import paths for several components to ensure proper functionality following directory restructuring.
  • Documentation

    • Removed deprecated exports from the main component index, improving clarity and usability.
  • Chores

    • Deleted unused components and their corresponding export files to maintain a clean codebase.

Copy link

changeset-bot bot commented Oct 13, 2024

⚠️ No Changeset found

Latest commit: 9e6fe28

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Oct 13, 2024

Walkthrough

The pull request introduces significant changes to the UI kit components, including the addition of the MenuBadge component and modifications to existing components to utilize this new badge. Several components have updated import paths, consolidating them for better organization. Additionally, multiple files and exports have been removed, streamlining the module's interface. A new index.ts file has been created in the UI directory to facilitate centralized exports of various UI components, enhancing modularity.

Changes

File Change Summary
packages/@core/ui-kit/menu-ui/src/components/index.ts New export added: MenuBadge from menu-badge.vue.
packages/@core/ui-kit/menu-ui/src/components/menu-item.vue Updated import from <VbenMenuBadge> to <MenuBadge>.
packages/@core/ui-kit/menu-ui/src/sub-menu.vue Replaced VbenMenuBadge with MenuBadge in import and template.
packages/@core/ui-kit/shadcn-ui/src/components/avatar/avatar.vue Import path changed for Avatar, AvatarFallback, AvatarImage from ../ui/avatar to ../../ui.
packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb.vue Import paths consolidated for breadcrumb and dropdown menu components.
packages/@core/ui-kit/shadcn-ui/src/components/button/button.ts Import path updated for ButtonVariants and ButtonVariantSize.
packages/@core/ui-kit/shadcn-ui/src/components/button/button.vue Import path for buttonVariants updated.
packages/@core/ui-kit/shadcn-ui/src/components/button/icon-button.vue Import path for ButtonVariants updated.
packages/@core/ui-kit/shadcn-ui/src/components/checkbox/checkbox.vue Import path for Checkbox updated.
packages/@core/ui-kit/shadcn-ui/src/components/context-menu/context-menu.vue Import path for ContextMenu components updated.
packages/@core/ui-kit/shadcn-ui/src/components/dropdown-menu/dropdown-menu.vue Import path modified for dropdown menu components.
packages/@core/ui-kit/shadcn-ui/src/components/dropdown-menu/dropdown-radio-menu.vue Import path modified for dropdown menu components.
packages/@core/ui-kit/shadcn-ui/src/components/hover-card/hover-card.vue Import path modified for HoverCard components.
packages/@core/ui-kit/shadcn-ui/src/components/index.ts Multiple exports removed, significantly reducing exported entities.
packages/@core/ui-kit/shadcn-ui/src/components/input-password/input-password.vue Import path for Input updated.
packages/@core/ui-kit/shadcn-ui/src/components/link/index.ts File deleted, removing export for VbenLink.
packages/@core/ui-kit/shadcn-ui/src/components/link/link.vue File deleted, removing the link component.
packages/@core/ui-kit/shadcn-ui/src/components/menu-badge/index.ts File deleted, removing export for VbenMenuBadge.
packages/@core/ui-kit/shadcn-ui/src/components/pagination/index.ts File deleted, removing exports for VbenPagination and VbenPaginationProps.
packages/@core/ui-kit/shadcn-ui/src/components/pagination/pagination.ts File deleted, removing PaginationProps interface and SIZE_CLASS_MAP.
packages/@core/ui-kit/shadcn-ui/src/components/pagination/pagination.vue File deleted, removing pagination component.
packages/@core/ui-kit/shadcn-ui/src/components/pin-input/input.vue Import path updated for PinInput components.
packages/@core/ui-kit/shadcn-ui/src/components/popover/popover.vue Import path updated for Popover components.
packages/@core/ui-kit/shadcn-ui/src/components/scrollbar/scrollbar.vue Import path updated for ScrollArea and ScrollBar.
packages/@core/ui-kit/shadcn-ui/src/components/segmented/segmented.vue Import path updated for Tabs components.
packages/@core/ui-kit/shadcn-ui/src/components/select/select.vue Import path modified for Select components.
packages/@core/ui-kit/shadcn-ui/src/components/swap/index.ts File deleted, removing export for VbenSwap.
packages/@core/ui-kit/shadcn-ui/src/components/swap/swap.vue File deleted, removing the swap component.
packages/@core/ui-kit/shadcn-ui/src/components/tooltip/tooltip.vue Import path modified for tooltip components.
packages/@core/ui-kit/shadcn-ui/src/index.ts New export added: export * from './ui';.
packages/@core/ui-kit/shadcn-ui/src/ui/index.ts New file created to aggregate exports for various UI components.

Suggested reviewers

  • vince292007

🐰 In the UI kit, oh what a sight,
New badges added, components bright!
Imports now tidy, paths made clear,
A hop and a skip, let’s give a cheer!
With every change, our toolkit grows,
Hoppy days ahead, as everyone knows! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@anncwb anncwb merged commit 0ea0f20 into main Oct 13, 2024
14 checks passed
@anncwb anncwb deleted the refactor/shadcn-ui branch October 13, 2024 02:58
Copy link
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: 3

🧹 Outside diff range and nitpick comments (5)
packages/@core/ui-kit/shadcn-ui/src/ui/index.ts (1)

1-29: Excellent centralization of UI component exports

The creation of this index.ts file is a great step towards improving the organization and modularity of the UI kit. It provides a single point of entry for importing all UI components, which will simplify usage across the project. The consistent naming convention and alphabetical ordering of exports enhance readability and maintainability.

To further improve maintainability, consider adding a brief comment at the top of the file explaining its purpose and any conventions used (e.g., naming, ordering). This will help future contributors understand and maintain this file more easily. For example:

/**
 * Central export file for all UI components.
 * Components are exported in alphabetical order.
 * Each component is imported from its own file using kebab-case naming.
 */

export * from './accordion';
// ... rest of the exports
packages/@core/ui-kit/shadcn-ui/src/components/input-password/input-password.vue (1)

Line range hint 1-68: Great implementation overall! Consider these minor improvements.

The component is well-structured and uses modern Vue 3 features like defineModel. Here are some suggestions for further improvement:

  1. Consider fully migrating to the Composition API for consistency. Currently, there's a mix with defineOptions using the Options API.
  2. The passwordStrength prop could benefit from a default value in the prop definition.
  3. Consider adding a prop for customizing the icon size, as it's currently hardcoded to size-4.

Here's an example of how you could implement these suggestions:

 interface Props {
   class?: any;
   /**
    * 是否显示密码强度
    */
-  passwordStrength?: boolean;
+  passwordStrength?: boolean;
+  iconSize?: string;
 }

-defineOptions({
-  inheritAttrs: false,
-});
+const props = withDefaults(defineProps<Props>(), {
+  passwordStrength: false,
+  iconSize: 'size-4'
+});

-const props = defineProps<Props>();

+const inheritAttrs = false;

 // ... rest of the component code

-      <Eye v-if="show" class="size-4" />
-      <EyeOff v-else class="size-4" />
+      <Eye v-if="show" :class="props.iconSize" />
+      <EyeOff v-else :class="props.iconSize" />

These changes would make the component more flexible and consistent with the Composition API style.

packages/effects/common-ui/src/ui/about/about.vue (3)

44-49: LGTM: New renderLink function

The introduction of the renderLink function is a good refactoring step. It encapsulates the creation of link elements, improving code reusability and consistency. The function correctly sets the target attribute for external links and applies consistent styling.

Consider adding a rel="noopener noreferrer" attribute to the anchor element for additional security when opening links in a new tab:

 const renderLink = (href: string, text: string) =>
   h(
     'a',
-    { href, target: '_blank', class: 'text-primary hover:text-primary-hover' },
+    { href, target: '_blank', rel: 'noopener noreferrer', class: 'text-primary hover:text-primary-hover' },
     { default: () => text },
   );

117-123: LGTM: Replacement of VbenLink with standard anchor tag

The replacement of the VbenLink component with a standard anchor tag for the GitHub URL is consistent with the refactoring approach seen in the script section. This change maintains the same styling and functionality while potentially improving performance by using a native HTML element.

For consistency with the renderLink function, consider adding the rel="noopener noreferrer" attribute to the anchor tag:

 <a
   :href="VBEN_GITHUB_URL"
   class="text-primary hover:text-primary-hover"
   target="_blank"
+  rel="noopener noreferrer"
 >
   {{ name }}
 </a>

Line range hint 1-186: Overall assessment: Successful refactoring with improved consistency

The changes in this file successfully achieve the PR's objective of refactoring the shadcn-ui directory and removing rarely used components. The VbenLink component has been replaced with a custom renderLink function and standard HTML anchor tags, leading to improved code consistency and potentially better performance. The functionality of the component remains unchanged while the codebase becomes more streamlined.

Consider extracting the renderLink function into a separate utility file if it's likely to be used across multiple components. This would further enhance code reusability and maintain a single source of truth for link rendering throughout the application.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1b65254 and 9e6fe28.

📒 Files selected for processing (33)
  • packages/@core/ui-kit/menu-ui/src/components/index.ts (1 hunks)
  • packages/@core/ui-kit/menu-ui/src/components/menu-item.vue (2 hunks)
  • packages/@core/ui-kit/menu-ui/src/sub-menu.vue (2 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/avatar/avatar.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/breadcrumb/breadcrumb.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/button/button.ts (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/button/button.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/button/icon-button.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/checkbox/checkbox.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/context-menu/context-menu.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/dropdown-menu/dropdown-menu.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/dropdown-menu/dropdown-radio-menu.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/hover-card/hover-card.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/index.ts (0 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/input-password/input-password.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/link/index.ts (0 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/link/link.vue (0 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/menu-badge/index.ts (0 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/pagination/index.ts (0 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/pagination/pagination.ts (0 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/pagination/pagination.vue (0 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/pin-input/input.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/popover/popover.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/scrollbar/scrollbar.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/segmented/segmented.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/select/select.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/swap/index.ts (0 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/swap/swap.vue (0 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/tooltip/tooltip.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/index.ts (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/ui/index.ts (1 hunks)
  • packages/effects/common-ui/src/ui/about/about.vue (4 hunks)
  • playground/package.json (1 hunks)
💤 Files with no reviewable changes (9)
  • packages/@core/ui-kit/shadcn-ui/src/components/index.ts
  • packages/@core/ui-kit/shadcn-ui/src/components/link/index.ts
  • packages/@core/ui-kit/shadcn-ui/src/components/link/link.vue
  • packages/@core/ui-kit/shadcn-ui/src/components/menu-badge/index.ts
  • packages/@core/ui-kit/shadcn-ui/src/components/pagination/index.ts
  • packages/@core/ui-kit/shadcn-ui/src/components/pagination/pagination.ts
  • packages/@core/ui-kit/shadcn-ui/src/components/pagination/pagination.vue
  • packages/@core/ui-kit/shadcn-ui/src/components/swap/index.ts
  • packages/@core/ui-kit/shadcn-ui/src/components/swap/swap.vue
✅ Files skipped from review due to trivial changes (5)
  • packages/@core/ui-kit/shadcn-ui/src/components/button/icon-button.vue
  • packages/@core/ui-kit/shadcn-ui/src/components/context-menu/context-menu.vue
  • packages/@core/ui-kit/shadcn-ui/src/components/hover-card/hover-card.vue
  • packages/@core/ui-kit/shadcn-ui/src/components/scrollbar/scrollbar.vue
  • playground/package.json
🧰 Additional context used
🔇 Additional comments (28)
packages/@core/ui-kit/shadcn-ui/src/index.ts (1)

1-3: Overall structure looks good

The index file now exports from three sources: './components', './ui', and specific exports from 'radix-vue'. This structure provides a clear and centralized point for importing various UI components and utilities. It enhances the modularity of the codebase and simplifies imports for consumers of this module.

packages/@core/ui-kit/menu-ui/src/components/index.ts (1)

2-2: New export for MenuBadge component added.

The addition of the MenuBadge export is consistent with the existing export pattern in this file. This change aligns with the PR objectives of refactoring the UI components, potentially introducing a new badge feature for menu items.

To ensure the MenuBadge component is properly implemented and its usage is consistent across the project, let's verify its implementation and usage:

✅ Verification successful

MenuBadge component verified successfully.

The menu-badge.vue file exists and is properly imported and used in relevant components. No pending TODO or FIXME comments related to MenuBadge were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify MenuBadge component implementation and usage

# Check if the menu-badge.vue file exists
echo "Checking for menu-badge.vue file:"
fd --type file "menu-badge.vue" packages/@core/ui-kit/menu-ui/src/components

# Look for usage of MenuBadge component in the project
echo "\nChecking usage of MenuBadge component:"
rg --type vue "MenuBadge"

# Check if there are any TODO or FIXME comments related to MenuBadge
echo "\nChecking for TODO or FIXME comments related to MenuBadge:"
rg --type vue "(TODO|FIXME).*MenuBadge"

Length of output: 557


Script:

#!/bin/bash
# Description: Verify MenuBadge component implementation and usage

# Check if the menu-badge.vue file exists
echo "Checking for menu-badge.vue file:"
fd --type file "menu-badge.vue" packages/@core/ui-kit/menu-ui/src/components

# Look for usage of MenuBadge component in the project
echo "\nChecking usage of MenuBadge component:"
rg -g "*.vue" "MenuBadge"

# Check if there are any TODO or FIXME comments related to MenuBadge
echo "\nChecking for TODO or FIXME comments related to MenuBadge:"
rg -g "*.vue" "(TODO|FIXME).*MenuBadge"

Length of output: 866

packages/@core/ui-kit/shadcn-ui/src/components/select/select.vue (2)

Line range hint 10-31: LGTM! File consistency maintained.

The rest of the file, including the Props interface, component logic, and template usage, remains unchanged and consistent with the updated import statement. The imported components (Select, SelectContent, SelectItem, SelectTrigger, SelectValue) are used correctly in the template section.


Line range hint 1-8: LGTM! Verify new import path and ensure consistency.

The change to import UI components from '../../ui' looks good and aligns with the PR objective of refactoring the shadcn-ui directory. This modification likely centralizes UI component imports, which can improve maintainability.

To ensure the change is correct and consistent:

  1. Verify that all required components (Select, SelectContent, SelectItem, SelectTrigger, SelectValue) are exported from the new '../../ui' path.
  2. Check if similar import path updates are needed in other files using these components.

Run the following script to verify the new import structure and usage:

This script will help ensure the consistency of the import changes across the project.

packages/@core/ui-kit/shadcn-ui/src/components/checkbox/checkbox.vue (1)

8-8: LGTM! Verify directory structure consistency.

The updated import path for the Checkbox component aligns with the PR objectives of refactoring the shadcn-ui directory. This change suggests that the 'ui' directory has been moved up one level in the hierarchy.

To ensure consistency across the project, please run the following script to verify that all imports of the Checkbox component have been updated correctly:

✅ Verification successful

Verified directory structure consistency.

All Checkbox component imports in .vue files have been updated to the correct path.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all imports of the Checkbox component use the correct path.

# Test: Search for Checkbox imports. Expect: Only occurrences of the new import path.
rg --type vue -A 1 "import.*Checkbox.*from" packages/@core/ui-kit/shadcn-ui/src

Length of output: 109


Script:

#!/bin/bash
# Description: Verify all imports of the Checkbox component use the correct path.

# Test: Search for Checkbox imports in .vue files using glob.
rg "import.*Checkbox.*from" packages/@core/ui-kit/shadcn-ui/src --glob "*.vue"

Length of output: 467

packages/@core/ui-kit/shadcn-ui/src/components/button/button.ts (2)

Line range hint 7-26: Verify type definitions in the new location

While the VbenButtonProps interface remains unchanged and correctly uses the imported types, it's important to ensure that the ButtonVariants and ButtonVariantSize types are properly defined in their new location.

Please run the following verification:

#!/bin/bash
# Description: Verify the definitions of ButtonVariants and ButtonVariantSize in the new location

# Check the definitions of ButtonVariants and ButtonVariantSize
echo "Verifying type definitions:"
rg --type typescript -A 10 "export (type|interface) (ButtonVariants|ButtonVariantSize)" packages/@core/ui-kit/shadcn-ui/src/ui

This script will help ensure that the ButtonVariants and ButtonVariantSize types are correctly defined in the new location, maintaining the expected structure for the VbenButtonProps interface.


3-3: LGTM! Verify consistency across the project.

The updated import path aligns with the PR objective of refactoring the shadcn-ui directory. This change potentially improves code organization by centralizing UI-related imports.

To ensure this change is consistent and doesn't introduce any issues, please run the following verification:

This script will help ensure that:

  1. There are no remaining imports from the old path.
  2. The new import path is used consistently across the project.
  3. The ButtonVariants and ButtonVariantSize types are properly exported from the new location.
✅ Verification successful

Import path update verified successfully.

All instances of ButtonVariants and ButtonVariantSize now use the new import path, and these types are properly exported from the updated location.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the consistency of ButtonVariants and ButtonVariantSize imports across the project

# Search for any remaining imports from the old path
echo "Checking for any remaining old imports:"
rg --type typescript "from '\.\./ui/button'" packages/@core/ui-kit

# Verify that the new import path is used consistently
echo "Verifying new import path usage:"
rg --type typescript "from '\.\./\.\./ui'" packages/@core/ui-kit

# Check if ButtonVariants and ButtonVariantSize are exported from the new location
echo "Verifying exports from the new location:"
rg --type typescript "export.*ButtonVariants.*ButtonVariantSize" packages/@core/ui-kit/shadcn-ui/src/ui

Length of output: 720


Script:

#!/bin/bash
# Description: Verify the consistency of ButtonVariants and ButtonVariantSize imports across the project

# Search for any remaining imports from the old path
echo "Checking for any remaining old imports:"
rg --type ts --type tsx "from '\.\./ui/button'" packages/@core/ui-kit

# Verify that the new import path is used consistently
echo "Verifying new import path usage:"
rg --type ts --type tsx "from '\.\./\.\./ui'" packages/@core/ui-kit

# Check if ButtonVariants and ButtonVariantSize are exported from the new location
echo "Verifying exports from the new location:"
rg --type ts --type tsx "export\s+(type|interface)\s+(ButtonVariants|ButtonVariantSize)" packages/@core/ui-kit/shadcn-ui/src/ui

Length of output: 622


Script:

#!/bin/bash
# Description: Verify the consistency of ButtonVariants and ButtonVariantSize imports across the project

# Search for any remaining imports from the old path
echo "Checking for any remaining old imports:"
rg -g "*.ts" -g "*.tsx" "from '\.\./ui/button'" packages/@core/ui-kit

# Verify that the new import path is used consistently
echo "Verifying new import path usage:"
rg -g "*.ts" -g "*.tsx" "from '\.\./\.\./ui'" packages/@core/ui-kit

# Check if ButtonVariants and ButtonVariantSize are exported from the new location
echo "Verifying exports from the new location:"
rg -g "*.ts" -g "*.tsx" "export\s+(type|interface)\s+(ButtonVariants|ButtonVariantSize)" packages/@core/ui-kit/shadcn-ui/src/ui

Length of output: 840

packages/@core/ui-kit/shadcn-ui/src/components/button/button.vue (1)

11-11: LGTM! Verify consistent updates across the codebase.

The import path change for buttonVariants aligns with the PR objective of refactoring the shadcn-ui directory. This change potentially simplifies the import structure by centralizing UI-related imports.

To ensure consistency, please verify that similar updates have been made in other components that use buttonVariants. Run the following script to check for any remaining imports from the old path:

packages/@core/ui-kit/shadcn-ui/src/components/tooltip/tooltip.vue (2)

Line range hint 1-41: LGTM for the rest of the file.

The overall structure and implementation of the tooltip component look good. The props are well-defined with appropriate defaults, and the template structure is clean and organized. No further changes or improvements are necessary for this file.


11-11: Verify the new import path and its impact on the project structure.

The import path has been changed from a specific module import to a more general one. This change aligns with the PR objective of refactoring the shadcn-ui directory.

However, we should verify that this change doesn't introduce any issues:

  1. Ensure that all required components (Tooltip, TooltipContent, TooltipProvider, TooltipTrigger) are correctly exported from the '../../ui' path.
  2. Check if this change is consistent across other components that might be using these tooltip-related imports.

To verify the correctness of this import change, please run the following script:

This script will help us confirm that the change is consistent and doesn't introduce any issues in the project structure.

✅ Verification successful

The import path change has been successfully verified and does not introduce any issues.

  • All UI components are correctly exported from the new ../../ui path.
  • No remaining imports from the old ../ui/tooltip path were found.
  • The new import path is consistently used across all relevant components.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new import path and its usage across the project

# Test 1: Check if the UI components are correctly exported from the new path
echo "Checking UI exports:"
cat packages/@core/ui-kit/shadcn-ui/src/ui/index.ts

# Test 2: Check for any remaining imports from the old path
echo "Checking for old import paths:"
rg --type vue "from '../ui/tooltip'" packages/@core/ui-kit/shadcn-ui/src/components

# Test 3: Check for consistency of the new import path across other files
echo "Checking for consistency of new import path:"
rg --type vue "from '../../ui'" packages/@core/ui-kit/shadcn-ui/src/components

Length of output: 1308


Script:

#!/bin/bash
# Description: Verify the new import path and its usage across the project without relying on rg's file type recognition

# Test 1: Check if the UI components are correctly exported from the new path
echo "Checking UI exports:"
cat packages/@core/ui-kit/shadcn-ui/src/ui/index.ts

# Test 2: Check for any remaining imports from the old path
echo "Checking for old import paths:"
fd --extension vue --type file '' packages/@core/ui-kit/shadcn-ui/src/components | xargs rg "from '../ui/tooltip'"

# Test 3: Check for consistency of the new import path across other files
echo "Checking for consistency of new import path:"
fd --extension vue --type file '' packages/@core/ui-kit/shadcn-ui/src/components | xargs rg "from '../../ui'"

Length of output: 2863

packages/@core/ui-kit/shadcn-ui/src/components/popover/popover.vue (1)

16-16: LGTM! Verify the new import path.

The updated import path aligns with the PR objective of refactoring the shadcn-ui directory. This change suggests a move towards a more centralized export of UI components, which can improve maintainability and organization.

To ensure the new import path is correct and consistent across the project, run the following script:

packages/@core/ui-kit/shadcn-ui/src/components/input-password/input-password.vue (1)

7-7: LGTM! Verify the new import path.

The change to import Input from '../../ui' aligns with the PR objective of refactoring the shadcn-ui directory. This modification likely improves code organization by centralizing component exports.

To ensure the new import path is correct and the Input component is properly exported, run the following script:

packages/@core/ui-kit/shadcn-ui/src/components/dropdown-menu/dropdown-menu.vue (2)

Line range hint 1-48: LGTM for the rest of the file.

The component structure, logic, and template look good. The use of Vue 3 composition API with <script setup> is appropriate, and the dynamic rendering of dropdown menu items is implemented correctly. No further changes are needed in this file beyond the import path modification.


14-14: Verify the new import path and its impact on the project structure.

The import path for dropdown menu components has been changed from '../ui/dropdown-menu' to '../../ui'. This change aligns with the PR objective of refactoring the shadcn-ui directory.

However, we should verify that:

  1. The new import path is correct and all required components are available in the new location.
  2. This change is consistent across the project.
  3. There are no unintended side effects due to this change.

Let's run a script to check these points:

This script will help us confirm that the change has been applied correctly and consistently.

✅ Verification successful

Import path change verified successfully.

All instances of the old import path have been updated to '../../ui', and the new import path exists with the required components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new import path and its usage across the project

# Test 1: Check if the new import path exists and contains the required components
echo "Checking if the new import path exists and contains the required components:"
cat packages/@core/ui-kit/shadcn-ui/src/ui/index.ts

# Test 2: Check for any remaining imports from the old path
echo "Checking for any remaining imports from the old path:"
rg --type vue "from '../ui/dropdown-menu'" packages/@core/ui-kit/shadcn-ui/src

# Test 3: Check for consistency of the new import path usage
echo "Checking for consistency of the new import path usage:"
rg --type vue "from '../../ui'" packages/@core/ui-kit/shadcn-ui/src/components

Length of output: 1481


Script:

#!/bin/bash
# Description: Verify the new import path and its usage across the project without relying on file type recognition

# Test 1: Check if the new import path exists and contains the required components
echo "Checking if the new import path exists and contains the required components:"
cat packages/@core/ui-kit/shadcn-ui/src/ui/index.ts

# Test 2: Check for any remaining imports from the old path
echo "Checking for any remaining imports from the old path:"
rg "from '../ui/dropdown-menu'" packages/@core/ui-kit/shadcn-ui/src --glob "*.vue"

# Test 3: Check for consistency of the new import path usage
echo "Checking for consistency of the new import path usage:"
rg "from '../../ui'" packages/@core/ui-kit/shadcn-ui/src/components --glob "*.vue"

Length of output: 2982

packages/@core/ui-kit/menu-ui/src/sub-menu.vue (3)

Line range hint 1-68: Overall, the changes look good and align with the PR objectives.

The modifications in this file contribute to better code organization and maintainability by consolidating imports and consistently using the new MenuBadge component. The changes appear to maintain existing functionality while improving the code structure.


6-6: LGTM! Verify the new import path.

The consolidation of imports from a local 'components' file is a good practice for maintainability and aligns with the PR objective of refactoring the shadcn-ui directory.

To ensure the correctness of the new import path, please run the following script:


Line range hint 55-59: LGTM! Verify the MenuBadge component functionality.

The replacement of VbenMenuBadge with MenuBadge is consistent with the import changes. The functionality appears to be maintained as the same props are being passed.

To ensure the MenuBadge component functions as expected, please run the following script:

packages/@core/ui-kit/shadcn-ui/src/components/dropdown-menu/dropdown-radio-menu.vue (2)

Line range hint 1-52: LGTM! Suggest thorough testing of the component.

The changes to the import statement appear to be the only modification in this file. The rest of the component logic and template remain unchanged, which is good for maintaining existing functionality.

To ensure the refactoring hasn't introduced any unintended side effects:

  1. Thoroughly test the DropdownRadioMenu component in various scenarios to verify that it still functions as expected.
  2. Check that the component renders correctly and that all interactions (opening/closing the menu, selecting items) work properly.
  3. Verify that the styling is consistent with the previous version of the component.

10-10: Verify the new import path and update documentation if necessary.

The change in the import path from '../ui/dropdown-menu' to '../../ui' aligns with the PR objective of refactoring the shadcn-ui directory. This suggests a centralization of UI components, which can improve organization and maintainability.

However, to ensure this change doesn't introduce any issues:

  1. Verify that all required components (DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuTrigger) are correctly exported from the new '../../ui' path.
  2. If this change is part of a larger restructuring of the shadcn-ui directory, consider updating the project documentation to reflect the new directory structure and import patterns.

To confirm the correct export of components, you can run the following script:

✅ Verification successful

Import path change verified and approved.

All required components (DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuTrigger) are correctly exported from the new '../../ui' path. This centralization aligns with the refactoring objectives and does not introduce any issues.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all required components are exported from the new UI file

# Test: Check if the new UI file exists and exports the required components
ui_file=$(fd --type f --full-path '*/ui/index.ts' --exec echo {})
if [ -n "$ui_file" ]; then
  echo "UI file found: $ui_file"
  echo "Checking exports:"
  grep -E "export.*Dropdown(Menu|MenuContent|MenuGroup|MenuItem|MenuTrigger)" "$ui_file"
else
  echo "UI file not found. Please check the path."
fi

Length of output: 472


Script:

#!/bin/bash
# Description: Verify that all required components are exported from the new UI file

# Test: Check if the new UI file exists and exports the required components
ui_file=$(fd --type f --glob '*/ui/index.ts' )
if [ -n "$ui_file" ]; then
  echo "UI file found: $ui_file"
  echo "Checking exports:"
  grep -E "export\s+.*(DropdownMenu|DropdownMenuContent|DropdownMenuGroup|DropdownMenuItem|DropdownMenuTrigger)" "$ui_file"
else
  echo "UI file not found. Please check the path."
fi

Length of output: 157


Script:

#!/bin/bash
# Description: Verify that all required components are exported from the new UI file

# Test: Check if the new UI file exists and exports the required components
# Using recursive glob pattern to locate 'ui/index.ts' or 'ui/index.js'
ui_file=$(fd --type f --glob '**/ui/index.@(ts|js)')
if [ -n "$ui_file" ]; then
  echo "UI file found: $ui_file"
  echo "Checking exports:"
  grep -E "export\s+.*(DropdownMenu|DropdownMenuContent|DropdownMenuGroup|DropdownMenuItem|DropdownMenuTrigger)" "$ui_file"
else
  echo "UI file not found. Please verify the import path or ensure the file exists."
fi

Length of output: 232


Script:

#!/bin/bash
# Description: Locate exports of required components across the repository

# Define the list of required components
exported_components=("DropdownMenu" "DropdownMenuContent" "DropdownMenuGroup" "DropdownMenuItem" "DropdownMenuTrigger")

# Iterate over each component and search for its export
for component in "${exported_components[@]}"; do
  echo "Searching for export of $component:"
  rg "export\s+.*${component}" --glob '**/ui/**/*.{ts,js,vue}'
  echo ""
done

Length of output: 3806

packages/@core/ui-kit/shadcn-ui/src/components/segmented/segmented.vue (1)

8-8: LGTM. Verify import consistency across the project.

The change in the import path aligns with the PR objectives of refactoring the shadcn-ui directory. This modification suggests a restructuring of the component organization, which could lead to more centralized and manageable imports.

To ensure consistency across the project, please run the following script to check for any remaining old import paths:

Consider updating the project's documentation if this import structure change is part of a larger refactoring effort. This will help maintain clear guidelines for future contributions.

✅ Verification successful

Import paths are consistently updated across the project.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining old import paths in the project

# Test: Search for old import paths
rg --type vue "from '\.\./ui/tabs'" packages/@core/ui-kit/shadcn-ui/src

# Test: Verify new import path usage
rg --type vue "from '\.\./\.\./ui'" packages/@core/ui-kit/shadcn-ui/src

Length of output: 215


Script:

#!/bin/bash
# Description: Check for any remaining old import paths in Vue files within the specified directory

# Test: Search for old import paths
rg -g '*.vue' "from '\.\./ui/tabs'" packages/@core/ui-kit/shadcn-ui/src

# Test: Verify new import path usage
rg -g '*.vue' "from '\.\./\.\./ui'" packages/@core/ui-kit/shadcn-ui/src

Length of output: 1708

packages/@core/ui-kit/shadcn-ui/src/components/pin-input/input.vue (3)

Line range hint 1-114: Confirm: Rest of the file remains correct after import change.

I've verified that the imported components (PinInput, PinInputGroup, PinInputInput) are correctly used in the template section of the component. The change in the import path doesn't affect the functionality of the component, and no further modifications are needed in the rest of the file.


Line range hint 1-114: Summary: Import path updated successfully without affecting component functionality.

The change in this file is limited to updating the import path for PinInput components. This modification aligns with the PR objective of refactoring the shadcn-ui directory. The rest of the component remains unchanged, and the functionality is preserved. The update successfully adapts the component to the new directory structure without introducing any issues.


6-6: LGTM: Import path updated correctly.

The import path for PinInput components has been updated to reflect the new directory structure. This change aligns with the PR objective of refactoring the shadcn-ui directory.

Let's verify if the imported components are used correctly in the rest of the file:

packages/@core/ui-kit/menu-ui/src/components/menu-item.vue (3)

112-115: LGTM! Verify MenuBadge properties and styling.

The replacement of VbenMenuBadge with MenuBadge is correctly implemented and consistent with the import changes. The conditional rendering and prop binding maintain the existing functionality.

To ensure the MenuBadge component is correctly implemented and styled, let's verify its usage and properties:

#!/bin/bash
# Description: Verify the MenuBadge component implementation and usage

# Test 1: Check for MenuBadge component definition
echo "Checking MenuBadge component definition:"
ast-grep --lang vue --pattern $'export default defineComponent({
  name: "MenuBadge",
  $$$
})'

# Test 2: Check for MenuBadge usage in other components
echo "Checking MenuBadge usage in other components:"
rg --type vue "<MenuBadge" -g '!**/menu-item.vue'

# Test 3: Check for right-2 class usage
echo "Checking right-2 class usage:"
rg --type vue 'class=".*right-2.*"' -g '!**/menu-item.vue'

Additionally, please ensure that the right-2 class provides the desired positioning for the badge in all menu modes and states.


Line range hint 1-124: Summary: Refactoring changes look good, verify integration with other components.

The changes in this file align well with the PR objectives of refactoring the shadcn-ui directory. The replacement of VbenMenuBadge with MenuBadge is consistently implemented across import statements and component usage. The core functionality of the menu item component appears to be preserved.

To ensure these changes integrate well with the rest of the system, consider running the following checks:

#!/bin/bash
# Description: Verify the integration of MenuBadge and potential impacts on other components

# Test 1: Check for any remaining usage of VbenMenuBadge
echo "Checking for any remaining VbenMenuBadge usage:"
rg --type vue "VbenMenuBadge"

# Test 2: Verify MenuBadge is exported correctly
echo "Verifying MenuBadge export:"
rg --type typescript "export.*MenuBadge" -g '**/index.ts'

# Test 3: Check for any broken imports due to the refactoring
echo "Checking for potential broken imports:"
rg --type vue "import.*from '@vben-core/ui-kit/menu-ui'" -g '!**/menu-item.vue'

These checks will help ensure that the refactoring has been applied consistently across the project and that there are no unintended side effects or broken dependencies.


7-7: LGTM! Verify import paths for consistency.

The changes in the import statements look good and align with the refactoring mentioned in the PR objectives. The shift from VbenMenuBadge to MenuBadge is correctly reflected here.

To ensure consistency across the project, let's verify the import paths:

Also applies to: 9-9

packages/effects/common-ui/src/ui/about/about.vue (2)

11-11: LGTM: Import of VbenRenderContent

The addition of the VbenRenderContent import from the shadcn-ui package aligns with the PR's objective of refactoring the shadcn-ui directory. This change suggests improved modularity and organization of UI components.


78-78: LGTM: Consistent use of renderLink function

The replacement of VbenLink components with calls to the new renderLink function is consistent across all links in the vbenDescriptionItems array. This refactoring aligns with the PR's objective of removing rarely used components and improves code consistency.

Also applies to: 82-82, 86-86, 90-90, 95-96

@@ -1,2 +1,3 @@
export * from './components';
export * from './ui';
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

'./ui' module does not exist but is being exported.

The export statement export * from './ui'; in packages/@core/ui-kit/shadcn-ui/src/index.ts references a module that does not exist. This will lead to import/export errors and potentially break the build or runtime functionality.

  • File: packages/@core/ui-kit/shadcn-ui/src/index.ts
  • Line: 2

Please ensure that the ./ui module is created with the necessary exports or remove the faulty export statement if it's no longer needed.

🔗 Analysis chain

Approve the new export, but verify its contents and document its purpose.

The addition of export * from './ui'; aligns with the existing export pattern and contributes to centralizing exports in this index file. This change enhances modularity and organization.

However, to ensure this change fully aligns with the PR objectives:

  1. Please verify the contents of the './ui' module to confirm that it doesn't include any rarely used components that were intended to be removed.
  2. Consider adding a comment explaining the purpose of this new export in relation to the PR's refactoring objectives.

To verify the contents of the './ui' module, you can run the following command:

This will help ensure that the new export aligns with the goal of removing rarely used components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: List the contents of the './ui' module to verify its exports

# Test: Display the contents of the './ui.ts' or './ui/index.ts' file
fd -e ts -p ui.ts -X cat {} || fd -p ui/index.ts -X cat {}

Length of output: 31


Script:

#!/bin/bash
# Description: Verify the contents of the './ui' module

# Check if './ui' is a directory
if [ -d "./ui" ]; then
  echo "'./ui' is a directory. Listing its TypeScript files:"
  fd -e ts . ./ui/ | xargs cat
elif [ -f "./ui.ts" ]; then
  echo "'./ui.ts' exists. Displaying its contents:"
  cat ./ui.ts
else
  echo "No './ui' directory or './ui.ts' file found."
fi

Length of output: 149

@@ -7,7 +7,7 @@ import type {

import { computed } from 'vue';

import { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar';
import { Avatar, AvatarFallback, AvatarImage } from '../../ui';
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Action Required: Resolve Duplicate Avatar Component Exports

The rg command indicates that VbenAvatar is still being exported from packages/@core/ui-kit/shadcn-ui/src/components/avatar/index.ts in addition to the centralized exports in packages/@core/ui-kit/shadcn-ui/src/ui/index.ts. This duplication can lead to inconsistencies and potential misuse.

  • Ensure Consistent Naming: Verify if VbenAvatar should be renamed to Avatar to maintain uniformity.
  • Remove Redundant Exports: If VbenAvatar is unnecessary, consider removing its export from components/avatar/index.ts to prevent conflicts.
  • Centralize Imports: Ensure all Avatar components are imported from the centralized ../../ui path to maintain consistency.
🔗 Analysis chain

LGTM: Import path updated correctly.

The import statement has been updated to use a more centralized path '../../ui'. This change aligns with the PR objectives of refactoring the shadcn-ui directory and potentially improving the organization of components.

To ensure the new import path is correct and the components are available, please run the following script:

This script will help verify that the Avatar components are correctly exported from the new location and that there are no conflicting exports in other files.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of Avatar components in the new import location

# Test: Check if the Avatar components exist in the new location
ast-grep --lang typescript --pattern 'export { Avatar, AvatarFallback, AvatarImage }' packages/@core/ui-kit/shadcn-ui/src/ui/index.ts

# Test: Ensure no other files are still exporting these components
rg --type typescript 'export.*Avatar(Fallback|Image)?' -g '!**/ui/index.ts'

Length of output: 248


Script:

#!/bin/bash
# Description: Verify the existence of Avatar components in the new import location

# Test: Check if the Avatar components are exported correctly in the new location
ast-grep --lang typescript --pattern 'export { Avatar, AvatarFallback, AvatarImage }' packages/@core/ui-kit/shadcn-ui/src/ui/index.ts

# Test: Ensure no other files are exporting these components outside the designated index
rg --type ts 'export .*Avatar(Fallback|Image)?' -g '!**/ui/index.ts'

Length of output: 785

Comment on lines +17 to +18
} from '../../ui';
import { VbenIcon } from '../icon';
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Missing Export Statements for Consolidated Imports

The consolidation of import statements in breadcrumb.vue introduces missing exports in ../../ui/index.ts. The following components are not exported and need to be added to prevent runtime errors:

  • Breadcrumb
  • BreadcrumbItem
  • BreadcrumbLink
  • BreadcrumbList
  • BreadcrumbPage
  • BreadcrumbSeparator
  • DropdownMenu
  • DropdownMenuContent
  • DropdownMenuItem
  • DropdownMenuTrigger

Please update ../../ui/index.ts to include exports for all the above components.

🔗 Analysis chain

Approve the consolidated import statement with a verification step.

The consolidation of import statements simplifies the code structure and aligns with the PR's refactoring objective. This change should make maintenance easier in the future.

To ensure all required components are correctly exported from the new path, please run the following verification script:

This script will help ensure that all necessary components are properly exported from the new import path, preventing potential runtime errors.


</review_comment>

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all required components are exported from '../../ui'

# Test: Check if all components are exported from '../../ui'
ast-grep --lang typescript --pattern 'export { $_ } from $$$' packages/@core/ui-kit/shadcn-ui/src/ui/index.ts | grep -E "Breadcrumb|BreadcrumbItem|BreadcrumbLink|BreadcrumbList|BreadcrumbPage|BreadcrumbSeparator|DropdownMenu|DropdownMenuContent|DropdownMenuItem|DropdownMenuTrigger"

# If any component is missing from the output, it needs to be added to the exports in '../../ui/index.ts'

Length of output: 729


Script:

#!/bin/bash
# Description: Verify that all required components are exported individually from '../../ui'

# Define an array of required components
components=("Breadcrumb" "BreadcrumbItem" "BreadcrumbLink" "BreadcrumbList" "BreadcrumbPage" "BreadcrumbSeparator" "DropdownMenu" "DropdownMenuContent" "DropdownMenuItem" "DropdownMenuTrigger")

# Iterate over each component and check its export
for component in "${components[@]}"; do
  echo "Checking export for: $component"
  ast-grep --lang typescript --pattern "export { $component } from $$$" packages/@core/ui-kit/shadcn-ui/src/ui/index.ts
done

# Note: If any component is not found in the exports, the corresponding ast-grep command will produce no output.
# Please ensure that all required components are exported from '../../ui/index.ts'.

Length of output: 7279


Script:

#!/bin/bash
# Description: Verify that all required components are exported individually from '../../ui'

# Define an array of required components
components=("Breadcrumb" "BreadcrumbItem" "BreadcrumbLink" "BreadcrumbList" "BreadcrumbPage" "BreadcrumbSeparator" "DropdownMenu" "DropdownMenuContent" "DropdownMenuItem" "DropdownMenuTrigger")

# Iterate over each component and check its export
for component in "${components[@]}"; do
  echo "Checking export for: $component"
  ast-grep --lang typescript --pattern 'export { '"$component"' } from $$$' packages/@core/ui-kit/shadcn-ui/src/ui/index.ts
done

# Note: If any component is not found in the exports, the corresponding ast-grep command will produce no output.
# Please ensure that all required components are exported from '../../ui/index.ts'.

Length of output: 7239


Script:

#!/bin/bash
# Description: Verify that all required components are exported individually from '../../ui'

# Define an array of required components
components=("Breadcrumb" "BreadcrumbItem" "BreadcrumbLink" "BreadcrumbList" "BreadcrumbPage" "BreadcrumbSeparator" "DropdownMenu" "DropdownMenuContent" "DropdownMenuItem" "DropdownMenuTrigger")

# Iterate over each component and check its export
for component in "${components[@]}"; do
  echo "Checking export for: $component"
  rg -q "export\s+\{\s*$component\s*\}\s+from\s+['\"][^'\"]+['\"]" packages/@core/ui-kit/shadcn-ui/src/ui/index.ts
  if [ $? -ne 0 ]; then
    echo "❌ Export for \`$component\` not found in \`../../ui/index.ts\`."
  else
    echo "✅ Export for \`$component\` exists."
  fi
done

# Summary
echo ""
echo "Export verification completed."

Length of output: 4322

GavinLucky pushed a commit to GavinLucky/vue-vben-admin that referenced this pull request Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant