-
Notifications
You must be signed in to change notification settings - Fork 2
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
Pivot to "federated package spec" (ecosystem-agnostic dependency spec) #41
Comments
Revised, minimal package spec:
|
based on tag/release ?
I think the |
Should we perhaps have a way of describing why a dependency exists? What about optional dependencies? Should that be within scope for this package spec, and if so, how would it work? |
You mean like pseudo "comments"? No, that doesn't sound like something needed in a minimal "P0" approach.
Why is that needed in the minimal, initial spec? |
Makes sense.
I don't think it is "needed", I was just asking if it should be included or not, just in case the thought of optional deps may have slipped your mind. |
Cool! I'll add some of my thoughts, hope you don't mind;
Does this mean that a manifest file always tracks HEAD of the git repo? Given a manifest file as input, how would one know which version of the package it describes? I think the version number in the manifest file is very much needed, and should be the canonical version identifier. I also feel like the absence of the version number would violate the 4th principle?
I think excluding this field would help with overall ergonomics. If the spec starts out small with only fundamental requirements and additions are carefully considered I don't see the spec schema changing in such a way it'd require a spec version bump. Bumping the spec version should imo be a last resort. I think a strict non-breaking change policy would make sense. Consumers would simply check the presence of a field to enable that "feature".
Should consumers of dependencies need to control how a dependency is resolved? I think it'd be nice if the spec enforces globally unique names instead which central registries would have to enforce. The dependency schema could then simply be: {
"dependencies": {
"plenary.nvim": "1.0.0"
}
} As for describing version ranges, it looks like the suggested syntax employs npm's syntax, which I think is entirely proprietary to npm. I think cargo's approach is a bit simpler, where:
I feel like this alone is enough? In the future it could be extended with the additional modifiers
I think the entire dependency tree should be "packspec-enabled". Having plugin dependencies is in my experience pretty rare (maybe only a contemporary consequence of the lack of a manifest file), and those who do tend to depend on plugins that are intended to be dependent on (e.g. Finally I think it'd also be good to explicitly define which fields are required. I don't see it being mentioned here but I feel like there's an implication that some of them currently are? |
Great feedback!
(Added to "Closed questions") The dependents declare what version they need, which must be available as a git tag in the dependency. Thus there is no need for
Agreed, updated spec. The absence of
(Added to "Closed questions")
(Added to "Closed questions") Requiring URIs achieves that.
(Added to "Closed questions") That looks nice but it makes the protocol more complicated and less "distributed". |
Good idea, updated spec.
That just isn't a goal (and it's the "RMS" approach to software 😏: cathedral instead of crazy, infectious bazaar) . The original scope was to be able to declare and resolve dependencies. Not anything else. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I mean lots of package managers support optional dependencies. Like it works without the dependency, but has additional features if the |
This comment was marked as resolved.
This comment was marked as resolved.
Via https://twitter.com/oilsforunix/status/1680957458431213569 :
|
I think having a metadata field reserved for client defined data is a pretty good idea. Especially when considering that this spec is likely to change in the future and breaking old packages because they used fields that collide with fields that were added in new versions would be bad. Also validation and deserialization is much easier if you know what to expect. |
VSCode handles this in the package.json. actually we could rip off quite a few of their contribution points although the rest of them have less obvious value.
Contribution points can be used for anything lua_ls annotations are currently used for (completions, hover, diagnostics, vimdoc) plus:
Technically lua_ls annotations could also be contorted to do some of the above (not sure about |
(Note: all feedback is captured in this description + the first comment.)
To add some momentum to this effort, I suggest:
all Lua-supporting versions of Vim/Nvimall "assets" or "artifacts" of any kind in the spec should be a requirement.Only support one format, Lua (because it allows comments). Vim must be compiled with+lua
or must havelua
available on $PATH.package.json
, where possible (assuming this reduces confusion rather than increasing it)pkg.json
should be totally sandboxed (evaluating it must have no side-effects, only input and output).(Does #7 address this?)Client requirements
git
(packages can live at any git URL)Package server requirements
git
repoWhy NPM package.json?
NPM is special because it's ubiquitous--and lots of discussion hasn't yielded a strong case for a novel format. Using things that are ubiquitous means you gain their tooling, docs, validators (and possibly even... infrastructure).
node and NPM aren't perfect, but that doesn't matter. Choosing to be a subset of that ecosystem provides optionality: it's almost entirely upside with limited downside. We could also choose PHP's package format.
The point is to surf on something massive and immortal.
What about LuaRocks?
I've advocated for LuaRocks as the Nvim plugin manager, but defining a
"plugin spec""federated package spec" also makes sense because:pkg.json
is a fairly "cheap" approach. LuaRocksReferences
The text was updated successfully, but these errors were encountered: