Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new timoni module has files listed in the timoni.ignore #158

Open
verdverm opened this issue Aug 2, 2023 · 7 comments
Open

new timoni module has files listed in the timoni.ignore #158

verdverm opened this issue Aug 2, 2023 · 7 comments

Comments

@verdverm
Copy link

verdverm commented Aug 2, 2023

looks like 3 files:

  • timoni.ignore
  • go.{mod,sum}

image

@stefanprodan
Copy link
Owner

Yes these are the new default ignore rules to avoid publishing modules to OCI with files which are not required at runtime.

@verdverm
Copy link
Author

verdverm commented Aug 2, 2023

The problem is that the generated go files (and cue mod setup) would have over written my existing files

if I generated a new timoni module at the root of my existing repository

I also have a CUE module setup already, so I might just copy gen and pkg extras over by hand, and account for the different import paths from the examples

@stefanprodan
Copy link
Owner

The timoni mod init mymod . creates a directory with the module name, if the dir exists it should error out. How did you run the command so it ended up overriding files?

@verdverm
Copy link
Author

verdverm commented Aug 2, 2023

I didn't run it that way, but noted that it would have had I, unaware of the exit behavior if dir exists.

Maybe what is needed is how to setup timoni in an existing CUE module? With the CUE pre generated for k8s API, are the Go files even needed in a new module? Or can you make a command that just writes out the cue.mod/...k8s/timoni... files`?

@stefanprodan
Copy link
Owner

The files needed for a Timoni module are listed here https://timoni.sh/module/

@verdverm
Copy link
Author

verdverm commented Aug 4, 2023

What's up with the generated go.mod/sum files then? They are not in the list, I'm not even in a project containing any Go

@stefanprodan
Copy link
Owner

When you do timoni mod push those Go files are ignored as per timoni.ignore, they are useful to module authors. As an author you should have them in your Git repo to be able to update the Kubernetes definitions https://timoni.sh/module/#kubernetes-types. If you don’t use go get and cue get go then you don’t need them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants