Open karthilxg opened 9 years ago
Grunt tasks cannot return anything, they just execute code (which may result in creating/deleting/modifying some files) and they may succeed or error. There is no consumable output, the task may just print something onto the console.
What exactly are you trying to achieve?
@mzgol I would like to export the check-dependencies report to a JSON file, I basically want to find what's the installed dependencies version in build environment, bower.json
has the list of expected versions, but sometimes upgrading the dependencies breaks some functionality (Ideally minor patches shouldn't break stuffs but that's not the case always), would like to know which patch version causes issue. (We would be updating the bower.json
to point to latest version always, so I don't want to refer to the exact version of dependency until if there's an issue.)
angular: installed: 1.4.7, expected: ~1.4.5
angular-animate: installed: 1.4.4, expected: 1.4.4
angular-bootstrap: installed: 0.13.4, expected: ~0.13.0
angular-bootstrap-datetimepicker: installed: 0.3.14, expected: ~0.3.14
angular-lodash: installed: 0.1.2, expected: ~0.1.2
angular-messages: installed: 1.4.7, expected: ~1.4.5
angular-mocks: installed: 1.4.7, expected: ~1.4.5
angular-resource: installed: 1.4.7, expected: ~1.4.5
angular-route: installed: 1.4.7, expected: ~1.4.5
angular-sanitize: installed: 1.4.7, expected: ~1.4.5
angular-scenario: installed: 1.4.7, expected: ~1.4.5
angular-spinner: installed: 0.6.2, expected: ~0.6.0
angular-touch: installed: 1.4.7, expected: ~1.4.5
angular-ui-notification: installed: 0.0.14, expected: ~0.0.11
angular-ui-router: installed: 0.2.15, expected: 0.2.15
angular-ui-select: installed: 0.13.1, expected: ~0.13.1
bootstrap-sass-official: installed: 3.3.5, expected: ~3.3.4
es5-shim: installed: 4.1.14, expected: ~4.1.14
font-awesome: installed: 4.4.0, expected: ~4.4.0
ionicons: installed: 2.0.1, expected: ~2.0.1
isteven-angular-multiselect: installed: 4.0.0, expected: ~4.0.0
jquery: installed: 2.1.4, expected: ~2.1.1
json-formatter: installed: 0.4.0, expected: ~0.4.0
ng-idle: installed: 1.1.0, expected: ~1.1.0
selectize: installed: 0.12.1, expected: ~0.12.1
tr-ng-grid: installed: 3.1.5, expected: ~3.1.5
angular-bootstrap-toggle-switch: installed: 0.5.5, expected: ~0.5.5
That seems like useful feature request, thanks! I think, though, that current output of the check-dependencies package is sub-optimal for that use case; the messages are just text & nothing structural.
How about changing the output of check-depedencies
from:
{
status: number, // 0 if successful, 1 otherwise
depsWereOk: boolean, // true if dependencies were already satisfied
log: array, // array of logged messages
error: array, // array of logged errors
}
to:
{
status: 1,
depsWereOk: false,
packages: {
// example content of this field:
angular: {
correct: true,
expected: '~1.4.5',
actual: '1.4.7',
},
'check-dependencies': {
correct: false,
expected: '~0.10.3',
actual: '0.10.2',
},
},
}
? What do you think? Alternatively it could be sth like:
{
status: 1,
depsWereOk: false,
packages: {
// example content of this field:
correct: {
angular: {
expected: '~1.4.5',
actual: '1.4.7',
},
},
incorrect: {
'check-dependencies': {
expected: '~0.10.3',
actual: '0.10.2',
},
},
},
}
@mzgol First of all thanks for taking time to consider about this request.
:+1: Your below output structure looks great to me!!
{
status: 1,
depsWereOk: false,
packages: {
// example content of this field:
angular: {
correct: true,
expected: '~1.4.5',
actual: '1.4.7',
},
'check-dependencies': {
correct: false,
expected: '~0.10.3',
actual: '0.10.2',
},
},
}
I won't get to it within the next week or two because of conferences so if no one submits PRs I'll get to it afterwards.
@mzgol I would like to create a
JSON
file once the dependencies check is completed, is there a way we can do using this plugin?In
check-dependencies
npm package the output object can be passed to the callback as per the doc.https://github.com/mzgol/check-dependencies#api