Files
test-repo/scripts/release/steps/update-version.js
T

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

25 lines
812 B
JavaScript
Raw Normal View History

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;
}
// Update github issue templates
processFile(".github/ISSUE_TEMPLATE/formatting.md", (content) =>
content.replace(/^(\*\*Prettier ).*?(\*\*)$/m, `$1${version}$2`),
);
processFile(".github/ISSUE_TEMPLATE/integration.md", (content) =>
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" });
process.env.PRETTIER_VERSION = version;
await runYarn(["update-stable-docs"], { cwd: "./website" });
2018-06-05 16:37:52 -03:00
}