forked from gruntjs/grunt
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preliminary new gruntplugin init template.
- Loading branch information
Showing
11 changed files
with
127 additions
and
64 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
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,5 +1,4 @@ | ||
{ | ||
"bin/name": "bin/{%= name %}", | ||
"tasks/name.js": "tasks/{%= short_name %}.js", | ||
"test/name_test.js": "test/{%= short_name %}_test.js" | ||
} |
This file was deleted.
Oops, something went wrong.
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,53 +1,85 @@ | ||
/* | ||
* {%= name %} | ||
* {%= homepage %} | ||
* | ||
* Copyright (c) {%= grunt.template.today('yyyy') %} {%= author_name %} | ||
* Licensed under the {%= licenses.join(', ') %} license{%= licenses.length === 1 ? '' : 's' %}. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = function(grunt) { | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
nodeunit: { | ||
files: ['test/**/*.js'] | ||
}, | ||
jshint: { | ||
options: { | ||
jshintrc: '.jshintrc' | ||
}, | ||
gruntfile: { | ||
src: 'Gruntfile.js' | ||
}, | ||
bin: { | ||
src: ['bin/{%= name %}'] | ||
}, | ||
lib: { | ||
src: ['lib/**/*.js'] | ||
}, | ||
test: { | ||
src: ['test/**/*.js'] | ||
curly: true, | ||
eqeqeq: true, | ||
immed: true, | ||
latedef: true, | ||
newcap: true, | ||
noarg: true, | ||
sub: true, | ||
undef: true, | ||
boss: true, | ||
eqnull: true, | ||
node: true, | ||
es5: true, | ||
}, | ||
all: [ | ||
'Gruntfile.js', | ||
'tasks/*.js', | ||
'<config:nodeunit.tests>' | ||
], | ||
}, | ||
watch: { | ||
gruntfile: { | ||
files: '<%= jshint.gruntfile.src %>', | ||
tasks: ['jshint:gruntfile'] | ||
}, | ||
bin: { | ||
files: '<%= jshint.bin.src %>', | ||
tasks: ['jshint:bin'] | ||
}, | ||
lib: { | ||
files: '<%= jshint.lib.src %>', | ||
tasks: ['jshint:lib', 'nodeunit'] | ||
|
||
// Before generating any new files, remove any previously-created files. | ||
clean: { | ||
tests: ['tmp'], | ||
}, | ||
|
||
// Configuration to be run (and then tested). | ||
{%= short_name %}: { | ||
default_options: { | ||
options: { | ||
}, | ||
files: { | ||
'tmp/default_options': ['test/fixtures/testing', 'test/fixtures/123'], | ||
}, | ||
}, | ||
test: { | ||
files: '<%= jshint.test.src %>', | ||
tasks: ['jshint:test', 'nodeunit'] | ||
custom_options: { | ||
options: { | ||
separator: ': ', | ||
punctuation: ' !!!', | ||
}, | ||
files: { | ||
'tmp/custom_options': ['test/fixtures/testing', 'test/fixtures/123'], | ||
}, | ||
}, | ||
}, | ||
|
||
// Unit tests. | ||
nodeunit: { | ||
tests: ['test/*_test.js'], | ||
}, | ||
|
||
}); | ||
|
||
// Load local tasks. | ||
// Actually load this plugin's task(s). | ||
grunt.loadTasks('tasks'); | ||
|
||
// Default task. | ||
grunt.registerTask('default', ['jshint', 'nodeunit']); | ||
// The clean plugin helps in testing. | ||
//grunt.loadNpmTasks('grunt-contrib-clean'); | ||
grunt.registerTask('clean', 'Clean up some shizzle.', function() { | ||
if (grunt.file.exists('tmp')) { grunt.file.delete('tmp'); } | ||
}); | ||
|
||
// 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', '{%= short_name %}', 'nodeunit']); | ||
|
||
// By default, lint and run all tests. | ||
grunt.registerTask('default', ['jshint', 'test']); | ||
|
||
}; |
This file was deleted.
Oops, something went wrong.
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
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 @@ | ||
Testing: 1 2 3 !!! |
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 @@ | ||
Testing, 1 2 3. |
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 @@ | ||
1 2 3 |
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 @@ | ||
Testing |
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