August 11, 2023

A boilerplate to be use in your project with React and Styled-components

NEXTJS BOILERPLATE

technology technology technology technology technology

About this project

This is a boilerplate to be use in your project with tecnologies NextJS, TypeScript, Storybook, Styled-components, Jest & React-testing-library.

Technologies

Run this project

# Creating your project using this boilerplate
$ yarn create next-app -e https://github.com/jefferson1104/boilerplate-nextjs PROJECT_NAME

# Project directory
cd PROJECT_NAME

# Install dependencies
$ yarn

# Run project
$ yarn dev

Commands

  • yarn dev: run application on localhost:3000
  • yarn build: creates the production build version
  • yarn start: starts a simple server with the build production code
  • yarn lint: runs ESLint to test all components and pages
  • test: run Jest to test all components and pages
  • test:watch: run Jest to test in watch mode
  • yarn storybook: run storybook on localhost:6006
  • yarn generate: create the component structure in an automated way

Init Husky in your project

Execute command: npx husky-init && yarn

In the pre-commit file inside the .husky directory .husky/pre-commit Change line content npm test to npx --no-install lint-staged