From 0502f67fa6f46db44b0f7e9c08bf31b9eb3eb223 Mon Sep 17 00:00:00 2001 From: Pyrox Date: Fri, 2 Aug 2024 23:59:55 -0400 Subject: [PATCH 1/2] get-graphql-schema: remove usage of mkYarnPackage --- .../ge/get-graphql-schema/package.json | 35 ------------------- .../by-name/ge/get-graphql-schema/package.nix | 35 +++++++++---------- 2 files changed, 17 insertions(+), 53 deletions(-) delete mode 100644 pkgs/by-name/ge/get-graphql-schema/package.json diff --git a/pkgs/by-name/ge/get-graphql-schema/package.json b/pkgs/by-name/ge/get-graphql-schema/package.json deleted file mode 100644 index ade37982b91f9..0000000000000 --- a/pkgs/by-name/ge/get-graphql-schema/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "get-graphql-schema", - "bin": "dist/index.js", - "files": [ - "README.md", - "dist/" - ], - "version": "2.1.1", - "description": "Downloads the GraphQL Schema of an GraphQL endpoint URL", - "scripts": { - "build": "tsc", - "prepublish": "npm run build && chmod +x dist/index.js", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/graphcool/get-graphql-schema.git" - }, - "author": "Johannes Schickling ", - "license": "MIT", - "dependencies": { - "@types/chalk": "^0.4.31", - "@types/graphql": "^0.8.6", - "@types/minimist": "^1.2.0", - "@types/node": "^7.0.4", - "@types/node-fetch": "^1.6.7", - "chalk": "^1.1.3", - "graphql": "^0.9.1", - "minimist": "^1.2.0", - "node-fetch": "^1.6.3" - }, - "devDependencies": { - "typescript": "^2.1.5" - } -} diff --git a/pkgs/by-name/ge/get-graphql-schema/package.nix b/pkgs/by-name/ge/get-graphql-schema/package.nix index 25d9f839778ca..c32fb60544d0a 100644 --- a/pkgs/by-name/ge/get-graphql-schema/package.nix +++ b/pkgs/by-name/ge/get-graphql-schema/package.nix @@ -1,37 +1,36 @@ { 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"; @@ -40,4 +39,4 @@ mainProgram = "get-graphql-schema"; maintainers = with lib.maintainers; [ pyrox0 ]; }; -} +}) From b812646b79772bb7e9f21c8ecb935a55e7e8e7ff Mon Sep 17 00:00:00 2001 From: Pyrox Date: Sat, 3 Aug 2024 22:25:27 -0400 Subject: [PATCH 2/2] get-graphql-schema: Fix meta attributes --- pkgs/by-name/ge/get-graphql-schema/package.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ge/get-graphql-schema/package.nix b/pkgs/by-name/ge/get-graphql-schema/package.nix index c32fb60544d0a..fe6b35e9bcad9 100644 --- a/pkgs/by-name/ge/get-graphql-schema/package.nix +++ b/pkgs/by-name/ge/get-graphql-schema/package.nix @@ -32,9 +32,8 @@ stdenv.mkDerivation (finalAttrs: { ]; 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 ];