Skip to content

Commit

Permalink
Merge pull request #2813 from harvesthq/package-files
Browse files Browse the repository at this point in the history
Package files
  • Loading branch information
koenpunt authored Jun 21, 2017
2 parents 40cb8a0 + 4475df8 commit 0d739b8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ This file is generated by `grunt build`, do not edit it by hand.
grunt.loadTasks 'tasks'

grunt.registerTask 'default', ['build']
grunt.registerTask 'build', ['coffee:jquery', 'coffee:proto', 'sass', 'concat', 'uglify', 'postcss', 'cssmin', 'package-bower']
grunt.registerTask 'build', ['coffee:jquery', 'coffee:proto', 'sass', 'concat', 'uglify', 'postcss', 'cssmin']
grunt.registerTask 'test', ['coffee', 'jasmine']
grunt.registerTask 'test:jquery', ['coffee:test', 'coffee:jquery', 'jasmine:jquery']
grunt.registerTask 'test:proto', ['coffee:test', 'coffee:proto', 'jasmine:proto']
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,17 @@
"download": "https://github.com/harvesthq/chosen/releases",
"docs": "https://harvesthq.github.io/chosen/"
},
"main": [
"chosen.jquery.js",
"chosen.css"
],
"files": [
"chosen.jquery.js",
"chosen.jquery.min.js",
"chosen.proto.js",
"chosen.proto.min.js",
"chosen.css",
"chosen.min.css",
"[email protected]",
"chosen-sprite.png"
]
Expand Down
2 changes: 1 addition & 1 deletion publish-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ GITHUB_URL=https://pfiller:${GH_TOKEN}@github.com/harvesthq/chosen-package.git

git clone $GITHUB_URL
rm -rf chosen-package/*
cp README.md public/*.json public/*.png public/chosen.jquery.js public/chosen.css chosen-package/
cp README.md public/*.json public/*.png public/*.js public/*.css chosen-package/
cp package-travis.yml chosen-package/.travis.yml
cd chosen-package

Expand Down
7 changes: 4 additions & 3 deletions tasks/package.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = (grunt) ->

grunt.registerTask 'package-npm', 'Generate npm manifest', () ->
pkg = grunt.config.get('pkg')
extra = pkg._extra

json =
name: "#{pkg.name}-js"
Expand All @@ -35,8 +36,8 @@ module.exports = (grunt) ->
license: pkg.license
contributors: pkg.contributors
dependencies: pkg.dependencies
files: pkg._extra.files
main: pkg._extra.files[0]
files: extra.files
main: extra.main[0]
repository: pkg.repository

grunt.file.write('public/package.json', JSON.stringify(json, null, 2) + "\n")
Expand All @@ -53,7 +54,7 @@ module.exports = (grunt) ->
license: extra.license.url
authors: pkg.contributors
dependencies: pkg.dependencies
main: extra.files
main: extra.main
ignore: []
repository: pkg.repository

Expand Down

0 comments on commit 0d739b8

Please sign in to comment.