npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ci-cd-react

v0.1.3

Published

A simple React application that allows users to register by filling out a form with their personal details. The application validates the information before storing it in the `localStorage`, and displays a list of registered users. The app also includes t

Downloads

267

Readme

React User Registration App

A simple React application that allows users to register by filling out a form with their personal details. The application validates the information before storing it in the localStorage, and displays a list of registered users. The app also includes test coverage and uses GitHub Actions for CI/CD.


Summary


Prerequisites

Before you can run this project, make sure you have the following installed:

  • Node.js (version 14.x or above)
  • npm (Node Package Manager)

You can check if these are installed by running:

node -v
npm -v

Getting Started

  1. Clone the Repository

Clone the project to your local machine:

git clone https://github.com/yourusername/react-user-registration.git
cd react-user-registration
  1. Install Dependencies

Run the following command to install the required dependencies:

npm install

Available Scripts

In the project directory, you can run:

npm run start

Runs the app in development mode. Open http://localhost:3000 to view it in your browser.

The page will reload when you make changes. You may also see any lint errors in the console.

npm run test

Launches the test runner in the interactive watch mode. You can write tests to verify your application’s functionality using Jest.

npm run build

Builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes. Your app is ready to be deployed!


Running Tests

  1. Run Unit and Integration Tests

To run the unit and integration tests, run:

npm test

This will start Jest in watch mode, running all the tests defined in your project.

  1. Check Test Coverage

Codecov integration is set up to track test coverage. After running the tests, the coverage report will be uploaded automatically to Codecov. You can view the coverage details on the Codecov website.


Generate API Documentation

To generate API documentation for the project using JSDoc, run the following command:

npm run jsdoc

This will create a docs folder containing the generated documentation based on the comments in your code.


GitHub Actions CI/CD

This project is configured with GitHub Actions for continuous integration and deployment (CI/CD). The following steps are automated:

Build and Test: Tests are automatically run, and code coverage is reported to Codecov.
Deployment: The app is automatically deployed to GitHub Pages when code is pushed to the master branch.

Deployment

The app is deployed to GitHub Pages using GitHub Actions. To deploy, simply push to the master branch, and the app will be built and deployed automatically.


NPM Package Build and Publish

This project includes automation for building, versioning, and publishing the NPM package to the NPM registry. Below are the key steps involved:

Configure Git: Git user settings are configured to automatically commit with the correct user information:

git config --global user.email "[email protected]" git config --global user.name "Loise Fenoll"

Build the NPM Package: The NPM package is built using the following command, which compiles the necessary files for publishing:

npm run build-npm

Versioning: The version of the package is bumped (using the patch version increment):

npm version patch

Publish: After building and versioning, the package is automatically published to the NPM registry:

npm publish

NPM Authentication Token: An authentication token stored in GitHub secrets (NPM_TOKEN) is used for secure publishing.


Technologies Used

React: JavaScript library for building the user interface.
Material-UI: React components that implement Google's Material Design.
Jest: Testing framework for React.
Codecov: Code coverage tool integrated with the GitHub repository.
JSDoc: Tool for generating API documentation from comments in the code.
GitHub Actions: CI/CD pipeline for automatic testing, building, and deployment.
npm: Package manager used to install dependencies and automate build tasks.

Explanation of Sections:

  • Prerequisites: List of tools required to run the project (Node.js and npm).
  • Getting Started: Instructions to clone the project and install dependencies.
  • Available Scripts: Basic commands to run the application (npm run start), launch tests (npm run test), and create a production build (npm run build).
  • Running Tests: Instructions for running unit tests and checking code coverage reports via Codecov.
  • Generate API Documentation: Instructions for generating API documentation using JSDoc.
  • GitHub Actions CI/CD: Explanation of the CI/CD process configured with GitHub Actions to automate the build, tests, and deployment to GitHub Pages.
  • Deployment: Process of automatic deployment via GitHub Actions to GitHub Pages.
  • Technologies Used: List of the main technologies used in the project.
  • NPM Package Build and Publish: Steps for automating the NPM package build, versioning, and publishing process.

This README.md file contains all the necessary information to get started, test, and deploy your project with detailed instructions.