0.1.2 โข Published 1 year ago
create-liteflow-app v0.1.2
Create LiteFlow App
A CLI tool for creating modern web applications with LiteFlow framework.
Quick Start
npx create-liteflow-app my-app
cd my-app
npm install
npm run devFeatures
- ๐ Quick project setup
- โก๏ธ Built with Vite for fast development
- ๐ฏ TypeScript by default
- ๐ฃ๏ธ Type-safe routing
- ๐จ Tailwind CSS for styling
- ๐ฆ Zero configuration
- ๐งช Testing setup with Vitest
- ๐ฑ Mobile-first responsive design
Usage
Creating a New Project
npx create-liteflow-app my-appOptions:
--template- Template to use (default: "default")--typescript- Use TypeScript (default: true)--package-manager- Package manager to use (npm, yarn, pnpm)
Project Structure
my-app/
โโโ src/
โ โโโ pages/ # Route components
โ โโโ components/ # Reusable components
โ โโโ hooks/ # Custom hooks
โ โโโ utils/ # Utility functions
โ โโโ App.tsx # Root component
โ โโโ main.tsx # Entry point
โโโ public/ # Static assets
โโโ package.json # Dependencies and scriptsAvailable Scripts
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm test- Run testsnpm run lint- Run linter
Templates
Default Template
The default template includes:
- React with TypeScript
- Vite for development and building
- React Router for routing
- Tailwind CSS for styling
- Vitest for testing
- ESLint and Prettier for code quality
Custom Templates
You can create custom templates by following this structure:
template/
โโโ src/
โ โโโ ...
โโโ package.json
โโโ tsconfig.json
โโโ vite.config.tsCLI Commands
Generate Components
npx create-liteflow-app generate component MyComponentThis will create:
src/components/MyComponent.tsxsrc/components/MyComponent.test.tsx(optional)
Generate Pages
npx create-liteflow-app generate page AboutThis will create:
src/pages/About.tsxsrc/pages/About.test.tsx(optional)
Configuration
TypeScript
The template includes a pre-configured tsconfig.json. You can extend it:
{
"extends": "./tsconfig.json",
"compilerOptions": {
// Your custom options
}
}Vite
Customize your Vite configuration in vite.config.ts:
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
// Your custom config
});Tailwind CSS
Customize your Tailwind configuration in tailwind.config.js:
module.exports = {
theme: {
extend: {
// Your custom theme
},
},
// Your custom config
};Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Publishing
To publish a new version:
- Update version in
package.json - Create and push a new tag:
git tag v0.1.1
git push origin v0.1.1The GitHub Action will automatically publish the package to npm.
License
MIT ยฉ Rahees Ahmed