Unverified Commit 20c77fb1 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

yo: 5.1.0 -> 7.0.0; adopted (#488571)

parents 040f944f 3ffa4a0e
Loading
Loading
Loading
Loading
+14 −21
Original line number Diff line number Diff line
{
  lib,
  buildNpmPackage,
  fetchNpmDeps,
  fetchFromGitHub,
  versionCheckHook,
  nix-update-script,
}:

buildNpmPackage rec {
buildNpmPackage (finalAttrs: {
  pname = "yo";
  version = "5.1.0";
  version = "7.0.0";

  src = fetchFromGitHub {
    owner = "yeoman";
    repo = "yo";
    tag = "v${version}";
    hash = "sha256-twV5vmQ5loR8j9guf0w5DG4sU4BQYz22GjqjsUkqE4U=";
    tag = "v${finalAttrs.version}";
    hash = "sha256-tTT+KjJ8Fol2IjPzuWpkd3SymODe8Jmge9sreSxBU5M=";
  };

  # needed to fix https://github.com/NixOS/nixpkgs/issues/367282
  # once yo gets a new lockfile upstream, we can go back to regular
  # `npmDepsHash` and remove the `postPatch`.
  npmDeps = fetchNpmDeps {
    src = fetchFromGitHub {
      owner = "yeoman";
      repo = "yo";
      rev = "96ebb14020a7f3f10699b3f88eadfa063a9e6b07";
      hash = "sha256-wMxH9Er+gb6rsSEgmH0zA4d6yvP2PSpsV+A0nBTIxBI=";
    };
    hash = "sha256-7TAH4Im+H7fbjI0xUxYZficcFQNZbweK2U0hGCZV+lQ=";
  };

  postPatch = "cp -v ${npmDeps.src}/package-lock.json ./package-lock.json";
  npmDepsHash = "sha256-bBGGZ5O4Nkw+nMZ5VAz7wjm8tIrCCvtv6TaXTwUCLPk=";

  dontNpmBuild = true;

  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "CLI tool for running Yeoman generators";
    homepage = "https://github.com/yeoman/yo";
    license = lib.licenses.bsd2;
    mainProgram = "yo";
    maintainers = [ ];
    maintainers = with lib.maintainers; [ chillcicada ];
  };
}
})