forked from vitejs/rolldown-vite
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.ts
36 lines (30 loc) · 1.05 KB
/
release.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { release } from "@vitejs/release-scripts";
import colors from "picocolors";
import extendCommitHash from "./extendCommitHash";
import { logRecentCommits, run, updateTemplateVersions } from "./releaseUtils";
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' || pkgName === '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}` });
// conventional-changelog generates links with short commit hashes, extend them to full hashes
extendCommitHash(`packages/${pkgName}/CHANGELOG.md`);
},
});