frend add <name>
This command allows you to easily install components and bloks from the @frend-digital/components package into your project.
Usage
Ensure to install the frend CLI first:
pnpm install -g @frend-digital/cliWhen ready, run the command:
frend add <component-name>Installing UI Components
To install a UI component from the package:
frend add ButtonThis will:
- Look for the component in
@frend-digital/components/src/components/ui/Button - If found, copy it to your project’s
src/components/ui/Buttondirectory - Skip if the component already exists in your project
Installing Bloks
To install a blok component:
frend add ButtonBlokThis will:
- Look for the blok in
@frend-digital/components/src/components/bloks/ButtonBlok - If found:
- Copy the blok to your project’s
src/components/bloks/ButtonBlokdirectory - Automatically install the required
BlokWrap.tsxif it doesn’t exist
- Copy the blok to your project’s
- Skip if the blok already exists in your project
Directory Structure
The command works with the following directory structure:
node_modules/@frend-digital/components/├── src/│ ├── components/│ │ └── ui/ # UI Components│ └── components/│ └── bloks/ # Blok ComponentsYour project structure will mirror this:
your-project/├── src/│ ├── components/│ │ └── ui/ # Installed UI Components│ └── components/│ └── bloks/ # Installed Blok Components