Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add brunch support #239

Merged
merged 4 commits into from
Dec 12, 2016
Merged

Add brunch support #239

merged 4 commits into from
Dec 12, 2016

Conversation

ptondereau
Copy link
Contributor

@ptondereau ptondereau commented Dec 8, 2016

Q A
Branch master for features and deprecations
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Documented? yes
Fixed tickets ~

My PR add support of js building tools Brunch which become more and more popular (such as Gulp and Grunt)

New Task Checklist:

  • Is the README.md file updated?
  • Are the dependencies added to the composer.json suggestions?
  • Is the doc/tasks.md file updated?
  • Are the task parameters documented?
  • Is the task registered in the tasks.yml file?
  • Does the task contains phpspec tests?
  • Is the configuration having logical allowed types?
  • Does the task run in the correct context?
  • Is the run() method readable?
  • Is the run() method using the configuration correctly?
  • Are all CI services returning green?

@veewee veewee added this to the Version 0.10.2 milestone Dec 9, 2016
Copy link
Contributor

@veewee veewee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @ptondereau,
Thanks for this PR, I did not know about brunchyet.
There are some small remarks that need to be fixed before we can merge this one in.

Can you take a look at them?


*Default: null*

If your `brunch-config.js file is located at an exotic location, you can specify your custom gulp file location with this option.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line contains "custom gulp file" which is a copy/paste from the gulp task?

tasks:
brunch:
brunch_file: ~
task: ~
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default configured task is 'build'.


**task**

*Default: null*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default configured task is 'build'.

}

$arguments = $this->processBuilder->createArgumentsForCommand('brunch');
$arguments->addOptionalArgument('%s', $config['task']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the task option should be required? Otherwise if the task is empty, the path will be added at the position of the task name which will result in an error.

@ptondereau
Copy link
Contributor Author

ptondereau commented Dec 9, 2016

@veewee thank you for your feedback, I'll fix all of this plus add some more advanced parameters this weekend.

@ptondereau
Copy link
Contributor Author

@veewee good to me

Copy link
Contributor

@veewee veewee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. I've added 2 small comments. Can you take a look at them before I merge this one in?

task: build
env: production
jobs: 4
debug: false
triggered_by: [js, jsx, coffee, ts, less, sass, scss]
```

**brunch_file**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brunch_file section is removed from the task.
Is there a reason why it is removed or can it be re-added?
If no, then this section in the documentation should be removed.

Copy link
Contributor Author

@ptondereau ptondereau Dec 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brunch_file doesn't exist anymore since 2.0, i'll remove it.

$arguments->addOptionalArgument('%s', $config['task']);
$arguments->addOptionalArgument('%s', $config['brunch_file']);
$arguments->addRequiredArgument('%s', $config['task']);
$arguments->addOptionalArgument('--env %s', $config['env']);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will result in the escaped CLI argument '--env production', shouldn't this be 2 separate arguments like this: '--env' 'production'?
If so, you could use the $arguments->addOptionalArgumentWithSeparatedValue() method.

Copy link
Contributor Author

@ptondereau ptondereau Dec 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should result to $ brunch build --env production --> --env 'production'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I guess you should use addOptionalArgumentWithSeparatedValue() instead.

@ptondereau
Copy link
Contributor Author

@veewee another check please

@veewee
Copy link
Contributor

veewee commented Dec 12, 2016

It looks good, thanks!

@veewee veewee merged commit b12e95a into phpro:master Dec 12, 2016
@ptondereau ptondereau deleted the brunch-task branch December 12, 2016 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants