cue-lang / cue

The home of the CUE language! Validate and define text-based and dynamic configuration
https://cuelang.org
Apache License 2.0
4.84k stars 279 forks source link

modules: copy LICENSE files from VCS root into modules #3130

Closed myitcv closed 1 week ago

myitcv commented 1 month ago

When a module is published from a source: kind: "git" setup, and the module is not at the root of the repository, it is a reasonable expectation that the LICENSE file at the root of the repository be included as a published artefact in the module which is rooted at a sub directory. Otherwise, there would be a needless maintaining of two LICENSE files: one at the root, and a presumably identical one in the sub directory.

Go follows a similar approach, including the root LICENSE file in a sub directory module if one does not exist (in the sub directory).

This issue captures implementing this behaviour.

We also need to print the included license file in the output of --dry-run.