neronmoon/scriptsdev

Composer 的 Scripts-dev 行为

安装次数: 1,145,280

依赖者: 33

建议者: 0

安全: 0

星标: 69

关注者: 3

分支: 5

公开问题: 1

类型:composer-plugin

v0.1.9 2020-12-16 08:02 UTC

This package is auto-updated.

Last update: 2024-09-16 15:46:35 UTC


README

就像 require-dev,但用于脚本

安装

只需运行 composer require neronmoon/scriptsdev --dev

使用方法

安装后,你可以在你的 composer.json 中添加额外的.scripts-dev 指令

...
"extra": {
    "scripts-dev": {
        "post-install-cmd": [
            "npm install --dev"
        ],
        "post-update-cmd": "php ./someCoolCommand.php",
        "test": "phpunit"
    },
}
...

过时用法

...
"scripts-dev": {
    "post-install-cmd": [
        "npm install --dev"
    ],
    "post-update-cmd": "php ./someCoolCommand.php"
}
...

已知问题

  • 使用此插件会在验证过程中产生轻微的警告。 composer validate 命令会显示类似以下的内容。
./composer.json is valid, but with a few warnings
See https://getcomposer.org.cn/doc/04-schema.md for details on the schema
Description for non-existent script "test" found in "scripts-descriptions"