Skip to content

Conversation

@Timeless0911
Copy link
Contributor

@Timeless0911 Timeless0911 commented Dec 12, 2025

Summary

  • Public API changed (WIP)
  • Simplify build error logs

before
image

now
image

  • Handle output formatting on different package managers
  • Add rslib-node to the title of process to make it easier to identify the process via activity monitor or other tools
  • Load config refactor

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings December 12, 2025 08:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the CLI initialization and error handling to improve user experience. The main changes include renaming the public API from runCli to runCLI (following proper casing convention), consolidating CLI setup logic, and implementing smarter output formatting for different package managers. The refactor also adds a process title for easier identification and simplifies build error logging.

Key changes:

  • Renamed public API runCli to runCLI and consolidated CLI initialization logic into a new /cli/index.ts file
  • Removed the prepareCli function and integrated its functionality into the main CLI entry point
  • Enhanced package manager detection to handle output formatting for npx, Bun, and Node.js --run command
  • Introduced RSPACK_BUILD_ERROR constant to conditionally suppress redundant error messages
  • Renamed internal function initConfig to init for better clarity

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/core/src/index.ts Updated public API exports: renamed runCli to runCLI and removed prepareCli export
packages/core/src/cli/prepare.ts Deleted file - functionality moved to /cli/index.ts
packages/core/src/cli/init.ts Renamed function from initConfig to init
packages/core/src/cli/index.ts New file consolidating CLI initialization with improved package manager detection and greeting logic
packages/core/src/cli/commands.ts Added RSPACK_BUILD_ERROR constant and error filtering logic; renamed import from initConfig to init; updated import path
packages/core/bin/rslib.js Simplified entry point to call runCLI directly without try-catch wrapper

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Timeless0911 Timeless0911 changed the title refactor!: enhance CLI behaviour and logs feat!: add JavaScript API and enhance CLI behaviour Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants