metav1

tool for turning many repos into a meta repo. why choose many repos or a monolithic repo, when you can have both with a meta repo?

Usage no npm install needed!

<script type="module">
  import metav1 from 'https://cdn.skypack.dev/metav1';
</script>

README

Build Status npm version Latest Release Date

Dependency Status Dev Dependency Status

NPM downloads Contributors Gitter

meta

meta is a tool for managing multi-project systems and libraries. It answers the conundrum of choosing between a mono repo or many repos by saying "both", with a meta repo!

meta is powered by plugins that wrap common commands, letting you execute them against some or all of the repos in your solution at once. meta is built on loop, and as such inherits loops ability to easily target a particular set of directories for executing a common command (eg meta git status --include-only dir1,dir2. See loop for more available options).

getting started

installing

npm i -g meta will install a meta command on your system.

initializing

To create a new meta project:

  1. create a new directory for your meta project mkdir my-meta-repo
  2. initialize a new git repository in your new dir: cd my-meta-repo && git init
  3. initialize your new repository as a meta repo: meta init

meta will have created a .meta file to hold references to any child repositories you add.

  1. (a) to create a new project, use meta project create [folder] [repo url] (b) to import an existing project, use meta project import [folder] [repo url]

for each project added, meta will update your .gitignore file and the .meta file with references to the new child repo

asciicast

meta git clone

To clone an existing meta repo, you need only execute meta git clone [meta repo url]. meta will clone your meta repo and all child repositories at once.

asciicast

working with meta

Because meta plugins wrap common commands, you shouldn't have much new syntax to memorize for some crazy new utilities nobody knows about. For instance, if you want to check the git status of all your repositories at once, you can just type meta git status:

asciicast

View what branches exist on all your repos with meta git branch:

asciicast

Creating a new feature that cross-cuts a number of services, a site, and an API? Create new branches on all your repos at once with meta git checkout -b [branch-name]. Or, revert all modified files to their remote status with meta git checkout .:

asciicast

Track your progress on all branches at once with meta git status:

asciicast

Remove unwanted untracked files on all repos with meta git clean -fd:

asciicast

really working with meta

plugins

All meta functionality is contributed by plugins - node modules that begin with meta- and are either installed globally or in your meta repo's node_modules directory. We recommend you install them as devDependencies in your meta repo's package.json. Plugins add additional sub commands to meta, and can leverage loop or meta-loop to easily execute a common command against your meta repo and all child repos.

Here's how easy it is to install meta-npm as a plugin, and gain the ability to meta npm install all your repos at once:

asciicast

And if you prefer the speediness of yarn, try meta-yarn with npm install --save-dev meta-yarn:

asciicast

Why meta?

  • clone a many-project architecture in one line
  • give every engineer on your team the same project setup, regardless of where it's cloned
  • npm / yarn install against all your projects at once
  • execute arbitrary commands against many repos to manage your projects
  • super simple plugin architecture using commander.js
  • easily wrap commands for working with any platform, not just Node!
  • meta repo keeps code in per project repos, benefiting deployment and reuse
  • use the same tools you always use. no strange side effects of git submodules or subtree
  • give different teams different slices of your architecture, with multiple metarepos!

Available Plugins

Third-party Plugins

Available Templates

Want to help develop meta locally?

The best way to get started is to do the following:

npm i -g meta
meta git clone git@github.com:mateodelnorte/meta.git
cd ./meta
npm install
meta npm install
meta npm link --all
npm link

This will clone the meta project, meta, enter the directory, and then use meta to perform npm install, npm link --all in each directory listed in projects of the .meta JSON configuration file, and link meta itself to be used as a global command.

You can then write your command and test using ./bin/meta git gh [subcommand].

You can run the above as a single command:

meta git clone git@github.com:mateodelnorte/meta.git && cd ./meta && npm i && meta npm install && meta npm link --all && npm link

Yarn lovers can do the same:

npm i -g meta
meta git clone git@github.com:mateodelnorte/meta.git
cd ./meta
yarn
meta yarn install
meta yarn link --all
yarn link

Or

meta git clone git@github.com:mateodelnorte/meta.git && cd ./meta && yarn && meta yarn install && meta yarn link --all && yarn link

See discussion here for more details

More resources