JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 30
  • Score
    100M100P100Q65980F
  • License MIT

Production-ready code generator for modern CRUD applications. Generate complete modules with TypeScript, Vue 3, Pinia, and more in seconds.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@florianogomez/aurora-generators) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Aurora Module Generator

    npm version npm downloads license node version

    โšก Production-ready code generator for modern CRUD applications โšก

    Generate complete modules with TypeScript, Vue 3, Pinia, and more in seconds.
    Say goodbye to repetitive boilerplate and focus on building features!


    ๐Ÿš€ Quick Start

    # Install globally
    npm install -g @florianogomez/aurora-generators
    
    # Generate a Vue 3 module interactively
    generate vue module --interactive
    
    # Or from a YAML file
    generate vue module resources/product.yaml

    โœจ Features

    • ๐ŸŽฏ Complete CRUD Generation - Generate 28+ files in seconds
    • ๐Ÿ“ TypeScript First - Full type safety with 6 interfaces per module
    • ๐ŸŽจ Vue 3 + Pinia - Modern state management out of the box
    • ๐Ÿงฉ Composable-based - Reusable logic with Vue composables
    • ๐ŸŽญ Vuetify Support - Beautiful UI components (optional)
    • ๐Ÿ”ง Highly Customizable - 35+ Handlebars templates
    • ๐Ÿงช Dry Run Mode - Preview changes before writing files
    • ๐Ÿ—‘๏ธ Smart Deletion - Remove modules with automatic cleanup
    • ๐Ÿ“ฆ Zero Configuration - Works out of the box
    • ๐ŸŒ Framework Ready - React & Angular support coming soon

    ๐Ÿ“ฆ Installation

    npm install -g @florianogomez/aurora-generators

    Local Installation

    npm install --save-dev @florianogomez/aurora-generators

    Then use with npx:

    npx generate vue module --interactive

    ๐Ÿ“– Usage

    Interactive Mode (Easiest)

    generate vue module --interactive

    The CLI will guide you through:

    • Resource name (e.g., "Product", "User")
    • Attributes with types
    • Filter configurations
    • Action selection
    • Output directory

    Create a YAML file (e.g., product.yaml):

    resource: Product
    description: Module de gestion des produits
    version: 1.0.0
    
    attributes:
      - name: name
        type: string
        required: true
        description: Product name
    
      - name: price
        type: number
        required: true
        description: Product price
    
      - name: category
        type: string
        required: true
        description: Product category
    
      - name: is_active
        type: boolean
        required: true
        description: Active status
    
    create_attributes:
      - name
      - price
      - category
    
    update_attributes:
      - name
      - price
      - is_active
    
    filterAttributes:
      - name: is_active
        type: boolean
        label: "Status"
        icon: "ri-checkbox-circle-line"
        trueLabel: "Active"
        falseLabel: "Inactive"
    
      - name: category
        type: string
        label: "Category"
        icon: "ri-folder-line"
    
    actions:
      - name: getAll
        description: Get all products
        route: list
        method: GET
    
      - name: create
        description: Create a product
        route: create
        method: POST
    
      - name: updateOne
        description: Update a product
        route: update
        method: PUT
    
      - name: delete
        description: Delete a product
        route: delete
        method: DELETE

    Generate the module:

    generate vue module product.yaml

    Available Commands

    # Generate module
    generate vue module [options] [file]
    
    # Delete module
    delete-module vue Product
    
    # Options
    --interactive     Interactive mode
    --dry-run        Preview without writing files
    --overwrite      Overwrite existing files
    --help           Show help

    โš™๏ธ Configuration

    Create a configuration file at the root of your project to customize the output directory:

    Option 1: JavaScript Configuration

    Create aurora.config.js:

    export default {
      // Output directory (relative to project root)
      outputDir: './src',
      
      // Modules directory name
      modulesDir: 'modules',
      
      // Or use full path override
      // modulesPath: './src/modules',
      
      // Generation options
      options: {
        overwrite: false,
        verbose: true,
      },
    };

    Option 2: JSON Configuration

    Create .aurorarc or aurora.config.json:

    {
      "outputDir": "./src",
      "modulesDir": "modules",
      "options": {
        "overwrite": false,
        "verbose": true
      }
    }

    Configuration Options

    Option Type Default Description
    outputDir string "./src" Output directory for modules
    modulesDir string "modules" Modules directory name
    modulesPath string null Full path override (if set, overrides outputDir and modulesDir)
    options.overwrite boolean false Overwrite existing files
    options.verbose boolean true Verbose output

    Example: If you set outputDir: './app' and modulesDir: 'features', modules will be generated in ./app/features/your-module/.

    Without configuration, modules are generated in ./src/modules/ by default.

    ๐Ÿ“‚ What Gets Generated

    For a resource called "Product", the generator creates:

    src/modules/product/
    โ”œโ”€โ”€ ๐Ÿ“ interfaces/
    โ”‚   โ”œโ”€โ”€ Product.ts              # Main interface
    โ”‚   โ”œโ”€โ”€ ProductCreate.ts        # Creation DTO
    โ”‚   โ”œโ”€โ”€ ProductUpdate.ts        # Update DTO
    โ”‚   โ”œโ”€โ”€ ProductListFilter.ts    # List filters
    โ”‚   โ”œโ”€โ”€ ProductStore.ts         # Store state interface
    โ”‚   โ””โ”€โ”€ index.ts                # Barrel export
    โ”‚
    โ”œโ”€โ”€ ๐Ÿ“ models/
    โ”‚   โ””โ”€โ”€ Product.model.ts        # Model class with constructor
    โ”‚
    โ”œโ”€โ”€ ๐Ÿ“ routes/
    โ”‚   โ”œโ”€โ”€ product.routes.base.ts  # Base route configuration
    โ”‚   โ”œโ”€โ”€ product.routes.list.ts  # List route
    โ”‚   โ”œโ”€โ”€ product.routes.create.ts
    โ”‚   โ”œโ”€โ”€ product.routes.update.ts
    โ”‚   โ”œโ”€โ”€ product.routes.delete.ts
    โ”‚   โ”œโ”€โ”€ product.routes.find.ts
    โ”‚   โ””โ”€โ”€ product.routes.navigation.ts
    โ”‚
    โ”œโ”€โ”€ ๐Ÿ“ store/
    โ”‚   โ”œโ”€โ”€ product.actions.ts      # Pinia actions
    โ”‚   โ””โ”€โ”€ product.store.ts        # Pinia store
    โ”‚
    โ”œโ”€โ”€ ๐Ÿ“ composables/
    โ”‚   โ”œโ”€โ”€ use_product_actions.ts  # CRUD composable
    โ”‚   โ””โ”€โ”€ use_product_filters.ts  # Filters composable
    โ”‚
    โ”œโ”€โ”€ ๐Ÿ“ views/
    โ”‚   โ”œโ”€โ”€ ProductList.vue         # List view with filters
    โ”‚   โ”œโ”€โ”€ ProductAdd.vue          # Create view
    โ”‚   โ””โ”€โ”€ ProductEdit.vue         # Edit view
    โ”‚
    โ””โ”€โ”€ ๐Ÿ“ components/
        โ”œโ”€โ”€ ProductForm.vue          # Reusable form
        โ”œโ”€โ”€ ProductFormDialog.vue    # Dialog wrapper
        โ”œโ”€โ”€ ProductDetailDialog.vue  # Details dialog
        โ”œโ”€โ”€ ProductFiltersForm.vue   # Filters form
        โ””โ”€โ”€ ProductSelector.vue      # Selector component (8+ variants)

    Total: 28+ files with ~3000+ lines of production-ready code!

    ๐ŸŽฏ Real-World Example

    # 1. Create a YAML spec
    cat > customer.yaml << EOF
    resource: Customer
    description: Customer management module
    
    attributes:
      - name: firstName
        type: string
        required: true
      - name: lastName
        type: string
        required: true
      - name: email
        type: string
        required: true
      - name: phone
        type: string
        required: false
      - name: is_active
        type: boolean
        required: true
    
    actions:
      - name: getAll
        route: list
        method: GET
      - name: create
        route: create
        method: POST
      - name: updateOne
        route: update
        method: PUT
      - name: delete
        route: delete
        method: DELETE
    EOF
    
    # 2. Generate the module
    generate vue module customer.yaml
    
    # 3. Module ready to use! ๐ŸŽ‰

    ๐Ÿ”ง Advanced Features

    Custom Actions

    Add custom actions to existing modules:

    # Add a custom "approve" action
    generate vue module --add-action Product approve

    Dry Run Mode

    Preview what will be generated without writing files:

    generate vue module --dry-run product.yaml

    Module Deletion

    Remove a module and clean up imports:

    delete-module vue Product

    ๐Ÿ“š Documentation

    ๐Ÿ› ๏ธ Requirements

    • Node.js >= 18.0.0
    • npm >= 9.0.0

    ๐ŸŽจ Supported Frameworks

    Framework Status Version
    Vue 3 + Pinia โœ… Available 1.0.0
    React + Redux ๐Ÿšง Coming Soon -
    Angular + NgRx ๐Ÿšง Coming Soon -

    ๐Ÿค Contributing

    Contributions are welcome! Please read our Contributing Guide for details.

    # Clone the repository
    git clone https://github.com/florianogomez/aurora-module-generator.git
    cd aurora-module-generator
    
    # Install dependencies
    npm install
    
    # Run tests
    npm test
    
    # Test locally
    npm link
    generate vue module --interactive

    ๐Ÿ“„ License

    MIT ยฉ Adรฉbayo Floriano Davidio Sergio Gomez

    See LICENSE for more information.

    ๐Ÿ™ Acknowledgments

    Built with:

    ๐Ÿ“ง Support

    โญ Show Your Support

    If this project helped you, please give it a โญ๏ธ!


    Made with โค๏ธ by Floriano Gomez