mlabs-haskell / lambda-buffers

LambdaBuffers toolkit for sharing types and their semantics between different languages
https://mlabs-haskell.github.io/lambda-buffers/
Apache License 2.0
29 stars 0 forks source link

Remove node2nix from Typescript's Nix utilities #162

Closed jaredponn closed 7 months ago

jaredponn commented 7 months ago

Surprisingly, one can scan the package-lock.json for URLS of tarballs for dependencies, then fetch those tarballs in a nix derivation, and manually add them into npm's cache. Then, npm install will surprisingly manage to find everything in the cache without hitting the network.

Future work

For now, this only supports grabbing things from the npm registry, and in the future we would like to support the complete set of allowed package-specs by npm.

Honestly, a better way forward would probably to cook up a proxy registry to the npm registry. override npm s.t. it always uses the proxy registry, and dump all the nix packages there. A brief glance suggests that https://verdaccio.org/ might be useful for this :^).

jaredponn commented 7 months ago

A question though. Is this really flake-typescript? or is it flake-npm? or smtn like that? At which point is typescript invoked here I can't figure it out :D

I suppose this really is just flake-npm -- typescript is only called with the build script in the package.json which indeed may not be typescript at all.

Unfortunately, I ended up not going with this, so I'll close this PR.