hiqdev/hidev-hiqdev
HiDev plugin that supplies HiQDev vendor configuration for HiDev automation/code generation. Includes vendor/company info, contacts, authors metadata, and default BSD-3-Clause licensing. Used by HiQDev packages and as a template for other vendors.
To leverage hiqdev/hidev-hiqdev in a Laravel project, follow these minimal steps:
Install the Package Add the package to your project via Composer:
composer require hiqdev/hidev-hiqdev
Understand the Purpose This package provides pre-configured vendor settings for HiDev (HiQDev’s automation tool), including:
Locate Key Files The primary configuration resides in:
vendor/hiqdev/hidev-hiqdev/src/config/goals.yml
(Defines HiQDev’s standardized settings for HiDev).First Use Case: Standardizing Vendor Metadata
If your Laravel project uses HiDev for scaffolding or needs consistent vendor configurations, copy the goals.yml to your project’s root (e.g., config/hidev/goals.yml) and customize it for your team’s needs.
HiDev-Based Scaffolding
goals.yml to include Laravel-specific metadata (e.g., laravel.com links, custom license files).Composer Script Hooks
Integrate the package’s configs into Laravel’s workflow via composer.json scripts:
"scripts": {
"post-install-cmd": [
"php vendor/bin/hidev generate:config --config=vendor/hiqdev/hidev-hiqdev/src/config/goals.yml"
]
}
Custom Configuration Overrides
Extend or replace the default goals.yml to fit Laravel’s conventions:
# Example: config/hidev/goals.yml
vendor:
name: "YourCompany"
company: "YourCompany Inc."
license: "MIT" # Override BSD-3-Clause if needed
authors:
- name: "John Doe"
email: "john@example.com"
github: "https://github.com/johndoe"
role: "Lead Developer"
PHPCS Integration
Leverage HiQDev’s PHPCS rules (defined in the package) by adding a php-cs-fixer.dist.php to your project:
<?php
return (new PhpCsFixer\Config())
->setRules(require __DIR__.'/vendor/hiqdev/hidev-hiqdev/src/config/php-cs-fixer.php');
Publish Configs
Create a custom Artisan command to publish the goals.yml to a Laravel-friendly location:
php artisan vendor:publish --provider="YourPackageServiceProvider" --tag="hidev-config"
Then, update config/app.php to include the published config.
License File Generation
Use the package’s license template to generate a LICENSE.md for your Laravel project:
php vendor/bin/hidev generate:license --output=LICENSE.md
HiDev Dependency
goals.yml and PHPCS configs to your project.Stale Maintenance
php-cs-fixer, symfony/yaml).Laravel Mismatch
PHPCS Configuration Quirks
--dry-run to identify issues:
vendor/bin/php-cs-fixer fix --dry-run --rules=@hiqdev
License Conflicts
license field in goals.yml or manually edit the generated LICENSE.md.HiDev Command Issues If HiDev commands fail, ensure:
hidev binary is installed globally or via Composer:
composer global require hiqdev/hidev
goals.yml path is correct (use absolute paths if needed).YAML Parsing Errors The package uses Symfony YAML 3.0. If your project uses an older version, update:
composer require symfony/yaml:^3.0
PHPCS Fixer Errors
If PHPCS fails with "unsupported fixers," update the config in php-cs-fixer.php to match your installed version:
return [
'rules' => [
'@HiQDev' => true,
// Override unsupported fixers (e.g., 'empty_return')
'empty_return' => false,
],
];
Custom Templates
Extend the package by creating a custom HiDev plugin that inherits from hidev-hiqdev:
# config/hidev/plugins.yml
plugins:
- hiqdev/hidev-hiqdev
- yourcompany/hidev-laravel
Dynamic Config Loading
Load the goals.yml dynamically in a Laravel service provider:
public function boot()
{
$config = Yaml::parse(file_get_contents(__DIR__.'/../../vendor/hiqdev/hidev-hiqdev/src/config/goals.yml'));
$this->app['config']->set('hidev', $config);
}
CI/CD Integration Use the package’s configs in GitHub Actions or Travis CI:
# .github/workflows/ci.yml
jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: vendor/bin/php-cs-fixer fix --rules=@hiqdev
How can I help you explore Laravel packages today?