Skip to content

Commit 400b894

Browse files
authored
Upgrade repo dependencies (#940)
* Upgrade repo dependencies * Update lerna config * Add link to status documentation * Docs, drop priority of v3 notice
1 parent d184c13 commit 400b894

File tree

13 files changed

+1722
-1865
lines changed

13 files changed

+1722
-1865
lines changed

lerna.json

-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
}
88
},
99
"ignoreChanges": ["**/test/**", "**/*.md"],
10-
"useWorkspaces": true,
1110
"version": "2.48.0"
1211
}

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"test": "lerna run test"
1616
},
1717
"dependencies": {
18-
"@changesets/changelog-github": "^0.4.2",
19-
"@changesets/cli": "^2.20.0",
20-
"lerna": "^6.0.3",
21-
"prettier": "^2.7.1"
18+
"@changesets/changelog-github": "^0.4.8",
19+
"@changesets/cli": "^2.26.2",
20+
"lerna": "^7.1.4",
21+
"prettier": "^3.0.1"
2222
}
2323
}

simple-git/readme.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
A lightweight interface for running `git` commands in any [node.js](https://nodejs.org) application.
66

7-
# Version 3 - Out Now
8-
9-
From v3 of `simple-git` you can now import as an ES module, Common JS module or as TypeScript with bundled type
10-
definitions. Upgrading from v2 will be seamless for any application not relying on APIs that were marked as deprecated
11-
in v2 (deprecation notices were logged to `stdout` as `console.warn` in v2).
12-
137
# Installation
148

159
Use your favourite package manager:
@@ -183,6 +177,12 @@ Whether using a trailing callback or a Promise, tasks either return the raw `str
183177

184178
For type details of the response for each of the tasks, please see the [TypeScript definitions](https://github.com/steveukx/git-js/blob/main/simple-git/typings/simple-git.d.ts).
185179

180+
# Upgrading from Version 2
181+
182+
From v3 of `simple-git` you can now import as an ES module, Common JS module or as TypeScript with bundled type
183+
definitions. Upgrading from v2 will be seamless for any application not relying on APIs that were marked as deprecated
184+
in v2 (deprecation notices were logged to `stdout` as `console.warn` in v2).
185+
186186
# API
187187

188188
| API | What it does |

simple-git/src/lib/errors/git-construct-error.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ import { SimpleGitOptions } from '../types';
1111
* passed to the constructor.
1212
*/
1313
export class GitConstructError extends GitError {
14-
constructor(public readonly config: SimpleGitOptions, message: string) {
14+
constructor(
15+
public readonly config: SimpleGitOptions,
16+
message: string
17+
) {
1518
super(undefined, message);
1619
}
1720
}

simple-git/src/lib/errors/git-error.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ import type { SimpleGitTask } from '../types';
2626
```
2727
*/
2828
export class GitError extends Error {
29-
constructor(public task?: SimpleGitTask<any>, message?: string) {
29+
constructor(
30+
public task?: SimpleGitTask<any>,
31+
message?: string
32+
) {
3033
super(message);
3134
Object.setPrototypeOf(this, new.target.prototype);
3235
}

simple-git/src/lib/parsers/parse-list-log-summary.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ export const SPLITTER = ' ò ';
1212
const defaultFieldNames = ['hash', 'date', 'message', 'refs', 'author_name', 'author_email'];
1313

1414
function lineBuilder(tokens: string[], fields: string[]): any {
15-
return fields.reduce((line, field, index) => {
16-
line[field] = tokens[index] || '';
17-
return line;
18-
}, Object.create({ diff: null }) as any);
15+
return fields.reduce(
16+
(line, field, index) => {
17+
line[field] = tokens[index] || '';
18+
return line;
19+
},
20+
Object.create({ diff: null }) as any
21+
);
1922
}
2023

2124
export function createListLogSummaryParser<T = any>(

simple-git/src/lib/responses/FileStatusSummary.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ export const fromPathRegex = /^(.+) -> (.+)$/;
55
export class FileStatusSummary implements FileStatusResult {
66
public readonly from: string | undefined;
77

8-
constructor(public path: string, public index: string, public working_dir: string) {
8+
constructor(
9+
public path: string,
10+
public index: string,
11+
public working_dir: string
12+
) {
913
if ('R' === index + working_dir) {
1014
const detail = fromPathRegex.exec(path) || [null, path, path];
1115
this.from = detail[1] || '';

simple-git/src/lib/responses/TagList.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { TagResult } from '../../../typings';
22

33
export class TagList implements TagResult {
4-
constructor(public readonly all: string[], public readonly latest: string | undefined) {}
4+
constructor(
5+
public readonly all: string[],
6+
public readonly latest: string | undefined
7+
) {}
58
}
69

710
export const parseTagList = function (data: string, customSort = false) {

simple-git/src/lib/utils/git-output-streams.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { TaskResponseFormat } from '../types';
22

33
export class GitOutputStreams<T extends TaskResponseFormat = Buffer> {
4-
constructor(public readonly stdOut: T, public readonly stdErr: T) {}
4+
constructor(
5+
public readonly stdOut: T,
6+
public readonly stdErr: T
7+
) {}
58

69
asStrings(): GitOutputStreams<string> {
710
return new GitOutputStreams(this.stdOut.toString('utf8'), this.stdErr.toString('utf8'));

simple-git/test/unit/__fixtures__/responses/diff.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ function change(count: number, sign: '-' | '+') {
1818
function line(insertions: SmallNumber, deletions: SmallNumber, fileName: string) {
1919
return `
2020
${fileName} | ${insertions + deletions} ${''.padEnd(insertions, '+')}${''.padEnd(
21-
deletions,
22-
'-'
23-
)}`;
21+
deletions,
22+
'-'
23+
)}`;
2424
}
2525

2626
export function diffSummarySingleFile(
@@ -48,9 +48,9 @@ export function diffSummaryMultiFile(
4848

4949
stdOut += `
5050
${files.length} file${files.length === 1 ? '' : 's'} changed ${change(add, '+')}${change(
51-
del,
52-
'-'
53-
)}
51+
del,
52+
'-'
53+
)}
5454
`;
5555
return createFixture(stdOut, '');
5656
}

simple-git/test/unit/promises.spec.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,13 @@ describe('promises', () => {
8484
const resolveMockCallCount = (c: jest.Mock) => c.mock.calls.length;
8585

8686
function byName<T>(resolver: (c: jest.Mock) => T) {
87-
return callbacks.reduce((all, callback) => {
88-
all[callback.getMockName()] = resolver(callback);
89-
return all;
90-
}, {} as { [key: string]: T });
87+
return callbacks.reduce(
88+
(all, callback) => {
89+
all[callback.getMockName()] = resolver(callback);
90+
return all;
91+
},
92+
{} as { [key: string]: T }
93+
);
9194
}
9295

9396
return {

simple-git/typings/response.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ export interface FileStatusResult {
305305
index: string;
306306

307307
/** Second digit of the status code of the file. Represents status of the working directory
308-
if no merge conflicts, otherwise represents status of other side of a merge. */
308+
if no merge conflicts, otherwise represents status of other side of a merge.
309+
See https://git-scm.com/docs/git-status#_short_format for full documentation of possible
310+
values and their meanings. */
309311
working_dir: string;
310312
}
311313

0 commit comments

Comments
 (0)