zouhir / jarvis

A very intelligent browser based Webpack dashboard
5.44k stars 191 forks source link

Feature: add section for linter output #51

Open m4r1vs opened 6 years ago

m4r1vs commented 6 years ago

I think many people would love having the output of a linter such as eslint and/or stylelint in the dashboard. I know it is already implemented fairly good into text editors but I would still love this feature. I will try making a PR soon but if there are any other ideas that are related to this please let me know!

Maybe it doesn't have to be a linter only but rather having the option to specify something like

new Jarvis({
    customCommands: [
        "eslint src --fix",
        "jest test"
    ]
})

And those command then each run on after build via require('child_process').exec and their output gets shown in individual tabs/sections in Jarvis.

m4r1vs commented 6 years ago

Probably having the output of the commands in seperate tabs of the section that displays webpack output would be the best idea since it already looks like a terminal output.

Sunshine168 commented 6 years ago

i think set tabs of the section that displays is a good idea. Provider custom tabs name in option like

new Jarvis({
    customCommands: [
       {name:"eslint ...", cmd:"eslint src --fix",reservedOptions} 
       { name:"test", cmd:"jest test",reservedOptions}
    ],
})

will be funny ?

m4r1vs commented 6 years ago

@Sunshine168 oh yeah that's a good idea to have a specified name, I thought of maybe somehow getting it from the running command but I don't think it's possible

zouhir commented 6 years ago

Great idea!!! 😻😻😻 But actually we don't need to do that in options. Would you consider something like:

// Loop through a projects npm scripts
Object.keys(pkg['scripts']).forEach(K => 

// K = start, test, lint, etc..

// Make a button in the dashboard

// On button click execute PKG[scripts][K in child process
})

I think thatd be RAD!!!

m4r1vs commented 6 years ago

Oh yeah totally forgot that we already have UI where we can do such things in. Maybe also add option save which then saves the current open commands in something like .jarvisrc?

Sunshine168 commented 6 years ago

oh yeah , Supporting config such as saving or auto-run scripts in ui is useful

zouhir commented 6 years ago

I'm excited for this y'all!