Call for nodePackages maintainers

For what it’s worth, we rely quite heavily on JS at work and that would be a great opportunity to introduce people to Nix, if I could show them that Nix works well with JS. What I’m trying to say is, I’d love to be one of those maintainers but I’m currently still a Nix beginner.

Is there any way I can help? I can at least offer some time and energy.

:wave: Hi all. Maintainer of GitHub - cprussin/nixjs: A nix overlay containing a collection of node versions and associated tools here. Obviously I have a particular interest in node / nix – I work on node (and JS in the browser) professionally at work, and while my company doesn’t use nix, I use nix avidly for anything I can (including nixos pretty much everywhere, all side projects I own, & I check shell.nix files into my repos at work for myself and in case anyone else comes along and wants to use nix).

The point being, in terms of interest and expertise, I’d be pretty well suited to lend a hand here. And I’d love to do so, but since my company doesn’t use nix it would be entirely extracurricular. So I can’t guarantee my time is sufficient, but I can certainly take a stab.

I’m reasonably familiar with nixpkgs from reading code, but my contributions thus far have been limited to a single backport of a PR someone else put in. I don’t know if that bothers the “powers that be” but it doesn’t bother me to dig in.

tl;dr I’d be happy to pitch in, but I can’t guarantee my time will be sufficient.

EDIT: someone tell me what to do next :slight_smile:

2 Likes

@cideM @cprussin thank for volunteering :slight_smile:

You could add yourself as a CODEOWNER of the node-packages directory, similar to this commit here: codeowners: add jonringer as vimplugin and vscode ext owner · NixOS/nixpkgs@4c810e7 · GitHub

This will mean that github will add you as a reviewer whenever someone creates a PR against those files or directories.

After you tested the changes, you can cc myself or another active committer to get the PR merged

If you’re not sure about nixpkgs PR process, can review manual section: Nixpkgs 23.11 manual | Nix & NixOS

I also have a video where I create a PR for a new application, but my suggestions on how to test and create the PR still apply to all PRs:

EDIT:
For most PRs, I look at the diff, make sure that it’s following established or best standards, and then also do a nixpkgs-review pr <pr #> to see what the changes affect. If there’s no regressions and the changes look good then it’s probably good to merge.

What is considered best practices? depends on the maintainer, language framework, and problem domain. That skillset develops slowly over time. If you don’t fee very confident about practices, I would review other PRs to see what most committers consider best practices

EDIT:
@ryantm might have a better “plan of attack”

2 Likes

@cideM @cprussin Thank you for volunteering! I will try to write up some instructions for you soon.

@ryantm I would be happy to help as well. I use nodejs + nix at work on daily basis and should be able to commit around 2 hours a week to this.

1 Like

@jonringer @ryantm Cool, I’ve added myself in codeowners: add cprussin as a codeowner for nodejs & deno by cprussin · Pull Request #99666 · NixOS/nixpkgs · GitHub.

Few questions:

  1. Is the expectation here purely to help review PRs or are there larger plans for improving the nodejs ecosystem in nixpkgs that maintainers should be thinking about? What level of freedom & discretion about those changes do maintainers have and where is the appropriate place to discuss significant changes before making them?

  2. Are there discussion forums I should be joining as a maintainer? I sit on the #nix channel on the functionalprogramming slack, but I don’t notice many maintainers in that channel apart from @cdepillabout. I’m happy to become more active elsewhere too.

1 Like

oh and @adrian-gierakowski and @cideM I’d be happy to add you two as CODEOWNERS in the PR I opened, just let me know if ya’ll are interested still.

Short term, just PRs, which is the intent of this discussion thread. Changes to the node ecosystem should probably done through an issue and bring in previous contributors to make sure there’s a marked improvement.

Remember that people will be “consuming” the changes, and that nixpkgs can be thought of as an “api”. Breaking changes should be few, and warranted

Discourse is the only official forum/mailing list. IRC is the only official chat platform. Generally most nixpkgs affecting discussions happen on github. The other chat channels are usually there for brain storming, collaboration, or help. You’re not required participate in the other chat circles. (E.g. I spend the most time in discord)

1 Like

Thanks a bunch, that’s helpful context.

FWIW when I was talking about “significant changes” I mostly had in mind internal plumbing or additions, not breaking changes. No question that breaking changes should be few and far between and well justified. But in terms of anything significant, it seems a github issue is the appropriate starting point.

1 Like

Moving the discussion back here as I’ve closed the PR since it seems github doesn’t support CODEOWNERS who don’t have write access to the repository.

Any suggestions on how to effectively contribute as a maintainer without being listed as a CODEOWNER?

2 Likes

Before we get some tools made, you could do these things:

  1. Ask people who made PRs to remove their changes to node-packages.nix.
  2. Consolidate the changes from the PRs yourself with no changes to node-packages.nix.
  3. Make separate PRs that only update node-packages.nix via the generate script.

