Skip to content

feat(install): 添加前端项目下载与依赖安装功能#735

Merged
kanyxmo merged 1 commit into
masterfrom
install-frontend
Jun 23, 2026
Merged

feat(install): 添加前端项目下载与依赖安装功能#735
kanyxmo merged 1 commit into
masterfrom
install-frontend

Conversation

@kanyxmo

@kanyxmo kanyxmo commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

新功能

  • 在应用安装流程中集成自动化前端安装步骤,包括从代码仓库获取前端代码、环境依赖检测(Node/pnpm)及依赖安装。每个安装步骤独立处理,单步失败时跳过但继续执行后续安装流程。

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement labels Jun 23, 2026
@kanyxmo kanyxmo merged commit c2f97b7 into master Jun 23, 2026
3 of 8 checks passed
@kanyxmo kanyxmo deleted the install-frontend branch June 23, 2026 10:58
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aac33a21-593d-4b5b-89f9-09e374d5b08c

📥 Commits

Reviewing files that changed from the base of the PR and between 243956c and 5586cf4.

📒 Files selected for processing (1)
  • app/Command/InstallCommand.php

📝 Walkthrough

Walkthrough

InstallCommandhandle() 主流程中新增 installFrontend() 调用,依次完成:git 克隆前端仓库、移除 .git 目录、执行 pnpm install。底层封装了基于 Symfony Process 的命令检测与进程执行工具链,任一步骤失败均以警告形式跳过,不阻断后端安装。

Changes

前端安装流程

Layer / File(s) Summary
常量、依赖引入与主流程接入点
app/Command/InstallCommand.php
引入 Symfony FilesystemProcess,声明 FRONTEND_REPOSITORY 常量,在 handle() 数据库迁移前插入 installFrontend() 调用。
installFrontend() 编排与异常保护
app/Command/InstallCommand.php
新增 installFrontend(),交互式确认后依次调用下载与依赖安装步骤,捕获任意 Throwable 并以 warning 标记跳过,不阻断后端流程。
downloadFrontend() 与 removeFrontendGitDirectory()
app/Command/InstallCommand.php
downloadFrontend() 检测 git 可用性及目标目录状态后执行 git clone --depth=1;成功后调用 removeFrontendGitDirectory() 通过 Symfony Filesystem 删除 .git 目录,各失败路径返回 false 并输出提示。
installFrontendDependencies() 与进程工具链
app/Command/InstallCommand.php
installFrontendDependencies() 检测 node/pnpm 并执行 pnpm installisCommandAvailable()/runProcess() 封装 Symfony Process,返回结构化 successful/error 结果;isGitAvailable/isNodeAvailable/isPnpmAvailable 基于此工具链实现。
frontendPath() 与 isDirectoryEmpty() 辅助方法
app/Command/InstallCommand.php
frontendPath() 固定返回 BASE_PATH/webisDirectoryEmpty() 通过 scandir 排除 ./.. 判断目录是否为空。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • mineadmin/MineAdmin#732: 同样修改 InstallCommand::handle() 流程,添加 migrate/db:seed 与扩展自动安装逻辑,本 PR 在该基础上插入 installFrontend() 步骤。

Suggested labels

enhancement, Command

Poem

🐰 小兔子挥动爪子,克隆前端不费神,
pnpm install 跑起来,node 与 pnpm 齐检验,
git clone 一声响,web 目录整洁生,
失败也不慌张,warning 跳过继续行,
后端安装稳如山,前端新装喜气盈~ 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch install-frontend

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

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Command enhancement size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant