svanderburg / node2nix

Generate Nix expressions to build NPM packages
MIT License
527 stars 100 forks source link

Support all "commit-ish" github dependencies. #277

Closed ryneeverett closed 2 years ago

ryneeverett commented 2 years ago

Not all "commit-ish" formats of github dependencies which work with npm also work with node2nix. For example:

$ cat package.json
{
  "name": "foo",
  "version": "0.0.0",
  "dependencies": {
    "mocha": "mochajs/mocha#pull/4779/head"
  }
}

$ nix-shell -p nodejs

[nix-shell]$ npm --version
6.14.15

[nix-shell]$ npm install .
npm WARN foo@0.0.0 No description
npm WARN foo@0.0.0 No repository field.
npm WARN foo@0.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 80 packages in 0.765s

19 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

   ╭───────────────────────────────────────────────────────────────╮
   │                                                               │
   │      New major version of npm available! 6.14.15 → 8.3.0      │
   │   Changelog: https://github.com/npm/cli/releases/tag/v8.3.0   │
   │               Run npm install -g npm to update!               │
   │                                                               │
   ╰───────────────────────────────────────────────────────────────╯

[nix-shell]$ echo $?
0

$
exit

$ node2nix --version
node2nix 1.10.0

$ node2nix
fetching local directory: ./. from .
info attempt registry request try #1 at 2:02:24 PM
http request GET https://registry.npmjs.org/mocha
http 200 https://registry.npmjs.org/mocha
Cannot resolve version: mocha@undefined