Back to Moon

Scripts

website/docs/__partials__/migrate/php/scripts.mdx

2.2.4824 B
Original Source

The PHP ecosystem has standardized (somewhat) around Composer scripts for reusability. While these work, they're not as efficient as moon. They do not support granular inputs, smart hashing, incremental caching, and all the other performance benefits that moon provides.

With that being said, you do not have to migrate away from Composer. Instead, you can simply run these scripts from within moon tasks. This gives you the best of both worlds.

yaml
language: 'php'

tasks:
  test:
    command: 'php composer.phar run-script test'
    inputs:
      - '@globs(sources)'
      - '@globs(tests)'
      - 'composer.json'

In the future, we aim to infer these scripts automatically, and provide migration scripts.