watskeburt 4.2.2 → 5.0.0-beta-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2022-2024 Sander Verweij
3
+ Copyright (c) 2022-2025 Sander Verweij
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,14 +1,15 @@
1
1
  import { spawn } from "node:child_process";
2
+ const SHA1_LENGTH = 40;
2
3
  export async function getStatusShort(pSpawnFunction = spawn) {
3
4
  const lErrorMap = new Map([
4
5
  [129, `'${process.cwd()}' does not seem to be a git repository`],
5
6
  ]);
6
- const lResult = await getGitResult(
7
+ const lStatusOutput = await getGitResult(
7
8
  ["status", "--porcelain"],
8
9
  lErrorMap,
9
10
  pSpawnFunction,
10
11
  );
11
- return lResult;
12
+ return lStatusOutput;
12
13
  }
13
14
  export async function getDiffLines(
14
15
  pOldRevision,
@@ -22,23 +23,22 @@ export async function getDiffLines(
22
23
  ],
23
24
  [129, `'${process.cwd()}' does not seem to be a git repository`],
24
25
  ]);
25
- const lResult = await getGitResult(
26
+ const lDiffOutput = await getGitResult(
26
27
  pNewRevision
27
28
  ? ["diff", pOldRevision, pNewRevision, "--name-status"]
28
29
  : ["diff", pOldRevision, "--name-status"],
29
30
  lErrorMap,
30
31
  pSpawnFunction,
31
32
  );
32
- return lResult;
33
+ return lDiffOutput;
33
34
  }
34
35
  export async function getSHA(pSpawnFunction = spawn) {
35
- const lSha1Length = 40;
36
- const lResult = await getGitResult(
36
+ const lRevParseOutput = await getGitResult(
37
37
  ["rev-parse", "HEAD"],
38
38
  new Map(),
39
39
  pSpawnFunction,
40
40
  );
41
- return lResult.slice(0, lSha1Length);
41
+ return lRevParseOutput.slice(0, SHA1_LENGTH);
42
42
  }
43
43
  function getGitResult(pArguments, pErrorMap, pSpawnFunction) {
44
44
  const lGit = pSpawnFunction("git", pArguments, {
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "4.2.2";
1
+ export const VERSION = "5.0.0-beta-3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "watskeburt",
3
- "version": "4.2.2",
3
+ "version": "5.0.0-beta-3",
4
4
  "description": "List files changed since a git revision",
5
5
  "keywords": [
6
6
  "git",
@@ -45,7 +45,7 @@
45
45
  "README.md"
46
46
  ],
47
47
  "engines": {
48
- "node": "^18||>=20"
48
+ "node": "^20.12||^22.13||>=24.0"
49
49
  },
50
50
  "scripts": {
51
51
  "test": "echo see github for test, build and analysis scripts"