Skip to content

Conversation

@Miles-hxy
Copy link
Collaborator

@Miles-hxy Miles-hxy commented Apr 3, 2025

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

  • Chores
    • 更新了演示项目的构建命令,新增指定配置选项以提升构建流程的稳定性。
    • 调整了应用的基础路径设置,确保相关项目在部署时能够准确解析和加载资源。
  • 新特性
    • 更新了“京东 JDesign 主题”的描述,新增预览链接,提升用户体验。
    • 在文档中新增了“京东 JDesign 主题”的预览链接,方便用户直接访问。

@github-actions github-actions bot added action:review This PR needs more reviews (less than 2 approvals) 3.x Target branch 3.x labels Apr 3, 2025
@Miles-hxy Miles-hxy requested a review from oasis-cloud April 3, 2025 01:36
@codecov
Copy link

codecov bot commented Apr 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.19%. Comparing base (cc94ce3) to head (f224413).
Report is 4 commits behind head on feat_v3.x.

Additional details and impacted files
@@              Coverage Diff              @@
##           feat_v3.x    #3146      +/-   ##
=============================================
+ Coverage      87.18%   87.19%   +0.01%     
=============================================
  Files            279      279              
  Lines          18537    18537              
  Branches        2820     2820              
=============================================
+ Hits           16161    16163       +2     
+ Misses          2371     2369       -2     
  Partials           5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai
Copy link

coderabbitai bot commented Apr 3, 2025

Walkthrough

本次提交对多个文件进行了修改。在 package.json 中,更新了 "build:demo:jmapp" 脚本,新增了 --config vite.config.demo.ts 参数;在 vite.config.demo.ts 中,调整了 base 属性的逻辑,使得当 projectIDjmapp 时,基础路径从 /h5/react/jdesign 改为 /h5/react/jdesign-3x。同时,在文档中更新了主题的描述,增加了预览链接。

Changes

文件 修改内容
package.json 更新 "build:demo:jmapp" 脚本,添加了 --config vite.config.demo.ts 参数;更新 "build:taro:demo:jmapp""build:jdtaro:demo:jmapp" 脚本,修改构建命令为 build:jmapp h5
vite.config.demo.ts 修改 base 属性逻辑:当 projectIDjmapp 时,基础路径变为 /h5/react/jdesign-3x
src/sites/sites-react/doc/docs/react/official-theme-react.md 更新 "京东 JDesign 主题" 描述,增加预览链接。
src/sites/sites-react/doc/docs/taro/official-theme-react.md 更新 "京东 JDesign 主题" 描述,增加预览链接。
packages/nutui-taro-demo/package.json 更新 "build:jmapp" 脚本,添加 VITE_APP_PROJECT_ID=jmapp 环境变量。
packages/nutui-taro-demo/config/prod.js 修改 publicPath 属性逻辑:根据 VITE_APP_PROJECT_ID 设置为 jdesign-3x3x

Sequence Diagram(s)

sequenceDiagram
    participant User as 用户
    participant NPM as npm
    participant Vite as Vite
    participant Config as vite.config.demo.ts

    User->>NPM: 执行 "build:demo:jmapp" 脚本
    NPM->>NPM: 运行 "npm run checked"
    NPM->>Vite: 执行 "vite build --config vite.config.demo.ts"
    Vite->>Config: 加载配置文件
    Config-->>Vite: 返回配置,设置 base 为 /h5/react/jdesign-3x (若 projectID = "jmapp")
    Vite-->>NPM: 完成构建过程
Loading

Possibly related PRs

Suggested Reviewers

  • oasis-cloud
  • xiaoyatong

Poem

我是跳跃的小兔,
轻盈穿越代码丛林;
新参数如风,掠过每一行,
基础路径迎风而变,
愿构建之旅如草原般广阔 🐰🌿。

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/nutui-taro-demo/config/prod.js

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "taro/react" to extend from. Please check that the name of the config is correct.

