about summary refs log tree commit diff
path: root/pkgs/by-name/ge/get-graphql-schema/package.nix
blob: 25d9f839778ca626a3208b832d3bb654b31b54cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
  lib,
  mkYarnPackage,
  fetchYarnDeps,
  fetchFromGitHub,
  nodejs_22
}: mkYarnPackage rec {
  pname = "get-graphql-schema";
  version = "2.1.1";

  src = fetchFromGitHub {
    owner = "prisma-labs";
    repo = "get-graphql-schema";
    rev = "v${version}";
    hash = "sha256-ujc0LGAqmo4SmItm4VcbBOtmUvL6aV1ppMm4fMmuSRs=";
  };

  packageJSON = ./package.json;
  offlineCache = fetchYarnDeps {
    yarnLock = "${src}/yarn.lock";
    hash = "sha256-TZGNX8UHbolLyBmQNGTnFjgx3/3f2HNVQf/h9rIVJKs=";
  };

  buildPhase = ''
    runHook preBuild
    yarn --offline build
    runHook postBuild
  '';

  postFixup = ''
    substituteInPlace $out/libexec/get-graphql-schema/deps/get-graphql-schema/dist/index.js \
      --replace-fail "#!/usr/bin/env node" "#!${lib.getExe nodejs_22}"
    chmod +x $out/bin/get-graphql-schema
  '';
  meta = {
    description = "Command line tool for generating a changelog from git tags and commit history";
    homepage = "https://github.com/cookpete/auto-changelog";
    changelog = "https://github.com/cookpete/auto-changelog/blob/master/CHANGELOG.md";
    license = lib.licenses.mit;
    mainProgram = "get-graphql-schema";
    maintainers = with lib.maintainers; [ pyrox0 ];
  };
}