LP#1778972: install Bootstrap skin's JS and CSS dependencies using npm
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 10 Sep 2020 15:44:58 +0000 (11:44 -0400)
committerJane Sandberg <sandbej@linnbenton.edu>
Sat, 12 Sep 2020 15:54:08 +0000 (08:54 -0700)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>

Open-ILS/src/templates-bootstrap/opac/parts/base.tt2
Open-ILS/src/templates-bootstrap/opac/parts/js.tt2
Open-ILS/web/opac/deps/package-lock.json [new file with mode: 0644]
Open-ILS/web/opac/deps/package.json [new file with mode: 0644]
build/tools/make_release
docs/modules/installation/pages/server_installation.adoc

index 8c898b5..5346346 100755 (executable)
@@ -10,9 +10,9 @@
         [% END %]
         <meta name = "viewport" content = "initial-scale = 1.0">
         <!--Added bootstrap dependancies-->
-        <link rel="stylesheet" href="[% ctx.media_prefix %]/css/bootstrap/bootstrap.min.css">
-        <link rel="stylesheet"  href="[% ctx.media_prefix %]/css/fontawesome/all.css[% ctx.cache_key %]" />
-        <link rel="stylesheet"  href="[% ctx.media_prefix %]/css/datepicker/bootstrap-datepicker.css[% ctx.cache_key %]" />
+        <link rel="stylesheet" href="[% ctx.media_prefix %]/opac/deps/node_modules/bootstrap/dist/css/bootstrap.min.css[% ctx.cache_key %]">
+        <link rel="stylesheet"  href="[% ctx.media_prefix %]/opac/deps/node_modules/@fortawesome/fontawesome-free/css/all.css[% ctx.cache_key %]" />
+        <link rel="stylesheet"  href="[% ctx.media_prefix %]/opac/deps/node_modules/bootstrap-datepicker/dist/css/bootstrap-datepicker.css[% ctx.cache_key %]" />
         <link rel="stylesheet"  href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto.css[% ctx.cache_key %]" />
         <link rel="stylesheet" href="[% ctx.opac_root %]/css/style.css[% ctx.cache_key %]&amp;dir=[%
           IF ctx.get_i18n_l(ctx.eg_locale).rtl == 't' %]rtl[%
@@ -51,7 +51,7 @@
             [% INCLUDE 'opac/parts/goog_analytics.tt2' %]
         [% END %]
         [% PROCESS 'opac/parts/stripe.tt2' %]
-<script  src="[% ctx.media_prefix %]/js/bootstrap/jquery-3.5.1.min.js"></script>
+<script  src="[% ctx.media_prefix %]/opac/deps/node_modules/jquery/dist/jquery.min.js"></script>
 
 
     </head>
index 488c95b..6c86409 100755 (executable)
@@ -176,16 +176,13 @@ var aou_hash = {
 <link rel="stylesheet" href="[% ctx.media_prefix %]/js/ui/default/common/build/js/glide/css/glide.core.min.css[% ctx.cache_key %]">
 <link rel="stylesheet" href="[% ctx.media_prefix %]/js/ui/default/common/build/js/glide/css/glide.theme.min.css[% ctx.cache_key %]">
 <!-- JS imports, etc.  -->
-<script  src="[% ctx.media_prefix %]/js/bootstrap/jquery-3.5.1.min.js"></script>
-
-<script src="[% ctx.media_prefix %]/js/bootstrap/popper.min.js"></script>
-
-<script src="[% ctx.media_prefix %]/js/bootstrap/bootstrap.min.js"></script>
-
-<script  src="[% ctx.media_prefix %]/js/datepicker/bootstrap-datepicker.js"></script>
+<script  src="[% ctx.media_prefix %]/opac/deps/node_modules/jquery/dist/jquery.min.js[% ctx.cache_key %]"></script>
+<script src="[% ctx.media_prefix %]/opac/deps/node_modules/popper.js/dist/umd/popper.min.js[% ctx.cache_key %]"></script>
+<script src="[% ctx.media_prefix %]/opac/deps/node_modules/bootstrap/dist/js/bootstrap.min.js[% ctx.cache_key %]"></script>
+<script  src="[% ctx.media_prefix %]/opac/deps/node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js[% ctx.cache_key %]"></script>
 
   <script>
     $(document).ready(function(){
     $('[data-toggle="tooltip"]').tooltip();
     });
-</script>
\ No newline at end of file
+</script>
diff --git a/Open-ILS/web/opac/deps/package-lock.json b/Open-ILS/web/opac/deps/package-lock.json
new file mode 100644 (file)
index 0000000..efeefb7
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "name": "evg-opac-depes",
+  "version": "1.0.0",
+  "lockfileVersion": 1,
+  "requires": true,
+  "dependencies": {
+    "@fortawesome/fontawesome-free": {
+      "version": "5.14.0",
+      "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.14.0.tgz",
+      "integrity": "sha512-OfdMsF+ZQgdKHP9jUbmDcRrP0eX90XXrsXIdyjLbkmSBzmMXPABB8eobUJtivaupucYaByz6WNe1PI1JuYm3qA=="
+    },
+    "bootstrap": {
+      "version": "4.3.1",
+      "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.3.1.tgz",
+      "integrity": "sha512-rXqOmH1VilAt2DyPzluTi2blhk17bO7ef+zLLPlWvG494pDxcM234pJ8wTc/6R40UWizAIIMgxjvxZg5kmsbag=="
+    },
+    "bootstrap-datepicker": {
+      "version": "1.9.0",
+      "resolved": "https://registry.npmjs.org/bootstrap-datepicker/-/bootstrap-datepicker-1.9.0.tgz",
+      "integrity": "sha512-9rYYbaVOheGYxjOr/+bJCmRPihfy+LkLSg4fIFMT9Od8WwWB/MB50w0JO1eBgKUMbb7PFHQD5uAfI3ArAxZRXA==",
+      "requires": {
+        "jquery": ">=1.7.1 <4.0.0"
+      }
+    },
+    "jquery": {
+      "version": "3.5.1",
+      "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
+      "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
+    },
+    "popper.js": {
+      "version": "1.12.9",
+      "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.12.9.tgz",
+      "integrity": "sha1-DfvC3/lsRRuzMu3Pz6r1ZtMx1bM="
+    }
+  }
+}
diff --git a/Open-ILS/web/opac/deps/package.json b/Open-ILS/web/opac/deps/package.json
new file mode 100644 (file)
index 0000000..56ee678
--- /dev/null
@@ -0,0 +1,20 @@
+{
+  "name": "evg-opac-depes",
+  "version": "1.0.0",
+  "description": "Dependencies for Evergreen OPAC skins",
+  "main": "index.js",
+  "dependencies": {
+    "bootstrap": "~4.3.0",
+    "bootstrap-datepicker": "^1.9.0",
+    "@fortawesome/fontawesome-free": "^5.14.0",
+    "jquery": "~3.5.1",
+    "popper.js": "~1.12.9"
+  },
+  "devDependencies": {},
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "Evergreen Project",
+  "license": "GPL-2.0-or-later",
+  "private": true
+}
index 1b7b5e1..19d1cf9 100755 (executable)
@@ -345,6 +345,12 @@ if [ "$BUILD_BROWSER_CLIENT" == "YES" ]; then
     rm -r node_modules 
     cd ../../../../../ # Open-ILS dir
 
+    # OPAC dependencies
+    cd web/opac/deps
+    npm install # fetch dependencies
+    # and leave them in node_modules; there's no build step
+    cd ../../.. # Open-ILS dir
+
     # Angular staff client
     echo "Building Angular browser staff client"
     cd src/eg2
@@ -353,6 +359,7 @@ if [ "$BUILD_BROWSER_CLIENT" == "YES" ]; then
     # npm cache is big and unnecessary in the final build. remove it.
     rm -rf node_modules 
     cd ../../../../ # release dir
+
 else
     echo "Skipping browser client build"
     cd ../../../../
index 44607b8..af4eb0d 100644 (file)
@@ -190,6 +190,26 @@ ng build --prod
 CHROME_BIN=/path/to/chrome npm run test
 ------------------------------------------------------------------------------
 
+[[install_opac_deps]]
+=== Install OPAC skin dependencies ===
+
+1. The following steps take place within the OPAC dependencies root:
++
+[source,sh]
+------------------------------------------------------------------------------
+cd $EVERGREEN_ROOT/Open-ILS/web/opac/deps
+------------------------------------------------------------------------------
++
+2. Install Project-local Dependencies. npm inspects the 'package.json' file
+   for dependencies and fetches them from the Node package network.
++
+[source,sh]
+------------------------------------------------------------------------------
+npm install   # fetch JS and CSS dependencies
+------------------------------------------------------------------------------
++
+Note that there is no build step.
+
 == Configuration and compilation instructions ==
 
 For the time being, we are still installing everything in the `/openils/`