Skip to content

Commit 76d1642

Browse files
chore(deps): update dependency execa to v9 (#16662)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: sapphi-red <[email protected]>
1 parent 6583ad2 commit 76d1642

File tree

7 files changed

+108
-15
lines changed

7 files changed

+108
-15
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"eslint-plugin-i": "^2.29.1",
6868
"eslint-plugin-n": "^17.6.0",
6969
"eslint-plugin-regexp": "^2.5.0",
70-
"execa": "^8.0.1",
70+
"execa": "^9.0.2",
7171
"feed": "^4.2.2",
7272
"fs-extra": "^11.2.0",
7373
"lint-staged": "^15.2.2",

packages/create-vite/__tests__/cli.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { join } from 'node:path'
2-
import type { ExecaSyncReturnValue, SyncOptions } from 'execa'
2+
import type { SyncOptions, SyncResult } from 'execa'
33
import { execaCommandSync } from 'execa'
44
import fs from 'fs-extra'
55
import { afterEach, beforeAll, expect, test } from 'vitest'
@@ -9,10 +9,10 @@ const CLI_PATH = join(__dirname, '..')
99
const projectName = 'test-app'
1010
const genPath = join(__dirname, projectName)
1111

12-
const run = (
12+
const run = <SO extends SyncOptions>(
1313
args: string[],
14-
options: SyncOptions = {},
15-
): ExecaSyncReturnValue => {
14+
options?: SO,
15+
): SyncResult<SO> => {
1616
return execaCommandSync(`node ${CLI_PATH} ${args.join(' ')}`, options)
1717
}
1818

playground/cli-module/__tests__/serve.ts

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export async function serve() {
7070
const serverProcess = execaCommand(serverCommand, {
7171
cwd: rootDir,
7272
stdio: 'pipe',
73+
forceKillAfterDelay: 3000,
7374
})
7475
collectStreams('server', serverProcess)
7576

playground/cli/__tests__/serve.ts

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export async function serve() {
7373
const serverProcess = execaCommand(serverCommand, {
7474
cwd: rootDir,
7575
stdio: 'pipe',
76+
forceKillAfterDelay: 3000,
7677
})
7778
collectStreams('server', serverProcess)
7879

playground/test-utils.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { normalizePath } from 'vite'
1414
import { fromComment } from 'convert-source-map'
1515
import type { Assertion } from 'vitest'
1616
import { expect } from 'vitest'
17-
import type { ExecaChildProcess } from 'execa'
17+
import type { ResultPromise as ExecaResultPromise } from 'execa'
1818
import { isBuild, isWindows, page, testDir } from './vitestSetup'
1919

2020
export * from './vitestSetup'
@@ -380,7 +380,7 @@ export const formatSourcemapForSnapshot = (map: any): any => {
380380

381381
// helper function to kill process, uses taskkill on windows to ensure child process is killed too
382382
export async function killProcess(
383-
serverProcess: ExecaChildProcess,
383+
serverProcess: ExecaResultPromise,
384384
): Promise<void> {
385385
if (isWindows) {
386386
try {
@@ -390,7 +390,7 @@ export async function killProcess(
390390
console.error('failed to taskkill:', e)
391391
}
392392
} else {
393-
serverProcess.kill('SIGTERM', { forceKillAfterTimeout: 2000 })
393+
serverProcess.kill('SIGTERM')
394394
}
395395
}
396396

pnpm-lock.yaml

+93-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/releaseUtils.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import { readdirSync, writeFileSync } from 'node:fs'
22
import path from 'node:path'
33
import semver from 'semver'
44
import colors from 'picocolors'
5-
import type { Options as ExecaOptions, ExecaReturnValue } from 'execa'
5+
import type { Options as ExecaOptions, ResultPromise } from 'execa'
66
import { execa } from 'execa'
77
import fs from 'fs-extra'
88

9-
export async function run(
9+
export function run<EO extends ExecaOptions>(
1010
bin: string,
1111
args: string[],
12-
opts: ExecaOptions = {},
13-
): Promise<ExecaReturnValue> {
14-
return execa(bin, args, { stdio: 'inherit', ...opts })
12+
opts?: EO,
13+
): ResultPromise<EO & (keyof EO extends 'stdio' ? {} : { stdio: 'inherit' })> {
14+
return execa(bin, args, { stdio: 'inherit', ...opts }) as any
1515
}
1616

1717
export async function getLatestTag(pkgName: string): Promise<string> {

0 commit comments

Comments
 (0)