The config "taro/react" was referenced from the config file in "/packages/nutui-taro-demo/.eslintrc".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c0e62fc and f224413.

📒 Files selected for processing (1)
  • packages/nutui-taro-demo/config/prod.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test
🔇 Additional comments (1)
packages/nutui-taro-demo/config/prod.js (1)

24-24: 优化了路径配置,支持jmapp项目构建

通过引入环境变量条件判断,使publicPath能够根据项目ID动态适配不同的路径。当VITE_APP_PROJECT_ID为'jmapp'时,将使用jdesign-3x子路径,否则保持使用原来的3x子路径。这个改动很好地解决了jmapp演示项目的构建路径问题。

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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

@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: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ce920b6 and 2b6f0ed.

📒 Files selected for processing (2)
  • package.json (1 hunks)
  • vite.config.demo.ts (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
vite.config.demo.ts (1)
packages/nutui-taro-demo/config/index.js (1)
  • projectID (5-5)
🔇 Additional comments (1)
package.json (1)

73-73:

✅ Verification successful

指定构建配置文件以确保正确的 jmapp 演示构建

此更改为 build:demo:jmapp 脚本添加了 --config vite.config.demo.ts 参数,确保在构建 jmapp 演示项目时使用正确的配置文件,这与其他演示构建脚本保持一致(如第 72 行的 build:demo 脚本)。


🏁 Script executed:

#!/bin/bash
# 验证其他相关构建脚本是否也指定了配置文件

echo "检查其他相关的 demo 构建脚本配置..."
grep "build:demo" package.json

# 检查是否有其他使用 vite.config.demo.ts 的构建脚本
echo "使用 vite.config.demo.ts 的构建脚本:"
grep -n "vite.config.demo.ts" package.json

Length of output: 587


构建配置文件已正确指定,确保 jmapp 演示构建使用正确配置

经过验证,build:demo:jmapp 脚本中添加的 --config vite.config.demo.ts 参数以及环境变量 VITE_APP_PROJECT_ID=jmapp 的设置,与其他 demo 构建脚本(如第 72 行的 build:demo)保持一致,均使用了相同的配置文件。这保证了各个演示构建的一致性和正确性。

@oasis-cloud oasis-cloud requested a review from xiaoyatong April 3, 2025 06:14
Copy link
Collaborator

@oasis-cloud oasis-cloud left a comment

Choose a reason for hiding this comment

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

增加 taro 的构建,2.x 版本只构建了 taro 版本。

将文件的部署处理增加到 work-shell 工程里面,每次发版执行 work-shell 脚本部署 demo

@oasis-cloud
Copy link
Collaborator

image 这里加预览地址

Copy link
Collaborator

@oasis-cloud oasis-cloud left a comment

Choose a reason for hiding this comment

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

taro 下的 offical-theme-react.md 文件也需要修改

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

🧹 Nitpick comments (2)
package.json (2)

80-80: Taro Demo 构建命令更新
"build:taro:demo:jmapp" 命令中,将原来的 build:h5 修改为 build:jmapp h5,确保生成页面文件与 jmapp 构建流程一致。建议进一步验证生成页面的输出是否符合新配置。


81-81: JDTaro 构建命令更新
"build:jdtaro:demo:jmapp" 命令中,新增了 JD=1 参数并使用 build:jmapp h5 命令,请确认 JD=1 的作用在整个构建流程中得到正确处理,同时确保该命令能正确生成 JDTaro 的 jmapp demo 版本。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between bb6f10c and 8bd820a.

📒 Files selected for processing (1)
  • package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: test
🔇 Additional comments (1)
package.json (1)

74-74: 构建命令更新正确
该命令在 "build:demo:jmapp" 中新增了 --config vite.config.demo.ts 参数,同时正确地设置了环境变量 VITE_APP_PROJECT_ID=jmapp,满足 jmapp demo 构建需求。请确保 vite.config.demo.ts 中的配置与预期一致。

@xiaoyatong xiaoyatong merged commit a7f79dd into jdf2e:feat_v3.x Apr 11, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants