Giter VIP home page Giter VIP logo

gulp-ngdocs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gulp-ngdocs's Issues

Problem with analytics

Hi, I'm using gulp-ngdocs to create the documentation for my project, but the analytics is not working.

This is my configuration

gulp.task('ngdocs', ['clean-ngdocs'], function () {
    var options = {
        html5Mode: false,
        analytics: {
            account: 'UA-44454147-3',
            domainName: 'http://hrajchert.github.io/angular-screenfull/'
        },
        scripts: [
            'dist/angular-screenfull.js',
            'https://cdnjs.cloudflare.com/ajax/libs/screenfull.js/2.0.0/screenfull.js'
        ]
    };
    return gulp.src(['./src/**/*.js', './src/**/*.ngdoc'])
        .pipe(gulpDocs.process(options))
        .pipe(gulp.dest(target.docs));
});

And this is the generated site.

As you can see the google analytics library is added but its not sending any data. Not sure if I'm doing something wrong or there is a problem with the library.

Thanks!

Working with gulp.watch

Hey @nikhilmodak ,

Great tool, thanks for this! I am trying to get this to work with a watch command, e.g.:

gulp.task('ngdocs', [], function () {
  var options = {
    html5Mode: false
  };
  var ngdocs = require('gulp-ngdocs');
  return gulp.src(['my/scripts/**/*.js'])
    .pipe(ngdocs.process(options))
    .pipe(gulp.dest('./ngdocs'))
    .on('error', function(err) {
      console.log('Error from ngdocs: ', err);
    });
});

gulp.task('serve:ngdocs', function(next) {
  var server = express();
  var port = argv.p || 9002;
  server.use(express.static('ngdocs')).listen(port, next);
  console.log('Docs being served at http://localhost:' + port);

  // this here:
  gulp.watch(dev.scripts.src, ['ngdocs']);
});

However the problem is that each time the ngdoc task above is run, things get double-added. So the first time it runs, everything is great (note that I have added a log statement here for illustration):

image

But on the next time ngdoc gets triggered by the watch, it has been doubled and there is an ng-repeat error:

image

I've been digging through your code for a good while (because I normally like to open pull requests, not issues) but I am pretty stumped. I am guessing that because require() in node caches the module, some state is being kept somewhere like an array of files that just gets added to rather than cleared on every call to processDoc.

Any suggestions?

Thanks!
Andy

TypeError: Cannot read property 'replace' of undefined

I'm getting this error in the browser's console when I visit the generated index.html after running gulp ngdocs.

TypeError: Cannot read property 'replace' of undefined
    at Fb (angular.js:10611)
    at Me.$get (angular.js:11421)
    at Object.e [as invoke] (angular.js:4203)
    at angular.js:4021
    at d (angular.js:4162)
    at Object.e [as invoke] (angular.js:4194)
    at angular.js:4021
    at d (angular.js:4162)
    at Object.e [as invoke] (angular.js:4194)
    at angular.js:6524angular.js:11655 (anonymous function)angular.js:8596 $getangular.js:6540 (anonymous function)angular.js:323 rangular.js:6522 (anonymous function)angular.js:4203 eangular.js:4056 (anonymous function)angular.js:4203 eangular.js:4021 (anonymous function)angular.js:4162 dangular.js:7855 xangular.js:7187 Xangular.js:7035 Sangular.js:7051 Sangular.js:7051 Sangular.js:7051 Sangular.js:7051 Sangular.js:7051 Sangular.js:6946 Dangular.js:1457 (anonymous function)angular.js:14466 $get.n.$evalangular.js:14565 $get.n.$applyangular.js:1455 (anonymous function)angular.js:4203 eangular.js:1453 dangular.js:1473 ucangular.js:1367 Jdangular.js:26304 (anonymous function)angular.js:2762 aangular.js:3032 c
angular.js:11655 TypeError: Cannot read property 'replace' of undefined
    at Fb (angular.js:10611)
    at Me.$get (angular.js:11421)
    at Object.e [as invoke] (angular.js:4203)
    at angular.js:4021
    at d (angular.js:4162)
    at Object.e [as invoke] (angular.js:4194)
    at $get.w.instance (angular.js:8493)
    at angular.js:7739
    at r (angular.js:331)
    at B (angular.js:7738)

Can't catch errors, gulp.watch just stops.

I tried using gulp-plumber and .on('error', function(err){}) with this.emit('end') and this.end() but nothing can stop errors throw when doc comments have formatting issues or incorrect tags.

Colon in event name

Prefix before colon is stripped out of the event name during ng-docs generation.

For example

/**
 * @ngdoc event
 * @name my-prefix:my-event
 * @eventOf myModule.controller:myController
 * @eventType broadcast
 */
$scope.$broadcast('my-prefix:my-event');

produces event called my-event instead of my-prefix:my-event.

Error to bootstrap module with animation block defined

When doing some live demo in the docs with a module which has defined an animation block, it's not able to instantiate the module.
i.e.
angular.module('test-module, []).animation('#animated-element', foo);

After debugging a bit the angular source code, it turns out that the $animateProvider doesn't have the register method it's expecting to have. If I use the code in a separated html with the exact same js (mines and the ones provided with ngdocs) it works fine.

I just forked the example repo of gulp-ngdocs and made a commit to demonstrate the issue:
https://github.com/ivogallego/gulp-ngdocs-example

Any clue on how to address this?

Thanks!

Document application stop when it failed to load modules

error occur in these lines:

  element.bind('$destroy', function() {
    deregisterEmbedRootScope();
    embedRootScope.$destroy();
  });

solution: I think we need to check undefined before execute function

element.bind('$destroy', function() {
  if(deregisterEmbedRootScope){
    deregisterEmbedRootScope()
  }

  if(embedRootScope){
    embedRootScope.$destroy();
  }
});

No docs folder gets created

var gulp = require('gulp');
gulp.task('ngdocs', [], function () {
  var gulpDocs = require('gulp-ngdocs');
  var options = {
     scripts: [
        './www/lib/ionic/js/angular/angular.min.js',
        './www/lib/ionic/js/angular/angular.min.js.map',
        './www/lib/ionic/js/angular-animate/angular-animate.min.js',
        './www/lib/ionic/js/angular-animate/angular-animate.min.js.map'
    ],
    html5Mode: false
  }
  return gulp.src('.www/app/directives.js')
    .pipe(gulpDocs.process(options))
    .pipe(gulp.dest('./docs'));
});

i run gulp ngdocs and it starts ngdocs and ends and nothing happens!

Working with Docstrap

Does Gulp-ngdocs supports Docstrap? I searched the documentation but i wasn't able to find anything. Thanks!

'error' is not emited

Having this task

gulp.task('docs', function(){
    return gulp.src( path.lib + '**/*.js' )
        .pipe( docs.process({}) )
        .pipe( gulp.dest( path.docs ) )
        .on('end', function(){
            gutil.log( gutil.colors.green( 'Rebuild docs successfully done.' ) );
            browserSync.reload();
        })
        .on('error', function( error ){
            gutil.log( gutil.colors.red( 'Rebuild docs failed.' ), error );
            gutil.beep();
            throw error;
        });
});

the error handler is no called when a error is found.
This is the output form the task above with an error

Z:\js-lib>gulp docs
[19:24:16] Using gulpfile Z:\js-lib\gulpfile.js
[19:24:16] Starting 'docs'...
[Error: Don't know how to format @ngdoc: module]
[19:24:16] Rebuild docs successfully done.
[19:24:16] Finished 'docs' after 100 ms

Twitter Bootstrap is very outdated, it uses v2.3.2, latest version is v3.3.2

This tool works great. But Bootstrap is very outdated. I also noticed the templates are as outdated as the Bootstrap version, since they use the old span# (span1, span2, span3, etc.) system.

Is there any way to replace or update the templates and the Bootstrap version the project uses? I can contribute with that.

M

TypeError: Cannot read property 'loadDefaults' of undefined

gulp.task('ngdocs', [], function () {
var gulpDocs = require('gulp-ngdocs');
return gulp.src('app/**/*.js')
.pipe(gulpDocs.process())
.pipe(gulp.dest('./ngdocs'));
});

TypeError: Cannot read property 'loadDefaults' of undefined
at Object.processDoc [as process] (C:\Users\odusek\IdeaProjects\iprace-front-end-angular\node_modules\gulp-ngdocs\index.js:95:12)
at Gulp.<anonymous> (C:\Users\odusek\IdeaProjects\iprace-front-end-angular\gulpfile.js:397:18)
at module.exports (C:\Users\odusek\IdeaProjects\iprace-front-end-angular\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:34:7)
at Gulp.Orchestrator._runTask (C:\Users\odusek\IdeaProjects\iprace-front-end-angular\node_modules\gulp\node_modules\orchestrator\index.js:273:3)
at Gulp.Orchestrator._runStep (C:\Users\odusek\IdeaProjects\iprace-front-end-angular\node_modules\gulp\node_modules\orchestrator\index.js:214:10)
at Gulp.Orchestrator.start (C:\Users\odusek\IdeaProjects\iprace-front-end-angular\node_modules\gulp\node_modules\orchestrator\index.js:134:8)
at C:\Users\odusek\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20
at process._tickCallback (node.js:442:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)

Error: undefined is not an object (evaluating 'b.replace')

This could be something very simple. Is it a safe assumption that this gulp task will work without a lot of configuration? I've literally just installed the npm module, added the gulp task, ran it, opened the docs/index file and saw the error.

My gulp task:

gulp.task('ngdocs', [], function () {
  var options = {
    /* pass both .min.js and .min.js.map files for angular and angular-animate */
    scripts: [
      'bower_components/angular/angular.min.js',
      'bower_components/angular/angular.min.js.map',
      'bower_components/angular-animate/angular-animate.min.js',
      'bower_components/angular-animate/angular-animate.min.js.map'
    ]
  };

  return gulp.src('app/**/*/js')
    .pipe(gulpDocs.process(options))
    .pipe(gulp.dest('./docs'));
});

This completes in less than ~200ms. I open the docs/index.html page and i see the following js error:

[Error] Error: undefined is not an object (evaluating 'b.replace')
Gb@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:93:502
file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:100:106
e@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:36:320
file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:38:116
d@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:36:14
e@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:36:284
file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:38:116
d@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:36:14
e@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:36:284
file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:47:399
s@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:7:306
file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:47:361
e@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:36:320
file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:34:304
e@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:36:320
file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:38:116
d@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:36:14
fb@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:63:417
W@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:53:196
ba@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:51:393
ba@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:52:57
ba@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:52:57
ba@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:52:57
ba@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:52:57
ba@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:52:57
F@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:49:666
file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:18:5
$eval@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:125:305
$apply@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:126:11
file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:17:571
e@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:36:320
d@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:17:406
tc@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:18:180
Jd@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:17:2
file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:249:430
a@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:163:400
c@file:///Users/bwigginton/Projects/exchange/docs/js/angular.min.js:32:393
    (anonymous function) (angular.min.js, line 102)
    (anonymous function) (angular.min.js, line 76)
    (anonymous function) (angular.min.js, line 48)
    s (angular.min.js, line 7)
    (anonymous function) (angular.min.js, line 47)
    e (angular.min.js, line 36)
    (anonymous function) (angular.min.js, line 34)
    e (angular.min.js, line 36)
    (anonymous function) (angular.min.js, line 38)
    d (angular.min.js, line 36)
    fb (angular.min.js, line 63)
    W (angular.min.js, line 53)
    ba (angular.min.js, line 51)
    ba (angular.min.js, line 52)
    ba (angular.min.js, line 52)
    ba (angular.min.js, line 52)
    ba (angular.min.js, line 52)
    ba (angular.min.js, line 52)
    F (angular.min.js, line 49)
    (anonymous function) (angular.min.js, line 18)
    $eval (angular.min.js, line 125)
    $apply (angular.min.js, line 126)
    (anonymous function) (angular.min.js, line 17)
    e (angular.min.js, line 36)
    d (angular.min.js, line 17)
    tc (angular.min.js, line 18)
    Jd (angular.min.js, line 17)
    (anonymous function) (angular.min.js, line 249)
    a (angular.min.js, line 163)
    c (angular.min.js, line 32)

Method name close breaks styles

Using method name close creates <div class="close"> in HTML code, that uses wrong styles from bootstrap div.close.

/**
 * @ngdoc method
 * @name close
 * @methodOf myModule.controller:myController
 * @description
 * Bla blabla
 */
$scope.close = function() {
    //...
}

sections() API is broken

Because the 'setup' variable is not initialized by the time sections() tries to reference it on line 62 of index.js.

Issues with own version of angular/angular animate + browserify

Because I am using browserify, I want to load in angular and angular animate via a built .js file. However, it gives an issue/conflict with the autoloaded angular and animate. Is there a way to disable the default loaded versions so I can self load it? I know if i remove it from the default index.html, my version kicks in and works totally fine.

I see that you are setting a default and it looks like iterating through the defaultScripts and checking if a similar script with a similar name is loaded.

If scripts are concatenated, however, it will assume its unloaded. I would suggest at this point just being able to turn off defaults or certain defaults.

Unrecoverable error

When I run ngdocs over a set of folders in my app, eventually I got to this error.
I GUESS it is because an annotation like

/**
 * @param {array|*} foo bar
 */

which I encountered before. But this error does not lead me at all to a file or line in the code where I should fix the invalid docblock.

/vagrant/xxx/node_modules/gulp-ngdocs/src/ngdoc.js:438
          self.type = match[1];
                           ^
TypeError: Cannot read property '1' of null
    at flush (/vagrant/xxx/node_modules/gulp-ngdocs/src/ngdoc.js:438:28)
    at /vagrant/xxx/node_modules/gulp-ngdocs/src/ngdoc.js:359:9
    at Array.forEach (native)
    at Object.Doc.parse (/vagrant/xxx/node_modules/gulp-ngdocs/src/ngdoc.js:355:31)
    at /vagrant/xxx/node_modules/gulp-ngdocs/src/reader.js:49:99
    at Array.forEach (native)
    at processJsFile (/vagrant/xxx/node_modules/gulp-ngdocs/src/reader.js:34:9)
    at Object.process (/vagrant/xxx/node_modules/gulp-ngdocs/src/reader.js:17:5)
    at DestroyableTransform.transformFunction [as _transform] (/vagrant/xxx/node_modules/gulp-ngdocs/index.js:208:14)
    at DestroyableTransform.Transform._read (/vagrant/xxx/node_modules/gulp-ngdocs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)

Doc sample does not work

The doc sample passing nothing to process method, throws an exception

TypeError: Cannot read property 'loadDefaults' of undefined

gulp.task('ngdocs', [], function () {
  var gulpDocs = require('gulp-ngdocs');
  return gulp.src('path/to/src/*.js')
    .pipe(gulpDocs.process())
    .pipe(gulp.dest('./docs'));
});

Bower paths are absolut

index.html

addTag('script', {src: 'js\C:\Users\myusername\Desktop\grunt-ngdocs-example\node_modules\gulp-ngdocs\bower_components\angular\angular.min.js'}, sync);

js/docs-setup.js

  "scripts": [
      "js\\C:\\Users\\xxx\\Desktop\\grunt-ngdocs-example\\node_modules\\gulp-ngdocs\\bower_components\\angular\\angular.min.js",
      "js\\C:\\Users\\xxx\\Desktop\\grunt-ngdocs-example\\node_modules\\gulp-ngdocs\\bower_components\\angular-animate\\angular-animate.min.js",
      "js\\C:\\Users\\xxx\\Desktop\\grunt-ngdocs-example\\node_modules\\gulp-ngdocs\\bower_components\\marked\\lib\\marked.js",
      "js\\C:\\Users\\xxx\\Desktop\\grunt-ngdocs-example\\node_modules\\gulp-ngdocs\\bower_components\\google-code-prettify\\src\\prettify.js"
    ],

Remove bower dependencies, or run bower install with allow-root

When node is running as a root user, the bower install command triggered by the install script is causing the following error :

bower ESUDO         Cannot be run with sudo
[...]
npm ERR! [email protected] install: `bower install`

Couldn't the actual bower dependencies be managed in package.json instead, or at least the bower install command launched with the --allow-root option?

Add ability to exclude css

It appears that it is hard coded to include bootstrap.min.css and font-awesome.css.
However, the project we are testing is UI components and pulling in bootstrap styles our elements in ways they aren't actually styled. We also have our own version of font-awesome we use and would like to use that instead. We are going to hack it to remove the style tags with javascript for the time being.

Fails to copy necessary scripts if opts.scripts.length > 9

I've been debugging this one for a while and can't seem to find any reason this would happen, so I thought I'd see if it makes any sense to you since you're much more familiar with the code.

I'm trying to add a bunch of scripts so that my examples will run, and it seems that if the array of scripts I pass can have up to 9 scripts, but as soon as I pass the tenth (doesn't seem to matter which scripts) it copies all my scripts over but begins to fail copying over angular-bootstrap.js, docs.js, and prettify.js for some reason.

Any idea what's going on?

TypeError: Cannot read property 'length' of undefined

Hello,

after generation of documentation with

// Documentation
gulp.task('docs', [], function () {
var gulpDocs = require('gulp-ngdocs');
var options = {
html5Mode: true,
title: "jayBee"
};
return gulp.src('./src/js/*.js')
.pipe(gulpDocs.process(options))
.pipe(gulp.dest('./dist/docs'));
});

I get the following errors inside the "app":

TypeError: Cannot read property 'length' of undefined
at Object.sections.getPage (docs.js:204)
at Object.docsPathWatchAction as fn
at l.$digest (angular.min.js:124)
at l.$apply (angular.min.js:126)
at angular.min.js:17
at Object.e as invoke
at d (angular.min.js:17)
at sc (angular.min.js:18)
at Jd (angular.min.js:16)
at angular.min.js:249

Does not work with angular 1.3

I can't get the simplest example that uses a ng-click and ng-show to work. If we don't override the scripts it pulls in angular 1.3.4 which doesn't work. We also overrode the scripts to use angular 1.3.0 and it still doesn't work.

The weird thing is that if you view the example in plunker using the button in the docs, it works.

Here's a project we used to reproduce the issue:
https://github.com/caseyhoward/ngdocs-angular-1.3

Add a view source

Similar to what Angular has, a view source that takes you to the point the doc was made

Add typescript support

I have typescript files with the same type of comment block with annotations as my javascript files, however they aren't being include in the documentation. There are also no errors. My gulpfile code looks something like this:

  gulpDocs.sections({
    api: {
      glob: ['src/**/*.js', 'src/**/*.ts'],
      ...
    },
    ...
  })
  .pipe(gulpDocs.process(options))
  .pipe(gulp.dest(projectPath('public/docs')));

Attempting to add jQuery causes build to fail

We're attempting to include jQuery as one of the app dependencies to have the advanced selectors jQuery provides, that jqLite does not. However, when I tried to add jQuery to the list of scripts, I discovered that jQuery was included AFTER the default Angular scripts. To resolve this, I simply used the scripts array to override the Angular version, as well as properly order the dependencies to ensure that jQuery was injected first.

scripts: [
    './bower_components/jquery/dist/jquery.min.js',
    './bower_components/jquery/dist/jquery.min.map',
    './bower_components/angular/angular.min.js',
    './bower_components/angular/angular.min.js.map',
    './bower_components/angular-animate/angular-animate.min.js',
    './bower_components/angular-animate/angular-animate.min.js.map'
    ... additional scripts included as well ...
]

The above array fails when attempting to build the docs. NOTE: I have tried both the minified version, with and without the source map, as well as the un-minified versions of all the libraries.

If I remove the jQuery lines, then the docs will build properly, with the exception of JS errors thrown due to the missing selector methods (.siblings() to be exact).

Is there any other preferred method of including jQuery into the docs application?

Thanks in advance.

@ngdoc filter and others

Hi, I'm trying to add a filter to the doc. I've tried a lot a different syntax with no success. Here is my code:

/**
 * @ngdoc filter
 * @name myModule.filter:thousandSeparator
 * @function
 * @description
 * Add a space as a thousand separator to a string, every 3 char. Start from the end.
 *
 *
 * @param {String} string
 * String to parse
 * @returns {String} parsed input string
 */

I also notice in the generated pages that there are other properties of the main module I can't populate:

{  
    "name"          : "myModule",
    "url"           : "#/api/myModule",
    "globals"       : [  ],      //this one
    "controllers"   : [  ],
    "directives"    : [  ],
    "services"      : [  ],
    "others"        : [  ],
    "types"         : [  ],      //this one
    "filters"       : [  ]       //and this one
}

Can someone tell me how to access it ?

ECONNREFUSED Request to https://bower.herokuapp.com/packages/angular failed: connect ECONNREFUSED

The request to install bower-angular is breaking my builds because it's attempting to access a resource outside of our allowed list of domains. Please include angular in the package.json file instead.

npm install angular

bower angular#~1.3.1 ECONNREFUSED Request to https://bower.herokuapp.com/packages/angular failed: connect ECONNREFUSED
npm ERR! [email protected] install: bower install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the gulp-ngdocs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install
npm ERR! You can get their info via:
npm ERR! npm owner ls gulp-ngdocs
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32-504.3.3.el6.x86_64
npm ERR! command "/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/grunt_bower_karma_yo/bin/node" "/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/grunt_bower_karma_yo/bin/npm" "install"
npm ERR! cwd /opt/jenkins_jobs/hal-secondaryFlow-RELEASE/workspace
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE

TypeError: Cannot read property 'replace' of undefined

This error is thrown without any details, it's hard to find out where the problem is in large projects with many files.

[TypeError: Cannot read property 'replace' of undefined]
events.js:85
      throw er; // Unhandled 'error' event
            ^
TypeError: Cannot read property 'replace' of undefined
    at C:\Users\odusek\IdeaProjects\ideapoly2_fe\node_modules\gulp-ngdocs\index.js:218:26
    at Array.forEach (native)
    at DestroyableTransform.flushFunction [as _flush] (C:\Users\odusek\IdeaProjects\ideapoly2_fe\node_modules\gulp-ngdocs\index.js:216:21)
    at DestroyableTransform.<anonymous> (C:\Users\odusek\IdeaProjects\ideapoly2_fe\node_modules\gulp-ngdocs\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:135:12)
    at DestroyableTransform.g (events.js:199:16)
    at DestroyableTransform.emit (events.js:129:20)
    at finishMaybe (C:\Users\odusek\IdeaProjects\ideapoly2_fe\node_modules\gulp-ngdocs\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:371:12)
    at endWritable (C:\Users\odusek\IdeaProjects\ideapoly2_fe\node_modules\gulp-ngdocs\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:378:3)
    at DestroyableTransform.Writable.end (C:\Users\odusek\IdeaProjects\ideapoly2_fe\node_modules\gulp-ngdocs\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:356:5)
    at DestroyableTransform.onend (C:\Users\odusek\IdeaProjects\ideapoly2_fe\node_modules\gulp\node_modules\vinyl-fs\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:523:10)

This one was caused by missing @name annotation in @ndgoc overview section.

Error on running ngdocs

I try to set my gulpfile in this way

gulp.task('ngdocs', [], function () {
  return gulp.src('./src/**/*.js')
    .pipe(gulpDocs.process({}))
    .pipe(gulp.dest('./docs2'));
});

and after opening docs2/index.html on the console log I get this error.
error

TypeError: Cannot read property 'replace' of undefined
    at Gb (angular.js:10564)
    at Me.$get (angular.js:11374)
    at Object.e [as invoke] (angular.js:4185)
    at angular.js:4003
    at d (angular.js:4144)
    at Object.e [as invoke] (angular.js:4176)
    at angular.js:4003
    at d (angular.js:4144)
    at Object.e [as invoke] (angular.js:4176)
    at angular.js:6485

Lack of support for multiple files in multiple directories.

I have multiple files:

myapplication/js/controllers/samplecontroller.js
myapplication/js/directives/sampledirective.js
myapplication/js/main.js
myapplication/js/app.js

I notice gulp-ngdocs can only read from one directory, and does not pick up any of the documentation in the subdirectories from js (i.e. controllers, directives).

My gulp task is:

gulp.task('ngdocs', [], function () {
  var gulpDocs = require('gulp-ngdocs');
  var options = {
    scripts: ['./controllers/*.js','./directives/*.js'], // this looks completely ignored
    startPage: '/api',
    title: "Awesome Docs",
    titleLink: "/api"
  }  
  return gulp.src('myapplication/js/*.js')
    .pipe(gulpDocs.process(options))
    .pipe(gulp.dest('./docs'));
});

How can I add partials file to index.html

I m trying to generate docs in my ionic project.its generate docs file one index.html and partials/api inside partials file.How can I add my partials html to index.html ?

"bower: command not found"

Linking the issue I opened with the NPM team for reference: link

When gulp-ngdocs gets installed side-by-side bower, bower is not installed in the node_modules of the gulp-ngdocs and the install script breaks.

Could the install script be removed and the needed files vendored in the repo instead?

Note: this is what grunt-ngdocs does.

Stream doesn't get closed (and defaultScript aren't pushed)

