chore(nuxt): update nuxi (#23145)

Co-authored-by: Pooya Parsa <pooya@pi0.io>
This commit is contained in:
Daniel Roe 2023-09-12 15:26:55 +01:00 committed by GitHub
parent a4cf8a0c24
commit 842a2e5cf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 15 deletions

View File

@ -64,7 +64,7 @@
"jiti": "1.20.0",
"markdownlint-cli": "^0.33.0",
"nitropack": "2.6.3",
"nuxi": "3.7.3",
"nuxi": "3.8.3",
"nuxt": "workspace:*",
"nuxt-vitest": "0.10.4",
"ofetch": "1.3.3",

View File

@ -82,7 +82,7 @@
"magic-string": "^0.30.3",
"mlly": "^1.4.2",
"nitropack": "^2.6.3",
"nuxi": "^3.7.3",
"nuxi": "^3.8.3",
"nypm": "^0.3.3",
"ofetch": "^1.3.3",
"ohash": "^1.1.3",

View File

@ -13,8 +13,9 @@ const kit: typeof _kit = _kit.default || _kit
export async function startServer () {
const ctx = useTestContext()
await stopServer()
const port = ctx.options.port || await getRandomPort()
ctx.url = 'http://127.0.0.1:' + port
const host = '127.0.0.1'
const port = ctx.options.port || await getRandomPort(host)
ctx.url = `http://${host}:${port}`
if (ctx.options.dev) {
const nuxiCLI = await kit.resolvePath('nuxi/cli')
ctx.serverProcess = execa(nuxiCLI, ['_dev'], {
@ -22,13 +23,13 @@ export async function startServer () {
stdio: 'inherit',
env: {
...process.env,
_PORT: String(port),
_PORT: String(port), // Used by internal _dev command
PORT: String(port),
NITRO_PORT: String(port),
HOST: host,
NODE_ENV: 'development'
}
})
await waitForPort(port, { retries: 32 })
await waitForPort(port, { retries: 32, host }).catch(() => {})
let lastError
for (let i = 0; i < 150; i++) {
await new Promise(resolve => setTimeout(resolve, 100))
@ -51,11 +52,11 @@ export async function startServer () {
env: {
...process.env,
PORT: String(port),
NITRO_PORT: String(port),
HOST: host,
NODE_ENV: 'test'
}
})
await waitForPort(port, { retries: 8 })
await waitForPort(port, { retries: 20, host })
}
}

View File

@ -95,8 +95,8 @@ importers:
specifier: 2.6.3
version: 2.6.3
nuxi:
specifier: 3.7.3
version: 3.7.3
specifier: 3.8.3
version: 3.8.3
nuxt:
specifier: workspace:*
version: link:packages/nuxt
@ -336,8 +336,8 @@ importers:
specifier: ^2.6.3
version: 2.6.3
nuxi:
specifier: ^3.7.3
version: 3.7.3
specifier: ^3.8.3
version: 3.8.3
nypm:
specifier: ^0.3.3
version: 0.3.3
@ -2526,6 +2526,7 @@ packages:
dependencies:
is-glob: 4.0.3
micromatch: 4.0.5
napi-wasm: 1.1.0
bundledDependencies:
- napi-wasm
@ -7927,6 +7928,9 @@ packages:
engines: {node: ^14 || ^16 || >=18}
hasBin: true
/napi-wasm@1.1.0:
resolution: {integrity: sha512-lHwIAJbmLSjF9VDRm9GoVOy9AGp3aIvkjv+Kvz9h16QR3uSVYH78PNQUnT2U4X53mhlnV2M7wrhibQ3GHicDmg==}
/natural-compare@1.4.0:
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
@ -8140,8 +8144,8 @@ packages:
dependencies:
boolbase: 1.0.0
/nuxi@3.7.3:
resolution: {integrity: sha512-Cg+ygRmhonE6PwAtDeKvKU/0VRqEyzmSSoJYfr0MzwIxQYrBSnLvw0z3UgJl/8MgFKjiZ5Y4wBUEiRsUw8O6uw==}
/nuxi@3.8.3:
resolution: {integrity: sha512-LS1KlxQhQDt+WREENAG44zfO91uiPYDcorQ7xlcaV0ejV65v7Eub94FTmJ6JNXL2boHhc+raODtJBClW2uYyJw==}
engines: {node: ^14.18.0 || >=16.10.0}
hasBin: true
optionalDependencies: