patrickarlt / acetate

A flexible, fast and easy to extend static site generator for Node
http://acetate.io
ISC License
20 stars 13 forks source link

acetate() no longer works (by default) with Gulp #57

Closed secretfader closed 8 years ago

secretfader commented 8 years ago

See https://github.com/nicholaswyoung/web/blob/master/gulpfile.js#L30-L36. Since acetate doesn't return a standard callback, Promise, or stream API, I had to do this in order to handle the async task of building.

Would you be open to a PR that would convert the current API into something more standard? Because as it is, it's hard for other tools to know when the build is finished.

secretfader commented 8 years ago

I hacked this together using a callback that is fired when the event build fires, but it would be nice to have a Promise or callback that could only resolve/fire once when the build is done.

gulp.task('build:pages', (done) => {
  acetate({
    config: 'config/acetate.js'
  }).on('build', () => {
    done();
  });
});
patrickarlt commented 8 years ago

@nicholaswyoung This should be fixed in 0.4.0 https://github.com/patrickarlt/acetate/releases/tag/v0.4.0. You should be able to do this:

gulp.task('build:pages', (done) => {
  acetate({
    config: 'config/acetate.js'
  }, (errors, warnings, status) => {
      done();
  });
});
secretfader commented 8 years ago

@patrickarlt So 0.4.0 shouldn't require the manual callback, like the one I wrote above?

patrickarlt commented 8 years ago

@nicholaswyoung You still need a callback. Like what I wrote above. https://github.com/gulpjs/gulp/blob/master/docs/API.md#async-task-support