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 | grunt.helper('prompt', {}, [
|
23 |
|
24 | grunt.helper('prompt_for', 'name'),
|
25 | grunt.helper('prompt_for', 'description'),
|
26 | grunt.helper('prompt_for', 'version'),
|
27 | grunt.helper('prompt_for', 'repository'),
|
28 | grunt.helper('prompt_for', 'homepage'),
|
29 | grunt.helper('prompt_for', 'bugs'),
|
30 | grunt.helper('prompt_for', 'licenses'),
|
31 | grunt.helper('prompt_for', 'author_name'),
|
32 | grunt.helper('prompt_for', 'author_email'),
|
33 | grunt.helper('prompt_for', 'author_url'),
|
34 | grunt.helper('prompt_for', 'node_version', '*'),
|
35 | grunt.helper('prompt_for', 'main'),
|
36 | grunt.helper('prompt_for', 'npm_test')
|
37 | ], function(err, props) {
|
38 | props.keywords = [];
|
39 |
|
40 |
|
41 | var files = init.filesToCopy(props);
|
42 |
|
43 |
|
44 | init.addLicenseFiles(files, props.licenses);
|
45 |
|
46 |
|
47 | init.copyAndProcess(files, props);
|
48 |
|
49 |
|
50 | init.writePackageJSON('package.json', props);
|
51 |
|
52 |
|
53 | done();
|
54 | });
|
55 |
|
56 | };
|