Closed pomek closed 1 year ago
If user were to execute command mrgit save --preset development
with config file as follows:
{
"packages": "external/",
"dependencies": {
"ckeditor5-linters-config": "ckeditor/ckeditor5-linters-config@latest",
"ckeditor5-dev": "ckeditor/ckeditor5-dev@latest"
},
"presets": {
"development": {
"ckeditor5-dev": "ckeditor/ckeditor5-dev"
}
}
}
What would be expected outcome? I imagine that ckeditor5-dev
should have its commit hash saved in the preset/development
object. What about the ckeditor5-linters-config
though?
dependencies
object.preset/development
object and its commit hash gets saved there.Option 1 would mean that save
does not save the exact state of the multirepo.
Option 2 would mean that default dependencies and other presets are affected.
Because of this, I come to the conclusion that correct behavior there is to add the ckeditor5-linters-config
key along with its commit hash to the preset/development
object.
š Provide a description of the new feature
Let's assume the following configuration as input. It uses tags, which we plan to introduce soon.
While bootstrapping the project (
mrgit sync
), mrgit clones and check-outs dependencies on the latest created tag.A package published on npm may (but it does not have to) contain the same files as a tag on Github. Fortunately, the packages specified above do.
So, by default,
sync
will process repositories specified in the#dependencies
key.Presets
Let's assume I'd like to synchronize the entire project depending on events, e.g., when starting TP, preparing a release, etc.
An example configuration.
And passing a preset name when using the
sync
command.mrgit sync
: all packages use the latest tag.mrgit sync --preset dev
: all packages are checked out on a#master
branch.mrgit sync --preset typedoc
:ckeditor5-dev
uses the#ck/11721-build-API-from-typedoc
branch, linters -@latest
.In other words, when the
--preset
modifier is available, specified dependencies for the given preset are merged with thedependencies
values. And preset takes precedence over dependencies.