easy-purescript-nix icon indicating copy to clipboard operation
easy-purescript-nix copied to clipboard

Maintenance of psa, pscid, pulp, purescript-language-server, purs-tidy

Open jamesdbrock opened this issue 3 years ago • 5 comments
trafficstars

So what I have been doing is keeping an uncommitted package.json around the folders. For instance this in purs-tidy:

{
  "name": "purs-tidy",
  "version": "0.7.1",
  "dependencies": {
    "purs-tidy": "0.7.1"
  }
}

When I new version comes in, I bump these numbers to match the NPM release. Following this I just run node2nix with the latest node2nix version (Node v12 is deprecated, and node2nix seems to favor the latest maintenance version instead of latest LTS).

After node2nix does it's thing. I run git checkout on the default.nix to keep the modifications Justin did way back when. Then I go back and nvim default.nix and edit the version number to match the package.json and generated code.

I git add *.nix, git commit and write my merge request message, then git push github $BRANCH. The diff this creates is usually minimal which Justin tends to approve of in <48 hours because it's just a few version bumps to read on his end.

Originally posted by @toastal in https://github.com/justinwoo/easy-purescript-nix/issues/146#issuecomment-1083977501

jamesdbrock avatar Mar 31 '22 13:03 jamesdbrock

we should write this as a bash script sometime

justinwoo avatar Mar 31 '22 14:03 justinwoo

I’ve been trying to do an import-from-derivation with node2nix for pulp and it’s very hard.

We want:

  • When a new version of a package comes out we can edit default.nix and paste in the new version number and a sha256 and then commit.
  • The new version gets the locked versions of NPM dependencies from the package-lock.json.

Problems:

  • We can get hashes for the dependencies from package-lock.json in the source repository, but there is no place to get a hash for the package itself. So there is no way to create a pure derivation for the package.
  • When we do this with @toastal ’s method then I think we don't get the locked dependency versions from package-lock.json.
  • We don't want to build from source because then all the source-building tools have to be in the derivation. So we want the pre-built code from npmjs.com.

jamesdbrock avatar Mar 31 '22 14:03 jamesdbrock

(Thank you very much for the work you’ve done on this @toastal )

jamesdbrock avatar Mar 31 '22 14:03 jamesdbrock

BTW, I found that I had also used process substitution at one point: node2nix --input (echo '{"name":"purescript-psa",version:"0.8.2",dependencies":{"purescript-psa": "0.8.2"}}' | psub)

toastal avatar Apr 19 '22 12:04 toastal

There's a new method for maintaining these derivations, see the default.nix files in each package’s directory.

https://github.com/justinwoo/easy-purescript-nix/blob/c8eee8f0df073deedd8d94314a01b76b0d9ff33d/psa/default.nix#L1-L4

jamesdbrock avatar Jun 05 '23 04:06 jamesdbrock