2025-12-01 07:25:25 +08:00
|
|
|
import { processFile, readJson, runYarn, writeJson } from "../utilities.js";
|
2018-06-05 16:37:52 -03:00
|
|
|
|
2023-12-17 22:51:37 +09:00
|
|
|
export default async function updateVersion({ version, next }) {
|
2018-06-05 16:37:52 -03:00
|
|
|
const pkg = await readJson("package.json");
|
|
|
|
|
pkg.version = version;
|
2022-01-17 09:19:50 +08:00
|
|
|
await writeJson("package.json", pkg);
|
2018-06-05 16:37:52 -03:00
|
|
|
|
2023-12-17 22:51:37 +09:00
|
|
|
// For pre-release, just update package.json
|
|
|
|
|
if (next) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-16 02:09:45 +08:00
|
|
|
// Update GitHub issue templates
|
2018-06-22 12:37:52 +08:00
|
|
|
processFile(".github/ISSUE_TEMPLATE/formatting.md", (content) =>
|
2025-12-21 23:44:08 +08:00
|
|
|
content.replace(/^(\*\*Prettier ).*?(\*\*)$/m, `$1${version}$2`),
|
2018-06-22 12:37:52 +08:00
|
|
|
);
|
|
|
|
|
processFile(".github/ISSUE_TEMPLATE/integration.md", (content) =>
|
2025-12-21 23:44:08 +08:00
|
|
|
content.replace(/^(- Prettier Version: ).*$/m, `$1${version}`),
|
2018-06-05 16:37:52 -03:00
|
|
|
);
|
2019-11-09 00:33:28 +08:00
|
|
|
|
2023-07-07 15:44:39 +09:00
|
|
|
await runYarn(["install"], { cwd: "./website" });
|
|
|
|
|
|
2024-06-11 09:18:16 +08:00
|
|
|
process.env.PRETTIER_VERSION = version;
|
2025-12-21 23:44:08 +08:00
|
|
|
await runYarn(["update-stable-docs"], { cwd: "./website" });
|
2018-06-05 16:37:52 -03:00
|
|
|
}
|