Skip to content

Commit

Permalink
Working on documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexios80 committed Apr 11, 2024
1 parent c6fb089 commit 9b3ddfe
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## 1.33.0
- The `puby link` command no longer requires existing `pubspec.lock` files to function
- Fixes `--no-fvm` flag for `puby link`
- Updates for fvm 3.0.0

Expand Down
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Run commands in all projects in the current directory. Handle monorepos with ease.

## Features

- No configuration necessary. Run `puby` anywhere. It won't complain.
- Execute `pub get` up to five times faster with `puby link`
- Execute `pub get` in seconds rather than minutes with `puby link`
- Reclaim disk space with `puby clean`
- Supports all project-level pub commands
- Execute any command in all projects with `puby exec`
Expand All @@ -27,33 +28,55 @@ For projects configured with FVM, `fvm flutter` is used. FVM support can be disa
## Use as an executable

### Installation

```console
$ dart pub global activate puby
```

### Usage

```console
$ puby get
$ puby upgrade --major-versions
...
```

## Notes on `puby link`

This command is based on `flutter update-packages`. All of the dependencies required by all of the projects in the current directory are cataloged and cached if necessary, then `pub get --offline` can safely run in all the projects in parallel.

The `pubspec.lock` file is used to catalog the required dependencies, so for this command to run successfully you must check in your `pubspec.lock` files to version control.
This command no longer requires existing `pubspec.lock` files to function. It now uses the same version resolution strategy from the `pub` command internally and runs many times faster than the old implementation.

The `puby link` command can run _many times faster_ than `puby get`, so it is very useful for large mono-repos.

Benchmarks in the [flutter/packages](https://github.com/flutter/packages) repo:

The `puby link` command can run up to _five times faster_ than `puby get`, so it is very useful for large mono-repos.
| Command | Duration |
| ----------------- | -------- |
| `puby get` | 9:01.97 |
| `melos bootstrap` | 47.810 |
| `puby link` | 25.881 |

Benchmark setup:

- M3 MacBook Pro
- Gigabit internet connection
- Run `puby clean && dart pub cache clean` before each run
- `melos bootstrap` is run with a [custom branch of flutter/packages](https://github.com/Rexios80/packages_flutter/tree/puby_benchmarking) with the required setup

## Notes on `puby exec`

Paths relative to the directory you are running `puby` in will not work. For example:

- `puby exec ./foo.sh` will not work
- `puby exec $PWD/foo.sh` will work

## Configuration

Create a `puby.yaml` file in the root of the project you want to configure

### Exclusions

Add command exclusions to prevent them from running in a project

```yaml
Expand All @@ -67,4 +90,4 @@ Exclusions match from the start of a command, and the entire exclusion string mu
| Exclusion | Example command excluded |
| ---------------------- | ------------------------------------- |
| `test` | `[engine] test --coverage` |
| `pub run build_runner` | `[engine] pub run build_runner build` |
| `pub run build_runner` | `[engine] pub run build_runner build` |

0 comments on commit 9b3ddfe

Please sign in to comment.