Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Gruntfile with stylus and intern tasks
Also update package.js to exclude Gruntfile and *.styl, and clean up a bit
- Loading branch information
1 parent
9fcdac2
commit 2bc176b
Showing
3 changed files
with
91 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* jshint node:true */ | ||
|
||
module.exports = function (grunt) { | ||
grunt.loadNpmTasks('grunt-contrib-clean'); | ||
grunt.loadNpmTasks('grunt-contrib-stylus'); | ||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
grunt.loadNpmTasks('intern-geezer'); | ||
|
||
// grunt-contrib-stylus does not appear to support globbed destination filenames, | ||
// so generate the desired destination/source configuration ahead of time | ||
var stylusFiles = grunt.file.expand([ | ||
'css/dgrid.styl', | ||
'css/TouchScroll.styl', | ||
'css/skins/*.styl', | ||
'!css/skins/skin.styl' | ||
]); | ||
var stylusFilesConfig = {}; | ||
stylusFiles.forEach(function (filename) { | ||
stylusFilesConfig[filename.slice(0, -5) + '.css'] = filename; | ||
}); | ||
|
||
grunt.initConfig({ | ||
clean: { | ||
css: { | ||
src: [ 'css/**/*.css' ] | ||
} | ||
}, | ||
|
||
stylus: { | ||
options: { | ||
compress: false, | ||
use: [ require('nib') ] | ||
}, | ||
|
||
compile: { | ||
files: stylusFilesConfig | ||
} | ||
}, | ||
|
||
watch: { | ||
stylus: { | ||
files: [ 'css/**/*.styl' ], | ||
tasks: [ 'stylus' ] | ||
} | ||
}, | ||
|
||
intern: { | ||
local: { | ||
options: { | ||
runType: 'runner', | ||
config: 'test/intern/intern.local' | ||
} | ||
}, | ||
remote: { | ||
options: { | ||
runType: 'runner', | ||
config: 'test/intern/intern' | ||
} | ||
} | ||
} | ||
}); | ||
|
||
grunt.registerTask('default', [ 'stylus', 'watch:stylus' ]); | ||
grunt.registerTask('test', [ 'intern:local' ]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,33 @@ | ||
/* exported profile */ | ||
|
||
var miniExcludes = { | ||
'dgrid/CHANGES.md': 1, | ||
'dgrid/LICENSE': 1, | ||
'dgrid/README.md': 1, | ||
'dgrid/package': 1 | ||
}, | ||
isTestRe = /\/test\//; | ||
var copyOnlyMids = { | ||
'dgrid/Gruntfile': 1, | ||
'dgrid/package': 1 | ||
}; | ||
var miniExcludeMids = { | ||
'dgrid/CHANGES.md': 1, | ||
'dgrid/LICENSE': 1, | ||
'dgrid/README.md': 1, | ||
'dgrid/Gruntfile': 1, | ||
'dgrid/package': 1 | ||
}; | ||
|
||
var profile = { | ||
resourceTags: { | ||
copyOnly: function (filename, mid) { | ||
return mid in copyOnlyMids; | ||
}, | ||
|
||
test: function (filename) { | ||
return isTestRe.test(filename); | ||
return /\/test\//.test(filename); | ||
}, | ||
|
||
miniExclude: function (filename, mid) { | ||
return (/\/(?:test|demos)\//).test(filename) || mid in miniExcludes; | ||
return (/\/(?:test|demos)\//).test(filename) || | ||
(/\.styl$/).test(filename) || | ||
mid in miniExcludeMids; | ||
}, | ||
|
||
amd: function (filename) { | ||
return (/\.js$/).test(filename); | ||
} | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters