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
โก 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
Global Installation (Recommended)
npm install -g @florianogomez/aurora-generatorsLocal Installation
npm install --save-dev @florianogomez/aurora-generatorsThen use with npx:
npx generate vue module --interactive๐ Usage
Interactive Mode (Easiest)
generate vue module --interactiveThe CLI will guide you through:
- Resource name (e.g., "Product", "User")
- Attributes with types
- Filter configurations
- Action selection
- Output directory
YAML Configuration (Recommended for Complex Modules)
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: DELETEGenerate the module:
generate vue module product.yamlAvailable 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 approveDry Run Mode
Preview what will be generated without writing files:
generate vue module --dry-run product.yamlModule Deletion
Remove a module and clean up imports:
delete-module vue Product๐ Documentation
- Vue Framework Guide - Complete Vue 3 documentation
- Architecture Guide - Internal architecture
- Generators API - Extend the generator
- Templates Guide - Customize templates
- YAML Reference - Full YAML specification
- CHANGELOG - Version history
- Publishing Guide - How to publish (for contributors)
๐ ๏ธ 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:
- Handlebars - Template engine
- Inquirer.js - Interactive CLI
- js-yaml - YAML parser
๐ง Support
- ๐ Report a Bug
- ๐ก Request a Feature
- ๐ง Email: contact@florianogomez.dev
โญ Show Your Support
If this project helped you, please give it a โญ๏ธ!
Made with โค๏ธ by Floriano Gomez