Giter Club home page Giter Club logo

meta's Introduction

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

meta is packaged with a few of these core plugins by default: https://github.com/mateodelnorte/meta/blob/master/package.json#L63-L66

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!
  • use meta project migrate to migrate mono-repos to a meta repo consisting of many repos

getting started

installing

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

initializing a new meta project

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

You can now perform commands against all of the repositories that make up your meta repository by using meta exec.

For example, to list all of the files in each project:

meta exec "ls -la"

cloning an existing meta project

To clone an existing meta repo, rather than git clone like you are used to, simply execute meta git clone [meta repo url] instead. meta will clone your meta repo and all child repositories at once.

meta git clone [email protected]:mateodelnorte/meta.git

asciicast

Getting meta project updates

If you are working on a team and another members adds a project to the meta repository, to get the project, run meta git update.

# get new .meta file
git pull origin master

# clone missing projects
meta git update

working with meta

meta exec

The most basic way to interact with meta repositories is to use the meta exec command. This will let you run any command against the projects that make up your meta repo.

meta exec "git checkout master"

In many cases, that is enough. There are also special cases where the functionality provided by the initial tool wasn't quite meta-y enough, and for those, there are plugins.

Even meta-exec, itself is a plugin, but it comes with meta by default.

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

Going deeper - meta plugins are able to wrap common commands for a friendly user experience, such as meta npm install. They are also able to extend the native tool's capabilities. For example, git update is not a git command, but meta git update will clone any repos that exist in your .meta file that aren't cloned locally - a problem that doesn't exist with a single git repo.

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

In the case a command has not been wrapped with a plugin, just use meta exec instead.

Available Plugins

Third-party Plugins

Available Templates

Usage Scenarios

Product Development Team

Your product consists of multiple applications and services. As the project lead, you can use meta to group together the projects so every developer is able to meta git clone a single project to get everything they need for development.

Furthermore, you could add a docker-compose file at this root level to run all of the services and applications:

version: '3.7'

services:

  app1:
    image: app1
    build:
      context: projects/app1
    ports:
    - 1234:1234
    env_file: projects/app1/.env

  app2:
    image: app2
    build:
      context: projects/app2
    ports:
    - 1234:1234
    env_file: projects/app2/.env

  service1:
    image: service1
    build:
      context: projects/service1
    ports:
    - 1236:1234
    env_file: projects/service1/.env

  service1:
    image: service1
    build:
      context: src/service2
    ports:
    - 1237:1234
    env_file: src/service2/.env

The meta repo is a good place for things like this, including scripts and a Makefile that are responsible for meta things, like gettings secrets for each project, like .env files for local development.

Take this example Makefile at the root of a meta repo:

onboard:
	meta exec "make setup"

setup: install-tools get-secrets

install-tools:
  echo "add install scripts here"

get-secrets:
	echo "get secrets via SOPS/Vault/however and cp into appropriate projects"

The command make onboard would start the setup task in the root and all of the child directories.

Each project can then contain a Makefile like so:

setup:
  npm ci
  npm run dev

To get new projects up and running you can give them the instructions:

meta git clone [email protected]/yourorg/metaproject
cd metaproject
make onboard

And they would have a fully running dev environment.

Developing a Library with many modules

Meta itself is developed with meta. This way you have a monorepo like feel while developing, but with individual components with their own release cycles.

It takes advantage of npm link, just like tools like Lerna do.

Using meta npm link && meta npm link --all enables a good development experience by creating symlinks so each project uses the development version of any other project in the meta repo:

# install meta
npm i -g meta

# clone and enter the meta repo
meta git clone [email protected]:mateodelnorte/meta.git
cd ./meta

# install plugins
npm install

# run install for all child repos
meta npm install

# create symlinks to/from all child repos
meta npm link --all

# link meta itself globally
npm link

There is admittedly now the problem of updating each repository to use the newly published versions of each other. For this, we recommend using a tool like Renovate, Dependabot, or Greenkeeper.

See this article for an example: Bring In The Bots, And Let Them Maintain Our Code!

Migrating a Monorepo to many repos

'meta project migrate' helps you move from a monorepo to a meta repo by moving directories from your existing repo into separate child repos, with git history intact. These are then referenced in your '.meta' file and cloned, making the operation transparent to your codebase.

