<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mayank Kumar</title>
    <description>The latest articles on DEV Community by Mayank Kumar (@mayankpareek).</description>
    <link>https://dev.to/mayankpareek</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2029026%2F3ad22045-80d1-4bf9-9c97-5e8db6775fb1.jpeg</url>
      <title>DEV Community: Mayank Kumar</title>
      <link>https://dev.to/mayankpareek</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mayankpareek"/>
    <language>en</language>
    <item>
      <title>Releasing dev-mate-cli on npm</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Sat, 23 Nov 2024 00:52:32 +0000</pubDate>
      <link>https://dev.to/mayankpareek/releasing-dev-mate-cli-on-npm-3bnn</link>
      <guid>https://dev.to/mayankpareek/releasing-dev-mate-cli-on-npm-3bnn</guid>
      <description>&lt;p&gt;This week, I successfully released my CLI tool, &lt;a href="https://github.com/mayank-Pareek/dev-mate-cli" rel="noopener noreferrer"&gt;&lt;code&gt;dev-mate-cli&lt;/code&gt;&lt;/a&gt;, to the public &lt;a href="https://www.npmjs.com/package/dev-mate-cli" rel="noopener noreferrer"&gt;npm registry&lt;/a&gt;. It was a rewarding experience that involved learning and refining my project. Here’s a detailed account of how I did it, along with lessons I learned and tips for anyone looking to release their own package.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://www.npmjs.com/package/dev-mate-cli" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstatic-production.npmjs.com%2F338e4905a2684ca96e08c7780fc68412.png" height="420" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://www.npmjs.com/package/dev-mate-cli" rel="noopener noreferrer" class="c-link"&gt;
          dev-mate-cli - npm
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          command line tool using LLMs for code documentation. Latest version: 1.0.3, last published: 3 hours ago. Start using dev-mate-cli in your project by running `npm i dev-mate-cli`. There are no other projects in the npm registry using dev-mate-cli.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstatic-production.npmjs.com%2Fb0f1a8318363185cc2ea6a40ac23eeb2.png" width="32" height="32"&gt;
        npmjs.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Choosing a Release Tool and Registry
&lt;/h2&gt;

&lt;p&gt;As my project was written in TypeScript and designed as a Node.js CLI tool, I chose &lt;code&gt;npm&lt;/code&gt; for hosting my package. It’s the most popular package registry for JavaScript developers, and I was already familiar with using it to install dependencies. Publishing to &lt;code&gt;npm&lt;/code&gt; made sense, as it would make my tool accessible to a broad audience.&lt;/p&gt;

&lt;p&gt;You can create an account at &lt;a href="https://www.npmjs.com/" rel="noopener noreferrer"&gt;npmjs.com&lt;/a&gt;. Once your account is ready, publishing a package involves using simple and well-documented commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Process for Releasing
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Preparing the Project for Release&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I added a &lt;code&gt;bin&lt;/code&gt; field in my &lt;code&gt;package.json&lt;/code&gt; file to make my CLI executable. This field maps the CLI command (&lt;code&gt;dev-mate-cli&lt;/code&gt;) to the script that should run when the command is invoked.&lt;/li&gt;
&lt;li&gt;Ensured all needed dependencies, like &lt;code&gt;dotenv&lt;/code&gt;, were correctly listed in the dependencies field of &lt;code&gt;package.json&lt;/code&gt; rather than &lt;code&gt;devDependencies&lt;/code&gt;. This is critical because &lt;code&gt;devDependencies&lt;/code&gt; are not installed when users download the package.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Testing Locally with &lt;code&gt;npm link&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Before publishing, I ran &lt;code&gt;npm link&lt;/code&gt; to simulate how users would install and use the package globally. This helped me test the CLI commands and catch any errors.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Building the Project&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Since the project was written in TypeScript, I ensured my build script compiled the source code correctly. Running &lt;code&gt;npm run build&lt;/code&gt; generated the necessary JavaScript files in a &lt;code&gt;dist&lt;/code&gt; folder.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Publishing the Package&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After verifying everything worked locally, I logged into npm using &lt;code&gt;npm login&lt;/code&gt; and published the package.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;--access public&lt;/code&gt; flag was required since I wanted my package to be publicly available.
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   npm publish &lt;span class="nt"&gt;--access&lt;/span&gt; public
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  User Testing
&lt;/h2&gt;

&lt;p&gt;For the testing phase, I asked a fellow developer to try out &lt;code&gt;dev-mate-cli&lt;/code&gt;. The tool worked as intended, and she found it easy to use with the provided instructions. Her main suggestion was improving the README to make the setup process clearer. Specifically, she recommended placing critical setup steps (like environment variable configuration) at the top of the documentation, which I promptly implemented.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Managing Dependencies&lt;/strong&gt;: One of the key issues I encountered was the &lt;code&gt;dotenv&lt;/code&gt; module being listed as a &lt;code&gt;devDependency&lt;/code&gt;. Since npm doesn’t include &lt;code&gt;devDependencies&lt;/code&gt; in the published package, this caused a runtime error. This was a valuable reminder to double-check the dependencies section before publishing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streamlining Documentation&lt;/strong&gt;: User testing with a developer revealed areas for improvement in my README. For instance, moving instructions for setting up environment variables (&lt;code&gt;API_KEY&lt;/code&gt; and &lt;code&gt;BASE_URL&lt;/code&gt;) to the installation section made it easier for users to get started.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Overall, publishing &lt;code&gt;dev-mate-cli&lt;/code&gt; was a rewarding process, filled with valuable lessons. I hope this blog helps other developers navigate the npm publishing process more easily. If you’re building your own CLI tool, feel free to reach out with questions or suggestions!&lt;/p&gt;

</description>
      <category>seneca</category>
      <category>osd600</category>
    </item>
    <item>
      <title>Introducing CI Pipeline for Clang-Format Checks in faker-cxx</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Thu, 21 Nov 2024 11:56:15 +0000</pubDate>
      <link>https://dev.to/mayankpareek/introducing-ci-pipeline-for-clang-format-checks-in-faker-cxx-35go</link>
      <guid>https://dev.to/mayankpareek/introducing-ci-pipeline-for-clang-format-checks-in-faker-cxx-35go</guid>
      <description>&lt;p&gt;For the second part of my Release 0.3 contribution to the &lt;a href="https://github.com/cieslarmichal/faker-cxx" rel="noopener noreferrer"&gt;&lt;code&gt;faker-cxx&lt;/code&gt;&lt;/a&gt; project, I addressed an issue involving the addition of a Continuous Integration (CI) pipeline. The goal was to ensure that any new code pushed to the repository adheres to the &lt;code&gt;clang-format&lt;/code&gt; configuration provided in the root folder. This was an exciting opportunity to deepen my understanding of CI/CD workflows, especially since I am actively learning about them.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/cieslarmichal/faker-cxx/issues/953" rel="noopener noreferrer"&gt;The Issue&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;faker-cxx&lt;/code&gt; repository already had a &lt;code&gt;clang-format&lt;/code&gt; configuration file, but there was no automated process to check if submitted code adhered to it. Previously, contributors had to run &lt;code&gt;clang-format&lt;/code&gt; locally before committing, which some contributors skipped and was also prone to human error. Automating this check would ensure consistency and reduce the chances of merging pull requests with formatting-related problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Approach
&lt;/h2&gt;

&lt;p&gt;To begin, I familiarized myself with &lt;code&gt;clang-format&lt;/code&gt; and its configuration guidelines. I had previously used &lt;code&gt;clang-format&lt;/code&gt; for contributions to this repository, but this time, I needed a more in-depth understanding to integrate it into a CI pipeline. &lt;a href="https://releases.llvm.org/18.1.0/tools/clang/docs/ClangFormat.html" rel="noopener noreferrer"&gt;Here’s the official release document I referred to&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Then, I explored the GitHub Actions Marketplace for pre-configured &lt;code&gt;clang-format&lt;/code&gt; actions, hoping to find a verified and actively maintained option. Unfortunately, none met these criteria, so I decided to write the workflow from scratch.&lt;/p&gt;

&lt;p&gt;Creating the GitHub Actions workflow involved defining steps to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check out the repository.&lt;/li&gt;
&lt;li&gt;Install &lt;code&gt;clang-format&lt;/code&gt; if it wasn’t already available.&lt;/li&gt;
&lt;li&gt;Cache dependencies to speed up the CI pipeline.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;clang-format&lt;/code&gt; on relevant files.&lt;/li&gt;
&lt;li&gt;Check for unformatted files and fail the CI run if any were found.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Implementing the CI Workflow
&lt;/h2&gt;

&lt;p&gt;Here is the core of the GitHub Actions workflow I wrote:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;check_formatting&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check Code Formatting&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-24.04&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checkout repository&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Cache clang-format dependencies&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/cache@v3&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/tmp/apt-cache&lt;/span&gt;
          &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;clang-format-${{ runner.os }}-${{ hashFiles('**/apt-packages.txt') }}&lt;/span&gt;
          &lt;span class="na"&gt;restore-keys&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
            &lt;span class="s"&gt;clang-format-${{ runner.os }}-&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install clang-format&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;if [ ! -f /tmp/apt-cache/clang-format-18 ]; then&lt;/span&gt;
            &lt;span class="s"&gt;sudo apt-get update&lt;/span&gt;
            &lt;span class="s"&gt;sudo apt-get install -y clang-format-18&lt;/span&gt;
            &lt;span class="s"&gt;touch /tmp/apt-cache/clang-format-18&lt;/span&gt;
          &lt;span class="s"&gt;fi&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run clang-format&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;clang-format src/**/*.cpp src/**/*.h include/**/*.h -i -style=file&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check for unformatted files&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;git diff --exit-code || (echo "Code is not formatted correctly" &amp;amp;&amp;amp; exit 1)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Key Features:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Path Filters: I ensured the workflow only ran when changes were made to files relevant to the &lt;code&gt;clang-format&lt;/code&gt; check. This optimization avoided unnecessary CI runs for unrelated updates like documentation changes.&lt;/li&gt;
&lt;li&gt;Caching: By caching the &lt;code&gt;clang-format&lt;/code&gt; dependencies, I reduced the time taken for subsequent runs. This step was implemented using the &lt;code&gt;actions/cache@v3&lt;/code&gt; action.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Testing and Deployment
&lt;/h2&gt;

&lt;p&gt;After writing the workflow, I tested it on my fork of the repository before pushing it upstream. This step was helpful to catch any issues early. Once I confirmed it was working as expected, I opened a pull request to the main repository.&lt;/p&gt;


&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/cieslarmichal/faker-cxx/pull/987" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        ci: add clang-format
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#987&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F103447831%3Fv%3D4" alt="mayank-Pareek avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;mayank-Pareek&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/cieslarmichal/faker-cxx/pull/987" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 20, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;p&gt;This closes #953&lt;/p&gt;
&lt;p&gt;This PR introduces a GitHub Action to check code formatting using clang-format.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Workflow&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Runs only on push and pull_request events for &lt;code&gt;include/**/*.h&lt;/code&gt;,&lt;code&gt;src/**/*.cpp&lt;/code&gt; and &lt;code&gt;src/**/*.h&lt;/code&gt; files.&lt;/li&gt;
&lt;li&gt;Cache check for &lt;code&gt;clang-format-18&lt;/code&gt; to avoid re-installation if it is already installed.&lt;/li&gt;
&lt;li&gt;Validates formatting using git diff and fails the workflow if unformatted files are detected.&lt;/li&gt;
&lt;/ul&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/cieslarmichal/faker-cxx/pull/987" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;The maintainer reviewed and merged the PR after a quick review, as the CI pipeline functioned smoothly and added significant value to the repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reflection
&lt;/h2&gt;

&lt;p&gt;Adding this CI workflow to &lt;code&gt;faker-cxx&lt;/code&gt; helped streamline the development process by automating an otherwise manual task. The repository now has an extra layer of validation, ensuring that all incoming code adheres to the defined coding standards. This experience enhanced my knowledge of setting up CI pipelines, including caching and optimization techniques.&lt;/p&gt;

</description>
      <category>seneca</category>
      <category>osd600</category>
    </item>
    <item>
      <title>Increasing Code Coverage in faker-cxx</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Thu, 21 Nov 2024 11:20:49 +0000</pubDate>
      <link>https://dev.to/mayankpareek/increasing-code-coverage-in-faker-cxx-3k46</link>
      <guid>https://dev.to/mayankpareek/increasing-code-coverage-in-faker-cxx-3k46</guid>
      <description>&lt;p&gt;For the Release 0.3 milestone of my OSD600 course, I returned to contribute to the &lt;a href="https://github.com/cieslarmichal/faker-cxx" rel="noopener noreferrer"&gt;&lt;code&gt;faker-cxx&lt;/code&gt;&lt;/a&gt; library, a C++ library designed for generating realistic fake data. As someone who had previously contributed to this project, I was eager to take on a more challenging issue. This time, I focused on increasing code coverage for a specific module.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://github.com/cieslarmichal/faker-cxx/issues/907" rel="noopener noreferrer"&gt;The Issue&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The function &lt;code&gt;ISBN10&lt;/code&gt; generates a 10-digit ISBN, sometimes with the letter "X" as the last character (representing a check digit of 10). The challenge is in the fact that this occurrence is random and relatively rare.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;ISBN10&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="k"&gt;auto&lt;/span&gt; &lt;span class="n"&gt;isbn10&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;numeric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;weight&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;size_t&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;isbn10&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="sc"&gt;'0'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;weight&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;weight&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;checkDigit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;checkDigit&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;checkDigit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;checkDigit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;checkDigit&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;isbn10&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"X"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;isbn10&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;to_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;checkDigit&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;While the function works well, the existing test covered it minimally, running it once to check the result. The random nature meant edge case of generating an ISBN ending in "X" was often missed.&lt;/p&gt;
&lt;h2&gt;
  
  
  My Approach
&lt;/h2&gt;

&lt;p&gt;Before diving into the code, I spent time understanding how ISBN generation and validation worked. The check digit calculation involves a weighted sum of the first nine digits, which must be divisible by 11. If the remainder is 10, the check digit becomes "X". This process provided the basis for writing effective tests.&lt;/p&gt;

&lt;p&gt;The original test checked for validity but did not focus on the edge case of "X". I modified it to ensure it only handled ISBNs without "X". To address the edge case, I introduced a new test. Given the randomness, generating "X" reliably required multiple iterations which I achieved by adding a loop to maximize the chance of generating "X". As a fallback, if "X" was not generated, I used a pre-defined valid ISBN ending with "X". &lt;/p&gt;


&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/cieslarmichal/faker-cxx/pull/986" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        feat: improve codecov for commerce module
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#986&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F103447831%3Fv%3D4" alt="mayank-Pareek avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;mayank-Pareek&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/cieslarmichal/faker-cxx/pull/986" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 20, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;p&gt;This closes #907&lt;/p&gt;
&lt;p&gt;This PR improves the test coverage for the &lt;code&gt;ISBN10&lt;/code&gt; function in &lt;code&gt;commerce.cpp&lt;/code&gt; and the associated &lt;code&gt;commerce_test.cpp&lt;/code&gt; file.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Changes:&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Updated &lt;code&gt;shouldGenerateIsbn10&lt;/code&gt; : Updated to check only ISBNs without X.&lt;/li&gt;
&lt;li&gt;Added &lt;code&gt;shouldGenerateIsbn10WithX&lt;/code&gt; : Specifically tests for the check digit - X.
&lt;div class="highlight highlight-source-c++ js-code-highlight"&gt;
&lt;pre&gt;  std::string generatedIsbn10;
  &lt;span class="pl-k"&gt;bool&lt;/span&gt; foundXCase = &lt;span class="pl-c1"&gt;false&lt;/span&gt;;
 
  &lt;span class="pl-k"&gt;for&lt;/span&gt; (&lt;span class="pl-c1"&gt;size_t&lt;/span&gt; i = &lt;span class="pl-c1"&gt;0&lt;/span&gt;; i &amp;lt; &lt;span class="pl-c1"&gt;100&lt;/span&gt; &amp;amp;&amp;amp; !foundXCase; i++)
  {
      generatedIsbn10 = &lt;span class="pl-c1"&gt;ISBN10&lt;/span&gt;();
      &lt;span class="pl-k"&gt;if&lt;/span&gt; (generatedIsbn10[&lt;span class="pl-c1"&gt;9&lt;/span&gt;] == &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;X&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;)
      {
          foundXCase = &lt;span class="pl-c1"&gt;true&lt;/span&gt;;
      }
  }
 
  &lt;span class="pl-k"&gt;if&lt;/span&gt; (!foundXCase)
  {
      generatedIsbn10 = &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;"&lt;/span&gt;094339600X&lt;span class="pl-pds"&gt;"&lt;/span&gt;&lt;/span&gt;;
  }&lt;/pre&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Improved Test Coverage&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;commerce.cpp&lt;/code&gt; from 98% to 100%.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;commerce_test.cpp&lt;/code&gt; from 96% to 99%.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;Note&lt;/code&gt;: While the tests achieve 99% coverage for &lt;code&gt;commerce_test.cpp&lt;/code&gt;, the if &lt;code&gt;(!foundXCase)&lt;/code&gt; branch in &lt;code&gt;shouldGenerateIsbn10WithX&lt;/code&gt; is intentionally left uncovered to maintain logical clarity and introduce fallback.&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/cieslarmichal/faker-cxx/pull/986" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  Challenges and Learnings
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Reviewing coverage reports with &lt;code&gt;gcov&lt;/code&gt; and &lt;code&gt;lcov&lt;/code&gt; was instrumental in identifying the uncovered cases.&lt;/li&gt;
&lt;li&gt;Writing tests for functions with randomness requires strategic thinking.&lt;/li&gt;
&lt;li&gt;Breaking tests into specific cases (e.g., with and without "X") helps ensure coverage while maintaining readability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After my changes, the tests covered all possible outputs of the &lt;code&gt;ISBN10&lt;/code&gt; function, increasing overall module coverage. Although one fallback line remained technically uncovered, thorough testing and the inherent randomness of the function were finely balanced.&lt;/p&gt;

</description>
      <category>seneca</category>
      <category>osd600</category>
    </item>
    <item>
      <title>Setting up Continuous Integration (CI) for dev-mate-cli</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Thu, 14 Nov 2024 04:39:44 +0000</pubDate>
      <link>https://dev.to/mayankpareek/setting-up-continuous-integration-ci-for-dev-mate-cli-19ea</link>
      <guid>https://dev.to/mayankpareek/setting-up-continuous-integration-ci-for-dev-mate-cli-19ea</guid>
      <description>&lt;p&gt;In this blog, I will walk through my experience setting up a CI workflow for my project &lt;a href="https://github.com/mayank-Pareek/dev-mate-cli" rel="noopener noreferrer"&gt;&lt;code&gt;dev-mate-cli&lt;/code&gt;&lt;/a&gt;, including insights into collaborating on testing and CI with a peer's project. Along the way, I took on the optional challenge of integrating a linter and explored how this addition improves code quality and the CI experience. Here’s how it all came together:&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up the GitHub Actions CI Workflow
&lt;/h2&gt;

&lt;p&gt;To start, I set up a simple CI workflow using GitHub Actions, designed to run tests whenever I pushed new changes. I’ve worked with basic CI setups like this before so I knew what to do. I created a YAML file in the &lt;code&gt;.github/workflows&lt;/code&gt; directory, with the following configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;CI&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;unit-test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Unit Tests&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Setup Node&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v4&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;lts/*'&lt;/span&gt;
          &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;npm'&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install Dependencies and Run Tests&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm install-ci-test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This workflow checks out the repository, sets up Node.js, installs dependencies, and runs the tests. As soon as I pushed the changes, GitHub Actions triggered the workflow, running all my Jest test suites, which passed successfully. This was a great way to ensure that each update to my project wouldn’t inadvertently break any functionality. Checkout the &lt;a href="https://github.com/mayank-Pareek/dev-mate-cli/actions/runs/11806835449/job/32892289710" rel="noopener noreferrer"&gt;action run here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Collaboration for Testing
&lt;/h2&gt;

&lt;p&gt;As part of the lab in my OSD600 course, I also needed to collaborate with a peer, &lt;a href="https://github.com/AnhChienVu" rel="noopener noreferrer"&gt;Anh Chien Vu&lt;/a&gt;. We agreed to add tests to each other's projects. Since we had already worked together, we knew each other’s code style and project setups, which made this collaboration easier. Anh Chien’s PR included an additional test suite, which improved my test coverage. His code was well-structured, so after testing his changes locally, I was comfortable merging the PR.&lt;/p&gt;

&lt;p&gt;Writing tests for Anh’s project, &lt;a href="https://github.com/AnhChienVu/VShell/" rel="noopener noreferrer"&gt;VShell&lt;/a&gt;, involved testing core CLI functions to verify program details and AI response generation. View the PR below:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/AnhChienVu/VShell/pull/21" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Add tests for server.js
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#21&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F103447831%3Fv%3D4" alt="mayank-Pareek avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;mayank-Pareek&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/AnhChienVu/VShell/pull/21" rel="noopener noreferrer"&gt;&lt;time&gt;Nov 12, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Description&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;This PR aims to add a new file with unit tests for &lt;code&gt;server.js&lt;/code&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Changes Made&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Added &lt;code&gt;server.test.js&lt;/code&gt; containing the following unit tests for &lt;code&gt;server.js&lt;/code&gt; -&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;should set up CLI information i.e. name, version and description.&lt;/li&gt;
&lt;li&gt;should use default values when no config file exists.&lt;/li&gt;
&lt;li&gt;should exit when no files(for processing) are provided with debug enabled.&lt;/li&gt;
&lt;li&gt;should process files and call promptAI&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These tests have 100% code coverage for &lt;code&gt;server.js&lt;/code&gt; file.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Testing Details&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;[x] Unit tests added&lt;/li&gt;
&lt;li&gt;[x] Unit tests passed&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Checklist&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;[x] Code compiles correctly&lt;/li&gt;
&lt;li&gt;[x] Tests have been written and run&lt;/li&gt;
&lt;li&gt;[x] Code adheres to the style guidelines&lt;/li&gt;
&lt;li&gt;[x] Ready for review&lt;/li&gt;
&lt;/ul&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/AnhChienVu/VShell/pull/21" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Since both of our projects used Jest, I had a smooth start, but I ran into some challenges mocking modules due to dependencies. I had to use &lt;code&gt;jest.resetModules()&lt;/code&gt; to clear the module cache after each test and directly import the required modules, which was a new but valuable lesson. This hands-on collaboration allowed me to experiment with test structures I can now apply in my own project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding a Linter to the CI Workflow
&lt;/h2&gt;

&lt;p&gt;To further enhance my CI pipeline, I took on the optional challenge of integrating a linter. The project initially used ESLint for linting, but I ran into multiple configuration complexities due to dependencies and plugins for Jest, Prettier, and TypeScript. To simplify things, I migrated to &lt;a href="https://biomejs.dev/" rel="noopener noreferrer"&gt;Biome&lt;/a&gt;, which combines both formatting and linting, reducing the need for multiple tools.&lt;/p&gt;

&lt;p&gt;After updating the project to use Biome, I created a &lt;code&gt;lint&lt;/code&gt; job in the CI configuration to automatically check for linting errors. Here’s what the addition looked like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;lint&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Biome Lint&lt;/span&gt;
  &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
  &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checkout&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Setup node&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v4&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;lts/*'&lt;/span&gt;
        &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;npm'&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install Dependencies&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm ci&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Biome Lint&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm run lint&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding a linter to the CI helped enforce consistent coding practices, catching potential errors before merging.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Overall, I learned that even a basic CI setup can provide a strong foundation to the project. It helps by giving immediate feedback on the code's stability and catching issues before merging. Having CI with both tests and lint checks makes code review easier and encourages better code quality, and I plan to implement it in all future work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.freepik.com/free-vector/gradient-devops-illustration_25225463.htm#fromView=keyword&amp;amp;page=1&amp;amp;position=6&amp;amp;uuid=d62aef9e-56f0-40fe-9398-ea128c6ad198" rel="noopener noreferrer"&gt;Cover Image by freepik&lt;/a&gt;&lt;/p&gt;

</description>
      <category>seneca</category>
      <category>osd600</category>
      <category>ci</category>
    </item>
    <item>
      <title>Adding Jest to dev-mate-cli</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Sat, 09 Nov 2024 03:39:24 +0000</pubDate>
      <link>https://dev.to/mayankpareek/adding-jest-to-dev-mate-cli-1l1k</link>
      <guid>https://dev.to/mayankpareek/adding-jest-to-dev-mate-cli-1l1k</guid>
      <description>&lt;p&gt;This week, I focused on improving &lt;a href="https://github.com/mayank-Pareek/dev-mate-cli" rel="noopener noreferrer"&gt;dev-mate-cli&lt;/a&gt; by adding robust testing with &lt;a href="https://jestjs.io/" rel="noopener noreferrer"&gt;Jest&lt;/a&gt;, a popular JavaScript testing framework. The goal was to enhance reliability and encourage contributions by ensuring new changes align with the project’s standards. Here’s a breakdown of the tools I used, the setup process, lessons learned, and how testing improved the code.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;
        mayank-Pareek
      &lt;/a&gt; / &lt;a href="https://github.com/mayank-Pareek/dev-mate-cli" rel="noopener noreferrer"&gt;
        dev-mate-cli
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A command line tool to quickly document your code
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;dev-mate-cli&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;A command-line tool that leverages OpenAI's Chat Completion API to document code with the assistance of AI models.&lt;/p&gt;
&lt;p&gt;Watch this &lt;a href="https://youtu.be/YJDD6YBaEFk" rel="nofollow noopener noreferrer"&gt;Demo video&lt;/a&gt; to view features.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source Code Documentation&lt;/strong&gt;: Automatically generate comments and documentation for your source code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiple File Processing&lt;/strong&gt;: Handle one or multiple files in a single command.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model Selection&lt;/strong&gt;: Choose which AI model to use with the &lt;code&gt;--model&lt;/code&gt; flag.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Output&lt;/strong&gt;: Output the results to a file with the &lt;code&gt;--output&lt;/code&gt; flag, or display them in the console.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stream Output&lt;/strong&gt;: Stream the LLM response to command line with &lt;code&gt;--stream&lt;/code&gt; flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Basic Usage&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;To run the tool, specify one or more source files or folders as input:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm start ./examples/file.js&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;For processing multiple files:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm start ./examples/file.js ./examples/file.cpp&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;For processing folders:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm start ./examples&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Command-line Options&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Note: Use &lt;code&gt;npm start -- -option&lt;/code&gt; to pass the option flag to the program, as npm…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mayank-Pareek/dev-mate-cli" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h3&gt;
  
  
  Why Jest?
&lt;/h3&gt;

&lt;p&gt;I chose Jest for its popularity, TypeScript compatibility, powerful mocking capabilities, and large community. Jest is widely adopted in the JavaScript/TypeScript ecosystem and provides built-in support for many essential features like snapshot testing, coverage reports, and a simple setup. Since I already had some experience with Jest in JavaScript, I was excited to deepen my understanding by integrating it with my project that uses TypeScript and ESLint.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting Up Jest with TypeScript and ESLint
&lt;/h3&gt;

&lt;p&gt;Configuring Jest to work smoothly with TypeScript and ESLint was more complex than I anticipated. I first installed Jest as a dev dependency and added three most-relevant scripts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nl"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"jest -c jest.config.js --runInBand --"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"test:watch"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"jest -c jest.config.js --runInBand --watch --"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"coverage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"jest -c jest.config.js --runInBand --coverage"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the initial test case, I picked a utility function, &lt;a href="https://github.com/mayank-Pareek/dev-mate-cli/blob/main/src/utils/checkIterable.ts" rel="noopener noreferrer"&gt;&lt;code&gt;checkIterable&lt;/code&gt;&lt;/a&gt;, that checks if an AI response can be streamed. Writing tests for it revealed a bug: it didn’t handle null inputs properly, returning null instead of false. I corrected this by ensuring it returns a Boolean consistently. This first success confirmed that tests could effectively catch errors in code logic, saving time later in the development process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mocking AI Responses with Jest
&lt;/h3&gt;

&lt;p&gt;The biggest challenge was simulating AI responses from OpenAI's API. Initially, I tried using &lt;a href="https://www.npmjs.com/package/nock" rel="noopener noreferrer"&gt;nock&lt;/a&gt; to intercept HTTP requests, but while researching I found that OpenAI had mocking capabilities for its &lt;a href="https://community.openai.com/t/testing-application-around-api-calls-with-jest-in-typescript/567809" rel="noopener noreferrer"&gt;constructor&lt;/a&gt; , which let me use captured JSON responses to simulate interactions with the model.&lt;/p&gt;

&lt;p&gt;I structured the main &lt;a href="https://github.com/mayank-Pareek/dev-mate-cli/blob/main/tests/unit/ai.test.ts" rel="noopener noreferrer"&gt;&lt;code&gt;ai.test.ts&lt;/code&gt;&lt;/a&gt; to cover three essential cases: Basic AI Response, API Errors and Missing Environment Variables. With the &lt;code&gt;jest.spyOn&lt;/code&gt; function, I could capture console logs and errors, confirming that messages were displayed as expected for both successful and failed API calls. This approach allowed me to identify gaps in error handling.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lessons Learned
&lt;/h3&gt;

&lt;p&gt;While I had limited experience with testing, setting up Jest for TypeScript and experimenting with AI response mocking deepened my understanding of automated testing. This process was a great reminder of how thorough testing improves code quality and promotes a smoother contribution experience. Going forward, I’m committed to making testing a core part of my development workflow and look forward to expanding the test suite as &lt;code&gt;dev-mate-cli&lt;/code&gt; evolves.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Enhancing Contributions for dev-mate-cli</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Sat, 02 Nov 2024 04:04:39 +0000</pubDate>
      <link>https://dev.to/mayankpareek/aligning-contributions-for-dev-mate-cli-599e</link>
      <guid>https://dev.to/mayankpareek/aligning-contributions-for-dev-mate-cli-599e</guid>
      <description>&lt;p&gt;This week, I focused on improving and encouraging contributions to my project, &lt;a href="https://github.com/mayank-Pareek/dev-mate-cli" rel="noopener noreferrer"&gt;&lt;code&gt;dev-mate-cli&lt;/code&gt;&lt;/a&gt;. As open-source projects thrive on community involvement, I recognized the need to create a seamless experience for new contributors. Here’s how I worked towards that goal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing CONTRIBUTIONS.md
&lt;/h2&gt;

&lt;p&gt;First of all, I created a new file called CONTRIBUTIONS.md. This document outlines the guidelines and setup necessary for development. Some of these instructions were previously present in README.md, but to separate documentations for contributors, I added them in the new file along with some new guidelines. Having clear instructions will help potential contributors understand how they can effectively engage with the project, fostering a more collaborative environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Aligning Contributions with Prettier and ESLint
&lt;/h2&gt;

&lt;p&gt;Next, I turned my attention to ensuring that all contributions are aligned with our coding standards. I realized that while I had previously added Prettier for code formatting, it wasn’t functioning as intended. So, I enhanced the configuration to ensure that code would be automatically formatted upon saving, along with introducing scripts to run prettier in command-line.&lt;/p&gt;

&lt;p&gt;After setting up Prettier, I followed the similar process and integrated ESLint into the project. ESLint helps catch errors and enforce coding conventions, making it easier for contributors to maintain code quality. By providing clear linting rules, I aimed to reduce potential friction points during the contribution process.&lt;/p&gt;

&lt;h2&gt;
  
  
  VSCode Settings for a Smooth Development Experience
&lt;/h2&gt;

&lt;p&gt;To further facilitate contributions, I added a &lt;code&gt;.vscode&lt;/code&gt; which includes essential configurations to ensure that contributors using Visual Studio Code have a consistent experience. I also included extension recommendations to help streamline the development process.&lt;/p&gt;

&lt;p&gt;All of the changes discussed above were squashed into a single commit, you can view all the changes &lt;a href="https://github.com/mayank-Pareek/dev-mate-cli/commit/c82691f958a3bd2aa47ba20d7736aba3c3a10739" rel="noopener noreferrer"&gt;here.&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I believe these enhancements will attract more contributions while keeping disruptions to a minimum. By providing clear guidelines and automated tools for formatting and linting, I hope to create a welcoming environment for developers who want to contribute to &lt;code&gt;dev-mate-cli&lt;/code&gt;. As the project evolves, I look forward to seeing how these changes positively impact the project growth.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>My Hacktoberfest 2024 Experience</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Fri, 01 Nov 2024 02:49:48 +0000</pubDate>
      <link>https://dev.to/mayankpareek/my-hacktoberfest-2024-experience-54fp</link>
      <guid>https://dev.to/mayankpareek/my-hacktoberfest-2024-experience-54fp</guid>
      <description>&lt;p&gt;This October, I dove into &lt;a href="https://hacktoberfest.com" rel="noopener noreferrer"&gt;Hacktoberfest 2024&lt;/a&gt;, excited to contribute to open-source projects and gain real-world coding experience. As a relatively new participant in open source, I didn’t know what to expect - only that I wanted to explore and learn as much as possible. This journey introduced me to a diverse range of projects and coding practices, which expanded my perspective on software development.&lt;/p&gt;

&lt;p&gt;Hacktoberfest itself was an adventure. Initially, finding issues that were manageable, open to new contributors, and within my skill set took time. The Hacktoberfest tag was both a blessing and a challenge: while it directed me toward projects welcoming contributions, it also attracted thousands of developers with the same goal because of growing popularity. I discovered that many repositories with these tags were either overloaded with PRs or had issues that were not truly beginner-friendly(at least in my-terms). Still, with persistence, I found several exciting projects that offered a chance to make a meaningful impact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tackling Four Unique Pull Requests
&lt;/h2&gt;

&lt;p&gt;Throughout Hacktoberfest, I explored and worked on many different projects, each with its own ecosystem and contribution challenges. Below is a rundown of the four PRs entailed and what I gained from them -&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/mayankpareek/my-first-hacktoberfest-pull-request-3m2"&gt;TLDR Pages (Adding a Page)&lt;/a&gt;&lt;/strong&gt; - My journey began with a fairly straightforward PR - adding a new page to TLDR Pages, a collaborative project for simplified, community-driven command documentation. Working on this was a smooth entry point, letting me focus on writing concise, readable documentation while following the project’s strict contribution standards. It was not overly technical, but it deepened my understanding of guideline’s importance in open-source contributions and helped me become familiar with the PR process on GitHub.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/mayankpareek/my-contribution-to-deno-20-48mg"&gt;Deno Project (Primordials Replacement)&lt;/a&gt;&lt;/strong&gt; - Next, I contributed to the Deno repository which is a JavaScript runtime focused on security and modern practices, and my issue dealt with its Node.js compatibility layer. My task was to replace some global functions with “primordials” to prevent potential prototype pollution. This PR had me researching the project’s coding standards, understanding JavaScript runtime internals, and navigating a large codebase written in a combination of JavaScript, TypeScript and Rust. Setting up the environment was challenging and required understanding Deno's unique structure. This PR pushed my comfort zone and I got insight into how JavaScript runtimes are built.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/mayankpareek/my-third-hacktoberfest-pr-adding-locale-support-to-faker-c-3p7c"&gt;Faker C++ (Adding Locale to a Module)&lt;/a&gt;&lt;/strong&gt; - The third project, Faker C++, was inspired by the popular Faker.js library, which generates realistic mock data for testing. My task was to add locale support to a module, which allowed me to work on a C++ codebase - something I had not done in a while. Setting up the environment in C++ was a different kind of challenge, involving tools like Blaze, CMake, Ninja, and clang-format.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://dev.to/mayankpareek/adding-workflow-filters-to-valid-gtin-48bl"&gt;Valid-GTIN (Optimizing GitHub Actions Workflow)&lt;/a&gt;&lt;/strong&gt; - My fourth and final PR involved CI/CD with GitHub Actions, a domain I’ve been eager to contribute in. The issue here was to update the workflow file to optimize when tests should run, based on changes to specific files. This required me to research GitHub Actions’ path filtering and to figure out the best way to apply it without disrupting the main workflow. It was a lightweight project, but it gave me a chance to work with CI/CD and understand the considerations that go into managing resources in active projects.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Challenges and Joys of Open Source
&lt;/h2&gt;

&lt;p&gt;While I ultimately completed four PRs, the journey involved exploring nearly a dozen other issues that I couldn’t resolve for various reasons. Some were overly complex, and others introduced dependencies or setup requirements that I couldn’t resolve within my timeframe. Each issue presented unique challenges: some were in languages or frameworks I hadn’t worked with, while others required new configurations I’d never set up before. I deliberately avoided asking to be assigned issues immediately, instead working through them locally to avoid blocking others until I was confident I could handle them.&lt;/p&gt;

&lt;p&gt;This approach was sometimes frustrating but taught me a lot. I learned to persevere through setups, to read documentation thoroughly, and to test things locally until I felt prepared to push changes. By the end of Hacktoberfest, I have probably reviewed over a hundred repositories, many of which are incredibly interesting even if they didn’t have open issues suitable for me. These explorations have expanded my understanding of various programming languages and domains, and I now have a list of projects I plan to revisit and contribute to in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned and Future Plans
&lt;/h2&gt;

&lt;p&gt;Reflecting on Hacktoberfest, I’m grateful for the growth I’ve experienced both technically and personally. Here are a few lessons I’m taking with me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Value of Good Documentation: Projects with well-documented contribution guidelines and helpful communities stood out. Clear documentation not only makes contributions smoother but encourages newcomers to participate.&lt;/li&gt;
&lt;li&gt;Perseverance Pays Off: Finding the right issues and setting up environments was often time-consuming. But sticking with it led to valuable learning experiences and the satisfaction of seeing a PR merged.&lt;/li&gt;
&lt;li&gt;Expanding My Toolset: I gained exposure to C++ setups, JavaScript runtimes, CI/CD workflows, and more. Hacktoberfest pushed me out of my comfort zone to use new tools and frameworks.&lt;/li&gt;
&lt;li&gt;The Open-Source Community is Inspiring: Being a part of the open-source community and contributing to shared projects was deeply fulfilling. Knowing that my code might help someone else or improve a project definitely felt nice.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Although Hacktoberfest is over, my open-source journey is only beginning. I plan to keep contributing to projects I found interesting and giving back to a community that has given so much to developers.&lt;/p&gt;

</description>
      <category>seneca</category>
      <category>osd600</category>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>Adding Workflow Filters to Valid-GTIN</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Fri, 01 Nov 2024 01:51:57 +0000</pubDate>
      <link>https://dev.to/mayankpareek/adding-workflow-filters-to-valid-gtin-48bl</link>
      <guid>https://dev.to/mayankpareek/adding-workflow-filters-to-valid-gtin-48bl</guid>
      <description>&lt;p&gt;For my fourth Hacktoberfest PR, I was determined to work on something related to CI/CD, Docker, or perhaps something DevOps-oriented. After hunting through several repositories, I found some promising CI/CD issues, but they often required touching multiple workflows or were deeply embedded in existing configurations. Given the potential risk of disrupting the projects with complex changes, I decided to keep looking until I found a better fit. That’s when I came across valid-gtin - a lightweight JavaScript library designed to validate GTINs (Global Trade Item Numbers).&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/0xflotus" rel="noopener noreferrer"&gt;
        0xflotus
      &lt;/a&gt; / &lt;a href="https://github.com/0xflotus/valid-gtin" rel="noopener noreferrer"&gt;
        valid-gtin
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A lightweight validator function for GTINs
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;valid-gtin&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://badge.fury.io/js/valid-gtin" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/a718c934641c57e0a5e2e3d28bb6f0a87c6ac6ed72a2dc76a1afac73d07b63b2/68747470733a2f2f62616467652e667572792e696f2f6a732f76616c69642d6774696e2e737667" alt="npm version"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/8cd76659b396e3a12b7cdee295cdd03ae71339e1b8755c7b60fd793b4047878c/68747470733a2f2f62616467656e2e6e65742f62756e646c6570686f6269612f6d696e7a69702f76616c69642d6774696e406c6174657374"&gt;&lt;img src="https://camo.githubusercontent.com/8cd76659b396e3a12b7cdee295cdd03ae71339e1b8755c7b60fd793b4047878c/68747470733a2f2f62616467656e2e6e65742f62756e646c6570686f6269612f6d696e7a69702f76616c69642d6774696e406c6174657374" alt="valid-gtin"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/483d7d331e78dbb9d1585c02cb58a11ad39dac3b6473ba5b3c4cdeb5f41692fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f3078666c6f7475732f76616c69642d6774696e3f6272616e63683d6d6173746572266c6162656c3d436f646525323053697a65266c6f676f3d476974487562266c6f676f436f6c6f723d666666666666266c6162656c436f6c6f723d323832383238267374796c653d666c6174"&gt;&lt;img src="https://camo.githubusercontent.com/483d7d331e78dbb9d1585c02cb58a11ad39dac3b6473ba5b3c4cdeb5f41692fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f3078666c6f7475732f76616c69642d6774696e3f6272616e63683d6d6173746572266c6162656c3d436f646525323053697a65266c6f676f3d476974487562266c6f676f436f6c6f723d666666666666266c6162656c436f6c6f723d323832383238267374796c653d666c6174" alt="code size in bytes"&gt;&lt;/a&gt;
&lt;a href="https://sonarcloud.io/dashboard?id=0xflotus_valid-gtin" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/895be2cf489cac4a9a1067e8aea7212c28acc3c800e5a170cfad55dd12f9c919/68747470733a2f2f736f6e6172636c6f75642e696f2f6170692f70726f6a6563745f6261646765732f6d6561737572653f70726f6a6563743d3078666c6f7475735f76616c69642d6774696e266d65747269633d616c6572745f737461747573" alt="Quality Gate Status"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/e8ae13c619c446b1506bb6bd40cdc0bc76b7765f3261211b68d36ebf5b4621d1/68747470733a2f2f62616467656e2e6e65742f6e706d2f646570656e64656e74732f76616c69642d6774696e"&gt;&lt;img src="https://camo.githubusercontent.com/e8ae13c619c446b1506bb6bd40cdc0bc76b7765f3261211b68d36ebf5b4621d1/68747470733a2f2f62616467656e2e6e65742f6e706d2f646570656e64656e74732f76616c69642d6774696e" alt="dependents"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/6f7e797bd7f352ccf0fb58da847f5a7f9be3928990070713072b6b851f13a48c/68747470733a2f2f736c6f632e78797a2f6769746875622f3078666c6f7475732f76616c69642d6774696e2f"&gt;&lt;img src="https://camo.githubusercontent.com/6f7e797bd7f352ccf0fb58da847f5a7f9be3928990070713072b6b851f13a48c/68747470733a2f2f736c6f632e78797a2f6769746875622f3078666c6f7475732f76616c69642d6774696e2f" alt="Scc Count Badge"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A zero cost lightweight validator function in native javascript for GTINs&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="highlight highlight-source-js notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;validate&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-en"&gt;require&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;"valid-gtin"&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;

&lt;span class="pl-k"&gt;if&lt;/span&gt; &lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;validate&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-c1"&gt;GTIN&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
  &lt;span class="pl-smi"&gt;console&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;log&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;":)"&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;CLI&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;&lt;code&gt;valid_gtin &amp;lt;gtin&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Development&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;To run the tests please checkout this repository and run:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;npm run test&lt;/code&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Stargazers over time&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://starchart.cc/0xflotus/valid-gtin" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/c47274a555362ebc70897737fe183fb82aa7a9496bb88c198f311602b32ccae7/68747470733a2f2f7374617263686172742e63632f3078666c6f7475732f76616c69642d6774696e2e737667" alt="Stargazers over time"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/0xflotus/valid-gtin" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;At first glance, it was a straightforward repository with only a few files and a single function responsible for GTIN validation. But that’s what made it perfect: it was clean, lightweight, and, best of all, the issue at hand was exactly what I was looking for.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Issue
&lt;/h2&gt;

&lt;p&gt;The issue was focused on improving the &lt;code&gt;test.yml&lt;/code&gt; GitHub Actions workflow file by adding path filtering to make testing more efficient by only running tests on specific file changes and thus reducing unnecessary runs. Earlier, every commit to the main branch or new pull requests, triggered tests, regardless of whether relevant files had changed. My goal was to update the workflow so that tests would only run when certain files (like .js, .ts, or GitHub workflow files) were modified. This was an ideal opportunity to learn about workflow filtering while keeping things relatively low-risk.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/0xflotus/valid-gtin/issues/109" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Tests should only run if some special files were edited
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#109&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/0xflotus" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F26602940%3Fv%3D4" alt="0xflotus avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/0xflotus" rel="noopener noreferrer"&gt;0xflotus&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/0xflotus/valid-gtin/issues/109" rel="noopener noreferrer"&gt;&lt;time&gt;Oct 21, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;p&gt;To reduce the costs, the tests should only run, if one of the following files was touched:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;*.{mjs,js,ts}&lt;/li&gt;
&lt;li&gt;.github/workflows/*.yml&lt;/li&gt;
&lt;li&gt;package.json&lt;/li&gt;
&lt;li&gt;tsconfig.json&lt;/li&gt;
&lt;/ul&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/0xflotus/valid-gtin/issues/109" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Making Changes
&lt;/h2&gt;

&lt;p&gt;After forking the repository and cloning it locally, I created a new feature branch and started by researching GitHub Actions path filtering options. I had never actually set up path-specific filters in a workflow before, so I spent some time experimenting with different configurations to get a better understanding of how to target files accurately and found relevant documentation on &lt;a href="https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore" rel="noopener noreferrer"&gt;GitHub Docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;test.yml file&lt;/code&gt;, I updated the workflow to be more efficient by modifying the &lt;code&gt;on&lt;/code&gt; event so it would listen only to changes in specific file types, hence making the CI/CD process lighter and more efficient. The updated workflow configuration included path filters which looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;main&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;*.mjs'&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;*.js'&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;*.ts'&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;.github/workflows/*.yml'&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;package.json'&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tsconfig.json'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Creating the Pull Request
&lt;/h2&gt;

&lt;p&gt;After configuring the workflow, I committed my changes, pushed the branch, and opened a pull request. Setting up CI/CD filters sounds straightforward, but it was surprisingly fun digging into the specifics and understanding how path filters could optimize workflows. I liked the idea of improving the efficiency of a smaller project, where every little optimization could streamline contributions and keep the repository agile. The repository owner reviewed the pull request fairly quickly and the PR was successfully merged.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/0xflotus/valid-gtin/pull/113" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Optimize Test Workflow to Run Only on Relevant File Changes
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#113&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F103447831%3Fv%3D4" alt="mayank-Pareek avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;mayank-Pareek&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/0xflotus/valid-gtin/pull/113" rel="noopener noreferrer"&gt;&lt;time&gt;Oct 31, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;p&gt;Fixes #109&lt;/p&gt;
&lt;p&gt;This PR modifies the GitHub Actions workflow to trigger tests only when specific files are changed, reducing unnecessary test runs and saving CI resources. With this update, the tests will only run if any of the following files or patterns are modified:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Files with extensions &lt;code&gt;.mjs, .js, .ts&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.github/workflows/*.yml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tsconfig.json&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Changes Made:&lt;/h2&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Updated &lt;code&gt;.github/workflow/test.yml&lt;/code&gt; by adding paths filtering under push and pull_request triggers, specifying the relevant files to watch.
&lt;div class="highlight highlight-source-yaml js-code-highlight"&gt;
&lt;pre&gt; &lt;span class="pl-ent"&gt;paths&lt;/span&gt;:
   - &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;*.mjs&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;
   - &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;*.js&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;
   - &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;*.ts&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;
   - &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;.github/workflows/*.yml&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;
   - &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;package.json&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;
   - &lt;span class="pl-s"&gt;&lt;span class="pl-pds"&gt;'&lt;/span&gt;tsconfig.json&lt;span class="pl-pds"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/0xflotus/valid-gtin/pull/113" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  Reflection
&lt;/h2&gt;

&lt;p&gt;This PR marked a significant step for me in Hacktoberfest, allowing me to contribute to CI/CD workflows, which I’ve been interested in for a while. Working on a smaller repository was also refreshing, as it gave me space to try new configurations without the pressure of handling a huge codebase. I enjoyed this contribution for the balance it struck between learning something new and enhancing the project in a meaningful way.&lt;/p&gt;

</description>
      <category>seneca</category>
      <category>osd600</category>
    </item>
    <item>
      <title>My Third Hacktoberfest PR: Adding Locale Support to Faker C++</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Thu, 31 Oct 2024 23:25:00 +0000</pubDate>
      <link>https://dev.to/mayankpareek/my-third-hacktoberfest-pr-adding-locale-support-to-faker-c-3p7c</link>
      <guid>https://dev.to/mayankpareek/my-third-hacktoberfest-pr-adding-locale-support-to-faker-c-3p7c</guid>
      <description>&lt;p&gt;For my third Hacktoberfest contribution, I worked on a fascinating project called &lt;a href="https://github.com/cieslarmichal/faker-cxx" rel="noopener noreferrer"&gt;Faker C++&lt;/a&gt;. This C++ library, inspired by the well-known &lt;a href="https://fakerjs.dev" rel="noopener noreferrer"&gt;Faker.js&lt;/a&gt;, is designed to give developers a flexible tool for generating realistic fake data. This repository had several open issue to choose from, I picked one of the issue to familiarize myself with C++ development again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Issue Overview
&lt;/h2&gt;

&lt;p&gt;The issue I tackled was to add locale support to a specific module within the project. This enhancement was intended to allow the plant module to generate data in different languages, making the library even more adaptable for developers around the world. This change would provides developers with the option to create location-specific data, which is especially valuable for testing localized applications or creating demos tailored to different regions.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/cieslarmichal/faker-cxx/issues/898" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        add locale to plant module
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#898&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/cieslarmichal" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F44656126%3Fv%3D4" alt="cieslarmichal avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/cieslarmichal" rel="noopener noreferrer"&gt;cieslarmichal&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/cieslarmichal/faker-cxx/issues/898" rel="noopener noreferrer"&gt;&lt;time&gt;Sep 07, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;p&gt;ref book module&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/cieslarmichal/faker-cxx/issues/898" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Approach and Setup
&lt;/h2&gt;

&lt;p&gt;Setting up my environment took more time than anticipated. Since I hadn’t worked with C++ in a long-time, I decided to use Visual Studio for the setup that I had used in past rather than my usually IDE - Visual Studio Code. I forked the repo, cloned it locally, created a new branch and followed the contribution guidelines to download and setup the tools necessary for development. I attempted to use &lt;a href="https://bazel.build/" rel="noopener noreferrer"&gt;Bazel&lt;/a&gt; as the build management tool, but after a few complications, I switched to CMake with Ninja, which proved to be a more compatible setup for this project. Additionally, I had to configure &lt;code&gt;clang-format&lt;/code&gt; to ensure my code followed the project’s specific formatting standards. To make all of these processes less-complicated and run some bash scripts, I also installed WSL on my Windows 11 operating system to use Linux-kernel. This setup phase was challenging but necessary to maintain consistency with the codebase.&lt;/p&gt;

&lt;h2&gt;
  
  
  Changes Made
&lt;/h2&gt;

&lt;p&gt;Once the environment was ready, I focused on understanding the module’s structure and the intended changes. Familiarizing myself with the codebase was an essential step since I was working in a relatively unfamiliar environment. Fortunately, the codebase was well-documented, and the repository owner provided reference to a previous pull request that addressed similar functionality in a different module. This example provided helpful context and clarified how I should approach the code changes.&lt;/p&gt;

&lt;p&gt;The primary code updates involved adding &lt;code&gt;enUS&lt;/code&gt; as a default locale for the plant module, which required adding a new struct that accepted a locale parameter. This change enabled the module to generate locale-specific plant data based on user preference. I also updated the existing &lt;code&gt;plant_test&lt;/code&gt; file to incorporate locale testing, ensuring that the new feature worked as expected and was thoroughly covered by the test cases. Testing was another area where I needed to catch up on C++, and working through this allowed me to get more comfortable with C++ testing frameworks in this case &lt;a href="https://github.com/google/googletest" rel="noopener noreferrer"&gt;GoogleTest&lt;/a&gt;, which turned out to be a nice learning experience.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/cieslarmichal/faker-cxx/pull/970" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        feat: add locale to plant module
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#970&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F103447831%3Fv%3D4" alt="mayank-Pareek avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;mayank-Pareek&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/cieslarmichal/faker-cxx/pull/970" rel="noopener noreferrer"&gt;&lt;time&gt;Oct 28, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;p&gt;This PR introduces locale support in the plant module, with &lt;code&gt;enUS&lt;/code&gt; set as the default.&lt;/p&gt;
&lt;p&gt;Fixes Issue: #898&lt;/p&gt;
&lt;p&gt;Changes:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Locale Parameter for Plant Definitions
&lt;ul&gt;
&lt;li&gt;Added &lt;code&gt;getPlantDefinition()&lt;/code&gt; with locale as parameter to support locale-based plant data.&lt;/li&gt;
&lt;li&gt;Defaulted to &lt;code&gt;enUS&lt;/code&gt; as a fallback for undefined or unsupported locales:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight highlight-source-c++ js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-k"&gt;struct&lt;/span&gt; &lt;span class="pl-en"&gt;PlantDefinition&lt;/span&gt;&amp;amp; &lt;span class="pl-en"&gt;getPlantDefinition&lt;/span&gt;(Locale locale) {
   &lt;span class="pl-k"&gt;switch&lt;/span&gt; (locale) {
    &lt;span class="pl-k"&gt;default&lt;/span&gt;:
        &lt;span class="pl-k"&gt;return&lt;/span&gt; enUSPlantDefinition;
    }
}&lt;/pre&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Locale-Specific Naming in Plant Data
&lt;ul&gt;
&lt;li&gt;Updated array naming for plant data, to reflect the locale:&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight highlight-source-c++ js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-k"&gt;auto&lt;/span&gt; enUSTrees = std::to_array&amp;lt;std::string_view&amp;gt; {&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;/*&lt;/span&gt; data &lt;span class="pl-c"&gt;*/&lt;/span&gt;&lt;/span&gt;};&lt;/pre&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Test Suite Updates
&lt;ul&gt;
&lt;li&gt;Updated &lt;code&gt;plant_test&lt;/code&gt; to incorporate the new locale parameter.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;[x] Ran all unit tests after building project to ensure no breakage from the locale addition.&lt;/li&gt;
&lt;/ul&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/cieslarmichal/faker-cxx/pull/970" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;After finalizing the code changes, I ran &lt;code&gt;clang-format&lt;/code&gt; and executed all the tests to ensure the modifications met the repository’s standards. The repository owner reviewed my pull request and suggested a small adjustment to include Doxygen tags for the new locale parameter to maintain thorough documentation. I quickly incorporated these changes, ensuring that the locale parameter was fully documented. After this revision and passing all checks, my pull request was successfully merged, marking the completion of my third Hacktoberfest contribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Reflecting on this pull request, I found the experience both challenging and rewarding. Setting up a C++ development environment took longer than expected, but this step helped me understand the importance of having a robust setup, especially when working on a project in an unfamiliar language. Working with testing frameworks in C++ was also a nice experience, giving me insight into how modular code can be thoroughly tested in a language like C++. In the end, this contribution not only added locale flexibility to Faker C++ but also expanded my comfort zone, helping me gain new skills that I can bring to future C++ projects.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>My Contribution to Deno 2.0</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Tue, 29 Oct 2024 03:44:23 +0000</pubDate>
      <link>https://dev.to/mayankpareek/my-contribution-to-deno-20-48mg</link>
      <guid>https://dev.to/mayankpareek/my-contribution-to-deno-20-48mg</guid>
      <description>&lt;p&gt;Over the past couple of weeks, I came across multiple blogs and YouTube videos about the v2.0 release of &lt;a href="https://deno.com/" rel="noopener noreferrer"&gt;Deno&lt;/a&gt; - a JavaScript, TypeScript, and WebAssembly runtime built with Rust and designed to offer secure defaults for developers. Since I was searching for an issue to create my second PR in Hacktoberfest, I decided contributed to this trending repository. My pull request focused on the compatibility layer of Deno, which was enhanced with the recent release to better support &lt;code&gt;Node.js&lt;/code&gt; and &lt;code&gt;npm&lt;/code&gt;. The specific task in my PR involved replacing built-in global proxy functions with &lt;code&gt;primordials&lt;/code&gt; in the Node compatibility layer.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/denoland" rel="noopener noreferrer"&gt;
        denoland
      &lt;/a&gt; / &lt;a href="https://github.com/denoland/deno" rel="noopener noreferrer"&gt;
        deno
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A modern runtime for JavaScript and TypeScript.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Deno&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://crates.io/crates/deno" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/7b0092d372df7a4ad2f2bf2bc698019730794087b06b2eda53bccfc1940e826f/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f762f64656e6f2e737667" alt=""&gt;&lt;/a&gt;
&lt;a href="https://twitter.com/intent/follow?screen_name=deno_land" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/78f81dc880a79dd9e742414395d416ab1e959d01f5b581716edf20454d94c77e/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f64656e6f5f6c616e642e7376673f7374796c653d736f6369616c266c6162656c3d466f6c6c6f77" alt="Twitter badge"&gt;&lt;/a&gt; &lt;a href="https://discord.gg/deno" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/a453b57334ba62b7849e5506990766fcd6af1c38a45172406e52a9b2cd4d4222/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3638343839383636353134333230363038343f6c6f676f3d646973636f7264267374796c653d736f6369616c" alt="Discord badge"&gt;&lt;/a&gt;
&lt;a href="https://www.youtube.com/@deno_land" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/7a453efaddbc399ba4d1cfcacf927733a8494f9edafe0aeca2b9ab3f42d964a1/68747470733a2f2f696d672e736869656c64732e696f2f796f75747562652f6368616e6e656c2f73756273637269626572732f554371433247324d2d726734667a673165734b464c4649773f7374796c653d736f6369616c" alt="YouTube badge"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/3bd1addadda204b1103c7989b704101b8c31d0760f803c72c93f805ff502012b/68747470733a2f2f64656e6f2e6c616e642f6c6f676f2e737667"&gt;&lt;img src="https://camo.githubusercontent.com/3bd1addadda204b1103c7989b704101b8c31d0760f803c72c93f805ff502012b/68747470733a2f2f64656e6f2e6c616e642f6c6f676f2e737667" height="150px" alt="the deno mascot dinosaur standing in the rain"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.deno.com" rel="nofollow noopener noreferrer"&gt;Deno&lt;/a&gt;
(&lt;a href="http://ipa-reader.xyz/?text=%CB%88di%CB%90no%CA%8A" rel="nofollow noopener noreferrer"&gt;/ˈdiːnoʊ/&lt;/a&gt;, pronounced
&lt;code&gt;dee-no&lt;/code&gt;) is a JavaScript, TypeScript, and WebAssembly runtime with secure
defaults and a great developer experience. It's built on &lt;a href="https://v8.dev/" rel="nofollow noopener noreferrer"&gt;V8&lt;/a&gt;
&lt;a href="https://www.rust-lang.org/" rel="nofollow noopener noreferrer"&gt;Rust&lt;/a&gt;, and &lt;a href="https://tokio.rs/" rel="nofollow noopener noreferrer"&gt;Tokio&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Learn more about the Deno runtime
&lt;a href="https://docs.deno.com/runtime/manual" rel="nofollow noopener noreferrer"&gt;in the documentation&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Install the Deno runtime on your system using one of the commands below. Note
that there are a number of ways to install Deno - a comprehensive list of
installation options can be found
&lt;a href="https://docs.deno.com/runtime/manual/getting_started/installation" rel="nofollow noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Shell (Mac, Linux):&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;curl -fsSL https://deno.land/install.sh &lt;span class="pl-k"&gt;|&lt;/span&gt; sh&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;PowerShell (Windows):&lt;/p&gt;
&lt;div class="highlight highlight-source-powershell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;irm https:&lt;span class="pl-k"&gt;//&lt;/span&gt;deno.land&lt;span class="pl-k"&gt;/&lt;/span&gt;install.ps1 &lt;span class="pl-k"&gt;|&lt;/span&gt; iex&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://formulae.brew.sh/formula/deno" rel="nofollow noopener noreferrer"&gt;Homebrew&lt;/a&gt; (Mac):&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;brew install deno&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://chocolatey.org/packages/deno" rel="nofollow noopener noreferrer"&gt;Chocolatey&lt;/a&gt; (Windows):&lt;/p&gt;
&lt;div class="highlight highlight-source-powershell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;choco install deno&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://winstall.app/apps/DenoLand.Deno" rel="nofollow noopener noreferrer"&gt;WinGet&lt;/a&gt; (Windows):&lt;/p&gt;
&lt;div class="highlight highlight-source-powershell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;winget install &lt;span class="pl-k"&gt;--&lt;/span&gt;id&lt;span class="pl-k"&gt;=&lt;/span&gt;DenoLand.Deno&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Build and install from source&lt;/h3&gt;

&lt;/div&gt;
&lt;p&gt;Complete instructions for building Deno from source can be found in the manual
&lt;a href="https://docs.deno.com/runtime/manual/references/contributing/building_from_source" rel="nofollow noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Your first Deno program&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Deno can be used for many different applications, but is…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/denoland/deno" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Exploring the Project
&lt;/h2&gt;

&lt;p&gt;Given that Deno is a large and complex project with multiple languages and layers of functionality, setting up the environment was a critical first step. The setup process required installing Rust and configuring Cargo, along with other necessary dependencies for local development. Following the &lt;a href="https://docs.deno.com/runtime/contributing/" rel="noopener noreferrer"&gt;contribution guidelines&lt;/a&gt;, I reviewed both the project documentation and setup instructions. This part took some time but was essential for navigating the project’s structure and development process smoothly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working on the Issue
&lt;/h2&gt;

&lt;p&gt;The issue I tackled was part of a larger effort to increase code reliability and security in Deno’s Node compatibility layer - &lt;a href="https://github.com/denoland/deno/issues/24236" rel="noopener noreferrer"&gt;Issue #24236&lt;/a&gt;. As per the documentation, &lt;em&gt;Primordials&lt;/em&gt; are frozen intrinsic objects in Deno, used to safeguard against prototype pollution by replacing direct references to global objects with safe alternatives. In my case, I worked on updating &lt;a href="https://github.com/denoland/deno/pull/26534/files" rel="noopener noreferrer"&gt;&lt;code&gt;randomInt.ts&lt;/code&gt;&lt;/a&gt; - a file responsible for the &lt;code&gt;randomInt&lt;/code&gt; function’s implementation in the core.&lt;/p&gt;

&lt;p&gt;My task was to replace certain global methods, like &lt;code&gt;Number.isSafeInteger&lt;/code&gt;, with their primordial equivalents e.g., &lt;code&gt;NumberIsSafeInteger&lt;/code&gt;. To ensure accuracy, I first researched the correct primordials for each global method. This led me to explore both the Node and Deno documentation to confirm the use of primordials and understand their role in reducing security risks in Deno’s core.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nodejs/node/blob/main/doc/contributing/primordials.md" rel="noopener noreferrer"&gt;Primordials documentation in Node.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/nodejs/node/blob/main/typings/primordials.d.ts" rel="noopener noreferrer"&gt;List of primordials in Node.js&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Code Changes and Pull Request
&lt;/h2&gt;

&lt;p&gt;As always I created a new branch for this pull request and made the necessary changes to the &lt;code&gt;randomInt.ts&lt;/code&gt; file, while reviewing similar accepted pull requests to align with best practices. I followed Deno’s style guidelines for linting and formatting, but I was not able to run the lint script due to some issue with cargo. I decided to push the code changes after testing locally and to review the linting errors(if any) generated by the CI workflow on GitHub. I submitted my PR, following the guidelines for new pull requests and eventually got a lint error. After changing the PR to draft and resolving the error locally, I pushed the new changes which passed all the tests and it was ready for review.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/denoland/deno/pull/26534" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        fix(ext/node): use primordials in ext\node\polyfills\internal\crypto\_randomInt.ts
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#26534&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F103447831%3Fv%3D4" alt="mayank-Pareek avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;mayank-Pareek&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/denoland/deno/pull/26534" rel="noopener noreferrer"&gt;&lt;time&gt;Oct 25, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;p&gt;Towards #24236&lt;/p&gt;
&lt;p&gt;used primordials from ext:core to replace usage of built-in functions&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/denoland/deno/pull/26534" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;While waiting for review on my PR I noticed new commits were merged into main and my branch was out of sync. Out of boredom, I decided to merge the new main branch into my branch which interestingly made my PR fail most of the cases. After investigating the cause for a while I concluded it was because of the new changes still under CI/CD workflows runs. Since I had the previous branch locally I forced pushed to origin in order to revert the merge and decided to leave merging for reviewers. The PR was reviewed and accepted after several hours and this time it did not fail any tests during merge.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;This PR allowed me to explore Rust alongside JavaScript in a large, open-source project being used by numerous users. Though it involved minimal code changes, contributing to a project as substantial as Deno was a valuable experience, helping me understand how small adjustments can enhance overall system stability and security.&lt;/p&gt;

</description>
      <category>osd600</category>
      <category>seneca</category>
    </item>
    <item>
      <title>My First Hacktoberfest Pull Request</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Wed, 23 Oct 2024 17:15:20 +0000</pubDate>
      <link>https://dev.to/mayankpareek/my-first-hacktoberfest-pull-request-3m2</link>
      <guid>https://dev.to/mayankpareek/my-first-hacktoberfest-pull-request-3m2</guid>
      <description>&lt;h2&gt;
  
  
  Finding the Right Repository
&lt;/h2&gt;

&lt;p&gt;The first couple of weeks of Hacktoberfest were challenging as I spent a significant amount of time searching for the right repository to contribute to. The competition for beginner-friendly issues was fierce, and many repositories existed solely to allow people to make low-effort pull requests (PRs), which wasn’t the kind of contribution I wanted to make. Eventually, I found a suitable repo: &lt;code&gt;tldr&lt;/code&gt; by &lt;code&gt;tldr-pages&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/tldr-pages" rel="noopener noreferrer"&gt;
        tldr-pages
      &lt;/a&gt; / &lt;a href="https://github.com/tldr-pages/tldr" rel="noopener noreferrer"&gt;
        tldr
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      📚 Collaborative cheatsheets for console commands
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div&gt;
  &lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;&lt;a href="https://tldr.sh/" rel="nofollow noopener noreferrer"&gt;&lt;img alt="tldr-pages" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Ftldr-pages%2Ftldrimages%2Fbanner.png" width="600/"&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://github.com/tldr-pages/tldr/actions" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/2f1d8335a3d7506ae6cb299da4a52b72f1779b5f6344f84cd307705f37bfe710/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746c64722d70616765732f746c64722f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d4275696c64" alt="Build status"&gt;&lt;/a&gt;
&lt;a href="https://matrix.to/#/#tldr-pages:matrix.org" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/6d8deb6ce2a493626e9eafb6fae9bfb76a75bb66b189de9e8d1e0359469437b5/68747470733a2f2f696d672e736869656c64732e696f2f6d61747269782f746c64722d70616765733a6d61747269782e6f72673f6c6162656c3d436861742b6f6e2b4d6174726978" alt="Matrix chat"&gt;&lt;/a&gt;
&lt;a href="https://github.com/tldr-pages/tldr/pulls?q=is:pr+is:merged" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/b1a658c1fcbc32907208bcf5fa4f70cd4a86d887abcca8751be86cc3ef90dbf7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d70722d636c6f7365642d7261772f746c64722d70616765732f746c64722e7376673f6c6162656c3d4d65726765642b50527326636f6c6f723d677265656e" alt="Merged PRs"&gt;&lt;/a&gt;
&lt;a href="https://github.com/tldr-pages/tldr/graphs/contributors" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/67669966af8f70c8b3f6a5f0a4f6a8750ba862bfd74deb42023d3c036b5564a6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732d616e6f6e2f746c64722d70616765732f746c64722e7376673f6c6162656c3d436f6e7472696275746f7273" alt="GitHub contributors"&gt;&lt;/a&gt;
&lt;a href="https://github.com/tldr-pages/tldr/blob/main/LICENSE.md" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/525ec6fd1ca589cd76072414b7278c6b55ef1941dda77892137c29b816fae413/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d43435f42595f342e302d626c75652e7376673f6c6162656c3d4c6963656e7365" alt="license"&gt;&lt;/a&gt;
&lt;a href="https://fosstodon.org/@tldr_pages" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/0599ca6511b79cf7e722393f2f2f5d75708779817a2d256c73ad1c34c2c569e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6173746f646f6e2d3633363446463f6c6f676f3d6d6173746f646f6e266c6f676f436f6c6f723d666666" alt="Mastodon"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What is tldr-pages?&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;strong&gt;tldr-pages&lt;/strong&gt; project is a collection of community-maintained help pages
for command-line tools, that aims to be a simpler, more approachable complement
to traditional &lt;a href="https://en.wikipedia.org/wiki/Man_page" rel="nofollow noopener noreferrer"&gt;man pages&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Maybe you're new to the command-line world? Perhaps you're just a little rusty or can't always recall the arguments for commands like &lt;code&gt;lsof&lt;/code&gt;, or &lt;code&gt;tar&lt;/code&gt;?&lt;/p&gt;
&lt;p&gt;It certainly doesn't help that, in the past, the first option explained in &lt;code&gt;man tar&lt;/code&gt; was:&lt;/p&gt;
&lt;div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ &lt;span class="pl-s1"&gt;man tar&lt;/span&gt;
&lt;span class="pl-c1"&gt;...&lt;/span&gt;
&lt;span class="pl-c1"&gt;-b blocksize&lt;/span&gt;
&lt;span class="pl-c1"&gt;   Specify the block size, in 512-byte records, for tape drive I/O.&lt;/span&gt;
&lt;span class="pl-c1"&gt;   As a rule, this argument is only needed when reading from or writing to tape drives,&lt;/span&gt;
&lt;span class="pl-c1"&gt;   and usually not even then as the default block size of 20 records (10240 bytes) is very common.&lt;/span&gt;
&lt;span class="pl-c1"&gt;...&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;There seems to be room for simpler help pages, focused on practical examples.
How about:&lt;/p&gt;

    
    
    &lt;img alt="Screenshot of the tldr client displaying the tar command." src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Ftldr-pages%2Ftldr%2Fraw%2Fmain%2Fimages%2Ftldr-dark.png"&gt;

&lt;p&gt;This repository is just that: an ever-growing collection of examples…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tldr-pages/tldr" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;The &lt;code&gt;tldr-pages&lt;/code&gt; project is a community-maintained collection of simplified help pages for command-line tools. It serves as a more approachable alternative to traditional &lt;a href="https://en.wikipedia.org/wiki/Man_page" rel="noopener noreferrer"&gt;man pages&lt;/a&gt;, making it easier for users to find and understand examples for common commands. Given its active maintenance and practical relevance, it seemed like a great project to contribute to.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Issue: Adding &lt;code&gt;npm-doctor&lt;/code&gt; Command
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;tldr&lt;/code&gt; repository had an open issue to document various &lt;code&gt;npm&lt;/code&gt; commands, and I decided to contribute by working on the &lt;code&gt;npm doctor&lt;/code&gt; command. This command checks the health of the &lt;code&gt;npm&lt;/code&gt; environment, which is particularly useful for developers troubleshooting their setup.&lt;/p&gt;


&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/tldr-pages/tldr/issues/14000" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        Let's document: npm
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#14000&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/bharateshwq" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F64769271%3Fv%3D4" alt="bharateshwq avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/bharateshwq" rel="noopener noreferrer"&gt;bharateshwq&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/tldr-pages/tldr/issues/14000" rel="noopener noreferrer"&gt;&lt;time&gt;Oct 05, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Command description&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;This is widely used in development and most of its options are misused or never really used this would be a great contendor&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Documentation&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://docs.npmjs.com/cli/commands" rel="nofollow noopener noreferrer"&gt;https://docs.npmjs.com/cli/commands&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Platform&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;Linux&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;VCS repository link (e.g. GitHub, GitLab)&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://github.com/npm/cli" rel="noopener noreferrer"&gt;https://github.com/npm/cli&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Additional information&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="https://docs.npmjs.com/cli/xxx" rel="nofollow noopener noreferrer"&gt;https://docs.npmjs.com/cli/xxx&lt;/a&gt;
&lt;a href="https://docs.npmjs.com/cli/v10/commands" rel="nofollow noopener noreferrer"&gt;https://docs.npmjs.com/cli/v10/commands&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Commands&lt;/h3&gt;
&lt;span class="octicon octicon-link"&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;[x] &lt;code&gt;npm&lt;/code&gt; 0a4c0f0a3705dae2a8c6d4f9f93d14f57ac6ba7b&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm access&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm adduser&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm audit&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm bugs&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm cache&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm ci&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm completion&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm config&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm dedupe&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm deprecate&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm diff&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm dist-tag&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm docs&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm doctor&lt;/code&gt; #14262&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm edit&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm exec&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm explain&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm explore&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm find-dupes&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm fund&lt;/code&gt; #8495&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm help&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm help-search&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm hook&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm init&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm install&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm install-ci-test&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm install-test&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm link&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm login&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm logout&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm ls&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm org&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm outdated&lt;/code&gt; #14088&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm owner&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm pack&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm ping&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm pkg&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm prefix&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm profile&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm prune&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm publish&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm query&lt;/code&gt; #8445&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm rebuild&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm repo&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm restart&lt;/code&gt; #14035&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm root&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm run&lt;/code&gt; #14035 (alias of &lt;code&gt;npm run-script&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm run-script&lt;/code&gt; #14050&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm sbom&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm search&lt;/code&gt; #14302&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm shrinkwrap&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm star&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm stars&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm start&lt;/code&gt; #14035&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm stop&lt;/code&gt; #14035&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm team&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm test&lt;/code&gt; #14035&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm token&lt;/code&gt; #14250&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm uninstall&lt;/code&gt; #14201&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm unpublish&lt;/code&gt; #14187&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm unstar&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm update&lt;/code&gt; #14242&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm version&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[x] &lt;code&gt;npm view&lt;/code&gt; #14269&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npm whoami&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;code&gt;npx&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tldr-pages/tldr/issues/14000" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;First, I installed the &lt;code&gt;tldr&lt;/code&gt; package on my local machine to get a feel for how it works and to understand the format of the pages. The short explanation and examples it provided were clear and helpful, which encouraged me to contribute to the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Preparing the Fix
&lt;/h2&gt;

&lt;p&gt;Before jumping into the code, I followed the recommended steps for contributing to the repository. I checked the &lt;a href="https://github.com/tldr-pages/tldr/blob/main/CONTRIBUTING.md" rel="noopener noreferrer"&gt;contribution guidelines&lt;/a&gt; and reviewed previous pull requests to understand how to format my submission according to the project's standards.&lt;/p&gt;

&lt;p&gt;Next, I visited the official &lt;a href="https://docs.npmjs.com/cli/commands/npm-doctor" rel="noopener noreferrer"&gt;npm documentation&lt;/a&gt; to learn about the &lt;code&gt;npm doctor&lt;/code&gt; command in detail. After gathering enough information, I forked and cloned the repository locally, then navigated to the common folder; created a new branch for the change, where I added a new markdown file named &lt;code&gt;npm-doctor.md&lt;/code&gt; as per the naming convention for sub-commands.&lt;/p&gt;

&lt;p&gt;Here’s what I added to the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# npm doctor&lt;/span&gt;
&lt;span class="gt"&gt;
&amp;gt; Check the health of the npm environment.&lt;/span&gt;
&lt;span class="gt"&gt;&amp;gt; More information: &amp;lt;https://docs.npmjs.com/cli/commands/npm-doctor&amp;gt;.&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Run all default health checks for npm:
&lt;span class="sb"&gt;`npm doctor`&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Check the connection to the npm registry:
&lt;span class="sb"&gt;`npm doctor connection`&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Check the versions of Node.js and npm in use:
&lt;span class="sb"&gt;`npm doctor versions`&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Check for permissions issues with npm directories and cache:
&lt;span class="sb"&gt;`npm doctor permissions`&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; Validate the cached package files and checksums:
&lt;span class="sb"&gt;`npm doctor cache`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I made sure the examples were simple, concise, and followed the format used in other tldr-pages. After testing and running required checks on the file locally to ensure everything worked as expected, I was ready to create my PR.&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating the Pull Request
&lt;/h2&gt;

&lt;p&gt;When creating my PR, I followed the template provided by the repository, which ensured I covered all necessary details. The maintainers were quick to review my submission and requested a few small changes. After addressing their feedback, the PR was merged successfully.&lt;/p&gt;


&lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/tldr-pages/tldr/pull/14262" rel="noopener noreferrer"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg"&gt;
      &lt;span class="issue-title"&gt;
        npm-doctor: add page
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#14262&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;
        &lt;img class="github-liquid-tag-img" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F103447831%3Fv%3D4" alt="mayank-Pareek avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;mayank-Pareek&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/tldr-pages/tldr/pull/14262" rel="noopener noreferrer"&gt;&lt;time&gt;Oct 18, 2024&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      
&lt;ul&gt;
&lt;li&gt;[x] The page(s) are in the correct platform directories: &lt;code&gt;common&lt;/code&gt;, &lt;code&gt;linux&lt;/code&gt;, &lt;code&gt;osx&lt;/code&gt;, &lt;code&gt;windows&lt;/code&gt;, &lt;code&gt;sunos&lt;/code&gt;, &lt;code&gt;android&lt;/code&gt;, etc.&lt;/li&gt;
&lt;li&gt;[x] The page(s) have at most 8 examples.&lt;/li&gt;
&lt;li&gt;[x] The page description(s) have links to documentation or a homepage.&lt;/li&gt;
&lt;li&gt;[x] The page(s) follow the &lt;a href="/tldr-pages/tldr/blob/main/CONTRIBUTING.md#guidelines"&gt;content guidelines&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;[x] The page(s) follow the &lt;a href="/tldr-pages/tldr/blob/main/contributing-guides/style-guide.md"&gt;style guide&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;[x] The PR title conforms to the recommended &lt;a href="/tldr-pages/tldr/blob/main/CONTRIBUTING.md#commit-message-and-pr-title"&gt;templates&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Version of the command being documented (if known):&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tldr-pages/tldr/pull/14262" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;h3&gt;
  
  
  Challenges &amp;amp; Learning
&lt;/h3&gt;

&lt;p&gt;While this PR was relatively straightforward, mostly consisting of markdown edits, it was a great introduction to contributing to large open-source projects. The main challenge I faced was familiarizing myself with the contribution process of the project. Reading through the repository's contribution guidelines and studying previous PRs helped me understand how to format my submission correctly.&lt;/p&gt;

&lt;p&gt;I learned that it’s essential to have a good high-level understanding of the project before starting work and reading other PRs is a good way to learn the methods of contribution. I believe that while my PR was small, it was a good starting point and it gave me insight into how to contribute to large open source projects.&lt;/p&gt;

&lt;p&gt;Now that I’ve successfully completed my first PR, I plan to gradually increase the complexity of my contributions. My next goal is to find a slightly more challenging issue, possibly involving code or a bug fix. I’ll continue to document my progress in future blog posts.&lt;/p&gt;

</description>
      <category>osd600</category>
      <category>seneca</category>
    </item>
    <item>
      <title>Learning Git Rebase</title>
      <dc:creator>Mayank Kumar</dc:creator>
      <pubDate>Fri, 11 Oct 2024 22:46:01 +0000</pubDate>
      <link>https://dev.to/mayankpareek/learning-git-rebase-d41</link>
      <guid>https://dev.to/mayankpareek/learning-git-rebase-d41</guid>
      <description>&lt;p&gt;This week, I worked on refactoring my project, &lt;code&gt;dev-mate-cli&lt;/code&gt;. As with any refactor, my primary goal was to improve the codebase by making it cleaner and more modular. However, the process didn’t stop there - I also took this opportunity to practice using Git’s interactive rebase feature to tidy up my commit history.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/mayank-Pareek" rel="noopener noreferrer"&gt;
        mayank-Pareek
      &lt;/a&gt; / &lt;a href="https://github.com/mayank-Pareek/dev-mate-cli" rel="noopener noreferrer"&gt;
        dev-mate-cli
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A command line tool to quickly document your code
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;dev-mate-cli&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;A command-line tool that leverages OpenAI's Chat Completion API to document code with the assistance of AI models.&lt;/p&gt;
&lt;p&gt;Watch this &lt;a href="https://youtu.be/YJDD6YBaEFk" rel="nofollow noopener noreferrer"&gt;Demo video&lt;/a&gt; to view features.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Source Code Documentation&lt;/strong&gt;: Automatically generate comments and documentation for your source code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiple File Processing&lt;/strong&gt;: Handle one or multiple files in a single command.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model Selection&lt;/strong&gt;: Choose which AI model to use with the &lt;code&gt;--model&lt;/code&gt; flag.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Output&lt;/strong&gt;: Output the results to a file with the &lt;code&gt;--output&lt;/code&gt; flag, or display them in the console.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stream Output&lt;/strong&gt;: Stream the LLM response to command line with &lt;code&gt;--stream&lt;/code&gt; flag.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Clone the repository:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;git clone https://github.com/mayank-Pareek/dev-mate-cli.git
&lt;span class="pl-c1"&gt;cd&lt;/span&gt; dev-mate-cli&lt;/pre&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install dependencies:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;npm install&lt;/pre&gt;

&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Set up environment variables:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Create a &lt;code&gt;.env&lt;/code&gt; file in the project’s root directory by making a copy of &lt;code&gt;.env.example&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;cp .env.example .env&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Replace &lt;code&gt;API_KEY&lt;/code&gt; and &lt;code&gt;BASE_URL&lt;/code&gt; values with an API Key and URL generated from a Open AI's…&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/mayank-Pareek/dev-mate-cli" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Refactoring Goals
&lt;/h2&gt;

&lt;p&gt;Before diving into Git, I wanted to focus on improving several aspects of my code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modularity: Breaking down large functions into smaller, reusable components.&lt;/li&gt;
&lt;li&gt;Error Handling: Improving how the application handled different input paths.&lt;/li&gt;
&lt;li&gt;AI Response: Refactoring how the program interacted with OpenAI's API, ensuring better separation of concerns.&lt;/li&gt;
&lt;li&gt;Performance: Making the file handling code more efficient by introducing recursion for processing directories.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-by-Step Refactor
&lt;/h2&gt;

&lt;p&gt;Here’s a breakdown of the steps that I took to refactor &lt;code&gt;dev-mate-cli&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Move File Processing to fileHandler&lt;br&gt;
My first task was to clean up the code responsible for file processing. Previously, this logic was mixed with the part of the code that handled the setup of cli program in &lt;code&gt;program.ts&lt;/code&gt;. To improve modularity, I moved the file processing into a dedicated fileHandler module. This separated the concerns, making the code easier to maintain and test.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make File Path Processing Recursive&lt;br&gt;
Since I was already working on the file processing, I saw an opportunity to add more robustness. The function initially handled file paths but didn’t traverse directories deeply. I enhanced it by adding recursive logic to handle directories, ensuring the program processes every file within subdirectories as well.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Split AI Response Logic into Separate Functions&lt;br&gt;
One function was doing too much—handling the AI request and response in one go. To simplify this, I broke it down into two functions: one for generating the response and another for handling what happens afterward. This separation of concerns not only made the code cleaner but also easier to extend in the future.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fix Token Usage Output When Streaming Response&lt;br&gt;
While streaming AI responses to the command line, I discovered that the token usage report wasn’t working as expected. This was due to incorrect handling of response chunks when streaming. I fixed the logic so that token usage would now be correctly displayed, even when data is streamed to the command line.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add Interface and Fallback for Program Options&lt;br&gt;
To ensure that the program handled missing options gracefully, I added fallback values for the model and temperature. I also created an interface to define the options type, improving type safety and making the code more predictable.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Git Rebase: Interactive Squashing
&lt;/h2&gt;

&lt;p&gt;Once all the changes were made, I turned my attention to the commit history. I had made 5 separate commits, each representing a logical change. To keep the Git history clean, I decided to squash these commits into one using Git’s interactive rebase feature. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ran &lt;code&gt;git rebase main -i&lt;/code&gt; to start an interactive rebase with main branch.&lt;/li&gt;
&lt;li&gt;Squashed the 5 commits into one.&lt;/li&gt;
&lt;li&gt;Amended the commit message to summarize all the changes in a clear and concise manner using &lt;code&gt;git commit --amend&lt;/code&gt; command.&lt;/li&gt;
&lt;li&gt;Merged the topic branch into main branch using fast-forward merge.&lt;/li&gt;
&lt;li&gt;Pushed the new commit to origin using &lt;code&gt;git push origin main&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The interactive rebase was smooth, and I found it to be an invaluable tool for maintaining a clean project history. I also learned how important it is to commit often but keep the history readable for maintainers and collaborators.&lt;/p&gt;

&lt;p&gt;The final commit can be checked here - &lt;a href="https://github.com/mayank-Pareek/dev-mate-cli/commit/16fe682e17cd0983d793298adfee504b16d71537" rel="noopener noreferrer"&gt;https://github.com/mayank-Pareek/dev-mate-cli/commit/16fe682e17cd0983d793298adfee504b16d71537&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
