Code Monkey home page Code Monkey logo

puby's Introduction

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 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
  • Determines the project engine (dart, flutter, fvm) automatically
  • Convenience shortcuts for common dart/flutter commands
  • Combined exit code for use in CI
  • Per-project command exclusions
Command Equivalent
puby [args] [engine] pub [args]
puby link Warm the pub cache and run [engine] pub get --offline (see below)
puby gen [engine] pub run build_runner build --delete-conflicting-outputs
puby test [engine] test
puby clean flutter clean
puby mup [engine] pub upgrade --major-versions
puby reset puby clean && puby get
puby relink puby clean && puby link
puby exec [command] command

For projects configured with FVM, fvm flutter is used. FVM support can be disabled with the --no-fvm option.

Use as an executable

Installation

$ dart pub global activate puby

Usage

$ 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.

This command no longer requires existing pubspec.lock files to function and instead uses the same version resolution strategy from the pub command to catalog dependencies.

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 repo:

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 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

exclude:
  - test
  - pub run build_runner

Exclusions match from the start of a command, and the entire exclusion string must be present. Here are some examples:

Exclusion Example command excluded
test [engine] test --coverage
pub run build_runner [engine] pub run build_runner build

puby's People

Contributors

rexios80 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

jimmytai

puby's Issues

Use args package

Implements the args package for better convenience command parsing and help command

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.