Mirror of https://github.com/cue-lang/cue cuelang.org
cue go

cue/load: drop support for legacy pkg directories master

cue/load was changed back in 2019 to transition to cue.mod being a directory rather than a file, so that it could contain the CUE declaring the module as cue.mod/module.cue, as well as other directories like cue.mod/pkg/ rather than pkg/. The logic to find the module root by walking parent directories as well as the logic to import a package still supported a "legacy" mode where the pkg directory exists outside of the cue.mod directory. This "legacy" mode was added over four years ago now, and we are now evolving CUE modules to add dependency management, so it seems like a good time to remove the legacy mode support. Any users still having a pkg directory outside of cue.mod should be able to fix their module by simply: mv pkg cue.mod/ This is precisely what we do in the encoding/openapi package, while also moving away from cue.mod being a regular file. Note that we still support cue.mod being a regular file itself, rather than a directory holding cue.mod/module.cue. Dropping support for that other "legacy" mode is left for another CL. For #2726. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: I9b72944b66231051dd49dc9b163bf2a4b16ec036 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1173271 TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com> Reviewed-by: Paul Jolly <paul@myitcv.io> Reviewed-by: Roger Peppe <rogpeppe@gmail.com>


+11 -53
7 changed files