From 8c70cd69aaed6f346668bbdb6848c5181207bd52 Mon Sep 17 00:00:00 2001 From: Peter Haight Date: Tue, 30 Dec 2014 15:52:33 -0800 Subject: [PATCH] Get the distmaker working with npm and bower. We're going to start distributing the node_modules and bower_modules using npm and bower now instead of having them in packages because we feel that those are a better way to manage backages than the packages repository. So the distmaker needs to copy those directories to the distribution after running 'npm install' to get the packages downloaded. Also I needed to put a resolution for the angular version in the bower.json file because some of the angular plugins were resolving to angular 1.2.x and we want 1.3.x. I also changed the version numbers to start at 1.3.8, but allow minor version updates because that's what we're using. --- bower.json | 9 ++++++--- distmaker/distmaker.conf.dist | 1 + distmaker/distmaker.sh | 3 +++ distmaker/dists/common.sh | 10 +++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index cbae39c0cd..7c3de3f992 100644 --- a/bower.json +++ b/bower.json @@ -5,13 +5,16 @@ "license": "AGPL-3.0", "private": true, "dependencies": { - "angular": "1.3.x", + "angular": "~1.3.8", "angular-file-upload": "~1.1.5", "angular-jquery-dialog-service": "totten/angular-jquery-dialog-service#jquery-closure", - "angular-mocks": "1.3.x", - "angular-route": "1.3.x", + "angular-mocks": "~1.3.8", + "angular-route": "~1.3.8", "angular-ui-sortable": "0.12.x", "angular-ui-utils": "0.1.x", "angular-unsavedChanges": "~0.1.1" + }, + "resolutions": { + "angular": "~1.3.8" } } diff --git a/distmaker/distmaker.conf.dist b/distmaker/distmaker.conf.dist index 9b63873ecc..738812ae14 100644 --- a/distmaker/distmaker.conf.dist +++ b/distmaker/distmaker.conf.dist @@ -4,6 +4,7 @@ DM_GENFILESDIR= DM_TMPDIR= DM_TARGETDIR= +DM_NPM= DM_PHP= DM_RSYNC= DM_ZIP= diff --git a/distmaker/distmaker.sh b/distmaker/distmaker.sh index 1388faba1f..fea13e5c90 100755 --- a/distmaker/distmaker.sh +++ b/distmaker/distmaker.sh @@ -156,6 +156,9 @@ case $1 in esac +## Install npm packages +dm_npm_install "$DM_SOURCEDIR" + ## Make sure we have the right branch or tag dm_git_checkout "$DM_SOURCEDIR" "$DM_REF_CORE" dm_git_checkout "$DM_SOURCEDIR/packages" "$DM_REF_PACKAGES" diff --git a/distmaker/dists/common.sh b/distmaker/dists/common.sh index 4a460239ae..0a53b3c300 100644 --- a/distmaker/dists/common.sh +++ b/distmaker/dists/common.sh @@ -51,7 +51,7 @@ function dm_install_core() { local repo="$1" local to="$2" - for dir in css i js PEAR templates bin CRM api extern Reports install settings Civi partials ; do + for dir in css i js PEAR templates bin CRM api extern Reports install settings Civi partials node_modules bower_components ; do [ -d "$repo/$dir" ] && dm_install_dir "$repo/$dir" "$to/$dir" done @@ -177,3 +177,11 @@ function dm_git_checkout() { git checkout "$2" popd } + +## Install npm packages +## usage: dm_npm_install +function dm_npm_install() { + pushd "$1" + $DM_NPM install + popd +} -- 2.25.1