## 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
Initialize a Project:
hidev init vendor/package-name
This generates a minimal hidev.yml and composer.json.
First Use Case:
hidev default
Updates all config files (.gitignore, README.md, etc.) based on your hidev.yml.
hidev.yml: Main configuration file (auto-generated via hidev init).composer.json: Generated with package metadata.hiqdev/hidev-php for PHP projects).hidev.yml with your package details (vendor, authors, etc.).hiqdev/hidev-php for PHP-specific automation.hidev default to sync files.hidev fix, hidev test, or hidev bump for common tasks.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).
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).Template Generation:
Use Twig templates to generate files (e.g., README.md, .travis.yml). Store templates in a plugin or project directory.
Add a Plugin:
plugins:
hiqdev/hidev-php: {}
hiqdev/hidev-travis: {}
Install via Composer:
composer require hiqdev/hidev-php
Custom Plugins:
Extend hiqdev/hidev by creating a plugin with:
goals.yml).templates/README.md.twig).hiqdev/hidev-hiqdev and customize.Plugin Goals: Plugins define reusable goals. Example:
goals:
my-plugin:
- action: copy
from: templates/.gitignore
to: .gitignore
Version Management:
hidev bump [major|minor|patch]
hidev release # Publishes to GitHub
CI/CD Integration:
Generate .travis.yml or .scrutinizer.yml via:
plugins:
hiqdev/hidev-travis: {}
Then run:
hidev default # Updates CI configs
Code Quality:
hidev fix # Runs PHP-CS-Fixer
hidev test # Runs PHPUnit/Codeception
PHAR Building:
hidev build # Combines `fix` + `test` + PHAR generation
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
Artisan Integration:
Extend hidev.yml to include Laravel-specific goals:
goals:
migrate:
- action: artisan
command: migrate
Run with:
hidev migrate
Template Customization:
Override default templates (e.g., resources/views/vendor/hidev/templates/README.md.twig) for Laravel-specific README.md.
Plugin Conflicts:
hidev version.hidev dump/internals
This shows loaded plugins and configs.Permission Issues:
sudo for file writes (e.g., .gitignore):
hidev default --sudo
hidev.yml:
sudo: true
Template Overrides:
templates/).Version Bumping:
hidev bump uses chkipper for version management. Ensure your composer.json has a valid version field.composer.json and config/version.php.Git Hooks:
hiqdev/hidev-git or manually configure hooks in .git/hooks/.Verbose Output:
hidev default -vvv
Shows detailed logs for debugging.
Dump Internals:
hidev dump/internals
Lists loaded plugins, configs, and goals.
Dry Runs:
Use --dry-run to preview changes without executing:
hidev fix --dry-run
Config Validation:
Validate hidev.yml with:
hidev validate
(If available in your version.)
Local Overrides:
Use hidev.yml.local for environment-specific configs (e.g., local paths):
# hidev.yml.local
paths:
runtime: /tmp/hidev-runtime
Custom Goals:
Define reusable goals in hidev.yml:
goals:
deploy:
- action: run
command: php artisan deploy
- action: github/release
Run with:
hidev deploy
PHAR Customization:
Override PHAR templates in templates/phar/ to customize the build process.
Laravel Mix/Gulp: Integrate with Laravel Mix by adding a goal:
goals:
assets:
- action: run
command: npm run dev
CI/CD Triggers:
Use hidev in CI pipelines (e.g., Travis) for automated releases:
# .travis.yml
script:
- hidev build
- hidev release
Environment Files:
HiDev doesn’t generate .env. Use a custom template or plugin:
goals:
env:
- action: copy
from: templates/laravel/.env
to: .env
Artisan Commands:
Ensure hidev has access to Laravel’s artisan binary. Add to hidev.yml:
paths:
artisan: vendor/bin/artisan
Package Auto-Loading:
For Laravel packages, ensure hidev.yml includes:
package:
type: laravel-package
extra:
include_path: src
Testing:
Use hidev test with Laravel’s test runner:
plugins:
hiqdev/hidev-phpunit:
test_command: php artisan test
Custom Plugins:
hiqdev/hidev by creating a plugin with:
goals.yml: Define new goals.templates/: Add Twig templates.src/: Custom PHP logic (if needed).Template Inheritance:
Override plugin templates by placing files in your project’s templates/ directory with the same path structure.
Goal Composition: Combine goals for complex workflows:
goals:
full-build
How can I help you explore Laravel packages today?