Skip to content

Commit

Permalink
deploy: fecec12
Browse files Browse the repository at this point in the history
  • Loading branch information
TessFerrandez committed Oct 20, 2023
1 parent f3836fd commit 56b897a
Show file tree
Hide file tree
Showing 7 changed files with 390 additions and 242 deletions.
3 changes: 1 addition & 2 deletions design/design-patterns/rest-api-design-guidance/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7378,7 +7378,6 @@ <h2 id="additional-resources">Additional Resources</h2>
<li><a href="https://www.restapitutorial.com/httpstatuscodes.html">Detailed HTTP status code definitions</a></li>
<li><a href="https://semver.org/">Semantic Versioning</a></li>
<li><a href="http://apistylebook.com/design/guidelines/">Other Public API Guidelines</a></li>
<li><a href="https://oai.github.io/Documentation/best-practices.html">OpenAPI Design Practices</a></li>
<li><a href="https://github.com/Microsoft/typespec">Microsoft TypeSpec</a></li>
<li><a href="https://github.com/cse-labs/typespec-workflow-samples/">Microsoft TypeSpec GitHub Workflow samples</a></li>
</ul>
Expand All @@ -7388,7 +7387,7 @@ <h2 id="additional-resources">Additional Resources</h2>
<small>

Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">May 29, 2023</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">October 20, 2023</span>


</small>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

476 changes: 238 additions & 238 deletions sitemap.xml

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.
Binary file added source-control/assets/monorepo-git-tags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source-control/assets/monorepo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
151 changes: 150 additions & 1 deletion source-control/component-versioning/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6930,6 +6930,40 @@
Semantic Versioning
</a>

</li>

<li class="md-nav__item">
<a href="#semantic-versioning-within-a-monorepo" class="md-nav__link">
Semantic Versioning within a Monorepo
</a>

<nav class="md-nav" aria-label="Semantic Versioning within a Monorepo">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#challenges-with-versioning-in-a-monorepo-structure" class="md-nav__link">
Challenges with Versioning in a monorepo structure
</a>

</li>

<li class="md-nav__item">
<a href="#semantic-release-package-for-versioning" class="md-nav__link">
semantic-release package for versioning
</a>

</li>

<li class="md-nav__item">
<a href="#semantic-release-configurations" class="md-nav__link">
semantic-release configurations
</a>

</li>

</ul>
</nav>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -7216,6 +7250,40 @@
Semantic Versioning
</a>

</li>

<li class="md-nav__item">
<a href="#semantic-versioning-within-a-monorepo" class="md-nav__link">
Semantic Versioning within a Monorepo
</a>

<nav class="md-nav" aria-label="Semantic Versioning within a Monorepo">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#challenges-with-versioning-in-a-monorepo-structure" class="md-nav__link">
Challenges with Versioning in a monorepo structure
</a>

</li>

<li class="md-nav__item">
<a href="#semantic-release-package-for-versioning" class="md-nav__link">
semantic-release package for versioning
</a>

</li>

<li class="md-nav__item">
<a href="#semantic-release-configurations" class="md-nav__link">
semantic-release configurations
</a>

</li>

