From e5dc92e6ad22dcaed69a231d0ea8940bc595f5f8 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 29 Aug 2022 22:19:15 +0200 Subject: [PATCH 1/2] build(nuxt): use latest `nitropack-edge` on release --- scripts/bump-edge.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/bump-edge.ts b/scripts/bump-edge.ts index 09c916ae3f6..abd759f238f 100644 --- a/scripts/bump-edge.ts +++ b/scripts/bump-edge.ts @@ -1,5 +1,6 @@ import { promises as fsp } from 'node:fs' import { execSync } from 'node:child_process' +import { $fetch } from 'ohmyfetch' import { resolve } from 'pathe' import { globby } from 'globby' @@ -100,6 +101,11 @@ async function main () { const commit = execSync('git rev-parse --short HEAD').toString('utf-8').trim() const date = Math.round(Date.now() / (1000 * 60)) + const nuxtPkg = workspace.find('nuxt') + const nitroInfo = await $fetch('https://registry.npmjs.org/nitropack-edge') + const latestNitro = nitroInfo.distTags.latest + nuxtPkg.data.dependencies.nitropack = `npm:nitropack-edge@${latestNitro}` + for (const pkg of workspace.packages.filter(p => !p.data.private)) { workspace.setVersion(pkg.data.name, `${pkg.data.version}-${date}.${commit}`) const newname = pkg.data.name === 'nuxt' ? 'nuxt3' : (pkg.data.name + '-edge') From ad7b67baacbf987acaec833edcbda690ea5b20b2 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 29 Aug 2022 22:21:55 +0200 Subject: [PATCH 2/2] fix version access and use caret --- scripts/bump-edge.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/bump-edge.ts b/scripts/bump-edge.ts index abd759f238f..426d7c828dd 100644 --- a/scripts/bump-edge.ts +++ b/scripts/bump-edge.ts @@ -103,8 +103,8 @@ async function main () { const nuxtPkg = workspace.find('nuxt') const nitroInfo = await $fetch('https://registry.npmjs.org/nitropack-edge') - const latestNitro = nitroInfo.distTags.latest - nuxtPkg.data.dependencies.nitropack = `npm:nitropack-edge@${latestNitro}` + const latestNitro = nitroInfo['dist-tags'].latest + nuxtPkg.data.dependencies.nitropack = `npm:nitropack-edge@^${latestNitro}` for (const pkg of workspace.packages.filter(p => !p.data.private)) { workspace.setVersion(pkg.data.name, `${pkg.data.version}-${date}.${commit}`)