sighjs / sigh

multi-process expressive build system for the web and node.js, built using baconjs observables
209 stars 12 forks source link

Improve gulp plugin adapters (many plugins don't work, many aren't supported). #16

Open unlight opened 8 years ago

unlight commented 8 years ago

gulp-eslint do empty output. Check example: https://www.npmjs.com/package/gulp-eslint In gulp I must use eslint.format(), but how to inject it to sigh file?

var eslint; // wrapped
var gEslint = require('gulp-eslint');

module.exports = function(pipelines) {
  pipelines['lint'] = [
    glob('src/*.js'),
    eslint(),
   // gEslint.format() // does not work
  ];
}

Some plugins cannot be injected because without gulp- prefix they are reserved words: gulp-if, gulp-switch, etc.

insidewhy commented 8 years ago

Good point, I will add gulpPluginName as an alternative, or maybe gulp.pluginName. Currently gulp plugins that export stream manipulators as subfields aren't supported but adding such support shouldn't be that difficult, you can raise a github issue for it if you want?

unlight commented 8 years ago

Some more info about gulp-plugins.

Some plugins are not following gulp-plugin name conventions. http://npmsearch.com/?q=keywords:gulpfriendly So it is not possible to inject it.

I made some research, and some gulp-plugins does not work. Some of them fails silently (does not output pipeline x complete: 0.023 seconds)

List of gulp plugins that works:
List of gulp plugins that does not work:
insidewhy commented 8 years ago

Thanks for the information.

unlight commented 8 years ago

most of my integration work with sigh will be aimed at jspm rather than browserify as I strongly believe jspm is the future.

That's sad. Browserify has a lot of useful plugins.

unlight commented 8 years ago

gulp-typescript doesnt work.

jmatsushita commented 8 years ago

gulp-rename: this adapts the streamed value to a differing path value, this wouldn't be compatible with sigh's adapter. It could be made to work though with a new feature to the gulp adapter code.

Could you elaborate on this? Also would renaming be supported by the built-in plugins or would that need to be done in a new plugin (I'll probably give that a shot to learn more)?

insidewhy commented 8 years ago

Ah it's because the way that gulp determines which output event relates to which input event is by checking the filenames... if a filename changes then it fails. However gulp allows you to attach your own metadata to each event (which well behaving plugins are supposed to pass through) which could be used instead. Should be a very simple fix, if you open a bug for it I can tackle it as soon as I'm back from holiday.

insidewhy commented 8 years ago

s/gulp determines/sigh determines/

insidewhy commented 8 years ago

Hm that's not it, not sure why it isn't working.