Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Hidev Laravel Package

hiqdev/hidev

View on GitHub
Deep Wiki
Context7
## Getting Started

### Minimal Setup
1. **Installation**:
   ```bash
   composer global require hiqdev/hidev

Or via PHAR:

wget http://hiqdev.com/hidev/hidev.phar
chmod +x hidev.phar
  1. Initialize a Project:

    hidev init vendor/package-name
    

    This generates a minimal hidev.yml and composer.json.

  2. First Use Case:

    hidev default
    

    Updates all config files (.gitignore, README.md, etc.) based on your hidev.yml.


Key Files

  • hidev.yml: Main configuration file (auto-generated via hidev init).
  • composer.json: Generated with package metadata.
  • Plugins: Extend functionality (e.g., hiqdev/hidev-php for PHP projects).

Quick Workflow

  1. Configure hidev.yml with your package details (vendor, authors, etc.).
  2. Use plugins like hiqdev/hidev-php for PHP-specific automation.
  3. Run hidev default to sync files.
  4. Use goals like hidev fix, hidev test, or hidev bump for common tasks.

Implementation Patterns

Core Workflow

  1. Configuration-Driven: Define goals (e.g., fix, test, bump) in hidev.yml or plugins. Example:

    plugins:
        hiqdev/hidev-php: {}
    

    This enables PHP-specific goals (hidev fix, hidev test).

  2. Goal-Based Execution:

    hidev goal/action
    
    • hidev fix: Runs PHP-CS-Fixer.
    • hidev test: Executes PHPUnit/Codeception.
    • hidev bump: Increments version (e.g., hidev bump patch).
  3. Template Generation: Use Twig templates to generate files (e.g., README.md, .travis.yml). Store templates in a plugin or project directory.


Plugin Integration

  1. Add a Plugin:

    plugins:
        hiqdev/hidev-php: {}
        hiqdev/hidev-travis: {}
    

    Install via Composer:

    composer require hiqdev/hidev-php
    
  2. Custom Plugins: Extend hiqdev/hidev by creating a plugin with:

    • YAML configs (e.g., goals.yml).
    • Twig templates (e.g., templates/README.md.twig).
    • Example: Fork hiqdev/hidev-hiqdev and customize.
  3. Plugin Goals: Plugins define reusable goals. Example:

    goals:
        my-plugin:
            - action: copy
              from: templates/.gitignore
              to: .gitignore
    

Common Patterns

  1. Version Management:

    hidev bump [major|minor|patch]
    hidev release  # Publishes to GitHub
    
  2. CI/CD Integration: Generate .travis.yml or .scrutinizer.yml via:

    plugins:
        hiqdev/hidev-travis: {}
    

    Then run:

    hidev default  # Updates CI configs
    
  3. Code Quality:

    hidev fix      # Runs PHP-CS-Fixer
    hidev test     # Runs PHPUnit/Codeception
    
  4. PHAR Building:

    hidev build    # Combines `fix` + `test` + PHAR generation
    

Laravel-Specific Tips

  1. Laravel Project Setup: Use the hiqdev/hidev-laravel plugin (if available) or configure hidev.yml for Laravel:

    plugins:
        hiqdev/hidev-php: {}
    goals:
        laravel:
            - action: copy
              from: templates/laravel/.env.example
              to: .env.example
    
  2. Artisan Integration: Extend hidev.yml to include Laravel-specific goals:

    goals:
        migrate:
            - action: artisan
              command: migrate
    

    Run with:

    hidev migrate
    
  3. Template Customization: Override default templates (e.g., resources/views/vendor/hidev/templates/README.md.twig) for Laravel-specific README.md.


Gotchas and Tips

Common Pitfalls

  1. Plugin Conflicts:

    • Ensure plugins are compatible with your hidev version.
    • Debug conflicts by running:
      hidev dump/internals
      
      This shows loaded plugins and configs.
  2. Permission Issues:

    • Use sudo for file writes (e.g., .gitignore):
      hidev default --sudo
      
    • Or configure hidev.yml:
      sudo: true
      
  3. Template Overrides:

    • Custom templates in your project must be in the correct directory (e.g., templates/).
    • Priority: Project templates > Plugin templates > Core templates.
  4. Version Bumping:

    • hidev bump uses chkipper for version management. Ensure your composer.json has a valid version field.
    • For Laravel, sync versions with composer.json and config/version.php.
  5. Git Hooks:

    • HiDev doesn’t manage Git hooks directly. Use plugins like hiqdev/hidev-git or manually configure hooks in .git/hooks/.

Debugging Tips

  1. Verbose Output:

    hidev default -vvv
    

    Shows detailed logs for debugging.

  2. Dump Internals:

    hidev dump/internals
    

    Lists loaded plugins, configs, and goals.

  3. Dry Runs: Use --dry-run to preview changes without executing:

    hidev fix --dry-run
    
  4. Config Validation: Validate hidev.yml with:

    hidev validate
    

    (If available in your version.)


Advanced Tips

  1. Local Overrides: Use hidev.yml.local for environment-specific configs (e.g., local paths):

    # hidev.yml.local
    paths:
        runtime: /tmp/hidev-runtime
    
  2. Custom Goals: Define reusable goals in hidev.yml:

    goals:
        deploy:
            - action: run
              command: php artisan deploy
            - action: github/release
    

    Run with:

    hidev deploy
    
  3. PHAR Customization: Override PHAR templates in templates/phar/ to customize the build process.

  4. Laravel Mix/Gulp: Integrate with Laravel Mix by adding a goal:

    goals:
        assets:
            - action: run
              command: npm run dev
    
  5. CI/CD Triggers: Use hidev in CI pipelines (e.g., Travis) for automated releases:

    # .travis.yml
    script:
        - hidev build
        - hidev release
    

Laravel-Specific Gotchas

  1. Environment Files: HiDev doesn’t generate .env. Use a custom template or plugin:

    goals:
        env:
            - action: copy
              from: templates/laravel/.env
              to: .env
    
  2. Artisan Commands: Ensure hidev has access to Laravel’s artisan binary. Add to hidev.yml:

    paths:
        artisan: vendor/bin/artisan
    
  3. Package Auto-Loading: For Laravel packages, ensure hidev.yml includes:

    package:
        type: laravel-package
        extra:
            include_path: src
    
  4. Testing: Use hidev test with Laravel’s test runner:

    plugins:
        hiqdev/hidev-phpunit:
            test_command: php artisan test
    

Extension Points

  1. Custom Plugins:

    • Extend hiqdev/hidev by creating a plugin with:
      • goals.yml: Define new goals.
      • templates/: Add Twig templates.
      • src/: Custom PHP logic (if needed).
    • Publish to Packagist for reuse.
  2. Template Inheritance: Override plugin templates by placing files in your project’s templates/ directory with the same path structure.

  3. Goal Composition: Combine goals for complex workflows:

    goals:
        full-build
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky