]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Merge remote-tracking branch 'upstream/master' into node-requirable
authorJames Friend <james.friend@agworld.com.au>
Thu, 28 Aug 2014 01:32:08 +0000 (09:32 +0800)
committerJames Friend <james.friend@agworld.com.au>
Thu, 28 Aug 2014 01:32:08 +0000 (09:32 +0800)
Conflicts:
Gruntfile.js

1  2 
Gruntfile.js
package.json

diff --cc Gruntfile.js
index 3fc645fafea53e267d7ed4c98eeaffea9ec0b980,486b0417fdd52f0caa2cf9be8d31a46cb2784ceb..60262ab87ce52a4b43511e00a7c8fb0bbd908400
@@@ -17,11 -17,15 +17,16 @@@ module.exports = function (grunt) 
  
    var fs = require('fs');
    var path = require('path');
-   var generateGlyphiconsData = require('./grunt/bs-glyphicons-data-generator.js');
+   var npmShrinkwrap = require('npm-shrinkwrap');
    var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js');
+   var getLessVarsData = function () {
+     var filePath = path.join(__dirname, 'less/variables.less');
+     var fileContent = fs.readFileSync(filePath, { encoding: 'utf8' });
+     var parser = new BsLessdocParser(fileContent);
+     return { sections: parser.parseFile() };
+   };
    var generateRawFiles = require('./grunt/bs-raw-files-generator.js');
-   var updateShrinkwrap = require('./grunt/shrinkwrap.js');
 +  var generateCommonJSModule = require('./grunt/bs-commonjs-generator.js');
  
    // Project configuration.
    grunt.initConfig({
      generateRawFiles(grunt, banner);
    });
  
-   grunt.registerTask('build-commonjs', 'Build CommonJS entrypoint module for JS.', function () {
++  grunt.registerTask('commonjs', 'Generate CommonJS entrypoint module in dist dir.', function () {
 +    var files = grunt.config.get('concat.bootstrap.src');
 +    generateCommonJSModule(grunt, files);
 +  });
 +
-   // Task for updating the npm packages used by the Travis build.
-   grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', 'exec:npmShrinkWrap', '_update-shrinkwrap']);
-   grunt.registerTask('_update-shrinkwrap', function () { updateShrinkwrap.call(this, grunt); });
+   // Docs task.
+   grunt.registerTask('docs-css', ['autoprefixer:docs', 'autoprefixer:examples', 'csscomb:docs', 'csscomb:examples', 'cssmin:docs']);
+   grunt.registerTask('lint-docs-css', ['csslint:docs', 'csslint:examples']);
+   grunt.registerTask('docs-js', ['uglify:docsJs', 'uglify:customize']);
+   grunt.registerTask('lint-docs-js', ['jshint:assets', 'jscs:assets']);
+   grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'build-customizer']);
+   // Task for updating the cached npm packages used by the Travis build (which are controlled by test-infra/npm-shrinkwrap.json).
+   // This task should be run and the updated file should be committed whenever Bootstrap's dependencies change.
+   grunt.registerTask('update-shrinkwrap', ['exec:npmUpdate', '_update-shrinkwrap']);
+   grunt.registerTask('_update-shrinkwrap', function () {
+     var done = this.async();
+     npmShrinkwrap({ dev: true, dirname: __dirname }, function (err) {
+       if (err) {
+         grunt.fail.warn(err);
+       }
+       var dest = 'test-infra/npm-shrinkwrap.json';
+       fs.renameSync('npm-shrinkwrap.json', dest);
+       grunt.log.writeln('File ' + dest.cyan + ' updated.');
+       done();
+     });
+   });
  };
diff --cc package.json
Simple merge