2023-04-05 09:43:16 +00:00
|
|
|
import { release } from '@vitejs/release-scripts'
|
2022-02-12 11:14:31 +00:00
|
|
|
import colors from 'picocolors'
|
2023-04-05 09:43:16 +00:00
|
|
|
import { logRecentCommits, run, updateTemplateVersions } from './releaseUtils'
|
2024-07-22 09:32:22 +00:00
|
|
|
import extendCommitHash from './extendCommitHash'
|
2023-04-05 09:43:16 +00:00
|
|
|
|
|
|
|
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`)
|
2023-04-05 09:43:16 +00:00
|
|
|
},
|
2020-12-29 05:48:52 +00:00
|
|
|
})
|