From d92605f117352f3026d5a81be64dc5e1341f34ab Mon Sep 17 00:00:00 2001 From: Mato Ilic Date: Mon, 30 May 2016 22:07:09 +0200 Subject: [PATCH] v0.6.1 fix wrong dependency version in app template --- app/templates/core/_package.json | 2 +- package.json | 3 ++- scripts/prepublish.js | 9 +++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 scripts/prepublish.js diff --git a/app/templates/core/_package.json b/app/templates/core/_package.json index 2caa3df..001c1e6 100644 --- a/app/templates/core/_package.json +++ b/app/templates/core/_package.json @@ -35,7 +35,7 @@ "babel-eslint": "^6.0.2",<% if(bootstrapCss) { %> "bootstrap-sass": "^3.3.6",<% } %> "eslint-config-angular-lazy": "^0.1.1", - "generator-angular-lazy": "^0.5.2", + "generator-angular-lazy": "~0.6.1", "glob": "^7.0.3", "gulp": "^3.9.0", "gulp-autoprefixer": "^3.1.0", diff --git a/package.json b/package.json index 3acb09b..040abba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-angular-lazy", - "version": "0.6.0", + "version": "0.6.1", "description": "Yeoman generator for creating Angular applications which lazy load components as needed at runtime. Based on SystemJS, JSPM, Babel and Gulp.", "repository": { "type": "git", @@ -53,6 +53,7 @@ "yo": "^1.8.0" }, "scripts": { + "prepublish": "node scripts/prepublish.js", "test": "eslint . && jasmine" } } diff --git a/scripts/prepublish.js b/scripts/prepublish.js new file mode 100644 index 0000000..e69e1d2 --- /dev/null +++ b/scripts/prepublish.js @@ -0,0 +1,9 @@ +const fs = require('fs'); +const packageInfo = require('../package.json'); + +const packageInfoTemplate = fs.readFileSync('app/templates/core/_package.json').toString(); +const requiredDependency = `"generator-angular-lazy": "~${packageInfo.version}"`; + +if (packageInfoTemplate.match(requiredDependency) === null) { + throw new Error('App template package.json might contain a wrong version of generator-angular-lazy!'); +}