Skip to content

Commit

Permalink
chore: grab scopes for cz-git
Browse files Browse the repository at this point in the history
  • Loading branch information
aniravi24 committed Sep 2, 2024
1 parent 7205a7a commit 6c13f17
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
// Default template copied from: https://cz-git.qbb.sh/config/

const { execSync } = require("child_process");

// Get the list of affected projects
const turboOutput = execSync("npx turbo run build --filter=[HEAD^1] --dry=json")
.toString()
.trim();

const scopes = JSON.parse(turboOutput)
.tasks.filter((task) => task.task === "build")
.map((task) => task.package);

/** @type {import('cz-git').UserConfig} */
module.exports = {
// I'm just putting something in here because this rules key can't be empty
Expand Down Expand Up @@ -82,8 +93,8 @@ module.exports = {
useAI: false,
aiNumber: 1,
themeColorCode: "",
// scopes,
// allowCustomScopes: true,
scopes,
allowCustomScopes: true,
allowEmptyScopes: true,
customScopesAlign: "top",
customScopesAlias: "custom",
Expand Down

0 comments on commit 6c13f17

Please sign in to comment.