Socket
Book a DemoInstallSign in
Socket

boilerbuilder

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boilerbuilder

A Boilerbuilder, to boilerbuild aesthetics projects!

latest
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

🏰 Boilerbuilder

Boilerbuilder Logo

A Boilerbuilder, to boilerbuild aesthetics projects! πŸ’ͺ

πŸ“œ Overview

Welcome to Boilerbuilder, your go-to CLI tool for creating, managing, and maintaining modern frontend projects with ease! Boilerbuilder streamlines the development workflow by providing a comprehensive set of commands to scaffold new projects, migrate existing ones, and keep dependencies up-to-date using curated templates from the cloud.

Built with developer productivity in mind, Boilerbuilder eliminates the repetitive setup tasks and ensures consistency across your projects by leveraging a centralized template system hosted on GitHub.

✨ Key Features

  • πŸ—οΈ Project Scaffolding: Create new projects instantly from curated templates
  • πŸ”„ Smart Migration: Migrate existing projects to updated templates while preserving your code
  • πŸ“¦ Dependency Management: Keep your project dependencies synchronized with template standards
  • 🌐 Cloud-Based Templates: Access templates dynamically from GitHub repository
  • 🎯 Interactive CLI: User-friendly prompts for seamless project configuration
  • πŸ”§ Flexible Architecture: Modular design supporting multiple project types
  • πŸ’Ύ Backup System: Automatic backup creation during migration processes

πŸ—οΈ Architecture

Boilerbuilder is organized into a clean, modular structure with enhanced reliability and maintainability:

boilerbuilder/
β”œβ”€β”€ src/                      # ✨ Refactored implementation
β”‚   β”œβ”€β”€ index.js              # CLI entry point with Commander.js
β”‚   β”œβ”€β”€ config/               # Configuration and validation
β”‚   β”‚   β”œβ”€β”€ constants.js      # Centralized constants and messages
β”‚   β”‚   └── validation.js     # Input validation schemas
β”‚   β”œβ”€β”€ commands/             # Command implementations
β”‚   β”‚   β”œβ”€β”€ createProject.js  # Project creation logic
β”‚   β”‚   β”œβ”€β”€ migrateProject.js # Project migration functionality
β”‚   β”‚   └── updateDependencies.js # Dependency update management
β”‚   β”œβ”€β”€ services/             # Business logic services
β”‚   β”‚   β”œβ”€β”€ templateService.js    # Template management
β”‚   β”‚   β”œβ”€β”€ fileService.js        # File operations
β”‚   β”‚   β”œβ”€β”€ gitService.js         # Git operations
β”‚   β”‚   └── validationService.js  # Input validation
β”‚   └── utils/                # Pure utility functions
β”‚       β”œβ”€β”€ errorHandler.js   # Consistent error handling
β”‚       β”œβ”€β”€ logger.js         # Logging utilities
β”‚       └── pathUtils.js      # Path manipulation utilities
β”œβ”€β”€ tests/                    # πŸ§ͺ E2E testing suite
β”‚   β”œβ”€β”€ e2e-test.sh          # Main test runner (bash)
β”‚   β”œβ”€β”€ helpers/             # Test utilities
β”‚   β”‚   β”œβ”€β”€ assert.sh        # Assertion functions
β”‚   β”‚   └── cleanup.sh       # Test cleanup utilities
β”‚   └── fixtures/            # Test data
β”œβ”€β”€ .temp/                   # Test projects (gitignored)
└── package.json             # Package configuration with test scripts

πŸ”„ Command Flow

graph TD
    A[boilerbuilder CLI] --> B{Command Type}
    
    B -->|Default/birl| C[Create New Project]
    B -->|update| D[Update Dependencies]
    B -->|migrate| E[Migrate Project]
    
    C --> F[Fetch Available Templates]
    F --> G[User Selection]
    G --> H[Download Template]
    H --> I[Setup Project]
    I --> J[Success Message]
    
    D --> K[Read package.json]
    K --> L[Compare with Remote]
    L --> M[Show Differences]
    M --> N[Apply Updates]
    
    E --> O[Backup Current Code]
    O --> P[Download New Template]
    P --> Q[Restore User Code]
    Q --> R[Update Configuration]
    
    style C fill:#e1f5fe
    style D fill:#f3e5f5
    style E fill:#fff3e0

πŸš€ Getting Started

πŸ“‹ Prerequisites

  • Node.js v18 or higher
  • npm or yarn package manager
  • Git (for template downloading)

πŸ“¦ Installation

Install Boilerbuilder globally to use it anywhere:

npm install -g boilerbuilder

Or use it directly with npx:

npx boilerbuilder

πŸ› οΈ Quick Start

Create your first project:

# Interactive mode - will prompt for project name and type
boilerbuilder

# Direct mode - specify name and type
boilerbuilder --name my-awesome-project --type react-spa-vite

πŸ› οΈ Usage

πŸ—οΈ Creating a New Project

The main command creates a new project from available templates:

