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

Fix/cli template bundle #1053

Closed

Conversation

yy-wow
Copy link
Collaborator

@yy-wow yy-wow commented Jan 20, 2025

English | 简体中文

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)
  • Built its own designer, fully self-validated

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:

Background and solution

What is the current behavior?

Issue Number: N/A

What is the new behavior?

根据物料新协议更新cli模板中的bundle.json

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

Release Notes for Version 2.2.0-beta.1

Version Update

  • Multiple packages have been updated to version 2.2.0-beta.1, indicating a new beta release across the entire project ecosystem.

Workflow Changes

  • Removed caching configuration for the pnpm package manager during Node.js installation in the GitHub workflow.

Bundle Configuration

  • Updated component library references in bundle.json:
    • Added explicit package information for TinyVue and Element Plus
    • Streamlined component dependency representation

Route Bar Improvements

  • Enhanced route generation logic in the canvas route bar
    • Improved error handling and data filtering
    • More robust route mapping process

Dependency Management

  • Minor adjustments to peer dependencies in some packages
  • Consistent versioning across project packages

Notes

  • This is a beta release and may contain experimental features
  • Recommended for testing and evaluation purposes

Copy link
Contributor

coderabbitai bot commented Jan 20, 2025

Walkthrough

This pull request involves a comprehensive version update across multiple packages from 2.1.0 to 2.2.0-beta.1. The changes span numerous package.json files within the project, indicating a coordinated beta release preparation. Additionally, there's a modification in the GitHub Actions workflow file that removes the pnpm cache configuration, and a notable update to the bundle.json file in the designer template, which consolidates package information.

Changes

