Skip to content

Commit

Permalink
chore(deps): update dependency execa to v9 (#16662)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: sapphi-red <49056869+sapphi-red@users.noreply.github.com>
  • Loading branch information
renovate[bot] and sapphi-red committed May 13, 2024
1 parent 6583ad2 commit 76d1642
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"eslint-plugin-i": "^2.29.1",
"eslint-plugin-n": "^17.6.0",
"eslint-plugin-regexp": "^2.5.0",
"execa": "^8.0.1",
"execa": "^9.0.2",
"feed": "^4.2.2",
"fs-extra": "^11.2.0",
"lint-staged": "^15.2.2",
Expand Down
8 changes: 4 additions & 4 deletions packages/create-vite/__tests__/cli.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { join } from 'node:path'
import type { ExecaSyncReturnValue, SyncOptions } from 'execa'
import type { SyncOptions, SyncResult } from 'execa'
import { execaCommandSync } from 'execa'
import fs from 'fs-extra'
import { afterEach, beforeAll, expect, test } from 'vitest'
Expand All @@ -9,10 +9,10 @@ const CLI_PATH = join(__dirname, '..')
const projectName = 'test-app'
const genPath = join(__dirname, projectName)

const run = (
const run = <SO extends SyncOptions>(
args: string[],
options: SyncOptions = {},
): ExecaSyncReturnValue => {
options?: SO,
): SyncResult<SO> => {
return execaCommandSync(`node ${CLI_PATH} ${args.join(' ')}`, options)
}

Expand Down
1 change: 1 addition & 0 deletions playground/cli-module/__tests__/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export async function serve() {
const serverProcess = execaCommand(serverCommand, {
cwd: rootDir,
stdio: 'pipe',
forceKillAfterDelay: 3000,
})
collectStreams('server', serverProcess)

Expand Down
1 change: 1 addition & 0 deletions playground/cli/__tests__/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export async function serve() {
const serverProcess = execaCommand(serverCommand, {
cwd: rootDir,
stdio: 'pipe',
forceKillAfterDelay: 3000,
})
collectStreams('server', serverProcess)

Expand Down
6 changes: 3 additions & 3 deletions playground/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { normalizePath } from 'vite'
import { fromComment } from 'convert-source-map'
import type { Assertion } from 'vitest'
import { expect } from 'vitest'
import type { ExecaChildProcess } from 'execa'
import type { ResultPromise as ExecaResultPromise } from 'execa'
import { isBuild, isWindows, page, testDir } from './vitestSetup'

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

// helper function to kill process, uses taskkill on windows to ensure child process is killed too
export async function killProcess(
serverProcess: ExecaChildProcess,
serverProcess: ExecaResultPromise,
): Promise<void> {
if (isWindows) {
try {
Expand All @@ -390,7 +390,7 @@ export async function killProcess(
console.error('failed to taskkill:', e)
}
} else {
serverProcess.kill('SIGTERM', { forceKillAfterTimeout: 2000 })
serverProcess.kill('SIGTERM')
}
}

Expand Down
95 changes: 93 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions scripts/releaseUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { readdirSync, writeFileSync } from 'node:fs'
import path from 'node:path'
import semver from 'semver'
import colors from 'picocolors'
import type { Options as ExecaOptions, ExecaReturnValue } from 'execa'
import type { Options as ExecaOptions, ResultPromise } from 'execa'
import { execa } from 'execa'
import fs from 'fs-extra'

export async function run(
export function run<EO extends ExecaOptions>(
bin: string,
args: string[],
opts: ExecaOptions = {},
): Promise<ExecaReturnValue> {
return execa(bin, args, { stdio: 'inherit', ...opts })
opts?: EO,
): ResultPromise<EO & (keyof EO extends 'stdio' ? {} : { stdio: 'inherit' })> {
return execa(bin, args, { stdio: 'inherit', ...opts }) as any
}

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

0 comments on commit 76d1642

Please sign in to comment.