Introduction
- Welcome to the World of NPM Packages!
- Why This Course Will Help You
- What You Will Build
- Use the Right Tools
- What You Should Know First
- Got Questions?
- Let’s Get Started!
Project Configuration
- 1. Set Up Your System
- 2. Create a Project Directory
- 3. Create a package.json File
- 4. Initialize a Git Repository
- 5. Specify the Files Git Should Ignore
- 6. Stage and Commit Your Project’s Changes to Git
- 7. Configure a GitHub Remote Repository
- 8. Push Your Local Git Directory to the Remote Repo
- 9. Install React as a dev-dependency
- Why Install React as a Package’s Dev-Dependency?
- Exercise 1
- Quiz 1
Testing React Component
- 1. Install the Testing Tools
- 2. Specify Jest as Your Project’s Test Runner Tool
- 3. Install the Code Compiler
- 4. Configure Babel to Compile Your Code
- 5. Configure Jest’s Testing Environment
- 6. Create Your Code Files
- 7. Write Your Test Case
- 8. Develop Your React Component
- 9. Run the Test
- Exercise 2
- Quiz 2
Commit Message Configuration
- Conventional Commits Messages Syntax
- Enforcing the Conventional Commits Format
- Setting up Husky
- Creating a Hook to Auto-Lint Commit Messages
- Exercise 3
- Quiz 3
Setting Up GitHub Action
- 1. Create a GitHub Action Workflow File
- 2. Define the GitHub Action Workflow
- 3. Test the GitHub Action Workflow
- Exercise 4
- Quiz 4
Styling React Components
- 1. Create the Stylesheet
- 2. Apply CSS Styles to Your Component
- 3. Loading CSS Files to Jest’s JSDOM
- 4. Run the Test
- Exercise 5
- Quiz 5
Compiling React to JavaScript
- Exercise 6
- Quiz 6
Distinguishing Source and Distribution Code
- Exercise 7
- Quiz 7
Defining Package’s Entry Point
- Quiz 8
Local Testing of Unpublished Package
- 1. Link-Install Your Package Globally in Your System
- 2. Create a NextJS Demo Website for Testing Your Package
- 3. Install Your Package from Your System’s Global Folder to the Test-App
- 4. Use the Link-Installed Package in the Test-App
- 5. Unlink Your Package from the Test-App
- 6. Unlink Your Package from the Global Folder
- Exercise 8
- Quiz 9
Creating README
- Exercise 9
- Quiz 10
Creating LICENSE
- Exercise 10
- Quiz 11
Publishing Package to NPM
- 1. Search Engine Optimization (SEO)
- 2. Specify the Files You Want to Publish to NPM
- 3. Confirm the Files NPM Will Publish
- 4. Confirm That You Have Passing Tests
- 5. Compile Any Pending Code
- 6. Stage and Commit Any Recent Changes
- 7. Push Your Local Git Directory to the Remote Repo
- 8. Sign In or Sign Up on the NPM Website
- 9. Log In to NPM via the Terminal
- 10. Confirm If Your Package’s Name Is Available
- 11. Publish Your Package!
- Exercise 11
- Quiz 12
Local Testing of the Published Package
- 1. Install the Package
- 2. Import the Package
- 3. Run Your Local Server
- Exercise 12
- Quiz 13
Production Testing of the Published Package
- 1. Stage and Commit Your Changes
- 2. Set Up a GitHub Remote Repository for Your NextJS Test-App
- 3. Push Your Local Git Directory to the Remote Repo
- 4. Sign In or Sign Up on the Vercel Website
- 5. Deploy Your Project to Vercel’s Server
- 6. Test the Package on the Live Demo Website
- Quiz 14
Updating Package’s Versions
- Example 1: Updating to a Patch Version
- Example 2: Updating to a Minor Version
- Example 3: Updating to a Major Version
- Exercise 13
- Quiz 15
Automating Version Management
- How to Release Your Package’s Latest Version
- How to Overwrite Release-It’s Default Configurations
- How Release-It Determines Your Package’s Latest Version
- How to Provide Release-It with a Recommended Version
- Exercise 14
- Quiz 16
Automating Changelog Management
- Quiz 17
Automating GitHub Releases
- 1. Get a GitHub Personal Access Token
- 2. Copy the Generated Token
- 3. Create a GitHub Environment Variable
- 4. Tell Release-It Your GitHub Token’s Name
- 5. Make the GitHub Secret Available Locally in Your Project
- 6. Prevent Git from Monitoring the Environment File
- 7. Install the Plugin for Loading the .env File
- 8. Load the .env File While Releasing Your Project’s Latest Version
- 9. Stage and Commit Your Changes
- Exercise 15
- Quiz 18
Epilogue
- What’s Next?
- One Last Favor
