Skip to content

feat: add NPM support for global installation and Node.js ecosystem compatibility#453

Open
reizhafajrian wants to merge 2 commits into
tirth8205:mainfrom
reizhafajrian:main
Open

feat: add NPM support for global installation and Node.js ecosystem compatibility#453
reizhafajrian wants to merge 2 commits into
tirth8205:mainfrom
reizhafajrian:main

Conversation

@reizhafajrian
Copy link
Copy Markdown

Description

Overview

This PR adds NPM support to the project, allowing users to install code-review-graph globally via npm install -g code-review-graph.

While the core logic remains in Python, this addition provides a seamless experience for developers in the Node.js ecosystem, which is common for many AI coding tools (like Claude Code, Cursor, etc.).

Key Changes

  • Node.js Wrapper: Added bin/cli.js to act as a bridge, automatically locating the Python environment and forwarding commands.
  • Automated Setup: Included a scripts/npm-postinstall.js script that automatically creates an isolated Python virtual environment (.venv) and installs all necessary dependencies upon running npm install.
  • Packaging: Configured package.json with binary mappings (code-review-graph and crg) and ensured all required Python assets are bundled.
  • Documentation: Updated README.md and all translations (zh-CN, ja-JP, ko-KR, hi-IN) to include the new NPM installation method.

Why this is beneficial

  • Easier Installation: Users don't need to manually manage Python virtual environments or paths if they prefer using npm.
  • Broader Adoption: Makes the tool more accessible to frontend and full-stack developers who primarily use Node.js tools.
  • Improved DX: The post-install script handles the heavy lifting of dependency management automatically.

How to test

  1. Clone this branch/fork.
  2. Run npm install -g . from the root directory.
  3. Verify that code-review-graph --version or crg status works correctly in any directory.

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