1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | exports.description = 'Create a commonjs module, including Nodeunit unit tests.';
|
12 |
|
13 |
|
14 | exports.notes = '';
|
15 |
|
16 |
|
17 | exports.warnOn = '*';
|
18 |
|
19 |
|
20 | exports.template = function(grunt, init, done) {
|
21 |
|
22 | var task = grunt.task;
|
23 | var file = grunt.file;
|
24 | var utils = grunt.utils;
|
25 | var log = grunt.log;
|
26 | var verbose = grunt.verbose;
|
27 | var fail = grunt.fail;
|
28 | var option = grunt.option;
|
29 | var config = grunt.config;
|
30 | var template = grunt.template;
|
31 |
|
32 | grunt.helper('prompt', {}, [
|
33 |
|
34 | grunt.helper('prompt_for', 'name'),
|
35 | grunt.helper('prompt_for', 'description'),
|
36 | grunt.helper('prompt_for', 'version'),
|
37 | grunt.helper('prompt_for', 'repository'),
|
38 | grunt.helper('prompt_for', 'homepage'),
|
39 | grunt.helper('prompt_for', 'bugs'),
|
40 | grunt.helper('prompt_for', 'licenses'),
|
41 | grunt.helper('prompt_for', 'author_name'),
|
42 | grunt.helper('prompt_for', 'author_email'),
|
43 | grunt.helper('prompt_for', 'author_url'),
|
44 | grunt.helper('prompt_for', 'node_version', '*'),
|
45 | grunt.helper('prompt_for', 'main'),
|
46 | grunt.helper('prompt_for', 'npm_test')
|
47 | ], function(err, props) {
|
48 |
|
49 | var files = init.filesToCopy(props);
|
50 |
|
51 |
|
52 | init.addLicenseFiles(files, props.licenses);
|
53 |
|
54 |
|
55 | init.copyAndProcess(files, props);
|
56 |
|
57 |
|
58 | init.writePackageJSON('package.json', props);
|
59 |
|
60 |
|
61 | done();
|
62 | });
|
63 |
|
64 | };
|