From e07c59218a6b4f26b600aab5d2396cdf636daa02 Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Sat, 22 Apr 2017 23:55:55 +0200 Subject: [PATCH 1/3] include minified and prototype files in package fixes #2804 fixes #2635 --- package.json | 4 ++++ publish-package.sh | 2 +- tasks/package.coffee | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 30ca5606338..6700ccce0af 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,11 @@ }, "files": [ "chosen.jquery.js", + "chosen.jquery.min.js", + "chosen.proto.js", + "chosen.proto.min.js", "chosen.css", + "chosen.min.css", "chosen-sprite@2x.png", "chosen-sprite.png" ] diff --git a/publish-package.sh b/publish-package.sh index cc770ae785d..fe5e4bf53ec 100755 --- a/publish-package.sh +++ b/publish-package.sh @@ -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 diff --git a/tasks/package.coffee b/tasks/package.coffee index 8578e3d7e29..7cb3a930b99 100644 --- a/tasks/package.coffee +++ b/tasks/package.coffee @@ -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" @@ -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.files[0] repository: pkg.repository grunt.file.write('public/package.json', JSON.stringify(json, null, 2) + "\n") From e4bab396266054578f2813f61697777b536271ff Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Sat, 22 Apr 2017 23:56:35 +0200 Subject: [PATCH 2/3] remove extraneous `package-bower` --- Gruntfile.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 85c5feaf883..d459ab78e43 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -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'] From 4475df826ca5e33f97bc48e6cb1cca6c726cff94 Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Sun, 23 Apr 2017 00:03:19 +0200 Subject: [PATCH 3/3] specify main explicitly --- package.json | 4 ++++ tasks/package.coffee | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6700ccce0af..c21a2df2dea 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,10 @@ "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", diff --git a/tasks/package.coffee b/tasks/package.coffee index 7cb3a930b99..70f1e997d97 100644 --- a/tasks/package.coffee +++ b/tasks/package.coffee @@ -37,7 +37,7 @@ module.exports = (grunt) -> contributors: pkg.contributors dependencies: pkg.dependencies files: extra.files - main: extra.files[0] + main: extra.main[0] repository: pkg.repository grunt.file.write('public/package.json', JSON.stringify(json, null, 2) + "\n") @@ -54,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