From da8d57eafd7c0f9f800ffed5f7a691fdef3d5487 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 3 Apr 2024 19:37:31 -0700 Subject: [PATCH] Build: Replace grunt-git-authors dependency with simple git-log command I considered using git-shortlog as `git shortlog -se --format='%aE' --no-merges`, which indeed gets us fairly close. But, the available sort options there (as of git 2.41.0) are by name or by count, not by first appearance. So, instead, use git log, and pipe it to awk to deduplicate. This is similar to piping to `sort | uniq`, except without the sorting. --- package-lock.json | 31 ------------------------------- package.json | 3 +-- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2657353bc..9e99c0dcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,6 @@ "grunt-contrib-connect": "^3.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-qunit": "^5.1.1", - "grunt-git-authors": "^3.2.0", "grunt-search": "^0.1.8", "kleur": "4.1.5", "npm-reporter": "file:./test/cli/fixtures/npm-reporter", @@ -4878,15 +4877,6 @@ "integrity": "sha512-bXE7Dyc1i6oQElDG0jMRZJrRAn9QR2xyyFGmBdZleNmyQX0FqGYmhZIrIrpPfm/w//LTo4tVQGOGQcGCb5q9uw==", "dev": true }, - "node_modules/grunt-git-authors": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/grunt-git-authors/-/grunt-git-authors-3.2.0.tgz", - "integrity": "sha512-uDJGPKoO7H93wUnnDPsNIdIrfhifyhQln2tG1ulH25ceFeKuKTrTKYytzTUuxeaspss2t66amQlgaqUS9yo+2w==", - "dev": true, - "dependencies": { - "spawnback": "~1.0.0" - } - }, "node_modules/grunt-known-options": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", @@ -7826,12 +7816,6 @@ "node": ">=8" } }, - "node_modules/spawnback": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.1.tgz", - "integrity": "sha512-340ZqtqJzWAZtHwaCC2gx4mdQOnkUWAWNDp7y0bCEatdjmgQ4j7b0qQ7qO5WIJWx/luNrKcrYzpKbH3NTR030A==", - "dev": true - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -12340,15 +12324,6 @@ } } }, - "grunt-git-authors": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/grunt-git-authors/-/grunt-git-authors-3.2.0.tgz", - "integrity": "sha512-uDJGPKoO7H93wUnnDPsNIdIrfhifyhQln2tG1ulH25ceFeKuKTrTKYytzTUuxeaspss2t66amQlgaqUS9yo+2w==", - "dev": true, - "requires": { - "spawnback": "~1.0.0" - } - }, "grunt-known-options": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-2.0.0.tgz", @@ -14549,12 +14524,6 @@ "which": "^2.0.1" } }, - "spawnback": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/spawnback/-/spawnback-1.0.1.tgz", - "integrity": "sha512-340ZqtqJzWAZtHwaCC2gx4mdQOnkUWAWNDp7y0bCEatdjmgQ4j7b0qQ7qO5WIJWx/luNrKcrYzpKbH3NTR030A==", - "dev": true - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", diff --git a/package.json b/package.json index 2423cbfdf..96312c2ea 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,6 @@ "grunt-contrib-connect": "^3.0.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-qunit": "^5.1.1", - "grunt-git-authors": "^3.2.0", "grunt-search": "^0.1.8", "kleur": "4.1.5", "npm-reporter": "file:./test/cli/fixtures/npm-reporter", @@ -96,7 +95,7 @@ "test-nolint": "npm run build && npm run test-main && npm run test-cli", "test-integration": "npm run build && node bin/qunit.js test/integration/*.js", "browserstack": "browserstack-runner -v", - "authors": "grunt authors", + "authors": "(echo 'Authors ordered by first contribution\n' && git log --format='%aN <%aE>' --no-merges --reverse | awk '!seen[$0]++') | tee AUTHORS.txt", "coverage": "npm run build-coverage && npm run coverage-cli && npm run coverage-main && nyc report", "coverage-cli": "nyc --use-spawn-wrap --silent bin/qunit.js test/cli/*.js", "coverage-main": "nyc instrument --in-place qunit/ && grunt connect:base qunit"