<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kelvin Kitika on Medium]]></title>
        <description><![CDATA[Stories by Kelvin Kitika on Medium]]></description>
        <link>https://medium.com/@kelvin.lukorito?source=rss-bf3033179a2c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*TvYbAEjB7-xCb-dKaqlWcw.jpeg</url>
            <title>Stories by Kelvin Kitika on Medium</title>
            <link>https://medium.com/@kelvin.lukorito?source=rss-bf3033179a2c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 01:08:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kelvin.lukorito/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using Lerna to manage JS Monorepos]]></title>
            <link>https://medium.com/the-andela-way/using-lerna-to-manage-js-monorepos-b7b8611f2ff3?source=rss-bf3033179a2c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7b8611f2ff3</guid>
            <category><![CDATA[the-andela-way]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[lerna]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Kelvin Kitika]]></dc:creator>
            <pubDate>Tue, 25 Jun 2019 15:47:41 GMT</pubDate>
            <atom:updated>2019-07-02T10:54:33.269Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aBvo8uV3JDpKNmd9" /><figcaption>Photo by <a href="https://unsplash.com/@ikukevk?utm_source=medium&amp;utm_medium=referral">Kevin Ku</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In most Full Stack Javascript projects, you will find that during development, the frontend and the backend of the application are managed in different repositories. This is okay at first, but it becomes very difficult to manage as the application grows. The disadvantages include:</p><ul><li>Installing similar packages on each application</li><li>Running similar commands separately.</li></ul><p><a href="https://github.com/lerna/lerna">Lerna</a> helps to solve this by allowing easy management of multiple JS applications/ repositories by:</p><ul><li>Allowing sharing of common packages across all applications</li><li>Allowing sharing of commands across all applications</li></ul><p>Let’s look at an example</p><h4>Example</h4><p>To get started, we need to install Lerna</p><p>$ npm install --global lerna</p><p>Next, create a folder for the Lerna packages</p><p>$ mkdir lerna-example &amp;&amp; cd lerna-example</p><p>To initialize Lerna:</p><p>$ lerna init</p><p>The folder structure will look like this</p><pre>lerna-example/<br>  packages/<br>  package.json<br>  lerna.json</pre><p>We can now add our applications in the packages folder to look something like this.</p><pre>packages/<br>    front-end/<br>      package.json<br>    backend/<br>      package.json</pre><p>In order to link common packages within the two applications we just created, we will need to add a script command on the outmost package.json</p><pre>&quot;scripts&quot;: {<br>  &quot;bootstrap&quot;: &quot;lerna bootstrap&quot;<br>}</pre><p>By running the bootstrap command, Lerna will install the dependencies listed in both applications and link any cross-dependencies. It is the same as running yarn install on each of the applications, but instead, Lerna links packages that are dependencies of each other.</p><p>For the second part, we need to start both applications with one command. To do this, we will add an npm script on each application for starting.</p><p>backend</p><pre>&quot;scripts&quot;: {<br>  &quot;start&quot;: &quot;react-scripts start&quot;<br>}</pre><p>front-end</p><pre>&quot;scripts&quot;: {<br>  &quot;start&quot;: &quot;node app.js&quot;<br>}</pre><p>On our parent package.json we will need to include a start script too.</p><pre>&quot;scripts&quot;: {<br>  &quot;start&quot;: &quot;lerna run start&quot;<br>}</pre><p>By using lerna run Lerna will look at each package&#39;s package.json file for an npm script that matches the script and runs it. It is that simple.</p><p>For more information, checkout <a href="https://github.com/lerna/lerna">Lerna on GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7b8611f2ff3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-andela-way/using-lerna-to-manage-js-monorepos-b7b8611f2ff3">Using Lerna to manage JS Monorepos</a> was originally published in <a href="https://medium.com/the-andela-way">The Andela Way</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>