项目作者: codeactual

项目描述 :
transplant exports a Go project out of a multi-project module into a standalone module.
高级语言: Go
项目地址: git://github.com/codeactual/transplant.git
创建时间: 2019-07-12T22:11:59Z
项目社区:https://github.com/codeactual/transplant

开源协议:Mozilla Public License 2.0

下载


transplant GoDoc Go Report Card Build Status

transplant exports a Go project out of a multi-project module into a standalone module.

The target use-case is the sharing of the project’s tags/releases from a private monorepo, ensuring that the standalone’s go.mod uses the exact same third-party dependencies as the origin and only bundles the minimum shared first-party dependencies.

Its CLI consists of two main commands:

  1. transplant export run: create/update the standalone copy
  2. transplant import run: propagate changes to the standalone copy’s local files back into the origin module

This repository itself was exported using transplant.yml as the config file. Below is the full command which relies on the support for variables in the config values.

  1. origin_module_filepath="/path/to/origin/module" \
  2. origin_local_filepath="tools/transplant" \
  3. copy_module_importpath="github.com/codeactual/transplant" \
  4. copy_module_filepath="/path/to/clone/of/this/repo" \
  5. transplant export run --op github

The above degree of parameterization is optional and all values can be self-contained in the config file.

Supports

  • Automatic copying of the target project and shared first-party dependencies from the origin.
  • Automatic pruning of unused globals/files from shared first-party dependencies.
  • Automatic go.mod/go.sum/vendor creation with versions synced with the origin.
  • Automatic rewriting of import paths and names.
  • Granular configuration of file include/exclude patterns, import paths, file renaming, source tree topologies, etc.

Documentation

Installation

  • Latest tag: go get github.com/codeactual/transplant/cmd/transplant
  • Latest commit: go get github.com/codeactual/transplant/cmd/transplant@master

License

Mozilla Public License Version 2.0 (About, FAQ)