Setup

  • I start the gulp task with no configuration, just gulpDocs.process() in which I pipe one js-file into it.
  • I cloned the https://github.com/m7r/grunt-ngdocs-example repo and replaced the grunt task with the gulp tasks.

Problem

  • The task never closes and I have to cancel the task with ctrl+c.
  • The partials/api/myfile.html and js/docs-setup.js are here, but all the defaultScripts and CSS are not in the docs folder.

Findings

My finding from debugging the task are:

  • In the transformFunction, docsStream.push pushes all the defaultScripts and CSS
  • In the transformFunction, the merged.on(.. calls docsStreamEndCb(null)

throw new TypeError('must start with number, buffer, array or string');

Hi:
Just trying to use gulp-ngdocs, here is my gulp task

gulp.task('newdocs', [], function () {
  var gulpDocs = require('gulp-ngdocs');
  return gulp.src('./**/src/*.js')
    .pipe(gulpDocs.process())
    .pipe(gulp.dest('./newdocs'));
});

and I got,

...
buffer.js:67
    throw new TypeError('must start with number, buffer, array or string');
          ^
TypeError: must start with number, buffer, array or string
    at new Buffer (buffer.js:67:11)
    at writeSetup (/Users/marksu/work/bitbucket/chatboxOpenfind/mailcloudchat/client/common/node_modules/gulp-ngdocs/index.js:158:17)
...

Please hint, thanks.

Add more collaborators

Hi @nikhilmodak,

First off, thanks for the great project; it has been very beneficial for the project I am working on and I am sure others benefit greatly as well.

Having said that, it appears that you are relatively inactive on github and as a result, issues and PRs go unaddressed for sometimes weeks at a time. I would like to offer my help in sharing the burden of management on this library (merging pull requests, answering questions), especially since now I have had a chance to dig in to the code base and write a test, etc.

The open-source community would benefit quite a bit if you allowed people like myself to become collaborators.

Regards,
Andy

update npm repository

@nikhilmodak, I'd like to update the npm repository with the latest version (0.2.11). Can you do this or give me write access to the npm repo?

Typo breaks @link

In the ngdoc.js line 1271 is a small typo - instead of options.html5mode it should be options.html5Mode. This typo leads to a warning, if I try to add link to another document.

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.