Skip to content

refactor(tool): unify the cli entrypoint#275

Merged
fengmk2 merged 2 commits intomainfrom
10-29-refactor_tool_use_the_unify_cli_index
Oct 29, 2025
Merged

refactor(tool): unify the cli entrypoint#275
fengmk2 merged 2 commits intomainfrom
10-29-refactor_tool_use_the_unify_cli_index

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Oct 29, 2025

I'm preparing to add more tools to @voidzero-dev/vite-plus-tools. Before adding more commands and tools, I want to unify the CLI entry point first.

Copilot AI review requested due to automatic review settings October 29, 2025 10:17
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown
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 tools package by consolidating multiple standalone CLI scripts (json-edit, replace-file-content, snap-test) into a single tool binary with subcommands. The change centralizes tool execution through a main entry point and updates TypeScript configuration to support the new structure.

Key changes:

  • Consolidated three separate binaries into one tool binary with subcommands
  • Refactored each tool script to export functions instead of executing directly
  • Updated package.json scripts to use the new tool <subcommand> pattern

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsconfig.json Adds tools package to TypeScript project references
packages/tools/tsconfig.json Configures TypeScript compilation for the tools package
packages/tools/src/snap-test.ts Refactored to export snapTest() function and accept filtered arguments
packages/tools/src/replace-file-content.ts Refactored to export replaceFileContent() function
packages/tools/src/json-edit.ts Refactored to export jsonEdit() function
packages/tools/src/index.ts New main entry point that routes to subcommands
packages/tools/src/bin.js Bootstrap file that registers oxc-node and imports the TypeScript entry point
packages/tools/src/tests/utils.spec.ts Updates import to remove .ts extension
packages/tools/snap-tests/replace-file-content/snap.txt Test snapshot showing expected output (indicates test needs updating)
packages/tools/package.json Updates bin configuration to use single tool binary
packages/cli/package.json Updates snap-test script to use new tool command

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

Comment thread packages/tools/src/index.ts Outdated
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.

ℹ️ 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 packages/tools/src/bin.js
Comment thread packages/tools/package.json
@Brooooooklyn Brooooooklyn force-pushed the 10-29-refactor_tool_use_the_unify_cli_index branch from 810f8b6 to bebb0fb Compare October 29, 2025 11:20
Copilot AI review requested due to automatic review settings October 29, 2025 11:20
Copy link
Copy Markdown
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

Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.


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

Comment thread packages/tools/snap-tests/replace-file-content/snap.txt Outdated
Comment thread packages/tools/src/replace-file-content.ts
Comment thread packages/tools/src/snap-test.ts
Comment thread packages/tools/src/json-edit.ts Outdated
@Brooooooklyn Brooooooklyn force-pushed the 10-29-refactor_tool_use_the_unify_cli_index branch from eb3acc3 to 22137d3 Compare October 29, 2025 11:38
Copilot AI review requested due to automatic review settings October 29, 2025 11:42
@Brooooooklyn Brooooooklyn force-pushed the 10-29-refactor_tool_use_the_unify_cli_index branch from 22137d3 to bcc886c Compare October 29, 2025 11:42
Copy link
Copy Markdown
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

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.


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

Comment thread packages/tools/src/json-edit.ts
Comment thread packages/tools/src/snap-test.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: LongYinan <lynweklm@gmail.com>
@Brooooooklyn Brooooooklyn force-pushed the 10-29-refactor_tool_use_the_unify_cli_index branch from bcc886c to c20bde7 Compare October 29, 2025 11:52
Comment thread packages/tools/src/bin.js
@fengmk2 fengmk2 merged commit 2f39b24 into main Oct 29, 2025
10 checks passed
Copy link
Copy Markdown
Member

fengmk2 commented Oct 29, 2025

Merge activity

@fengmk2 fengmk2 deleted the 10-29-refactor_tool_use_the_unify_cli_index branch October 29, 2025 12:17
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.

3 participants