-
Notifications
You must be signed in to change notification settings - Fork 18
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
Feature request: declarative sources in npins.toml #104
Comments
Can you provide an example how that would look like for our current structure? This isn't just JSON to TOML as the JSON is currently treated as machine-only and thus some optional fields are nullable, some fields only exist in certain situations. We rely on what serde is doing. Not sure we want to document that exact format for users and/or maintain two. Happy to be convinced otherwise. |
I thought about it a bit, and I think kdl feels like a better choice:
|
To me the important UX question is which information should be "declarative" in the "humans" file, and which should be generated in the "lock" file. Dependency pinning actually is a three-step data flow process, not two-step. Step 1 declare the dependency, step 2 specify version information, step 3 pin version and download information. Tools like Cargo can paper over this fact by putting step one and two information into one "declarative" file and step three into the "lock" file. This mostly works when the majority of dependencies properly sticks to SemVer. But even then, the abstraction is leaky and stuff like Because the Nix ecosystem has basically no versioning whatsoever, the three-step nature becomes a lot more pronounced. Npins is internally very aware of that, even if it ends up putting all data into the same JSON file in the end. In order to properly provide some declarative component to Npins dependency pinning, one needs to first figure out a proper abstraction as to which information to put where and how it interacts with the CLI. |
I propose an alternative API to the current one, where user would be able to declare the sources not just by running npins commands, but also in a file, say
npins.toml
. This would allow for a faster access to the list of sources, without revisions and a simpler APIThe text was updated successfully, but these errors were encountered: