Weave 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 License Laravel Package

hiqdev/hidev-license

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Install via Composer:

    composer require hiqdev/hidev-license
    

    Ensure you have HiDev installed as this is a plugin for it.

  2. Configure HiDev: Add the plugin to your hidev.json under the plugins section:

    {
        "plugins": {
            "hiqdev/license": {}
        }
    }
    
  3. First Use Case: Generate a license file for your project by running:

    hidev license:generate
    

    This will prompt you to select a license type (MIT, BSD, proprietary, etc.) and generate the corresponding LICENSE file.


Implementation Patterns

Workflows

  1. License Generation:

    • Use the license:generate command to create a LICENSE file with predefined templates (MIT, BSD, Apache, etc.).
    • Customize the generated file by passing additional arguments (e.g., --name="Your Name" or --year=2023).
  2. Integration with HiDev:

    • Leverage HiDev’s goal system to automate license generation as part of your project’s initialization or release workflow.
    • Example: Add a custom goal in hidev.json:
      {
          "goals": {
              "init": ["license:generate"]
          }
      }
      
      This ensures a license is generated whenever the init goal is run.
  3. Custom Templates:

    • Extend the package by adding custom license templates in the templates directory of your project.
    • Override default templates by placing them in config/license-templates/ (if using HiDev’s config system).
  4. CI/CD Pipeline:

    • Integrate the license:generate command into your CI pipeline (e.g., GitHub Actions) to ensure every new repository starts with a valid license.
    • Example GitHub Actions step:
      - name: Generate License
        run: vendor/bin/hidev license:generate --name="Your Company" --year=2023
      

Gotchas and Tips

Pitfalls

  1. HiDev Dependency:

    • This package only works with HiDev. Ensure HiDev is installed and configured before using this plugin.
    • If you encounter issues, verify HiDev’s installation with:
      hidev --version
      
  2. Template Overrides:

    • Custom templates in your project must follow the same structure as the default templates (e.g., MIT.txt). Mismatched structures may cause generation failures.
    • Debug template issues by checking the hidev license:generate --debug output.
  3. Outdated Package:

    • The last release was in 2017, so compatibility with newer HiDev versions (post-2017) is untested.
    • Monitor the HiDev compatibility matrix or fork the package to update dependencies.
  4. Configuration Quirks:

    • If using hidev-config, ensure the plugin is registered in the correct section (e.g., plugins or extensions). Older versions may require extension-config.

Debugging Tips

  1. Verbose Output: Use --debug or -v flags to diagnose issues:

    hidev license:generate --debug
    
  2. Check HiDev Logs: HiDev logs are stored in ~/.cache/hidev/logs/ (Linux/macOS) or %APPDATA%\hidev\logs (Windows). Inspect these for errors during generation.

  3. Template Validation: Validate custom templates by manually running:

    hidev license:generate --template="custom-license.txt"
    

Extension Points

  1. Custom License Types: Add new license templates by:

    • Placing .txt files in config/license-templates/ (or a custom path).
    • Updating hidev.json to reference the new template:
      {
          "license": {
              "templates": ["config/license-templates/custom-license.txt"]
          }
      }
      
  2. Dynamic Data Injection: Extend the license generation logic by overriding the LicenseGenerator class (if using HiDev’s plugin system). Example:

    // In a custom plugin
    public function generateLicense() {
        $licenseText = $this->renderTemplate('MIT.txt', [
            'year' => date('Y'),
            'name' => 'Custom Company',
        ]);
        file_put_contents('LICENSE', $licenseText);
    }
    
  3. Post-Generation Hooks: Use HiDev’s event system to run scripts after license generation (e.g., commit the file automatically):

    {
        "hooks": {
            "license:generate:after": ["git add LICENSE", "git commit -m 'Add LICENSE'"]
        }
    }
    
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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings