0.1.11 • Published 10 months ago

@igniter-js/cli v0.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Igniter CLI

Code generation CLI for Igniter.js projects - the essential tool to boost productivity with Igniter Framework.

Why Igniter CLI?

  • Feature-First Architecture: Generate complete features with best practices and proper structure
  • Type Safety: All generated code is fully typed with TypeScript
  • Best Practices: Follows modern development patterns and industry standards
  • Framework Integration: Seamlessly integrates with Next.js and the Igniter Framework
  • Developer Experience: Intuitive commands and helpful error messages
  • Productivity Boost: Automates repetitive tasks and enforces consistency
  • Cross-Platform: Works seamlessly on Windows, macOS, and Linux

šŸ“¦ Installation

# Global installation (recommended)
npm install -g @igniter-js/cli

# Or using npx for one-time execution
npx @igniter-js/cli

šŸš€ Quick Start

# Initialize a new project with Igniter Framework in the current directory
igniter init

# Initialize a new project in a specific directory
igniter init -d my-igniter-app

# Generate a new feature
igniter generate feature -n users

# Generate features from Prisma models
igniter generate feature

šŸ› ļø Available Commands

init

Initializes a new Next.js project with the complete Igniter Framework structure:

# Initialize in the current directory
igniter init

# Initialize in a specific directory (creates the directory if it doesn't exist)
igniter init -d my-igniter-app

Options:

  • -d, --dir <directory>: Directory to initialize the project in

This command:

  • Creates a Next.js application with TypeScript, Tailwind, and ESLint
  • Sets up the recommended folder structure for Igniter Framework
  • Initializes Prisma ORM
  • Configures testing environment with Vitest
  • Installs and configures Shadcn/UI
  • Creates necessary Igniter Framework files
  • Sets up Docker for development

analyze

Analyzes the current project:

igniter analyze

This command checks your project's structure and configuration, providing insights and optimization suggestions.

generate feature (alias: g)

Generates a complete feature:

# Generate a specific feature
igniter generate feature -n users

# Generate a feature with specific fields
igniter generate feature -n products -f name:string price:number

# Generate multiple features from Prisma models
igniter generate feature

This command:

  • Creates the feature folder structure
  • Generates base files (controller, procedures, interfaces)
  • Configures the feature based on Prisma model if available

šŸ—ļø Generated Project Structure

src/
ā”œā”€ā”€ app/                                  # Application routes
    ā”œā”€ā”€ configs/                          # Global configurations
    ā”œā”€ā”€ core/
    │   ā”œā”€ā”€ design-system/                # Shadcn/UI components
    │   ā”œā”€ā”€ utils/                        # Utility functions
    │   ā”œā”€ā”€ providers/                    # Contexts and providers
    │   ā”œā”€ā”€ factories/                    # Base classes
  ā”œā”€ā”€ igniter.ts                          # Core initialization
  ā”œā”€ā”€ igniter.client.ts                   # Client implementation
  ā”œā”€ā”€ igniter.context.ts                  # Context management
  ā”œā”€ā”€ igniter.router.ts                   # Router configuration
  ā”œā”€ā”€ features/                           # Application features
  │   └── [feature]/
  │       ā”œā”€ā”€ presentation/               # Feature presentation layer
  │       │   ā”œā”€ā”€ components/             # Feature-specific components
  │       │   ā”œā”€ā”€ hooks/                  # Custom hooks
  │       │   ā”œā”€ā”€ contexts/               # Feature contexts
  │       │   └── utils/                  # Utility functions
  │       ā”œā”€ā”€ controllers/                # Feature controllers
  │       │   └── [feature].controller.ts
  │       ā”œā”€ā”€ procedures/                 # Feature procedures/middleware
  │       │   └── [feature].procedure.ts
  │       ā”œā”€ā”€ [feature].interfaces.ts     # Type definitions
  │       └── index.ts                    # Feature exports

šŸ”„ Platform Compatibility

Igniter CLI is designed to work seamlessly across different platforms:

  • Windows: Full compatibility with Windows command prompt and PowerShell
  • macOS/Linux: Native support for Unix-based terminals
  • Path handling: Automatic path normalization across different operating systems
  • Terminal output: Adaptive terminal styling based on platform capabilities

The CLI automatically detects your operating system and adjusts its behavior accordingly to ensure a consistent experience.

šŸ”§ Advanced Configuration

The Igniter CLI can be configured through environment variables:

# Example of advanced configuration
IGNITER_TEMPLATE_DIR=/path/to/templates igniter generate feature -n custom

šŸ“š Complete Documentation

For complete Igniter Framework documentation, visit our official documentation.

šŸ¤ Contributing

Contributions are welcome! Please read our contribution guide to learn how to participate.

šŸ“„ License

This project is licensed under the MIT License.

0.1.11

10 months ago

0.1.10

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.0

11 months ago