RetireJS/grunt-retire

Executing all tasks (both js and node) seems to fail

karthik-rangarajan opened this issue · 3 comments

When running retire with both node and js tasks, the second task does not seem to work correctly. Below is the configuration file:

    retire:  
      node: ['.']
      js: [['build/js/app/*.js']
      options:
        verbose: true
        packageOnly: true
        jsRepository: 'https://raw.github.com/bekk/retire.js/master/repository/jsrepository.json'
        nodeRepository: 'https://raw.github.com/bekk/retire.js/master/repository/npmrepository.json'

Here's the check for JavaScript alone:

$ grunt retire:js
Running "retire:js" (retire) task
Ignoring []
Loading from cache: https://raw.github.com/bekk/retire.js/master/repository/jsrepository.json
Reading /tmp/.retire-cache/1389063038801.json ...
>> build/js/lib/jquery-migrate.min.js
>> ↳ jquery-migrate 1.1.0 has known vulnerabilities: http://bugs.jquery.com/ticket/11290 http://research.insecurelabs.org/jquery/test/

Here's the check for Node:

 $ grunt retire:node
Running "retire:node" (retire) task
Ignoring []
Loading from cache: https://raw.github.com/bekk/retire.js/master/repository/npmrepository.json
Reading /tmp/.retire-cache/1389063038547.json ...
Checking: .
>> connect 2.7.11 has known vulnerabilities: https://nodesecurity.io/advisories/51d0d6abf196582611000001
 ↳ express 3.2.6
  ↳ connect 2.7.11

However, when run together, the Node check works, but the JavaScript check fails:

 $ grunt retire --force
Running "retire:node" (retire) task
Ignoring []
Loading from cache: https://raw.github.com/bekk/retire.js/master/repository/npmrepository.json
Reading /tmp/.retire-cache/1389063038547.json ...
Checking: .
>> connect 2.7.11 has known vulnerabilities: https://nodesecurity.io/advisories/51d0d6abf196582611000001
 ↳ express 3.2.6
  ↳ connect 2.7.11

Running "retire:js" (retire) task
Ignoring []
Loading from cache: https://raw.github.com/bekk/retire.js/master/repository/jsrepository.json
Reading /tmp/.retire-cache/1389063038801.json ...
Loading from cache: https://raw.github.com/bekk/retire.js/master/repository/jsrepository.json
Reading /tmp/.retire-cache/1389063038801.json ...
No vulnerabilities found.
Checking: build/js/lib/jquery-migrate.min.js

I'm not entirely sure what is happening here, but it looks like grunt.event.emit(this.target === 'node' ? 'retire-load-node' : 'retire-load-js'); is emitting whichever twice, for whichever task comes second. I'm not sure why this is (I am fairly new to the world of node.js and grunt), but if you need any more details, I'll be glad to provide it.

Thanks for reporting this. You have a double [ in your config. Not sure if it's related to the bug:

js: [['build/js/app/*.js']

Maybe that was just a typo when pasting it here on Github.

Ok, reproduced locally. Thanks

Thanks for fixing so quickly!