Hey there, developer! 👋 Let's talk about our handy Template Generator. It's your go-to tool for creating new components, pages/routes, and store slices. Using this generator is like having a coding buddy who ensures everything stays consistent and follows our project's structure and best practices.
- 🎯 Ensures consistency across the project
- 🚀 Speeds up development
- 🧱 Follows established project structure
- 🛠️ Sets up best practices automatically
Ready to create something new? Here's how to use our Template Generator:
-
Open your terminal
-
Run this command:
npm run generate
You'll see a menu that looks like this:
? [PLOP] Please choose a generator. (Use arrow keys)
❯ component - create an src/component/{name}/{name}.* component files
page - create an src/component/Page{name}/Page{name}.* component files
route - create a src/pages route
slice - create a src/store slice
api - create an src/pages/api route
Use the arrow keys to navigate and press Enter
to select. Here's what each option does:
- component: Creates a new React component in
src/component/{name}/
- page: Generates a new page component in
src/component/Page{name}/
- route: Sets up a new route in
src/pages
- slice: Creates a new state slice in
src/store
- api: Establishes a new API route in
src/pages/api
After selecting, the generator will ask you some questions. Just follow the prompts, and before you know it, your new files will be ready to go!
- 💡 Use the generator every time you need a new component or feature. It'll save you time and headaches!
- 🤔 Not sure which generator to use? Don't worry! Choose the one that seems closest, and you can always adjust the files afterward.
- 🎨 The generated files are a great starting point. Feel free to customize them to fit your specific needs.
Remember, the Template Generator is here to make your life easier. It's like having a little coding assistant right in your terminal. Happy generating! 🎉