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

Example in README is confusing #4

Open
cvan opened this issue Aug 27, 2014 · 8 comments
Open

Example in README is confusing #4

cvan opened this issue Aug 27, 2014 · 8 comments

Comments

@cvan
Copy link
Contributor

cvan commented Aug 27, 2014

I don't follow the example in the README.

var gulp = require('duo-gulp');

Is there any other way to use this plugin without wrapping gulp?

var duo = Duo(root).entry(entry);

What is root and entry?

duo.run(fn);

What is fn?

@matthewmueller
Copy link
Contributor

Oh, it's using the Duo JS API: https://github.com/duojs/duo/blob/master/docs/api.md

Let me know if you're still confused. Feel free to open a PR making it more clear.

@zeke
Copy link

zeke commented Aug 28, 2014

I had the same thought: It would be nice if the README example used working code.

@cvan
Copy link
Contributor Author

cvan commented Aug 28, 2014

I spent quite some time looking through the code, the tests, and the Gulp API, and I'm still unclear what's the canonical way of calling duo with gulp whenever my .js file changes.

@cvan
Copy link
Contributor Author

cvan commented Aug 28, 2014

Ah, I found a fantastic example in the duo repo: https://github.com/duojs/duo/blob/master/examples/gulpfile/gulpfile.js

@matthewmueller
Copy link
Contributor

@cvan I need to make this more clear in the readme, but there are 2 different places gulp can be used:

  1. Duo can be integrated into your Gulp workflow, compiling JS and CSS files. The example you linked to shows that.
  2. Gulp plugins can also be used within Duo to support Stylus, SASS, coffeescript, etc. That is what this plugin is for.

Note that these can be used in unison.

@cvan
Copy link
Contributor Author

cvan commented Aug 29, 2014

@matthewmueller Understood, thanks.

I didn't understand that duo-gulp was meant to be used with transforms only. Since there are tests for everything non-JS, that makes sense to me now.

I ended up just requiring Duo directly. Instead of wrapping gulp, it'd be nice if there was a gulp-duo plugin that did the duo boilerplate code that I added to my gulpfile, including the file watching. Maybe I'll eventually make one.

Anyway, thanks for your help!

@matthewmueller
Copy link
Contributor

it'd be nice if there was a gulp-duo plugin that did the duo boilerplate code that I added to my gulpfile, including the file watching. Maybe I'll eventually make one.

+1!

@sergeyt
Copy link

sergeyt commented Oct 22, 2014

@matthewmueller, @cvan I just wrapped duo-gulp into gulp-duo with loading coffee, less, sass plugins . It could reduce mentioned duo boilerplate.

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

4 participants