{"id":25602162,"url":"https://github.com/rajvarsani/repoverse","last_synced_at":"2025-04-13T08:26:31.540Z","repository":{"id":213494482,"uuid":"734248920","full_name":"RajVarsani/repoverse","owner":"RajVarsani","description":"Tool for code synchronization across multiple repositories in distributed systems and microservices","archived":false,"fork":false,"pushed_at":"2023-12-27T12:10:55.000Z","size":343,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T08:26:25.183Z","etag":null,"topics":["code-synchronization","github-actions","octokit","repo-sync","repository-synchronization","synchronization"],"latest_commit_sha":null,"homepage":"https://npmjs.com/repoverse","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RajVarsani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-21T08:15:48.000Z","updated_at":"2024-01-03T11:45:07.000Z","dependencies_parsed_at":"2023-12-23T12:37:45.391Z","dependency_job_id":"7a5b93d8-3740-4ce6-a6d4-b9f08dd0e486","html_url":"https://github.com/RajVarsani/repoverse","commit_stats":null,"previous_names":["rajvarsani/repo-sync","rajvarsani/repoverse"],"tags_count":8,"template":false,"template_full_name":"ryansonshine/typescript-npm-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RajVarsani%2Frepoverse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RajVarsani%2Frepoverse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RajVarsani%2Frepoverse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RajVarsani%2Frepoverse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RajVarsani","download_url":"https://codeload.github.com/RajVarsani/repoverse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248682878,"owners_count":21144839,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-synchronization","github-actions","octokit","repo-sync","repository-synchronization","synchronization"],"created_at":"2025-02-21T16:48:25.985Z","updated_at":"2025-04-13T08:26:31.520Z","avatar_url":"https://github.com/RajVarsani.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Repoverse** ![version](https://img.shields.io/badge/version-1.0.0-blue) ![license](https://img.shields.io/badge/license-MIT-green)\n\n## 📖 Table of Contents\n\n- [**Repoverse** ](#repoverse--)\n  - [📖 Table of Contents](#-table-of-contents)\n  - [🌐 Overview](#-overview)\n  - [⭐ Key Features](#-key-features)\n  - [📚 Prerequisites](#-prerequisites)\n  - [⚙️ Configuration](#️-configuration)\n  - [📦 Installation](#-installation)\n  - [🚀 Usage](#-usage)\n    - [As a GitHub Action](#as-a-github-action)\n    - [Programmatically in Your Code](#programmatically-in-your-code)\n  - [🔄 Workflow](#-workflow)\n  - [🤝 Contributing](#-contributing)\n  - [📄 License](#-license)\n\n## 🌐 Overview\n\n`Repoverse` automates code synchronization across multiple repositories by propagation of relevant commits, ensuring consistency and saving you time. It's most suitable for distributed systems and microservices where some part of the code needs to be synced.\n\n## ⭐ Key Features\n\n- **Automated synchronization**: Propagates commits across all configured repositories, keeping them up-to-date.\n- **Flexible usage**: Works as a GitHub Action or directly in your Node.js applications.\n- **Precise control**: Synchronize specific paths and branches within repositories.\n- **Seamless integration**: Integrates effortlessly into your development workflows.\n- **Collaborative synchronization**: Raises pull requests for review and approval, ensuring code quality and alignment.\n\n## 📚 Prerequisites\n\n- Node.js (version 14 or higher)\n- npm (or another package manager)\n- A GitHub personal access token with access to all the repositories\n\n## ⚙️ Configuration\n\nRepoverse requires a configuration object to specify the repositories to sync and other settings. Here's an example:\n\n```JSON\n{\n  \"repositories\": [\n    {\n      \"owner\": \"example-user\",\n      \"repo\": \"repo-to-sync-1\",\n      \"path\": \"models/\",\n      \"branch\": \"dev\",\n      \"reviewers\": [\"Maintainer1\"]\n    },\n    {\n      \"owner\": \"example-user\",\n      \"repo\": \"repo-to-sync-2\",\n      \"path\": \"models/\",\n      \"branch\": \"dev\",\n      \"reviewers\": [\"Maintainer2\"]\n    }\n  ],\n  \"syncBranchPrefix\": \"sync-branch\",\n  \"accessToken\": \"ghp_YourGitHubPersonalAccessTokenHere\"\n}\n```\n\n## 📦 Installation\n\nTo install `repoverse`, run the following command:\n\n```bash\nnpm install repoverse\n```\n\n## 🚀 Usage\n\n`repoverse` can be used in two different ways:\n\n### As a GitHub Action\n\nAutomate synchronization based on GitHub push events:\n\n- Create a workflow file (e.g., `.github/workflows/sync.yml`) in your repository.\n- Define the workflow, including triggers, jobs, and steps.\n- Use the `repoverse` action within your job to perform synchronization.\n\nExample workflow:\n\n- Make sure that the `REPOVERSE_CONFIG` secret is created in your repository's settings, containing the synchronization configuration in `JSON` format.\n\n```yaml\nname: Repository Sync\n\non:\n  push:\n    branches:\n      - dev\n    paths:\n      - 'path/to/sync/**'\n\njobs:\n  repoverse:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/setup-node@v1\n        with:\n          node-version: '20'\n      - run: npm install repoverse\n      - name: Run repoverse synchronization\n        env:\n          REPOVERSE_CONFIG: ${{ secrets.REPOVERSE_CONFIG }}\n          COMMITS: ${{ toJson(github.event.commits) }}\n          REPOSITORY: ${{ github.repository }}\n        run: |\n          echo \"Running repoverse synchronization...\"\n          node -e \"\n            const Repoverse = require('repoverse');\n            const config = JSON.parse(process.env.REPOVERSE_CONFIG);\n            const repoverse = new Repoverse(config);\n            const commits = JSON.parse(process.env.COMMITS); \n            const repository = process.env.REPOSITORY;\n\n            repoverse.synchronize(repository, commits)\n              .then(() =\u003e console.log('Repositories synchronized successfully'))\n              .catch(error =\u003e console.error('Synchronization failed:', error));\n          \"\n```\n\n### Programmatically in Your Code\n\nSynchronize code on-demand or with more control:\n\n- Import the Repoverse module in your Node.js application.\n- Create a configuration object specifying repositories and settings.\n- Instantiate a Repoverse instance with the configuration.\n- Use the synchronize method to trigger synchronization.\n\n```javascript\nconst Repoverse = require('repoverse');\n\n// Construct a configuration object for your repositories and settings\nconst config = {\n  // your config here\n};\n\nconst repoverse = new Repoverse(config);\n\n// Source repository should be in the 'owner/repo' format and present in the config's repositories list\nconst sourceRepo = 'your-organization/source-repo';\nconst commits = [\n  // Your array of commit objects to synchronize\n  {\n    author: {\n      email: 'author@example.com',\n      name: 'Author Name',\n      username: 'authorusername',\n    },\n    committer: {\n      email: 'committer@example.com',\n      name: 'Committer Name',\n      username: 'committerusername',\n    },\n    distinct: true,\n    id: 'def1234567890abcdef1234567890abcdef',\n    message: 'Update models',\n    timestamp: '2023-04-14T13:34:56Z',\n    tree_id: 'def123456abc7890def123456abc7890def12345',\n    url: 'https://github.com/example-user/repo-to-sync-1/commit/def1234567890abcdef1234567890abcdef',\n  },\n];\n\nrepoverse\n  .synchronize(sourceRepo, commits)\n  .then(() =\u003e console.log('Synchronization successful'))\n  .catch(error =\u003e console.error('Synchronization failed:', error));\n```\n\n## 🔄 Workflow\n\n- Repoverse identifies changes in a source repository(one of the repo in config).\n- Creates corresponding branches (prefixed with a configured value) in target(reamining) repositories.\n- Applies the changes to those branches and commits them.\n- Raises pull requests in the target repositories, inviting review and approval before merging.\n\n## 🤝 Contributing\n\nContributions to `repoverse` are highly encouraged! If you have a suggestion, fix, or enhancement, please open an issue or a pull request. Help us make repository synchronization seamless for developers.\n\n## 📄 License\n\nRepoverse is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajvarsani%2Frepoverse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajvarsani%2Frepoverse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajvarsani%2Frepoverse/lists"}