fix: Modify some version issue#1280
Conversation
WalkthroughThis pull request updates CDN configuration for the engine CLI by modifying environment files to use the npmmirror CDN. It replaces the previous CDN domain with a new one and introduces a new environment variable. Additionally, the PR removes a block copy button from the block settings component, adds block initialization logic in the main block editor, and refines the filtering logic in the page tree component to enforce case-insensitive matching. Changes
Sequence Diagram(s)sequenceDiagram
participant User as Developer/User
participant UI as Main.vue
participant BlockSvc as useBlock()
User->>UI: Saves block edits
UI-->>User: Confirmation dialog (if needed)
UI->>BlockSvc: initBlock(block, {}, isEdit)
BlockSvc-->>UI: Block initialized
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/engine-cli/template/designer/env/.env.alpha (1)
4-4: Optional Cleanup of Deprecated Comment:
Consider removing the commented out line#VITE_CDN_DOMAIN=https://unpkg.comif it is no longer required for historical reference. This will help reduce clutter in the configuration file.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
packages/engine-cli/template/designer/env/.env.alpha(1 hunks)packages/engine-cli/template/designer/env/.env.development(1 hunks)packages/engine-cli/template/designer/env/.env.production(1 hunks)packages/plugins/block/src/BlockSetting.vue(0 hunks)packages/plugins/block/src/Main.vue(1 hunks)packages/plugins/page/src/Tree.vue(1 hunks)
💤 Files with no reviewable changes (1)
- packages/plugins/block/src/BlockSetting.vue
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: push-check
🔇 Additional comments (6)
packages/engine-cli/template/designer/env/.env.production (1)
4-7:Details
✅ Verification successful
CDN source updated from unpkg to npmmirror
The configuration changes the CDN source from unpkg.com to registry.npmmirror.com and adds the necessary
VITE_CDN_TYPEvariable required for npmmirror integration. This change aligns with the PR objective to replace "unpkg" with "npmmirror" in the engine-cli.
🏁 Script executed:
#!/bin/bash # Check if this change is consistent across all environment files echo "Checking for consistency across environment files..." grep -r "VITE_CDN_DOMAIN=" packages/engine-cli/template/designer/env/ grep -r "VITE_CDN_TYPE=" packages/engine-cli/template/designer/env/Length of output: 1397
CDN Configuration Update Verified Across All Environment Files
The change from using unpkg.com to npmmirror has been verified in all environment files (.env.alpha, .env.development, and .env.production). The active settings now correctly point tohttps://registry.npmmirror.comforVITE_CDN_DOMAIN, and the requiredVITE_CDN_TYPE=npmmirrorvariable is present as intended.
- Files Affected:
packages/engine-cli/template/designer/env/.env.productionpackages/engine-cli/template/designer/env/.env.alphapackages/engine-cli/template/designer/env/.env.developmentNo further changes appear to be necessary, and this update aligns perfectly with the PR's objectives.
packages/engine-cli/template/designer/env/.env.development (1)
4-7: CDN source updated from unpkg to npmmirrorThe configuration changes the CDN source from unpkg.com to registry.npmmirror.com and adds the necessary
VITE_CDN_TYPEvariable required for npmmirror integration. This change maintains consistency with the updates in the production environment file.packages/plugins/page/src/Tree.vue (1)
115-115: Enhanced case-insensitive filtering for page searchThe improvement ensures consistent case-insensitive filtering by explicitly converting both the node label and the filter value to lowercase before performing the includes check. This fixes the search functionality in the page management feature mentioned in the PR objectives.
packages/plugins/block/src/Main.vue (1)
329-329:Details
✅ Verification successful
Fixed block initialization in edit mode
Added block initialization when the block is confirmed to be saved, ensuring proper rendering of the block in edit mode. This addresses the issue mentioned in the PR objectives where "clicking on an edit block did not yield any response."
🏁 Script executed:
#!/bin/bash # Check if this block initialization is properly implemented in other similar functions echo "Checking for similar block initialization patterns..." rg "useBlock\(\).initBlock\(" packages/plugins/block/src/Length of output: 660
Block Initialization Verified and Correct
The updated code in
packages/plugins/block/src/Main.vueusinguseBlock().initBlock(block, {}, isEdit)is consistent with similar patterns found in the codebase (e.g., in
blockSetting.tsxandBlockSetting.vue). This proper initialization in edit mode confirms that the block is rendered correctly after being saved, which addresses the issue where clicking on an edit block was unresponsive.
- Verified consistency with similar implementations across the repository.
- No additional changes are needed.
packages/engine-cli/template/designer/env/.env.alpha (2)
4-5: CDN Domain Update:
The CDN domain has been updated from the unpkg.com endpoint to "https://registry.npmmirror.com". This change aligns with the project’s requirement to switch CDNs and ensures consistency with the other environment files.
6-7: Introducing VITE_CDN_TYPE Variable:
The new environment variableVITE_CDN_TYPEset to "npmmirror" is well introduced and accompanied by a clarifying comment. Ensure that any downstream code consuming these variables is updated to handle the new configuration.
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit