Skip to content

Commit 01760a4

Browse files
committed
chore: fix import paths for execa upgrade
1 parent 8f3130d commit 01760a4

File tree

27 files changed

+32
-35
lines changed

27 files changed

+32
-35
lines changed

e2e/install.e2e.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { readFileSync, existsSync } from 'fs'
1+
import { existsSync, readFileSync } from 'fs'
22
import { mkdir } from 'fs/promises'
33
import { platform } from 'os'
44
import { join, resolve } from 'path'
55
import { env } from 'process'
66
import { fileURLToPath } from 'url'
77

8-
import execa from 'execa'
8+
import { execa } from 'execa'
99
import { expect, test } from 'vitest'
1010

1111
import { packageManagerConfig, packageManagerExists } from './utils.js'

scripts/prepare-for-publish.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { readFile, writeFile } from 'fs/promises'
22
import { dirname, join } from 'path'
33
import { fileURLToPath } from 'url'
44

5-
import execa from 'execa'
5+
import { execa } from 'execa'
66
import ora from 'ora'
77

88
// These scripts from package.json need to be preserved on publish

src/commands/dev/dev-exec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { OptionValues } from 'commander'
2-
import execa from 'execa'
2+
import { execa } from 'execa'
33

44
import { getDotEnvVariables, injectEnvVariables } from '../../utils/dev.js'
55
import { getEnvelopeEnv, normalizeContext } from '../../utils/env/index.js'

src/lib/exec-fetcher.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const shouldFetchLatestVersion = async ({
6363
return false
6464
}
6565

66+
// @ts-expect-error TS(2339) Property 'match' does not exist on type 'never'
6667
const match = stdout.match(new RegExp(pattern))
6768
if (!match) {
6869
return false

src/recipes/vscode/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { join } from 'path'
22

33
import { DenoBridge } from '@netlify/edge-bundler'
4-
import execa from 'execa'
4+
import { execa } from 'execa'
55
import inquirer from 'inquirer'
66

77
import { NETLIFYDEVLOG, NETLIFYDEVWARN, chalk, error, log } from '../../utils/command-helpers.js'

src/utils/execa.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { env } from 'process'
22

3-
import execaLib from 'execa'
3+
import { execa as execaLib } from 'execa'
44

55
// This is a thin layer on top of `execa` that allows consumers to provide an
66
// alternative path to the module location, making it easier to mock its logic

src/utils/lm/install.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path, { join, sep } from 'path'
44
import process from 'process'
55
import { fileURLToPath } from 'url'
66

7-
import execa from 'execa'
7+
import { execa } from 'execa'
88
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'hasb... Remove this comment to see the full error message
99
import hasbin from 'hasbin'
1010
import { Listr } from 'listr2'

src/utils/shell.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import process from 'process'
22

3-
import execa from 'execa'
3+
import { execaCommand } from 'execa'
44
// @ts-expect-error TS(7016) FIXME: Could not find a declaration file for module 'stri... Remove this comment to see the full error message
55
import stripAnsiCc from 'strip-ansi-control-characters'
66

@@ -54,7 +54,7 @@ const cleanupBeforeExit = async ({ exitCode }) => {
5454
export const runCommand = (command, options = {}) => {
5555
// @ts-expect-error TS(2339) FIXME: Property 'cwd' does not exist on type '{}'.
5656
const { cwd, env = {}, spinner = null } = options
57-
const commandProcess = execa.command(command, {
57+
const commandProcess = execaCommand(command, {
5858
preferLocal: true,
5959
// we use reject=false to avoid rejecting synchronously when the command doesn't exist
6060
reject: false,
@@ -84,11 +84,8 @@ export const runCommand = (command, options = {}) => {
8484
})
8585
}
8686

87-
// @ts-expect-error TS(2531) FIXME: Object is possibly 'null'.
8887
commandProcess.stdout.pipe(stripAnsiCc.stream()).on('data', pipeDataWithSpinner.bind(null, process.stdout))
89-
// @ts-expect-error TS(2531) FIXME: Object is possibly 'null'.
9088
commandProcess.stderr.pipe(stripAnsiCc.stream()).on('data', pipeDataWithSpinner.bind(null, process.stderr))
91-
// @ts-expect-error TS(2345) FIXME: Argument of type 'Writable | null' is not assignab... Remove this comment to see the full error message
9289
process.stdin.pipe(commandProcess.stdin)
9390

9491
// we can't try->await->catch since we don't want to block on the framework server which
@@ -107,8 +104,7 @@ export const runCommand = (command, options = {}) => {
107104
)
108105
} else {
109106
const errorMessage = result.failed
110-
? // @ts-expect-error TS(2339) FIXME: Property 'shortMessage' does not exist on type 'Ex... Remove this comment to see the full error message
111-
`${NETLIFYDEVERR} ${result.shortMessage}`
107+
? `${NETLIFYDEVERR} ${result.shortMessage}`
112108
: `${NETLIFYDEVWARN} "${command}" exited with code ${result.exitCode}`
113109

114110
log(`${errorMessage}. Shutting down Netlify Dev server`)

tests/integration/commands/build/build.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import path from 'path'
22
import process from 'process'
33

4-
import execa from 'execa'
4+
import { execa } from 'execa'
55
import { describe, test } from 'vitest'
66

77
import { cliPath } from '../../utils/cli-path.js'

tests/integration/commands/deploy/deploy.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import path from 'path'
22
import process from 'process'
33
import { fileURLToPath } from 'url'
44

5-
import execa from 'execa'
5+
import { execaCommand } from 'execa'
66
import fetch from 'node-fetch'
77
import { afterAll, beforeAll, describe, test } from 'vitest'
88

@@ -886,7 +886,7 @@ describe.skipIf(process.env.NETLIFY_TEST_DISABLE_LIVE === 'true').concurrent('co
886886
})
887887
.build()
888888

889-
await execa.command('npm install', { cwd: builder.directory })
889+
await execaCommand('npm install', { cwd: builder.directory })
890890
const { deploy_url: deployUrl } = await callCli(
891891
['deploy', '--json'],
892892
{

0 commit comments

Comments
 (0)