Skip to content

feat(cli): spawn npm for global installation in parallel and refine output#1597

Merged
fengmk2 merged 22 commits into
voidzero-dev:mainfrom
liangmiQwQ:feat/parllel-run-npm-for-global-installation
May 19, 2026
Merged

feat(cli): spawn npm for global installation in parallel and refine output#1597
fengmk2 merged 22 commits into
voidzero-dev:mainfrom
liangmiQwQ:feat/parllel-run-npm-for-global-installation

Conversation

@liangmiQwQ
Copy link
Copy Markdown
Contributor

@liangmiQwQ liangmiQwQ commented May 16, 2026

Close #1476

This PR introduced parallel installation to for global packages installation and updates to improve installation speed.

It used futures::stream::FuturesUnordered to manage parallel tasks, it also added --concurrency option (5 as default) for vp add, vp install, vp update with --global.

In order to suit the parallel installation, this PR modified output format for these commands, with a progress bar and more format on the final results. It’s a pretty big change, but since it’s tightly coupled with the parallel logic, I’m not sure if it belongs in a separate PR.

2026-05-16.17-33-10.mov

🤖 Generated with OpenAI Codex

@netlify
Copy link
Copy Markdown

netlify Bot commented May 16, 2026

Deploy Preview for viteplus-preview ready!

Name Link
🔨 Latest commit 6487314
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a0bd7f2c55bee0008de3ba5
😎 Deploy Preview https://deploy-preview-1597--viteplus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@liangmiQwQ
Copy link
Copy Markdown
Contributor Author

liangmiQwQ commented May 16, 2026

It seems that installation speed has significantly improved! (22 packages)

% sh test.sh
Parallel execution: 18 seconds
Current execution: 69 seconds
# pnpm bootstrap-cli > /dev/null 2>&1
# vp install -g (your packages there...)
pnpm install-global-cli  > /dev/null 2>&1
vp update -g  > /dev/null 2>&1

# Cache clean
npm cache clean --force > /dev/null 2>&1

start=$(date +%s)
vp update -g > /dev/null 2>&1
end=$(date +%s)

duration=$(( ($end - $start) ))
echo "Parallel execution: $duration seconds"

# Use the current vp
vp upgrade > /dev/null 2>&1
npm cache clean --force > /dev/null 2>&1

start_current=$(date +%s)
vp update -g > /dev/null 2>&1
end_current=$(date +%s)

duration_current=$(( ($end_current - $start_current) ))
echo "Current execution: $duration_current seconds"

@liangmiQwQ liangmiQwQ changed the title feat(cli): parllel run npm for global installation feat(cli): spawn npm for global installation in parallel and refine output May 16, 2026
@liangmiQwQ liangmiQwQ marked this pull request as ready for review May 16, 2026 09:06
@liangmiQwQ
Copy link
Copy Markdown
Contributor Author

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c9b7f50ea9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/vite_global_cli/src/commands/env/global_install.rs
Comment thread crates/vite_global_cli/src/commands/env/global_install.rs Outdated
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented May 17, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7aa981a350

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/vite_global_cli/src/commands/env/global_install.rs Outdated
Comment thread crates/vite_global_cli/src/commands/env/global_install.rs
Comment thread crates/vite_global_cli/src/commands/env/global_install.rs Outdated
@liangmiQwQ
Copy link
Copy Markdown
Contributor Author

Considering this PR has conflicting part with #1596, I recommend merging #1596 first, and resolve them on my side because this PR's diff is larger. Also, finishing the discussion in #1598 can make it easier and reduce future rework.

@fengmk2 fengmk2 self-assigned this May 18, 2026
…m-for-global-installation

# Conflicts:
#	crates/vite_global_cli/src/cli.rs
@fengmk2
Copy link
Copy Markdown
Member

fengmk2 commented May 18, 2026

@codex review

Copy link
Copy Markdown
Member

@fengmk2 fengmk2 left a comment

Choose a reason for hiding this comment

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

LGTM! @liangmiQwQ Thanks again!

@liangmiQwQ
Copy link
Copy Markdown
Contributor Author

liangmiQwQ commented May 18, 2026

Please wait a moment before merging, I have a few commits for simplifying the code for the integration of updating logic

@liangmiQwQ liangmiQwQ marked this pull request as draft May 18, 2026 14:05
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e457fdacd4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/vite_global_cli/src/commands/env/global_install.rs
Comment thread crates/vite_global_cli/src/commands/env/global_install.rs
@liangmiQwQ liangmiQwQ marked this pull request as ready for review May 18, 2026 14:17
@liangmiQwQ
Copy link
Copy Markdown
Contributor Author

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 520e587d9d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/vite_global_cli/src/cli.rs
@liangmiQwQ
Copy link
Copy Markdown
Contributor Author

Done! To simplify code and according to #1598, I regress some logic so that vp update -g now still uses resolved Node.js version for updating.

@fengmk2 fengmk2 merged commit f0ae621 into voidzero-dev:main May 19, 2026
39 checks passed
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.

Enhance vp install -g and vp update -g with multiple packages

2 participants