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

Feature request: Wrapper of gulp command that reads gulpfile.wisp #1

Closed
ikeji opened this issue Jan 3, 2015 · 6 comments
Closed

Feature request: Wrapper of gulp command that reads gulpfile.wisp #1

ikeji opened this issue Jan 3, 2015 · 6 comments

Comments

@ikeji
Copy link

ikeji commented Jan 3, 2015

Can you add wrapper command that uses gulpfile.wisp instead of gulpfile.js?

@crteal
Copy link
Collaborator

crteal commented Jan 3, 2015

Such that you could write the example usage from the README as something like...

(let [wisp (requires "gulp-wisp")]
  (.task gulp
    "wisp"
    (fn []
      (.pipe
       (.pipe
         (.src gulp "./src/*.wisp")
         wisp)
       (.dest gulp "./lib")))))

in a file called gulpfile.wisp?

Would the new command exposed in gulp-wisp take the place of gulp in your workflow?

@ikeji
Copy link
Author

ikeji commented Jan 6, 2015

Yes, also you can define macro for it.

(defmacro deftask [name deps & body]
  `(gulp.task (name (quote ~name)) ~deps (fn [] ~@body)))

(defmacro --> [src & pipes]
  (reduce
    (fn [form operation]
      (cons '.pipe
            (cons form (list operation))))
    src
    pipes))

(deftask default []
  (-->
    (.src gulp "./src/*.wisp")
    (wisp)
    (.dest gulp "./lib")))

For coffeescript they had coffee-gulp script for that use case.
https://github.com/F1ow/coffee-gulp
(Now this module is obsolete because gulp supports coffeescript by default.)

@crteal
Copy link
Collaborator

crteal commented Jan 6, 2015

Thanks for the example! I'll see what I can do...

@crteal
Copy link
Collaborator

crteal commented Jan 16, 2015

It looks like things have changed substantially in the gulp ecosystem since coffee-gulp was authored. From my reading and debugging it appears that the simple approach from that module is now impossible given the gulp internals. To make a long story short Wisp needs to be added to node-interpret to get the behavior you requested (sans macros). I have opened a pull request that will hopefully make that happen sooner rather than later.

@ikeji
Copy link
Author

ikeji commented Jan 17, 2015

Thanks a lot!!!
That's best solution.

@crteal
Copy link
Collaborator

crteal commented Jan 18, 2015

I'm happy to help, thanks for the idea @ikeji!

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

2 participants