mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
chore: depend on h3-nightly
on edge releases (#22593)
This commit is contained in:
parent
afd8126b65
commit
9fcd99eccc
@ -1,21 +1,19 @@
|
|||||||
import { execSync } from 'node:child_process'
|
import { execSync } from 'node:child_process'
|
||||||
import { $fetch } from 'ofetch'
|
|
||||||
import { inc } from 'semver'
|
import { inc } from 'semver'
|
||||||
import { determineBumpType, loadWorkspace } from './_utils'
|
import { determineBumpType, loadWorkspace } from './_utils'
|
||||||
|
|
||||||
|
const nightlyPackages = {
|
||||||
|
nitropack: 'nitropack-edge',
|
||||||
|
h3: 'h3-nightly',
|
||||||
|
nuxi: 'nuxi-ng'
|
||||||
|
}
|
||||||
|
|
||||||
async function main () {
|
async function main () {
|
||||||
const workspace = await loadWorkspace(process.cwd())
|
const workspace = await loadWorkspace(process.cwd())
|
||||||
|
|
||||||
const commit = execSync('git rev-parse --short HEAD').toString('utf-8').trim().slice(0, 8)
|
const commit = execSync('git rev-parse --short HEAD').toString('utf-8').trim().slice(0, 8)
|
||||||
const date = Math.round(Date.now() / (1000 * 60))
|
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()
|
const bumpType = await determineBumpType()
|
||||||
|
|
||||||
for (const pkg of workspace.packages.filter(p => !p.data.private)) {
|
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}`, {
|
workspace.setVersion(pkg.data.name, `${newVersion}-${date}.${commit}`, {
|
||||||
updateDeps: true
|
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')
|
const newname = pkg.data.name === 'nuxt' ? 'nuxt3' : (pkg.data.name + '-edge')
|
||||||
workspace.rename(pkg.data.name, newname)
|
workspace.rename(pkg.data.name, newname)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user