Skip to content

Simple grumphp task akin to the 'npm_script' task, but runs yarn instead

License

Notifications You must be signed in to change notification settings

JanDC/grumphp-yarn-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grumphp-yarn-task

Simple grumphp task akin to the 'npm_script' task, but runs yarn instead

Usage

Dependencies

yarn (obviously), has to be installed and available in $PATH.
Refer to https://yarnpkg.com/en/docs/install for the installation procedures.

Installation

To install the yarn task simply run
composer require jandc/grumphp-yarn-task
or
composer global require jandc/grumphp-yarn-task

depending on your grumphp location

You can register the task by adding it's extension:

# grumphp.yml
parameters:
    extensions:
        - YarnTask\Extension\Loader

Configuration

Usage is almost identical to npm_script:
(https://github.com/phpro/grumphp/blob/v0.15.0/doc/tasks/npm_script.md)

# grumphp.yml
parameters:
    tasks:
        yarn:
            script: lint
            options:
                - '--no-fix'
                - '--max-warnings=0'
            triggered_by: [js, jsx, coffee, ts, less, sass, scss]
            working_directory: ./
            is_run_task: false

Note the extra 'options' array which can be used to append extra parameters to your scripts