Code Monkey home page Code Monkey logo

Comments (8)

Mikhus avatar Mikhus commented on August 19, 2024 1

My fault! I cloned but forgot to switch to a proper branch, so it was actually 3.9 :)
Taking this into work, thank you for contribution!

from gulp-help-doc.

Mikhus avatar Mikhus commented on August 19, 2024 1

Fixed in release v1.0.5

from gulp-help-doc.

Mikhus avatar Mikhus commented on August 19, 2024

Thanks, I will investigate this ASAP

from gulp-help-doc.

Mikhus avatar Mikhus commented on August 19, 2024

I see no problem with gulp4.

First of all, gulp v4 is unstable and is not released yet, but nevermind(I cloned their 4.0 branch for test).
Second, the code you provided is incorrect as far as gulp task requires it's name as first argument.
And third, when the code is correct everything works as expected.

In your case it would be

/**
 * Something
 * @task {sth}
 */
gulp.task('sth', function sth(done) {
    done();
});

/**
 * Prints this info.
 * @task {help}
 */
gulp.task('help', function help(done) {
    require('gulp-help-doc')(gulp);
    done();
});

from gulp-help-doc.

fracz avatar fracz commented on August 19, 2024

Thank you for your respone.

However, the Changelog says:

added single argument syntax for gulp.task which allows a named function to be used as the name of the task and task function.

So the syntax I had posted is valid and works for me.

I suppose you have gulp 3 installed globally and that is the reason of not understanding the new syntax. Try

npm rm -g gulp
npm install -g gulp-cli

(only the cli should be installed globally).

from gulp-help-doc.

Mikhus avatar Mikhus commented on August 19, 2024

I don't have any modules installed globally. I have my PATH refering local ./node_modules/.bin, so I never install globally anything.
Gulp v4 is not released, and the thing I cloned from their v4 branch throws an error:

Error: Task requires a name that is a string
    at Gulp.Orchestrator.add (/home/mikhus/Projects/test/node_modules/gulp/node_modules/orchestrator/index.js:41:10)
    at Object.<anonymous> (/home/mikhus/Projects/test/gulpfile.js:22:6)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Liftoff.handleArguments (/home/mikhus/Projects/test/node_modules/gulp/bin/gulp.js:116:3)

As you may see from a stack trace it is not global reference.

All kind regards,
Mike

from gulp-help-doc.

fracz avatar fracz commented on August 19, 2024

It's weird then. Can you please try installing the gulp v4 with npm install 'gulpjs/gulp.git#4.0' --save-dev?

from gulp-help-doc.

Mikhus avatar Mikhus commented on August 19, 2024

OK

from gulp-help-doc.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.