Skip to content

Workshop by WebDevCaptain on building Open source npm packages.

License

Notifications You must be signed in to change notification settings

WebDevCaptain/oss-npm-package-workshop

 
 

Repository files navigation

Workshop for developing Open Source NPM packages.

Getting Started

  • This workshop is designed to be a hands-on experience for developers who want to learn how to develop and publish Open Source NPM packages.

  • The workshop is divided into multiple sections, each section will cover a specific topic.


Sections

1. Code and Test:

Focuses on writing a simple add function and testing it using Vitest. Also, we will learn how to use the collaborative development tool, Git and GitHub. We talk about a Github Repository, Branches, and Merging. Along the way, we also discuss the importance of writing good commit messages. Issues and Pull Requests are also discussed.

2. Git Hooks:

This section is focussed on Git Hooks using Husky. We will learn how to use Husky to run tests before committing code. Husky makes it easy to use Git Hooks in your project.

3. CI:

This section is focussed on Continuous Integration using GitHub Actions. We will learn how to use GitHub Actions to run tests on every push to the repository and also on every Pull Request.

4. Linter and Formatter:

This section is focussed on using ESLint and Prettier. We will learn how to use ESLint to enforce code quality and Prettier to format the code. We also learn how to use Husky to run ESLint and Prettier on every commit. We also discuss about lint-staged and how it can be used to run ESLint and Prettier on staged files.

5. Commit Messages:

This section is focussed on writing good commit messages. We will learn how to use Conventional Commits to write commit messages. We will also learn how to use Commitlint to enforce Conventional Commits. Finally we run commitlint in CI.

6. Bundler:

This section is focussed on using Rollup as a bundler. We will learn how to use Rollup to bundle our code. We will also learn how to use Terser to minify the code. Finally we hook Rollup and Terser to our CI.

7. Documentation:

This section is focussed on writing documentation for our package. We already wrote some code documentation (using JSdoc) in the previous sections. In this section, we will learn how to write a README.md file for our package. We will also learn how to use GitHub Pages to host our documentation. We also discuss about templates for Pull Requests and Issues. Finally we end this section with a brief discussion on CHANGELOG.md and licensing our code.


Prerequisites

  • Node.js
  • NPM

About

Workshop by WebDevCaptain on building Open source npm packages.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%