LP#1680624 Consolidate package dependencies into package.json
authorDan Scott <dan@coffeecode.net>
Thu, 6 Apr 2017 04:26:50 +0000 (00:26 -0400)
committerBen Shum <ben@evergreener.net>
Wed, 12 Apr 2017 01:32:14 +0000 (21:32 -0400)
npm already enables us to designate dependencies in package.json,
and projects have increasingly consolidated what bower used to be
used for in package.json. We can do this with an npm-compatible version of
angular-order-object-by from github.

There are a few other tweaks to npm vs bower file locations, such as
ng-toast instead of ngtoast for ngToast.

Pin to AngularJS 1.5.x for now

Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Ben Shum <ben@evergreener.net>
Open-ILS/web/js/ui/default/staff/Gruntfile.js
Open-ILS/web/js/ui/default/staff/bower.json [deleted file]
Open-ILS/web/js/ui/default/staff/package.json
Open-ILS/web/js/ui/default/staff/test/karma.conf.js
docs/installation/server_installation.txt

index b768b05..d006a65 100644 (file)
@@ -4,7 +4,7 @@ module.exports = function(grunt) {
   var config = { 
     pkg: grunt.file.readJSON('package.json'),
 
-    // copy the files we care about from bower-fetched dependencies
+    // copy the files we care about from fetched dependencies
     // into our build directory
     copy: {
 
@@ -15,28 +15,28 @@ module.exports = function(grunt) {
           filter: 'isFile',
           expand : true,
           src: [
-            'bower_components/angular/angular.min.js',
-            'bower_components/angular/angular.min.js.map',
-            'bower_components/angular-animate/angular-animate.min.js',
-            'bower_components/angular-animate/angular-animate.min.js.map',
-            'bower_components/angular-sanitize/angular-sanitize.min.js',
-            'bower_components/angular-sanitize/angular-sanitize.min.js.map',
-            'bower_components/angular-route/angular-route.min.js',
-            'bower_components/angular-route/angular-route.min.js.map',
-            'bower_components/angular-bootstrap/ui-bootstrap.min.js',
-            'bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js',
-            'bower_components/angular-hotkeys/build/hotkeys.min.js',
-            'bower_components/angular-file-saver/dist/angular-file-saver.bundle.min.js',
-            'bower_components/angular-location-update/angular-location-update.min.js',
-            'bower_components/angular-tree-control/angular-tree-control.js',
-            'bower_components/ngtoast/dist/ngToast.min.js',
-            'bower_components/jquery/dist/jquery.min.js',
-            'bower_components/angular-cookies/angular-cookies.min.js',
-            'bower_components/angular-cookies/angular-cookies.min.js.map',
-            'bower_components/iframe-resizer/js/iframeResizer.min.js',
-            'bower_components/iframe-resizer/js/iframeResizer.map',
-            'bower_components/iframe-resizer/js/iframeResizer.contentWindow.min.js',
-            'bower_components/angular-order-object-by/src/ng-order-object-by.js'
+            'node_modules/angular/angular.min.js',
+            'node_modules/angular/angular.min.js.map',
+            'node_modules/angular-animate/angular-animate.min.js',
+            'node_modules/angular-animate/angular-animate.min.js.map',
+            'node_modules/angular-sanitize/angular-sanitize.min.js',
+            'node_modules/angular-sanitize/angular-sanitize.min.js.map',
+            'node_modules/angular-route/angular-route.min.js',
+            'node_modules/angular-route/angular-route.min.js.map',
+            'node_modules/angular-ui-bootstrap/dist/ui-bootstrap.min.js',
+            'node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.min.js',
+            'node_modules/angular-hotkeys/build/hotkeys.min.js',
+            'node_modules/angular-file-saver/dist/angular-file-saver.bundle.min.js',
+            'node_modules/angular-location-update/angular-location-update.min.js',
+            'node_modules/angular-tree-control/angular-tree-control.js',
+            'node_modules/ng-toast/dist/ngToast.min.js',
+            'node_modules/jquery/dist/jquery.min.js',
+            'node_modules/angular-cookies/angular-cookies.min.js',
+            'node_modules/angular-cookies/angular-cookies.min.js.map',
+            'node_modules/iframe-resizer/js/iframeResizer.min.js',
+            'node_modules/iframe-resizer/js/iframeResizer.map',
+            'node_modules/iframe-resizer/js/iframeResizer.contentWindow.min.js',
+            'node_modules/angular-order-object-by/src/ng-order-object-by.js'
           ]
         }]
       },
@@ -48,12 +48,12 @@ module.exports = function(grunt) {
           filter : 'isFile',
           expand : true,
           src : [
-            'bower_components/angular-hotkeys/build/hotkeys.min.css',
-            'bower_components/bootstrap/dist/css/bootstrap.min.css', 
-            'bower_components/ngtoast/dist/ngToast.min.css',
-            'bower_components/ngtoast/dist/ngToast-animations.min.css',
-            'bower_components/angular-tree-control/css/tree-control.css',
-            'bower_components/angular-tree-control/css/tree-control-attribute.css',
+            'node_modules/angular-hotkeys/build/hotkeys.min.css',
+            'node_modules/bootstrap/dist/css/bootstrap.min.css', 
+            'node_modules/ngtoast/dist/ngToast.min.css',
+            'node_modules/ngtoast/dist/ngToast-animations.min.css',
+            'node_modules/angular-tree-control/css/tree-control.css',
+            'node_modules/angular-tree-control/css/tree-control-attribute.css',
           ]
         }]
       },
