Skip to content

Commit b29109b

Browse files
committed
Deploying to gh-pages from @ 4ade721 🚀
1 parent 9a4fcac commit b29109b

File tree

2 files changed

+25
-14
lines changed

2 files changed

+25
-14
lines changed

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tutorials/monorepo_guidance/index.html

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,8 +1400,13 @@
14001400

14011401

14021402
<h1 id="configuring-commitizen-in-a-monorepo">Configuring Commitizen in a monorepo<a class="headerlink" href="#configuring-commitizen-in-a-monorepo" title="Permanent link">&para;</a></h1>
1403-
<p>This tutorial assumes the monorepo layout is designed with multiple components that can be released independently of each
1404-
other, it also assumes that conventional commits with scopes are in use. Some suggested layouts:</p>
1403+
<p>This tutorial assumes that your monorepo is structured with multiple components that can be released independently of each other.
1404+
It also assumes that you are using conventional commits with scopes.</p>
1405+
<p>Here is a step-by-step example using two libraries, <code>library-b</code> and <code>library-z</code>:</p>
1406+
<ol>
1407+
<li>
1408+
<p><strong>Organize your monorepo</strong></p>
1409+
<p>For example, you might have one of these layouts:</p>
14051410
<div class="highlight"><pre><span></span><code><span class="go">.</span>
14061411
<span class="go">├── library-b</span>
14071412
<span class="go">│   └── .cz.toml</span>
@@ -1414,7 +1419,9 @@ <h1 id="configuring-commitizen-in-a-monorepo">Configuring Commitizen in a monore
14141419
<span class="go">└── library-z</span>
14151420
<span class="go"> └── .cz.toml</span>
14161421
</code></pre></div>
1417-
<p>Sample <code>.cz.toml</code> for each component:</p>
1422+
</li>
1423+
<li>
1424+
<p><strong>Add a Commitizen configuration for each component</strong></p>
14181425
<div class="highlight"><pre><span></span><code><span class="c1"># library-b/.cz.toml</span>
14191426
<span class="k">[tool.commitizen]</span>
14201427
<span class="n">name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">&quot;cz_customize&quot;</span>
@@ -1431,30 +1438,34 @@ <h1 id="configuring-commitizen-in-a-monorepo">Configuring Commitizen in a monore
14311438
<span class="n">ignored_tag_formats</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="s2">&quot;${version}-library-*&quot;</span><span class="p">]</span><span class="w"> </span><span class="c1"># Avoid noise from other tags</span>
14321439
<span class="n">update_changelog_on_bump</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">true</span>
14331440
</code></pre></div>
1434-
<p>And finally, to bump each of these:</p>
1441+
</li>
1442+
<li>
1443+
<p><strong>Bump each component independently</strong></p>
14351444
<div class="highlight"><pre><span></span><code>cz<span class="w"> </span>--config<span class="w"> </span>library-b/.cz.toml<span class="w"> </span>bump<span class="w"> </span>--yes
14361445
cz<span class="w"> </span>--config<span class="w"> </span>library-z/.cz.toml<span class="w"> </span>bump<span class="w"> </span>--yes
14371446
</code></pre></div>
1447+
</li>
1448+
</ol>
14381449
<h2 id="changelog-per-component">Changelog per component<a class="headerlink" href="#changelog-per-component" title="Permanent link">&para;</a></h2>
1439-
<p>In order to filter the correct commits for each component, you'll have to come up with a strategy.</p>
1450+
<p>To filter the correct commits for each component, you'll need to define a strategy.</p>
14401451
<p>For example:</p>
14411452
<ul>
1442-
<li>Trigger the pipeline based on the changed path, which can have some downsides, as you'll rely on the developer not including files from other files<ul>
1443-
<li><a href="https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore">GitHub actions</a> uses <code>path</code></li>
1453+
<li>Trigger the pipeline based on the changed path. This can have some downsides, as you'll rely on the developer not including files from unrelated components.<ul>
1454+
<li><a href="https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore">GitHub Actions</a> uses <code>path</code></li>
14441455
<li><a href="https://www.jenkins.io/doc/book/pipeline/syntax/#built-in-conditions">Jenkins</a> uses <code>changeset</code></li>
14451456
<li><a href="https://docs.gitlab.com/ee/ci/yaml/#ruleschanges">GitLab</a> uses <code>rules:changes</code></li>
14461457
</ul>
14471458
</li>
1448-
<li>Filter certain pattern of the commit message (recommended)</li>
1459+
<li>Filter commits by a specific pattern in the commit message (recommended)</li>
14491460
</ul>
14501461
<h3 id="example-with-scope-in-conventional-commits">Example with scope in conventional commits<a class="headerlink" href="#example-with-scope-in-conventional-commits" title="Permanent link">&para;</a></h3>
1451-
<p>For this example, to include the message in the changelog, we will require commits to use a specific scope.
1452-
This way, only relevant commits will be included in the appropriate change log for a given component, and any other commit will be ignored.</p>
1453-
<p>Example config and commit for <code>library-b</code>:</p>
1462+
<p>In this example, we want <code>library-b</code>'s changelog to only include commits that use the <code>library-b</code> scope.
1463+
To achieve this, we configure Commitizen to match only commit messages with that scope.</p>
1464+
<p>Here is an example configuration for <code>library-b</code>:</p>
14541465
<div class="highlight"><pre><span></span><code><span class="k">[tool.commitizen.customize]</span>
1455-
<span class="n">changelog_pattern</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">&quot;^(feat|fix)</span><span class="se">\\</span><span class="s2">(library-b</span><span class="se">\\</span><span class="s2">)(!)?:&quot;</span><span class="w"> </span><span class="c1">#the pattern on types can be a wild card or any types you wish to include</span>
1466+
<span class="n">changelog_pattern</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">&quot;^(feat|fix)</span><span class="se">\\</span><span class="s2">(library-b</span><span class="se">\\</span><span class="s2">)(!)?:&quot;</span><span class="w"> </span><span class="c1"># the type pattern can be a wildcard or any types you wish to include</span>
14561467
</code></pre></div>
1457-
<p>A commit message looking like this, would be included:</p>
1468+
<p>With this configuration, a commit message like the following would be included in <code>library-b</code>'s changelog:</p>
14581469
<div class="highlight"><pre><span></span><code>fix(library-b): Some awesome message
14591470
</code></pre></div>
14601471

0 commit comments

Comments
 (0)