[cli] Fix vc dev when user has ipv6 configured (#7956)

Running tests from #7455 

- Fixes #7306
- Closes #7455
This commit is contained in:
Steven
2022-06-13 17:04:00 -04:00
committed by GitHub
parent 0d302a6f48
commit 0e8278f490
4 changed files with 8 additions and 20 deletions

View File

@@ -137,7 +137,7 @@
"ini": "3.0.0",
"inquirer": "7.0.4",
"is-docker": "2.2.1",
"is-port-reachable": "3.0.0",
"is-port-reachable": "3.1.0",
"is-url": "1.2.2",
"jaro-winkler": "0.2.8",
"jsonlines": "0.1.1",

View File

@@ -2447,12 +2447,10 @@ function needsBlockingBuild(buildMatch: BuildMatch): boolean {
return typeof builder.shouldServe !== 'function';
}
async function checkForPort(
port: number | undefined,
timeout: number
): Promise<void> {
async function checkForPort(port: number, timeout: number): Promise<void> {
const opts = { host: '127.0.0.1' };
const start = Date.now();
while (!(await isPortReachable(port))) {
while (!(await isPortReachable(port, opts))) {
if (Date.now() - start > timeout) {
throw new Error(`Detecting port ${port} timed out after ${timeout}ms`);
}

View File

@@ -1,10 +0,0 @@
declare module 'is-port-reachable' {
export interface IsPortReachableOptions {
timeout?: number | undefined;
host?: string;
}
export default function (
port: number | undefined,
options?: IsPortReachableOptions
): Promise<boolean>;
}

View File

@@ -7640,10 +7640,10 @@ is-port-reachable@2.0.1:
resolved "https://registry.yarnpkg.com/is-port-reachable/-/is-port-reachable-2.0.1.tgz#e0778d0733beac1ade3ba72a5fe77db50a59926b"
integrity sha512-SqU55C5gkitgOhl2ccd2v23MbkbcOFa5e4aPo8h8VGqOifh7iDwG44bQBWGW/lZulTjl9AWIKP0NiUWpa+TtWA==
is-port-reachable@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/is-port-reachable/-/is-port-reachable-3.0.0.tgz#edf721e7d354e6e00cbeb0fc174ad89bdf6056b3"
integrity sha512-056IzLiWHdgVd6Eq1F9HtJl+cIkvi5X2MJ/A1fjQtByHkzQE1wGardnPhqrarOGDF88BOW+297X7PDvZ2vcyVg==
is-port-reachable@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/is-port-reachable/-/is-port-reachable-3.1.0.tgz#f6668d3bca9c36b07f737c48a8f875ab0653cd2b"
integrity sha512-vjc0SSRNZ32s9SbZBzGaiP6YVB+xglLShhgZD/FHMZUXBvQWaV9CtzgeVhjccFJrI6RAMV+LX7NYxueW/A8W5A==
is-promise@^2.1.0:
version "2.2.2"