From d7815f4dff7e10cdb75cc349c56409f8fdfbd436 Mon Sep 17 00:00:00 2001 From: Harry Wolff Date: Fri, 21 Feb 2014 22:16:07 -0500 Subject: [PATCH] Update package.json for publishing to npm address #2078 - removes private: true flag from package.json - created .npmignore file and moved all of buildGlob file patterns into here, negating all patterns as the npmignore file defines what is to be excluded and not included. - gruntfile now uses the inverse of the .npmignore file to define what files to include in a release --- .npmignore | 28 ++++++++++++++++++++++++++++ Gruntfile.js | 39 +++++++++++---------------------------- package.json | 1 - 3 files changed, 39 insertions(+), 29 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000000..168048682e --- /dev/null +++ b/.npmignore @@ -0,0 +1,28 @@ +!** +.build +.dist +docs/** +_site/** +content/images/** +!content/images/README.md +content/themes/** +!content/themes/casper/** +content/apps/** +!content/apps/README.md +node_modules/** +core/test/** +core/client/assets/sass/** +core/server/data/export/exported* +**/*.db* +*.db* +.sass* +.af* +.git* +.groc* +*.iml +config.js +CONTRIBUTING.md +SECURITY.md +.travis.yml +Gemfile* +*.html \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 7144a71533..64ef36da8f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,34 +15,17 @@ var path = require('path'), // ## Build File Patterns // a list of files and paterns to process and exclude when running builds & releases - buildGlob = [ - '**', - '!docs/**', - '!_site/**', - '!content/images/**', - 'content/images/README.md', - '!content/themes/**', - 'content/themes/casper/**', - '!content/apps/**', - 'content/apps/README.md', - '!node_modules/**', - '!core/test/**', - '!core/client/assets/sass/**', - '!core/server/data/export/exported*', - '!**/*.db*', - '!*.db*', - '!.sass*', - '!.af*', - '!.git*', - '!.groc*', - '!*.iml', - '!config.js', - '!CONTRIBUTING.md', - '!SECURITY.md', - '!.travis.yml', - '!Gemfile*', - '!*.html' - ], + // It is taken from the .npmignore file and all patterns are inverted as the .npmignore + // file defines what to ignore, whereas we want to define what to include. + buildGlob = (function () { + /*jslint stupid:true */ + return fs.readFileSync('.npmignore', {encoding: 'utf8'}).split('\n').map(function (pattern) { + if (pattern[0] === '!') { + return pattern.substr(1); + } + return '!' + pattern; + }); + }()), // ## Grunt configuration diff --git a/package.json b/package.json index 664c461539..c422c7f152 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ }, "bugs" : "https://github.com/TryGhost/Ghost/issues", "contributors": "https://github.com/TryGhost/Ghost/graphs/contributors", - "private" : true, "licenses" : [ { "type": "MIT",