@simbo/git-changes 1.0.3 → 2.0.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @simbo/git-changes
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 2ded9ff: Upgrade Execa to ^10.0.1 for running Prettier, locating executables
8
+ and reading Git changes.
9
+
10
+ Execa 10 requires Node.js 22 or newer, dropping Node.js 20 support for these
11
+ packages. Upgrade the runtime before updating.
12
+
13
+ - 2ded9ff: Require Node.js ^22.22.2 || ^24.15.0 || >=26.0.0 across all packages
14
+ to align with the runtime requirements of the updated dependencies. Node.js
15
+ 20, 21, 23 and 25, as well as earlier Node.js 22 and 24 releases, are no
16
+ longer supported. Upgrade to a supported Node.js version before updating these
17
+ packages.
18
+
19
+ ### Patch Changes
20
+
21
+ - 2ded9ff: Update documentation links from `simbo.codes` to `simbo.de`,
22
+ including the package READMEs and generated package list.
23
+ - 2ded9ff: Document the shared Node.js requirements and updated peer
24
+ dependencies. Correct API documentation links, installation and usage
25
+ examples, and repository development instructions. Clarify string count
26
+ conversion, literal replacements and import metadata fallbacks.
27
+ - 2ded9ff: Preserve the original error as `cause` when wrapping read or command
28
+ failures.
29
+ - Updated dependencies [2ded9ff]
30
+ - Updated dependencies [2ded9ff]
31
+ - Updated dependencies [2ded9ff]
32
+ - @simbo/find-git-repository-root@2.0.0
33
+
3
34
  ## 1.0.3
4
35
 
5
36
  ### Patch Changes
package/README.md CHANGED
@@ -5,6 +5,10 @@
5
5
  A library to read, parse and provide Git changes information for a local
6
6
  repository.
7
7
 
8
+ ## Requirements
9
+
10
+ Requires Node.js `^22.22.2 || ^24.15.0 || >=26.0.0`.
11
+
8
12
  ## Installation
9
13
 
10
14
  Install `@simbo/git-changes` from the npm registry:
@@ -23,7 +27,7 @@ const changes = await getGitChanges('/path/to/repo');
23
27
  ```
24
28
 
25
29
  For a complete API reference, see the
26
- [documentation](https://simbo.codes/packages/modules/_simbo_git-changes/).
30
+ [documentation](https://simbo.de/packages/modules/_simbo_git-changes/).
27
31
 
28
32
  ## License
29
33
 
@@ -38,7 +38,7 @@ export async function getGitChanges(workingDir = cwd()) {
38
38
  : error instanceof Error
39
39
  ? error.message
40
40
  : `Unknown error (${String(error)})`;
41
- throw new Error(`Failed to get Git changes: ${reason}`);
41
+ throw new Error(`Failed to get Git changes: ${reason}`, { cause: error });
42
42
  }
43
43
  }
44
44
  //# sourceMappingURL=get-git-changes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-git-changes.js","sourceRoot":"","sources":["../src/get-git-changes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,UAAU,GAAG,GAAG,EAAE;IACpD,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAEzD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,kBAAkB,UAAU,oCAAoC,CAAC,CAAC;IACpF,CAAC;IAED,IAAI,CAAC;QACH;;;;;;;;;;;;;;WAcG;QACH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAA,uCAAuC,CAAC;QAEjG,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,GACV,KAAK,YAAY,UAAU;YACzB,CAAC,CAAC,KAA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,KAAK,CAAC,GAAG,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,8BAA8B,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { GitChangeStatus } from './git-change-status.enum.js';
2
2
  /**
3
- * Common git change statuses for both staged and unstaged changes.
3
+ * Common Git change statuses for both staged and unstaged changes.
4
4
  */
5
5
  export type GitChangeStatusCommon = GitChangeStatus.Modified | GitChangeStatus.Deleted;
6
6
  /**
@@ -8,11 +8,11 @@ export type GitChangeStatusCommon = GitChangeStatus.Modified | GitChangeStatus.D
8
8
  */
9
9
  export type GitChangeStatusWithOriginPath = GitChangeStatus.Renamed | GitChangeStatus.Copied;
10
10
  /**
11
- * Added git change status (only for staged changes).
11
+ * Added Git change status (only for staged changes).
12
12
  */
13
13
  export type GitChangeStatusAdded = GitChangeStatus.Added;
14
14
  /**
15
- * Untracked git change status (only for unstaged changes).
15
+ * Untracked Git change status (only for unstaged changes).
16
16
  */
17
17
  export type GitChangeStatusUntracked = GitChangeStatus.Untracked;
18
18
  export type GitChangeStagedStatus = GitChangeStatusCommon | GitChangeStatusAdded | GitChangeStatusWithOriginPath;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The separator used in the output of the git status command.
2
+ * The separator used in the output of the Git status command.
3
3
  * This is a null character, which is used to separate entries in the output.
4
4
  */
5
5
  export declare const ENTRY_SEPARATOR = "\0";
@@ -1,6 +1,6 @@
1
1
  import { GitChangeStatus } from './git-change-status.enum.js';
2
2
  /**
3
- * The separator used in the output of the git status command.
3
+ * The separator used in the output of the Git status command.
4
4
  * This is a null character, which is used to separate entries in the output.
5
5
  */
6
6
  export const ENTRY_SEPARATOR = '\0';
@@ -1,8 +1,8 @@
1
1
  import type { GitChange } from './git-changes.types.js';
2
2
  /**
3
- * Parses the output of the git status command and returns a map of Git changes.
3
+ * Parses the output of the Git status command and returns a map of Git changes.
4
4
  *
5
- * @param output - The output string from the git status command.
5
+ * @param output - The output string from the Git status command.
6
6
  * @returns A ReadonlyMap of file paths to their corresponding GitChange objects.
7
7
  */
8
8
  export declare function parseGitStatusOutput(output: string): ReadonlyMap<string, GitChange>;
@@ -2,9 +2,9 @@ import { GitChangeStatus } from './git-change-status.enum.js';
2
2
  import { ENTRY_PATH_INDEX, ENTRY_SEPARATOR, ENTRY_STATUS_INDEX, ENTRY_STATUS_LENGTH } from './git-status-constants.js';
3
3
  import { parseGitChangeStatus } from './parse-git-change-status.js';
4
4
  /**
5
- * Parses the output of the git status command and returns a map of Git changes.
5
+ * Parses the output of the Git status command and returns a map of Git changes.
6
6
  *
7
- * @param output - The output string from the git status command.
7
+ * @param output - The output string from the Git status command.
8
8
  * @returns A ReadonlyMap of file paths to their corresponding GitChange objects.
9
9
  */
10
10
  export function parseGitStatusOutput(output) {
@@ -18,7 +18,7 @@ export function parseGitStatusOutput(output) {
18
18
  }
19
19
  const { staged, unstaged } = parseGitChangeStatus(entry.slice(ENTRY_STATUS_INDEX, ENTRY_STATUS_LENGTH));
20
20
  const path = entry.slice(ENTRY_PATH_INDEX);
21
- if ((!staged && !unstaged) || !path) {
21
+ if (!path || (!staged && !unstaged)) {
22
22
  continue;
23
23
  }
24
24
  // For entries that are renamed or copied, the current entry contains the old path,
@@ -1 +1 @@
1
- {"version":3,"file":"parse-git-status-output.js","sourceRoot":"","sources":["../src/parse-git-status-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACvH,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAc;IACjD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC7C,MAAM,OAAO,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C,GAAG,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;YACpF,CAAC;YACD,SAAS;QACX,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simbo/git-changes",
3
3
  "description": "A library to read, parse and provide Git changes information from `git status` for a local repository.",
4
- "version": "1.0.3",
4
+ "version": "2.0.0",
5
5
  "keywords": [
6
6
  "git",
7
7
  "changes",
@@ -17,10 +17,13 @@
17
17
  "author": "Simon Lepel <simbo@simbo.de> (https://simbo.de/)",
18
18
  "license": "MIT",
19
19
  "homepage": "http://github.com/simbo/packages/tree/main/packages/git-changes",
20
- "repository": "github:simbo/packages",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "github:simbo/packages"
23
+ },
21
24
  "bugs": "https://github.com/simbo/packages/issues",
22
25
  "engines": {
23
- "node": ">=20"
26
+ "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
24
27
  },
25
28
  "type": "module",
26
29
  "exports": {
@@ -33,23 +36,23 @@
33
36
  "README.md"
34
37
  ],
35
38
  "dependencies": {
36
- "execa": "^9.6.1",
37
- "@simbo/find-git-repository-root": "1.0.2"
39
+ "@simbo/find-git-repository-root": "2.0.0",
40
+ "execa": "^10.0.1"
38
41
  },
39
42
  "devDependencies": {
40
- "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
41
- "@types/node": "^24.10.4",
42
- "@vitest/coverage-v8": "^3.2.4",
43
- "@vitest/ui": "^3.2.4",
44
- "baseline-browser-mapping": "^2.9.8",
45
- "eslint": "^9.39.2",
46
- "jiti": "^2.6.1",
47
- "prettier": "^3.7.4",
48
- "typescript": "^5.9.3",
49
- "vitest": "^3.2.4",
50
- "@simbo/eslint-config": "2.0.4",
51
- "@simbo/tsconfig": "1.0.4",
52
- "@simbo/prettier-config": "2.0.0"
43
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.1",
44
+ "@simbo/eslint-config": "3.0.0",
45
+ "@simbo/prettier-config": "3.0.0",
46
+ "@simbo/tsconfig": "2.0.0",
47
+ "@types/node": "^24.13.6",
48
+ "@vitest/coverage-v8": "^5.0.1",
49
+ "@vitest/ui": "^5.0.1",
50
+ "baseline-browser-mapping": "^2.11.25",
51
+ "eslint": "^10.11.0",
52
+ "jiti": "^2.7.0",
53
+ "prettier": "^3.9.8",
54
+ "typescript": "^6.0.3",
55
+ "vitest": "^5.0.1"
53
56
  },
54
57
  "scripts": {
55
58
  "build": "tsc --project tsconfig.build.json",