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..fe6b35e9bcad9 100644 --- a/pkgs/by-name/ge/get-graphql-schema/package.nix +++ b/pkgs/by-name/ge/get-graphql-schema/package.nix @@ -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 ]; }; -} +})