less/less.js — pull request #1431 by jonschlinkert (2013-07-18 21:31:00+00:00)
Title: Refactored build to use Grunt.js

@lukeapage, @matthew-dean, @SomMeri (related to: https://github.com/less/less.js/issues/1260)

here it is :-)

I expect a few corrections will need to be made. I tried to get this done during my 2-yr olds nap earlier :-) Please look over the build stuff and the README for typos, errors etc. It would be good to pull this down and try to run the tasks to ensure that they work (besides some tests since they aren't finished, a couple of them are commented out). fact-check the instructions to make sure everything is described correctly, etc.

@lukeapage your feedback is especially important, let me know if it doesn't build the way you want it to. I don't have any attachment to anything I did, so we can change whatever needs to change. Also it's possible that I missed details in the Makefile, like do we need to reflect "-beta", "-wip", or "-alpha" etc in the header comments of Less.js? I can implement anything I missed or whatever you think would improve this.

**However**... any edits to the README should happen in [build/README.md](https://github.com/less/less.js/build/README.md), a template for generating the readme. It pulls metadata from the Gruntfile and package.json to keep common details in README up-to-date and in sync with the package.json, like for version number and copyright date, etc.

#### other stuff

* as you look through the changes, please don't be polite, be practical. if you see something that can be improved or explained better let me know or just change it and push it up. One thing that would help is if you could try to write down things that don't make sense immediately, or something I did that seem unintuitive or less-than-idiomatic. It's really hard to remember or notice these things later, so it's important to try to think of them now.
* browser tests need to be done (thanks @SomMeri!)
* linting: I recommend we start linting the code with jshint. The task is already setup if it's okay with @lukeapage to start using it, and if so Luke you can just configure the options in `.jshintrc` to your tastes. And while you're doing heavy lifting on other changes, if you want me to start doing some minor cleanup to get it passing I don't mind doing it at all. I can just put up a pull request for your review.
* Last, I suggest we organize the `./tests/**` dir: I suggest we reorganize it into a pattern something like this:

```
./test/
fixtures/
node/
*.less files, and other node.js-specific fixtures
browser/
*.less files, and other browser-specific fixtures
common/
expected/
node/
*.css files, and other node.js-specific files
browser/
*.css files, and other browser-specific files
```

The "fixtures" and "expected" dirs are the main thing I'm suggesting. Then the output of any tests would go to `./tmp/results`, which is ignored in `.gitignore` and `.npmignore`. This way we can use grunt-contrib-nodeunit (or whatever) to compare the `./tmp/results` to `./test/expected`, IMO this is preferable to committing all of those "results" files and using diffs to find differences.