For example, given the following monorepo structure:

- monorepo-base
  - project-a
  - project-b
  - project-c

Create git repos for project-a, project-b, and project-c, then run:

cd monorepo-base
meta init
meta project migrate project-a [email protected]/yourorg/project-a
meta project migrate project-b [email protected]/yourorg/project-b
meta project migrate project-c [email protected]/yourorg/project-c

This will keep the git history of each subproject in tact, using some git magic:

How it works

  1. Migrate will first create a copy of your project in a temporary directory and replace the remote 'origin' with the provided
  2. It will split the history from and push to the provided : https://help.github.com/en/articles/splitting-a-subfolder-out-into-a-new-repository
  3. Next is removed from your monorepo, and then cloned back into the same location.

In the eyes of the monorepo, the only thing that has changed is the .meta file, however, now also has it's own distinct history.

Migration Phase

If you need the monorepos structure to stay in tact for any extended duration, such as supporting legacy CI systems, you can stop here.

While in this 'migration' phase, you need to commit to the child directory's git history as well as the monorepo's git history. These commits can literally be made twice by cd-ing around or both can be made at once using 'meta git commit'.

Finishing the Migration

When the monorepo no longer needs to be maintained you can simply add the migrated project to your '.gitignore'.

This will cause changes to only be tracked in the child repo, rather than both, such as during the migration phase.

FAQs

How can I create a group of repositories, to, for example, run npm install on only node projects?

There are two ways to do this:

  1. Meta repos can contain other meta repos. Make smaller groups of repos that only contain projects with commands that will be executed together. This is commonly not an option such as in migrating legacy monorepos.
  2. Use a Makefile to declare the groups, and use make commands:
NODE_APPS=app1,service1,app2,service2

node-install:
	meta npm install --include-only $(NODE_APPS)

Then you can run make node-install

Can I run things in parallel?

Yes.

meta exec "npm ci" --parallel

Output is even grouped nicely together for you at the end! :)

How to escape expressions

If you try to evaluate an expression run in meta exec, you'll notice that the expression is evaluated before being run in the target projects.

➜  meta exec "echo `pwd`" --include-only=plugins/meta-loop

plugins/meta-loop:
/Users/patrickleet/dev/mateodelnorte/meta
plugins/meta-loop ✓

In these cases, simply escape the expression so that it is not executed until being run against each project rather than ahead of time:

➜  meta exec "echo \`pwd\`" --include-only=plugins/meta-loop

plugins/meta-loop:
/Users/patrickleet/dev/mateodelnorte/meta/plugins/meta-loop
plugins/meta-loop ✓

Or...

➜  meta exec "echo \$(pwd)" --include-only=plugins/meta-loop 

plugins/meta-loop:
/Users/patrickleet/dev/mateodelnorte/meta/plugins/meta-loop
plugins/meta-loop ✓

Developing meta locally

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

npm i -g meta
meta git clone [email protected]: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 [email protected]: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 [email protected]:mateodelnorte/meta.git
cd ./meta
yarn
meta yarn install
meta yarn link --all
yarn link

Or

meta git clone [email protected]:mateodelnorte/meta.git && cd ./meta && yarn && meta yarn install && meta yarn link --all && yarn link

See discussion here for more details

More resources

meta's People

Contributors

aleclarson avatar allain avatar fluxsauce avatar maniator avatar mateodelnorte avatar myles avatar patrickleet avatar patrykzurawik avatar renovate-bot avatar renovate[bot] avatar sidps avatar

Stargazers

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

Watchers

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

meta's Issues

Convert submodules to meta?

Hi!

Often I get detached HEADs when working with submodules in a meta project (which is immense pain).

How can I move from submodules to meta? I want to work in a single project root and split commits into their own module-repo's.

Thank you.

Cannot seem to run meta when not a global module

When trying to run meta from local npm modules you get this:

git:(meta)$ ./node_modules/.bin/meta
{ Error: ENOENT: no such file or directory, scandir '/projectName/node_modules/meta/node_modules'
    at Error (native)
    at Object.fs.readdirSync (fs.js:951:18)
    at module.exports.error (/projectName/node_modules/meta/lib/listDirectories.js:32:28)
    at Object.<anonymous> (/projectName/node_modules/meta/bin/meta:13:14)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/projectName/node_modules/meta/node_modules' }

Is there anything that could be done about that or it has to be run globally?

Same thing happens if you run meta out of an npm package script.

meta/commander.js is not downloadable

if i use this library behind proxy, where npm registry is some sort of artifactory I can not install meta via
npm install meta -g because there is some script that is loaded from github not from registry.

npm install meta -g
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\mingw64\bin\git.EXE ls-remote -h -t ssh://[email protected]/mateodelnorte/commander.js.git
npm ERR!
npm ERR! ssh: connect to host github.com port 22: Connection refused
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users...\\2018-10-01T07_15_23_818Z-debug.log

Consider putting commander.js as npm package instead so that everyone behind proxy can also use your meta tool.

advice around https vs ssh for repo additions

Right now, I've got this working wonderfully if I add projects using https. But, I use bitbucket and the url is something of the form: https://[email protected]/organization/repo.git

I'd like to force my development staff to use this if possible, but they'd all have to change the username in the .meta;

I did get it to work with ssh when I added the project with the format [email protected]:organization/repo.git but it was challenging to say the least and I had ssh whining at me for quite a bit.

Perhaps I'm just ignorant to an easier way. Perhaps I should just write a script that's inside my metarepo; But I'm very fond of just using meta git clone metarepourl to clone everything. If I had to script the updation of the .meta file to hot-swap the end-users username, it wouldn't work etc..

Perhaps you can point me to some best practice around using this in teams?

For what it's worth, I'd love to figure this out and help you document the add project module a bit more; It was hard to tell if I just entered the repo wrong, or it was an ssh problem etc...

Use meta on itself

It would be cool to have meta-init, meta-project, meta-git, etc in this repository as Meta child repos.

edit: Oh and loop too, since it's so vital to Meta.

No errors on invalid commands

Using an unsupported command yields no output and a successful exit code.
I think it should write an error message, and certainly not return 0.

Some example cases (the 0 in my prompt is the exit code of the last command):

# calling meta with a random word
   0[quezak@...]...$ meta asdf
# calling meta git with a random word
   0[quezak@...]...$ meta git asdf
# calling meta git with an alias to git status (in my ~/.gitconfig) -- shouldn't this produce same output as meta git status?
   0[quezak@...]...$ meta git s
   0[quezak@...]...$

windows has trouble chaining git style subcommands

This is likely happening because npm is wrapping bin files in .cmd files.

C:\Program Files (x86)\Nodist\v-x64\6.9.1\node_modules\meta\node_modules\.bin\meta-git:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^
SyntaxError: missing ) after argument list
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

document using .js format with `module.exports =` for .meta file

some companies enforce https-only usage of their source control systems. this causes the repository urls to essentially have a username variable in their signature.

the following will work perfectly well, in a .meta file, but for now meta project add will not know how to add projects to it.

module.exports = {
  "projects": {
    "project1": `https://${process.env.USERNAME}@stash.mycompany.com/gedtwo/project1.git`,
    "project2": `https://${process.env.USERNAME}@stash.mycompany.com/gedtwo/project2.git`
  }
}

this issue is a placeholder to documentation for this capability.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

origin refspec doesn't work when pushing new branch to remote

If I create new branches via meta git checkout -b new_branch, the new branches cannot be pushed as I would expect via meta git push -u origin new_branch, with each execution in the child directories failing with error: src refspec origin does not match any.

If I manually cd into the directories and execute the command or execute it via loop "git push -u origin new_branch" it works as expected. After the new branches are present in the remote repository, meta git push works as expected.

meta init

I ran touch .meta, then needed package.

/Users/thomas/.nvm/versions/node/v7.2.1/lib/node_modules/meta/node_modules/meta-git/bin/meta-git-clone:51
  const projects = meta.projects;
                       ^

TypeError: Cannot read property 'projects' of null
    at exec (/Users/thomas/.nvm/versions/node/v7.2.1/lib/node_modules/meta/node_modules/meta-git/bin/meta-git-clone:51:24)
    at module.exports (/Users/thomas/.nvm/versions/node/v7.2.1/lib/node_modules/meta/node_modules/meta-exec/index.js:54:18)
    at Object.<anonymous> (/Users/thomas/.nvm/versions/node/v7.2.1/lib/node_modules/meta/node_modules/meta-git/bin/meta-git-clone:21:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:420:7)

Yarn warns about package-lock.json

While running yarn in a local clone:

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

$ yarn --version
1.12.3

npm5 breaks plugin model

because npm5 flattens dependencies so much, meta plugins may not have their own node_modules folder and therefore may break when running one of their executables

is there a feature where you can meta git checkout <sha#>

is there a meta git checkout feature?
e.g. meta git checkout <sha#>

Doing that will checkout that <sha#> in one of the repos. It will change all the other repos to be checkedout to the latest commit at that time of that <sha#>.

The reason for this feature is that some people prefer mono repos over multi repos because they get a snapshot of the whole stack when they checkout a <sha#>. So this will cover that scenario.

Thanks!

Feature Request: path to repository

TL;DR Add property to .meta configuration to specify a local path to each project.


I just found this project and I'm really intrigued with integrating it into my development workflow. The problem I find is that I have a ton of existing repos with various stashes and remotes added to each. I could just make a meta project in the root of all my sub-projects but if I wanted to have multiple meta configs for different project groupings I would not be able to. And while I think there's merit to doing a little fall cleaning on all these, I'd love to be able to use meta without a huge change to environment vars and scripts I have for various command line tools.

Additionally, there are certain languages *cough go-lang cough* that have a specific directory that they need to live in. Sure there are ways around it but there can be weird side-effects to this.

As a user of meta I'd like to be able to edit the .meta JSON to include a local path to each git repo so I may store them where I please.

Discover organisation scoped plugins

I'm currently working on a meta plugin I'd like to publish as @thing-it/meta-devtools. The current plugin discovery does not find this as it does not look for ^meta-.* directories inside organization scope directories.

In the long term, this may generally help to avoid NPM name clashes in the global scope.

I'm glad to work on a PR but would like to quickly gather some feedback if this is something you'd like to add.

meta fails on first run

getting the following on first run, after a new install

meta
TypeError: Cannot read property 'split' of undefined
    at module.exports (/Users/matt/n/lib/node_modules/meta/lib/findPlugins.js:33:25)
    at Object.exports.run (/Users/matt/n/lib/node_modules/meta/index.js:24:23)
    at Object.<anonymous> (/Users/matt/n/lib/node_modules/meta/bin/meta:8:15)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)

Running any subcommand throws SyntaxError on Windows

Running any subcommand throws a SyntaxError on Windows:

$ meta git clone [email protected]:mateodelnorte/meta.git
C:\Users\Andreeib\AppData\Roaming\npm\node_modules\meta\node_modules\.bin\meta-git.cmd:1
(function (exports, require, module, __filename, __dirname) { @IF EXIST "%~dp0\node.exe" (
                                                              ^

SyntaxError: Invalid or unexpected token
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:607:28)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
$ node -v
v8.11.1

$ npm -v
5.8.0

If I replace this line:
https://github.com/mateodelnorte/commander.js/blob/245bc4c84ba72d447ab30ec3e2a4456e34052b59/index.js#L576
with:
proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });
it works.

In windows the npm bin is a batch file and not JavaScript.

meta-git-clone.cmd
@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe"  "%~dp0\..\meta-git\bin\meta-git-clone" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node  "%~dp0\..\meta-git\bin\meta-git-clone" %*
)

meta init command

It'd be great if there were a meta init command that could be used to bootstrap your meta setup.

At a minimum it should create a .meta file, with the basic JSON structure.

How to do code sharing and CI/CD?

Don't know if this is the place to ask.
But I would like to know how to do code sharing.

My project consist out of three microservices (NodeJS). I set up CI/CD on GitLab that builds the a microservice on change and pushes it into a cluster. These microservices have shared code, like database-models, policy-rules etc.

What's the best way to set this up? I was thinking about building the meta-project, but this makes CI/CD pretty complicated I think.

Maybe checkout the repo's in the build-fase? or use npm-modules? Or maybe a meta-project in a meta-project?

Any help is welcome, thanks!

[Question] Tagging Repositories

Dear @mateodelnorte ,

i am currently evaluating this package for future use in my projects as i want to provide an easy to maintain approach for splitting up my packages into different modules and then building it all together.

