Permalink
Browse files

completely refactor, update docs

  • Loading branch information...
1 parent f8f20f2 commit c79cba61ee9d252d3212fc1c422f0f71ed2f57be @jonschlinkert jonschlinkert committed Jul 30, 2013
Showing with 899 additions and 635 deletions.
  1. +5 −3 .gitignore
  2. +1 −2 .jshintrc
  3. +1 −1 .npmignore
  4. +1 −1 .travis.yml
  5. +2 −0 AUTHORS
  6. +12 −31 CHANGELOG
  7. +1 −0 CONTRIBUTING.md
  8. +183 −36 Gruntfile.js
  9. +1 −1 LICENSE-MIT
  10. +132 −341 README.md
  11. +2 −6 ROADMAP
  12. +47 −0 docs/less-examples.md
  13. +179 −0 docs/less-options.md
  14. +1 −0 docs/less-overview.md
  15. +12 −52 package.json
  16. +55 −0 tasks/assets/README.tmpl.md
  17. +83 −0 tasks/docs.js
  18. +144 −161 tasks/less.js
  19. +34 −0 tasks/lib/comment.js
  20. +3 −0 vendor/bootstrap/less/mixins.less
View
@@ -1,8 +1,10 @@
+experimental
node_modules
+npm-debug.log
test/css
test/themes
-tmp
temp
+tmp
TODO.md
-
-*.sublime*
+vendor
+*.sublime-*
View
@@ -9,6 +9,5 @@
"undef": true,
"boss": true,
"eqnull": true,
- "node": true,
- "es5": true
+ "node": true
}
View
@@ -4,5 +4,5 @@ test
temp
tmp
TODO.md
-
+vendor
*.sublime-*
View
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "0.8"
+ - "0.10"
before_script:
- npm install -g grunt-cli
- - npm install grunt
View
@@ -0,0 +1,2 @@
+Jon Schlinkert (https://github.com/jonschlinkert/)
+Brian Woodward (https://github.com/doowb/)
View
@@ -1,44 +1,25 @@
+v0.5.0:
+ date: "2013-07-30"
+ changes:
+ - Completely refactored the plugin based on grunt-contrib-less.
+ - Add examples for all features to Gruntfile.
+ - Removed the concat feature.
+ - You can now use `.lessrc` or `.lessrc.yml` for externalizing task options.
+ - New `stripBanners` option
v0.4.7:
date: "2013-06-13"
changes:
- Cleaned up a lot of the Gruntfile. Examples are more clear.
- - New "import" option for prepending import statements to compiled less files.
- - New "banner" option for adding banners to generated CSS files.
-v0.4.5:
- date: "2013-04-28"
- changes:
- - Fixes #7, for processing templates. thanks to @gtoniser for pointing it out.
- - Renamed "lib" option to "library" for clarity.
- - Improved logging.
-v0.4.4:
- date: "2013-04-24"
- changes:
- - Breaking change. Renamed "require" option to "globals".
- - New "lib" option.
+ - New `import` option for prepending import statements to LESS files before compiling.
+ - New `banner` option for adding banners to generated CSS files.
v0.3.0:
date: "2013-03-17"
changes:
- - Adds new option to specify the version of less.js to use for compiling to CSS.
+ - New option to specify the version of less.js to use for compiling to CSS.
v0.2.3:
date: "2013-03-14"
changes:
- - adds new options from Less.js 1.4.0
-v0.2.0:
- date: "2013-03-09"
- changes:
- - in bootstrap.json, changed the path to bootstrap folder, new globals object.
- - new targets for single component, bootstrap.less lib, ignore pattern.
-v0.1.7:
- date: "2013-03-08"
- changes:
- - Enhanced boostrap.json model.
- - Many task improvements.
- - Greatly improved examples, readme updates.
-v0.1.2:
- date: "2013-02-27"
- changes:
- - Add support for requires option.
- - Add support for concat option
+ - New options from Less.js 1.4.0
v0.1.0:
date: "2013-02-27"
changes:
View
@@ -0,0 +1 @@
+Please see the [Contributing to Assemble](http://assemble.io/contributing) guide for information on contributing to this project.
View
@@ -1,62 +1,209 @@
/*
+ * Based on grunt-contrib-less
+ * http://gruntjs.com/
+ * Copyright (c) 2013 Tyler Kellen, contributors
+ *
* assemble-less
- * http://github.com/assemble
- * Copyright (c) 2013 Assemble
- * MIT License
+ * http://github.com/assemble/assemble-less
+ * Copyright (c) 2013 Jon Schlinkert, contributors
+ * Licensed under the MIT license.
*/
-module.exports = function(grunt) {
+'use strict';
- 'use strict';
+module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+ jshint: {
+ all: [
+ 'Gruntfile.js',
+ 'tasks/*.js',
+ '<%= nodeunit.tests %>'
+ ],
+ options: {
+ jshintrc: '.jshintrc'
+ }
+ },
+
+ // Metadata
+ meta: {
+ license: '<%= _.pluck(pkg.licenses, "type").join(", ") %>',
+ copyright: 'Copyright (c) <%= grunt.template.today("yyyy") %>',
+ banner:
+ '/* \n' +
+ ' * <%= pkg.name %> v<%= pkg.version %> \n' +
+ ' * http://assemble.io \n' +
+ ' * \n' +
+ ' * <%= meta.copyright %>, <%= pkg.author.name %> \n' +
+ ' * Licensed under the <%= meta.license %> License. \n' +
+ ' * \n' +
+ ' */ \n\n'
+ },
+ // Configuration to be run (and then tested).
less: {
- options: {
- paths: 'vendor/bootstrap/less',
- imports: {
- less: ['mixins.less', 'variables.less']
+ bootstrap: {
+ src: 'vendor/bootstrap/less/bootstrap.less',
+ dest: 'tmp/actual/css/bootstrap.css'
+ },
+ alerts: {
+ options: {
+ lessrc: '.lessrc'
+ },
+ src: 'vendor/bootstrap/less/alerts.less',
+ dest: 'tmp/actual/css/alerts.css'
+ },
+ components: {
+ options: {
+ lessrc: '.lessrc.yml'
+ },
+ files: [{
+ expand: true,
+ cwd: 'vendor/bootstrap/less',
+ src: ['*.less', '!{bootstrap,variables,mixins}.less'],
+ dest: 'tmp/actual/css/components/',
+ ext: '.css'
+ }
+ ]
+ },
+ lodash: {
+ options: {process: true},
+ files: {
+ 'tmp/actual/lodash.css': ['test/fixtures/lodash.less']
}
},
- bootstrap: {
- src: 'vendor/bootstrap/less/bootstrap.less',
- dest: 'test/css/bootstrap.css'
+ banner: {
+ options: {
+ stripBanners: true,
+ banner: '<%= meta.banner %>'
+ },
+ files: [{
+ expand: true,
+ flatten: true,
+ cwd: 'test/fixtures/banners',
+ src: ['*.less'],
+ dest: 'tmp/actual/banners/',
+ ext: '.css'
+ }
+ ]
+ },
+ stripbanners: {
+ options: {stripBanners: true},
+ files: [{
+ expand: true,
+ flatten: true,
+ cwd: 'test/fixtures/banners',
+ src: ['*.less'],
+ dest: 'tmp/actual/stripbanners/',
+ ext: '.css'
+ }
+ ]
+ },
+ compile: {
+ options: {
+ paths: ['test/fixtures/include']
+ },
+ files: {
+ 'tmp/actual/less.css': ['test/fixtures/style.less'],
+ 'tmp/actual/concat.css': ['test/fixtures/style.less', 'test/fixtures/style2.less', 'test/fixtures/style3.less']
+ }
+ },
+ compress: {
+ options: {
+ paths: ['test/fixtures/include'],
+ compress: true
+ },
+ files: {
+ 'tmp/actual/compress.css': ['test/fixtures/style.less']
+ }
+ },
+ nopaths: {
+ files: {
+ 'tmp/actual/nopaths.css': ['test/fixtures/nopaths.less']
+ }
},
- component: {
- src: 'vendor/bootstrap/less/alerts.less',
- dest: 'test/css/alerts.css'
+ yuicompress: {
+ options: {
+ paths: ['test/fixtures/include'],
+ yuicompress: true
+ },
+ files: {
+ 'tmp/actual/yuicompress.css': ['test/fixtures/style.less']
+ }
+ },
+ ieCompatTrue: {
+ options: {
+ paths: ['test/fixtures/include'],
+ ieCompat: true
+ },
+ files: {
+ 'tmp/actual/ieCompatTrue.css': ['test/fixtures/ieCompat.less']
+ }
+ },
+ ieCompatFalse: {
+ options: {
+ paths: ['test/fixtures/include'],
+ ieCompat: false
+ },
+ files: {
+ 'tmp/actual/ieCompatFalse.css': ['test/fixtures/ieCompat.less']
+ }
+ },
+ nofiles: {},
+ nomatchedfiles: {
+ files: {
+ "tmp/actual/nomatchedfiles.css": 'test/nonexistent/*.less'
+ }
+ },
+ compressReport: {
+ options: {
+ paths: ['test/fixtures/include'],
+ compress: true,
+ report: 'min'
+ },
+ files: {
+ 'tmp/actual/compressReport.css': ['test/fixtures/style.less', 'test/fixtures/style2.less']
+ }
+ },
+ yuicompressReport: {
+ options: {
+ paths: ['test/fixtures/include'],
+ yuicompress: true,
+ report: 'gzip'
+ },
+ files: {
+ 'tmp/actual/yuicompressReport.css': ['test/fixtures/style.less', 'test/fixtures/style2.less', 'test/fixtures/style3.less']
+ }
}
},
- jshint: {
- options: {
- jshintrc: '.jshintrc'
- },
- files: [
- 'Gruntfile.js',
- 'lib/**/*.js',
- 'tasks/**/*.js'
- ]
+ // Unit tests.
+ nodeunit: {
+ tests: ['test/*_test.js']
},
-
- // Clean out files from last run,
- // before creating new ones.
+ // Before generating any new files, remove any previously-created files.
clean: {
- tests: { src: 'test/css/**/*.css' }
+ tests: ['tmp/actual/**']
}
});
- // Load npm plugins to provide necessary tasks.
- grunt.loadNpmTasks('grunt-contrib-jshint');
- grunt.loadNpmTasks('grunt-contrib-clean');
-
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
- // Default tasks to be run.
- grunt.registerTask('default', ['jshint', 'clean', 'less']);
+ // These plugins provide necessary tasks.
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-clean');
+ grunt.loadNpmTasks('grunt-contrib-nodeunit');
+ grunt.loadNpmTasks('grunt-contrib-internal');
+ grunt.loadNpmTasks('assemble-internal');
+
+ // By default, lint and run all tests.
+ grunt.registerTask('default', ['jshint', 'test']);
- // Tests to be run.
- grunt.registerTask('test', ['default']);
+ // Whenever the "test" task is run, first clean the "tmp" dir, then run this
+ // plugin's task(s), then test the result.
+ grunt.registerTask('test', ['clean', 'less', 'nodeunit']);
+ grunt.registerTask('readme', ['assemble-internal']);
};
View
@@ -1,4 +1,4 @@
-Copyright (c) 2013 Jon Schlinkert
+Copyright (c) 2013 Tyler Kellen, contributors
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Oops, something went wrong.

0 comments on commit c79cba6

Please sign in to comment.