about summary refs log tree commit diff
path: root/pkgs/by-name/ge
diff options
context:
space:
mode:
authorPyrox2024-08-02 23:59:55 -0400
committerPyrox2024-08-03 22:23:54 -0400
commit0502f67fa6f46db44b0f7e9c08bf31b9eb3eb223 (patch)
treeeccc009a33c489aa1c38a135efa1f245a0294804 /pkgs/by-name/ge
parente32d4c5654399d6bf0f724b9114fb76363bdd660 (diff)
get-graphql-schema: remove usage of mkYarnPackage
Diffstat (limited to 'pkgs/by-name/ge')
-rw-r--r--pkgs/by-name/ge/get-graphql-schema/package.json35
-rw-r--r--pkgs/by-name/ge/get-graphql-schema/package.nix35
2 files changed, 17 insertions, 53 deletions
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 ade37982b91f..000000000000
--- 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 <johannes@graph.cool>",
-  "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 25d9f839778c..c32fb60544d0 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 ];
   };
-}
+})