feat(config): allow RCZ configs to be located in a folder (#15)

This commit is contained in:
2023-12-17 18:19:09 +02:00
parent 4de93ef3e2
commit d707aaffe6
4 changed files with 46 additions and 10 deletions

4
.rcz/config.json Normal file
View File

@@ -0,0 +1,4 @@
{
"scopes": ["commands", "changelog", "readme", "release", "config"],
"autoSignReleases": true
}

22
.rcz/onrelease.js Normal file
View File

@@ -0,0 +1,22 @@
const fs = require("fs");
const { execSync } = require("child_process");
const packageFile = fs.readFileSync("./package.json").toString();
const newPackageFile = packageFile.replace(
/"version": "[0-9]+.[0-9]+.[0-9]+"/,
`"version": "${__NEW_VERSION__}"`
);
fs.writeFileSync("./package.json", newPackageFile);
const indexFile = fs.readFileSync("./src/index.ts").toString();
const newIndexFile = indexFile.replace(
/version\("[0-9]+\.[0-9]+\.[0-9]+"\)/,
`version("${__NEW_VERSION__}")`
);
fs.writeFileSync("./src/index.ts", newIndexFile);
execSync(
`rcz changelog --show-hashes --unreleased-as v${__NEW_VERSION__} > CHANGELOG.md`
);

7
.rcz/postrelease.js Normal file
View File

@@ -0,0 +1,7 @@
const { execSync } = require("child_process");
execSync(`git push -u origin main --tags`);
execSync(`pnpm run build`);
execSync(`pnpm publish`);