Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Package distribution #409

Closed
sh0rez opened this issue May 24, 2020 · 4 comments
Closed

Package distribution #409

sh0rez opened this issue May 24, 2020 · 4 comments
Labels
FeatureRequest New feature or request module/imports

Comments

@sh0rez
Copy link

sh0rez commented May 24, 2020

(Not being able to find an existing issue, I am opening this one. Please direct me to the existing discussion in case I missed it)

Is your feature request related to a problem? Please describe.
Cue is a very interesting language and as a refreshing alternative to YAML (or even Jsonnet) for configuring Kubernetes.
Looking at the Helm project, one can clearly see their biggest power is the ready-to-go library of prepared configuration charts.

I would like to achieve a similar thing with CUE, by distributing .cue files (Packages) to users.

Describe the solution you'd like
Given the overall Go-inspired characteristics of CUE and especially cue mod, a go get similar command would be very beneficial.

Similar to cue get go, we could also introduce cue get cue (or better cue get) to download CUE modules from source control, e.g. GitHub:

$ cue get github.com/foo/bar

Dependency resolution would be desirable as well, so that cue.mod/module.cue specifies required modules:

module: "github.com/foo/bar"
require: [
  "k8s.io/api"
]

Describe alternatives you've considered

  1. External tool: Of course this could be handled by an external project along the lines of jsonnet-bundler. However considering cue already includes get go, it seems like a natural fit
  2. Central registry: As an alternative to the Go-inspired VCS-sources, an NPM-like approach could be taken, where a central registry stores packages. While this benefits discoverability of packages, the CUE project would need to develop and maintain this place, which appears to be more of a burden compared to taking the successful Go approach, which imposes mostly cli-side work.
@sh0rez sh0rez added the FeatureRequest New feature or request label May 24, 2020
@verdverm
Copy link
Contributor

verdverm commented May 26, 2020

A cue mod feature is planned, and will work very closely to how go mod works. It will likely be a large code copy and repair kind of job. There are a lot of good reasons for doing this, such as much of Cue code is already from Go and there are very sophisticated security mechanisms in the go mods implementation that will come along. Expect it to look a lot like go mods.

You can use hof mod in the meantime if you'd like to use something close to what it will be and what go mods is. https://github.com/hofstadter-io/hof

# initialize a Cue module
hof mod init cue "golang.org/like/import"

# edit mod file (no auto determination)
vim cue.mods   (cue uses cue.mod as the vendor folder)

# update deps
hof mod vendor

The project uses its own mod system and so is an example usage.

@leejansq
Copy link

look forward to cue mod

@myitcv
Copy link
Contributor

myitcv commented Mar 23, 2021

Hi @sh0rez - thanks for raising this. I've just opened #851 which directly addresses your request. So I'll mark this issue as closed and we can continue discussion there. Thanks

@cueckoo
Copy link

cueckoo commented Jul 3, 2021

This issue has been migrated to cue-lang/cue#409.

For more details about CUE's migration to a new home, please see cue-lang/cue#1078.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest New feature or request module/imports
Projects
None yet
Development

No branches or pull requests

6 participants