Skip to content

revert: #15#16

Merged
zombieJ merged 3 commits into
mainfrom
revert-antd
Apr 7, 2025
Merged

revert: #15#16
zombieJ merged 3 commits into
mainfrom
revert-antd

Conversation

@zombieJ

@zombieJ zombieJ commented Apr 7, 2025

Copy link
Copy Markdown
Member

antd 继续使用 antd-tools,这里的内置 eslint 不再需要。同时回滚也解决其他 rc 组件库 eslint 依赖冲突的问题。

Summary by CodeRabbit

  • Chores
    • 更新了应用版本号及构建命令,从而简化了构建流程。
    • 优化了依赖管理,移除不必要的依赖包,实现依赖关系的精简。
    • 调整了代码检查流程,重构了 ESLint 集成以提升执行效率。

@coderabbitai

coderabbitai Bot commented Apr 7, 2025

Copy link
Copy Markdown

Walkthrough

此次变更主要涵盖了配置文件、构建脚本及 ESLint 集成的调整。
.fatherrc.ts 中,移除了对 path 的导入以及使用 path.resolve 的插件配置,插件数组因此变为空。
package.json 中,版本号由 2.1.2 更新至 2.1.3,同时构建和预发布脚本中去除了 cross-env 前缀,部分依赖进行了移除和重新分类。
src/index.ts 中,对 ESLint 的集成方式作出重构,不再使用详细错误处理,而是通过检查 ESLint 是否存在后直接执行命令。

Changes

文件 修改概述
.fatherrc.ts
package.json
配置及构建相关调整:移除 .fatherrc.ts 中的 path 导入和插件配置;
package.json 中版本号由 2.1.2 更新至 2.1.3,构建命令和预发布命令中移除 cross-env 前缀,同时调整/移除部分依赖。
src/index.ts 重构 ESLint 集成:不再实例化 ESLint 对象及详细错误处理,改为检查 ESLint 是否安装后使用 execSync 执行命令;删除了对 process.env.CHECK_TS_ONLY 的条件检查。

Sequence Diagram(s)

sequenceDiagram
    participant B as 构建流程
    participant I as ESLint 集成 (src/index.ts)
    participant S as Shell/execSync
    B->>I: 开始 ESLint 检查
    I->>I: 检查是否安装 ESLint (checkNpmPackageDependency)
    alt ESLint 已安装
        I->>S: 执行 ESLint 命令
        S-->>I: 返回命令结果
    else ESLint 未安装
        I-->>B: 打印跳过提示
    end
Loading

Poem

我是一只快乐的小兔子,
代码精简如春风轻拂,
路径与依赖都焕然一新,
版本升级跳跃似晨曦,
ESLint 的魔法悄然降临,
在代码花园中,我欢快飞跃!🐇✨

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.

 WARN  GET http://10.0.0.28:4873/@types%2Feslint error (503). Will retry in 10 seconds. 2 retries left.
 WARN  GET http://10.0.0.28:4873/eslint/-/eslint-8.57.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left.
 WARN  GET http://10.0.0.28:4873/@umijs/lint/-/lint-4.3.20.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left.
 WARN  GET http://10.0.0.28:4873/@types%2Feslint error (503). Will retry in 1 minute. 1 retries left.
 WARN  GET http://10.0.0.28:4873/eslint/-/eslint-8.57.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left.
 WARN  GET http://10.0.0.28:4873/@umijs/lint/-/lint-4.3.20.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left.
 ERR_PNPM_FETCH_503  GET http://10.0.0.28:4873/@types%2Feslint: Service Unavailable - 503

This error happened while installing a direct dependency of /tmp/eslint


📜 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 6ba9bb7 and 926307f.

📒 Files selected for processing (3)
  • .fatherrc.ts (0 hunks)
  • package.json (3 hunks)
  • src/index.ts (2 hunks)
💤 Files with no reviewable changes (1)
  • .fatherrc.ts
🔇 Additional comments (5)
src/index.ts (2)

39-53: ESLint 集成方式的简化

此处变更将之前可能复杂的 ESLint API 直接调用方式简化为命令行执行方式。这种实现更加直接明了,但请注意 execSync 执行失败时会直接抛出异常,可能会导致整个构建过程中断。

- // 此处移除了之前复杂的 ESLint API 实现代码
+ const isEslintInstalled = checkNpmPackageDependency(packageJson, 'eslint');
+ if (isEslintInstalled) {
+   execSync(
+     // Requires compatibility with Windows environment
+     `npx eslint ${inputFolder} --ext .tsx,.ts --rule "@typescript-eslint/consistent-type-exports: error"`,
+     {
+       cwd,
+       env: process.env,
+       stdio: [process.stdin, process.stdout, process.stderr],
+       encoding: 'utf-8',
+     },
+   );
+ } else {
+   console.log('ESLint is not installed, skip.');
+ }

57-75: 构建配置调整

配置部分代码看起来只是格式调整,并移除了与 CHECK_TS_ONLY 环境变量相关的条件判断,这与 package.json 中脚本变更保持一致。

package.json (3)

3-3: 版本更新

版本从 2.1.2 更新到 2.1.3,符合语义化版本控制规范。


13-13: 构建脚本简化

移除了 cross-env CHECK_TS_ONLY=1 前缀,与 src/index.ts 中移除相关环境变量判断逻辑保持一致。这种变更使得构建流程更加简洁。

Also applies to: 17-17


38-40:

Details

✅ Verification successful

依赖调整

  • 移除了 ESLint 相关的依赖(@typescript-eslint/eslint-plugin 和 @typescript-eslint/parser)
  • 将 eslint 从 dependencies 移至 devDependencies

这些变更与 PR 目标一致,解决了与其他 RC 组件库的依赖冲突,同时将 eslint 正确归类为开发依赖。

Also applies to: 47-47


🏁 Script executed:

#!/bin/bash
# 检查其他 RC 组件库的依赖情况,验证是否存在冲突
echo "检查 RC 组件库的 ESLint 相关依赖情况"
grep -r "\"eslint\":" --include="package.json" . || echo "未找到其他 eslint 相关依赖"
grep -r "\"@typescript-eslint" --include="package.json" . || echo "未找到其他 @typescript-eslint 相关依赖"

Length of output: 271


依赖调整验证通过

经过验证,本次 PR 中关于 ESLint 依赖的调整完全符合预期,具体说明如下:

  • 已移除 ESLint 相关的依赖(@typescript-eslint/eslint-plugin 与 @typescript-eslint/parser),在 package.json 中未再出现这些依赖;
  • 将 eslint 从 dependencies 移至 devDependencies,有助于避免与其他 RC 组件库产生依赖冲突。

请开发者确认 package.json 中的 eslint 已正确放置于 devDependencies 部分,其它部分无遗漏。

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ 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.
  • @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.

@socket-security

Copy link
Copy Markdown

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: npm/@typescript-eslint/eslint-plugin@8.29.0, npm/@typescript-eslint/parser@8.29.0

View full report↗︎

@zombieJ zombieJ merged commit 66863ff into main Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant