承接 esign/laravel-install-command 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

esign/laravel-install-command

最新稳定版本:1.2.0

Composer 安装命令:

composer require esign/laravel-install-command

包简介

Simplify stub publishing and effortlessly manage Composer and Node packages

README 文档

README

Latest Version on Packagist Total Downloads GitHub Actions

This package provides a simple way to publish stubs and install Composer and Node packages using a Laravel Command. This may be useful when creating packages that require stubs to be publish and require Composer and Node packages to be installed.

Installation

You can install the package via composer:

composer require esign/laravel-install-command

Usage

To make use of the InstallJob you may create a new command that extends the InstallCommand class. In this command you may specify the stubs to publish and the Composer and Node packages to install.

use Esign\InstallCommand\InstallCommand;
use Esign\InstallCommand\ValueObjects\AppendableFile;
use Esign\InstallCommand\ValueObjects\ComposerPackage;
use Esign\InstallCommand\ValueObjects\NodePackage;
use Esign\InstallCommand\ValueObjects\PublishableFile;

class MyInstallCommand extends InstallCommand
{
    protected $signature = 'my-install-command';
    protected $description = 'Publish my stubs and install my packages';

    protected function publishableFiles(): array
    {
        return [
            new PublishableFile(
                path: __DIR__ . '/../../stubs/my-stub.stub',
                target: base_path('my-stub.php'),
            ),
            new AppendableFile(
                path: __DIR__ . '/../../stubs/my-appendable-stub.stub',
                target: base_path('my-appendable-stub.php'),
            ),
            new AppendableFile(
                path: __DIR__ . '/../../stubs/my-appendable-stub.stub',
                target: base_path('my-appendable-stub.php'),
                search: 'insert-after-line-with-this-string',
            ),
        ];
    }

    protected function composerPackages(): array
    {
        return [
            new ComposerPackage(name: 'my/composer-package'),
            new ComposerPackage(name: 'my/specific-composer-package', version: '^1.0'),
            new ComposerPackage(name: 'my/dev-composer-package', dev: true),
        ];
    }

    protected function nodePackages(): array
    {
        return [
            new NodePackage(name: 'my/node-package'),
            new NodePackage(name: 'my/specific-node-package', version: '^1.0'),
            new NodePackage(name: 'my/dev-node-package', dev: true),
        ];
    }
}

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 500
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-21