I have a question, which i as not able to answer so far:
Is it possible to tag all sub-packages from the main repository? e.g., if i release a new version of my main application, can i tag all sub-packages at the same time?

Consider the following example:
I will release a 2.0.0 version of my main application and, therefore, adapt all my other packages. However, i would like to automatically tag them as well with 2.0.0 to have a consistent state across my overall application.

Is this possible? If yes, how?
All the best

projects property unreadable from .meta file

Hi, I ran a command meta git pull, it pulled the newly created child repo, fixed conflicts and staged changes, but when i run command meta git status, the following error is thrown
`TypeError: Cannot read property 'projects' of null
at module.exports (/Users/embrace/.nvm/versions/node/v8.11.3/lib/node_modules/meta/node_modules/meta-git/node_modules/meta-loop/index.js:13:25)
at Object. (/Users/embrace/.nvm/versions/node/v8.11.3/lib/node_modules/meta/node_modules/meta-git/bin/meta-git-branch:25:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
here is my meta file defintion
{
"projects": {
"auth": "path to repo",
"chat": "path to repo",
"groupchat": "path to repo"
}
}

what's going on here?

meta yarn install

I may be misunderstanding things but when I ran meta project add <folder> <repo> it created an empty folder with the folder name I specified. I assumed it would contain the files/folders from the repo but it didn't so I tried meta yarn install and nothing improved.

I then tried meta yarn clean which removed the meta project node_modules and re-tried meta yarn install but it did nothing, in fact it didn't even install the meta project node_modules.

Where am I going wrong here?

I have:

node 8.9.4
yarn 1.3.2
meta 1.0.48
meta-yarn ^0.0.4

Please provide an integration with automated build servers?

Fixed the question:

Feature request:
Hello,
As a user, I would like to please have a way to automate nightly builds for the source depending on meta tool so that

  1. I don't have to create separate scripts that clone my code using meta
  2. The build system knows when to clone based on the changes done in code
  3. The tags are applied to the specific repositories on successful completion of a build and test.

Description:

  1. Our repositories are hosted on our private bitbucket server.
  2. We have docker containers in local registry as build slaves.
  3. We have a scenario, when the code from one repository is needed inside another repository to build a single binary. (the code is directly compiled from the sub-repository along with the code from the top-repository). I know this is not an ideal solution, but this is the requirement at present.

I wanted to use meta to be able to maintain the sub-repository without the developers bothering about cloning each repo separately etc. Meta is very good at that.
But to tell jenkins what to build (without cloning/pulling the repositories through scripts) and to track/list code changes in a build, I guess I need a plugin.

Can we convert the es6 to es5?

Can we babelify meta (or buble or something) to make the es6 code into es5 for library -- otherwise the lib doesnt work for older versions of node.

zsh git shortcuts

Hello @mateodelnorte ,

Amazing repo! Love it so far. Quick question, doubtful this is code that should live in your repo, but do you know of a way to make my zsh aliases work?

for instance, git s for me equals git status - just shorter; I have like 20 other shortcuts that I love to use and I want to use them prefixed with meta so I can perform said operations on all my sub repos at once.

Perhaps you can just point me in the right direction?

sudo npm i -g meta fails to install

Here's the log:
2018-02-05T18_26_42_802Z-debug.log

I'm able to git clone that repo without problems so not sure what the error msg about permission is about.

I made this edit to the package.json and it was able to install (Note: I am a novice to npm, so not sure this is the correct fix but it helped me move forward).

diff --git a/package.json b/package.json
index d6e8f1b..26edcee 100644
--- a/package.json
+++ b/package.json
@@ -33,7 +33,7 @@
   "homepage": "https://github.com/mateodelnorte/meta#readme",
   "dependencies": {
     "chalk": "^2.1.0",
-    "commander": "mateodelnorte/commander.js",
+    "commander": "https://github.com/mateodelnorte/commander.js/archive/v2.9.0.tar.gz",
     "cross-env": "^3.1.4",
     "debug": "^2.3.3",
     "findup-sync": "^1.0.0",

meta attach

Setting up meta is currently a manual process.

A meta attach command would automate adding projects to the .meta file, as well as .gitignore

Use folder name in "meta exec"

Is there a way to get the current folder name, when running a command via meta exec?

Here's a concrete example of what I'm hoping to accomplish (although, I could foresee a handful of other scenarios where this might be useful):

We have a meta-repo, containing a .meta file with a bunch of other projects that all depend on each other. These sub-repos contain .NET Standard projects, and I would like run a command to compile and publish (to a local feed) each project one-by-one.

For example...

rmdir %USERPROFILE%/.nuget/packages/<name-of-project> /s /q
dotnet pack src/<name-of-project>/<name-of-project>.csproj --configuration Release --output package
nuget push -Source %USERPROFILE%/.nuget/packages/ src/<name-of-project>/package/<name-of-project>.<version>.nupkg

Due to the folder structure we have in place, the command that I'm running changes depending on which project I'm building, if that makes sense.

meta git pull...

... fails, even on public project. What i did i initialized meta then i added some repos using meta project add [name][repo] and after meta git pull i see "

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
[name]: command 'git pull ' exited with error: Error: Command failed: git pull

And its not repo specific issue, i tried my own repos, open source plugins its always like that.

semantic-release

with travis-deploy-once - maybe something changed and env vars don't get passed through..

Error: The GitHub user of the "GH_TOKEN" has not authenticated Travis CI yet. Go to https://travis-ci.com/, login with the GitHub user of this token and then restart this job.
    at module.exports (/home/travis/.nvm/versions/node/v11.4.0/lib/node_modules/travis-deploy-once/lib/get-jobs.js:35:13)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)

using just semantic-release works but doesn't wait for all builds to pass, and triggers the release process multiple times (they fail after the first one).

Also the version calculated is incorrect, so gotta add some tags to this repo to fix..

Issue using dot notation in project name

Running into problems when trying to add project in meta project that is with dot notation.

valdestrijus@DESKTOP-9LG90J8 MINGW64 /c/www/platform.meta (master)
$ meta project add platform.app [email protected]:1337homework/platform.app.git
meta project adding '[email protected]:1337homework/platform.app.git' at platform.app
created C:\www\platform.meta\platform.app
Initialized empty Git repository in C:/www/platform.meta/platform.app/.git/
set remote origin to [email protected]:1337homework/platform.app.git
adding "platform.app": "[email protected]:1337homework/platform.app.git" to .meta file at C:\www\platform.meta\.meta
adding platform.app to .gitignore at C:\www\platform.gitignore\.meta
C:\www\platform.gitignore\.meta does not exists. Creating it now.
fs.js:646
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open 'C:\www\platform.gitignore\.meta'

Better ergonomics for scripts

Hello!

I've been using your project to manage about 150 repos and I've been loving it. I've had a few pain points, but one is that many of my meta exec statements only apply to a few repositories. For example, I'll do something like this:

script.sh

if ! [ -a .meta ]; then
  BRANCH=$(git remote show origin | grep "HEAD branch" | sed "s/.*: //")
  git fetch origin
  git checkout $BRANCH
  git reset --hard origin/$BRANCH
  git clean -fdx
  if [ -a package.json ] && ! [ -a .gitignore ]; then
    echo 'node_modules' > .gitignore
    git add .gitignore
    git commit -S -m 'Add .gitignore to ignore node_modules'
    git push origin $BRANCH
  fi
fi
meta exec "$(< script.sh)"

Here are my pain points:

  • I'll often want to exclude the meta repo, and this seems better suited to a CLI flag than if ! [ -a .meta ]
  • I only want to run commands on repos with package.json, but I get output from all repos -- it would be great if repos without any stdout just didn't show up at all
  • I personally don't mind the shell command above, but meta exec -f script.sh might be more ergonomic

Thanks for your work on this project, I'm loving it!

global install of meta-<plugin> is not recognized in Windows.

Example:

npm i -g meta-npm
 .
 .
 .
+ [email protected]
added 282 packages in 17.005s
meta

  Usage: meta [options] [command]

  Options:

    -V, --version  output the version number
    -h, --help     output usage information

  Commands:

    git            manage your meta repo and child git repositories
    init           initialize a new meta repo
    exec|loop      execute a command against meta repo and child repo dirs
    project        add & remove child repositories
    help [cmd]     display help for [cmd]

as you can see... no npm command available.

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.