# Interactive mode
boilerbuilder

# With options
boilerbuilder --name <project-name> --type <template-type>

Example:

boilerbuilder --name my-react-app --type react-spa-vite

Interactive Flow:

? Nome do projeto: my-awesome-project
? Tipo do projeto: (Use arrow keys)
❯ react-spa-vite
  react-lib-vite
  next-app
  ts-lib-vite
  vue-lib-vite
  vue-spa-vite

πŸ“¦ Updating Dependencies

Keep your project dependencies synchronized with the latest template standards:

cd your-project
boilerbuilder update

Requirements:

  • The command detects the project type from package.json keywords[0]
  • Your project's package.json must have the template name in the first keyword

Example package.json configuration:

{
  "name": "my-project",
  "keywords": ["react-spa-vite"],
  "dependencies": {
    // your dependencies
  }
}

Features:

  • Compares current dependencies with template versions
  • Shows detailed diff table with current vs. new versions
  • Identifies missing dependencies from template
  • Highlights dependencies not present in template
  • Interactive confirmation before applying changes

Example Output:

DependΓͺncias para atualizar:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ DependΓͺncia                  β”‚ VersΓ£o Atual       β”‚ VersΓ£o Nova        β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ react                        β”‚ ^18.2.0            β”‚ ^18.3.1            β”‚
β”‚ @types/react                 β”‚ ^18.2.15           β”‚ ^18.3.3            β”‚
β”‚ vite                         β”‚ ^4.4.5             β”‚ ^5.3.4             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

? Deseja atualizar as dependΓͺncias automaticamente? (y/N)

πŸ”„ Migrating Existing Projects

Migrate your existing project to a newer template while preserving your custom code:

cd your-existing-project
boilerbuilder migrate

Migration Process:

  • Detection: Automatically detects project type from package.json
  • Confirmation: Asks for confirmation or allows template selection
  • Backup: Creates src_backup and public_backup folders
  • Template Download: Downloads the latest template
  • Code Restoration: Restores your custom code from backups
  • Configuration Update: Updates package.json with your project name

Safety Features:

  • Automatic backup of src/ and public/ directories
  • Preserves .git and .github folders
  • Maintains project name in package.json
  • Non-destructive process with rollback capability

πŸ“¦ Available Templates

Boilerbuilder dynamically fetches available templates from the GitHub repository. Current templates include:

  • react-spa-vite: React Single Page Application with Vite
  • react-lib-vite: React Library template with Vite
  • next-app: Next.js Application template
  • ts-lib-vite: TypeScript Library template with Vite
  • vue-lib-vite: Vue.js Library template with Vite
  • vue-spa-vite: Vue.js Single Page Application with Vite

Templates are maintained in the boilerplates repository and updated automatically.

βš™οΈ Commands Reference

Main Command (Default)

boilerbuilder [options]

Options:

  • --name <name>: Specify project name
  • --type <type>: Specify template type
  • --version: Show version information
  • --help: Display help information

Update Command

boilerbuilder update

Functionality:

  • Reads current package.json
  • Fetches remote template package.json
  • Compares dependency versions
  • Shows interactive diff table
  • Applies updates with user confirmation

Migrate Command

boilerbuilder migrate

Functionality:

  • Detects current project type
  • Creates automatic backups
  • Downloads latest template
  • Restores user code
  • Updates project configuration

🧩 Development

To contribute to Boilerbuilder or run it locally:

πŸ”§ Setup

  • Clone the repository:

    git clone https://github.com/BoilerBuilder/boilerbuilder.git
    cd boilerbuilder
    
  • Install dependencies:

    yarn install
    
  • Check for existing global links:

    # Check if boilerbuilder is already linked
    npm list -g --depth=0 | grep boilerbuilder
    # or
    which boilerbuilder
    
  • Remove existing link (if found):

    npm unlink -g boilerbuilder
    
  • Link for local development:

    npm link
    
  • Test the CLI:

    boilerbuilder --help
    boilerbuilder --version
    
    # Run E2E tests to validate functionality
    npm test
    
    # Test specific functionality
    boilerbuilder --name test-project --type react-spa-vite
    

Development Workflow:

# Complete setup from scratch
git clone https://github.com/BoilerBuilder/boilerbuilder.git
cd boilerbuilder
yarn install

# Check and remove existing links
npm list -g --depth=0 | grep boilerbuilder
npm unlink -g boilerbuilder  # if exists

# Create development link
npm link

# Test your changes
boilerbuilder --name test-project --type react-spa-vite

# Clean up when done
npm unlink -g boilerbuilder

Troubleshooting:

  • Dependencies fail: Ensure yarn is installed: npm install -g yarn
  • Link not found: Check PATH includes npm global bin directory
  • Permission errors: May need to configure npm/yarn permissions
  • Wrong version: Always unlink before relinking for development

πŸƒβ€β™‚οΈ Development Workflow

  • Make your changes in the src/ directory
  • Test locally using npm link
  • Submit a pull request

πŸ“ Project Structure Details

  • src/index.js: Main CLI entry point with Commander.js and enhanced error handling
  • src/commands/createProject.js: Project creation logic with interactive prompts
  • src/commands/migrateProject.js: Project migration functionality with backup system
  • src/commands/updateDependencies.js: Dependency update management with diff tables
  • src/services/: Business logic services for templates, files, git operations, and validation
  • src/utils/: Pure utility functions for error handling, logging, and path operations
  • src/config/: Configuration constants and validation schemas
  • tests/: Comprehensive E2E testing suite with bash scripts

πŸ§ͺ Testing

Boilerbuilder includes comprehensive E2E tests to ensure reliability and maintain backward compatibility:

Running Tests

# Run all E2E tests
npm test

# Run with verbose output for debugging
npm run test:verbose

# Clean up test files
npm run test:cleanup

# List current test projects
npm run test:list

# For CI/CD environments
npm run test:ci

Test Coverage

The testing suite validates all core functionality:

  • βœ… Project Creation: Tests all available templates from the repository
  • βœ… Migration Process: Validates user code preservation during template updates
  • βœ… Dependency Updates: Verifies version comparison and update mechanisms
  • βœ… Backward Compatibility: Ensures old command syntax continues to work
  • βœ… Error Handling: Tests graceful failure scenarios and edge cases
  • βœ… CLI Interface: Validates help, version, and interactive prompts

Test Environment

  • Isolation: Tests run in dedicated .temp/ directory (gitignored)
  • Cleanup: Automatic cleanup after test completion
  • Safety: No impact on existing projects or global state
  • Speed: Bash-based tests with zero additional dependencies

Enhanced Reliability

Recent architectural improvements provide:

  • πŸ”’ Robust Error Handling: Consistent error patterns across all operations
  • πŸ§ͺ Comprehensive Testing: E2E validation ensures stability
  • πŸ—οΈ Modular Architecture: Clean, maintainable codebase
  • πŸ”„ Backward Compatibility: All existing workflows preserved and tested

πŸ“š Template System

🌐 Remote Template Management

Boilerbuilder uses a centralized template system:

πŸ”§ Template Structure

Each template follows this structure:

templates/
└── template-name/
    β”œβ”€β”€ package.json      # Dependencies and scripts
    β”œβ”€β”€ src/             # Source code
    β”œβ”€β”€ public/          # Static assets
    └── ...              # Template-specific files

πŸ“ Adding New Templates

To add a new template to the system:

  • Create template folder in the boilerplates repository
  • Add template name to templates.js
  • Ensure package.json includes proper keywords for detection
  • Test template creation and migration

❓ Troubleshooting

Common Issues

1. Template Download Fails

NΓ£o foi possΓ­vel buscar os templates:
  • Solution: Check internet connection and GitHub repository access
  • Fallback: Uses default react-spa-vite template

2. Migration Issues

Erro ao migrar o projeto:
  • Solution: Ensure write permissions in project directory
  • Check: Verify src/ and public/ directories exist

3. Dependency Update Issues

Erro ao atualizar dependΓͺncias:
  • Solution: Run command from project root directory
  • Verify: Ensure package.json exists and is valid JSON

4. Template Download Issues

Erro ao baixar o template [template-name] : [error details]
  • Solution: Check Git installation and network connectivity
  • Alternative: Verify GitHub repository accessibility

5. Update Command Not Finding Project Type

Tipo de projeto nΓ£o encontrado.
  • Solution: Add the template name to your package.json keywords
  • Example: Add "keywords": ["react-spa-vite"] to your package.json
  • Note: The first keyword should match one of the available templates

πŸ’‘ Best Practices

  • Always backup your project before migration
  • Test in development environment first
  • Review changes before confirming updates
  • Keep templates updated by running commands regularly
  • Use version control to track changes

🀝 Contributing

We welcome contributions to Boilerbuilder! Here's how you can help:

πŸ› Reporting Issues

  • Check existing issues on GitHub
  • Provide detailed reproduction steps
  • Include system information (Node.js version, OS)
  • Share relevant error messages

πŸ”§ Development Contributions

  • Fork the repository
  • Create a feature branch: git checkout -b feature/amazing-feature
  • Make your changes following the existing code style
  • Test your changes thoroughly
  • Commit your changes: git commit -m 'Add amazing feature'
  • Push to the branch: git push origin feature/amazing-feature
  • Open a Pull Request

πŸ“ Documentation

Help improve documentation by:

  • Adding usage examples
  • Fixing typos or unclear explanations
  • Translating to other languages
  • Creating video tutorials

πŸ“ƒ License

Boilerbuilder is released under the ISC License. See the LICENSE file for more details.

πŸ’¬ Support

If you have questions, issues, or feature requests:

Happy coding with Boilerbuilder! πŸŽ‰
BIIRRRLLLL!!! πŸ’ͺ

Made with ❀️ by Gabriel Mule

FAQs

Package last updated on 07 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.