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

Installing nu_scripts and other notes #110

Open
tombh opened this issue Nov 23, 2024 · 4 comments
Open

Installing nu_scripts and other notes #110

tombh opened this issue Nov 23, 2024 · 4 comments

Comments

@tombh
Copy link

tombh commented Nov 23, 2024

tl;dr Can nupm currently install nu_scripts? And if not I'd be open to implement it, some guidance would be appreciated.

I originally asked about this on the nu_scripts repo itself, which is interesting because I had already looked at nupm but I guess I'd decided that what I was looking for wasn't in scope. I think maybe it's that I couldn't tell the difference between this project being advertised as WIP and the sparse usage examples. Or in other words, in my cursory research of the various, current Nushell package manager projects, I blurred "don't expect too much from this project" with "this project doesn't do much".

But then @fdncred pointed me back here and then I noticed the "/nushell" organisation in the repo URL! So now I'm back to thinking this project will have much to offer. Would adding the definite article to the README title help, "nupm - The Nushell package manager"?

The first time I looked at this repo I did actually have a quick look at the design document, but I interpreted "design" as more like "architecture" and less like "roadmap". I've since found the old Roadmap PR where I saw that both the things I want from nupm are planned: installing nu_scripts and automatic self-installation. What about adding a concise TODO-style roadmap on the README?

Even without a roadmap on the README I'm still wondering about communicating a bit more insight into what to expect from nupm. It's basically the Cargo of Nushell right? It can both install standalone plugins and be used as a dependency manager for Nushell projects? Whilst I understand Cargo.toml I'm not quite sure what adding a plugin (or script) to my personal config will do? Is there a kind of user-based nupm.toml at ~/.config/nupm/nupm.toml?

I think at least it would be good to have some basic usage examples in the README. Like:

  • nupm install nufetch (a real, but lightweight example).
  • nupm add https://github.com/nushell/nupm/blob/main/nupm.nuon. BTW I assume that nupm.nuon is the equivalent of Cargo.toml?

Whilst it's clear that this project is WIP, it would also like some early users? Are the lack of usage examples intentional or just an oversight? I, at least, dismissed this project at first because I could neither read about its goals nor try any commands.

I'd be happy to offer PRs improving the README. And, should I have a go at trying to implement nu_scripts installation and automatic self-installation?

@fdncred
Copy link
Collaborator

fdncred commented Nov 23, 2024

Personally, I think an update to the readme.md is a good plan of action and a great starting point. I wouldn't mind seeing a few roadmap checkboxes indicating the direction we're going as well as the progress we've made. It could also indicate where the community could jump in.

Unfortunately, this repo doesn't get the attention it deserves due to maintainer time and competing priorities since everyone here is a volunteer.

/cc @amtoine @kubouch (the people who wrote most of this)

@NotTheDr01ds
Copy link

From what I recall (and it's been a few months), you need to checkout a Git repo locally, then you can install a module in it using nupm with (if my history is accurate):

nupm install -f --path ./stdlib-candidate/

I've experimented a bit with a git based approach, and there were a few issues:

  • First, in regards to nu_scripts, the repo is currently over 200MB, even with depth=1. This is due to the theme previews -- a problem which we were working on solving, but I've personally been sidetracked on other items.

  • nu_scripts is a bit of a mono-repo, and we need to determine how to install just certain modules (e.g., stdlib-candidate) from it. That can be done somewhat using a Git sparse checkout (experimental, but seems like it might be stabilizing) as I mention here.

    The problem with that, from a package-manager perspective, is that you always end up having to "namespace" it using the <checkout_dir>/<module>. That's not optimal. It's something that could probably be solved with symlinks, but I don't think we have a cross-platform solution for linking.

@NotTheDr01ds
Copy link

NotTheDr01ds commented Nov 23, 2024

That said, @tombh, I share your goal -- I'd like to be able to rely on more of a "pure-Git" approach to managing packages, using things like:

  • Tags, commits, and releases
  • Local and remote repos
  • Automatic updates via git pull
  • Monorepos and sparse checkouts
  • Etc.

There likely always needs to be a "registry" of some sort, but I'd love to see this migrated to SQLite.

@amtoine
Copy link
Member

amtoine commented Nov 25, 2024

i wish i had more time to have a closer look at Nupm...

this is in my TODO for sure but yeah, for now, nu_scripts is not a module but rather a collection of modules that you should be able to install with nupm install after checking out Git revisions locally.

there should also be the official Nushell registry but i'm not sure that part works that great 🤔

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

4 participants