create-frontend-component is a framework-agnostic CLI tool to scaffold frontend components using custom templates. It supports Vue, React, Angular, and other frameworks through customizable presets.
| Command | Description |
|---|---|
npx create-frontend-component init |
Initialize project with preset and config |
npx create-frontend-component init <preset> |
Initialize with specific preset (e.g., init vue3) |
npx create-frontend-component prompt |
Interactive component creation |
npx create-frontend-component <name> --type <type> --flavour <flavour> |
Direct component creation |
npx create-frontend-component upgrade |
Add missing files from a different flavour |
- Make sure to run
npm testandnpm run lint:fixafter changes have been finished - Keep the project lightweight and avoid adding more dependencies
- Make sure to update existing unit tests or create new ones for new features
npm run lint # Run ESLint
npm run lint:fix # Run ESLint with auto-fix
npm run release # Create release with standard-version
npm run release:patch # Release patch version
npm run release:minor # Release minor version
npm run release:major # Release major versionEdit .create-frontend-component/config.json:
{
"types": ["atoms", "molecules", "organisms"],
"templatePath": ".create-frontend-component/templates",
"componentPath": "src/components",
"nameStyle": "pascalCase"
}- types: Component categories (set to
nullto disable) - templatePath: Template directory location
- componentPath: Generated component output directory
- nameStyle:
kebabCaseorpascalCase
src/
├── commands.js # Command handlers (init, prompt, create, upgrade)
├── gulpfile.js # File generation using Gulp
├── prompt-utilities.js # Interactive prompts
└── utilities.js # Helper functions
presets/ # Built-in templates (vue2, vue3, react, etc.)
playground/ # Test environment- ES Modules (Node.js 18+)
- Gulp for file operations
- Commander for CLI
- Prompts for interactive input
- No tests currently implemented (
npm testis a placeholder) - Uses Husky for pre-commit hooks
- Follows conventional commits (commitlint)
- ESLint configuration in
.eslintrc.json