@@ -65,10 +65,10 @@ module.exports = function(grunt) {
           filter : 'isFile',
           expand : true,
           src : [
-            'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
-            'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
-            'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
-            'bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff'
+            'node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.eot',
+            'node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.svg',
+            'node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf',
+            'node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.woff'
           ]
         }]
       },
@@ -80,16 +80,16 @@ module.exports = function(grunt) {
           filter : 'isFile',
           expand : true,
           src : [
-            'bower_components/angular-tree-control/images/sample.png',
-            'bower_components/angular-tree-control/images/node-opened-2.png',
-            'bower_components/angular-tree-control/images/folder.png',
-            'bower_components/angular-tree-control/images/node-closed.png',
-            'bower_components/angular-tree-control/images/node-closed-light.png',
-            'bower_components/angular-tree-control/images/node-opened.png',
-            'bower_components/angular-tree-control/images/node-opened-light.png',
-            'bower_components/angular-tree-control/images/folder-closed.png',
-            'bower_components/angular-tree-control/images/node-closed-2.png',
-            'bower_components/angular-tree-control/images/file.png'
+            'node_modules/angular-tree-control/images/sample.png',
+            'node_modules/angular-tree-control/images/node-opened-2.png',
+            'node_modules/angular-tree-control/images/folder.png',
+            'node_modules/angular-tree-control/images/node-closed.png',
+            'node_modules/angular-tree-control/images/node-closed-light.png',
+            'node_modules/angular-tree-control/images/node-opened.png',
+            'node_modules/angular-tree-control/images/node-opened-light.png',
+            'node_modules/angular-tree-control/images/folder-closed.png',
+            'node_modules/angular-tree-control/images/node-closed-2.png',
+            'node_modules/angular-tree-control/images/file.png'
           ]
         }]
       }
diff --git a/Open-ILS/web/js/ui/default/staff/bower.json b/Open-ILS/web/js/ui/default/staff/bower.json
deleted file mode 100644 (file)
index 63f801e..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-{
-  "name": "evergreen-staff-client",
-  "version": "0.0.1",
-  "authors": [
-    "Bill Erickson <berick@esilibrary.com>"
-  ],
-  "description": "Evergreen HTML Staff Client",
-  "keywords": [
-    "evergreen"
-  ],
-  "license": "GPL",
-  "homepage": "http://evergreen-ils.org",
-  "ignore": [
-    "**/.*",
-    "node_modules",
-    "bower_components",
-    "test",
-    "tests"
-  ],
-  "dependencies": {
-    "AngularJS": "angular-latest#~1.5.0",
-    "jquery": "~2.2.1",
-    "bootstrap": "~3.3.6",
-    "angular-route": "~1.5.0",
-    "angular-mocks": "~1.5.0",
-    "angular-bootstrap": "~1.2.4",
-    "angular-file-saver": "~1.1.0",
-    "angular-location-update": "~0.0.2",
-    "ngtoast": "~2.0.0",
-    "angular-tree-control": "~0.2.28",
-    "angular-animate": "~1.5.3",
-    "angular-hotkeys": "cfp-angular-hotkeys#^1.7.0",
-    "angular-cookies": "~1.5.8",
-    "iframe-resizer": "^3.5.5",
-    "angular-order-object-by": "*"
-  },
-  "resolutions": {
-    "angular": "~1.5.5"
-  }
-}
index f820d68..91a1802 100644 (file)
@@ -5,7 +5,18 @@
   "license": "GPL",
   "homepage": "http://evergreen-ils.org/",
   "devDependencies": {
-    "bower": "^1.3.3",
+    "angular": "~1.5",
+    "angular-animate": "~1.5.3",
+    "angular-ui-bootstrap": "~1.2.4",
+    "angular-cookies": "~1.5.8",
+    "angular-file-saver": "~1.1.0",
+    "angular-hotkeys": "^1.7.0",
+    "angular-location-update": "~0.0.2",
+    "angular-mocks": "~1.5.0",
+    "angular-route": "~1.5.0",
+    "angular-tree-control": "~0.2.28",
+    "angular-order-object-by": "rxfork/ngOrderObjectBy#npm",
+    "bootstrap": "~3.3.6",
     "grunt": "~0.4.4",
     "grunt-cli": "^0.1.13",
     "grunt-contrib-concat": "^0.4.0",
     "grunt-contrib-uglify": "^0.4.0",
     "grunt-exec": "^0.4.5",
     "grunt-karma": "^0.8.3",
-    "phantomjs-prebuilt": "^2.1.7",
+    "iframe-resizer": "^3.5.5",
+    "jquery": "~2.2.1",
     "karma": "^0.12.14",
     "karma-jasmine": "^0.1.5",
     "karma-phantomjs-launcher": "^1.0.0",
     "karma-script-launcher": "~0.1.0",
     "karma-spec-reporter": "0.0.12",
-    "karma-story-reporter": "^0.2.2"
+    "karma-story-reporter": "^0.2.2",
+    "ng-toast": "~2.0.0",
+    "phantomjs-prebuilt": "^2.1.7"
   },
   "scripts": {
     "test": "grunt test"
index 8c7b650..0170e3c 100644 (file)
@@ -8,10 +8,10 @@ module.exports = function(config){
     files : [
       'build/js/angular.min.js',
       'build/js/angular-route.min.js',
-      'bower_components/angular-mocks/angular-mocks.js', // testing only
-      'bower_components/angular-file-saver/dist/angular-file-saver.bundle.min.js',
-      'bower_components/ngtoast/dist/ngToast.min.js',
-      'bower_components/angular-sanitize/angular-sanitize.min.js',
+      'node_modules/angular-mocks/angular-mocks.js', // testing only
+      'node_modules/angular-file-saver/dist/angular-file-saver.bundle.min.js',
+      'node_modules/ng-toast/dist/ngToast.min.js',
+      'node_modules/angular-sanitize/angular-sanitize.min.js',
       'build/js/ui-bootstrap.min.js',
       'build/js/hotkeys.min.js',
       'build/js/angular-cookies.min.js',
index ef178dd..8d8c49a 100644 (file)
@@ -161,13 +161,6 @@ environment variable `PATH`.
 ------------------------------------------------------------------------------
 % sudo npm install -g grunt-cli
 ------------------------------------------------------------------------------
-+
-3. Install Bower
-+
-[source,sh]
-------------------------------------------------------------------------------
-% sudo npm install -g bower
-------------------------------------------------------------------------------
 
 [[install_files_for_web_staff_client]]
 Install files for web staff client
@@ -186,8 +179,7 @@ cd $EVERGREEN_ROOT/Open-ILS/web/js/ui/default/staff/
 +
 [source,sh]
 ------------------------------------------------------------------------------
-npm install   # fetch Grunt dependencies
-bower install # fetch JS dependencies
+npm install   # fetch JS dependencies
 ------------------------------------------------------------------------------
 +
 3. Run the build script.