0.2.0 • Published 4 years ago

usyncit v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

uSync

Build status codecov

Sync subdirectories of a monorepo with external repos

Setup your monorepo

Configuration for synced repos exists as a json file in the root of your monorepo; this allows your configuration to be versioned along with your code.

.usyncrc.json

{
  "$schema": "https://raw.githubusercontent.com/uber-workflow/usync/v0.0.1/schema/.usyncrc.json",
  "mapping": {
    // setup directory mappings per external repo
    "my-open-source-org/some-repo": {
      // sync `/projects/some-repo` with root of external repo
      "/projects/some-repo": "/"
    }
  }
}

Setup your server

Install

yarn add usyncit

Provide environment vars

GH_TOKEN

Used in the remote url when cloning repos (see docs on customizing git). Must be from an account that has write access to repos in your org.

Use

const {USync} = require('usyncit');

// provide parent monorepo name so it knows where to look
// for config and where to import into
const usync = new USync('myorg/monorepo');

yourImportWebhookHandler(async () => {
  await usync.import(...);
});

yourLandWebhookHandler(async () => {
  await usync.land(...);
});

See DOCS.md for full usage info.

License

MIT

0.2.0

4 years ago

0.1.0

5 years ago

0.0.1

5 years ago

0.0.1-3

5 years ago

0.0.1-2

5 years ago

0.0.1-1

5 years ago

0.0.1-0

5 years ago