From 58b371b0ecabec92b5c976f4cdf7061283383651 Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Sat, 5 Sep 2015 20:41:06 +0300 Subject: [PATCH 1/2] Adding MEAN.JS version information as part of the startup info when app loads --- config/config.js | 4 ++++ config/lib/app.js | 1 + 2 files changed, 5 insertions(+) diff --git a/config/config.js b/config/config.js index df8abd6d20..c129edfa3c 100644 --- a/config/config.js +++ b/config/config.js @@ -161,6 +161,10 @@ var initGlobalConfig = function () { // Merge config files var config = _.merge(defaultConfig, environmentConfig); + // read package.json for MEAN.JS project information + var pkg = require(path.resolve('./package.json')); + config.meanjs = pkg; + // We only extend the config object with the local.js custom/local environment if we are on // production or development environment. If test environment is used we don't merge it with local.js // to avoid running test suites on a prod/dev environment (which delete records and make modifications) diff --git a/config/lib/app.js b/config/lib/app.js index 76c0bf779c..759fdbc68a 100644 --- a/config/lib/app.js +++ b/config/lib/app.js @@ -46,6 +46,7 @@ module.exports.start = function start(callback) { if (process.env.NODE_ENV === 'secure') { console.log(chalk.green('HTTPs:\t\t\t\ton')); } + console.log(chalk.green('MEAN.JS version:\t\t\t' + config.meanjs.version)); console.log('--'); if (callback) callback(app, db, config); From a12746e3c12324df64a1cf75338e3f3f45877c1f Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Sun, 6 Sep 2015 09:10:43 +0300 Subject: [PATCH 2/2] Adding support for meanjs-version specific configuration option and displaying both MEAN.JS project and App project version numbers on start-up --- config/lib/app.js | 4 +++- package.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/lib/app.js b/config/lib/app.js index 759fdbc68a..17dd9076c5 100644 --- a/config/lib/app.js +++ b/config/lib/app.js @@ -46,7 +46,9 @@ module.exports.start = function start(callback) { if (process.env.NODE_ENV === 'secure') { console.log(chalk.green('HTTPs:\t\t\t\ton')); } - console.log(chalk.green('MEAN.JS version:\t\t\t' + config.meanjs.version)); + console.log(chalk.green('App version:\t\t\t' + config.meanjs.version)); + if (config.meanjs['meanjs-version']) + console.log(chalk.green('MEAN.JS version:\t\t\t' + config.meanjs['meanjs-version'])); console.log('--'); if (callback) callback(app, db, config); diff --git a/package.json b/package.json index b8e34d0d36..967ad70f5a 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "meanjs", "description": "Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js.", "version": "0.4.1", + "meanjs-version": "0.4.1", "private": false, "author": "https://github.com/meanjs/mean/graphs/contributors", "license": "MIT",