about summary refs log tree commit diff
path: root/pkgs/by-name/au
diff options
context:
space:
mode:
authorPyrox2024-08-02 23:48:42 -0400
committerPyrox2024-08-03 22:24:14 -0400
commit04c0c779b7ccb53b9b99bd01bca41b46e8f7b139 (patch)
treedce77a94814e284cddc180740afed888ef9cff28 /pkgs/by-name/au
parente32d4c5654399d6bf0f724b9114fb76363bdd660 (diff)
auto-changelog: remove usage of mkYarnPackage
Diffstat (limited to 'pkgs/by-name/au')
-rw-r--r--pkgs/by-name/au/auto-changelog/package.json100
-rw-r--r--pkgs/by-name/au/auto-changelog/package.nix36
2 files changed, 28 insertions, 108 deletions
diff --git a/pkgs/by-name/au/auto-changelog/package.json b/pkgs/by-name/au/auto-changelog/package.json
deleted file mode 100644
index 573119c376c5..000000000000
--- a/pkgs/by-name/au/auto-changelog/package.json
+++ /dev/null
@@ -1,100 +0,0 @@
-{
-  "name": "auto-changelog",
-  "version": "2.4.0",
-  "description": "Command line tool for generating a changelog from git tags and commit history",
-  "main": "./src/index.js",
-  "bin": {
-    "auto-changelog": "./src/index.js"
-  },
-  "engines": {
-    "node": ">=8.3"
-  },
-  "scripts": {
-    "lint": "standard --verbose | snazzy",
-    "lint-fix": "standard --fix",
-    "lint-markdown": "markdownlint README.md test/data/*.md",
-    "test": "cross-env NODE_ENV=test mocha -r @babel/register test",
-    "test-coverage": "cross-env NODE_ENV=test nyc mocha test",
-    "report-coverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json",
-    "preversion": "npm run lint && npm run test",
-    "version": "node src/index.js --package && git add CHANGELOG.md",
-    "generate-test-data": "cross-env NODE_ENV=test node scripts/generate-test-data.js"
-  },
-  "author": "Pete Cook <pete@cookpete.com> (https://github.com/cookpete)",
-  "homepage": "https://github.com/CookPete/auto-changelog",
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/CookPete/auto-changelog.git"
-  },
-  "bugs": {
-    "url": "https://github.com/CookPete/auto-changelog/issues"
-  },
-  "keywords": [
-    "auto",
-    "automatic",
-    "changelog",
-    "change",
-    "log",
-    "generator",
-    "git",
-    "commit",
-    "commits",
-    "history"
-  ],
-  "license": "MIT",
-  "dependencies": {
-    "commander": "^7.2.0",
-    "handlebars": "^4.7.7",
-    "node-fetch": "^2.6.1",
-    "parse-github-url": "^1.0.2",
-    "semver": "^7.3.5"
-  },
-  "devDependencies": {
-    "@babel/core": "^7.14.3",
-    "@babel/register": "^7.13.16",
-    "babel-plugin-istanbul": "^6.0.0",
-    "babel-plugin-rewire": "^1.2.0",
-    "chai": "^4.3.4",
-    "codecov": "^3.8.2",
-    "cross-env": "^7.0.3",
-    "markdownlint-cli": "^0.30.0",
-    "mocha": "^9.2.0",
-    "nyc": "^15.1.0",
-    "snazzy": "^9.0.0",
-    "standard": "^16.0.3"
-  },
-  "babel": {
-    "env": {
-      "test": {
-        "plugins": [
-          "istanbul",
-          "rewire"
-        ]
-      }
-    }
-  },
-  "standard": {
-    "ignore": [
-      "test/data/"
-    ]
-  },
-  "nyc": {
-    "all": true,
-    "include": "src",
-    "exclude": "src/index.js",
-    "sourceMap": false,
-    "instrument": false,
-    "report-dir": "./coverage",
-    "temp-dir": "./coverage/.nyc_output",
-    "require": [
-      "@babel/register"
-    ],
-    "reporter": [
-      "text",
-      "html"
-    ]
-  },
-  "auto-changelog": {
-    "breakingPattern": "Breaking change"
-  }
-}
diff --git a/pkgs/by-name/au/auto-changelog/package.nix b/pkgs/by-name/au/auto-changelog/package.nix
index 44a4273b9042..ba35a26d6e37 100644
--- a/pkgs/by-name/au/auto-changelog/package.nix
+++ b/pkgs/by-name/au/auto-changelog/package.nix
@@ -1,25 +1,45 @@
 {
   lib,
-  mkYarnPackage,
+  stdenv,
   fetchYarnDeps,
-  fetchFromGitHub
-}: mkYarnPackage rec {
+  fetchFromGitHub,
+  yarnConfigHook,
+  npmHooks,
+  nodejs,
+  git,
+}:
+stdenv.mkDerivation (finalAttrs: {
   pname = "auto-changelog";
   version = "2.4.0";
 
   src = fetchFromGitHub {
     owner = "cookpete";
     repo = "auto-changelog";
-    rev = "v${version}";
+    rev = "v${finalAttrs.version}";
     hash = "sha256-qgJ/TVyViMhISt/EfCWV7XWQLXKTeZalGHFG905Ma5I=";
   };
 
-  packageJSON = ./package.json;
-  offlineCache = fetchYarnDeps {
-    yarnLock = "${src}/yarn.lock";
+  yarnOfflineCache = fetchYarnDeps {
+    yarnLock = "${finalAttrs.src}/yarn.lock";
     hash = "sha256-rP/Xt0txwfEUmGZ0CyHXSEG9zSMtv8wr5M2Na+6PbyQ=";
   };
 
+  nativeBuildInputs = [
+    yarnConfigHook
+    npmHooks.npmInstallHook
+    nodejs
+  ];
+
+  doCheck = true;
+
+  nativeCheckInputs = [ git ];
+
+  checkPhase = ''
+    runHook preCheck
+    yarn --offline run test -i -g 'compileTemplate'
+    runHook postCheck
+  '';
+
   meta = {
     description = "Command line tool for generating a changelog from git tags and commit history";
     homepage = "https://github.com/cookpete/auto-changelog";
@@ -28,4 +48,4 @@
     mainProgram = "auto-changelog";
     maintainers = with lib.maintainers; [ pyrox0 ];
   };
-}
+})