</ul>
</nav>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -7287,19 +7355,100 @@ <h2 id="semantic-versioning">Semantic Versioning</h2>
<li>Branch names (e.g. develop, release/..) for Alpha / Beta / RC</li>
<li>Otherwise: Number of commits (+12, ...)</li>
</ul>
<h2 id="semantic-versioning-within-a-monorepo">Semantic Versioning within a Monorepo</h2>
<p>A monorepo, short for "monolithic repository", is a software development practice where multiple related projects, components, or modules are stored within a single version-controlled repository as opposed to maintaining them in separate repositories.</p>
<p><img src="./assets/monorepo.png" alt="drawing" width="150"/></p>
<h3 id="challenges-with-versioning-in-a-monorepo-structure">Challenges with Versioning in a monorepo structure</h3>
<p>Versioning in a monorepo involves making decisions about how to assign version numbers to different projects and components contained within the repository.</p>
<p>Assigning a single version number to all projects in a monorepo can lead to frequent version increments if changes in one project don't match the significance of changes in another. This might be excessive if some projects undergo rapid development while others evolve more slowly.</p>
<p>Ideally, we would want each project within the monorepo to have its own version number. Changes in one project shouldn't necessarily trigger version changes in others.
This strategy allows projects to evolve at their own pace, without forcing all projects to adopt the same version number. It aligns well with the differing release cadences of distinct projects.</p>
<h3 id="semantic-release-package-for-versioning">semantic-release package for versioning</h3>
<p><a href="https://github.com/semantic-release/semantic-release">semantic-release</a> simplifies the entire process of releasing a package, which encompasses tasks such as identifying the upcoming version number, producing release notes, and distributing the package. This process severs the direct link between human sentiments and version identifiers. Instead, it rigorously adheres to the Semantic Versioning standards and effectively conveys the significance of alterations to end users.</p>
<p><code>semantic-release</code> relies on commit messages to assess how codebase changes impact consumers. By adhering to structured conventions for commit messages, <code>semantic-release</code> autonomously identifies the subsequent semantic version, compiles a changelog, and releases the software.</p>
<p><a href="https://gist.github.com/brianclements/841ea7bffdb01346392c">Angular Commit Message</a> Conventions serve as the default for <code>semantic-release</code>. However, the configuration options of the @semantic-release/commit-analyzer and @semantic-release/release-notes-generator plugins, including presets, can be adjusted to modify the commit message format.</p>
<p>The table below shows which commit message gets you which release type when <code>semantic-release</code> runs (using the default configuration):</p>
<table>
<thead>
<tr>
<th>Commit message</th>
<th>Release type</th>
</tr>
</thead>
<tbody>
<tr>
<td>fix(pencil): stop graphite breaking when too much pressure applied</td>
<td>Patch Fix Release</td>
</tr>
<tr>
<td>feat(pencil): add 'graphiteWidth' option</td>
<td>Minor Feature Release</td>
</tr>
<tr>
<td>perf(pencil): remove graphiteWidth option <br> BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reasons.</td>
<td>Major Breaking Release <br> (Note that the BREAKING CHANGE: token must be in the footer of the commit)</td>
</tr>
</tbody>
</table>
<p>The inherent setup of <code>semantic-release</code> presumes a direct correspondence between a GitHub repository and a package. Hence changes anywhere in the project result in a version upgrade for the project.</p>
<p>The <a href="https://github.com/pmowrer/semantic-release-monorepo">semantic-release-monorepo</a> tool permits the utilization of <code>semantic-release</code> within a solitary GitHub repository that encompasses numerous packages.</p>
<p>Instead of attributing all commits to a single package, commits are assigned to packages based on the files that a commit touched.</p>
<p>If a commit touches a file in or below a package's root, it will be considered for that package's next release. A single commit can belong to multiple packages and may trigger the release of multiple packages.</p>
<p>In order to avoid version collisions, generated git tags are namespaced using the given package's name: <code>&lt;package-name&gt;</code>-<code>&lt;version&gt;</code>.</p>
<p><img alt="monorepo-git-tags" src="../assets/monorepo-git-tags.png" /></p>
<h3 id="semantic-release-configurations">semantic-release configurations</h3>
<p><code>semantic-release</code>’s options, mode and plugins can be set via either:</p>
<ul>
<li>A .releaserc file, written in YAML or JSON, with optional extensions: .yaml/.yml/.json/.js/.cjs</li>
<li>A release.config.(js|cjs) file that exports an object</li>
<li>A release key in the project's package.json file</li>
</ul>
<p>Here is an example .releaserc file which contains the configuration for:
1. git tags for the releases from different types of branches
2. Any plugins required, list of supported plugins can be found <a href="https://semantic-release.gitbook.io/semantic-release/extending/plugins-list">here</a>. In this file <em>semantic-release-monorepo</em> plugin is extended.</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;ci&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;repositoryUrl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;your repository url&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;branches&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
<span class="w"> </span><span class="s2">&quot;master&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;feature/*&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;prerelease&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;beta-${name.replace(/\\//g, &#39;-&#39;).replace(/_/g, &#39;-&#39;)}&quot;</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;[a-zA-Z0-9_]+/[a-zA-Z0-9-_]+&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;prerelease&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;dev-${name.replace(/\\//g, &#39;-&#39;).replace(/_/g, &#39;--&#39;)}&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">],</span>
<span class="w"> </span><span class="nt">&quot;plugins&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
<span class="w"> </span><span class="s2">&quot;@semantic-release/commit-analyzer&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s2">&quot;@semantic-release/release-notes-generator&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="p">[</span>
<span class="w"> </span><span class="s2">&quot;@semantic-release/exec&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;verifyReleaseCmd&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;echo ${nextRelease.name} &gt; .VERSION&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">],</span>
<span class="w"> </span><span class="s2">&quot;semantic-release-ado&quot;</span>
<span class="w"> </span><span class="p">],</span>
<span class="w"> </span><span class="nt">&quot;extends&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;semantic-release-monorepo&quot;</span>
<span class="w"> </span><span class="p">}</span>
</code></pre></div>
<h2 id="resources">Resources</h2>
<ul>
<li><a href="https://gitversion.net/">GitVersion</a></li>
<li><a href="https://semver.org/">Semantic Versioning</a></li>
<li><a href="https://learn.microsoft.com/en-us/dotnet/csharp/versioning">Versioning in C#</a></li>
<li><a href="https://github.com/semantic-release/semantic-release">semantic-release</a></li>
<li><a href="https://github.com/pmowrer/semantic-release-monorepo">semantic-release-monorepo</a></li>
</ul>

<hr>
<div class="md-source-file">
<small>

Last update:
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">March 19, 2023</span>
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">October 20, 2023</span>


</small>
Expand Down

0 comments on commit 56b897a

Please sign in to comment.