From 91e7b957960c6930b31b1753c7388cfb23934b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o=20Soares=20dos=20Santos?= Date: Fri, 10 Jul 2015 21:00:21 +0100 Subject: [PATCH] chore: several small build enhancements + build --- .gitattributes | 4 ++++ .gitignore | 2 +- Gruntfile.js | 54 ++++++++++++++++++------------------------- dist/showdown.js | Bin 55233 -> 55233 bytes dist/showdown.min.js | Bin 17921 -> 17921 bytes package.json | 5 +--- 6 files changed, 29 insertions(+), 36 deletions(-) diff --git a/.gitattributes b/.gitattributes index 6234bf3..6821512 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,10 @@ /test export-ignore +.editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore +.jscs.json export-ignore .jshintignore export-ignore +.jshintrc .travis.yml export-ignore +bower.json Gruntfile.js export-ignore diff --git a/.gitignore b/.gitignore index 61f9328..ed1e238 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .idea/ -build/ +.build/ .DS_Store node_modules npm-debug.log diff --git a/Gruntfile.js b/Gruntfile.js index 6d0ab2a..401cb43 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,7 +15,7 @@ module.exports = function (grunt) { footer: '}).call(this);' }, dist: { - src: [ + src: [ 'src/showdown.js', 'src/helpers.js', 'src/converter.js', @@ -23,9 +23,18 @@ module.exports = function (grunt) { 'src/loader.js' ], dest: 'dist/<%= pkg.name %>.js' + }, + test: { + src: '<%= concat.dist.dest %>', + dest: '.build/<%= pkg.name %>.js', + options: { + sourceMap: false + } } }, + clean: ['.build/'], + uglify: { options: { sourceMap: true, @@ -53,7 +62,7 @@ module.exports = function (grunt) { options: { config: '.jscs.json' }, - files: { + files: { src: [ 'Gruntfile.js', 'src/**/*.js', @@ -69,25 +78,6 @@ module.exports = function (grunt) { } }, - bump: { - options: { - files: ['package.json'], - updateConfigs: [], - commit: true, - commitMessage: 'Release version %VERSION%', - commitFiles: ['package.json'], - createTag: true, - tagName: '%VERSION%', - tagMessage: 'Version %VERSION%', - push: true, - pushTo: 'upstream', - gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d', - globalReplace: false, - prereleaseName: 'alpha', - regExp: false - } - }, - simplemocha: { node: { src: 'test/node/**/*.js', @@ -105,12 +95,15 @@ module.exports = function (grunt) { timeout: 3000, ignoreLeaks: false, reporter: 'spec' - } - }, - browser: { - src: 'test/browser/**/*.js', - options: { - reporter: 'spec' + }, + issues: { + src: 'test/node/testsuite.issues.js', + options: { + globals: ['should'], + timeout: 3000, + ignoreLeaks: false, + reporter: 'spec' + } } } } @@ -120,11 +113,10 @@ module.exports = function (grunt) { require('load-grunt-tasks')(grunt); - grunt.registerTask('concatenate', ['concat']); + grunt.registerTask('concatenate', ['concat:dist']); grunt.registerTask('lint', ['jshint', 'jscs']); - grunt.registerTask('test', ['lint', 'concat', 'simplemocha:node']); - grunt.registerTask('test-without-building', ['simplemocha:node']); - grunt.registerTask('build', ['test', 'uglify']); + grunt.registerTask('test', ['lint', 'concat:test', 'simplemocha:node', 'clean']); + grunt.registerTask('build', ['test', 'concatenate', 'uglify']); grunt.registerTask('prep-release', ['build', 'changelog']); // Default task(s). diff --git a/dist/showdown.js b/dist/showdown.js index 35267c0a7e62c24e13822912258e44cd30cbd582..2fea717466434323bc6bd720df94bbd65463dd78 100644 GIT binary patch delta 30 mcmX@Op84Qio&^0jMDD>VH0ET4=P5=M^ delta 29 kcmZqdVQlPS6w=pHR4C5KFHgxY&r>k8&^0jIDD>VH0EVCmRR910 diff --git a/package.json b/package.json index c420360..7c24a90 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "devDependencies": { "chai": "^1.10.0", "grunt": "^0.4.5", - "grunt-bump": "^0.3.1", + "grunt-contrib-clean": "^0.6.0", "grunt-contrib-concat": "^0.5.0", "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-uglify": "^0.6.0", @@ -46,10 +46,7 @@ "grunt-jscs": "^1.2.0", "grunt-simple-mocha": "^0.4.0", "js-beautify": "^1.5.6", - "jscs": "^1.10.0", "load-grunt-tasks": "^3.2.0", - "mocha": "*", - "should": "^4.4.2", "sinon": "^1.14.1", "source-map-support": "^0.2.9" }