Skip to content

Commit 2bd2efc

Browse files
committed
Update @types/node, remove the typescript resolution override, target es2018 to cater for new regexp format.
Update numstat and abort integration tests to be more robust
1 parent 260a6d9 commit 2bd2efc

File tree

9 files changed

+45
-22
lines changed

9 files changed

+45
-22
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"simple-git"
88
],
99
"resolutions": {
10-
"typescript": "4.7.4",
1110
"jest": "29.7.0"
1211
},
1312
"scripts": {

packages/test-typescript-consumer/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"directory": "packages/test-typescript-consumer"
2626
},
2727
"devDependencies": {
28-
"jest": "^29.7.0"
28+
"jest": "^29.7.0",
29+
"typescript": "^5.7.3"
2930
}
3031
}

simple-git/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@simple-git/babel-config": "^1.0.0",
2424
"@types/debug": "^4.1.12",
2525
"@types/jest": "^29.2.2",
26-
"@types/node": "^22.13.5",
26+
"@types/node": "^22.15.30",
2727
"esbuild": "^0.25.0",
2828
"esbuild-node-externals": "^1.18.0",
2929
"jest": "^29.7.0",

simple-git/src/lib/utils/task-options.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
filterType,
77
} from './argument-filters';
88
import { asFunction, isUserFunction, last } from './util';
9-
import { Maybe, Options, OptionsValues } from '../types';
9+
import { Maybe, Options } from '../types';
1010
import { isPathSpec } from '../args/pathspec';
1111

1212
export function appendTaskOptions<T extends Options = Options>(
@@ -18,7 +18,7 @@ export function appendTaskOptions<T extends Options = Options>(
1818
}
1919

2020
return Object.keys(options).reduce((commands: string[], key: string) => {
21-
const value: OptionsValues = options[key];
21+
const value = options[key];
2222

2323
if (isPathSpec(value)) {
2424
commands.push(value);

simple-git/src/lib/utils/util.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1+
import { Buffer } from 'node:buffer';
12
import { exists, FOLDER } from '@kwsites/file-exists';
23
import { Maybe } from '../types';
34

5+
type Callable = (...args: unknown[]) => unknown;
6+
47
export const NULL = '\0';
58

6-
export const NOOP: (...args: any[]) => void = () => {};
9+
export const NOOP: Callable = () => {};
710

811
/**
912
* Returns either the source argument when it is a `Function`, or the default
1013
* `NOOP` function constant
1114
*/
12-
export function asFunction<T extends () => any>(source: T | any): T {
13-
return typeof source === 'function' ? source : NOOP;
15+
export function asFunction<T>(source: T | unknown): Callable {
16+
if (typeof source !== 'function') {
17+
return NOOP;
18+
}
19+
return source as Callable;
1420
}
1521

1622
/**

simple-git/test/integration/log-numstat.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('log-numstat', function () {
2020
ae: '%ae',
2121
},
2222
'--all': null,
23-
'--since': '2024-02-04',
23+
'--since': '2025-01-01',
2424
'--numstat': null,
2525
});
2626

simple-git/test/integration/plugin.abort.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ describe('timeout', () => {
3232

3333
const repos = await Promise.all('abcdef'.split('').map((p) => context.dir(p)));
3434

35-
repos.map((baseDir) => {
35+
const tasks = repos.map((baseDir) => {
3636
const git = newSimpleGit({ baseDir, abort });
3737
if (baseDir.endsWith('a')) {
3838
return promiseError(git.init());
3939
}
4040
return promiseError(git.clone(upstream, baseDir));
4141
});
4242

43-
await wait(0);
43+
await tasks[0];
4444
controller.abort();
4545

4646
const results = await Promise.all(

simple-git/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"allowJs": false,
44
"skipLibCheck": false,
5-
"target": "es2015",
5+
"target": "es2018",
66
"module": "commonjs",
77
"lib": ["dom", "esnext"],
88
"rootDir": ".",

yarn.lock

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2959,6 +2959,7 @@ __metadata:
29592959
"@simple-git/babel-config": "npm:*"
29602960
jest: "npm:^29.7.0"
29612961
simple-git: "npm:*"
2962+
typescript: "npm:^5.7.3"
29622963
languageName: unknown
29632964
linkType: soft
29642965

@@ -3174,7 +3175,7 @@ __metadata:
31743175
languageName: node
31753176
linkType: hard
31763177

3177-
"@types/node@npm:*, @types/node@npm:^22.13.5":
3178+
"@types/node@npm:*":
31783179
version: 22.13.8
31793180
resolution: "@types/node@npm:22.13.8"
31803181
dependencies:
@@ -3190,6 +3191,15 @@ __metadata:
31903191
languageName: node
31913192
linkType: hard
31923193

3194+
"@types/node@npm:^22.15.30":
3195+
version: 22.15.30
3196+
resolution: "@types/node@npm:22.15.30"
3197+
dependencies:
3198+
undici-types: "npm:~6.21.0"
3199+
checksum: 10/16d03f30df7851eea4f31d9a2470a53b24dc7d3909ed1782e2538e3aafe398451da17b83d6f730dfdcd0a843ccdbe841176ecfbde6bdb51963e8d11f58a10ade
3200+
languageName: node
3201+
linkType: hard
3202+
31933203
"@types/normalize-package-data@npm:^2.4.0":
31943204
version: 2.4.4
31953205
resolution: "@types/normalize-package-data@npm:2.4.4"
@@ -8962,7 +8972,7 @@ __metadata:
89628972
"@simple-git/babel-config": "npm:^1.0.0"
89638973
"@types/debug": "npm:^4.1.12"
89648974
"@types/jest": "npm:^29.2.2"
8965-
"@types/node": "npm:^22.13.5"
8975+
"@types/node": "npm:^22.15.30"
89668976
debug: "npm:^4.4.0"
89678977
esbuild: "npm:^0.25.0"
89688978
esbuild-node-externals: "npm:^1.18.0"
@@ -9595,23 +9605,23 @@ __metadata:
95959605
languageName: node
95969606
linkType: hard
95979607

9598-
"typescript@npm:4.7.4":
9599-
version: 4.7.4
9600-
resolution: "typescript@npm:4.7.4"
9608+
"typescript@npm:>=3 < 6, typescript@npm:^5.7.3":
9609+
version: 5.8.3
9610+
resolution: "typescript@npm:5.8.3"
96019611
bin:
96029612
tsc: bin/tsc
96039613
tsserver: bin/tsserver
9604-
checksum: 10/f056b2313a7df95268ac63dc4ddcb7aed1b7d5a6bbc933d11c3fcd0a77712e16b24bdf4403acc529ade5c27a2a477e25124e899587e8ca3f19685c7ab954c6f3
9614+
checksum: 10/65c40944c51b513b0172c6710ee62e951b70af6f75d5a5da745cb7fab132c09ae27ffdf7838996e3ed603bb015dadd099006658046941bd0ba30340cc563ae92
96059615
languageName: node
96069616
linkType: hard
96079617

9608-
"typescript@patch:typescript@npm%3A4.7.4#optional!builtin<compat/typescript>":
9609-
version: 4.7.4
9610-
resolution: "typescript@patch:typescript@npm%3A4.7.4#optional!builtin<compat/typescript>::version=4.7.4&hash=65a307"
9618+
"typescript@patch:typescript@npm%3A>=3 < 6#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.7.3#optional!builtin<compat/typescript>":
9619+
version: 5.8.3
9620+
resolution: "typescript@patch:typescript@npm%3A5.8.3#optional!builtin<compat/typescript>::version=5.8.3&hash=5786d5"
96119621
bin:
96129622
tsc: bin/tsc
96139623
tsserver: bin/tsserver
9614-
checksum: 10/cd6f51368ba0f8c458a44ca8b05684e9cda49acbb4e7dcf40c4720cd1534f68c2d139ec6f179bb9996e6fe9d0c7a04846db55a048f51fd2f3c41fbce0a004971
9624+
checksum: 10/b9b1e73dabac5dc730c041325dbd9c99467c1b0d239f1b74ec3b90d831384af3e2ba973946232df670519147eb51a2c20f6f96163cea2b359f03de1e2091cc4f
96159625
languageName: node
96169626
linkType: hard
96179627

@@ -9631,6 +9641,13 @@ __metadata:
96319641
languageName: node
96329642
linkType: hard
96339643

9644+
"undici-types@npm:~6.21.0":
9645+
version: 6.21.0
9646+
resolution: "undici-types@npm:6.21.0"
9647+
checksum: 10/ec8f41aa4359d50f9b59fa61fe3efce3477cc681908c8f84354d8567bb3701fafdddf36ef6bff307024d3feb42c837cf6f670314ba37fc8145e219560e473d14
9648+
languageName: node
9649+
linkType: hard
9650+
96349651
"unicode-canonical-property-names-ecmascript@npm:^2.0.0":
96359652
version: 2.0.1
96369653
resolution: "unicode-canonical-property-names-ecmascript@npm:2.0.1"

0 commit comments

Comments
 (0)