nutui-react icon indicating copy to clipboard operation
nutui-react copied to clipboard

fix: jmapp demo build

Open Miles-hxy opened this issue 8 months ago • 3 comments

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

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

Summary by CodeRabbit

  • Chores
    • 更新了演示项目的构建命令,新增指定配置选项以提升构建流程的稳定性。
    • 调整了应用的基础路径设置,确保相关项目在部署时能够准确解析和加载资源。

Miles-hxy avatar Apr 03 '25 01:04 Miles-hxy

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

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

codecov[bot] avatar Apr 03 '25 01:04 codecov[bot]

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: 完成构建过程

Possibly related PRs

  • jdf2e/nutui-react#2847: 该PR涉及对 package.json 中构建脚本的更新,与本PR的修改直接相关。
  • jdf2e/nutui-react#2842: 该PR对 package.json 的修改与本PR中的构建命令增强存在关联。
  • jdf2e/nutui-react#3137: 该PR修改了 publicPath 属性,涉及与本PR相似的项目ID处理逻辑。

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 c0e62fcf7db56c54a61f8d0e0e7d5148c4607274 and f2244131bae60f8b59116fcb62045b582ace3259.

📒 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.

coderabbitai[bot] avatar Apr 03 '25 01:04 coderabbitai[bot]

image 这里加预览地址

oasis-cloud avatar Apr 03 '25 06:04 oasis-cloud