<?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 Avishek Subedi on Medium]]></title>
        <description><![CDATA[Stories by Avishek Subedi on Medium]]></description>
        <link>https://medium.com/@avisheksubedi?source=rss-a80ffeb294c8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QCj8Gd8cgjOj0JQ2</url>
            <title>Stories by Avishek Subedi on Medium</title>
            <link>https://medium.com/@avisheksubedi?source=rss-a80ffeb294c8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 22:18:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@avisheksubedi/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[In the world of Flutter development, as your project grows, you often find yourself dealing with…]]></title>
            <link>https://medium.com/@avisheksubedi/in-the-world-of-flutter-development-as-your-project-grows-you-often-find-yourself-dealing-with-13dc83cadda5?source=rss-a80ffeb294c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/13dc83cadda5</guid>
            <dc:creator><![CDATA[Avishek Subedi]]></dc:creator>
            <pubDate>Fri, 13 Oct 2023 13:44:17 GMT</pubDate>
            <atom:updated>2023-10-13T13:46:22.395Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of Flutter development, as your project grows, you often find yourself dealing with multiple packages, libraries, and applications. Managing them individually can become unwieldy. This is where a monorepo comes to the rescue. A monorepo, short for “monolithic repository,” allows you to house multiple related projects in one repository. In this guide, we will explore setting up a monorepo for your Flutter projects using Melos, a powerful and developer-friendly tool for managing monorepos.</p><p><strong>What is Melos?</strong></p><p>Melos is an open-source tool designed specifically for managing monorepos in Flutter projects. It simplifies the process of organizing your Flutter packages, handling dependencies, and streamlining development and publishing tasks. With Melos, you can develop and maintain a collection of related packages under a single codebase, ensuring consistency and modularity across your project.</p><p><strong>Setting Up Your Flutter Monorepo:</strong></p><p>Let’s walk through the detailed steps to set up a monorepo for your Flutter projects using Melos.</p><p><strong>Step 1: Install Melos</strong></p><p>Before we begin, ensure you have Flutter and Dart installed on your system. To install Melos globally, open your terminal and run:</p><pre><br>dart pub global activate melos<br></pre><p>This command installs Melos and makes it accessible throughout your system.</p><p><strong>Step 2: Create a New Monorepo</strong></p><p>Now, let’s create a new monorepo for your Flutter project. In your terminal, execute the following Melos command:</p><pre><br>melos init my_flutter_monorepo<br></pre><p>Replace “my_flutter_monorepo” with the name you want for your monorepo. This command initializes the structure for your monorepo.</p><p><strong>Step 3: Organize Your Packages</strong></p><p>Melos encourages you to organize your Flutter packages within a directory named `packages` in your monorepo. To create a Flutter package, use the standard `flutter create` command, like this:</p><pre><br>cd my_flutter_monorepo<br>flutter create packages/my_package<br></pre><p>Repeat this step for all the packages you wish to include in your monorepo.</p><p><strong>Step 4: Configure `melos.yaml`</strong></p><p>For Melos to work efficiently, you need to create a configuration file called `melos.yaml` in the root directory of your monorepo. Here’s an example configuration:</p><pre><br>name: my_flutter_monorepo<br>packages:<br> — packages/*<br></pre><p>This configuration specifies the name of your monorepo and tells Melos to manage all packages within the `packages` directory. You can further customize this file to include package-specific settings as needed.</p><p><strong>Step 5: Install Dependencies</strong></p><p>With your packages organized and the configuration in place, it’s time to install the dependencies for all packages. In your terminal, run:</p><pre><br>melos run bootstrap<br></pre><p>This command ensures that all packages have their necessary dependencies properly installed.</p><p><strong>Step 6: Development Workflow</strong></p><p>Now, you can start working on your packages within the monorepo. To initiate the Flutter development server for a specific package, use the following command:</p><pre><br>melos run dev -w my_package<br></pre><p>Replace `my_package` with the name of the package you want to develop. This command sets up a development environment for that specific package.</p><p><strong>Step 7: Testing and Publishing</strong></p><p>Melos simplifies the process of testing and publishing your packages. You can use commands like `melos run test` to run tests across all packages and `melos run publish` to manage the publishing process.</p><p>Example Monorepo Workflow:</p><p>Let’s illustrate the process with a monorepo containing two packages: `package_a` and `package_b`. Follow this example workflow:</p><p>1. Develop `package_a` by running:</p><pre><br> melos run dev -w package_a<br></pre><p>2. Test all packages using:</p><pre><br> melos run test<br></pre><p>3. Publish `package_a` by running:</p><pre><br> melos run publish -w package_a<br></pre><p>4. Publish `package_b` using the same approach:</p><pre><br> melos run publish -w package_b<br></pre><p><strong>Conclusion:</strong></p><p>Managing a Flutter monorepo can significantly enhance your development workflow, promoting code sharing and consistency among your packages. Melos simplifies the process, making it easier to develop, test, and publish packages. This guide provided a detailed, step-by-step process on how to set up a monorepo for your Flutter projects using Melos, along with an example workflow. By following these instructions, you can efficiently manage your Flutter projects, ensuring they are modular, maintainable, and of the highest quality.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13dc83cadda5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>