ngx-crafter
Version:
Custom Angular CLI generator
203 lines (153 loc) โข 6.93 kB
Markdown
#  ngx-crafter
> **Craft your Angular projects like a pro!** โ๏ธ
[](https://opensource.org/licenses/MIT)
[](https://www.npmjs.com/package/ngx-crafter)
[](https://nodejs.org/)
[](https://angular.io/)
A powerful CLI tool that helps you **craft** Angular projects with pre-configured folder structures and essential packages. Think of it as your personal **crafting table** for Angular development! ๐งฐ
## ๐ Features
- **๐๏ธ Smart Project Generation**: Creates Angular projects with optimized folder structures
- **๐ฆ Package Management**: Automatically installs commonly used packages (Tailwind CSS, Angular Material, NgRx, ESLint)
- **๐ง Dev Utilities**: Git hooks and development tools (Husky)
- **๐จ Tailwind CSS Integration**: Pre-configured utility-first CSS framework with PostCSS
- **๐ฏ Custom Structures**: Support for custom folder structure configurations
- **๐ Plugin System**: Extensible plugin architecture for additional features (auth, i18n, PWA, etc.)
- **โก Fast Setup**: Get your project ready in seconds, not minutes
- **๐ง Angular 17-20 Support**: Compatible with the latest Angular versions
## ๐ Quick Start
### Prerequisites
Before you start crafting, make sure you have:
- **Node.js** (v18 or higher) ๐ฆ
- **Angular CLI** (v17-20) โก
```bash
npm install -g @angular/cli
```
### Installation
```bash
npm install -g ngx-crafter
```
### Usage
```bash
# Basic usage with interactive prompts
ngx-crafter
# Use plugins for additional features (coming soon)
ngx-crafter -- --with auth
ngx-crafter -- --with auth,i18n,pwa
# Plugin-specific options (coming soon)
ngx-crafter -- --with auth --auth-provider firebase
ngx-crafter -- --with pwa --pwa-name "My Awesome App"
```
That's it! The tool will guide you through the setup process with interactive prompts.
## ๐ฏ What You Get
When you run `ngx-crafter`, you'll get a fully configured Angular project with:
### ๐ฆ Pre-configured Packages
- **Tailwind CSS**: Automatically configured with PostCSS and ready to use
- **Angular Material**: UI components and theming setup
- **NgRx**: State management with store, effects, and devtools
### ๐ ๏ธ Development Utilities
- **Husky**: Git hooks configured with lint-staged for pre-commit code quality checks
- **ESLint**: Code linting and formatting rules
- **Prettier**: Code formatting and style consistency
### ๐ Default Folder Structure
```
src/
โโโ app/
โ โโโ core/ # Core application logic
โ โ โโโ services/ # Application services
โ โ โโโ guards/ # Route guards
โ โ โโโ interceptors/ # HTTP interceptors
โ โ โโโ models/ # Data models
โ โ โโโ utils/ # Utility functions
โ โโโ shared/ # Shared components & services
โ โ โโโ components/ # Reusable components
โ โ โโโ directives/ # Custom directives
โ โ โโโ pipes/ # Custom pipes
โ โ โโโ models/ # Shared models
โ โ โโโ services/ # Shared services
โ โโโ features/ # Feature modules
โ โโโ layouts/ # Layout components
โ โโโ assets/ # Static assets
โ โโโ images/ # Image files
โ โโโ icons/ # Icon files
โ โโโ fonts/ # Font files
โโโ environments/ # Environment configurations
```
### ๐ Available Plugins
- **๐ Auth**: Authentication setup with Angular Fire and Firebase (coming soon)
- **๐ i18n**: Internationalization with ngx-translate (coming soon)
- **๐ฑ PWA**: Progressive Web App setup with Angular PWA (coming soon)
- **๐ CRUD**: CRUD operations setup (coming soon)
- **๐งช Testing**: Enhanced testing setup (coming soon)
- **๐ Storybook**: Storybook integration (coming soon)
Plugin system infrastructure is ready! You can create your own plugins now.
Provided plugins will be available in future versions.
Meanwhile, check out demo-plugin as an example.
### ๐ ๏ธ Interactive Setup
The tool will ask you:
1. **Project Name**: What should we call your masterpiece?
2. **Package Selection**: Which packages do you want to include?
- **Angular Material**: UI component library
- **Tailwind CSS**: Utility-first CSS framework
- **NgRx**: State management library
3. **Dev Utilities**: Which development utilities do you want to add?
- **Husky**: Git hooks with lint-staged for pre-commit code quality
- **ESLint**: Code linting and formatting
- **Prettier**: Code formatting and style consistency
4. **Folder Structure**: Use default or custom structure?
## ๐จ Custom Structures
Want to craft your own folder structure? Create a JSON file like this:
```json
{
"src": {
"app": {
"core": {
"services": {},
"guards": {},
"models": {}
},
"features": {
"auth": {},
"dashboard": {}
}
}
}
}
```
Then reference it during setup!
## ๐งฐ Development
### Building the Project
```bash
npm run build
```
### Development Mode
```bash
npm run dev
```
### Project Structure
```
ngx-crafter/
โโโ src/
โ โโโ cli.ts # Main CLI entry point
โ โโโ default-structure.json # Default folder structure
โ โโโ utils/ # Utility functions
โ โโโ checkAngularCLI.ts # Angular CLI version checker
โ โโโ createFolders.ts # Folder creation logic
โ โโโ createProject.ts # Project creation logic
โ โโโ prompt.ts # Interactive prompts
โโโ test/ # Test files
โโโ package.json # Project configuration
โโโ tsconfig.json # TypeScript configuration
```
## ๐ค Contributing
Want to help improve ngx-crafter? Here's how you can contribute:
1. **Fork** the repository ๐ด
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
3. **Commit** your changes (`git commit -m 'Add amazing feature'`)
4. **Push** to the branch (`git push origin feature/amazing-feature`)
5. **Open** a Pull Request ๐
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
<div align="center">
**Happy Crafting!** โ๏ธโจ
*Built with โค๏ธ by [TOROIMERA](https://github.com/ErwanHeschung)*
</div>