You can ping me whenever you need something merged.

2 Likes

the node infrastructure heavily uses node2nix, so the node2nix issue tracker might also be a good place to discuss some things.

Personally, for me (as someone who is not really too familiar with node, but ended up maintaining one node package (mastodon-bot)) the main pain point is that when you use node2nix to update the dependencies for one package, it also updates the dependencies for all other packages.

I think that is a big cause of the many conflicts between PR’s updating node packages, and also makes reviewing harder: I can easily test the one package I maintain still works, but am reluctant to approve a PR that also updates the dependencies for all those other node packages.

See also this node2nix issue.

Sorry I was away from home on a communion and didn’t have time to check in. I’m still up for the task! I see you already said that apparently this CODEOWNER thing doesn’t work without write permissions so I think I’ll just start by trying to make some time for taking a look at existing node PRs and doing the steps that @ryantm outlined.

5 Likes

@ryantm Is there an easy way for you to massively label every PR that touches node-packages.nix ?

Could serve as a quick work around:

Edit: at the very least the 6:topic label doesn’t seem to work. I checked in one of my node submissions.

2 Likes

Also, as a start, the documentation should be updated to tell contributors to not run ./generate.sh:

They should probably run it, so they can test their work, but then not commit it.

So I went through the process of merging three PRs and I have a few questions because I don’t want to step on anyone’s toes. Right now I just manually cherry-picked the changes from each fork/PR and then rewrote the author to preserve the information who put in the work to add something new. I then want to run the generate.sh for each commit. It’s now running as I’m writing this and I have no idea if this will take hours or days on my measly AMD Ryzen 7 1700.

The pragmatic alternative would be to just take the changes from all PRs, add them as a single commit, run generate.sh once, and maybe refer to all authors in the commit message? But I don’t know GitHub well enough to determine if either of these two options will properly preserve the commit in e.g., people’s dashboards and just in case someone really cares about having their commits to Nixpkgs properly reflected there, I thought I’d ask first.

I would have created a PR so you can see the changes but like I said generate is still running. The gist is (without the generated stuff)

nixpkgs-master (master↑3|✔) $ git shortlog --max-count=3
Changlin Li (1):
      nodePackages.inliner: init at 1.13.1

Teodoro Freund (1):
      Added the makam package to the nodePackages

Tobias Mayer (1):
      nodePackages.clubhouse-cli: init at 2.1.0
diff --git a/pkgs/development/node-packages/default.nix b/pkgs/development/node-packages/default.nix
index 4ef3de0bb4e..c86bc964fd6 100644
--- a/pkgs/development/node-packages/default.nix
+++ b/pkgs/development/node-packages/default.nix
@@ -73,6 +73,14 @@ let
       nativeBuildInputs = drv.nativeBuildInputs or [] ++ [ pkgs.psc-package self.pulp ];
     });
 
+    makam = super.makam.override {
+      buildInputs = [ pkgs.nodejs pkgs.makeWrapper ];
+      postFixup = ''
+        wrapProgram "$out/bin/makam" --prefix PATH : ${stdenv.lib.makeBinPath [ pkgs.nodejs ]}
+        patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 "$out/lib/node_modules/makam/makam-bin-linux64"
+      '';
+    };
+
     mirakurun = super.mirakurun.override rec {
       nativeBuildInputs = with pkgs; [ makeWrapper ];
       postInstall = let
diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json
index 77b398caeec..8cd631cf070 100644
--- a/pkgs/development/node-packages/node-packages.json
+++ b/pkgs/development/node-packages/node-packages.json
@@ -18,6 +18,7 @@
 , "browserify"
 , "castnow"
 , "clean-css-cli"
+, "clubhouse-cli"
 , "coc-css"
 , "coc-emmet"
 , "coc-eslint"
@@ -82,6 +83,7 @@
 , "gitmoji-cli"
 , "graphql-cli"
 , "grunt-cli"
+, "makam"
 , "gtop"
 , "gulp"
 , "gulp-cli"
@@ -90,6 +92,7 @@
 , "htmlhint"
 , "http-server"
 , "hueadm"
+, "inliner"
 , "imapnotify"
 , "indium"
 , "insect"

TL;DR: I really want to help I just want to make sure I do it in the right way before automating anything.

1 Like

Thank you for taking this on! I’m sure we can figure out something if we work on it.

Why after each commit? I think cherry-picking a string of commits with a generate commit at the end would work.

I have no idea if this will take hours or days on my measly AMD Ryzen 7 1700.

I remember it running pretty quickly for me. Hope it doesn’t take that long!

The idea was that running generate.sh after each commit would preserve a working git history whereas without it you might look at a commit and determine it includes node package x but because generate.sh was never run it actually doesn’t

I created a PR which we can now use to discuss the approach

1 Like