Loading…
Loading…
Generate boilerplate for new custom components
Generate boilerplate for new custom components without writing repetitive code.
npx woonext scaffold [path] # Or after initial install npm run woonext:scaffold
Generate a new React component with test file.
Prompts:
Navbar)server, client, ui, or custom)Generated files:
[directory]/[ComponentName]/
├── [ComponentName].tsx
├── [ComponentName].spec.tsx
└── index.ts
Generate a custom React hook with test file.
Prompts:
todo for useTodo)hooks)Generated files:
hooks/use[Name]/
├── use[Name].ts
├── use[Name].spec.ts
└── index.ts
Generate a new App Router page with optional layout.
Prompts:
my-page/subpage)Generated files:
app/[path]/
├── page.tsx
└── layout.tsx (optional)
Generate an API route handler with test file.
Prompts:
my-route/subroute)Generated files:
app/api/[path]/
├── route.ts
└── route.spec.ts
$ npm run woonext:scaffold ? What is to be generated? React Component ? Enter the component name: ProductGallery ? Pick a component directory: /client ? What type of component is it? Client Component ✔ Created client/ProductGallery/ProductGallery.tsx ✔ Created client/ProductGallery/ProductGallery.spec.tsx ✔ Created client/ProductGallery/index.ts