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