From 9fcd99eccc8454f2dd451a0c66bcf04522e68c0f Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 11 Aug 2023 14:11:51 +0100 Subject: [PATCH] chore: depend on `h3-nightly` on edge releases (#22593) --- scripts/bump-edge.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/bump-edge.ts b/scripts/bump-edge.ts index bc513cefe7..2d93d550b8 100644 --- a/scripts/bump-edge.ts +++ b/scripts/bump-edge.ts @@ -1,21 +1,19 @@ import { execSync } from 'node:child_process' -import { $fetch } from 'ofetch' import { inc } from 'semver' import { determineBumpType, loadWorkspace } from './_utils' +const nightlyPackages = { + nitropack: 'nitropack-edge', + h3: 'h3-nightly', + nuxi: 'nuxi-ng' +} + async function main () { const workspace = await loadWorkspace(process.cwd()) const commit = execSync('git rev-parse --short HEAD').toString('utf-8').trim().slice(0, 8) const date = Math.round(Date.now() / (1000 * 60)) - const nuxtPkg = workspace.find('nuxt') - const { version: latestNitro } = await $fetch<{ version: string }>('https://registry.npmjs.org/nitropack-edge/latest') - nuxtPkg.data.dependencies.nitropack = `npm:nitropack-edge@^${latestNitro}` - - const { version: latestNuxi } = await $fetch<{ version: string }>('https://registry.npmjs.org/nuxi-ng/latest') - nuxtPkg.data.dependencies.nuxi = `npm:nuxi-ng@^${latestNuxi}` - const bumpType = await determineBumpType() for (const pkg of workspace.packages.filter(p => !p.data.private)) { @@ -23,6 +21,11 @@ async function main () { workspace.setVersion(pkg.data.name, `${newVersion}-${date}.${commit}`, { updateDeps: true }) + for (const [name, nightlyName] of Object.entries(nightlyPackages)) { + if (name in pkg.data.dependencies) { + pkg.data.dependencies[name] = `npm:${nightlyName}@latest` + } + } const newname = pkg.data.name === 'nuxt' ? 'nuxt3' : (pkg.data.name + '-edge') workspace.rename(pkg.data.name, newname) }