Skip to content

Repository files navigation

DependSight

DependSight is an intelligent dependency management tool that helps developers understand their project dependencies, track updates, and make informed decisions about which packages to update.

🚀 Features

  • Dependency Analysis: Scans your project for dependencies and their usage patterns
  • Import Tracking: Identifies exactly where and how each dependency is used in your codebase
  • Update Detection: Fetches the latest versions and changelogs for your dependencies
  • Smart Relevance: Calculates relevance scores to help prioritize updates
  • Custom Reports: Generates detailed reports in multiple formats (console, markdown, JSON)

📦 Installation

Global installation

npm install -g dependsight

Or as a dev dependency in your project

npm install --save-dev dependsight

🔧 Usage

Analyzing your project

First, analyze your project to create a dependency usage database: bash dependsight analyze --path ./my-project

This will create a dependsight-analysis.json file in your project directory with information about your dependencies and how they're used.

Generating update reports

To generate an update report based on the analysis:

dependsight report --path ./my-project --format markdown

CLI Options

analyze command:

  • -p, --path <path>: Path to project root (default: current directory)
  • -o, --output <file>: Output file for analysis results (default: dependsight-analysis.json)

report command:

  • -p, --path <path>: Path to project root (default: current directory)
  • -i, --input <file>: Input file from analysis results (default: dependsight-analysis.json)
  • -f, --format <format>: Report format (console, markdown, json) (default: console)
  • -o, --output <file>: Output file for report (default: dependsight-report.md)
  • -m, --min-relevance <score>: Minimum relevance score (0-100) (default: 50)

📊 Example Report

Here's an example of the markdown report generated by DependSight:

# DependSight Update Report

## 1. react (17.0.2 → 18.0.0)

**Relevance Score:** 85%

### Affected Files (3)

- `src/App.js`
- `src/components/Button.js`
- `src/hooks/useCounter.js`

### Changelog

#### Version 18.0.0 (2022-03-29)

- New concurrent rendering features
- Automatic batching of state updates
- New suspense features
- New root API

🔍 How It Works

DependSight works in three main steps:

  1. Scan Dependencies: Analyzes your package.json to find all dependencies and their versions
  2. Analyze Code Usage: Parses your JavaScript/TypeScript files to identify where and how dependencies are used
  3. Fetch Updates: Retrieves the latest versions and changelog information from npm and GitHub

The relevance score is calculated based on:

  • The type of version change (major, minor, patch)
  • The number of files affected by the update
  • Whether it's a development or production dependency
  • How frequently the dependency is imported in your code

🛠️ Development

Prerequisites

  • Node.js 14 or higher
  • npm or yarn

Setup

# Clone the repository
git clone https://github.com/yourusername/dependsight.git
cd dependsight

# Install dependencies
npm install

# Build the project
npm run build

# Run tests
npm test

Project Structure

  • src/cli: Command line interface and commands
  • src/core: Core functionality (scanner, analyzer, changelog fetcher)
  • src/utils: Utility functions
  • src/types: TypeScript type definitions

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please read our Code of Conduct and Contributing Guidelines before submitting a PR.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👥 Authors and Acknowledgment

Created by [Umit Haciyusufoglu] - @umithyo

Special thanks to all contributors!

📬 Contact

If you have any questions or feedback, please open an issue or reach out to umit.haciyusufoglu@gmail.com.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages