0.1.5 ⢠Published 11 months ago
@cs-magic/generator-acg v0.1.5
AnyCodeGenerator (ACG)
A powerful and flexible code generator for VS Code that helps you generate code snippets, boilerplates, and entire project structures with ease.
Features
- šÆ Smart code generation based on context and requirements
- š Multiple generation templates and patterns
- š¦ Support for various project types and frameworks
- š ļø Built with TypeScript for type safety
- šØ Modern UI with React and Tailwind CSS
- š± Extensible architecture for custom templates
- š Live preview of generated code
Quick Start
Using CLI (Recommended)
# Install ACG globally
npm install -g @cs-magic/generator-acg
# Generate your code with simple command
acg
# Follow the interactive prompts to customize your generationUsing Yeoman Generator
# If you prefer using Yeoman directly
yo @cs-magic/acgUsing VS Code Extension
# Install the VS Code extension
# Search for "AnyCodeGenerator" in VS Code marketplace
# Or visit: [VS Code Marketplace Link]
# Use the command palette (Ctrl+Shift+P / Cmd+Shift+P)
# Type: "ACG: Generate Code"Generation Types
Using Yeoman Commands
The generator supports various commands for different generation needs:
# Generate a new project
yo @cs-magic/generator-acg:project
# Generate a component
yo @cs-magic/generator-acg:component
# Generate an API endpoint
yo @cs-magic/generator-acg:api
# Generate custom template
yo @cs-magic/generator-acg:customEach command will prompt you for necessary configuration options.
Code Snippets
Generate commonly used code patterns and snippets based on your current context.
Project Templates
Create new projects with best-practice structure and configuration:
project-name/
āāā src/
ā āāā core/ # Core functionality
ā āāā components/ # UI components (if applicable)
ā āāā types/ # Type definitions
āāā tests/ # Test files
āāā package.json # Project configurationCustom Templates
Create and use your own templates for specific needs:
- Component templates
- API endpoints
- Database models
- Custom patterns
Development
Prerequisites
- Node.js 16 or later
- pnpm (recommended), yarn, or npm
- VS Code
Building the Extension
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Development with hot reload
pnpm devConfiguration Options
- Project Type: Choose between standalone, monorepo package, or monorepo root
- Package Manager: Select pnpm, yarn, or npm
- Webview Support: Option to include React-based webview
- Package Scope: Custom scope for monorepo packages
Contributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request