File Change Summary
.github/workflows/Release.yml Removed cache: 'pnpm' line from Node.js setup step
packages/*/package.json Version updated from 2.1.0 to 2.2.0-beta.1 across multiple packages
packages/engine-cli/template/designer/public/mock/bundle.json Restructured package information, centralized component library details
packages/canvas/route-bar/src/CanvasRouteBar.vue Enhanced route mapping logic with improved error handling

Sequence Diagram

sequenceDiagram
    participant Workflow as GitHub Actions
    participant NPM as Package Registry
    participant Packages as Project Packages

    Workflow->>Packages: Update versions to 2.2.0-beta.1
    Packages->>NPM: Prepare for beta release
    NPM-->>Packages: Version confirmation
Loading

Possibly related PRs

Suggested labels

refactor-main, bug

Suggested reviewers

  • rhlin
  • hexqi

Poem

🐰 Hop, hop, version update's here!
Beta magic spreading cheer
From 2.1 to 2.2 we leap
Packages dancing, version's deep
CodeRabbit's release hops with glee! 🚀


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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@github-actions github-actions bot added the refactor-main refactor/develop branch feature label Jan 20, 2025
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: 2

🧹 Nitpick comments (1)
packages/canvas/route-bar/src/CanvasRouteBar.vue (1)

68-81: LGTM! Improved error handling for route population.

The changes enhance the robustness of the route population logic by adding proper null checks and maintaining a clean data transformation pipeline.

Consider these minor improvements:

  1. Translate the Chinese comments to English for better international collaboration
  2. Add error logging when items are filtered out to help with debugging
 routes.value = ancestors
   .concat(value)
   .map((id) => pageSettingState.treeDataMapping[id])
-  .filter((item) => Boolean(item))
+  .filter((item) => {
+    const isValid = Boolean(item)
+    if (!isValid) {
+      console.warn(`[CanvasRouteBar] Page data not found for ID in treeDataMapping`)
+    }
+    return isValid
+  })
   .map((pageData) => {
     const { id, route, isPage } = pageData
     return {
       id,
       route: route
-        .replace(/\/+/g, '/') // 替换连续的 '/' 为单个 '/'
-        .replace(/^\/|\/$/g, ''), // 去掉开头和结尾的 '/'
+        .replace(/\/+/g, '/') // Replace consecutive '/' with single '/'
+        .replace(/^\/|\/$/g, ''), // Remove leading and trailing '/'
       isPage
     }
   })
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e4b18e and 5ae12e3.

📒 Files selected for processing (60)
  • .github/workflows/Release.yml (0 hunks)
  • designer-demo/package.json (1 hunks)
  • mockServer/package.json (1 hunks)
  • packages/block-compiler/package.json (1 hunks)
  • packages/blockToWebComponentTemplate/package.json (1 hunks)
  • packages/build/vite-config/package.json (1 hunks)
  • packages/build/vite-plugin-meta-comments/package.json (1 hunks)
  • packages/builtinComponent/package.json (1 hunks)
  • packages/canvas/package.json (1 hunks)
  • packages/canvas/route-bar/src/CanvasRouteBar.vue (1 hunks)
  • packages/common/package.json (1 hunks)
  • packages/configurator/package.json (1 hunks)
  • packages/design-core/package.json (2 hunks)
  • packages/engine-cli/package.json (1 hunks)
  • packages/engine-cli/template/designer/public/mock/bundle.json (33 hunks)
  • packages/i18n/package.json (1 hunks)
  • packages/layout/package.json (1 hunks)
  • packages/plugins/block/package.json (1 hunks)
  • packages/plugins/bridge/package.json (1 hunks)
  • packages/plugins/datasource/package.json (1 hunks)
  • packages/plugins/help/package.json (1 hunks)
  • packages/plugins/i18n/package.json (1 hunks)
  • packages/plugins/materials/package.json (1 hunks)
  • packages/plugins/page/package.json (1 hunks)
  • packages/plugins/robot/package.json (1 hunks)
  • packages/plugins/schema/package.json (1 hunks)
  • packages/plugins/script/package.json (1 hunks)
  • packages/plugins/state/package.json (1 hunks)
  • packages/plugins/tree/package.json (1 hunks)
  • packages/plugins/tutorial/package.json (1 hunks)
  • packages/register/package.json (1 hunks)
  • packages/settings/design/package.json (1 hunks)
  • packages/settings/events/package.json (1 hunks)
  • packages/settings/panel/package.json (1 hunks)
  • packages/settings/props/package.json (1 hunks)
  • packages/settings/styles/package.json (1 hunks)
  • packages/svgs/package.json (1 hunks)
  • packages/theme/base/package.json (1 hunks)
  • packages/theme/dark/package.json (1 hunks)
  • packages/theme/light/package.json (1 hunks)
  • packages/toolbars/breadcrumb/package.json (1 hunks)
  • packages/toolbars/clean/package.json (1 hunks)
  • packages/toolbars/collaboration/package.json (1 hunks)
  • packages/toolbars/fullscreen/package.json (1 hunks)
  • packages/toolbars/generate-code/package.json (1 hunks)
  • packages/toolbars/lang/package.json (1 hunks)
  • packages/toolbars/layout/package.json (1 hunks)
  • packages/toolbars/lock/package.json (1 hunks)
  • packages/toolbars/logo/package.json (1 hunks)
  • packages/toolbars/logout/package.json (1 hunks)
  • packages/toolbars/media/package.json (1 hunks)
  • packages/toolbars/preview/package.json (1 hunks)
  • packages/toolbars/redoundo/package.json (1 hunks)
  • packages/toolbars/refresh/package.json (1 hunks)
  • packages/toolbars/save/package.json (1 hunks)
  • packages/toolbars/setting/package.json (1 hunks)
  • packages/toolbars/view-setting/package.json (1 hunks)
  • packages/utils/package.json (1 hunks)
  • packages/vue-generator/package.json (2 hunks)
  • packages/webcomponent/package.json (1 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/Release.yml
✅ Files skipped from review due to trivial changes (54)
  • packages/theme/base/package.json
  • packages/plugins/tree/package.json
  • packages/toolbars/layout/package.json
  • packages/theme/light/package.json
  • packages/theme/dark/package.json
  • packages/toolbars/fullscreen/package.json
  • packages/engine-cli/package.json
  • packages/toolbars/breadcrumb/package.json
  • packages/settings/styles/package.json
  • packages/toolbars/media/package.json
  • packages/toolbars/clean/package.json
  • packages/settings/props/package.json
  • packages/plugins/materials/package.json
  • packages/build/vite-config/package.json
  • packages/builtinComponent/package.json
  • packages/toolbars/save/package.json
  • packages/common/package.json
  • packages/plugins/block/package.json
  • packages/utils/package.json
  • packages/plugins/datasource/package.json
  • packages/i18n/package.json
  • packages/configurator/package.json
  • packages/plugins/state/package.json
  • packages/toolbars/refresh/package.json
  • packages/plugins/tutorial/package.json
  • packages/toolbars/view-setting/package.json
  • packages/toolbars/generate-code/package.json
  • packages/toolbars/collaboration/package.json
  • packages/toolbars/logout/package.json
  • packages/settings/design/package.json
  • packages/settings/panel/package.json
  • packages/plugins/page/package.json
  • packages/settings/events/package.json
  • packages/svgs/package.json
  • packages/plugins/schema/package.json
  • packages/plugins/i18n/package.json
  • packages/toolbars/redoundo/package.json
  • packages/toolbars/preview/package.json
  • packages/block-compiler/package.json
  • packages/canvas/package.json
  • mockServer/package.json
  • packages/toolbars/logo/package.json
  • packages/plugins/robot/package.json
  • packages/webcomponent/package.json
  • packages/toolbars/setting/package.json
  • packages/plugins/help/package.json
  • packages/plugins/script/package.json
  • packages/toolbars/lang/package.json
  • packages/toolbars/lock/package.json
  • packages/blockToWebComponentTemplate/package.json
  • packages/plugins/bridge/package.json
  • packages/design-core/package.json
  • packages/register/package.json
  • packages/vue-generator/package.json
🔇 Additional comments (3)
packages/engine-cli/template/designer/public/mock/bundle.json (2)

14038-14054: LGTM! Well-structured package configurations.

The new packages section nicely consolidates the shared dependencies for TinyVue and Element Plus component libraries. The configuration includes all necessary fields and uses reliable CDN sources.


Line range hint 1-14037: Component metadata looks good.

The component library metadata is comprehensive and well-organized with proper documentation.

packages/build/vite-plugin-meta-comments/package.json (1)

3-3: Version update to beta requires careful testing.

The transition to 2.2.0-beta.1 indicates pre-release changes. Please ensure:

  1. All dependent packages are compatible with this beta version
  2. Breaking changes are documented
  3. Beta version is properly tagged in npm
✅ Verification successful

Beta version update appears safe to proceed

The version update to 2.2.0-beta.1 in vite-plugin-meta-comments is isolated and won't affect other packages in the repository as:

  • No other packages depend on this plugin
  • Each package maintains its independent versioning
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if all workspace packages are aligned to the same beta version
echo "Checking version consistency across workspace packages..."
find . -name "package.json" -not -path "*/node_modules/*" -exec jq -r 'select(.version != null) | "\(.name): \(.version)"' {} \; | grep -v "2.2.0-beta.1" || echo "All versions are consistent"

Length of output: 359


Script:

#!/bin/bash
# Check dependencies on vite-plugin-meta-comments
echo "Checking dependencies on vite-plugin-meta-comments..."
find . -name "package.json" -not -path "*/node_modules/*" -exec jq -r '
  select(.dependencies["@vuepress/vite-plugin-meta-comments"] != null or .devDependencies["@vuepress/vite-plugin-meta-comments"] != null) |
  "\(.name): dep version: \(.dependencies["@vuepress/vite-plugin-meta-comments"] // .devDependencies["@vuepress/vite-plugin-meta-comments"])"
' {} \;

# Check if this is a workspace package
echo -e "\nChecking workspace configuration..."
jq -r '.workspaces // empty' ./package.json

Length of output: 614

@@ -1,7 +1,7 @@
{
"name": "designer-demo",
"private": true,
"version": "2.1.0",
"version": "2.2.0-beta.1",
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

Align workspace dependency patterns with project convention

The codebase predominantly uses workspace:* for internal dependencies. Consider updating the following in designer-demo/package.json to match this pattern:

  • @opentiny/tiny-engine: workspace:^workspace:*
  • @opentiny/tiny-engine-mock: workspace:^workspace:*
  • @opentiny/tiny-engine-vite-config: workspace:^workspace:*
🔗 Analysis chain

Review workspace dependency versioning strategy.

While the version update to 2.2.0-beta.1 is consistent, consider:

  1. The use of ^ for workspace dependencies might lead to version mismatches
  2. Ensure all @opentiny/vue packages at ~3.14.0 are compatible with Vue 3.4.21
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for potential version conflicts in workspace dependencies
echo "Checking workspace dependency patterns..."
jq -r '.dependencies + .devDependencies | to_entries[] | select(.value | startswith("workspace")) | "\(.key): \(.value)"' designer-demo/package.json

Length of output: 499


Script:

#!/bin/bash
# Check for workspace dependency patterns in all package.json files
echo "Checking all package.json files for workspace dependencies..."
fd package.json --type f --exclude node_modules --exec sh -c 'echo "\n=== $1 ==="; jq -r ".dependencies + .devDependencies | to_entries[] | select(.value | startswith(\"workspace\")) | \"\(.key): \(.value)\"" "$1"' sh {}

Length of output: 13435

@@ -1,6 +1,6 @@
{
"name": "@opentiny/tiny-engine-layout",
"version": "2.1.0",
"version": "2.2.0-beta.1",
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

⚠️ Potential issue

Critical: Vue version inconsistency confirmed across packages

The version mismatch is verified:

  • @opentiny/tiny-engine-layout uses Vue 3.2.45
  • Most other packages use Vue ^3.4.x (primarily 3.4.21)

This significant version gap (3.2.45 → 3.4.21) should be addressed to prevent potential compatibility issues.

🔗 Analysis chain

Critical: Vue version inconsistency detected.

While the package version is updated to 2.2.0-beta.1, there's a critical version mismatch:

  • This package uses Vue 3.2.45
  • Designer demo uses Vue 3.4.21

Please align Vue versions across packages to prevent potential compatibility issues.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check Vue version consistency across packages
echo "Checking Vue version consistency..."
find . -name "package.json" -not -path "*/node_modules/*" -exec jq -r 'select(.dependencies.vue != null) | "\(.name): Vue \(.dependencies.vue)"' {} \;

Length of output: 523

@chilingling
Copy link
Member

不太对,应该只有单个 commit,前面的 commit 注意不要包含
image

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


That’s not quite right. There should be only a single commit. Be careful not to include the previous commit.
image

@yy-wow yy-wow closed this Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor-main refactor/develop branch feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants