From 590bc144c2a0d1d43e05897730e9b58ea08fa9a8 Mon Sep 17 00:00:00 2001 From: Pyrox Date: Wed, 26 Jun 2024 00:39:39 -0400 Subject: [PATCH] get-graphql-schema: Move out of nodePackages --- .../ge/get-graphql-schema/package.json | 35 ++++++++++++++ .../by-name/ge/get-graphql-schema/package.nix | 43 +++++++++++++++++ pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 46 ------------------- 5 files changed, 79 insertions(+), 47 deletions(-) create mode 100644 pkgs/by-name/ge/get-graphql-schema/package.json create mode 100644 pkgs/by-name/ge/get-graphql-schema/package.nix diff --git a/pkgs/by-name/ge/get-graphql-schema/package.json b/pkgs/by-name/ge/get-graphql-schema/package.json new file mode 100644 index 000000000000..ade37982b91f --- /dev/null +++ b/pkgs/by-name/ge/get-graphql-schema/package.json @@ -0,0 +1,35 @@ +{ + "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 new file mode 100644 index 000000000000..25d9f839778c --- /dev/null +++ b/pkgs/by-name/ge/get-graphql-schema/package.nix @@ -0,0 +1,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 ]; + }; +} diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 8f754479b625..f559d655c768 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -86,6 +86,7 @@ mapAliases { git-ssb = throw "git-ssb was removed because it was broken"; # added 2023-08-21 inherit (pkgs) gitmoji-cli; # added 2023-09-23 glob = pkgs.node-glob; # added 2023-08-18 + inherit (pkgs) get-graphql-schema; # added 2024-06-26 inherit (pkgs) gqlint; # added 2023-08-19 inherit (pkgs) graphite-cli; # added 2024-01-25 inherit (pkgs) graphqurl; # added 2023-08-19 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index d04e5184b9f9..8c1af62a2d75 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -112,7 +112,6 @@ , "fx" , "ganache" , "gatsby-cli" -, "get-graphql-schema" , "git-run" , "git-standup" , "@gitbeaker/cli" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index b2c235e87c2c..c8ecdfd9639f 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -28771,15 +28771,6 @@ let sha512 = "tdcqOOpwArNjEr0gNQKCXwaNCWnQJrog14nJNQPeemcLnXQUUGrsCWpWkVKt46zLjcS6/KGoayeJfHHyPDlvwA=="; }; }; - "graphql-14.7.0" = { - name = "graphql"; - packageName = "graphql"; - version = "14.7.0"; - src = fetchurl { - url = "https://registry.npmjs.org/graphql/-/graphql-14.7.0.tgz"; - sha512 = "l0xWZpoPKpppFzMfvVyFmp9vLN7w/ZZJPefUicMCepfJeQ8sMcztloGYY9DfjVPo6tIUDzU5Hw3MUbIjj9AVVA=="; - }; - }; "graphql-15.3.0" = { name = "graphql"; packageName = "graphql"; @@ -74233,43 +74224,6 @@ in bypassCache = true; reconstructLock = true; }; - get-graphql-schema = nodeEnv.buildNodePackage { - name = "get-graphql-schema"; - packageName = "get-graphql-schema"; - version = "2.1.2"; - src = fetchurl { - url = "https://registry.npmjs.org/get-graphql-schema/-/get-graphql-schema-2.1.2.tgz"; - sha512 = "1z5Hw91VrE3GrpCZE6lE8Dy+jz4kXWesLS7rCSjwOxf5BOcIedAZeTUJRIeIzmmR+PA9CKOkPTYFRJbdgUtrxA=="; - }; - dependencies = [ - sources."ansi-styles-3.2.1" - sources."chalk-2.4.2" - sources."color-convert-1.9.3" - sources."color-name-1.1.3" - sources."encoding-0.1.13" - sources."escape-string-regexp-1.0.5" - sources."graphql-14.7.0" - sources."has-flag-3.0.0" - sources."iconv-lite-0.6.3" - sources."iterall-1.3.0" - sources."minimist-1.2.8" - sources."node-fetch-2.7.0" - sources."safer-buffer-2.1.2" - sources."supports-color-5.5.0" - sources."tr46-0.0.3" - sources."webidl-conversions-3.0.1" - sources."whatwg-url-5.0.0" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "Downloads the GraphQL Schema of an GraphQL endpoint URL"; - homepage = "https://github.com/graphcool/get-graphql-schema#readme"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; git-run = nodeEnv.buildNodePackage { name = "git-run"; packageName = "git-run";