yarn2nix v0.8.0 Release Notes

Release Date: 2019-12-22 // over 4 years ago
  • βž• Added

    • πŸ“¦ Preliminary support for local packages

    To support local packages (see commit for 0.6.0 in yarn-lock), we have to add a new package function to the nix output.

    For now it will only add the path directly, which has the drawback that the nix expression is now required to be in the right position (for relative paths). It should be changed to be user-defined later (i.e. the user passes a function which takes the string of the local path and returns a derivation to the package tarball).

    We don’t use the tarball hash from the lockfile yet to verify the integrity when importing into the nix store.

    πŸ”„ Changed

    • ⬆️ Bumped hnix to 0.6.*
      • Small breaking change, because the pretty print library changed to prettyprint.
    • πŸ”’ Bumped yarn-lock to 0.6.2

    πŸ›  Fixed

    • nix-lib: Allow creating a scoped directory if it exists

Previous changes from v0.7.0

  • βž• Added

    • πŸ‘Œ Support for scoped npm packages
      • These are used mostly for Typescript annotations, but have been cropping up in other cases as well
      • The support is first-class and scoped packages are already recognized by the yarn.lock parser; as such every corner case should be supported (if not it’s a bug or missed type signature change)

    πŸ”„ Changed

    • nix-lib
      • buildNodeDeps now takes an overlay instead of a path; for the generated files this means pkgs.callPackage ./npm-deps.nix {} instead of just ./npm-deps.nix
      • Because of scoped package support, the package names are now mostly an attributeset of { scope: String, name: String } where an empty string for scope means (360) no scope
      • One exception is the key argument of _buildNodePackage, which accepts a string as well if the package is not scoped, to save on bytes in the generated nix deps file