Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Mayank Kumar
Mayank Kumar

Posted on

My First Hacktoberfest Pull Request

Finding the Right Repository

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:tldr bytldr-pages.

GitHub logo tldr-pages / tldr

📚 Collaborative cheatsheets for console commands

tldr-pages

Build statusMatrix chatMerged PRsGitHub contributorslicenseMastodon

What is tldr-pages?

Thetldr-pages project is a collection of community-maintained help pagesfor command-line tools, that aims to be a simpler, more approachable complementto traditionalman pages.

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 likelsof, ortar?

It certainly doesn't help that, in the past, the first option explained inman tar was:

$man tar...-b blocksize   Specify the block size, in 512-byte records, for tape drive I/O.   As a rule, this argument is only needed when reading from or writing to tape drives,   and usually not even then as the default block size of 20 records (10240 bytes) is very common....
Enter fullscreen modeExit fullscreen mode

There seems to be room for simpler help pages, focused on practical examples.How about:

Screenshot of the tldr client displaying the tar command.

This repository is just that: an ever-growing collection of examples…

Thetldr-pages project is a community-maintained collection of simplified help pages for command-line tools. It serves as a more approachable alternative to traditionalman pages, 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.

The Issue: Addingnpm-doctor Command

Thetldr repository had an open issue to document variousnpm commands, and I decided to contribute by working on thenpm doctor command. This command checks the health of thenpm environment, which is particularly useful for developers troubleshooting their setup.

GitHub logo Let's document: npm#14000

Command description

This is widely used in development and most of its options are misused or never really used this would be a great contendor

Documentation

https://docs.npmjs.com/cli/commands

Platform

Linux

VCS repository link (e.g. GitHub, GitLab)

https://github.com/npm/cli

Additional information

https://docs.npmjs.com/cli/xxxhttps://docs.npmjs.com/cli/v10/commands

Commands

  • [x]npm 0a4c0f0a3705dae2a8c6d4f9f93d14f57ac6ba7b
  • [ ]npm access
  • [ ]npm adduser
  • [ ]npm audit
  • [ ]npm bugs
  • [ ]npm cache
  • [ ]npm ci
  • [ ]npm completion
  • [ ]npm config
  • [ ]npm dedupe
  • [ ]npm deprecate
  • [ ]npm diff
  • [ ]npm dist-tag
  • [ ]npm docs
  • [x]npm doctor #14262
  • [ ]npm edit
  • [ ]npm exec
  • [ ]npm explain
  • [ ]npm explore
  • [ ]npm find-dupes
  • [x]npm fund #8495
  • [ ]npm help
  • [ ]npm help-search
  • [ ]npm hook
  • [ ]npm init
  • [ ]npm install
  • [ ]npm install-ci-test
  • [ ]npm install-test
  • [ ]npm link
  • [ ]npm login
  • [ ]npm logout
  • [ ]npm ls
  • [ ]npm org
  • [x]npm outdated #14088
  • [ ]npm owner
  • [ ]npm pack
  • [ ]npm ping
  • [ ]npm pkg
  • [ ]npm prefix
  • [ ]npm profile
  • [ ]npm prune
  • [ ]npm publish
  • [x]npm query #8445
  • [ ]npm rebuild
  • [ ]npm repo
  • [x]npm restart #14035
  • [ ]npm root
  • [x]npm run #14035 (alias ofnpm run-script)
  • [x]npm run-script #14050
  • [ ]npm sbom
  • [x]npm search #14302
  • [ ]npm shrinkwrap
  • [ ]npm star
  • [ ]npm stars
  • [x]npm start #14035
  • [x]npm stop #14035
  • [ ]npm team
  • [x]npm test #14035
  • [x]npm token #14250
  • [x]npm uninstall #14201
  • [x]npm unpublish #14187
  • [ ]npm unstar
  • [x]npm update #14242
  • [ ]npm version
  • [x]npm view #14269
  • [ ]npm whoami
  • [ ]npx

First, I installed thetldr 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.

Preparing the Fix

Before jumping into the code, I followed the recommended steps for contributing to the repository. I checked thecontribution guidelines and reviewed previous pull requests to understand how to format my submission according to the project's standards.

Next, I visited the officialnpm documentation to learn about thenpm doctor 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 namednpm-doctor.md as per the naming convention for sub-commands.

Here’s what I added to the file:

# npm doctor> Check the health of the npm environment.> More information: <https://docs.npmjs.com/cli/commands/npm-doctor>.- Run all default health checks for npm:`npm doctor`- Check the connection to the npm registry:`npm doctor connection`- Check the versions of Node.js and npm in use:`npm doctor versions`- Check for permissions issues with npm directories and cache:`npm doctor permissions`- Validate the cached package files and checksums:`npm doctor cache`
Enter fullscreen modeExit fullscreen mode

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.

Creating the Pull Request

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.

GitHub logo npm-doctor: add page#14262

  • [x] The page(s) are in the correct platform directories:common,linux,osx,windows,sunos,android, etc.
  • [x] The page(s) have at most 8 examples.
  • [x] The page description(s) have links to documentation or a homepage.
  • [x] The page(s) follow thecontent guidelines.
  • [x] The page(s) follow thestyle guide.
  • [x] The PR title conforms to the recommendedtemplates.
  • Version of the command being documented (if known):

Challenges & Learning

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.

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.

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.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Computer Programming Student at Seneca College, Toronto
  • Joined

More fromMayank Kumar

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp