evilstreak / markdown-js

A Markdown parser for javascript
7.69k stars 863 forks source link

Adds support for Grunt to the project. #111

Closed eviltrout closed 10 years ago

eviltrout commented 10 years ago

This patch is the first of several I'd like to commit to the project to allow it to be more modular.

I'm hoping that we can split up markdown-js into separate files and build them on the command line. Users should eventually be able to choose the dialects they want included in the built file.

The first step, is to add support for Grunt.

Grunt can be used to run tasks on the command line such as builds, tests, removing debug assertions and all that great stuff. I have migrated the current tests and hinting over to Grunt, so you can now run:

$ npm install
$ grunt test

And it will run all the tests and linting. I have kept reverse compatibility with the old way of running the tests npm test, npm tap and npm lint, although they all run via Grunt to keep a singular code path.

My next step will be to split up the large markdown-js into multiple files, and have grunt assemble them.

Feedback appreciated!

ashb commented 10 years ago

Looks like Grunt doesn't support node 0.6 - I guess that's pretty old so we need to disable support for that in travis.yml.

What's the lodash requirement for? Doesn't look like it's needed in this commit.

Otherwise sure! Looks good.

eviltrout commented 10 years ago

I swear earlier while I was working on the commit lodash was required. I've removed it now and everything looks swell.

Sorry about that! Would have updated sooner but it was a long weekend in Canada. I hope to send a bunch more patches your way this week :)

eviltrout commented 10 years ago

That worked until I tried to rm my node_modules and install again. Apparently lodash is a requirement for grunt-node-tap and it isn't installed normally via npm install. I'm fairly new to npm, but is it normal to expect people who install a library to recursively go into the node_modules and npm install in there too?

Or should we just include lodash in the root as I did before?

eviltrout commented 10 years ago

Aha, I sorted it out with the grunt-node-tap developer. The dependency is removed:

https://github.com/maxnachlinger/grunt-node-tap/pull/2

ashb commented 10 years ago

Hmmm Travis is still marking this as failing - do we just need to update the version number dep on grunt-tap?

eviltrout commented 10 years ago

I'll take a peek later at the travis thing later today!

eviltrout commented 10 years ago

@ashb I just had to trigger a new build to get the fixed grunt-node-tap. It passes except in the old node now, which I believe is incompatible with grunt.

ashb commented 10 years ago

@eviltrout The versions of node we test against are in .travis.yml - just edit this and remove the version that Grunt doesn't support.

eviltrout commented 10 years ago

Duh, obviously I could have done that myself. I've removed it and Travis is all green now.

evilstreak commented 10 years ago

Thanks for this