You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/monorepo_guidance/index.html
+24-13Lines changed: 24 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1400,8 +1400,13 @@
1400
1400
1401
1401
1402
1402
<h1id="configuring-commitizen-in-a-monorepo">Configuring Commitizen in a monorepo<aclass="headerlink" href="#configuring-commitizen-in-a-monorepo" title="Permanent link">¶</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>
@@ -1431,30 +1438,34 @@ <h1 id="configuring-commitizen-in-a-monorepo">Configuring Commitizen in a monore
1431
1438
<spanclass="n">ignored_tag_formats</span><spanclass="w"></span><spanclass="o">=</span><spanclass="w"></span><spanclass="p">[</span><spanclass="s2">"${version}-library-*"</span><spanclass="p">]</span><spanclass="w"></span><spanclass="c1"># Avoid noise from other tags</span>
<h2id="changelog-per-component">Changelog per component<aclass="headerlink" href="#changelog-per-component" title="Permanent link">¶</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>
1440
1451
<p>For example:</p>
1441
1452
<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>
<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>
<li>Filter certain pattern of the commit message (recommended)</li>
1459
+
<li>Filter commits by a specific pattern in the commit message (recommended)</li>
1449
1460
</ul>
1450
1461
<h3id="example-with-scope-in-conventional-commits">Example with scope in conventional commits<aclass="headerlink" href="#example-with-scope-in-conventional-commits" title="Permanent link">¶</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>
<spanclass="n">changelog_pattern</span><spanclass="w"></span><spanclass="o">=</span><spanclass="w"></span><spanclass="s2">"^(feat|fix)</span><spanclass="se">\\</span><spanclass="s2">(library-b</span><spanclass="se">\\</span><spanclass="s2">)(!)?:"</span><spanclass="w"></span><spanclass="c1">#the pattern on types can be a wild card or any types you wish to include</span>
1466
+
<spanclass="n">changelog_pattern</span><spanclass="w"></span><spanclass="o">=</span><spanclass="w"></span><spanclass="s2">"^(feat|fix)</span><spanclass="se">\\</span><spanclass="s2">(library-b</span><spanclass="se">\\</span><spanclass="s2">)(!)?:"</span><spanclass="w"></span><spanclass="c1">#the type pattern can be a wildcard or any types you wish to include</span>
1456
1467
</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>
1458
1469
<divclass="highlight"><pre><span></span><code>fix(library-b): Some awesome message
0 commit comments