vite/scripts/release.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
1.0 KiB
TypeScript
Raw Permalink Normal View History

import { release } from '@vitejs/release-scripts'
import colors from 'picocolors'
import { logRecentCommits, run, updateTemplateVersions } from './releaseUtils'
2024-07-22 09:32:22 +00:00
import extendCommitHash from './extendCommitHash'
release({
repo: 'vite',
packages: ['vite', 'create-vite', 'plugin-legacy'],
toTag: (pkg, version) =>
pkg === 'vite' ? `v${version}` : `${pkg}@${version}`,
logChangelog: (pkg) => logRecentCommits(pkg),
generateChangelog: async (pkgName) => {
if (pkgName === 'create-vite') await updateTemplateVersions()
console.log(colors.cyan('\nGenerating changelog...'))
const changelogArgs = [
'conventional-changelog',
'-p',
'angular',
'-i',
'CHANGELOG.md',
'-s',
'--commit-path',
'.',
]
if (pkgName !== 'vite') changelogArgs.push('--lerna-package', pkgName)
await run('npx', changelogArgs, { cwd: `packages/${pkgName}` })
2024-07-22 09:32:22 +00:00
// conventional-changelog generates links with short commit hashes, extend them to full hashes
extendCommitHash(`packages/${pkgName}/CHANGELOG.md`)
},
2020-12-29 05:48:52 +00:00
})