A powerful Visual Studio Code extension that helps developers generate React components efficiently with pre-defined Next.js file structures. This extension prompts the user for a component name, validates it, and creates a folder with the necessary files, following best practices for Next.js development.
Features
Component Scaffolding: Quickly generate a new component folder with:
[ComponentName].tsx: The main component file.
[ComponentName].module.scss: A scoped stylesheet for the component.
index.ts: A default export file for clean imports.
Naming Validation: Ensures the component folder name:
Starts with a letter.
Contains only alphanumeric characters.
Does not start with a number or include special characters.
Ease of Use: Integrates seamlessly into VS Code's context menu. Right-click on a folder and select "Generate Component" to start.
Installation
Clone this repository or download the source code.
Open the project in VS Code.
Run npm install to install the required dependencies.
Open the Extensions View (Ctrl+Shift+X or Cmd+Shift+X on Mac) in VS Code.
Click the Install from VSIX option and select the .vsix file from your local directory.
Usage
Right-click on any folder in the Explorer pane.
Select Generate Component from the context menu.
Enter a valid component folder name when prompted.
The extension will create a new folder with the specified name and the following files: