Code Monkey home page Code Monkey logo

react-boilerplate's Introduction

My React Boilerplate with TypeScript

βš™οΈ Configs

  • πŸš€ Vite β€” A native ES modules development server and build tool.
  • πŸ”„ Dependabot β€” Automated dependency updates for GitHub repositories.
  • πŸ”§ ESLint β€” Pluggable JavaScript linter
  • 🎨 Prettier β€” Opinionated Code Formatter
  • πŸ“ Commitzen β€” Git commit message helper
  • 🐢 Husky β€” Use git hooks with ease
  • 🚫 Lint-staged β€” Run linters against staged git files

Libs

  • 🌐 Axios β€” HTTP client library for JavaScript.
  • πŸ’… Styled-components β€” library for styling React components.
  • πŸ“‹ React-hook-form β€” lightweight library for building forms.
  • πŸ”’ Zod β€” TypeScript-first schema validation.

πŸš€ Getting Started

To use this boilerplate as a template for your own project, follow these steps:

  • Click on the Use this template button on this repository page to create a new repository from this template.
  • Choose a name and configure the new repository as desired.
  • Clone the newly created repository to your local machine with the following command in your terminal:
git clone https://github.com/<YOUR_USERNAME>/<YOUR_PROJECT_NAME>.git

After cloning the repository, run the following commands inside the project folder:

  • Install the dependencies with npm install
  • Start the project with npm start

πŸ“ Main File Structure

β”œβ”€β”€ πŸ“.github // GitHub workflows
β”œβ”€β”€ πŸ“.husky // Git hooks
|
β”œβ”€β”€ πŸ“src
|   β”œβ”€β”€ πŸ“@types // Type definitions
|   β”œβ”€β”€ πŸ“components // React components
|   β”œβ”€β”€ πŸ“hooks // Custom hooks
|   β”œβ”€β”€ πŸ“pages // Pages or screens
|   β”œβ”€β”€ πŸ“service // API services
|   β”œβ”€β”€ πŸ“styles  // Global styles
|   β”œβ”€β”€ πŸ“theme // Theme files
|   β”œβ”€β”€ πŸ“utils // General utilities
|   |   β”œβ”€β”€πŸ“constants // Global constants
|   |   β””β”€β”€πŸ“functions // Utility functions
|   |
|   └── πŸ“„index.tsx // Main entry file
|
β”œβ”€β”€ πŸ“„.eslintrc.json // ESLint configuration file
β”œβ”€β”€ πŸ“„.prettierrc // Prettier configuration file
β”œβ”€β”€ πŸ“„Index.html // Entry point HTML file
β”œβ”€β”€ πŸ“„README.md // Project documentation
β”œβ”€β”€ πŸ“„package.json // NPM package configuration file
β”œβ”€β”€ πŸ“„tsconfig.json // TypeScript configuration file
└── πŸ“„vite.config.ts // Vite configuration file

🀝 Contributing

If you want to contribute to this template, follow these steps:

  • Fork this repository
  • Create a new branch with their feature using git checkout -b my-feature.
  • Commit their changes using git commit -m 'Adding new feature'.
  • Push the changes to their branch using git push origin my-feature.
  • Open a pull request on your repository.

react-boilerplate's People

Contributors

dependabot[bot] avatar guilhiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-boilerplate's Issues

Fix Commitzen bug: prevent default text editor from opening after confirming commit message

πŸ“ Description

This issue aims to address a bug that occurs when committing using Commitzen. Currently, when a user runs git commit without providing a commit message, Commitzen prompts the user to enter a message using its interface. However, after the user confirms the message, the default text editor is opened for them to edit the message again, resulting in unnecessary time loss and confusion for users who prefer to use Commitzen for their commit messages.

πŸš€ Steps to Reproduce

  1. Run git add to stage changes
  2. Run git commit without providing a message to use Commitzen
  3. Use the Commitzen interface to write and confirm the commit message
  4. Observe that the default text editor opens, even though the commit message has already been confirmed using Commitzen.
ezgif.com-gif-maker.mp4

πŸ‘€ Expected Behavior

After confirming the commit message using the Commitzen interface, the commit should be made without opening the default text editor. This would improve the user experience by eliminating unnecessary steps and reducing confusion.

πŸ€” Previous Attempts

I attempted to solve this issue by checking the Commitzen documentation and trying different configurations in my Git hooks, but none of them seem to work. Usually, changing the code of the Git hooks only caused more problems, such as Commitzen running twice or lint-staged not working. From what I found, the solution adopted by most people was simply to create a script or an alias to avoid using git commit. I am considering adopting one of these ideas, but I decided to open this issue to try my luck.

πŸ“Œ Task List

  • Modify Commitzen or git hook prepape-commit-msg to enable committing without opening the default text editor after confirming the commit message using the Commitzen interface.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.