-
Notifications
You must be signed in to change notification settings - Fork 11
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
Redesign registry; Allow publishing to registry #86
Conversation
One argument for keeping the nuon files "raw" is that they do not contain newlines, so their hashes should be the same on Windows/non-Windows. If we made the nuon files more human-friendly, they would contain newlines which could potentially mess things up: Simply opening and closing a nuon file could change the line endings in the entire file, making its hash not match the expected hash. Maybe it would be fine, but we'd have to make sure and test it, I'd rather avoid this by having no newlines, at least for now. |
Just devil's advocate but could you manually replace all |
Yes, that's an option (or convert all |
nice job @kubouch !! Windows is such a pain... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the new commits look fine to me 👌
there's just a review question and some missing packages 😉
use std assert
def make-it-similar []: table<name: string, version: string, url: string, revision: string, path: string> -> table<name: string, version: string, url: string, revision: string, path: string> {
sort-by version name | select name version url revision path
}
let old = http get https://raw.githubusercontent.com/nushell/nupm/main/registry.nuon
| get git
| make-it-similar
let new = open registry/registry.nuon
| get path
| each {|it| open ("registry/" | path join $it)} # open each registry package file
| flatten # extract the path and revision from `$.info`
| update info { flatten } # |
| flatten --all # |
| reject type
| default "." path # remove the `null`
| make-it-similar
if $new != $old {
$new | to nuon --indent 4 | save --force /tmp/new.nuon
$old | to nuon --indent 4 | save --force /tmp/old.nuon
diff -u /tmp/old.nuon /tmp/new.nuon
}
print "all good"
gives me
--- /tmp/old.nuon 2024-05-05 13:15:41.093046938 +0200
+++ /tmp/new.nuon 2024-05-05 13:15:41.093046938 +0200
@@ -245,55 +245,6 @@
.
],
[
- nu_plugin_explore,
- "0.92.0",
- "https://github.com/amtoine/nu_plugin_explore",
- "0.92.",
- .
- ],
- [
- nu_plugin_clipboard,
- "0.92.1",
- "https://github.com/FMotalleb/nu_plugin_clipboard",
- "98d7102",
- .
- ],
- [
- nu_plugin_explore,
- "0.92.3-2595f31541554c6d8602ebebc9dffbc4dd29dd89",
- "https://github.com/amtoine/nu_plugin_explore",
- "0.92.3-2595f31541554c6d8602ebebc9dffbc4dd29dd89",
- .
- ],
- [
- nu_plugin_explore,
- "0.92.3-55edef5ddaf3d3d55290863446c2dd50c012e9bc",
- "https://github.com/amtoine/nu_plugin_explore",
- "0.92.3-55edef5ddaf3d3d55290863446c2dd50c012e9bc",
- .
- ],
- [
- nu_plugin_explore,
- "0.92.3-be5ed3290cb116cbe9f3038f7a2d46aaac85a25c",
- "https://github.com/amtoine/nu_plugin_explore",
- "0.92.3-be5ed3290cb116cbe9f3038f7a2d46aaac85a25c",
- .
- ],
- [
- nu_plugin_explore,
- "0.92.3-c06ef201b72b3cbe901820417106b7d65c6f01e1",
- "https://github.com/amtoine/nu_plugin_explore",
- "0.92.3-c06ef201b72b3cbe901820417106b7d65c6f01e1",
- .
- ],
- [
- nu_plugin_explore,
- "0.93.0",
- "https://github.com/amtoine/nu_plugin_explore",
- "0.93.0",
- .
- ],
- [
nu_plugin_port_scan,
"1.0.10",
"https://github.com/FMotalleb/nu_plugin_port_scan",
related to
Co-authored-by: Antoine Stevan <44101798+amtoine@users.noreply.github.com>
Ah yeah, it's missing the added packages. I currently don't have time to add them. If you have time, you can merge it and publish them again to the registry using the new |
these versions have been removed in a merge conflict resolution and were defined in nushell#88. i did run the following command after checking out on the different revisions: ```nushell use /path/to/nupm/nupm nupm publish /path/to/nupm/registry/registry.nuon --save --git ```
no worries 👍 i was able to add most of them apart from
|
Now thinking about it, I think we should support only semver-style versions because we need to be able to sort by version and select the latest. The same with the I'd propose keeping only semver in the official registry, but let's keep experimenting with being able to have some alternative versions. These could be allowed e.g. only in your personal registry, but not for publishing to the official one. Or the |
Commit hashes are supported in semver (in case it helps). |
TIL, but I still think we need to restrict our versions to a subset that doesn't prevent sorting. Otherwise, we wouldn't be able to reliably update a package. You want to type We could support having a |
I trust your vision for it ✌🏼 FWIW the spec is |
i agree @kubouch, maybe these deps are simply ill-defined 👀 does that mean that
then we can land this PR 🙏 |
@amtoine I republished the problematic packages, should be good now. The problem with nu_plugin_explore is that revisions up to 0.93.0 still had the old version 0.1.2 in their nupm.nu, so they're not publishable because 0.1.2 is already published. Seems like you forgot to update it. |
aaah yeah, you're right 😭 we're good to land then? i kinda lost track of whole the changes lol |
still think the registry diffs are impossible to review, which is a bit of a bummer imo 😕 |
Same. I think there'd be some value in standardizing on Unix line endings. Otherwise DX will be a step above binary. Epic regardless 👏🏼 |
Thinking about it, I think what we can do is to make I'm going to merge this as-is, but I'll play with the newlines in the next PR, or anyone else can take a shot at it. I think relying forever on having zero newlines doesn't sound very robust in the long run. |
Description
This changes registry to from one file that is manually updated to multiple files that are auto-generated. Now, the registry should be only updated with the new
nupm publish
command.See the doc page for more details and the
registry/
directory for the new proposed structure.Misc changes
registry/
andtests/packages/registry/
for examples.path
field can benull
, not requiring the "."TODO