Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 2.14 KB

template-generator.md

File metadata and controls

52 lines (36 loc) · 2.14 KB

Template Generator: Your Coding Companion

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.

Why Use the Template Generator?

  • 🎯 Ensures consistency across the project
  • 🚀 Speeds up development
  • 🧱 Follows established project structure
  • 🛠️ Sets up best practices automatically

Let's Get Generating!

Ready to create something new? Here's how to use our Template Generator:

  1. Open your terminal

  2. 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

Choosing Your Generator

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!

Pro Tips

  • 💡 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! 🎉