Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get-graphql-schema: remove usage of mkYarnPackage #331912

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions pkgs/by-name/ge/get-graphql-schema/package.json

This file was deleted.

40 changes: 19 additions & 21 deletions pkgs/by-name/ge/get-graphql-schema/package.nix
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
{
lib,
mkYarnPackage,
stdenv,
fetchYarnDeps,
fetchFromGitHub,
nodejs_22
}: mkYarnPackage rec {
nodejs,
yarnConfigHook,
yarnBuildHook,
npmHooks,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "get-graphql-schema";
version = "2.1.1";

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

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

buildPhase = ''
runHook preBuild
yarn --offline build
runHook postBuild
'';
nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
npmHooks.npmInstallHook
nodejs
];

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";
description = "Fetch and print the GraphQL schema from a GraphQL HTTP endpoint.";
homepage = "https://github.com/prisma-labs/get-graphql-schema";
license = lib.licenses.mit;
mainProgram = "get-graphql-schema";
maintainers = with lib.maintainers; [ pyrox0 ];
};
}
})