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 🙏

© 2026 – Pkg Stats / Ryan Hefner

test-tp1-ynov-react-kleas17

v7.0.0

Published

React application package prepared for automated npm publishing.

Readme

Application d'inscription SPA

Fonctionnalités

  • Navigation SPA avec react-router-dom
    • / : accueil, compteur des inscrits, liste des inscrits (Nom + Prénom)
    • /register : formulaire d'inscription
  • État partagé au niveau racine (tableau des utilisateurs)
  • Données chargées/sauvegardées via API (/users) avec axios
  • Résilience UI face aux erreurs backend :
    • 400 : affichage du message métier renvoyé par le serveur
    • 500 : affichage d'une alerte utilisateur sans crash de l'application

Architecture API

  • Fichier dédié : src/api.js
  • API par défaut : https://jsonplaceholder.typicode.com
  • Variables d'environnement prises en charge :
    • REACT_APP_API_URL
    • REACT_APP_SERVER_PORT
    • REACT_APP_API_TOKEN (header Authorization: Bearer ...)

Pyramide de tests

  • UT : logique pure dans src/validator.js
  • IT : interactions UI + rendu + navigation dans src/App.test.js
  • IT API : appels réseau mockés dans src/api.test.js avec jest.mock('axios')
  • E2E : parcours multi-vues avec cy.intercept dans cypress/e2e/navigation.cy.js

Couverture des cas (activité 5)

  • Succès (200/201)
  • Erreur métier (400) avec message backend visible
  • Erreur serveur (500) avec message utilisateur de résilience
  • Aucun appel réseau réel dans Jest (axios entièrement mocké)

Commandes

Dans my-app :

npm install
npm start
npm test
npm run cypress:run

CI/CD

Le workflow GitHub Actions exécute :

  1. tests Jest
  2. tests E2E Cypress
  3. build React
  4. publication GitHub Pages

Le workflow injecte :

  • REACT_APP_API_URL=https://jsonplaceholder.typicode.com
  • REACT_APP_API_TOKEN=${{ secrets.JSONPLACEHOLDER_TOKEN }}

Publication npm et SemVer

Le package est configuré pour la publication npm avec :

  • name: test-tp1-ynov-react-kleas17
  • npm: https://www.npmjs.com/package/test-tp1-ynov-react-kleas17?activeTab=readme
  • version au format SemVer MAJOR.MINOR.PATCH
  • main: dist/index.js
  • files: ["dist"]

Commandes de versioning prises en charge :

npm version major
npm version minor
npm version patch
npm version prerelease
npm version premajor
npm version preminor
npm version prepatch
npm version patch -m "Upgrade to %s"

Pré-releases supportées :

npm run version:alpha   # x.y.z-alpha.n
npm run version:beta    # x.y.z-beta.n
npm run version:rc      # x.y.z-rc.n

Validation manuelle de publication :

npm run build-npm
npm adduser
npm publish

Sécurité :

  • Créer un token npm de type Automation.
  • Ajouter NPM_TOKEN dans Settings > Secrets and variables > Actions.
  • Ne jamais commiter un .npmrc contenant un token.
  • Ne jamais republier une version existante : incrémenter systématiquement la version avant publication.