chore: Improve UX

This commit is contained in:
abhisek
2025-05-15 17:57:05 +05:30
parent cfde1d7632
commit d91a1b32ac
6 changed files with 58 additions and 47 deletions
+31 -23
View File
@@ -16,11 +16,11 @@ features, we particularly value contributions in the form of:
## How to report a bug
Create a new issue and add the label "bug".
Create a new issue and add the label `bug`.
## How to suggest a new feature
Create a new issue and add the label "enhancement".
Create a new issue and add the label `enhancement`.
## Development workflow
@@ -41,38 +41,46 @@ When contributing changes to repository, follow these steps:
### Getting Started
1. Clone your fork:
```bash
git clone https://github.com/YOUR_USERNAME/pmg.git
cd pmg
```
```shell
git clone https://github.com/YOUR_USERNAME/pmg.git
cd pmg
```
2. Install dependencies:
```bash
go mod tidy
```
```shell
go mod tidy
```
3. Build the project:
```bash
make all
```
```shell
make all
```
### Development Workflow
1. Create a branch:
```bash
git checkout -b feature/your-feature
```
```shell
git checkout -b feature/your-feature
```
2. Make your changes and test:
```bash
make test
```
```shell
make test
```
3. Commit with sign-off:
```bash
git commit -s -m "feat: add new feature"
```
```shell
git commit -s -m "feat: add new feature"
```
4. Push and create PR:
```bash
git push origin feature/your-feature
```shell
git push origin feature/your-feature
```
+23 -20
View File
@@ -7,7 +7,17 @@ See [example](https://safedep.io/malicious-npm-package-express-cookie-parser/)
- Blocks malicious packages at install time
- No configuration required, just install and use
## TL;DR
## 🔥 PMG in Action
<img src="./docs/assets/pmg-intro.png" width="600" alt="pmg in action">
## 📦 TL;DR
Install `pmg`
```shell
brew install safedep/tap/pmg
```
Set up `pmg` to protect you development environment from malicious packages:
@@ -19,16 +29,20 @@ source ~/.zshrc
Continue using your favorite package manager as usual:
```
```shell
npm install <package-name>
```
```shell
pnpm add <package-name>
```
## 📑 Table of Contents
- [Package Manager Guard (PMG)](#package-manager-guard-pmg)
- [TL;DR](#tldr)
- [🔥 PMG in Action](#-pmg-in-action)
- [📦 TL;DR](#-tldr)
- [📑 Table of Contents](#-table-of-contents)
- [Features](#features)
- [🔥 Features](#-features)
- [Supported Package Managers](#supported-package-managers)
- [Installation](#installation)
- [Binaries](#binaries)
@@ -37,13 +51,10 @@ pnpm add <package-name>
- [Silent Mode](#silent-mode)
- [Verbose Mode](#verbose-mode)
- [Debugging](#debugging)
- [PMG in Action](#pmg-in-action)
- [Malicious Package Detection](#malicious-package-detection)
- [Bulk Package Analysis](#bulk-package-analysis)
- [Contributing](#contributing)
- [Limitations](#limitations)
- [🤝 Contributing](#-contributing)
- [🚫 Limitations](#-limitations)
## Features
## 🔥 Features
- 🚫 Malicious package identification using [SafeDep Cloud](https://docs.safedep.io/cloud/malware-analysis)
- 🌲 Deep dependency analysis and transitive dependency resolution
@@ -135,19 +146,11 @@ Store the debug logs in a file:
pmg --debug --log /tmp/debug.json npm install <package-name>
```
### PMG in Action
#### Malicious Package Detection
![pmg scan malicious package](./docs/assets/pmg-malicious-pkg.png)
#### Bulk Package Analysis
![pmg scan & install multiple package](./docs/assets/pmg-scan-multiple-pkgs.png)
## Contributing
## 🤝 Contributing
Refer to [CONTRIBUTING.md](CONTRIBUTING.md)
## Limitations
## 🚫 Limitations
<details>
<summary>Approximate dependency version resolution</summary>
Binary file not shown.

After

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 KiB

+4 -4
View File
@@ -104,11 +104,11 @@ func printMaliciousPackagesList(malwarePackages []*analyzer.PackageVersionAnalys
if verbosityLevel == VerbosityLevelVerbose {
fmt.Println(Colors.Yellow(termWidthFormatText(mp.Summary, 80)))
}
if mp.ReferenceURL != "" {
fmt.Println()
fmt.Println(Colors.Yellow(fmt.Sprintf("Reference: %s", mp.ReferenceURL)))
}
if mp.ReferenceURL != "" {
fmt.Println()
fmt.Println(Colors.Yellow(fmt.Sprintf("Reference: %s", mp.ReferenceURL)))
}
}
}