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

next-must-have-libraries

v1.0.14

Published

A starter professional React using Nextjs

Downloads

28

Readme

NEXT-MHL

A Professional Starter React Nextjs with Must-Have Libraries (MHL)

test lint CI npm version GitHub issues DeepScan grade codecov

Opinionated project includes:

  • Initial Next.js project - bootstrapped with create-next-app.
  • NextJS v12.x
  • React & React DOM v17
  • Type Checker - TypeScript v4.x
  • Storybook v6.x (Webpack@5 support)
  • MSW storybook-addon
  • Lint - ESlint & Eslint-config-next
  • Mocking - Mock Service Worker
  • CSS-in-JS Modules — Styled Components
  • Unit Testing - Jest + react-testing-library
  • E2E testing - Cypress
  • Format - Prettier
  • Git hooks - Husky
  • Useful utilities - analyzer Bundle, react-uuid (create unique Id)
  • Generate templates
  • next-password-protect check _app.tsx to enable
  • Sharp library - For production Image Optimization with Next.js, the optional 'sharp' package is strongly recommended.

alt text

If you want to generate HTML in the client browser check CRA-MHL

Run Scripts

Inside the project directory run using npm or yarn:

  • dev - runs the app in the development mode. Open http://localhost:3000 to view it in the browser.
  • build - builds the app for production to the build folder.
  • start - Runs the built app in production mode. You can add port: "start": "next start -p 8081".
  • export - create an export static folder, default out folder.
  • lint - ESlint configured for Next. Use .eslintrc.json to setup & .eslintignore to ignore files.
  • storybook - To run your Storybook. Open http://localhost:6006/ to view it in the browser.
  • build-storybook - build Storybook - create static Storybook project.
  • clean-storybook - clean static Storybook folder.
  • test - unit testing with Jest & react-testing-library.
  • test:watch - watch our jest tests.
  • test:ci - unit testing with Jest & react-testing-library using the ci flag.
  • format - will format your code prettier using opinionated settings inside .prettierrc file. Use .prettierignore to ignore files.
  • analyze - source-map-explorer to Analyzer Bundle.
  • clean-next - delete .next folder.
  • analyze - source-map-explorer to Analyzer Bundle.
  • cypress:open - create a cypress E2E directory with some examples.
  • cypress:run - run the E2E tests and record video.
  • cypress:clean - delete cypress folder.
  • prepare - Install husky.
  • isready - run format, lint, test and build production, lastly run analyze.
  • clean-next - clean next directory.
  • svg - run to auto-generate TypeScript React components of SVGs from the /src/components/Svg/raw directory, outputted to the /src/components/Svg directory.

Usage

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app my-app -e https://github.com/EliEladElrom/next-must-have-libraries

Or;

yarn create next-app my-app -e https://github.com/EliEladElrom/next-must-have-libraries

Run

yarn dev
# or
npm run dev

Entry point pages/index.tsx.

API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.tsx.

The pages/api directory mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Configure Storybook Templates

generate-react-cli help speed up productivity in React projects, feel free to tweak rules inside the config file generate-react-cli.json to match your needs.

Example;

npx generate-react-cli component Header --type=story

Or use the complex story;

npx generate-react-cli component Header --type=complex-story

Will result with the following components;

  1. components/Header/Header.tsx
  2. components/Header/Header.stories.tsx
  3. components/Header/index.ts

Eslint configurations

Lint set according to Airbnb style guide — as part of their style guide. Feel free to tweak .eslintrc.

Format configurations

Prettier is set using my opinionated settings, feel free to tweak prettier rules inside config file .prettierrc to match your code style.

Analyzing the Bundle Size

Use source-map-explorer (yarn add --dev source-map-explorer);

$ yarn analyze

Environment Variables

The following environment variables .env are in use throughout the project. See .env.sample for examples:

| Name | Description | | ------------------------------------------------------ | ----------------------------------------------- | | PUBLIC_ENVIRONMENT | Environment | | NEXT_PUBLIC_GIT_SHA | Git Commit SHA | | NEXT_PUBLIC_PUBLIC_VERSION | Should be Based on package.json version tag | | NEXT_PUBLIC_IMAGE_TAG | Docker SHA - if using one | | NEXT_PUBLIC_GIT_COMMIT_DATE | Latest commit date |

If you can use help with your React project or have a burning question, or an issue in your project that needs help with, I invite you to hire me as your Coach. My strategy is 100% results-oriented. If you want to sample how I work 1-on-1, let’s schedule a one-time deep dive Consultation. Additionally, I will tutor you in react, javascript, typescript, mongodb, node, d3.

Where to go from here?

If you like this library, don't be shy to star it!