0.6.6 • Published 2 years ago

indo v0.6.6

Weekly downloads
144
License
MIT
Repository
github
Last release
2 years ago

indo

Workspaces where each package has its own commit history.

Setup your monorepo with one command:

npx indo

Synopsis

Monorepos are great for keeping a bundle of packages tied together by a commit history, but sometimes a package needs (or already has) its own commit history. For example, you might be developing a fork of someone else's package. Indo lets you choose which packages deserve their own commit history. Just run git clone and Indo will notice. Note: Be sure to add your clones to .gitignore to avoid git submodules (which are not supported by Indo).

Indo automatically searches your monorepo for package.json files, which means it can be used with zero setup. The indo command will (1) create the .indo.json if none is found, (2) clone any missing repos, (3) install dependencies, (4) run build scripts, and (5) link local packages together.

Fun facts:

  • Indo never hoists dependencies
  • Indo plays nicely with Yarn workspaces
  • Indo makes forking a breeze

 

Guides

 

Commands

indo

Run this command to bootstrap your Indo-powered monorepo, which involves cloning any missing repos, installing any dependencies, and linking together your local packages.

Specify -f/--force to see which packages are linked where. Otherwise, only newly linked packages are printed.

Note: Packages are ignored when no version exists in their package.json.

 

indo help

Print documentation for a specific command.

# What does "indo clone" do?
indo clone help

Aliases: -h, --help

 

indo clone

Shallow clone a repository and add it to "repos" in the nearest .indo.json config.

You can even provide a package name instead of a git url! For example, indo clone lodash asks npm for the git url and clones it into vendor/lodash by default. You can also pass an optional directory name (eg: indo clone lodash a/b/c).

 

indo link

Link a global package to the ./vendor/ directory, and link it to packages that can use it.

indo link lodash

However, before you can do that, you must call indo link in your lodash clone.

# Clone "lodash" outside your monorepo.
git clone https://github.com/lodash/lodash.git ~/dev/lodash
cd ~/dev/lodash

# Add it to Indo's global package registry.
indo link

It's basically yarn link except with automatic linking to packages in your monorepo. 😻

For a monorepo whose root package is unnamed, use indo link -g <name> to register it globally. Then use indo link <name> to link your local packages to it.

 

indo unlink

Remove the current package from Indo's global package registry.

indo unlink

To revert indo link <name> commands, run indo unlink <name> and the given package names will be removed from the ./vendor/ directory (but only if they were added with indo link).

indo unlink lodash

 

indo add

Add dependencies to the current package, using its preferred npm client (eg: yarn or pnpm).

After installing, the dependency is replaced with a local package if possible.

indo add lodash

Supported flags:

  • --prod (enabled by default)
  • -P/--peer
  • -D/--dev
  • -O/--optional
  • -E/--exact

 

indo remove

Remove dependencies from the current package, using its preferred npm client.

indo remove lodash

Aliases: rm

 

indo list

See which packages are detected by Indo.

indo list

Aliases: ls

 

indo run

Run a npm script in every non-vendor package.

indo run build

 

indo exec

Run an arbitrary command in every non-vendor package.

Note: Piping is not yet supported.

indo exec -- echo \$PACKAGE_NAME

Injected variables include:

  • PACKAGE_NAME
  • PACKAGE_ROOT

 

indo git

Run a git command in every .git repo containing a non-vendor package.

Note: Your customized git aliases are supported!

indo git status

 

indo purge

Remove one or more packages, cleaning up .indo.json along the way.

For example, indo purge foo bar removes the ./foo and ./bar directories (relative to the current directory) from the filesystem and from the nearest .indo.json file.

The given directories are not required to contain a package.json. For example, you can do indo rm packages to delete the entire packages directory, which may contain dozens of repos, each with its own package.json. Indo re-installs the dependencies of any non-vendor package that was linked to a removed package.

It's basically rm -rf but with:

  • a confirmation prompt
  • automatic updates to the nearest .indo.json file
  • an install step for depending packages

 

indo init

Create an empty .indo.json file in the current directory, replacing any pre-existing .indo.json file.

The indo command automatically invokes this command when neither the current directory nor any of its ancestors contain a .indo.json file.

0.6.6

2 years ago

0.6.5

2 years ago

0.6.4

3 years ago

0.6.3

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.4.5

3 years ago

0.4.6

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.4.1

3 years ago

0.4.2

3 years ago

0.4.0-2

3 years ago

0.4.0

3 years ago

0.4.0-1

3 years ago

0.4.0-0

3 years ago

0.3.42

3 years ago

0.3.41

3 years ago

0.3.40

3 years ago

0.3.39

3 years ago

0.3.38

3 years ago

0.3.37

3 years ago

0.3.36

4 years ago

0.3.35

4 years ago

0.3.34

4 years ago

0.3.33

4 years ago

0.3.32

4 years ago

0.3.31

4 years ago

0.3.30

4 years ago

0.3.29

4 years ago

0.3.28

4 years ago

0.3.27

4 years ago

0.3.26

4 years ago

0.3.25

4 years ago

0.3.24

4 years ago

0.3.23

4 years ago

0.3.22

4 years ago

0.3.21

4 years ago

0.3.20

4 years ago

0.3.19

4 years ago

0.3.18

4 years ago

0.3.17

4 years ago

0.3.16

4 years ago

0.3.15

4 years ago

0.3.14

4 years ago

0.3.13

4 years ago

0.3.12

4 years ago

0.3.11

4 years ago

0.3.10

4 years ago

0.3.9

4 years ago

0.3.8

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.15

5 years ago

0.2.14

5 years ago

0.2.13

5 years ago

0.2.12

5 years ago

0.2.11

5 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.0

5 years ago