FlowweComponents is a CLI tool for creating and managing custom HTML components with Tailwind CSS integration. It provides a streamlined workflow for developing, previewing, and iterating on web components used (mostly) in Flowwe JS.
- Create custom HTML components with integrated JavaScript and CSS
- Automatic Tailwind CSS compilation based on used classes
- Live preview with hot reloading
- Component templates for quick start
- Development server for easy testing and iteration
- Clone the repository:
git clone https://github.com/yourusername/FlowweComponents.git
cd FlowweComponents
- Install dependecies
npm install
- Link the CLI tool globally:
npm link
To create a new component:
flowwecomponent new <componentName> [options]
Options:
-t, --template <templateName>
: Specify a template to use (default: 'default')-w, --watch
: Start watching the component after creation
Example:
flowwecomponent new my-button -w
This command will:
- Create a new component named "my-button" in the
/components
directory - Start the development server
- Open the component in your default browser
- Watch for changes and automatically reload the browser
To start the development server for an existing component:
flowwecomponent start my-button
Each component consists of three main files:
<componentName>.html
: The HTML structure of your component<componentName>.css
: The component's styles (auto-generated from Tailwind)<componentName>.js
: The JavaScript behavior of your component
The component is defined as a custom element that extends HTMLElement
.
Tailwind CSS classes used in your component's HTML are automatically extracted and compiled into the component's CSS file. This ensures that only the used styles are included, keeping your component's CSS lean and efficient.
Component templates are stored in the templates/
directory. You can create custom templates and use them with the -t
option when creating a new component.
- Create a new component using the
new
command - Edit the component files in your preferred code editor
- View the component in the automatically opened browser window
- Changes to the component files will trigger automatic reloading
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.