https://github.com/uber-workflow/usync
Sync subdirectories of a monorepo with external repos
https://github.com/uber-workflow/usync
git monorepo sync-files
Last synced: 4 months ago
JSON representation
Sync subdirectories of a monorepo with external repos
- Host: GitHub
- URL: https://github.com/uber-workflow/usync
- Owner: uber-workflow
- License: mit
- Created: 2019-08-14T00:24:37.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:54:47.000Z (almost 2 years ago)
- Last Synced: 2025-03-14T06:26:12.411Z (7 months ago)
- Topics: git, monorepo, sync-files
- Language: JavaScript
- Homepage:
- Size: 941 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# uSync
[](https://buildkite.com/uberopensource/usync)
[](https://codecov.io/gh/uber-workflow/usync)> 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**
```js
{
"$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
```sh
yarn add usyncit
```### Provide environment vars
`GH_TOKEN`
Used in the remote url when cloning repos (see docs on [customizing git](DOCS.md#gitconfigureopts)). Must be from an account that has write access to repos in your org.
### Use
```js
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](DOCS.md) for full usage info.
## License
[MIT](LICENSE)