-
-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Need a sanity check. The readme for grunt-verb says there is no configuration required. When I install and attempt to run the verb task without adding a config to my Gruntfile.js I get a "No verb targets found." response.
$ npm install grunt-verb --save-dev
$ grunt verb
...
> Running "verb" task
> [D] Task source: /Users/jd/Projects/4tr/node_modules/grunt-verb/tasks/verb.js
>> No "verb" targets found.
> Warning: Task "verb" failed. Use --force to continue.
The readme also says that I can use the Verb generator to kickstart the documentation for any project, so I tried that as well, but got the same result.
$ npm i -g generator-verb
$ npm install grunt-verb --save-dev
$ yo verb
> ? Project name? foo
> ? Description? Foo's description
> ? Author's name? John Smith
> ? Author's URL? https://github.com/jsmith
> ? GitHub username/org? jsmith
> create LICENSE-MIT
> create .verb.md
> create CONTRIBUTING.md
$ grunt verb --verbose --debug
...
Registering "grunt-verb" local Npm module tasks.
Reading /Users/jd/Projects/4tr/node_modules/grunt-verb/package.json...OK
Parsing /Users/jd/Projects/4tr/node_modules/grunt-verb/package.json...OK
Loading "verb.js" tasks...OK
+ verb
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK
Loading "Gruntfile.js" tasks...OK
+ build, changelog, cover, default, doc, integration, jsdocs, polish, readme, saveRevision, server, tagRevision, test, unit, verify, version, yuidocs
...
Running "verb" task
[D] Task source: /Users/jd/Projects/4tr/node_modules/grunt-verb/tasks/verb.js
>> No "verb" targets found.
Warning: Task "verb" failed. Use --force to continue.
I dug into grunt-verb task's code, and at the bottom it looks like the task's default config file is ".verbrc.md", but according to the output of yo verb it created ".verb.md".
// /node_modules/grunt-verb/tasks/verb.js
...
grunt.config('verb', {
readme: {
files: [
{src: ['.verbrc.md'], dest: 'README.md'},
{expand: true, cwd: 'docs', src: ['**/*.tmpl.md'], dest: '.', ext: '.md'},
]
}
});
...
So, I tried changing my .verb.md to .verbrc.md, thinking that the task might now find the correct init file. No joy though. I still get the "No verb targets found." response.
There are some grunt tasks (like grunt-build-number) that require an entry in the Gruntfile.js even when you don't alter the defaults. So, I tried adding a verb block....
// Gruntfile.js
verb: {
readme: {}
},
And running task again produces...
Registering "grunt-verb" local Npm module tasks.
Reading /Users/jd/Projects/4tr/node_modules/grunt-verb/package.json...OK
Parsing /Users/jd/Projects/4tr/node_modules/grunt-verb/package.json...OK
Loading "verb.js" tasks...OK
+ verb
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK
Loading "Gruntfile.js" tasks...OK
+ build, changelog, cover, default, doc, integration, jsdocs, polish, readme, saveRevision, server, tagRevision, test, unit, verify, version, yuidocs
Running "verb" task
[D] Task source: /Users/jd/Projects/4tr/node_modules/grunt-verb/tasks/verb.js
Running "verb:readme" (verb) task
[D] Task source: /Users/jd/Projects/4tr/node_modules/grunt-verb/tasks/verb.js
Verifying property verb.readme exists in config...OK
File: [no files]
Options: sep="\n", ext=".md", data=["docs/*.{json,yml}"], prefixBase, cwd="/Users/jd/Projects/4tr", destBase="/Users/jd/Projects/4tr", docs="docs"
Done, without errors.
This time around, the verb task was found, and it tried to run, but it didn't find any files in its default options, so I tried to set some up...
// Gruntfile.js
verb: {
readme: {
files:[
{
src: [ '.verbrc.md' ],
dest: 'README.md'
}
]
}
},
And now I get an error 'test/fixtures/comment.tmpl.md' not existing.
Running "verb:readme" (verb) task
[D] Task source: /Users/jd/Projects/4tr/node_modules/grunt-verb/tasks/verb.js
Verifying property verb.readme exists in config...OK
Files: .verbrc.md -> README.md
Options: sep="\n", ext=".md", data=["docs/*.{json,yml}"], prefixBase, cwd="/Users/jd/Projects/4tr", destBase="/Users/jd/Projects/4tr", docs="docs"
Reading .verbrc.md...OK
Warning: ENOENT, no such file or directory 'test/fixtures/comment.tmpl.md' Use --force to continue.
Aborted due to warnings.
I checked the verbrc.md and found no reference to 'test/fixtures/comment.tmpl.md', so I'm assuming that error was thrown from inside the verb module.
This is where I'm at now. Have I gone through the steps incorrectly?