tbusser / jscc

This is the website for the JavaScript Compatibility Checker
http://jscc.info
88 stars 17 forks source link

Node Module #2

Open andrewrota opened 9 years ago

andrewrota commented 9 years ago

Very cool! What about creating a version of these checks as a standalone node module? That way it could be easily integrated into code sniffs or other static analysis tools.

azu commented 9 years ago

:+1:

hugooliveirad commented 9 years ago

:+1:

d-simon commented 9 years ago

:+1:

atticoos commented 9 years ago

:+1: would love to integrate into build tasks

elijahmanor commented 9 years ago

:+1:

tbusser commented 9 years ago

I agree, this would useful to have as a standalone module which can be integrated into something else. I have no experience in making Node modules but I think I should be able to create a Grunt plug-in. Would be something you're interested in?

doot0 commented 9 years ago

No doubt a grunt plugin would be conducive to a port to a node module. Plus - grunt plugin! All for it.

atticoos commented 9 years ago

Grunt plugin would be fantastic. If you're able create a grunt plugin, if you create a separate file that you can require into that grunt plugin, you should be easily able to turn that dependency into a standalone module

mroderick commented 9 years ago

I believe the recommended way to create grunt plugins, is to make them wrappers around node modules. If no one else has time to look at this in the next couple of days, I can look into it later this week.

atticoos commented 9 years ago

Yep yep ^^, should just be an interface/wrapper to your node module, so node module first, grunt plugin second. Really should be :cake:

tbusser commented 9 years ago

Okay, so Node it is. Any suggestions as to what would make a good repository name? Perhaps node-jscc?

d-simon commented 9 years ago

I think it would be preferable to have a library that works in the browser as well. Using something similar to this pattern perhaps

 if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
    module.exports = jscc;
 } else {
    window.jscc = jscc;
 }
bl4de commented 9 years ago

:+1:

Also module for Gulp would be nice :)

tbusser commented 9 years ago

@d-simon Everything is already wrapped in a UMD pattern, so that is covered. I've refactored the way the compatibility data is loaded so it will be easier to have the data come from either an URL or the file system. I think a Node module should be possible without a huge effort.

tbusser commented 9 years ago

I have a basic Node.js version available of the JSCC. It can consume a glob, loads the compatibility data and analyses the files matching the glob. I have no previous experience in building Node modules so I am sure there is room for improvement.

I also haven't build anything that reports the findings as I am not sure what would be the best way to go about it (write it to the console, put something in a file, etc). All ideas are more than welcome.

I am going to publish the code that I have to a new repository, I would appreciate if you can give feedback and suggestions for the Node.js version on the new repository.

andrewrota commented 9 years ago

@tbusser, cool, thanks for putting this together! Logging to the console with stdout would probably be the most helpful for the output (since it can be piped into anything), though a separate option for writing to a file might be a feature to add after (JSON format maybe?).

tbusser commented 9 years ago

@andrewrota Thanks! Logging to the console it will be for now. Expect an update soon. The repository for the Node.js version is up and can be found here.

codylindley commented 9 years ago

:+1:

Gulp would be nice!

arroo commented 8 years ago

here is a version made for gulp: https://github.com/mozesmagyar/gulp-browser-compat