transplant exports a Go project out of a multi-project module into a standalone module.
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:
transplant export run
: create/update the standalone copytransplant import run
: propagate changes to the standalone copy’s local files back into the origin moduleThis 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.
origin_module_filepath="/path/to/origin/module" \
origin_local_filepath="tools/transplant" \
copy_module_importpath="github.com/codeactual/transplant" \
copy_module_filepath="/path/to/clone/of/this/repo" \
transplant export run --op github
The above degree of parameterization is optional and all values can be self-contained in the config file.
go.mod/go.sum/vendor
creation with versions synced with the origin.go get github.com/codeactual/transplant/cmd/transplant
go get github.com/codeactual/transplant/cmd/transplant@master