Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package files #2813

Merged
merged 3 commits into from
Jun 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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