forked from harvesthq/chosen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.coffee
64 lines (54 loc) · 1.84 KB
/
package.coffee
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
###
This file contains tasks only necessary for packaging and publishing Chosen
###
module.exports = (grunt) ->
grunt.config 'dom_munger',
latest_version:
src: ['public/index.html', 'public/index.proto.html', 'public/options.html']
options:
callback: ($) ->
$('#latest-version').text(grunt.config.get('version_tag'))
grunt.config 'zip',
chosen:
cwd: 'public/'
src: ['public/**/*']
dest: 'chosen_<%= version_tag %>.zip'
grunt.config 'gh-pages',
options:
base: 'public',
message: 'Updated to new Chosen version <%= pkg.version %>'
src: ['**']
grunt.registerTask 'package-npm', 'Generate npm manifest', () ->
pkg = grunt.config.get('pkg')
extra = pkg._extra
json =
name: "#{pkg.name}-js"
version: pkg.version
description: pkg.description
keywords: pkg.keywords
homepage: pkg.homepage
bugs: pkg.bugs
license: pkg.license
contributors: pkg.contributors
dependencies: pkg.dependencies
files: extra.files
main: extra.main[0]
repository: pkg.repository
grunt.file.write('public/package.json', JSON.stringify(json, null, 2) + "\n")
grunt.registerTask 'package-bower', 'Generate bower manifest', () ->
pkg = grunt.config.get('pkg')
extra = pkg._extra
json =
name: pkg.name
description: pkg.description
keywords: pkg.keywords
homepage: pkg.homepage
license: extra.license.url
authors: pkg.contributors
dependencies: pkg.dependencies
main: extra.main
ignore: []
repository: pkg.repository
grunt.file.write('public/bower.json', JSON.stringify(json, null, 2) + "\n")
grunt.registerTask 'prep-release', ['build', 'dom_munger:latest_version', 'zip:chosen', 'package-npm', 'package-bower']
grunt.registerTask 'publish-release', ['gh-pages']