-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.js
89 lines (75 loc) · 2.58 KB
/
template.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
* grunt-init-express
*
* @version v0.0.1rc2
* @author kamiyam (http://twitter.com/kamiyam)
* @copyright (c) 2013 "kamiyam"
* @license The MIT License
* @link https://github.com/kamiyam/grunt-init-express
*
*/
'use strict';
//description
exports.description = 'Create a Express apps plugin.';
// about express
exports.notes = 'For more information about Express, ' +
'please see the docs at http://expressjs.com/guide.html';
// after setup express
exports.after = 'You should now install project dependencies with _npm ' +
'install_. After comand _express app_';
// If exist files warning.
exports.warnOn = '*';
// template files
exports.template = function(grunt, init, done) {
init.process({type: 'grunt'}, [
// prompt
init.prompt( 'name' ),
init.prompt( 'description', 'Express Application description'),
init.prompt( 'version'),
init.prompt( 'repository'),
init.prompt( 'homepage'),
init.prompt( 'bugs'),
init.prompt( 'licenses'),
init.prompt( 'author_name'),
init.prompt( 'author_email'),
init.prompt( 'author_url'),
init.prompt( 'grunt_version'),
init.prompt( 'node_version', grunt.package.engines.node),
init.prompt( 'express_prameter',"")
], function(err, props) {
props.short_name = props.name;
props.main = 'Gruntfile.js';
props.npm_test = 'grunt test';
props.keywords = ['grunt','node.js','express'];
props.devDependencies = {
"matchdep": "~0.1.2",
"grunt": "~0.4.1",
"grunt-regarde": "~0.1.1",
"grunt-contrib-connect": "~0.3.0",
"grunt-contrib-livereload": "~0.1.2",
"grunt-open": "~0.2.0",
"grunt-connect-proxy": "~0.1.4",
"grunt-exec": "~0.4.2",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-compass": "~0.3.0",
"grunt-contrib-clean": "~0.4.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-express-server": "~0.4.0",
"grunt-contrib-cssmin": "~0.6.1"
};
props.peerDependencies = {
'grunt': props.grunt_version
};
// filecopy
var files = init.filesToCopy(props);
// add lisences file
init.addLicenseFiles(files, props.licenses);
// setting all files
init.copyAndProcess(files, props);
// create package.json
init.writePackageJSON('package.json', props);
done();
});
};