Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

"No path(s) provided" error when compiling #5

Closed
radius opened this Issue Feb 18, 2013 · 12 comments

Comments

Projects
None yet
3 participants

radius commented Feb 18, 2013

I'm using the example configuration, but when I try to compile w grunt, I get:
Warning: No path(s) provided for YUIDoc to scan. Use --force to continue

Browsing through the source, it seems that the options object (which contains the paths) is expected to be a sibling of the compile object, but in your example it is a child of compile.

However, when I move the options object up one level, everything compiles without errors, but the docs don't get generated. I attempted to debug the tasks/yuidoc.js file, and noticed that execution stops on line 61:
json = (new Y.YUIDoc(options)).run();

After that, nothing is executed.

My yuidoc generation works fine when using the command line generator

Here are the versions I'm using:

grunt-cli v0.1.6
grunt v0.4.0rc7
yuidoc 0.3.35
grunt-contrib-yuidoc@0.3.2

Hope that helps

Owner

tkellen commented Feb 18, 2013

Can you please try doing this with all the latest versions of Grunt/gruntplugins and see if the issue persists. The tests for this repo use the form from the example in the README and it works just fine.

radius commented Feb 18, 2013

I didn't realize my stuff was out of date. I installed it all like a day ago. I'll try again...

Owner

tkellen commented Feb 18, 2013

No worries, we just released 0.4 today!

radius commented Feb 18, 2013

I'm having the same problem, even after nuking everything and reinstalling. Here are the versions I have:

grunt-cli v0.1.6
grunt v0.4.0
grunt-contrib-yuidoc@0.4.0

my package.json devDependencies section:

"devDependencies": {
    "grunt": "~0.4.0",
    "grunt-contrib-yuidoc": "~0.4.0",
    "grunt-contrib-clean": "~0.4.0",
    "grunt-contrib-concat": "~0.1.2",
    "grunt-contrib-uglify": "~0.1.1",
    "grunt-contrib-qunit": "~0.1.1",
    "grunt-contrib-jshint": "~0.1.1",
    "grunt-contrib-watch": "~0.2.0"
  }

I run npm install and then run grunt and i get the same error. Any idea?

Owner

tkellen commented Feb 19, 2013

Can you post your config?

radius commented Feb 19, 2013

'use strict';
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    meta: {
      version: '0.1.0',
      banner: '/*! FancyProjectThing.js - v<%= meta.version %> - ' +
        '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
        '* http://FancyProjectThing.com/\n' +
        '* Copyright (c) <%= grunt.template.today("yyyy") %> ' +
        'FancyProjectThing; Licensed MIT */'
    },
    clean: {
      files: ['dist']
    },
    concat: {
      options: {
        banner: '<%= banner %>',
        stripBanners: true
      },
      dist: {
        src: ['src/FancyProjectThing.js','src/*'],
        dest: 'dist/FancyProjectThing.js'
      },
    },
    uglify: {
      options: {
        banner: '<%= banner %>'
      },
      dist: {
        src: '<%= concat.dist.dest %>',
        dest: 'dist/FancyProjectThing.min.js'
      },
    },
    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile']
      },
      src: {
        files: '<%= jshint.src.src %>',
        tasks: ['jshint:src', 'qunit']
      },
      test: {
        files: '<%= jshint.test.src %>',
        tasks: ['jshint:test', 'qunit']
      },
    },
    qunit: {
      all: ['tests/*.html']
    },
    jshint: {
        beforeconcat: ['src/*'],
        afterconcat: ['dist/FancyProjectThing.js'],
      options: {
        curly: true,
        eqeqeq: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        sub: true,
        undef: true,
        boss: true,
        eqnull: true,
        globals: {
            window: true,
            Handlebars: true,
            $: true,
            FancyProjectThing: true,
            FancyProjectThing: true
          }
      },
    },
    yuidoc: {
      pkg: grunt.file.readJSON('package.json'),
      compile: {
        name: '<%= pkg.name %>',
        description: '<%= pkg.description %>',
        version: '<%= pkg.version %>',
        url: '<%= pkg.homepage %>',
        options: {
          paths: ['src/*'],
          outdir: 'docs/',
          parseOnly: false
        },
      }
    }
  });


  // These plugins provide necessary tasks.
  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-qunit');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-yuidoc');

  // Default task.
  grunt.registerTask('default', ['jshint', 'qunit', 'clean', 'concat', 'uglify', 'yuidoc']);

};
Owner

tkellen commented Feb 19, 2013

paths: ['src/'] should fix it--can you give that a shot?

fluky commented Feb 19, 2013

I'm having the same issue. What I have discovered is that if I remove the "pkg: grunt.file.rea...." from the yuidoc config it works fine and generates doc, however the doc title is:

"API Docs for: json:package.json"

Owner

tkellen commented Feb 19, 2013

Ahh, I totally missed that. You need to load the package at the top level of your grunt config. Grunt is treating your pkg key like a target.

@tkellen tkellen closed this in 8a8152e Feb 19, 2013

fluky commented Feb 19, 2013

Yes, that makes it run, what about the junk in the YUIDoc title?

fluky commented Feb 19, 2013

In fact, now that look pkg.name is not working anywhere since I upgraded grub.

radius commented Feb 19, 2013

Thanks @tkellen, getting rid of the pkg line worked for me. Also, your suggestion to change src/* to src/ was also necessary to get it to work.

@ewl are you adding the pkg key inside your grunt config?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment