定制 jamesclark32/dev-audit 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

jamesclark32/dev-audit

Composer 安装命令:

composer require jamesclark32/dev-audit

包简介

Quickly run a set of CLI commands and summarize their outcome

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provides a Laravel console command to quickly run a set of CLI commands and summarize their outcome.

Dev Audit is intended to encapsulate a series of audits regularly run together as part of a development process, such as a pre-merge routine.

The package ships with an opinionated set of default audits based upon the author's workflow but is easily modified to suit yours instead.

Out of the box, Dev Audit runs:

  • Tests (phpunit)
  • Static Analysis (phpstan)
  • Lint check against changed PHP files (pint)
  • Lint check against changed javascript files (prettier)
  • Composer audit
  • Npm audit

Note that this includes phpstan and prettier which require separate installation and configuration in a Laravel project.

Once installed, Dev Audit can be run at any time using artisan dev:audit.

Under the hood, Dev Audit executes the commands from the configuration via an instance of Symfony/Process and serves as a UI wrapper to summarize the results while removing feedback clutter.

Typical output looks something like this:

img.png

Linters

This package also contains a command, dev:lint to run linters. You can run this command at any time you choose. You can also run the linters as part of the audit by adding the --lint flag thusly: php artisan dev:audit --lint.

If you always want the linters to run as part of the audit process, you can get control this by setting settings.always_lint to true in the dev-audit configuration file.

Installation

To get started, you need only to install the package via composer:

It is recommended to only require the package for development.

composer require --dev jamesclark32/dev-audit

Once installed, Dev Audit can be run at any time using artisan dev:audit.

Configuration

To adjust the audits to be run, simply publish and modify the config file.

You can publish the config file to config/dev-audit.php with:

php artisan vendor:publish --tag="dev-audit-config"

The config files contains the details of the audits to run. Audits can be added, removed, modified, or have their order adjusted.

Any new audits need only a title for display purposes and the command to run.

failure_hint content is optional, but provides the opportunity to display commands needed for likely next steps in the case of a failure.

The default audit configuration looks like this, requiring a few third-party packages:

return [
    'settings' => [
        'always_lint' => false,
    ],
    'audits' => [
        [
            'title' => 'Tests',
            'command' => './vendor/bin/pest',
        ],
        [
            'title' => 'Test coverage',
            'command' => './vendor/bin/pest --coverage --min=80',
        ],
        [
            'title' => 'Type coverage',
            'command' => './vendor/bin/pest --type-coverage --min=100',
        ],
        [
            'title' => 'PHPStan type check',
            'command' => './vendor/bin/phpstan analyze -v --memory-limit=-1',
        ],
        [
            'title' => 'Pint PHP linting (dirty files only)',
            'command' => './vendor/bin/pint --dirty --test',
        ],
        [
            'title' => 'Prettier JS linting (dirty files only)',
            'command' => 'npm run format:check:dirty',
            'failure_hint' => 'Run "npm run format:check:dirty',
        ],
        [
            'title' => 'Peck typo check',
            'command' => './vendor/bin/peck',
        ],
        [
            'title' => 'Rector code quality',
            'command' => './vendor/bin/rector --dry-run',
        ],
        [
            'title' => 'Composer Audit',
            'command' => 'composer audit',
        ],
        [
            'title' => 'NPM Audit',
            'command' => 'npm audit',
        ],
    ],
    'linters' => [
        [
            'title' => 'Pint (dirty files only)',
            'command' => './vendor/bin/pint --dirty',
        ],
        [
            'title' => 'Rector',
            'command' => './vendor/bin/rector',
        ],
        [
            'title' => 'Prettier (dirty files only)',
            'command' => 'npm run format:dirty',
        ],
        [
            'title' => 'ESX',
            'command' => 'npm run lint',
        ],
    ],
];

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

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

jamesclark32/dev-audit 适用场景与选型建议

jamesclark32/dev-audit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.05k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 08 月 25 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「JamesClark32」 「dev-audit」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 jamesclark32/dev-audit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 jamesclark32/dev-audit 我们能提供哪些服务?
定制开发 / 二次开发

基于 jamesclark32/dev-audit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-25