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

Gulp-shell is blacklisted. Needs to be replaced with gulp-exec or npm child_process #35

Open
iris-i opened this issue Nov 17, 2017 · 0 comments

Comments

@iris-i
Copy link

iris-i commented Nov 17, 2017

The npm library being used to start the PL server & export files has been blacklisted for using anti-patterns:
Blacklist: https://github.com/gulpjs/plugins/blob/master/src/blackList.json
Issue: sun-zheng-an/gulp-shell#55

Fwiw the author doesn't agree with this:
gulpjs/gulp#1353
sun-zheng-an/gulp-shell#82

I am testing this to replace the task, but my gulpfile is outside of the PL directory. Will submit a PR once I fine-tune how it works and change it to work from within the PL directory:

gulp.task('start-server', function() {
  var options = {
    continueOnError: false, // default = false, true means don't emit error event
    pipeStdout: false, // default = false, true means stdout is written to file.contents
  };
  var reportOptions = {
    err: true, // default = true, false means don't write err
    stderr: true, // default = true, false means don't write stderr
    stdout: true // default = true, false means don't write stdout
  };
  return gulp.src('./design-library')
    .pipe(exec('cd <%= file.path %> && php core/console --server --with-watch', options))
    .pipe(exec.reporter(reportOptions));
});

I got this from the gulp-exec readme and I'm still trying to figure out how to log the patternlab console messages that tell you that the server has been started and the localhost url to open.
Gulp docs: https://github.com/gulpjs/gulp/blob/4.0/docs/recipes/running-shell-commands.md
Gulp exec docs: https://github.com/robrich/gulp-exec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant