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

docs: 删除smb配置以及相关依赖 #2332

Merged
merged 1 commit into from
Oct 21, 2024
Merged

docs: 删除smb配置以及相关依赖 #2332

merged 1 commit into from
Oct 21, 2024

Conversation

gimmyhehe
Copy link
Member

@gimmyhehe gimmyhehe commented Oct 21, 2024

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced theme management by removing support for the 'smb' theme, focusing on 'aurora' and 'saas' themes.
    • Improved demo loading logic for better user experience.
  • Bug Fixes

    • Refined event handling for menu interactions and demo selections.
  • Chores

    • Updated dependency management by removing @opentiny/vue-design-smb from various projects and adding new dependencies in the vue2-example project.

@gimmyhehe gimmyhehe added the documentation 对文档的改进或补充 label Oct 21, 2024
Copy link

coderabbitai bot commented Oct 21, 2024

Walkthrough

The changes in this pull request primarily involve the removal of the @opentiny/vue-design-smb dependency across multiple components and projects, reflecting a shift in theme management. The pc.vue component has been updated to exclude the smb theme from its configuration and logic, while new methods for demo handling have been introduced. Additionally, several package.json files have been modified to remove references to @opentiny/vue-design-smb, indicating a broader architectural change. The build process for Vue components has also been refined to exclude SMB-related entries.

Changes

File Path Change Summary
examples/docs/pc.vue Updated theme configuration to remove designSmbConfig and added _switchPath method for demo loading.
examples/docs/package.json Removed dependency on @opentiny/vue-design-smb.
examples/sites/package.json Removed dependency on @opentiny/vue-design-smb.
examples/sites/playground/App.vue Removed references to 'smb' theme in theme handling logic.
examples/sites/src/tools/useTheme.js Updated designConfigMap to initialize keys with empty objects instead of designSmbConfig.
examples/vue2/package.json Added several new dependencies; removed @opentiny/vue-design-smb.
examples/vue3/package.json Removed dependency on @opentiny/vue-design-smb.
internals/cli/src/commands/build/build-ui.ts Modified build logic to exclude 'design/smb' entries and simplified regex for PNG files.
internals/cli/src/commands/create/commonMapping.json Removed "DesignSmb" entry from the mapping.
packages/design/smb/index.ts Deleted file containing the SMB module definition.
packages/design/smb/package.json Deleted package.json for @opentiny/vue-design-smb.

Possibly related PRs

Suggested labels

bug

Suggested reviewers

  • zzcr

🐰 In a world of themes so bright,
The 'smb' has taken flight.
With new paths and demos to explore,
Our code is cleaner than before!
So hop along, let's cheer and play,
For a brighter, simpler day! 🌼


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.

Copy link

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 455332c and 313c71a.

📒 Files selected for processing (11)
  • examples/docs/newsrc/pc.vue (1 hunks)
  • examples/docs/package.json (0 hunks)
  • examples/sites/package.json (0 hunks)
  • examples/sites/playground/App.vue (4 hunks)
  • examples/sites/src/tools/useTheme.js (1 hunks)
  • examples/vue2/package.json (3 hunks)
  • examples/vue3/package.json (0 hunks)
  • internals/cli/src/commands/build/build-ui.ts (2 hunks)
  • internals/cli/src/commands/create/commonMapping.json (1 hunks)
  • packages/design/smb/index.ts (0 hunks)
  • packages/design/smb/package.json (0 hunks)
💤 Files with no reviewable changes (5)
  • examples/docs/package.json
  • examples/sites/package.json
  • examples/vue3/package.json
  • packages/design/smb/index.ts
  • packages/design/smb/package.json
🧰 Additional context used
🔇 Additional comments (14)
internals/cli/src/commands/create/commonMapping.json (1)

Line range hint 1-57: LGTM! Removal of DesignSmb entry is consistent with PR objectives.

The removal of the "DesignSmb" entry from this mapping file aligns well with the PR's goal of removing SMB configuration and related dependencies. This change is consistent with other modifications across the project, such as removing '@opentiny/vue-design-smb' from package.json files and updating the build process. The JSON structure remains valid after this removal.

examples/vue2/package.json (4)

5-5: LGTM: Repositioning of private field

The private field has been moved. This change doesn't affect functionality and is likely for better organization of the package.json file.


Line range hint 1-62: Summary of changes and next steps

The changes in this file align with the PR objectives of removing SMB configuration and related dependencies. The shift towards SAAS theming is evident, and new dependencies suggest the introduction of new features or tools.

Next steps:

  1. Provide clarification on the purpose and impact of the new dependencies.
  2. Run the verification scripts to ensure complete removal of SMB-related code and proper usage of new dependencies.
  3. Update documentation to reflect these dependency changes and any new features they introduce.

Overall, these changes seem to be moving the project in the intended direction, but careful verification is needed to ensure smooth transition and maintain project stability.


Line range hint 1-62: Verify complete removal of @opentiny/vue-design-smb

The removal of @opentiny/vue-design-smb aligns with the PR objective. This change is consistent with similar removals in other package.json files.

Please run the following script to ensure complete removal of SMB-related code:

#!/bin/bash
# Description: Verify complete removal of @opentiny/vue-design-smb

echo "Checking for any remaining references to vue-design-smb:"
rg -i 'vue-design-smb'

echo "Checking for any remaining SMB theme usage:"
rg -i 'theme.*smb'

30-33: Clarify the purpose and impact of new dependencies

Several new dependencies have been added:

  • @tiptap/vue-2
  • @unocss/core, @unocss/preset-icons, @unocss/transformer-directives, unocss
  • js-sha256
  • onigasm

These additions suggest new features or tools being incorporated into the project. Could you please clarify:

  1. The purpose of each new dependency?
  2. How they align with the PR objectives?
  3. Any potential impact on the project's performance or build process?

To help assess the impact, please run:

#!/bin/bash
# Description: Check for usage of new dependencies in the project

echo "Checking for Tiptap usage:"
rg -i 'tiptap'

echo "Checking for UnoCSS usage:"
rg -i 'unocss'

echo "Checking for js-sha256 usage:"
rg -i 'js-sha256'

echo "Checking for onigasm usage:"
rg -i 'onigasm'

Also applies to: 39-39, 41-41, 46-46

examples/sites/playground/App.vue (5)

74-77: LGTM: Theme selection simplified

The condition for including design themes has been updated to only consider 'aurora' and 'saas'. This change aligns with the PR objective of removing SMB configuration and related dependencies.


92-93: LGTM: Consistent theme validation

The theme validation has been updated to only consider 'aurora' and 'saas' as valid themes, defaulting to 'default' for unsupported themes. This change is consistent with the earlier modification in the import map creation and aligns with the removal of the 'smb' theme.


135-135: LGTM: Removed unused 'smb' theme mapping

The 'smb' entry has been removed from the designThemeMap object, which is consistent with the overall changes to remove SMB configuration and related dependencies.


146-152: LGTM: Consistent theme configuration updates

The conditions for importing design configurations and applying design themes have been updated to only consider supported themes ('aurora', 'saas', and 'infinity'). These changes are consistent with the previous modifications and align with the removal of the 'smb' theme support.


Line range hint 1-368: Overall assessment: SMB theme successfully removed

The changes in this file consistently remove all references to the 'smb' theme and related configurations. This aligns well with the PR objective of removing SMB configuration and its dependencies. The modifications maintain code clarity and structure while simplifying theme-related logic. No new issues or potential problems were introduced by these changes.

Here's a summary of the key changes:

  1. Updated import map creation to exclude 'smb' theme
  2. Modified theme validation to only consider 'aurora' and 'saas' as valid themes
  3. Removed 'smb' entry from the designThemeMap
  4. Updated conditions for importing design configurations and applying design themes

These changes should simplify maintenance and usage of the component in the future by focusing on the supported themes.

internals/cli/src/commands/build/build-ui.ts (3)

203-203: LGTM: Removal of 'design/smb' from matchList

The removal of 'design/smb' from the matchList array aligns with the PR objective of removing SMB configuration. This change will affect how certain file paths are matched during the build process, specifically for determining the main and module entries in the generated package JSON.


329-329: LGTM: Updated regex for design packages

The regular expression for design packages has been updated to remove 'smb', which is consistent with the PR objective. This change will affect how PNG files are handled for different design packages during the build process. The updated regex now only includes 'saas' and 'aurora' designs.


Line range hint 1-465: Overall changes look good

The modifications in this file consistently remove SMB-related configurations, aligning with the PR objective. The changes affect the build process for UI components, specifically in how design packages are handled and how file paths are matched. These updates don't introduce any apparent bugs or issues and maintain the overall structure and logic of the file.

examples/docs/newsrc/pc.vue (1)

266-267: Verify that 'tiny-aurora-theme' functions correctly without a design configuration

While the removal of designSmbConfig and assigning an empty object to 'tiny-smb-theme' aligns with the objective to eliminate SMB configurations, assigning an empty object to 'tiny-aurora-theme' may have unintended consequences. Please verify that 'tiny-aurora-theme' does not require a specific design configuration to function properly. Assigning an empty object might lead to issues in theme rendering or inconsistencies in the user interface if the theme relies on particular configurations.

Run the following script to check for any references to a design configuration specific to 'tiny-aurora-theme':

"@opentiny/vue-theme-mobile": "workspace:~",
"@opentiny/vue-theme-saas": "workspace:~",
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Residual SMB theme references detected

Several files still reference smb-theme, which conflicts with the removal of SMB configuration:

  • examples/sites/demos/pc/webdoc/theme.md
  • packages/theme/src/theme/index.js
  • internals/automate/src/theme-swap/index.ts
  • examples/sites/src/router.js
🔗 Analysis chain

Verify usage of @opentiny/vue-theme-saas

The addition of @opentiny/vue-theme-saas aligns with the PR objective of removing SMB configuration. This change suggests a shift towards using the SAAS theme.

Please run the following script to verify the usage of this theme:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of @opentiny/vue-theme-saas in the project

# Test: Search for imports or uses of the SAAS theme
rg -i 'vue-theme-saas'

Length of output: 4859

Comment on lines +69 to +72
[DEFAULT_THEME]: {},
[INFINITY_THEME]: {},
[AURORA_THEME]: {},
[SMB_THEME]: {}
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Issues Found: Residual SMB References Detected

The shell script identified multiple remaining references to SMB-related configurations and imports. This indicates that SMB themes are still partially integrated within the codebase.

  • Files with SMB References:
    • packages/vue-icon/src/config/index.ts
    • packages/theme/src/theme-tool.js
    • examples/sites/src/tools/useTheme.js
    • internals/automate/src/theme-swap/index.ts
    • Numerous .less, .js, and .md files across various packages

Recommended Actions:

  1. Remove Unnecessary SMB Imports:

    • Ensure that all SMB-related imports, such as @opentiny/vue-design-smb, are removed if SMB themes are no longer required.
  2. Clean Up Theme Configurations:

    • Verify that setting theme configurations to empty objects does not leave behind dependencies or affect other themes.
  3. Update or Remove SMB-Specific Code:

    • Refactor or eliminate SMB-specific code segments found in components, stylesheets, and configuration files.
  4. Comprehensive Testing:

    • Perform thorough testing to confirm that removing SMB references does not introduce runtime errors or degrade application functionality.
  5. Documentation Updates:

    • Update any documentation that references SMB themes to reflect their removal or modification.
🔗 Analysis chain

LGTM. Verify impact on theme functionality.

The changes to designConfigMap align with the project goal of removing SMB-related configurations. All theme configurations are now consistently set to empty objects.

Please ensure that:

  1. These changes don't negatively impact theme functionality across the application.
  2. Any components or modules relying on theme-specific configurations are updated accordingly.
  3. Documentation related to theming is updated to reflect these changes.

To verify the impact, you can run the following script:

This script will help identify any remaining references to theme-specific configurations or SMB-related code that might need attention.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to theme-specific configurations

# Test: Search for references to designConfigMap or theme-specific configurations
rg -i '(designConfigMap|theme.*config)'

# Test: Check for any remaining SMB-related imports or configurations
rg -i '(smb|@opentiny/vue-design-smb)'

Length of output: 26911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 对文档的改进或补充
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants