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

Make gnomod optional everywhere #1039

Open
moul opened this issue Aug 9, 2023 · 1 comment
Open

Make gnomod optional everywhere #1039

moul opened this issue Aug 9, 2023 · 1 comment

Comments

@moul
Copy link
Member

moul commented Aug 9, 2023

It's a good idea to create a set of consistent helper functions that'll make the process of loading entire directories or single files much smoother. These helpers would basically help us create a virtual Module, something we can either find in gno.mod or work out from other clues. These functions could even put together the Module for us, using smart default values.

Presently, gnomod operates in an all-or-nothing fashion – either it works or throws an error. The aim is to refine this behavior. The library or binary utilizing this helper will certainly check for errors, and depending on its needs for an actual file, it might include an extra validation like if mod.FromFile. In most cases, this extra step might not matter, except for potential linting scenarios.

And just to wrap things up, you'd be able to do something like gno test file.gno or cat file.gno | gno test -. This would give you a little pretend world to play with, complete with a package path that's kind of like main or local/r/anonXXXX.

What I'm suggesting is that we develop these helpful functions in gnovm/pkg/gnomod. We could transform the library from just reading files to being the go-to place for getting a gnomod.Module. Reading files would become more like a behind-the-scenes thing that only happens sometimes.

See:

@moul
Copy link
Member Author

moul commented Aug 9, 2023

cc @harry-hov @ilgooz @tbruyelle

@moul moul moved this to 🔨 Wanted for launch in 🚀 The Launch [DEPRECATED] Sep 5, 2023
@moul moul moved this from 🔨 Wanted for launch to 🚫 After launch in 🚀 The Launch [DEPRECATED] Sep 5, 2023
@moul moul added this to the 💡Someday/Maybe milestone Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔵 Not Needed for Launch
Development

No branches or pull requests

1 participant